Commit graph

361769 commits

Author SHA1 Message Date
Rafał Miłecki
fb3bc67ed8 b43: use defines for board_type
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:57 +02:00
Rafał Miłecki
542e15f35d b43: N-PHY: fix "NB" RSSI calibration on PHYs rev2-
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:57 +02:00
Rafał Miłecki
a3764ef7a5 b43: N-PHY: use enum for RSSI type everywhere we use it
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:57 +02:00
Rafał Miłecki
2a2d058944 b43: N-PHY: rename RSSI types to be shorter and more accurate
Thanks to Broadcom releasing some code we can use better names.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:56 +02:00
Rafał Miłecki
37859a75cc b43: N-PHY: use more friendly variables names in RSSI code
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:56 +02:00
Rafał Miłecki
e5ab1fd7a5 b43: N-PHY: simplify conditions in RSSI offset scale function
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:56 +02:00
Rafał Miłecki
6aa38725a5 b43: N-PHY: use enum for RAIL type
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:56 +02:00
Rafał Miłecki
2d551f1410 b43: HT-PHY: use enum for RSSI types
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:56 +02:00
Rafał Miłecki
418e8b6805 b43: HT-PHY: store TX power state before disabling it
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:56 +02:00
Rafał Miłecki
fc6ab1e0c0 b43: HT-PHY: define regs for power estimation
In MMIO dumps of ndiswrapper there are following PHY ops:
phy_read(0x0118) -> 0x013d
phy_read(0x01ed) -> 0x993d
phy_read(0x0119) -> 0x012f
phy_read(0x01ee) -> 0x992f
phy_read(0x011a) -> 0x0139
phy_read(0x0969) -> 0x9939
It matches the code of wlc_phy_txpower_est_power_nphy (from brcm80211),
so we know the registers meaning.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:56 +02:00
Rafał Miłecki
dc3c4e1271 b43: HT-PHY: do some extra TSSI setup after configuring TX
After b43_phy_ht_tx_power_ctl_setup there are some extra radio ops:
 radio_read(0x08bf) -> 0x0001
radio_write(0x08bf) <- 0x0001
radio_write(0x0159) <- 0x0011
On N-PHY we write 0x11 to TSSI regs, so it's probably sth similar.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:55 +02:00
Rafał Miłecki
9cfc17cbbf b43: HT-PHY: finish calculating values for idle TSSI
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:55 +02:00
Rafał Miłecki
9a0bc41e1c b43: HT-PHY: tables: don't duplicate core-generic regs
Now when we know many radio regs at 0x000 are core-generic, I've noticed
we duplicate some values in the tables.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:55 +02:00
Rafał Miłecki
d6657db90a b43: HT-PHY: rename defines addressing cores on the 2059 radio
After comparing writes to registers at 0x000, 0x400 and 0x800 it seems
there are many very similar writes. So 0x000 offset is not for accessing
something totally different, but probably just the first out of three
cores.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-04-23 12:27:55 +02:00
Bing Zhao
c43933e61e mwifiex: remove redundant initialization for bss_descriptor
Initialization of bss_descriptor is unnecessary as the entire
structure will be overwritten by a memcpy followed by.

Initialize disable_11ac flag properly by setting it to true in
mwifiex_fill_new_bss_desc().

Reported-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:38:36 -04:00
Bing Zhao
d837a2ae40 mwifiex: fix use-after-free in beacon_ie processing
beacon_ie buffer is allocated in mwifiex_fill_new_bss_desc()
and the buffer pointer is saved in bss_desc->beacon_buf.
beacon_ie is freed before the function returns. However,
bss_desc->beacon_buf is still being accessed afterwards.

Fix it by freeing beacon_ie (bss_desc->beacon_buf) in
caller's scope.

Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:38:35 -04:00
Bing Zhao
8bc77a4d2c mwifiex: don't try to associate when bss_mode is not STA
We have blocked association attempts on interfaces configured in
AP and AD-HOC modes. P2P mode should be blocked too.

Furthermore, an error code must be returned if we are unable to
associate.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:28 -04:00
Bing Zhao
4587eea5b7 mwifiex: make use of msecs_to_jiffies()
Use msecs_to_jiffies() wherever possible.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:28 -04:00
Bing Zhao
0648f3a4b0 mwifiex: correct bss_mode check while appending vht operation IE
priv->bss_mode uses NL80211_IFTYPE_* definitions.
HostCmd_BSS_MODE_IBSS is used in ad-hoc start/join command between
driver and firmware.

