cascardo/linux.git
11 years agoiwlwifi: provide RX page order
Emmanuel Grumbach [Wed, 23 Jan 2013 08:59:29 +0000 (10:59 +0200)]
iwlwifi: provide RX page order

When the pages are to be used by front-end, it may need
to know the page order, provide it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: update copyright
Johannes Berg [Mon, 21 Jan 2013 20:39:26 +0000 (21:39 +0100)]
iwlwifi: update copyright

Update Copyright notices to 2013.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoBluetooth: Add support for reading LE supported states
Johan Hedberg [Tue, 22 Jan 2013 12:02:01 +0000 (14:02 +0200)]
Bluetooth: Add support for reading LE supported states

The LE supported states indicate the states and state combinations that
the link layer supports. This is important information for knowing what
operations are possible when dealing with multiple connected devices.
This patch adds reading of the supported states to the HCI init
sequence.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add support for reading LE White List Size
Johan Hedberg [Tue, 22 Jan 2013 12:02:00 +0000 (14:02 +0200)]
Bluetooth: Add support for reading LE White List Size

The LE White List Size is necessary to be known before attempting to
feed the controller with any addresses intended for the white list. This
patch adds the necessary HCI command sending to the HCI init sequence.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add LE Local Features reading support
Johan Hedberg [Tue, 22 Jan 2013 12:01:59 +0000 (14:01 +0200)]
Bluetooth: Add LE Local Features reading support

To be able to make the appropriate decisions for some LE procedures we
need to know the LE features that the local controller supports.
Therefore, it's important to have the LE Read Local Supported Features
HCI comand as part of the HCI init sequence.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix returning proper cmd_complete for mgmt_block/unblock
Johan Hedberg [Sun, 20 Jan 2013 12:27:22 +0000 (14:27 +0200)]
Bluetooth: Fix returning proper cmd_complete for mgmt_block/unblock

The Block/Unblock Device Management commands should return Command
Complete instead of Command Status whenever possible so that user space
can distinguish exactly which command failed in the case of multiple
commands. This patch does the necessary changes in the command handler
to return the right event to user space.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix returning proper cmd_complete for mgmt_disconnect
Johan Hedberg [Sun, 20 Jan 2013 12:27:21 +0000 (14:27 +0200)]
Bluetooth: Fix returning proper cmd_complete for mgmt_disconnect

The Disconnect Management command should return Command Complete instead
of Command Status whenever possible so that user space can distinguish
exactly which command failed in the case of multiple commands. This
patch does the necessary changes in the disconnect command handler to
return the right event to user space.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix checking for valid disconnect parameters in unpair_device
Johan Hedberg [Sun, 20 Jan 2013 12:27:20 +0000 (14:27 +0200)]
Bluetooth: Fix checking for valid disconnect parameters in unpair_device

The valid values for the Disconnect parameter in the Unpair Device
command are 0x00 and 0x01. If any other value is encountered the command
should fail with the appropriate invalid params response.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix checking for valid address type values in mgmt commands
Johan Hedberg [Sun, 20 Jan 2013 12:27:19 +0000 (14:27 +0200)]
Bluetooth: Fix checking for valid address type values in mgmt commands

This patch adds checks for valid address type values passed to mgmt
commands. If an invalid address type is encountered the code will return
a proper invalid params response.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add helper functions for testing bdaddr types
Johan Hedberg [Sun, 20 Jan 2013 12:27:18 +0000 (14:27 +0200)]
Bluetooth: Add helper functions for testing bdaddr types

This patch adds two helper functions to test for valid bdaddr type
values. These will be particularely useful in the mgmt code to check
that user space has passed valid values to the kernel.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Check for valid key->authenticated value for LTKs
Johan Hedberg [Sun, 20 Jan 2013 12:27:17 +0000 (14:27 +0200)]
Bluetooth: Check for valid key->authenticated value for LTKs

This patch adds necessary checks for the two allowed values of the
authenticated parameter of each Long Term Key, i.e. 0x00 and 0x01. If
any other value is encountered the valid response is to return invalid
params to user space.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Refactor valid LTK data testing into its own function
Johan Hedberg [Sun, 20 Jan 2013 12:27:16 +0000 (14:27 +0200)]
Bluetooth: Refactor valid LTK data testing into its own function

This patch refactors valid LTK data testing into its own function. This
will help keep the code readable since there are several tests still
missing that need to be done on the LTK data.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix checking for proper key->master value in Load LTKs
Johan Hedberg [Sun, 20 Jan 2013 12:27:15 +0000 (14:27 +0200)]
Bluetooth: Fix checking for proper key->master value in Load LTKs

The allowed values for the key->master parameter in the Load LTKs
command are 0x00 and 0x01. If there is a key in the list with some other
value the command should fail with a proper invalid params response.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix returning proper mgmt status for Load LTKs
Johan Hedberg [Sun, 20 Jan 2013 12:27:14 +0000 (14:27 +0200)]
Bluetooth: Fix returning proper mgmt status for Load LTKs

Failures of mgmt commands should be indicated with valid mgmt status
codes, and EINVAL is not one of them. Instead MGMT_STATUS_INVALID_PARAMS
should be returned.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix checking for correct mgmt_load_link_keys parameters
Johan Hedberg [Sun, 20 Jan 2013 12:27:13 +0000 (14:27 +0200)]
Bluetooth: Fix checking for correct mgmt_load_link_keys parameters

