Commit Graph

232418 Commits (f3e85b9edeaf8ad0446a37a40c873f3f8898c57d)

Author SHA1 Message Date
Vivek Natarajan f3e85b9ede mac80211: Fix a race on enabling power save.
There is a race on sending a data frame before the tx completion
of nullfunc frame for enabling power save. As the data quickly
follows the nullfunc frame, the AP thinks that the station is out
of power save and continues to send the frames. Whereas in the
station, the nullfunc ack will be processed after the tx completion
of data frame and mac80211 goes to powersave. Thus the power
save state mismatch between the station and the AP causes some
data loss and some applications fail because of that. This patch
fixes this issue.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:29 -05:00
Rafał Miłecki 05db8c5729 b43: N-PHY: rev1: restore PHY state after RSSI operations
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:29 -05:00
Rafał Miłecki 8e60b04479 b43: N-PHY: rev1: enable some gain ctl workarounds
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:29 -05:00
Rafał Miłecki 9c1f992c77 b43: N-PHY: fix 0x2055 radio workaround condition
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:29 -05:00
Sujith Manoharan 512c044a29 ath9k_htc: Fix error path in URB allocation
ath9k_hif_usb_alloc_urbs() takes care of freeing
all the allocated URBs for the various endpoints when
an error occurs. Calling ath9k_hif_usb_dealloc_urbs() would
cause a panic since the URBs have already been freed.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:28 -05:00
Sujith Manoharan 3e3f1d197f ath9k_htc: Add debug code to print endpoint mapping
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:28 -05:00
Sujith Manoharan 4825f54a44 ath9k_htc: Fix RX filters
Add ATH9K_RX_FILTER_UNCOMP_BA_BAR and ATH9K_RX_FILTER_PSPOLL
when mac80211 requires it.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:28 -05:00
Sujith Manoharan 88427c65f0 ath9k_htc: Fix host RX initialization
There is no need to set the BSSID mask or opmode when
initializing RX, they would be set correctly in the HW reset
routine.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:28 -05:00
Sujith Manoharan 200be651f7 ath9k_htc: Fix TBTT calculation for IBSS mode
The target beacon transmission time has to be synced with the HW
TSF when configuring beacon timers in Adhoc mode. Failing to do this
would cause erroneous beacon transmission, for example, on completion
of a scan run to check for IBSS merges.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:28 -05:00
Sujith Manoharan a5fae37d11 ath9k_htc: Configure beacon timers in AP mode
Handle multi-interface situations by checking if
AP interfaces are already present.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:28 -05:00
Sujith Manoharan a236254c35 ath9k_htc: Add ANI for AP mode
The time granularity for the ANI task is different for AP and
station mode.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:27 -05:00
Sujith Manoharan ffbe7c83cb ath9k_htc: Calculate and set the HW opmode
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:27 -05:00
Sujith Manoharan da8d9d937b ath9k_htc: Allow AP interface to be created
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:27 -05:00
Sujith Manoharan 0df8359a88 ath9k_htc: Maintain individual counters for interfaces
This is required for allowing only one IBSS interface to be
configured.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:27 -05:00
Sujith Manoharan 87df89579a ath9k_htc: Protect ampdu_action with a mutex
This is required when issuing commands to the firmware.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:27 -05:00
Sujith Manoharan 2299423bd0 ath9k_htc: Use VIF from the packet's control data
There is no need to use a locally stored reference.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:27 -05:00
Sujith Manoharan 9a3d025be1 ath9k_htc: Make sequence number calculation per-VIF
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:26 -05:00
Sujith Manoharan 585895cdfc ath9k_htc: Set the BSSID mask for multiple interfaces
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:26 -05:00
Sujith Manoharan 7c277349ec ath9k_htc: Remove OP_ASSOCIATED variable
mac80211 stores the association state in ieee80211_bss_conf.
Use this and remove the local state, which is incorrect anyway
since it is stored globally and not on a per-VIF basis.

Restarting ANI and reconfiguration of HW beacon timers when a
scan run ends requires more work. This is handled by iterating
over the active interfaces.