Coincidentally both HostCmd_BSS_MODE_IBSS and NL80211_IFTYPE_STATION
are defined as 2. That explains why nobody complained.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:28 -04:00
Avinash Patil
d033d3a6b1 mwifiex: use PCI_DMA_FROMDEVICE for RX queue de-init
There is a typo in mwifiex_cleanup_rxq_ring() which uses
PCI_DMA_TODEVICE while unmapping PCI memory.
We should actually use PCI_DMA_FROMDEVICE.

Signed-off-by: Avinash Patil <patila@marvell.com>
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>
2013-04-22 15:20:27 -04:00
Bing Zhao
66aa1ae2e7 mwifiex: configure p2p interface during initialization
Send P2P_MODE_CFG cmd to firmware when p2p interface is created.
Without proper p2p configuration firmware may behave incorrectly
while handling commands sent through this interface.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:27 -04:00
Paul Stewart
5586d3e2f2 mwifiex: Start P2P devices in P2P mode
p2p devices should identify themselves as such to userspace at
startup, so the connection manager can decide which interface
to start wpa_supplicant instances on.

Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:27 -04:00
Joe Perches
ec9c498991 rt2x00: Use more current logging styles, shrink object size
Reduce object space ~2% using more current logging styles.

Neaten and simplify logging macros.
Use wiphy_<level> where appropriate.
Coalesce formats.

Convert ERROR/WARNING/INFO macros to rt2x00_<level>
Convert EEPROM to rt2x00_eeprom_dbg
Convert PROBE_ERROR to rt2x00_probe_err
Convert DEBUG to rt2x00_dbg
Convert EEPROM to rt2x00_eeprom_dbg

$ size drivers/net/wireless/rt2x00/built-in.o*
   text	   data	    bss	    dec	    hex	filename
 245639	  71696	  69584	 386919	  5e767	drivers/net/wireless/rt2x00/built-in.o.new
 240609	  70096	  68944	 379649	  5cb01	drivers/net/wireless/rt2x00/built-in.o.new.nodyndbg
 240609	  70096	  68944	 379649	  5cb01	drivers/net/wireless/rt2x00/built-in.o.new.no_rt2x00_debug
 249198	  70096	  70352	 389646	  5f20e	drivers/net/wireless/rt2x00/built-in.o.old
 249198	  70096	  70352	 389646	  5f20e	drivers/net/wireless/rt2x00/built-in.o.old.nodyndbg
 244222	  70096	  69712	 384030	  5dc1e	drivers/net/wireless/rt2x00/built-in.o.old.no_rt2x00_debug

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:26 -04:00
Gabor Juhos
624708b85e rt2x00: rt2800lib: rename rt2800_init_bbb_early to rt2800_init_bbp_early
The function is used for BBP register initialization,
fix the typo in the function name to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:26 -04:00
Wei Yongjun
16a1f73670 brcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()
The dereference to 'ifp' in debug code should be moved below the NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:25 -04:00
Vladimir Kondratiev
4fc4118cdb wil6210: more Rx descriptor accessor functions
Helpers to fetch various fields from the Rx descriptor

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:25 -04:00
Vladimir Kondratiev
4de41bef3e wil6210: Use cached copy of Tx descriptor
Original Tx descriptor stored is in non-cached area for DMA;
copy it to the cached memory to speed-up access

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:25 -04:00
Vladimir Kondratiev
b5d98e9d02 wil6210: Tx init optimization
vring size is known from the beginning, fill it immediately
in the struct initializer
This is minor optimization that reduces code size.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:24 -04:00
Vladimir Kondratiev
33e611690e wil6210: Use cached copy of Rx descriptor
Rx descriptors stored in non-cacheable memory area for DMA.
Non-cacheable memory causes long access time from CPU.

