openwrt/staging/blogic.git
13 years agowl12xx: fix a couple of sparse warnings about undeclared functions
Luciano Coelho [Mon, 21 Mar 2011 17:26:41 +0000 (19:26 +0200)]
wl12xx: fix a couple of sparse warnings about undeclared functions

Fix the following sparse warnings:

drivers/net/wireless/wl12xx/main.c:1129:5: warning: symbol '__wl1271_plt_stop' was not declared. Should it be static?
drivers/net/wireless/wl12xx/main.c:2988:5: warning: symbol 'wl1271_op_ampdu_action' was not declared. Should it be static?

Both functions should be static.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: fix SG BT load value to reflect its new meaning
Luciano Coelho [Mon, 21 Mar 2011 15:58:32 +0000 (17:58 +0200)]
wl12xx: fix SG BT load value to reflect its new meaning

The Soft Gemini BT load ratio value has changed its meaning with FW
version 6.1.0.0.310.  It now means the passive scan compensation
percentage during A2DP EDR.  Instead of 50, we need to use 200.

Fix the SG configuration accordingly.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: set the skbuff priority for dummy packets
Luciano Coelho [Mon, 21 Mar 2011 14:35:21 +0000 (16:35 +0200)]
wl12xx: set the skbuff priority for dummy packets

The firmware requires dummy packets to be sent using TID 7
(WL1271_TID_MGMT).  Instead of hardcoding it in the tx_fill_hdr()
function, set it when creating the packet itself.

This requires Eliad's fix to set the actual TID in the TX descriptor.

Cc: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: set the actual tid instead of the ac
Eliad Peller [Wed, 16 Mar 2011 21:03:54 +0000 (23:03 +0200)]
wl12xx: set the actual tid instead of the ac

When passing a tx frame, the driver incorrectly set desc->tid
with the ac instead of the actual tid.

It has some serious implications when using 802.11n + QoS,
as the fw starts a BlockAck with the wrong tid (which finally
cause beacon loss and disconnection / some fw crash)

Fix it by using the actual tid stored in skb->priority.

Reported-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Add mutex protection for interface list
Juuso Oikarinen [Mon, 21 Mar 2011 08:43:36 +0000 (10:43 +0200)]
wl12xx: Add mutex protection for interface list

The interface list maintained in main.c is not mutex protected. This could
cause issues, as the list is accessed from notifier chains.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Clamp byte mode transfers for 128x chips
Arik Nemtsov [Fri, 18 Mar 2011 12:49:57 +0000 (14:49 +0200)]
wl12xx: Clamp byte mode transfers for 128x chips

On wl128x based devices, when TX packets are aggregated, each packet
size must be aligned to the SDIO block size, and sent using block mode
transfers.

The block size is set to 256 bytes, which is less than the maximum
possible byte transfer. Thus, if two small packets (< 256 bytes) are
aggregated, the aggregation buffer size would be 512, and will be sent
using byte mode transfers. This can have undesired side effects.

Fix this by setting the MMC_QUIRK_BLKSZ_FOR_BYTE_MODE mmc card quirk.
For 127x chips this has no effect, as the block size is set to 512
bytes.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: update bet_max_consecutive
Ohad Ben-Cohen [Mon, 14 Mar 2011 16:53:10 +0000 (18:53 +0200)]
wl12xx: update bet_max_consecutive

Allow early termination of 50 consecutive beacons.

This value is the recommended one by the 12xx's system/RF team,
and tests show that power consumption is improved as expected.

Reported-by: Ruthy Zaphir <ruthyz@ti.com>
Tested-by: Danil Shalumov <danils@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Add support for 11n Rx STBC one spatial stream
Shahar Levi [Sun, 13 Mar 2011 09:24:40 +0000 (11:24 +0200)]
wl12xx: Add support for 11n Rx STBC one spatial stream

The wl12xx chip supports one Rx STBC spatial stream.  Announce this in
the HT capabilities info field.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Fix potential incorrect band in rx-status
Juuso Oikarinen [Thu, 10 Mar 2011 08:01:43 +0000 (10:01 +0200)]
wl12xx: Fix potential incorrect band in rx-status

The rx-status passed to mac80211 along with each received frame contains the
band on which the frame was received. Under certain circumstances, this band
information may be incorrect, causing in worst case a WARNING from mac80211,
and causes the received frame to be dropped.

This scenario mainly occurs when performing connected-mode scans, when the
received scan results are from the other band than the one currently
associated to.

[Since desc_band doesn't exist anymore, use status->band in the later
call to ieee80211_channel_to_frequency() to fix compilation -- Luca]

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: use 1 spare TX block instead of two
Luciano Coelho [Thu, 10 Mar 2011 13:24:57 +0000 (15:24 +0200)]
wl12xx: use 1 spare TX block instead of two

All the new firmware versions (>=6.1.3.50.58 for STA and >=6.2.0.0.47
for AP) use 1 spare TX block.  We still want to support older
firmwares that require 2 spare blocks, so added a quirk to handle the
difference.