Finally, remove the useless check for associated status in RX
processing.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:26 -05:00
Sujith Manoharan 9304c82d8f ath9k_htc: Remove OP_PROTECT_ENABLE
CTS protection can be obtained from mac80211 directly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:26 -05:00
Sujith Manoharan cf04e77286 ath9k_htc: Remove OP_PREAMBLE_SHORT
mac80211's BSS info can be used for this.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:26 -05:00
Sujith Manoharan ab77c70a15 ath9k_htc: Fix error handling in add_interface
Addition of a station might fail - handle this error
properly by removing the VAP on the target.
Also, bail out immediately if the max. no of interfaces
has been reached.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:26 -05:00
Sujith Manoharan 1057b75039 ath9k_htc: Unify target capability updating
Update capabilites on the target once, when
start() is called, there is no need for redundant
updating on adding an interface.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:26 -05:00
Sujith Manoharan a97b478c92 ath9k_htc: Allow upto two simultaneous interfaces
Multiple interfaces can be configured if a slot is free
on the target. Monitor mode also requires a slot.

The maximum number of stations that can be handled in
the firmware is 8, manage the station slots accordingly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:25 -05:00
Sujith Manoharan 36bcce4306 ath9k_htc: Handle storage devices
Some AR7010 based devices are recognized as storage media.
Sending a CD-EJECT command to the device will 'convert' it into
a WLAN device. Do this within the driver itself, removing the
dependancy on an external program (usb_modeswitch).

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:25 -05:00
Nishant Sarmukadam 85c9205c79 mwl8k: Invert tx queues for set_hw_spec and set_edca_params
mac80211 and mwl8k FW tx queue priorities map inversely to each other.
Fix this.

Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Tested-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:25 -05:00
Nishant Sarmukadam 0bf22c3751 mwl8k: Tell mac80211 we have rate adaptation in FW
All mwl8k parts perform rate control in firmware.  Make this known to
mac80211 so that it does not launch minstrel.  Also, because actual tx
rate information is not available from the firmware, invalidate the
rate status before returning the skb to mac80211.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:25 -05:00
Nishant Sarmukadam da62b76176 mwl8k: fix rf_antenna rx argument for AP
When configuring rx antennas using CMD_RF_ANTENNA, the argument input is
the number of antennas to be enabled. For AP, we support 3 rx antennas
and hence set the field to 3. For tx antennas, value is a bitmap, so 0x7
enables all three.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:25 -05:00
John W. Linville 427749861d Merge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx 2011-02-23 16:23:00 -05:00
John W. Linville 9077f2189e Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6 2011-02-23 16:22:36 -05:00
Arik Nemtsov b622d992c2 wl12xx: AP-mode - management of links in PS-mode
Update the PS mode of each link according to a bitmap polled from
fw_status. Manually notify mac80211 about PS mode changes in connected
stations.

mac80211 will only be notified about PS start when the station is in PS
and there is a small number of TX blocks from this link ready in HW.
This is required for waking up the remote station since the TIM is
updated entirely by FW.

When a station enters mac80211-PS-mode, we drop all the skbs in the
low-level TX queues belonging to this sta with STAT_TX_FILTERED
to keep our queues clean.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:18:46 +02:00
Arik Nemtsov 09039f42a2 wl12xx: AP-mode - count free FW TX blocks per link
Count the number of FW TX blocks allocated per link. We add blocks to a
link counter when allocated for a TX descriptor. We remove blocks
according to counters in fw_status indicating the number of freed blocks
in FW. These counters are polled after each IRQ.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:18:46 +02:00
Arik Nemtsov 409622ecc2 wl12xx: AP mode - fix bug in cleanup of wl1271_op_sta_add()
Remove an active hlid when chip wakeup fails. In addition rename the
involved functions.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:18:46 +02:00
Arik Nemtsov ba7c082a13 wl12xx: AP-mode - support HW based link PS monitoring
When operating in AP mode the wl1271 hardware filters out null-data
packets as well as management packets. This makes it impossible for
mac80211 to monitor the PS mode by using the PM bit of incoming frames.

Disable mac80211 automatic link PS-mode handling by supporting
IEEE80211_HW_AP_LINK_PS in HW flags.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:18:45 +02:00
Arik Nemtsov 1d36cd892c wl12xx: report invalid TX rate when returning non-TX-ed skbs
Report a TX rate idx of -1 and count 0 when returning untransmitted
skbs to mac80211 using ieee80211_tx_status(). Otherwise mac80211
tries to use the returned (essentially garbage) status.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:14:56 +02:00
Arik Nemtsov a8c0ddb5ba wl12xx: AP-mode - TX queue per link in AC
When operating in AP-mode we require a per link tx-queue.
This allows us to implement HW assisted PS mode for links,
as well as regulate per-link FW TX blocks consumption.
Split each link into ACs to support future QoS for AP-mode.