Copy rx descriptor to the skb->cb, and use this copy.
It provides faster memory access, and will be usefull to keep
Rx information for later processing (BACK reorder)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:24 -04:00
Arend van Spriel
047445c579 brcmfmac: stop dequeue upon sk_buff commit failure
In the dequeue worker the function brcmf_commit_skb() is called.
However, instead of increment the credit count upon success it
should break the for loop upon failure. Otherwise, it will result
in an endless loop.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:24 -04:00
Arend van Spriel
88f656fa10 brcmfmac: change return type for brcmf_rollback_toq() to void
The function brcmf_rollback_toq() is already called in error path
and its result should not override the initial error value. As the
function releases the sk_buff there is no need to return anything
so change return type to void.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:23 -04:00
Arend van Spriel
67994fa24a brcmfmac: finalize transmit upon any rollback failure
All rollback failures should result in freeing of the sk_buff
by calling brcmf_txfinalize().

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:23 -04:00
Arend van Spriel
6d421e54c2 brcmfmac: use lock in brcmf_fws_del_interface()
When deleting an interface in firmware-signalling module it will
clear any destination descriptors. To avoid concurrency issues it
should take the lock using brcmf_fws_lock().

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:22 -04:00
Arend van Spriel
a5e9d805f9 brcmfmac: schedule dequeue upon firmware-signal reception
Several firmware signals should be considered as opportunity to
send packets to the firmware. This patch adds conditional scheduling
of the dequeue worker thread while handling those signals.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:22 -04:00
Arend van Spriel
b75c1a301b brcmfmac: destination mac closed when interface is closed
Firmware signals a destination is closed as well as an interface. A
destination is associated with an interface. When an interface is
closed consequently the destination should be considered closed as
well.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:22 -04:00
Arend van Spriel
130e380b44 brcmutil: simplify brcmu_pkt_free_skb()
The function brcmu_pkt_free_skb() use skb->destructor to decide
how the sk_buff should be freed. However, when running AP mode
with iptables configured this results in a kernel warning.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:21 -04:00
Arend van Spriel
a652bf0381 brcmfmac: remove error message upon allocation failure
In function brcmf_add_if() an error message is printed
upon alloc_netdev() failure. The allocation failure itself
spews enough info in the log so remove the error message.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:21 -04:00
Arend van Spriel
991c209393 brcmfmac: check memory allocation in brcmf_add_if()
For P2P_DEVICE interface the struct brcmf_if instance is
allocated using kzalloc() which can fail. Add pointer
check and return -ENOMEM if it failed. Fixes the following
smatch error:

"drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c:770
brcmf_add_if()
  error: potential null dereference 'ifp'. (kzalloc returns null)"

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:21 -04:00
Arend van Spriel
07529d2047 brcmfmac: reinitialize dequeue mask per node
The mask was only initialized for the first node, but it should be
done for each node that is handled in the loop.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:20 -04:00
Stanislaw Gruszka
557985ae34 rt2800: nulify all last words of TXWI
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:20 -04:00
Stanislaw Gruszka
f0bda57104 rt2x00: provide separate information about TXWI & RXWI sizes
On new 2800 hardware sizes of TXWI & RXIW can be different than TXD
& RXD sizes, so we need to difference between them. Let's define
winfo_size as size of in buffer descriptor (TXWI & RXWI), and desc_size
of as size of additional descriptor - in separate DMA coherent buffer
for PCI hardware (TXD & RXD) and yet another in buffer descriptor for
USB hardware (TXINFO & RXINFO).

Change is rt2x00 wild, but should affect only 2800 driver.

Patch also fix beaconing for 5592usb AP mode.

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>
2013-04-22 15:20:20 -04:00
Stanislaw Gruszka
074f25295b rt2800: cleanup rt2800_init_rfcsr
This procedure is simple switch now and return no error any longer.

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:19 -04:00
Stanislaw Gruszka
da8064c2cf rt2800: add rt2800_normal_mode_setup_3xxx subroutine
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>
2013-04-22 15:20:19 -04:00
Stanislaw Gruszka
d9517f2f08 rt2800: add rt2800_led_open_drain_enable subroutine
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:18 -04:00
Stanislaw Gruszka
5de5a1f4d2 rt2800: move RF_R27 setup to individual rfcsr init subroutines
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:18 -04:00
Stanislaw Gruszka
c5b3c3500f rt2800: add rt2800_rx_filter_calibration procedure
Add procedure for both bands filter calibration and use it on individual
chipset init rfcsr subroutines.

Remove "Set back to initial state" code for 3290 since vendor driver
DPO_RT3290_LinuxSTA_V2600_20120508 does not include it.

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>
2013-04-22 15:20:18 -04:00
Stanislaw Gruszka
87d91db9d0 rt2800: move RFCSR6_R2 & LDO_CFG0 setup to 3572 specific rfcsr init
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:17 -04:00
Stanislaw Gruszka
2971e66f20 rt2800: move GPIO_SWITCH setup to 3390 specific rfcsr init
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:17 -04:00
Stanislaw Gruszka
c9a221b24a rt2800: move 30xx common rf init code
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:16 -04:00
Stanislaw Gruszka
f9cdcbb133 rt2800: move RFCSR29_RSSI_GAIN to 3290 specific rfcsr init
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-04-22 15:20:16 -04:00