The debug_keys parameter is only allowed to have the values 0x00 and
0x01. Any other value should result in a proper command status with
MGMT_STATUS_INVALID_PARAMS.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix pair device command reply if adapter is powered off
Szymon Janc [Fri, 18 Jan 2013 11:48:07 +0000 (12:48 +0100)]
Bluetooth: Fix pair device command reply if adapter is powered off

According to Bluetooth Management API specification Pair Device Command
should generate command complete event on both success and failure.
This fix replying with command status (which lacks address info) when
adapter is powered off.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix Class of Device indication when powering off
Johan Hedberg [Wed, 16 Jan 2013 14:15:34 +0000 (16:15 +0200)]
Bluetooth: Fix Class of Device indication when powering off

When a HCI device is powered off the Management interface specification
dictates that the class of device value is indicated as zero. This patch
fixes sending of the appropriate class of device changed event when a
HCI device is powered off.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoath9k_hw: remove a useless WARN_ON
Felix Fietkau [Sun, 20 Jan 2013 17:51:59 +0000 (18:51 +0100)]
ath9k_hw: remove a useless WARN_ON

&ah->curchan->ani can never be NULL

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: reduce struct ar5416AniState size
Felix Fietkau [Sun, 20 Jan 2013 17:51:58 +0000 (18:51 +0100)]
ath9k_hw: reduce struct ar5416AniState size

It is kept per-channel, so removing unnecessary (or constant) fields from
it can save quite a bit of memory.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: remove ath9k_hw_ani_setup and its variables
Felix Fietkau [Sun, 20 Jan 2013 17:51:57 +0000 (18:51 +0100)]
ath9k_hw: remove ath9k_hw_ani_setup and its variables

They are no longer needed for ANI functionality

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: make the initval parameter to ath9k_hw_write_array const
Felix Fietkau [Sun, 20 Jan 2013 17:51:55 +0000 (18:51 +0100)]
ath9k_hw: make the initval parameter to ath9k_hw_write_array const

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: use ath_tx_process_buffer instead of open-coding similar code
Felix Fietkau [Sun, 20 Jan 2013 17:51:54 +0000 (18:51 +0100)]
ath9k: use ath_tx_process_buffer instead of open-coding similar code

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: clean up processing of pending tx frames on reset
Felix Fietkau [Sun, 20 Jan 2013 17:51:53 +0000 (18:51 +0100)]
ath9k: clean up processing of pending tx frames on reset

Dropping packets from aggregation sessions is usually not a good idea, as
it might upset the synchronization of the BlockAck receive window of the
remote node. The use of the retry_tx parameter to reset/tx-drain functions
also seemed a bit arbitrary.
This patch removes this parameter altogether and ensures that pending tx
frames are not dropped for no good reason.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: stop rx after tx
Felix Fietkau [Sun, 20 Jan 2013 17:51:52 +0000 (18:51 +0100)]
ath9k: stop rx after tx

Completing frame transmission can fail if the rx engine is stopped
prematurely, as the hw might be waiting for an ACK from the other side.
Shutting down tx before rx might make the DMA shutdown more reliable.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agonet: wireless/rtlwifi: fix uninitialized variable issue
Cong Ding [Sat, 19 Jan 2013 12:56:36 +0000 (13:56 +0100)]
net: wireless/rtlwifi: fix uninitialized variable issue

The use of variable packet_beacon might be uninitialized in the three files.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: don't return zero on failure paths in il4965_pci_probe()
Alexey Khoroshilov [Sat, 19 Jan 2013 12:56:34 +0000 (16:56 +0400)]
iwlegacy: don't return zero on failure paths in il4965_pci_probe()

If hardware is not ready, il4965_pci_probe() breaks off initialization,
deallocates all resources, but returns zero.
The patch adds -EIO as return value in this case.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwl8k: don't return zero on failure paths in mwl8k_probe[_hw]()
Alexey Khoroshilov [Fri, 18 Jan 2013 21:24:01 +0000 (01:24 +0400)]
mwl8k: don't return zero on failure paths in mwl8k_probe[_hw]()

If pci_iomap() fails in mwl8k_probe(), it breaks off initialization,
deallocates all resources, but returns zero.
There is a similar issue when priv->rxd_ops is NULL in mwl8k_probe_hw().

The patch adds proper error code return values.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: correction in status codes used for association failure
Amitkumar Karwar [Fri, 18 Jan 2013 01:41:57 +0000 (17:41 -0800)]
mwifiex: correction in status codes used for association failure

When AP responds with appropriate status code, we forward that
code correctly to cfg80211. But sometimes when there is no
response from AP, our firmware uses proprietary status codes.
We will map authentication timeout to WLAN_STATUS_AUTH_TIMEOUT
and other proprietary codes to WLAN_STATUS_UNSPECIFIED_FAILURE.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Improve TX status handling for BlockAckReq frames
Helmut Schaa [Thu, 17 Jan 2013 16:34:32 +0000 (17:34 +0100)]
rt2x00: Improve TX status handling for BlockAckReq frames

Since rt2800 hardware isn't capable of reporting the TX status of
BlockAckReq frames implement the TX status handling of BARs in
rt2x00lib. We keep track of all BARs that are send out and try to
match incoming BAs to the appropriate BARs. This allows us to report a
more or less accurate TX status for BAR frames which in turn improves
BA session stability.

This is loosley based on Christian Lamparter's patch for carl9170
"carl9170: fix HT peer BA session corruption".