AC queues are emptied in priority and per-link queues are
scheduled in a simple round-robin fashion.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:14:56 +02:00
Arik Nemtsov 99a2775d02 wl12xx: AP-mode - fix race condition on sta connection
If a sta starts transmitting immediately after authentication, sometimes
the FW deauthenticates it. Fix this by marking the sta "in-connection"
in FW before sending the autentication response.

The "in-connection" entry is automatically removed when connection
succeeds or after a timeout.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:14:55 +02:00
Arik Nemtsov f4d08ddd3e wl12xx: fix potential race condition with TX queue watermark
Check the conditions for the high/low TX queue watermarks when the
spin-lock is taken. This prevents race conditions as tx_queue_count and
the flag checked are only modified when the spin-lock is taken.

The following race was in mind:
- Queues are almost full and wl1271_op_tx() will stop the queues, but it
  doesn't get the spin-lock yet.
- (on another CPU) tx_work_locked() dequeues 15 skbs from this queue and
  tx_queue_count is updated to reflect this
- wl1271_op_tx() does not check tx_queue_count after taking the
  spin-lock and incorrectly stops the queue.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:14:55 +02:00
Eliad Peller 6dc9fb3c78 wl12xx: always set mac_address when configuring ht caps
The mac_address should be set also when ht caps are disabled.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:11:20 +02:00
Eliad Peller 02ad2d9080 wl12xx: use standard ALIGN() macro
Use the standard ALIGN() macro instead of redefining similar macros.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-23 11:11:19 +02:00
Eliad Peller 62c0740c4f wl12xx: declare support for IEEE80211_HW_REPORTS_TX_ACK_STATUS
The wl12xx fw supports ack status reporting for tx frames, so
add the IEEE80211_HW_REPORTS_TX_ACK_STATUS flag to our supported
features.

Since we do the rate control in the fw, we'll probably want
to adjust the STA_LOST_PKT_THRESHOLD heuristics in the future, to
account for retransmissions as well.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-22 18:06:37 +02:00
Luciano Coelho b1a48cab6f wl12xx: fix MODULE_AUTHOR email address
Change my old email address to the new one in MODULE_AUTHOR.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-22 18:06:37 +02:00
Arik Nemtsov a100885d9d wl12xx: avoid blocking while holding rcu lock on bss info change
Some blocking functions were called while holding the rcu lock for
accessing STA information. This can lead to a deadlock.

Save the required info beforehand and release the rcu without
blocking.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-22 18:06:36 +02:00
Eliad Peller 92fe9b5f11 wl12xx: fix identification of beacon packets (debug)
for debugging purposes, wl12xx determines whether a rx packet
is a beacon packet.

however, it checks only the frame_control subtype without checking
the actual packet type, which leads to false identification in some
cases.

use ieee80211_is_beacon instead.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-22 18:06:36 +02:00
Gery Kahn 1ec610ebd6 wl12xx: update PLT initialization for new firmware
In revision > 6.1.3.0.0 the firmware expects memory configuration command
as part of boot. This was missing if driver boots in PLT mode.
The patch adds the memory configuration command, which fixes PLT commands
tx continuous and rx statistics.

Signed-off-by: Gery Kahn <geryk@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-22 18:06:36 +02:00
Dan Carpenter 03c5a9cf49 wl12xx: change type from u8 to int
ret is used to store int types.  Using an u8 will break the error
handling.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-02-22 18:06:35 +02:00
Sujith Manoharan 320d6c1b56 ath9k_hw: Fix power on reset
Commit "ath9k_hw: add an extra delay when reseting AR_RTC_RESET"
added an extra udelay to the reset routine. As the required
delay is already present, remove this.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-21 15:40:00 -05:00
RA-Shiang Tu 60687ba710 rt2x00: Add support for RT5390 chip
Add new RT5390 chip support

Signed-off-by: Shiang Tu <shiang_tu@ralinktech.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-21 15:40:00 -05:00
Shiang Tu fe59147c4f rt2x00: Add/Modify the GPIO register definition
Revise/Add GPIO register related definitions

Signed-off-by: Shiang Tu <shiang_tu@ralinktech.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-21 15:40:00 -05:00
Shiang Tu 6f492b6d38 rt2x00: Add/Modify protection related register definitions
Make the definition of protection related registers more precisely

Signed-off-by: Shiang Tu <shiang_tu@ralinktech.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-21 15:40:00 -05:00