iwlwifi: mvm: use atomic interface iteration to avoid deadlock
Using the non-atomic version creates a dependency between
mac80211's iflist_mtx and mvm->mutex. Use the atomic version
instead which doesn't take iflist_mtx but can't sleep, so
send the HCMD in ASYNC.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1118
1119 key_flags = cpu_to_le16(keyconf->keyidx & STA_KEY_FLG_KEYID_MSK);
^^^^^^^^^^^^^^^
This is s8.
^^^^^^^^^^^^^^^^^^^^^
STA_KEY_FLG_KEYID_MSK is 0x300.
The result after the bitwise AND is always zero because 0xff & 0x300.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ilan Peer [Mon, 4 Feb 2013 12:09:37 +0000 (14:09 +0200)]
iwlwifi: mvm: Change the Time Event type used for ROC
The TE_P2P_DEVICE_DISCOVERABLE time event type used for ROC is
assigned low priority in the FW, and thus has low chance of
being scheduled when there are active BSS or GO VMACs (even if
fragmentation is allowed). This is mainly problematic in for
cases where ROC is requested for sending action frames.
To overcome this, use a time event type that has priority equal
to that ot the time event type used by the FW to action scan.
Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ilan Peer [Mon, 4 Feb 2013 11:16:24 +0000 (13:16 +0200)]
iwlwifi: mvm: Update quota settings for all bindings
The FW scheduler, schedules the bindings over a session of 128
fragments (each is 4 TU long). The quota command should allocate
all the session fragments between all the bindings that require quota
allocation. Currently, use static allocation, where the fragments
are equally distributed between all data bindings.
Note, that not allocating all the session's fragments might cause
the FW scheduler to leave the medium unused.
Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 27 Dec 2012 20:43:48 +0000 (21:43 +0100)]
iwlwifi: use threaded interrupt handler
With new transports coming up, move to threaded
interrupt handling now. This has the advantage
that we can use the same locking scheme with all
different transports we may need to implement.
Note that the TX path obviously still runs in a
tasklet, so some spin_lock() calls need to change
to spin_lock_bh() calls to properly lock out the
TX path.
In my test on a Calpella platform this has no
impact on throughput or latency.
Also add lockdep annotations to avoid lockups due
to catch sending synchronous commands or using
locks that connect with them from the irq thread.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Lilach Edelstein [Wed, 16 Jan 2013 09:34:49 +0000 (11:34 +0200)]
iwlwifi: move register access lock into transport
Move the reg_lock that protects HW register access
into the transport implementation. Locking is no
longer exposed, but handled internally in grab and
release NIC access. This simplifies the users.
Lilach Edelstein [Sun, 13 Jan 2013 11:31:10 +0000 (13:31 +0200)]
iwlwifi: add iwl_set_bits_mask to transport API
Express iwl_set_bit() and iwl_clear_bit() through iwl_set_bits_mask()
and add the latter to the transport's API in order to allow different
implementation for different transport types in the future.
As the rate scaling algorithm will attempt to enable
aggregation over and over again, the message will
flood the log if there is, for example, Bluetooth
streaming music. Make it a debug messages instead of
printing it all the time.
Johannes Berg [Thu, 24 Jan 2013 13:14:22 +0000 (14:14 +0100)]
iwlwifi: add NVM and PHY DB code for new MVM driver
The new MVM (multi-virtual MAC) firmware driver
requires NVM (non-volatile memory) parsing code
and some PHY information database code. Add this
separately.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Firmware crash on attempt to delete Rx chain.
Driver part of Rx chain removed only in preparation for the target reset;
as reset is the only flow that removes Rx chain in the firmware.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Due to multi-tx-queue design, wil_start_xmit() used to be executed
concurrently for different queues. Then, these transmits delivered
to the same queue, creating race.
As result, Tx descriptor may be skipped, causing stall in hardware.
Convert to single Tx queue fixes it.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Guenter Roeck [Sun, 27 Jan 2013 18:55:41 +0000 (10:55 -0800)]
net: iwlegacy: remove unused variable
Fix:
drivers/net/wireless/iwlegacy/4965.c: In function ‘il4965_post_associate’:
drivers/net/wireless/iwlegacy/4965.c:1751:25: warning: variable ‘conf’ set but
not used [-Wunused-but-set-variable]
seen when building allmodconfig on x86_64 with W=1 by removing the unused
variable.
Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch is based on "iwlwifi: fix antenna bitmask".
(362b0563b28506d53)
Like the new iwlagn devices, the old 4965N device only
supports a maximum of three antennas. Hence only three
bits are used, the fourth bit is likely the A-MPDU
indicator.
Cc: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hauke Mehrtens [Sat, 26 Jan 2013 20:39:44 +0000 (21:39 +0100)]
bcma: add gpio_to_irq
The old bcm47xx gpio code had support for gpio_to_irq, but the new
code did not provide this function, but returned -ENXIO all the time.
This patch adds the missing function.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hauke Mehrtens [Sat, 26 Jan 2013 20:38:35 +0000 (21:38 +0100)]
ssb: add gpio_to_irq
The old bcm47xx gpio code had support for gpio_to_irq, but the new
code did not provide this function, but returned -ENXIO all the time.
This patch adds the missing function.
arch/mips/bcm47xx/wgt634u.c calls gpio_to_irq() and got the correct irq
number with the old gpio handling code. With this patch the code in
wgt634u.c should work again. I do not have a wgt634u to test this.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bing Zhao [Sat, 26 Jan 2013 02:23:00 +0000 (18:23 -0800)]
mwifiex: do not overwrite error code from lower layer driver
Instead of converting it to a bogus error code -1, we should
return the original error code from lower layer driver. This
error code will be printed so it may give user some clues on
what has happened.
Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: don't return zero on failure paths in mwifiex_pcie_init()
If pci_iomap() fails in mwifiex_pcie_init(), it 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> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Chun-Yeow Yeoh [Fri, 25 Jan 2013 04:47:50 +0000 (12:47 +0800)]
rt2x00: allow AP and mesh mode to operate simultaneously
Allow AP and Mesh mode to operate concurrently using
single radio. Verify this using fonera 2.0n featuring
RT3052 chipset and also TP-LINK TL-WN727N featuring
RT5370 chipset.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemal.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2800usb: move "TX status missed" messages to debug level
Those messages can flood in dmesg, so do not print them by default.
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Some messages provide useful information, but are disabled without
CONFIG_RT2X00_DEBUG=y, so enable them by default
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sven Eckelmann [Wed, 23 Jan 2013 19:12:39 +0000 (20:12 +0100)]
ath9k: Update spectral scan output data
The sample data received through the spectral scan can be either in big or
little endian byteorder. This information isn't stored in the output file.
Therefore it is not possible for the analyzer software to find the correct byte
order.
It is relative common to get the data from a low end AP in big endian mode and
transfer it to another computer in little endian mode to analyze it. Therefore,
it would be better to store it in network (big endian) byte order.
The extension of the 8 bit bins for each bin to 16 bit is not necessary. This
operation can be done in userspace or on a different machine. Instead the
max_exp defining the amount of shifting required for each bin is exported to
userspace.
The change of the output format requires a change of the type in the sample
tlv to allow the userspace program to correctly detect the bin format.
Reported-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
[siwu@hrz.tu-chemnitz.de: squashed patches, update commit message, rebase, fix endianess bug] 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>
Simon Wunderlich [Wed, 23 Jan 2013 16:38:06 +0000 (17:38 +0100)]
ath9k: reorder error codes for spectral
When using the spectral scan feature, frames with phy errors are
returned for further processing to the driver. However, if the frames
also have an invalid CRC (which seems to happen quite often), the frame
is marked with bad CRC and not with the PHY error bit. The FFT
processing function will thus miss the frames.
Fix this by changing the precedence in error marking.
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>
Simon Wunderlich [Wed, 23 Jan 2013 16:38:05 +0000 (17:38 +0100)]
ath9k: drop spectral packets after processing them
Spectral packets are "bogus" packets and should not be further evaluated
by the RX path.
Statistics are added to keep track of these packets.
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>
Simon Wunderlich [Wed, 23 Jan 2013 16:38:04 +0000 (17:38 +0100)]
ath9k: add debug parameters for spectral scan
Export the various parameters to userspace.
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>
Avinash Patil [Wed, 23 Jan 2013 00:29:03 +0000 (16:29 -0800)]
mwifiex: fix invalid access of PCIe RxBD ring buffer descriptor
This patch fixes invalid access of RxBD ring buffer descriptor's
length and flag inside PCIe send_data_complete() routine. We are
supposed to modify TxBD buffer descriptor's length and flag here.
Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Before "mac80211: clean up mesh sta allocation warning"
was applied, mesh_sta_info_get() was reshuffled to please
sparse. As a result we neglect to initialize newly created
STAs. Fix this.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Add API to enable drivers to implement MAC address based
access control in AP/P2P GO mode. Capable drivers advertise
this capability by setting the maximum number of MAC
addresses in such a list in wiphy->max_acl_mac_addrs.
An initial ACL may be given to the NL80211_CMD_START_AP
command and/or changed later with NL80211_CMD_SET_MAC_ACL.
Black- and whitelists are supported, but not simultaneously.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
[rewrite commit log, many cleanups] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Arnd Bergmann [Fri, 25 Jan 2013 14:14:33 +0000 (14:14 +0000)]
mac80211: avoid a build warning
gcc cannot prove that the value of sdata->vif.type does not
change between the switch() statement and the second
comparison to NL80211_IFTYPE_AP, causing a harmless
warning.
Slightly reordering the code makes the warning go away
with no functional change.
Without this patch, building ARM at91sam9g45_defconfig with
gcc-4.6 results in:
net/mac80211/tx.c: In function 'ieee80211_subif_start_xmit':
net/mac80211/tx.c:1797:22: warning: 'chanctx_conf' may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 18 Jan 2013 20:21:31 +0000 (21:21 +0100)]
mac80211: remove redundant check
There's no need to have two checks for "associated"
in ieee80211_sta_restart(), make the first one locked
to not race (unlikely at this point during resume)
and remove the second check.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Simon Wunderlich [Wed, 23 Jan 2013 14:15:57 +0000 (15:15 +0100)]
cfg80211: fix channel check in cfg80211_can_use_iftype_chan
In commit "cfg80211: check radar interface combinations" a regression
was introduced which might lead to NULL dereference if the argument
chan = NULL, which might happen in IBSS/wext case (and probably
others).
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Thomas Pedersen [Wed, 23 Jan 2013 20:18:12 +0000 (12:18 -0800)]
mac80211: clean up mesh sta allocation warning
This refactoring fixes a "scheduling while atomic" warning
when allocating a mesh station entry while holding the RCU
read lock. Fix this by creating a new function
mesh_sta_info_get(), which correctly handles the locking
and returns under RCU.
Also move some unnecessarily #ifdefed mesh station init
code from sta_info_alloc() to __mesh_sta_info_alloc().
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
[change code flow to make sparse happy] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 18 Jan 2013 22:47:05 +0000 (23:47 +0100)]
mac80211: fix aggregation state with current drivers
For drivers that don't actually flush their queues when
aggregation stop with the IEEE80211_AMPDU_TX_STOP_FLUSH
or IEEE80211_AMPDU_TX_STOP_FLUSH_CONT reasons is done,
like iwlwifi or iwlegacy, mac80211 can then transmit on
a TID that the driver still considers busy. This happens
in the following way:
- IEEE80211_AMPDU_TX_STOP_FLUSH requested
- driver marks TID as emptying
- mac80211 removes tid_tx data, this can copy packets
to the TX pending queues and also let new packets
through to the driver
- driver gets unexpected TX as it wasn't completely
converted to the new API
Fortunately, solving this problem is easy as the station
is being destroyed, so such transmit packets can only
happen due to races. Instead of trying to close the race
just let the race not reach the drivers by making two
changes:
1) remove the explicit aggregation session teardown in
the managed mode code, the same thing will be done
when the station is removed, in __sta_info_destroy.
2) When aggregation stop with AGG_STOP_DESTROY_STA is
requested, leave the tid_tx data around as stopped.
It will be cleared and freed in cleanup_single_sta
later, but until then any racy packets will be put
onto the tid_tx pending queue instead of transmitted
which is fine since the station is being removed.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Since drivers can support several BSS / P2P Client
interfaces, the rssi callback needs to inform the driver
about the interface teh rssi event relates to.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.