We have to walk the list of pending BARs for every rx'red BA even
though most BAs don't belong to any of these BARs as they are just
acknowledging an AMPDU. To keep that overhead low use RCU which allows
us to walk the list of pending BARs without the need to acquire a lock.
This however requires us to _copy_ relevant information from the BAR
(RA, TA, control field, start sequence number) into our BAR list entry.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Tested-by: Andreas Hartmann <andihartmann@01019freenet.de>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoprism54: bug in getting auth type
Dan Carpenter [Sun, 13 Jan 2013 20:03:42 +0000 (23:03 +0300)]
prism54: bug in getting auth type

There is a missing break statement so SHARED_KEY authentication doesn't
work.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: N-PHY: fix gain in b43_nphy_get_gain_ctl_workaround_ent()
Dan Carpenter [Sun, 20 Jan 2013 16:31:30 +0000 (19:31 +0300)]
b43: N-PHY: fix gain in b43_nphy_get_gain_ctl_workaround_ent()

There were no break statements in this switch statement so everything
used the default settings.  Per Walter Harms's suggestion, I've replaced
the switch statement and done a little cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agodrivers/net/wireless: need consider the not '\0' terminated string.
Chen Gang [Tue, 8 Jan 2013 05:33:03 +0000 (13:33 +0800)]
drivers/net/wireless: need consider the not '\0' terminated string.

  in ray_cs.c:
    the a_current_ess_id is "Null terminated unless ESSID_SIZE long"
    so we need buffer it with '\0' firstly, before using strlen or %s.

  additional information:
    in drivers/net/wireless/rayctl.h:
      "NULL terminated unless 32 long" is a comment at line 616, 664
      ESSID_SIZE is 32, at line 190
    in include/uapi/linux/wireless.h:
      IW_ESSID_MAX_SIZE is also 32
    in drivers/net/wireless/ray_cs.c:
      use strncpy for it, without '\0' terminated, at line 639
      use memcpy for it, assume not '\0' terminated in line 1092..1097
      buffer it with '\0' firstly, before using %s, in line 2576, 2598..2600

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: fix RF bank initialization
Felix Fietkau [Sun, 13 Jan 2013 18:54:58 +0000 (19:54 +0100)]
ath9k_hw: fix RF bank initialization