Also implemented a generic way of setting quirks that depend on the
firmware revision.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - enable chip support
Shahar Levi [Sun, 6 Mar 2011 14:32:20 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - enable chip support

Add support to wl128x chip via chip id

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - Use different FW file for AP mode wl127x/wl128x chips
Arik Nemtsov [Sun, 6 Mar 2011 14:32:18 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - Use different FW file for AP mode wl127x/wl128x chips

Choose a different FW for AP-mode wl127x and wl128x chips, base on chip
ID at boot time.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - Add dummy packet support
Shahar Levi [Sun, 6 Mar 2011 14:32:14 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - Add dummy packet support

Support sending dummy packet to wl128x FW as results of
dummy packet event. That is part of dynamic TX mem blocks mechanism.

Only send dummy packet when not in AP mode.

[Even though the DUMMY_PACKET_EVENT_ID and the
STA_REMOVE_COMPLETE_EVENT_ID events are defined to the same value, we
need to treat them separately in the code.  Keep the check and enable
STA_REMOVE_COMPLETE_EVENT_ID for AP mode and DUMMY_PACKET_EVENT_ID for
STA.  Moved one warning to a cleaner place.  Use WL1271_TID_MGMT for
dummy packets -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - Improve Tx & Rx path
Shahar Levi [Sun, 6 Mar 2011 14:32:13 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - Improve Tx & Rx path

Reduced bus transactions in the Tx & Rx path.

[Removed unnecessary check wl->chip.id != CHIP_ID_1283_PG20 when
checking the quirk -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - use dynamic memory for the RX/TX pools
Shahar Levi [Sun, 6 Mar 2011 14:32:12 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - use dynamic memory for the RX/TX pools

Separate the memory configuration to chip-specific structures and
implement dynamic memory for wl128x.

This feature allows us to move TX memory blocks to the RX pool when
the RX path is overloaded.

Thanks for Arik Nemtsov <arik@wizery.com> for helping simplify the
wl1271_fw_status() code.

[Rewrote the commit subject and message for clarity; improved some
comments and changed "spare" to "padding" for consistency; added a
FIXME for the AP memory configuration -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - New boot sequence
Shahar Levi [Sun, 6 Mar 2011 14:32:11 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - New boot sequence

Boot sequence support FREF clock and TCXO clock.
WL128x has two clocks input - TCXO and FREF.
TCXO is the main clock of the device, while FREF is used to sync
between the GPS and the cellular modem.
Auto-detection checks where TCXO is 32.736MHz or 16.368MHz, in that
case the FREF will be used as the WLAN/BT main clock.

[Use clock enumeration as defined in linux/wl12xx.h; remove
unnecessary else block in wl128x_switch_fref; remove unnecessary
change in main.c; remove some unnecessary debug prints and comments;
fix potential use of uninitialized value (pll_config) -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - Loading FW & NVS
Shahar Levi [Sun, 6 Mar 2011 14:32:10 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - Loading FW & NVS

Take care of FW & NVS with the auto-detection between wl127x and
wl128x.

[Moved some common code outside if statements and added notes about
NVS structure assumptions; Fixed a bug when checking the nvs size: if
the size was incorrect, the local nvs variable was set to NULL, it
should be wl->nvs instead. -- Luca]

[Merged with potential buffer overflow fix -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - New radio structs and functions
Shahar Levi [Sun, 6 Mar 2011 14:32:09 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - New radio structs and functions

New general and radio parameters structures and functions.
Implemented as separate functions due to auto-detection
between wl127x and wl128x.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - add block size handling for sdio and spi
Luciano Coelho [Mon, 14 Mar 2011 12:05:13 +0000 (14:05 +0200)]
wl12xx: 1281/1283 support - add block size handling for sdio and spi

Add the the set_block_size op in the SDIO and in the SPI modules.
Since it is only used with SDIO, just explicitly set the op to NULL in
spi.c

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - Add acx commands
Shahar Levi [Sun, 6 Mar 2011 14:32:08 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - Add acx commands

New acx command that sets: Rx fifo enable reduced bus transactions
in RX path. Tx bus transactions padding to SDIO block size that
improve preference in Tx and essential for working with SDIO HS (48Mhz).
The max SDIO block size is 256 when working with Tx bus transactions
padding to SDIO block.

Add new ops to SDIO & SPI that handles the win size change in case of
transactions padding (relevant only for SDIO).

[Fix endianess issues; simplify sdio-specific block_size handling;
minor changes in comments; use "aligned_len" in one calculation
instead of "pad" to avoid confusion -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - Add Definitions
Shahar Levi [Sun, 6 Mar 2011 14:32:07 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - Add Definitions

Definitions to support wl128x:
  - New FW file name
  - Chip ID
  - New PLL Configuration Algorithm macros that will be used at wl128x
    boot stage
  - Rename NVS macro name: wl127x and wl128x are using the same NVS
    file name. However, the ini parameters between them are
    different. The driver will validate the correct NVS size in
    wl1271_boot_upload_nvs().

[Cleaned up some of the definitions. -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: 1281/1283 support - move IRQ polarity
Shahar Levi [Sun, 6 Mar 2011 14:32:06 +0000 (16:32 +0200)]
wl12xx: 1281/1283 support - move IRQ polarity

In order to prevent overran of IRQ polarity via FW the polarity setting move after
FW download and before IRQ enable.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: add new board_tcxo_clock element to the platform data
Luciano Coelho [Thu, 10 Mar 2011 14:42:47 +0000 (16:42 +0200)]
wl12xx: add new board_tcxo_clock element to the platform data

This new value is a new type of clock setting that is used by wl128x
chipsets.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agoath: Add a missing world regulatory domain 0x6C
Senthil Balasubramanian [Thu, 14 Apr 2011 11:11:30 +0000 (16:41 +0530)]
ath: Add a missing world regulatory domain 0x6C

Some customers use 0x6C world regulatory domain and this patch
adds the support.

Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: Fix unitialized variable warnings
Larry Finger [Thu, 14 Apr 2011 02:00:02 +0000 (21:00 -0500)]
rtlwifi: Fix unitialized variable warnings

In http://lkml.indiana.edu/hypermail/linux/kernel/1104.1/01955.html, Geerti
Uytterhoeven reports the following warnings for the rtlwifi drivers.

src/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c: warning:
 'cck_index' may be used uninitialized in this function: => 637
src/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c: warning:
 'cck_index_old' may be used uninitialized in this function: => 637
src/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c: warning:
 'box_extreg' may be used uninitialized in this function: => 303
src/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c: warning:
 'box_reg' may be used uninitialized in this function: => 303
src/drivers/net/wireless/rtlwifi/rtl8192ce/rf.c: warning:
 'chnlgroup' may be used uninitialized in this function: => 205
src/drivers/net/wireless/rtlwifi/rtl8192ce/rf.c: warning:
 'u4_regvalue' may be used uninitialized in this function: => 450
src/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c: warning:
 'hq_sele' may be used uninitialized in this function: => 924

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwifiex: rename function mwifiex_is_ba_stream_avail
Bing Zhao [Thu, 14 Apr 2011 00:27:09 +0000 (17:27 -0700)]
mwifiex: rename function mwifiex_is_ba_stream_avail

The old function name sounds like checking for existing BA
stream. The function actually checks if we have room for
creating new BA stream or not.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwifiex: remove unused function parameters
Amitkumar Karwar [Thu, 14 Apr 2011 00:27:08 +0000 (17:27 -0700)]
mwifiex: remove unused function parameters

Some function parameters become useless after previous
cleanup changes.

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>
13 years agomwifiex: remove redundant "return" at end of void function
Yogesh Ashok Powar [Thu, 14 Apr 2011 00:27:07 +0000 (17:27 -0700)]
mwifiex: remove redundant "return" at end of void function

The return statement at the last line of a void function
is not necessary.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwifiex: cleanup ioctl wait queue and abstraction layer
Amitkumar Karwar [Thu, 14 Apr 2011 00:27:06 +0000 (17:27 -0700)]
mwifiex: cleanup ioctl wait queue and abstraction layer

1) remove mwifiex_alloc_fill_wait_queue() and
mwifiex_request_ioctl()
2) avoid dynamic allocation of wait queue
3) remove unnecessary mwifiex_error_code macros that
were used mainly by the wait queue status code
4) remove some abstraction functions
5) split mwifiex_prepare_cmd() to mwifiex_send_cmd_async()
and mwifiex_send_sync() to handle asynchronous and
synchronous commands respectively

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>
13 years agoath5k: disable 5 GHz support for the dualband PHY chip on dual-radio AR5312
Felix Fietkau [Wed, 13 Apr 2011 19:56:46 +0000 (21:56 +0200)]
ath5k: disable 5 GHz support for the dualband PHY chip on dual-radio AR5312

There are two variants of AR5312 dual-band devices, one single-radio
and the other one dual-radio. On the dual-radio board, the first MAC
only supports 5 GHz, even though it has a dual-band PHY. The 2.4 GHz
part of this phy is used in pass-through mode, connecting the second
MAC with the second PHY.
Disable 2.4 GHz for the first MAC on an AR5312, but only if the board
configuration indicates a dual-radio device.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: fix the EEPROM check for hw AES crypto support
Felix Fietkau [Wed, 13 Apr 2011 19:56:45 +0000 (21:56 +0200)]
ath5k: fix the EEPROM check for hw AES crypto support

EEPROM version 5.0 adds a new field for disabling AES support, having
an older version means that AES is present. This patch fixes hw AES
crypto support on AR5312 boards, which have an older EEPROM version.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: add a new bus op for reading the mac address
Felix Fietkau [Wed, 13 Apr 2011 19:56:44 +0000 (21:56 +0200)]
ath5k: add a new bus op for reading the mac address

On AHB, the calibration data usually does not contain a valid MAC address,
the correct MAC address is stored in the board config.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath: unshare struct ath_bus_ops between ath5k and ath9k
Felix Fietkau [Wed, 13 Apr 2011 19:56:43 +0000 (21:56 +0200)]
ath: unshare struct ath_bus_ops between ath5k and ath9k

This struct is not used in any common code, and moving it out of
the ath header makes it easier to add more driver specific ops.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: disable 5 GHz support if a 2.4 GHz radio is detected
Felix Fietkau [Wed, 13 Apr 2011 19:56:42 +0000 (21:56 +0200)]
ath5k: disable 5 GHz support if a 2.4 GHz radio is detected

On a dual-radio dual-band AR5312 device, the calibration data is shared
between the 5 GHz and the 2.4 GHz radio/MAC.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix improper beacon slot selection in IBSS
Rajkumar Manoharan [Tue, 12 Apr 2011 11:59:29 +0000 (17:29 +0530)]
ath9k: Fix improper beacon slot selection in IBSS

Request a re-configuration of Beacon related timers
on the receipt of the first Beacon frame has to be set only
for station mode. Setting beacon sync for IBSS is causing
wrong beacon slot selection on beacon generation.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: avoid using trinary operator w/ TX_STAT_INC
John W. Linville [Thu, 14 Apr 2011 14:38:22 +0000 (10:38 -0400)]
ath9k: avoid using trinary operator w/ TX_STAT_INC

Otherwise, you get this:

  CC [M]  drivers/net/wireless/ath/ath9k/hif_usb.o
drivers/net/wireless/ath/ath9k/hif_usb.c: In function â€˜ath9k_skb_queue_complete’:
drivers/net/wireless/ath/ath9k/hif_usb.c:230:12: error: expected expression before â€˜do’
make[2]: *** [drivers/net/wireless/ath/ath9k/hif_usb.o] Error 1
make[1]: *** [drivers/net/wireless/ath/ath9k] Error 2
make: *** [drivers/net/wireless/ath/] Error 2

The TX_STAT_INC macro should probably be changed to accomodate such
usage, although using a trinary operator in place of an if-else seems
questionable to me anyway.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Sujith Manoharan <Sujith.Manoharan@Atheros.com>
13 years agomac80211: Allocate new mesh path and portal tables before taking locks
cozybit Inc [Wed, 13 Apr 2011 18:10:28 +0000 (11:10 -0700)]
mac80211: Allocate new mesh path and portal tables before taking locks

It is unnecessary to hold the path table resize lock while allocating a
new table.  Allocate first and take lock later.  This resolves a
soft-lockup:

[  293.385799] BUG: soft lockup - CPU#0 stuck for 61s! [kworker/u:3:744]
(...)
[  293.386049] Call Trace:
[  293.386049]  [<c119fd04>] do_raw_read_lock+0x26/0x29
[  293.386049]  [<c14b2982>] _raw_read_lock+0x8/0xa
[  293.386049]  [<c148c178>] mesh_path_add+0xb7/0x24e
[  293.386049]  [<c148b98d>] ? mesh_path_lookup+0x1b/0xa6
[  293.386049]  [<c148ded5>] hwmp_route_info_get+0x276/0x2fd
[  293.386049]  [<c148dfb6>] mesh_rx_path_sel_frame+0x5a/0x5d9
[  293.386049]  [<c102667d>] ? update_curr+0x1cf/0x1d7
[  293.386049]  [<c148b45a>] ieee80211_mesh_rx_queued_mgmt+0x60/0x67
[  293.386049]  [<c147c374>] ieee80211_iface_work+0x1f0/0x258
(...)

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Enable AP and P2P modes
Sujith Manoharan [Wed, 13 Apr 2011 05:57:06 +0000 (11:27 +0530)]
ath9k_htc: Enable AP and P2P modes

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add detailed firmware statistics
Sujith Manoharan [Wed, 13 Apr 2011 05:56:58 +0000 (11:26 +0530)]
ath9k_htc: Add detailed firmware statistics

New debugfs files:

<debugfs_root>/ath9k_htc/<phy#>/tgt_int_stats
<debugfs_root>/ath9k_htc/<phy#>/tgt_tx_stats
<debugfs_root>/ath9k_htc/<phy#>/tgt_rx_stats

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Use helper routines for transmission
Sujith Manoharan [Wed, 13 Apr 2011 05:56:52 +0000 (11:26 +0530)]
ath9k_htc: Use helper routines for transmission

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Use separate URB pool for management frames
Sujith Manoharan [Wed, 13 Apr 2011 05:56:46 +0000 (11:26 +0530)]
ath9k_htc: Use separate URB pool for management frames

Beacon transmission needs to involve as little latency
as possible after receiving a SWBA event from the target.
Since packets are buffered to use TX stream mode, beacon
frames sometimes gets queued up and are not sent out immediately.
Fix this by decoupling management frame transmission from the
normal data path and send them out immediately.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add a timer to cleanup WMI events
Sujith Manoharan [Wed, 13 Apr 2011 05:56:39 +0000 (11:26 +0530)]
ath9k_htc: Add a timer to cleanup WMI events

Occasionally, a WMI event would arrive ahead of the TX
URB completion handler. Discarding these events would exhaust
the available TX slots, so handle them by running a timer
cleaning up such events. Also, timeout packets for which TX
completion events have not arrived.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add a debugfs file showing endpoint status
Sujith Manoharan [Wed, 13 Apr 2011 05:56:31 +0000 (11:26 +0530)]
ath9k_htc: Add a debugfs file showing endpoint status

Location: ath9k_htc/phy#/queue

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add a debugfs file to dump TX slot information
Sujith Manoharan [Wed, 13 Apr 2011 05:56:26 +0000 (11:26 +0530)]
ath9k_htc: Add a debugfs file to dump TX slot information

Location: ath9k_htc/phy#/slot

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add support for TX completion
Sujith Manoharan [Wed, 13 Apr 2011 05:56:18 +0000 (11:26 +0530)]
ath9k_htc: Add support for TX completion

Now that the infrastructure is in place, process WMI
TX status events and complete packets.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Drain packets on station removal
Sujith Manoharan [Wed, 13 Apr 2011 05:56:11 +0000 (11:26 +0530)]
ath9k_htc: Drain packets on station removal

When a station entry is removed, there could still be
pending packets destined for that station in the HIF layer.
Sending these to the target is not necessary, so drain them
in the driver itself.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Optimize HTC start/stop API
Sujith Manoharan [Wed, 13 Apr 2011 05:56:06 +0000 (11:26 +0530)]
ath9k_htc: Optimize HTC start/stop API

There is no point in looping over all the endpoints,
since the HIF layer uses the start/stop APIs only
for the TX pipe. Simplify the API accordingly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Drain pending TX frames properly
Sujith Manoharan [Wed, 13 Apr 2011 05:55:59 +0000 (11:25 +0530)]
ath9k_htc: Drain pending TX frames properly

When doing a channel set or a reset operation the pending
frames queued up for transmission have to be flushed and
sent to mac80211. Fixing this has to be done in two separate
steps:

  * Flush queued frames and kill the URB TX completion handler.
  * Complete all the frames that in the TX pending queue.

This patch adds proper support for draining and all the callsites
namely, channel change/reset/idle/stop are fixed. A separate queue
is used for handling failed frames.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Use helper functions for TX processing
Sujith Manoharan [Wed, 13 Apr 2011 05:55:54 +0000 (11:25 +0530)]
ath9k_htc: Use helper functions for TX processing

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add TX slots
Sujith Manoharan [Wed, 13 Apr 2011 05:55:47 +0000 (11:25 +0530)]
ath9k_htc: Add TX slots

Maintain a bitmap of slots for transmission and update
the cookie field for every packet with the slot value.
This value would be used for matching packets when TX
completion processing is added.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Move endpoint header parsing to TX tasklet
Sujith Manoharan [Wed, 13 Apr 2011 05:55:41 +0000 (11:25 +0530)]
ath9k_htc: Move endpoint header parsing to TX tasklet

There is no need to do endpoint header removal in the ISR.
Also, this is needed when TX slot management is added later on.
Use a helper function to strip the driver header.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Introduce new HTC API
Sujith Manoharan [Wed, 13 Apr 2011 05:55:35 +0000 (11:25 +0530)]
ath9k_htc: Introduce new HTC API

A new routine that takes an endpoint explicitly is
introduced. The normal htc_send() now retrieves the endpoint
from the packet's private data. This would be useful
in TX completion when the endpoint ID would be required.
While at it, use a helper function to map the queue to endpoint.

Data/mgmt/beacon packets use htc_send(), while WMI comamnds
pass the endpoint to HTC.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix TX queue management
Sujith Manoharan [Wed, 13 Apr 2011 05:55:29 +0000 (11:25 +0530)]
ath9k_htc: Fix TX queue management

Handle queue start/stop properly by maintaining
a counter to check if the pending frame count has
exceeded the threshold. Otherwise, packets would be
dropped needlessly. While at it, use a simple flag
to track queue status and use helper functions too.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Increase URB count for REG_IN pipe
Sujith Manoharan [Wed, 13 Apr 2011 05:55:23 +0000 (11:25 +0530)]
ath9k_htc: Increase URB count for REG_IN pipe

Using a single URB for receiving WMI events is
insufficient, increase it to 64 to not lose
WMI events in high throughput situations.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add a new WMI event WMI_TXSTATUS_EVENTID
Sujith Manoharan [Wed, 13 Apr 2011 05:55:18 +0000 (11:25 +0530)]
ath9k_htc: Add a new WMI event WMI_TXSTATUS_EVENTID

This event will be generated by the target for packet completions.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Sync MGMT/DATA packet headers with firmware
Sujith Manoharan [Wed, 13 Apr 2011 05:55:12 +0000 (11:25 +0530)]
ath9k_htc: Sync MGMT/DATA packet headers with firmware

Add a new cookie field that would be filled by the host.
This can be used to match the TX status WMI event with
the appropriate packet.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Reduce TX queue size
Sujith Manoharan [Wed, 13 Apr 2011 05:55:06 +0000 (11:25 +0530)]
ath9k_htc: Reduce TX queue size

The current max queue length of 1024 is quite large
and unnecessary. 256 suffices well enough even for high
throughput situations.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Move TX specific stuff to a separate structure
Sujith Manoharan [Wed, 13 Apr 2011 05:55:00 +0000 (11:25 +0530)]
ath9k_htc: Move TX specific stuff to a separate structure

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Remove unused WMI_WLAN_TXCOMP_EVENTID
Sujith Manoharan [Wed, 13 Apr 2011 05:54:55 +0000 (11:24 +0530)]
ath9k_htc: Remove unused WMI_WLAN_TXCOMP_EVENTID

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Sync struct ath9k_htc_cap_target with FW
Sujith Manoharan [Wed, 13 Apr 2011 05:54:49 +0000 (11:24 +0530)]
ath9k_htc: Sync struct ath9k_htc_cap_target with FW

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Sync struct ath9k_htc_target_vif with FW
Sujith Manoharan [Wed, 13 Apr 2011 05:54:43 +0000 (11:24 +0530)]
ath9k_htc: Sync struct ath9k_htc_target_vif with FW

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Sync struct ath9k_htc_target_sta with FW
Sujith Manoharan [Wed, 13 Apr 2011 05:54:37 +0000 (11:24 +0530)]
ath9k_htc: Sync struct ath9k_htc_target_sta with FW

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Use SKB's private area for TX parameters
Sujith Manoharan [Wed, 13 Apr 2011 05:54:31 +0000 (11:24 +0530)]
ath9k_htc: Use SKB's private area for TX parameters

For all packets sent through the USB_WLAN_TX_PIPE endpoint,
the private area of the SKB's tx_info can be used to store
driver-specific information. For packets sent through USB_REG_OUT_PIPE,
this will not make a difference since they are routed through a
separate routine that doesn't access the private region.

This would help in situations where TX information is required
in the URB callback.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Remove unused WMI commands
Sujith Manoharan [Wed, 13 Apr 2011 05:54:25 +0000 (11:24 +0530)]
ath9k_htc: Remove unused WMI commands

WMI_TGT_TXQ_ENABLE_CMDID
WMI_HOST_ATTACH
WMI_DEBUG_INFO_CMDID
WMI_BEACON_UPDATE_CMDID
WMI_RESET_CMDID
WMI_RX_LINK_CMDID
WMI_STOP_DMA_RECV_CMDID

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix RX length check
Sujith Manoharan [Wed, 13 Apr 2011 05:54:19 +0000 (11:24 +0530)]
ath9k_htc: Fix RX length check

The length of the received SKB could be equal to
HTC_RX_FRAME_HEADER_SIZE in case of packets with phy/crc errors,
in which case they are dropped without being processed.
Fix this check so that the error counters are updated correctly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add RX error statistics
Sujith Manoharan [Wed, 13 Apr 2011 05:54:10 +0000 (11:24 +0530)]
ath9k_htc: Add RX error statistics

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Move debug code to a separate file
Sujith Manoharan [Wed, 13 Apr 2011 05:54:00 +0000 (11:24 +0530)]
ath9k_htc: Move debug code to a separate file

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Queue WMI events
Sujith Manoharan [Wed, 13 Apr 2011 05:53:52 +0000 (11:23 +0530)]
ath9k_htc: Queue WMI events

Use a queue to handle WMI events and schedule a tasklet
to process the events. This fixes the race between the
WMI event ISR and the SWBA tasklet when the arrival of
WMI events in quick succession could overwrite the SWBA
data before the tasklet from a previous iteration could
have been scheduled. Also, drain the WMI queue properly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix beacon miss under heavy load
Sujith Manoharan [Wed, 13 Apr 2011 05:53:44 +0000 (11:23 +0530)]
ath9k_htc: Fix beacon miss under heavy load

Transmission of beacons becomes erratic when TX load
is high, since the latency involved in the generation
of a SWBA interrupt on the target to the actual sending
of a beacon is quite high for USB devices.

Fix this by adjusting the beacon response time.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Handle buffered frames in AP mode
Sujith Manoharan [Wed, 13 Apr 2011 05:53:34 +0000 (11:23 +0530)]
ath9k_htc: Handle buffered frames in AP mode

Use the CAB endpoint to send buffered multicast or
broadcast frames after each SWBA event.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Configure the beacon queue
Sujith Manoharan [Wed, 13 Apr 2011 05:53:26 +0000 (11:23 +0530)]
ath9k_htc: Configure the beacon queue

Set operating parameters (cwmin, cwmax) for the beacon queue
in AP mode.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add TSF adjust capability
Sujith Manoharan [Wed, 13 Apr 2011 05:53:17 +0000 (11:23 +0530)]
ath9k_htc: Add TSF adjust capability

In multi-interface mode, beacons/probe responses that are
sent out must have their timestamp field updated. Calculate
the TSF adjustment value for each beaconing interface and set it
in the frame properly.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add beacon slots
Sujith Manoharan [Wed, 13 Apr 2011 05:53:08 +0000 (11:23 +0530)]
ath9k_htc: Add beacon slots

Beacon transmission is now handled through a slot mechanism.
This allows multiple beaconing interfaces to be be present.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix WMI and beacon header
Sujith Manoharan [Wed, 13 Apr 2011 05:52:59 +0000 (11:22 +0530)]
ath9k_htc: Fix WMI and beacon header

Match the beacon header with that of the firmware.
Also, the firmware reports the TSF for an SWBA, so
store it.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Add a WMI command to get the firmware version
Sujith Manoharan [Wed, 13 Apr 2011 05:52:51 +0000 (11:22 +0530)]
ath9k_htc: Add a WMI command to get the firmware version

Also, update the wiphy information and use the correct
device pointer when registering. This would fix ethtool.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Rename firmware
Sujith Manoharan [Wed, 13 Apr 2011 05:52:42 +0000 (11:22 +0530)]
ath9k_htc: Rename firmware

Since the new FW requires backward incompatible host driver changes,
rename the FW to allow older driver versions to work with the
older FW.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Remove AR7010 v1.0 support
Sujith Manoharan [Wed, 13 Apr 2011 05:52:33 +0000 (11:22 +0530)]
ath9k_htc: Remove AR7010 v1.0 support

All the AR7010 devices supoprted by ath9k_htc are based
on version v1.1, so remove support for v1.0.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: use traffic threshold to decide when to start ampdu
Brian Cavagnolo [Tue, 12 Apr 2011 18:06:28 +0000 (11:06 -0700)]
mwl8k: use traffic threshold to decide when to start ampdu

Currently, ampdu stream is created on the first qos packet to an
HT sta. The overhead of setting up the BA session may not be
justified if the outgoing packet rate is minimal (e.g., ping). So
we only allow ampdu streams after seeing a critical number of
packets in an arbitrary one-second interval.

Based on work by Nishant Sarmukadam <nishants@marvell.com>

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: receive EAP frames from a station in an AP VLAN on the main AP
Felix Fietkau [Tue, 12 Apr 2011 17:15:22 +0000 (19:15 +0200)]
mac80211: receive EAP frames from a station in an AP VLAN on the main AP

This makes it easier to handle moving stations to VLAN interfaces that are
part of a different bridge.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: introduce ATH9K_{PCI,AHB} config options
Gabor Juhos [Tue, 12 Apr 2011 16:23:16 +0000 (18:23 +0200)]
ath9k: introduce ATH9K_{PCI,AHB} config options

Currently ath9k only available in menuconfig if PCI bus
support is enabled. However the driver is required for
the built-in wireless MACs of the Atheros AR9130/AR9132
SoCs. These SoCs have no PCI controller, the wireless
MAC is connected to the AHB bus on them.

Introduce separated config options for the supported
buses, in order to allow building of ath9h without PCI
bus support.

As a bonus, this patch removes the cross-reference of
the ATHEROS_AR71XX option which is not present in the
kernel.

Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
Cc: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwl8k: interrupt handling changes
Nishant Sarmukadam [Fri, 8 Apr 2011 09:08:27 +0000 (14:38 +0530)]
mwl8k: interrupt handling changes

We do not need to enable all the interrupts in mwl8k_probe_hw.
We need to enable only MWL8K_A2H_INT_OPC_DONE interrupt for sending
commands to the firmware. Keep the other interrupts masked in
mwl8k_probe_hw. Also, in mwl8k_start, where we expect other interrupts,
enable only those interrupts we are interested in.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: improve comments for optimized tx descriptor setup
John W. Linville [Wed, 13 Apr 2011 12:47:32 +0000 (08:47 -0400)]
ath5k: improve comments for optimized tx descriptor setup

Comment the use of local variables to reduce the number of load/store
operations on uncached memory, in hopes of not losing this optimization
accidentally in the future.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Register id table for platform device
Vasanthakumar Thiagarajan [Tue, 12 Apr 2011 07:12:22 +0000 (12:42 +0530)]
ath9k: Register id table for platform device

Currently the device id in the platform driver is hardcoded to an id
which is specific to AR9130/AR9132 SOCs as it supports only wmac (wireless mac)
of these SOCs. But this needs to be dynamic when we want to support different
wmac of SOCs. So add id_table to driver to make it extendable to more SOCs.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2800usb: Add seven new USB IDs
Mark Davis [Tue, 12 Apr 2011 04:19:10 +0000 (00:19 -0400)]
rt2800usb: Add seven new USB IDs

Adds USB IDs for seven previously missing devices. Additionally, all
instances of 'Conceptronic' have been replaced by the OEM name.

Devices added are..
0411:01a2 - Buffalo WLI-UC-GNM, RT3070V
0586:341e - ZyXEL NWD2105, RT3070
13b1:002f - Linksys AE1000, RT3572
13b1:0031 - Cisco / Linksys AM10, RT3072
14b2:3c2c - Keebox W150NU / Alpha Networks WUS-N12, RT3070
157e:3013 - TRENDnet TEW-645UB, RT2770+RT2720
15a9:0012 - Airlink AWLL7025 / Gemtek WUBR-208N, RT2870+RT2850

Signed-off-by: Mark Davis <marked86@gmail.com>
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>
13 years agoath9k_hw: update AR9003 low_ob_db_tx_gain to improve spur performance
Rajkumar Manoharan [Mon, 11 Apr 2011 14:52:30 +0000 (20:22 +0530)]
ath9k_hw: update AR9003 low_ob_db_tx_gain to improve spur performance

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: update Ar9003 intervals to fix carrier leak
Rajkumar Manoharan [Mon, 11 Apr 2011 14:52:29 +0000 (20:22 +0530)]
ath9k_hw: update Ar9003 intervals to fix carrier leak

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Remove unused code in AR9287 eeprom
Rajkumar Manoharan [Mon, 11 Apr 2011 14:52:28 +0000 (20:22 +0530)]
ath9k_hw: Remove unused code in AR9287 eeprom

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Implement integer mode for AR9485
Vasanthakumar Thiagarajan [Mon, 11 Apr 2011 11:09:40 +0000 (16:39 +0530)]
ath9k: Implement integer mode for AR9485

This fixes random disconnect.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortlwifi: rtl8192ce: Fix LED initialization
Chaoming Li [Sun, 10 Apr 2011 23:30:23 +0000 (18:30 -0500)]
rtlwifi: rtl8192ce: Fix LED initialization

Driver rtl8192ce does not initialize the LED correctly.

Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: index out of bounds
roel [Sun, 10 Apr 2011 19:09:55 +0000 (21:09 +0200)]
ath9k: index out of bounds

Check whether index is within bounds before testing the element

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: index out of bounds
roel [Sun, 10 Apr 2011 19:09:50 +0000 (21:09 +0200)]
ath9k_hw: index out of bounds

Check whether index is within bounds before testing the element

Both spurChans arrays in modalHeader5G and modalHeader2G have 5 elements,
AR_EEPROM_MODAL_SPURS is defined 5. So unless a break occurs, in the
last iteration (i=5) we tried to access spurChansPtr[5] before testing
whether i was within bounds. Fix this.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: reduce interrupt load caused by rx/tx interrupts
Felix Fietkau [Sun, 10 Apr 2011 16:32:19 +0000 (18:32 +0200)]
ath5k: reduce interrupt load caused by rx/tx interrupts

While the rx/tx tasklet is pending, new unnecessary interrupts may arrive.
Decrease the load by temporarily disabling the interrupts until the tasklet
has completed.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: clean up debugfs code
Felix Fietkau [Sun, 10 Apr 2011 16:32:18 +0000 (18:32 +0200)]
ath5k: clean up debugfs code

The pointers to the debugfs entries do not need to be saved, because they
will be recursively removed when the wiphy is unregistered.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: remove ts_retry from ath5k_tx_status
Felix Fietkau [Sun, 10 Apr 2011 16:32:17 +0000 (18:32 +0200)]
ath5k: remove ts_retry from ath5k_tx_status

Reusing the configured retry counts from the skb cb is more efficient than
reloading the data from uncached memory.
Replace ts_longretry (unused) with ts_final_retry which contains the retry
count for the final rate only

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: optimize rx status processing
Felix Fietkau [Sun, 10 Apr 2011 16:32:16 +0000 (18:32 +0200)]
ath5k: optimize rx status processing

Use ACCESS_ONCE to reduce the number of redundant loads on uncached memory

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: optimize tx status processing
Felix Fietkau [Sun, 10 Apr 2011 16:32:15 +0000 (18:32 +0200)]
ath5k: optimize tx status processing

Use ACCESS_ONCE to reduce the number of variable reloads on uncached memory

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: remove ts_rate from ath5k_tx_status
Felix Fietkau [Sun, 10 Apr 2011 16:32:14 +0000 (18:32 +0200)]
ath5k: remove ts_rate from ath5k_tx_status

It is no longer necessary for preparing mac80211 tx status

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: optimize tx descriptor setup
Felix Fietkau [Sun, 10 Apr 2011 16:32:13 +0000 (18:32 +0200)]
ath5k: optimize tx descriptor setup

Use local variables to reduce the number of load/store operations on uncached
memory.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: fix slot time handling
Felix Fietkau [Sat, 9 Apr 2011 21:10:21 +0000 (23:10 +0200)]
ath5k: fix slot time handling

Set the slot time based on the mac80211 short slot vs long slot setting
instead of just forcing long slot for all CCK-enabled channels.
This slightly improves 802.11g mode performance in in my tests.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: fix SIFS time handling
Felix Fietkau [Sat, 9 Apr 2011 21:10:20 +0000 (23:10 +0200)]
ath5k: fix SIFS time handling

ath5k uses 8 usec as a sifs time, extracted from the initvals, whereas the
standard requires a sifs time of 10. The difference originates from the fact
that the SIFS register has an offset of 2 usec.
Fix the SIFS time definition to use the standard value of 10 usec and subtract
2 usecs when writing the SIFS register.

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