ar900*_init_mode_regs needs to be called before RF banks are allocated,
otherwise the storage size of RF banks isn't known. This patch fixes
a memory overrun that can show up as a crash on unloading the module.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Tue, 22 Jan 2013 20:40:56 +0000 (15:40 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Tue, 22 Jan 2013 20:39:51 +0000 (15:39 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

11 years agomwifiex: fix typo in PCIe adapter NULL check
Avinash Patil [Tue, 22 Jan 2013 05:04:10 +0000 (21:04 -0800)]
mwifiex: fix typo in PCIe adapter NULL check

Add missing "!" as we are supposed to check "!card->adapter"
in PCIe suspend handler.

Cc: "3.2+" <stable@vger.kernel.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Sergey V. <sftp.mtuci@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: allow setting arbitrary antenna masks on AR9003+
Felix Fietkau [Sun, 20 Jan 2013 20:55:22 +0000 (21:55 +0100)]
ath9k: allow setting arbitrary antenna masks on AR9003+

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: fix chain swap setting when setting rx chainmask to 5
Felix Fietkau [Sun, 20 Jan 2013 20:55:21 +0000 (21:55 +0100)]
ath9k_hw: fix chain swap setting when setting rx chainmask to 5

Chain swapping should only be enabled when the EEPROM chainmask is set to 5,
regardless of what the runtime chainmask is.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: fix calibration issues on chainmask that don't include chain 0
Felix Fietkau [Sun, 20 Jan 2013 20:55:20 +0000 (21:55 +0100)]
ath9k_hw: fix calibration issues on chainmask that don't include chain 0

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: Fix build warning introduced by commit a290593
Larry Finger [Sat, 19 Jan 2013 18:36:49 +0000 (12:36 -0600)]
rtlwifi: Fix build warning introduced by commit a290593

The kbuild test robot reports the following warning with x86_64-randconfig-x955:

warning: (RTL8192CE && RTL8192SE && RTL8192DE && RTL8723AE && RTL8192CU) selects
 RTLWIFI which has unmet direct dependencies (NETDEVICES && WLAN &&
 (RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE))

This warning was introduced in commit a290593, "rtlwifi: Modify files for addition
of rtl8723ae", and is d ue to a missing dependence of RTLWIFI on RTL8723AE.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: kbuild test robot <fengguang.wu@intel.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: fix IBSS cleanup
Stanislaw Gruszka [Wed, 16 Jan 2013 10:45:15 +0000 (11:45 +0100)]
iwlegacy: fix IBSS cleanup

We do not correctly change interface type when switching from
IBSS mode to STA mode, that results in microcode errors.

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=886946

Reported-by: Jaroslav Skarvada <jskarvad@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
John W. Linville [Tue, 22 Jan 2013 19:23:13 +0000 (14:23 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Tue, 22 Jan 2013 19:22:01 +0000 (14:22 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-fixes

11 years agomac80211: allow drivers to access IPv6 information
Johannes Berg [Mon, 14 Jan 2013 14:14:34 +0000 (15:14 +0100)]
mac80211: allow drivers to access IPv6 information

To be able to implement NS response offloading (in
regular operation or while in WoWLAN) drivers need
to know the IPv6 addresses assigned to interfaces.
Implement an IPv6 notifier in mac80211 to call the
driver when addresses change.

Unlike for IPv4, implement it as a callback rather
than as a list in the BSS configuration, that is
more flexible.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: improve aggregation debug messages
Johannes Berg [Wed, 16 Jan 2013 09:39:44 +0000 (10:39 +0100)]
mac80211: improve aggregation debug messages

A lot of the aggregation messages don't indicate the
station so they're hard to understand if there are
multiple sessions in progress. Make that easier by
adding the MAC address to most messages. Also add
the TID if it wasn't already there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove ARP filter enable/disable logic
Johannes Berg [Mon, 14 Jan 2013 15:39:07 +0000 (16:39 +0100)]
mac80211: remove ARP filter enable/disable logic

Depending on the driver, having ARP filtering for
some addresses may be possible. Remove the logic
that tracks whether ARP filter is enabled or not
and give the driver the total number of addresses
instead of the length of the list so it can make
its own decision.

Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add op to configure default key id
Yoni Divinsky [Wed, 30 May 2012 08:36:39 +0000 (11:36 +0300)]
mac80211: add op to configure default key id

There are hardwares which support offload of data packets
for example when auto ARP is enabled the hw will send
the ARP response. In such cases if WEP encryption is
configured the hw must know the default WEP key in order
to encrypt the packets correctly.

When hw_accel is enabled and encryption type is set to WEP,
the driver should get the default key index from mac80211.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
[cleanups, fixes, documentation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoMerge branch 'wl12xx-next' into for-linville
Luciano Coelho [Fri, 18 Jan 2013 07:40:07 +0000 (09:40 +0200)]
Merge branch 'wl12xx-next' into for-linville

Conflicts:
drivers/net/wireless/ti/wl12xx/main.c
drivers/net/wireless/ti/wlcore/wlcore.h

11 years agoBluetooth: Fix using system-global workqueue when not necessary
Johan Hedberg [Mon, 14 Jan 2013 20:33:52 +0000 (22:33 +0200)]
Bluetooth: Fix using system-global workqueue when not necessary

There's a per-HCI device workqueue (hdev->workqueue) that should be used
for general per-HCI device work (except hdev->req_workqueue that's for
hci_request() related work). This patch fixes places using the
system-global work queue and makes them use the hdev->workqueue instead.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Use req_workqueue for hci_request operations
Johan Hedberg [Mon, 14 Jan 2013 20:33:51 +0000 (22:33 +0200)]
Bluetooth: Use req_workqueue for hci_request operations

This patch converts work assignment relying on hci_request() from the
system-global work queue to the per-HCI device specific work queue
(hdev->req_workqueue) intended for hci_request() related tasks.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add a new workqueue for hci_request operations
Johan Hedberg [Mon, 14 Jan 2013 20:33:50 +0000 (22:33 +0200)]
Bluetooth: Add a new workqueue for hci_request operations

The hci_request function is blocking and cannot be called through the
usual per-HCI device workqueue (hdev->workqueue). While hci_request is
in progress any other work from the queue, including sending HCI
commands to the controller would be blocked and eventually cause the
hci_request call to time out.

This patch adds a second workqueue to be used by operations needing
hci_request and thereby avoiding issues with blocking other workqueue
users.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agomac80211: split out chandef tracing macros
Johannes Berg [Fri, 21 Dec 2012 11:36:33 +0000 (12:36 +0100)]
mac80211: split out chandef tracing macros

Some new APIs will require tracing a chandef without
it being part of a channel context, so separate out
the tracing macros for that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: check radar interface combinations
Simon Wunderlich [Tue, 8 Jan 2013 13:04:07 +0000 (14:04 +0100)]
cfg80211: check radar interface combinations

To ease further DFS development regarding interface combinations, use
the interface combinations structure to test for radar capabilities.
Drivers can specify which channel widths they support, and in which
modes. Right now only a single AP interface is allowed, but as the
DFS code evolves other combinations can be enabled.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: Allow use_mfp to be specified with the connect command
Jouni Malinen [Tue, 15 Jan 2013 15:15:57 +0000 (17:15 +0200)]
cfg80211: Allow use_mfp to be specified with the connect command

The NL80211_ATTR_USE_MFP attribute was originally added for
NL80211_CMD_ASSOCIATE, but it is actually as useful (if not even more
useful) with NL80211_CMD_CONNECT, so process that attribute with the
connect command, too.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add encrypt headroom to PERR frames
Bob Copeland [Wed, 9 Jan 2013 17:34:56 +0000 (12:34 -0500)]
mac80211: add encrypt headroom to PERR frames

Mesh PERR action frames are robust and thus may be encrypted, so add
proper head/tailroom to allow this.  Fixes this warning when operating
a Mesh STA on ath5k:

WARNING: at net/mac80211/wpa.c:427 ccmp_encrypt_skb.isra.5+0x7b/0x1a0 [mac80211]()
Call Trace:
 [<c011c5e7>] warn_slowpath_common+0x63/0x78
 [<c011c60b>] warn_slowpath_null+0xf/0x13
 [<e090621d>] ccmp_encrypt_skb.isra.5+0x7b/0x1a0 [mac80211]
 [<e090685c>] ieee80211_crypto_ccmp_encrypt+0x1f/0x37 [mac80211]
 [<e0917113>] invoke_tx_handlers+0xcad/0x10bd [mac80211]
 [<e0917665>] ieee80211_tx+0x87/0xb3 [mac80211]
 [<e0918932>] ieee80211_tx_pending+0xcc/0x170 [mac80211]
 [<c0121c43>] tasklet_action+0x3e/0x65

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: set NEED_TXPROCESSING for PERR frames
Bob Copeland [Wed, 9 Jan 2013 17:34:55 +0000 (12:34 -0500)]
mac80211: set NEED_TXPROCESSING for PERR frames

A user reported warnings in ath5k due to transmitting frames with no
rates set up.  The frames were Mesh PERR frames, and some debugging
showed an empty control block with just the vif pointer:

>  [  562.522682] XXX txinfo: 00000000: 00 00 00 00 00 00 00 00 00 00 00
>  00 00 00 00 00  ................
>  [  562.522688] XXX txinfo: 00000010: 00 00 00 00 00 00 00 00 54 b8 f2
>  db 00 00 00 00  ........T.......
>  [  562.522693] XXX txinfo: 00000020: 00 00 00 00 00 00 00 00 00 00 00
>  00 00 00 00 00  ................

Set the IEEE80211_TX_INTFL_NEED_TXPROCESSING flag to ensure that
rate control gets run before the frame is sent.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: allow user-space to set address for P2P_DEVICE
Arend van Spriel [Tue, 8 Jan 2013 09:17:27 +0000 (10:17 +0100)]
nl80211: allow user-space to set address for P2P_DEVICE

As per email discussion Jouni Malinen pointed out that:

"P2P message exchanges can be executed on the current operating channel
of any operation (both P2P and non-P2P station). These can be on 5 GHz
and even on 60 GHz (so yes, you _can_ do GO Negotiation on 60 GHz).

As an example, it would be possible to receive a GO Negotiation Request
frame on a 5 GHz only radio and then to complete GO Negotiation on that
band. This can happen both when connected to a P2P group (through client
discoverability mechanism) and when connected to a legacy AP (assuming
the station receive Probe Request frame from full scan in the beginning
of P2P device discovery)."

This means that P2P messages can be sent over different radio devices.
However, these should use the same P2P device address so it should be
able to provision this from user-space. This patch adds a parameter for
this to struct vif_params which should only be used during creation of
the P2P device interface.

Cc: Jouni Malinen <j@w1.fi>
Cc: Greg Goldman <ggoldman@broadcom.com>
Cc: Jithu Jance <jithu@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
[add error checking]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years ago{cfg,nl}80211: mesh power mode primitives and userspace access
Marco Porsch [Mon, 7 Jan 2013 15:04:52 +0000 (16:04 +0100)]
{cfg,nl}80211: mesh power mode primitives and userspace access

Add the nl80211_mesh_power_mode enumeration which holds possible
values for the mesh power mode. These modes are unknown, active,
light sleep and deep sleep.

Add power_mode entry to the mesh config structure to hold the
user-configured default mesh power mode. This value will be used
for new peer links.

Add the dot11MeshAwakeWindowDuration value to the mesh config.
The awake window is a duration in TU describing how long the STA
will stay awake after transmitting its beacon in PS mode.

Add access routines to:
 - get/set local link-specific power mode (STA)
 - get remote STA's link-specific power mode (STA)
 - get remote STA's non-peer power mode (STA)
 - get/set default mesh power mode (mesh config)
 - get/set mesh awake window duration (mesh config)

All config changes may be done at mesh runtime and take effect
immediately.

Signed-off-by: Marco Porsch <marco@cozybit.com>
Signed-off-by: Ivan Bezyazychnyy <ivan.bezyazychnyy@gmail.com>
Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
[fix commit message line length, error handling in set station]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years ago{cfg,nl,mac}80211: set beacon interval and DTIM period on mesh join
Marco Porsch [Mon, 7 Jan 2013 15:04:51 +0000 (16:04 +0100)]
{cfg,nl,mac}80211: set beacon interval and DTIM period on mesh join

Move the default mesh beacon interval and DTIM period to cfg80211
and make them accessible to nl80211. This enables setting both
values when joining an MBSS.

Previously the DTIM parameter was not set by mac80211 so the
driver's default value was used.

Signed-off-by: Marco Porsch <marco@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: move add_tim to subfunction
Marco Porsch [Mon, 7 Jan 2013 15:04:50 +0000 (16:04 +0100)]
mac80211: move add_tim to subfunction

This functions will be used for mesh beacons, too.

Signed-off-by: Marco Porsch <marco@cozybit.com>
[some formatting fixes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: update mesh peer link counter during userspace peering
Marco Porsch [Mon, 7 Jan 2013 15:04:49 +0000 (16:04 +0100)]
mac80211: update mesh peer link counter during userspace peering

The established peer link count is indicated in mesh beacons and
used for other internal tasks. Previously it was not updated when
authenticated peering is performed in userspace.

Signed-off-by: Marco Porsch <marco@cozybit.com>
Acked-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: add range checks to mesh parameters
Marco Porsch [Mon, 7 Jan 2013 15:04:48 +0000 (16:04 +0100)]
nl80211: add range checks to mesh parameters

Ranges are taken from IEEE 802.11-2012, common sense or current
implementation requirements.

Signed-off-by: Marco Porsch <marco@cozybit.com>
Acked-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: allow disable power save in mesh
Chun-Yeow Yeoh [Thu, 10 Jan 2013 15:31:54 +0000 (23:31 +0800)]
mac80211: allow disable power save in mesh

Allow mesh interface to disable the power save which is by default
turn on in certain chipset. Testing with 2 units of ZCN-1523H-5-16
featuring AR9280 chipset which have power save enabled by default.
Constant reset if the average signal of the peer mesh STA is below
-80 dBm and power save is enabled.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: call restart complete at wowlan resume time
Johannes Berg [Thu, 10 Jan 2013 23:28:01 +0000 (00:28 +0100)]
mac80211: call restart complete at wowlan resume time

When the driver's resume function can't completely
restore the configuration in the device, it returns
1 from the callback which will be treated like a HW
restart request, but done directly.

In this case, also call the driver's restart_complete()
function so it can finish the reconfiguration there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix resume from WoWLAN
Johannes Berg [Thu, 10 Jan 2013 22:55:33 +0000 (23:55 +0100)]
mac80211: fix resume from WoWLAN

My commit 529ba6e9313dbe60dab7e72c6fdf647a012e9f5b
("mac80211: clean up association better in suspend")
introduced a bug when resuming from WoWLAN when a
device reset is desired. This case must not use the
suspend_bss_conf as it hasn't been stored.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years ago{cfg,mac}80211.h: fix some kernel-doc warnings
Yacine Belkadi [Sat, 12 Jan 2013 12:54:14 +0000 (13:54 +0100)]
{cfg,mac}80211.h: fix some kernel-doc warnings

When building the 80211 DocBook, scripts/kernel-doc reports
the following type of warnings:

Warning(include/net/cfg80211.h:334): No description found for return value of 'cfg80211_get_chandef_type'

These warnings are only reported when scripts/kernel-doc
runs in verbose mode.

To fix these use "Return:" to describe function return values.

Signed-off-by: Yacine Belkadi <yacine.belkadi.1@gmail.com>
[adjust for freq_reg_info() change]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix monitor mode injection
Felix Fietkau [Sun, 13 Jan 2013 22:10:26 +0000 (23:10 +0100)]
mac80211: fix monitor mode injection

Channel contexts are not always used with monitor interfaces. If no channel
context is set, use the oper channel, otherwise tx fails.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
[check local->use_chanctx]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: synchronize scan off/on-channel and PS states
Stanislaw Gruszka [Thu, 20 Dec 2012 13:41:18 +0000 (14:41 +0100)]
mac80211: synchronize scan off/on-channel and PS states

Since:

commit b23b025fe246f3acc2988eb6d400df34c27cb8ae
Author: Ben Greear <greearb@candelatech.com>
Date:   Fri Feb 4 11:54:17 2011 -0800

    mac80211: Optimize scans on current operating channel.

we do not disable PS while going back to operational channel (on
ieee80211_scan_state_suspend) and deffer that until scan finish.
But since we are allowed to send frames, we can send a frame to AP
without PM bit set, so disable PS on AP side. Then when we switch
to off-channel (in ieee80211_scan_state_resume) we do not enable PS.
Hence we are off-channel with PS disabled, frames are not buffered
by AP.

To fix remove offchannel_ps_disable argument and always enable PS when
going off-channel and disable it when going on-channel, like it was
before.

Cc: stable@vger.kernel.org # 2.6.39+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Tested-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix FT roaming
Johannes Berg [Fri, 11 Jan 2013 13:34:25 +0000 (14:34 +0100)]
mac80211: fix FT roaming

During FT roaming, wpa_supplicant attempts to set the
key before association. This used to be rejected, but
as a side effect of my commit 66e67e418908442389d3a9e
("mac80211: redesign auth/assoc") the key was accepted
causing hardware crypto to not be used for it as the
station isn't added to the driver yet.

It would be possible to accept the key and then add it
to the driver when the station has been added. However,
this may run into issues with drivers using the state-
based station adding if they accept the key only after
association like it used to be.

For now, revert to the behaviour from before the auth
and assoc change.

Cc: stable@vger.kernel.org
Reported-by: Cédric Debarge <cedric.debarge@acksys.fr>
Tested-by: Cédric Debarge <cedric.debarge@acksys.fr>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: improve the reports in TX path
Emmanuel Grumbach [Wed, 2 Jan 2013 10:12:25 +0000 (12:12 +0200)]
iwlwifi: improve the reports in TX path

Also when things go wrong (queues don't get emtpy), try to
get some data from the HW.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: audit single frames from AGG queue in RS
Emmanuel Grumbach [Wed, 9 Jan 2013 08:20:36 +0000 (10:20 +0200)]
iwlwifi: audit single frames from AGG queue in RS

The rate scaling won't treat the information in a frame
with IEEE80211_TX_CTL_AMPDU set if IEEE80211_TX_STAT_AMPDU
is cleared. But all the frames coming from an AGG tx queue
have IEEE80211_TX_CTL_AMPDU set, and IEEE80211_TX_STAT_AMPDU
is set only if the frame was sent in an AMPDU.
This means that all the data in frames in AGG tx queues that
aren't sent as an AMPDU is thrown away.
This is even more harmful when in bad link conditions, the
frames are sent in an AMPDU and then finally sent as single
frame. So a lot of failures weren't reported and the rate
scaling got stuck in high rates leading to very poor
connectivity.

Fix that by clearing IEEE80211_TX_CTL_AMPDU when the frame
isn't part of an AMPDU.

This bug was introduced by

2eb81a40aa521035ff9c8c8309e482dff523f8c9
iwlwifi: don't clear CTL_AMPDU on frame status

This fix basically reverts the aforementioned commit.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: enable communication with WoWLAN firmware
Johannes Berg [Tue, 8 Jan 2013 10:25:44 +0000 (11:25 +0100)]
iwlwifi: enable communication with WoWLAN firmware

On resuming, the opmode may have to be able to talk
to the WoWLAN/D3 firmware in order to query it about
its status and wakeup reasons. To do that, the opmode
has to call the new d3_resume() transport API which
will set up the device for command communcation.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: simplify scheduler memory clearing
Johannes Berg [Tue, 8 Jan 2013 23:47:07 +0000 (00:47 +0100)]
iwlwifi: simplify scheduler memory clearing

Writing 130 dwords into the device one by one is
rather inefficient, every one needs to lock, grab
NIC access (a few register reads/writes) and then
write the address and data registers.

Use the new memory clearing function to make this
easier and faster.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: allow to zero SRAM
Emmanuel Grumbach [Wed, 9 Jan 2013 09:37:59 +0000 (11:37 +0200)]
iwlwifi: allow to zero SRAM

Sending a NULL pointer to iwl_trans_write_mem allows now
to zero SRAM.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: don't enable all interrupts on resuming
Johannes Berg [Tue, 8 Jan 2013 09:26:17 +0000 (10:26 +0100)]
iwlwifi: don't enable all interrupts on resuming

Enabling the RF-kill interrupt is sufficient for getting
RF-kill notifications, and no other interrupt is needed
as the device isn't functional when suspended and will be
restarted/reconfigured when mac80211 resumes it later.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: don't memset scalar values
Johannes Berg [Mon, 7 Jan 2013 23:25:21 +0000 (00:25 +0100)]
iwlwifi: don't memset scalar values

The dma_addr_t type is a scalar value, so it should
just be assigned, not memset.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobcma: use consistent case for 'hex' constants
Nathan Hintz [Sat, 12 Jan 2013 10:46:17 +0000 (02:46 -0800)]
bcma: use consistent case for 'hex' constants

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: add support for 1 and 2 byte extended config space access
Nathan Hintz [Sat, 12 Jan 2013 10:46:16 +0000 (02:46 -0800)]
bcma: add support for 1 and 2 byte extended config space access

The sanity checks allow 1 and 2 byte reads/writes of the extended
PCI config space to proceed; however, the code only supports 4
byte reads/writes.  This patch adds support for 1 and 2 byte
reads/writes of the extended PCI config space.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: don't map/unmap a subset of the PCI config space
Nathan Hintz [Sat, 12 Jan 2013 10:46:15 +0000 (02:46 -0800)]
bcma: don't map/unmap a subset of the PCI config space

For PCI config space access offsets < 256 for device '0',
bcma_extpci_write_config performs an 'ioremap_nocache' on a 4 byte
section of the PCI config space (an area that has already
previously been mapped), and then subsequently unmaps that 4 byte
section.  This can't be a good thing for future read access from
that now unmapped location.  Modify the config space writes to use
the existing access functions (similar to how it is done for the reads).

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: jump to 'out' label for invalid 'func' value
Nathan Hintz [Sat, 12 Jan 2013 10:46:14 +0000 (02:46 -0800)]
bcma: jump to 'out' label for invalid 'func' value

Consistently jump to the 'out' label for error conditions (adds
missing check for 'func' validity in bcma_extpci_write_config).

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: delete duplicate readl
Nathan Hintz [Sat, 12 Jan 2013 10:46:13 +0000 (02:46 -0800)]
bcma: delete duplicate readl

The 'val' has already been read by the prior call to 'mips_busprobe32';
this 'readl' is unnecessary.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: fix bcm4716/bcm4748 i2s irqflag
Nathan Hintz [Sat, 12 Jan 2013 06:07:22 +0000 (22:07 -0800)]
bcma: fix bcm4716/bcm4748 i2s irqflag

The default irqflag assignment for the I2S core on some Broadcom
4716/4748 devices is invalid and needs to be corrected (from the
Broadcom SDK).

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: ar9002_hw_spectral_scan_config() can be static
Fengguang Wu [Sat, 12 Jan 2013 02:28:12 +0000 (10:28 +0800)]
ath9k_hw: ar9002_hw_spectral_scan_config() can be static

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-next-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Mon, 14 Jan 2013 20:08:52 +0000 (15:08 -0500)]
Merge tag 'nfc-next-3.9-1' of git://git./linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"This is the first NFC patchset targeted at the 3.9 merge window.

It brings the following goodies:

- LLCP socket timestamping (To be used e.g with the recently released nfctool
  application for a more efficient skb timestamping when sniffing).
- A pretty big pn533 rework from Waldemar, preparing the driver to support
  more flavours of pn533 based devices.
- HCI changes from Eric in preparation for the microread driver support.
- Some LLCP memory leak fixes, cleanups and slight improvements.
- pn544 and nfcwilink move to the devm_kzalloc API.
- An initial Secure Element (SE) API.
- An nfc.h license change from the original author, allowing non GPL
  application code to safely include it."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: disable the tasklet before taking the PCU lock
Felix Fietkau [Mon, 14 Jan 2013 15:56:46 +0000 (16:56 +0100)]
ath9k: disable the tasklet before taking the PCU lock

Fixes a reported CPU soft lockup where the tasklet tries to acquire the
lock and blocks while ath_prepare_reset (holding the lock) waits for it
to complete.

Cc: stable@vger.kernel.org
Reported-by: Robert Shade <robert.shade@gmail.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: remove sc->rx.rxbuflock to fix a deadlock
Felix Fietkau [Mon, 14 Jan 2013 09:50:15 +0000 (10:50 +0100)]
ath9k: remove sc->rx.rxbuflock to fix a deadlock

The commit "ath9k: fix rx flush handling" added a deadlock that happens
because ath_rx_tasklet is called in a section that has already taken the
rx buffer lock.

It seems that the only purpose of the rxbuflock was a band-aid fix to the
reset vs rx tasklet race, which has been properly fixed in the commit
"ath9k: add a better fix for the rx tasklet vs rx flush race".

Now that the fix is in, we can safely remove the lock to avoid such issues.

Cc: stable@vger.kernel.org
Reported-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoNFC: Change nfc.h license
Lauro Ramos Venancio [Thu, 6 Dec 2012 00:12:25 +0000 (21:12 -0300)]
NFC: Change nfc.h license

nfc.h being GPL makes it quite controversial for non GPL applications to
include it.
Moreover, nfc.h only includes structures and API definitions that are hardly
copyrightable.

Signed-off-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agowireless: make the reg_notifier() void
Luis R. Rodriguez [Fri, 11 Jan 2013 18:39:36 +0000 (18:39 +0000)]
wireless: make the reg_notifier() void

The reg_notifier()'s return value need not be checked
as it is only supposed to do post regulatory work and
that should never fail. Any behaviour to regulatory
that needs to be considered before cfg80211 does work
to a driver should be specified by using the already
existing flags, the reg_notifier() just does post
processing should it find it needs to.

Also make lbs_reg_notifier static.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
[move lbs_reg_notifier to not break compile]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoNFC: pn533: Fix bad allocation size
Thierry Escande [Sat, 12 Jan 2013 18:37:12 +0000 (19:37 +0100)]
NFC: pn533: Fix bad allocation size

Use dereferenced pointer in sizeof instead of pointer itself.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agobcma: update pci configuration for bcm4706/bcm4716
Nathan Hintz [Fri, 11 Jan 2013 06:24:03 +0000 (22:24 -0800)]
bcma: update pci configuration for bcm4706/bcm4716

Update the PCI configuration for BCM4706 and BCM4716 per the 2011
Broadcom SDK.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: add tx gain tables for newer devices
Felix Fietkau [Thu, 10 Jan 2013 18:41:52 +0000 (19:41 +0100)]
ath9k_hw: add tx gain tables for newer devices

Improves stability on affected devices and also fixes the Tx IQ calibration
related regression on some AR9340 devices such as the TP-Link TL-WDR4300.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: return the mips irq number in bcma_core_irq
Nathan Hintz [Thu, 10 Jan 2013 16:54:09 +0000 (17:54 +0100)]
bcma: return the mips irq number in bcma_core_irq

The irq signal numbers that are send by the cpu are increased by 2 from
the number programmed into the mips core by bcma.
Return the irq number on which the irqs are send in bcma_core_irq() now.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: fix compile error
Hauke Mehrtens [Thu, 10 Jan 2013 16:52:38 +0000 (17:52 +0100)]
bcma: fix compile error

This error was introduced in:
commit e3f05a42faac627d8704c76c1927e09b22443b7b
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Fri Jan 4 00:51:21 2013 +0100

    bcma: mips: explicit assign IRQ numbers

  CC      drivers/bcma/driver_mips.o
drivers/bcma/driver_mips.c: In function 'bcma_core_mips_init':
drivers/bcma/driver_mips.c:302:4: error: implicit declaration of
function 'bcma_core_irq' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[6]: *** [drivers/bcma/driver_mips.o] Error 1

Reported-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: fix spectral scan endless mode on AR9002
Simon Wunderlich [Thu, 10 Jan 2013 10:45:14 +0000 (11:45 +0100)]
ath9k: fix spectral scan endless mode on AR9002

There was a copy+paste error in ar9002 for the endless spectral mode,
fix that.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: add database of serial flash memories
Rafał Miłecki [Thu, 10 Jan 2013 09:11:37 +0000 (10:11 +0100)]
ssb: add database of serial flash memories

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomac80211_hwsim: fix beacon timestamp and mactime
Thomas Pedersen [Mon, 7 Jan 2013 22:48:07 +0000 (14:48 -0800)]
mac80211_hwsim: fix beacon timestamp and mactime

Set the beacon timestamp once during "transmission" so the
monitor interface also gets a timestamped beacon.

Also use a common base between TX timestamp and RX
mactime. This eliminates "TX" path delay, which shows up
as a constant error in Toffset.

Get the global TSF once before iterating over all RX HWs,
so they all set a mactime with the same time base.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agodrivers/nfc/nfcwilink.c: use devm_kzalloc
Julia Lawall [Thu, 6 Dec 2012 22:10:40 +0000 (23:10 +0100)]
drivers/nfc/nfcwilink.c: use devm_kzalloc

devm_kzalloc allocates memory that is released when a driver detaches.
This patch uses devm_kzalloc for data that is allocated in the probe
function of a platform device and is only freed in the remove function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: increase timer reference count for new timers only
Piotr Haber [Thu, 10 Jan 2013 10:20:48 +0000 (11:20 +0100)]
brcmsmac: increase timer reference count for new timers only

On hardware reintialization reference count of
already existing timers would be increased again.
This leads to problems on module unloading.

Cc: stable@vger.kernel.org
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: fix rx flush handling
Felix Fietkau [Wed, 9 Jan 2013 15:16:56 +0000 (16:16 +0100)]
ath9k: fix rx flush handling

Right now the rx flush is not doing anything useful on AR9003+, as it only
works if the buffers in the rx FIFO have not been purged yet, as is done
by ath_stoprecv.

To fix this, always call ath_flushrecv from within ath_stoprecv before
the FIFO is emptied, but still after the hw receive path has been stopped.

This ensures that frames received (and ACKed by the hardware) shortly before
a reset will be seen by the software, which should improve A-MPDU session
stability.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: add a better fix for the rx tasklet vs rx flush race
Felix Fietkau [Wed, 9 Jan 2013 15:16:55 +0000 (16:16 +0100)]
ath9k: add a better fix for the rx tasklet vs rx flush race

Ensure that the rx tasklet is no longer running when entering the reset path.
Also remove the distinction between flush and no-flush frame processing.
If a frame has been received and ACKed by the hardware, the stack needs to see
it, so that the BA receive window does not go out of sync.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>