GitHub/LineageOS/android_kernel_motorola_exynos9610.git
11 years agoMerge branch 'wl12xx-next' into for-linville
Luciano Coelho [Mon, 25 Mar 2013 15:06:37 +0000 (17:06 +0200)]
Merge branch 'wl12xx-next' into for-linville

11 years agowlcore: move handling from hardirq to the irq thread function
Luciano Coelho [Fri, 8 Mar 2013 07:41:53 +0000 (09:41 +0200)]
wlcore: move handling from hardirq to the irq thread function

Spin locks and completions are expensive in hard IRQ context and cause
problems with RT kernels.  In RT kernels, both spin locks and
completions can schedule(), so we can't use them in hard irq context.

Move handling code into the irq thread function to avoid that.

Reported-by: Gregoire Gentil <gregoire@alwaysinnovating.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: use print_hex_dump_debug()
Luciano Coelho [Tue, 12 Mar 2013 15:04:01 +0000 (17:04 +0200)]
wlcore: use print_hex_dump_debug()

We were printing out all the hex dumps regardless of whether dynamic
debugging was enabled or not.  Now that print_hex_dump_debug() has
been implemented, we can use that instead.

Reported-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: consider dummy packets when tx queues are empty
Arik Nemtsov [Tue, 12 Mar 2013 15:19:46 +0000 (17:19 +0200)]
wlcore: consider dummy packets when tx queues are empty

Don't ignore dummy packets when our queues are empty. This causes dummy
packets never to be sent when traffic is not suspended by FW thresholds,
which happens only in high Tx throughput situations. This may hurt Rx
performance.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: correctly check state before regdomain conf
Arik Nemtsov [Tue, 12 Mar 2013 15:19:45 +0000 (17:19 +0200)]
wlcore: correctly check state before regdomain conf

The wlcore state was checked without the mutex being taken. This leads
to WARN_ONs sometimes if a notification arrives when the driver
is on, but the mutex is only taken after it is off. This usually
happens if stopping the driver while connected to a network.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: AP-mode - recover security seq num for stations
Arik Nemtsov [Tue, 12 Mar 2013 15:19:44 +0000 (17:19 +0200)]
wlcore: AP-mode - recover security seq num for stations

Save the sequence number of the broadcast AP link in the wlvif. For each
connected station, save the sequence number in the drv_priv part of
ieee80211_sta. Use the saved numbers on recovery/resume, with the
obligatory increment on recovery.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: free AP global links properly on recovery
Arik Nemtsov [Tue, 12 Mar 2013 15:19:43 +0000 (17:19 +0200)]
wlcore: free AP global links properly on recovery

Dont use free_sta() on AP global links. It would fail an internal check
within the function and various structures within the link struct would
not be reset.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowl18xx: print chip info during boot
Victor Goldenshtein [Tue, 12 Mar 2013 15:19:42 +0000 (17:19 +0200)]
wl18xx: print chip info during boot

Print board type, PG with metal and ROM versions.
This might help debugging HW related issues.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: don't attempt to roam in case of p2p
Eyal Shapira [Tue, 12 Mar 2013 15:19:41 +0000 (17:19 +0200)]
wlcore: don't attempt to roam in case of p2p

For STA we report beacon loss to higher levels so that wpa_s
can attempt to roam without disconnecting. In case of P2P CLI
we don't want to attempt roaming and instead disconnect immediately
upon beacon loss.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: change warn on missing lock in wlcore_queue_xx funcs
Arik Nemtsov [Tue, 12 Mar 2013 15:19:40 +0000 (17:19 +0200)]
wlcore: change warn on missing lock in wlcore_queue_xx funcs

On !CONFIG_SMP builds spin_is_locked always returns 0. Assert the
locking using assert_spin_locked, which is written to behave correctly
in all cases.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: report rssi from roaming statistics
Nadim Zubidat [Tue, 12 Mar 2013 15:19:39 +0000 (17:19 +0200)]
wlcore: report rssi from roaming statistics

report the average beacon rssi which is calculated
by firmware for roaming statistics instead of the
last rx packet rssi. this results a more accurate
rssi reporting

Signed-off-by: Nadim Zubidat <nadimz@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: consolidate tx_seq handling on recovery
Arik Nemtsov [Tue, 12 Mar 2013 15:19:38 +0000 (17:19 +0200)]
wlcore: consolidate tx_seq handling on recovery

Accumulate the total number of sent packets per-link to find out how far
the encryption sequence number has progressed. Use this number as the
initial security sequence number after recovery.

This consolidates security sequence handling for both chip families, as
we no longer have to rely on 12xx specific Tx completion.

A fortunate side effect of this is correct management of seq numbers for
AP roles and multi-role scenarios.

When a link is removed we save the last seq number on a persistent part
of the wlvif. This helps the data survive through recoveries/suspends,
which also entail changes in the hlid of the link.

This functionality is STA only currently.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: don't risk using stale HLID during .sta_state callback
Arik Nemtsov [Tue, 12 Mar 2013 15:19:37 +0000 (17:19 +0200)]
wlcore: don't risk using stale HLID during .sta_state callback

The HLID of a STA can change, particularly during recovery. Don't cache
the HLID before it was potentially allocated.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: fix link count in single-link-PSM optimization
Arik Nemtsov [Tue, 12 Mar 2013 15:19:36 +0000 (17:19 +0200)]
wlcore: fix link count in single-link-PSM optimization

commit 144614f3eebd7d only allowed a single active link when
turning on the optimization, ignoring the fact that an AP has two
additional global links.
Use 3 links as an indication for a single active link. Use the
FW PSM bits to verify the extra active link belongs to the AP role.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: set max num of Rx BA sessions per chip
Igal Chernobelsky [Tue, 12 Mar 2013 15:19:35 +0000 (17:19 +0200)]
wlcore: set max num of Rx BA sessions per chip

Maximum number of supported RX BA sessions depends on chip type.
wl18xx supports 5 RX BA sessions while wl12xx supports 3.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: enter elp in force ps mode in 5ms
Igal Chernobelsky [Tue, 12 Mar 2013 15:19:34 +0000 (17:19 +0200)]
wlcore: enter elp in force ps mode in 5ms

It is requiered to enter sleep mode with smaller delay in forced PS mode.
This fixes issue of testing force PS mode during VoIP traffic where packets
are sent every 20ms. Chip never enters ps mode with default 30 ms delay
in such test.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agoath6kl: fix size_t printf warnings
Kalle Valo [Tue, 19 Mar 2013 13:25:20 +0000 (15:25 +0200)]
ath6kl: fix size_t printf warnings

My new tracing code for ath6kl introduced these warnings on 64-bit:

trace.h:38:1: warning: format '%d' expects argument of type 'int',
but argument 4 has type 'size_t' [-Wformat]
trace.h:61:1: warning: format '%d' expects argument of type 'int',
but argument 4 has type 'size_t' [-Wformat]
trace.h:84:1: warning: format '%d' expects argument of type 'int',
but argument 6 has type 'size_t' [-Wformat]
trace.h:119:1: warning: format '%d' expects argument of type 'int',
but argument 7 has type 'size_t' [-Wformat]
trace.h:173:1: warning: format '%d' expects argument of type 'int',
but argument 3 has type 'size_t' [-Wformat]
trace.h:193:1: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'size_t' [-Wformat]
trace.h:221:1: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'size_t' [-Wformat]

Fix them by using %zd.

Reported-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: add more USB devices IDs
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:53 +0000 (19:19 +0100)]
rt2800: 5592: add more USB devices IDs

Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: iq calibration for 5GHz
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:52 +0000 (19:19 +0100)]
rt2800: 5592: iq calibration for 5GHz

Based on:
RT5592_IQCalibration()

DPO_RT5572_LinuxSTA_2.6.1.3_20121022/cips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: add Kconfig
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:51 +0000 (19:19 +0100)]
rt2800: 5592: add Kconfig

Enable support to 5592 chip.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: TXWI & RXWI descriptors size
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:50 +0000 (19:19 +0100)]
rt2800: 5592: TXWI & RXWI descriptors size

Based on:
TXWI_STRUC
RXWI_STRUC

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/include/chip/rtmp_mac.h

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: add chip specific vgc calculations
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:49 +0000 (19:19 +0100)]
rt2800: 5592: add chip specific vgc calculations

Based on:
RT5592_ChipAGCAdjust()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: add AGC init
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:48 +0000 (19:19 +0100)]
rt2800: 5592: add AGC init

Based on:
RT5592_RTMPAGCInit()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: add write_with_rx_chain function
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:47 +0000 (19:19 +0100)]
rt2800: add write_with_rx_chain function

Based on:
AsicBBPWriteWithRxChain()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rtmp_chip.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: rearrange bbp/rfcsr initialization
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:46 +0000 (19:19 +0100)]
rt2800: rearrange bbp/rfcsr initialization

This makes order of initialization of various registers similar like
on vendor driver.

Based on:
NICInitializeAsic()
RT5592LoadRFNormalModeSetup()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/common/rtmp_init.c
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chip/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: add iq calibration
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:45 +0000 (19:19 +0100)]
rt2800: 5592: add iq calibration

Based on:
GetIQCalibration()
IQCalibration()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rtmp_chip.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: more channel switch registers settings (BBP & GLRT)
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:44 +0000 (19:19 +0100)]
rt2800: 5592: more channel switch registers settings (BBP & GLRT)

Based on:
RT5592_ChipSwitchChannel()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: enable rf init
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:43 +0000 (19:19 +0100)]
rt2800: 5592: enable rf init

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: setup LDO_CFG0 when configuring channel
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:42 +0000 (19:19 +0100)]
rt2800: 5592: setup LDO_CFG0 when configuring channel

Based on:
RT5592_ChipSwitchChannel()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: init frequency calibration
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:41 +0000 (19:19 +0100)]
rt2800: 5592: init frequency calibration

Based on:
InitFrequencyCalibrationMode()
RT5592_ChipCap

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/common/frq_cal.c
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: initialize RF_38/39/30 registers
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:40 +0000 (19:19 +0100)]
rt2800: 5592: initialize RF_38/39/30 registers

Based on:
RT5592LoadRFNormalModeSetup()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: initialize BBP_R138 register
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:39 +0000 (19:19 +0100)]
rt2800: 5592: initialize BBP_R138 register

Based on:
RT5592LoadRFNormalModeSetup()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: initalize BBP_R103 register on new revisions
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:38 +0000 (19:19 +0100)]
rt2800: 5592: initalize BBP_R103 register on new revisions

Based on:
NICInitRT5592RFRegisters()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: initalize RF_R27 on older revisions
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:37 +0000 (19:19 +0100)]
rt2800: 5592: initalize RF_R27 on older revisions

Based on:
NICInitRT5592RFRegisters()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: RF early registers initialization
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:36 +0000 (19:19 +0100)]
rt2800: 5592: RF early registers initialization

Based on:
NICInitRT5592RFRegisters()
RF5592Reg_2G_5G[]

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

This patch also merge common frequency adjustment (RF_R17 settings)
code. Further work is needed, to setup more RF/BBP/MAC registers after
that.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: common BBP initialization
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:35 +0000 (19:19 +0100)]
rt2800: 5592: common BBP initialization

Add BBP registers initialization common with other chipsets, but for now
performed only for 5592.

Based on:
NICInitBBP()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/common/rtmp_init.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: BBP registers initialization
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:34 +0000 (19:19 +0100)]
rt2800: 5592: BBP registers initialization

Based on:
NICInitRT5592BbpRegisters()
NICInitBBP()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/common/rtmp_init.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: MAC registers initalization
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:33 +0000 (19:19 +0100)]
rt2800: 5592: MAC registers initalization

Based on:
NICInitRT5592MacRegisters()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

On vendor driver we do not initialize TX_SW_CFG{1,2}. However the same
difference is between rt2x00 and vendor driver for 5390 chip.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: channel config stub
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:32 +0000 (19:19 +0100)]
rt2800: 5592: channel config stub

Based on:
RT5592_ChipSwitchChannel()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: add channels table
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:31 +0000 (19:19 +0100)]
rt2800: 5592: add channels table

Based on:
RT5592_ChipSwitchChannel()
RT5592_Frequency_Plan_Xtal20M[]
RT5592_Frequency_Plan_Xtal40M[]

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: 5592: early defines
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:30 +0000 (19:19 +0100)]
rt2800: 5592: early defines

Add basic defines for 5592 chip. It can not be enabled until
CONFIG_RT2800USB_RT55XX configuration option will be provided in the
Kconfig.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: do not crash if spec->channels is NULL
Stanislaw Gruszka [Sat, 16 Mar 2013 18:19:29 +0000 (19:19 +0100)]
rt2800: do not crash if spec->channels is NULL

In case the spec->channels was not specified, print warning instead
of hard crash the kernel.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Fix tx status reporting for reordered frames in rt2800pci
Helmut Schaa [Fri, 15 Mar 2013 08:57:57 +0000 (09:57 +0100)]
rt2x00: Fix tx status reporting for reordered frames in rt2800pci

rt2800 hardware sometimes reorders tx frames when transmitting to
multiple BA enabled STAs concurrently.

For example a tx queue
[ STA1 | STA2 | STA1 | STA2 ]
can result in the tx status reports
[ STA1 | STA1 | STA2 | STA2 ]
when the hw decides to put the frames for STA1 in one AMPDU.

To mitigate this effect associate the currently processed tx status
to the first frame in the tx queue with a matching wcid.

This patch fixes several problems related to incorrect tx status
reporting. Furthermore the tx rate selection is much more stable when
communicating with multiple STAs.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Revert "rt2x00: remove unused argument"
Helmut Schaa [Fri, 15 Mar 2013 08:57:56 +0000 (09:57 +0100)]
rt2x00: Revert "rt2x00: remove unused argument"

This reverts commit db36f792370959ff26458f80942cf98fe8249d95
since I'm going to use the data pointer that was removed in
a follow up patch.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: cleanup VHT cap
Yogesh Ashok Powar [Thu, 14 Mar 2013 01:32:47 +0000 (18:32 -0700)]
mwifiex: cleanup VHT cap

Firmware returned VHT cap has the same format that cfg80211
expects. There is no need to parse the vht cap from the firmware
and then set it to ieee80211_sta_vht_cap. Just copying is
sufficient.

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>
11 years agoMerge tag 'for-linville-20130318' of git://github.com/kvalo/ath6kl
John W. Linville [Mon, 18 Mar 2013 20:34:55 +0000 (16:34 -0400)]
Merge tag 'for-linville-20130318' of git://github.com/kvalo/ath6kl

11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Mon, 18 Mar 2013 13:39:21 +0000 (09:39 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless

Conflicts:
net/nfc/llcp/llcp.c

11 years agoath6kl: Fix a debugfs crash for USB devices
Mohammed Shafi Shajakhan [Tue, 12 Mar 2013 16:33:03 +0000 (22:03 +0530)]
ath6kl: Fix a debugfs crash for USB devices

Credit distribution stats is currently implemented
only for SDIO. This fixes a crash in debugfs for
USB interface.

BUG: unable to handle kernel NULL pointer dereference at   (null)
IP: [<f91c2048>] read_file_credit_dist_stats+0x38/0x330 [ath6kl_core]
*pde = b62bd067
Oops: 0000 [#1] SMP

EIP: 0060:[<f91c2048>] EFLAGS: 00210246 CPU: 0
EIP is at read_file_credit_dist_stats+0x38/0x330 [ath6kl_core]
EAX: 00000000 EBX: e6f7a9c0 ECX: e7b148b8 EDX: 00000000
ESI: 000000c8 EDI: e7b14000 EBP: e6e09f64 ESP: e6e09f30
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Process cat (pid: 4058, ti=e6e08000 task=e50cf230 task.ti=e6e08000)
Stack:
00008000 00000000 e6e09f64 c1132d3c 00004e71 e50cf230 00008000 089e4000
e7b148b8 00000000 e6f7a9c0 00008000 089e4000 e6e09f8c c11331fc e6e09f98
00000001 e6e09f7c f91c2010 e6e09fac e6f7a9c0 089e4877 089e4000 e6e09fac

Call Trace:
[<c1132d3c>] ? rw_verify_area+0x6c/0x120
[<c11331fc>] vfs_read+0x8c/0x160
[<f91c2010>] ? read_file_war_stats+0x130/0x130 [ath6kl_core]
[<c113330d>] sys_read+0x3d/0x70
[<c15755b4>] syscall_call+0x7/0xb
[<c1570000>] ? fill_powernow_table_pstate+0x127/0x127

Cc: Ryan Hsu <ryanhsu@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath: changed kmalloc to kmemdup
Andrei Epure [Sun, 10 Mar 2013 12:39:58 +0000 (14:39 +0200)]
ath: changed kmalloc to kmemdup

Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: Fix the byte alignment rule to avoid loss of bytes in a TCP segment
Myoungje Kim [Sun, 10 Mar 2013 06:16:05 +0000 (08:16 +0200)]
ath6kl: Fix the byte alignment rule to avoid loss of bytes in a TCP segment

Either first 3 bytes of the first received tcp segment or last one
over MTU size file can be loss due to the byte alignment problem.
Although ATH6KL_HTC_ALIGN_BYTES was defined for 'extra bytes for htc header
alignment' in the patch "Fix buffer alignment for scatter-gather
I/O"(1df94a857), there exists the bytes loss issue which means that it will be
truncated 3 bytes in the transmitted file contents if a file which has over MTU
size is transferred through TCP/IP stack.  It doesn't look like TCP/IP stack
bug of 3.5 or the latest version of kernel but the byte alignment issue.  This
patch is to use the roundup() function for the byte alignment rather than the
predefined ATH6KL_HTC_ALIGN_BYTES.

kvalo: fixed indentation

Signed-off-by: Myoungje Kim <mjei78@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: remove false check from ath6kl_rx()
Kalle Valo [Sun, 10 Mar 2013 05:51:39 +0000 (07:51 +0200)]
ath6kl: remove false check from ath6kl_rx()

Dan found a check from ath6kl_rx() which doesn't make any sense at all:

"  1327          if (status || !(skb->data + HTC_HDR_LENGTH)) {
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^
skb->data is a pointer.  This pointer math is always going to be false.
Should it be testing "packet->act_len < HTC_HDR_LENGTH" or something?"

I don't know what the check really was supposed to do, but I think Dan's guess
is right. Fix it accordingly.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: add an extra band check to ath6kl_wmi_beginscan_cmd()
Kalle Valo [Sun, 10 Mar 2013 05:51:29 +0000 (07:51 +0200)]
ath6kl: add an extra band check to ath6kl_wmi_beginscan_cmd()

Dan reported that smatch found a possible issue in ath6kl_wmi_beginscan_cmd()
where we might access sc->supp_rates beyond the end. It shouldn't happen as
ar->wiphy->bands always have just the first two bands set, but add an extra
check just to be sure.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: add tracing support to debug message macros
Kalle Valo [Mon, 18 Mar 2013 11:42:22 +0000 (13:42 +0200)]
ath6kl: add tracing support to debug message macros

Now all log messages are sent through the tracing infrastruture as well.
Tracing point doesn't follow debug_mask module parameter, instead it sends
all debug messages, so once you enable ath6kl_log_dbg tracing point you will
get a lot of messages. Needs to be discussed if this is sensible or not.
The overhead should be small enough and we anyway include debug level as
well so it's easy to filter in user space.

I wasn't really sure what to do with ath6kl_dbg_dump() and for now decided
that it also sends the buffer to user space. But most likely in the future
ath6kl_dbg_dump() should go away in favor of using proper tracing points, but
we will see.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: add tracing support to log functions
Kalle Valo [Mon, 18 Mar 2013 11:42:22 +0000 (13:42 +0200)]
ath6kl: add tracing support to log functions

All log messages are now sent through tracing interface as well if
ATH6KL_TRACING is enabled.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: convert ath6kl_info/err/warn macros to real functions
Kalle Valo [Mon, 18 Mar 2013 11:42:21 +0000 (13:42 +0200)]
ath6kl: convert ath6kl_info/err/warn macros to real functions

After this it's cleaner to add trace calls.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: adding tracing points for htc_mbox
Kalle Valo [Mon, 18 Mar 2013 11:42:21 +0000 (13:42 +0200)]
ath6kl: adding tracing points for htc_mbox

Add tracing points for htc layer, just dumping the packets to user space.
I wasn't really sure what to do with the status value, it might not always
be accurate, but I included it anyway.

I skipped htc_pipe (and usb) implementation for now. Need to add those
tracepoints later.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: add tracing point for hif irqs
Kalle Valo [Mon, 18 Mar 2013 11:42:21 +0000 (13:42 +0200)]
ath6kl: add tracing point for hif irqs

Add a tracing point for hif irq and dump the register content to user space.
This is in hif.c as we could use the same code also with SPI but, as ath6kl
doesn't SPI and most likely never will be, this is used just by SDIO so
name the trace point as ath6kl_sdio_irq to make it easier to manage filters.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: add tracing points for sdio transfers
Kalle Valo [Mon, 18 Mar 2013 11:42:20 +0000 (13:42 +0200)]
ath6kl: add tracing points for sdio transfers

Add tracing points for sdio transfers, just dump the address, flags and the
buffer.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: add tracing support and tracing points for wmi packets
Kalle Valo [Mon, 18 Mar 2013 11:42:20 +0000 (13:42 +0200)]
ath6kl: add tracing support and tracing points for wmi packets

Add basic tracing infrastructure support to ath6kl and which can be
enabled with CONFIG_ATH6KL_TRACING.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: cold reset target after host warm boot
Kalle Valo [Sat, 9 Mar 2013 10:01:50 +0000 (12:01 +0200)]
ath6kl: cold reset target after host warm boot

Julien reported that ar6004 usb device fails to initialise
after host has been rebooted and power is still on for the ar6004 device. He
found out that doing a cold reset fixes the issue.

I wasn't sure what would be the best way to detect if target needs a reset so I
settled on checking a timeout from htc_wait_recv_ctrl_message().

Reported-by: Julien Massot <jmassot@aldebaran-robotics.com>
Tested-by: Julien Massot <jmassot@aldebaran-robotics.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: fix usb related error handling and warnings
Kalle Valo [Sat, 9 Mar 2013 10:01:43 +0000 (12:01 +0200)]
ath6kl: fix usb related error handling and warnings

It was annoying to debug usb warm reboot initialisation problems as many usb
related functions just ignored errors and it wasn't obvious from the kernel
logs what was failing. Fix all that so that error messages are printed and
errors are handled properly.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: cleanup ath6kl_reset_device()
Kalle Valo [Sat, 9 Mar 2013 10:01:35 +0000 (12:01 +0200)]
ath6kl: cleanup ath6kl_reset_device()

Move it to init.c, make it static, remove all useless checks and force it to
always do cold reset.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agoath6kl: print firmware capabilities
Kalle Valo [Wed, 6 Mar 2013 06:56:06 +0000 (08:56 +0200)]
ath6kl: print firmware capabilities

Printin the  firmware capabilities during the first firmware boot makes it easier to find out what
features firmware supports.

Obligatory screenshot:

[21025.678481] ath6kl: ar6003 hw 2.1.1 sdio fw 3.2.0.144 api 3
[21025.678667] ath6kl: firmware supports: sched-scan,sta-p2pdev-duplex,rsn-cap-override

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
11 years agob43: HT-PHY: enable basic TX power setup
Rafał Miłecki [Thu, 7 Mar 2013 15:47:27 +0000 (16:47 +0100)]
b43: HT-PHY: enable basic TX power setup

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: setup TX power control
Rafał Miłecki [Thu, 7 Mar 2013 15:47:26 +0000 (16:47 +0100)]
b43: HT-PHY: setup TX power control

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: implement RSSI polling
Rafał Miłecki [Sat, 9 Mar 2013 12:56:26 +0000 (13:56 +0100)]
b43: HT-PHY: implement RSSI polling

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: implement playing sample tone
Rafał Miłecki [Thu, 7 Mar 2013 15:47:24 +0000 (16:47 +0100)]
b43: HT-PHY: implement playing sample tone

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: implement stopping sample tone playback
Rafał Miłecki [Thu, 7 Mar 2013 15:47:23 +0000 (16:47 +0100)]
b43: HT-PHY: implement stopping sample tone playback

It was another sequence I recognized in HT-PHY dump:
 phy_read(0x00c7) -> 0x0001
 phy_read(0x00c3) -> 0x0000
phy_write(0x00c3) <- 0x0002
 phy_read(0x00c3) -> 0x0000
phy_write(0x00c3) <- 0x0000
The difference to N-PHY is that it writes to 6 tables instead of a one
(after above).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: implement controlling TX power control
Rafał Miłecki [Sat, 9 Mar 2013 12:52:12 +0000 (13:52 +0100)]
b43: HT-PHY: implement controlling TX power control

Don't enable it until we have (almost?) whole TX power management
figured out. It's similar to the N-PHY, the difference is that we call a
"fix" *before* disabling power control.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: implement PA override
Rafał Miłecki [Sat, 9 Mar 2013 12:49:01 +0000 (13:49 +0100)]
b43: HT-PHY: implement PA override

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: implement CCA reset
Rafał Miłecki [Thu, 7 Mar 2013 15:47:20 +0000 (16:47 +0100)]
b43: HT-PHY: implement CCA reset

It was just another similar-to-N-PHY and easy-to-track routine:
write32 0xb0601408 <- 0x00002057
 phy_read(0x0001) -> 0x0000
phy_write(0x0001) <- 0x4000
phy_write(0x0001) <- 0x0000
write32 0xb0601408 <- 0x00002055
(b43_phy_ht_force_rf_sequence was moved up unmodified)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: implement MAC reclocking
Rafał Miłecki [Thu, 7 Mar 2013 15:47:19 +0000 (16:47 +0100)]
b43: HT-PHY: implement MAC reclocking

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: implement spurious tone avoidance
Rafał Miłecki [Thu, 7 Mar 2013 15:47:18 +0000 (16:47 +0100)]
b43: HT-PHY: implement spurious tone avoidance

On N-PHY it's also done after TX power fix, so it was easy to spot.
Unfortunately the MMIO logs I have from ndsiwrapper include channels
1-12 only, so enabling code for 13 and 14 is just a N-PHY-based guess.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: move TX fix to the separated function
Rafał Miłecki [Thu, 7 Mar 2013 15:47:17 +0000 (16:47 +0100)]
b43: HT-PHY: move TX fix to the separated function

On N-PHY after B43_PHY_B_TEST operation there is a call to TX power fix
function which iterates over available cores. It matches our HT-PHY code
which means it's probably also some TX fix.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: add classifier control function
Rafał Miłecki [Thu, 7 Mar 2013 15:47:16 +0000 (16:47 +0100)]
b43: HT-PHY: add classifier control function

After comparing operations on reg 0xB on N and HT it seems to be the
same register with similar ops. Implement them for HT-PHY.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: rename AFE defines
Rafał Miłecki [Sat, 9 Mar 2013 12:43:49 +0000 (13:43 +0100)]
b43: HT-PHY: rename AFE defines

It you take a look at N-PHY analog switch function it touches every core
on the chipset. It seems HT-PHY does they same, it just has 3 cores
instead of 2 (which make sense since BCM4331 is 3x3). Rename AFE defines
to include core id.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: temperature measurement
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:51 +0000 (14:12 +0200)]
wil6210: temperature measurement

Firmware got support for temperature measurement.
There are 2 temperature sensors: MAC and radio

"not available" temperature - reported by FW as 0 or ~0

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: sync with new firmware
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:50 +0000 (14:12 +0200)]
wil6210: sync with new firmware

Adjust driver for changes in the FW API.
Noticeable changes in the FW are:
- temperature sensing
- infrastructure for multiple connections
- infrastructure for P2P
- signal strength indication

This commit introduces only changes that are required to support same functionality
as previous firmware, no new features.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: new SW reset
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:49 +0000 (14:12 +0200)]
wil6210: new SW reset

New firmware allows for shorter SW reset procedure.
After SW reset, FW raises "fw done" IRQ, at this
moment mailbox control structures are initialized, driver caches it.

New status bit wil_status_reset_done introduced to track completion
of the reset. It is set by "fw ready" irq, and required for WMI rx flow
to access control structures.

WMI Tx flow protected by other status bit, wil_status_fwready. It can't
be set before wil_status_reset_done is set by design.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: headers clean-up
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:48 +0000 (14:12 +0200)]
wil6210: headers clean-up

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: use WLAN_CAPABILITY_DMG_TYPE_MASK
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:47 +0000 (14:12 +0200)]
wil6210: use WLAN_CAPABILITY_DMG_TYPE_MASK

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: fix FW error notification
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:46 +0000 (14:12 +0200)]
wil6210: fix FW error notification

user space get notified through kobject_uevent_env(), that might sleep and thus
should run in thread context.

Move user space notification to the thread handler, while mark FW is non-functional
right in the hard IRQ.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: report all received mgmt frames
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:45 +0000 (14:12 +0200)]
wil6210: report all received mgmt frames

Pass to cfg80211 all management frames.
Used by wpa_supplicant.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: use cfg80211_inform_bss_frame()
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:44 +0000 (14:12 +0200)]
wil6210: use cfg80211_inform_bss_frame()

Avoid unnecessary frame parsing

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: refactor connect_worker
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:43 +0000 (14:12 +0200)]
wil6210: refactor connect_worker

Move wmi_connect_worker() to the main.c and change names for consistency.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Fix garbage sent to the FW with wmi_set_ie()
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:42 +0000 (14:12 +0200)]
wil6210: Fix garbage sent to the FW with wmi_set_ie()

Extra reference was taken by mistake.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: do not set IE's for beacon
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:41 +0000 (14:12 +0200)]
wil6210: do not set IE's for beacon

On the DMG band, there is no 'normal' beacon frame.
Instead, transmitted is short 'DMG beacon' frame, that do not include IE's
So, beacon IE's are not relevant for the DMG band.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: handle WMI_BA_STATUS_EVENTID
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:40 +0000 (14:12 +0200)]
wil6210: handle WMI_BA_STATUS_EVENTID

Firmware indicated block ack agreement status change.
For now, just log it.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: handle linkup/linkdown WMI events
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:39 +0000 (14:12 +0200)]
wil6210: handle linkup/linkdown WMI events

Firmware indicates linkup/linkdown when data path becomes ready.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Remove local implementation of dynamic hexdump
Vladimir Kondratiev [Wed, 13 Mar 2013 12:12:38 +0000 (14:12 +0200)]
wil6210: Remove local implementation of dynamic hexdump

This functionality now integrated in kernel, local hack not needed any more

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: remove unused including <linux/version.h>
Wei Yongjun [Tue, 12 Mar 2013 03:09:34 +0000 (11:09 +0800)]
wil6210: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: pci: Fix flipping of MAC address
Larry Finger [Mon, 11 Mar 2013 20:38:26 +0000 (15:38 -0500)]
ssb: pci: Fix flipping of MAC address

Since commit e565275 entitled "ssb: pci: Standardize a function to get mac
address", the SPROM readout of the MAC has had the values flipped so that
00:11:22:33:44:55 became 11:00:33:22:55:44. The fix has been tested on both
little- and big-endian architectures.

Reported-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: rtl8192cu: Fix problem that prevents reassociation
Larry Finger [Wed, 13 Mar 2013 15:28:13 +0000 (10:28 -0500)]
rtlwifi: rtl8192cu: Fix problem that prevents reassociation

The driver was failing to clear the BSSID when a disconnect happened. That
prevented a reconnection. This problem is reported at
https://bugzilla.redhat.com/show_bug.cgi?id=789605,
https://bugzilla.redhat.com/show_bug.cgi?id=866786,
https://bugzilla.redhat.com/show_bug.cgi?id=906734, and
https://bugzilla.kernel.org/show_bug.cgi?id=46171.

Thanks to Jussi Kivilinna for making the critical observation
that led to the solution.

Reported-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Tested-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Tested-by: Alessandro Lannocca <alessandro.lannocca@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: fix rt2x00 to work with the new ralink SoC config symbols
John Crispin [Wed, 13 Mar 2013 12:20:15 +0000 (13:20 +0100)]
rt2x00: fix rt2x00 to work with the new ralink SoC config symbols

Since v3.9-rc1 the kernel has basic support for Ralink WiSoC. The config symbols
are named slightly different than before. Fix the rt2x00 to match the new
symbols.

The commit causing this breakage is:
commit ae2b5bb6570481b50a7175c64176b82da0a81836
Author: John Crispin <blogic@openwrt.org>
Date:   Sun Jan 20 22:05:30 2013 +0100
MIPS: ralink: adds Kbuild files

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Wed, 13 Mar 2013 17:29:56 +0000 (13:29 -0400)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/bluetooth/bluetooth

11 years agoBluetooth: Device 0cf3:3008 should map AR 3012
Sunguk Lee [Mon, 11 Mar 2013 19:41:58 +0000 (04:41 +0900)]
Bluetooth: Device 0cf3:3008 should map AR 3012

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0cf3 ProdID=3008 Rev= 0.01
S:  Manufacturer=Atheros Communications
S:  Product=Bluetooth USB Host Controller
S:  SerialNumber=Alaska Day 2006
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Signed-off-by: Sunguk Lee <d3m3vilurr@gmail.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agomwl8k: don't overwrite regulatory settings on fw reload
Jonas Gorski [Mon, 11 Mar 2013 16:44:21 +0000 (17:44 +0100)]
mwl8k: don't overwrite regulatory settings on fw reload

Currently the caps are parsed on every firmware reload, causing any
channel flags to be cleared.
When there is a firmware to interface mode mismatch, the triggered
firmware reload causes a reset of the regulatory settings, causing all
channels to become available:

root@openrouter:/# iw phy phy0 info
Wiphy phy0
        Band 1:
(...)
                Frequencies:
                        * 2412 MHz [1] (0.0 dBm)
                        * 2417 MHz [2] (0.0 dBm)
                        * 2422 MHz [3] (0.0 dBm)
                        * 2427 MHz [4] (0.0 dBm)
                        * 2432 MHz [5] (0.0 dBm)
                        * 2437 MHz [6] (0.0 dBm)
                        * 2442 MHz [7] (0.0 dBm)
                        * 2447 MHz [8] (0.0 dBm)
                        * 2452 MHz [9] (0.0 dBm)
                        * 2457 MHz [10] (0.0 dBm)
                        * 2462 MHz [11] (0.0 dBm)
                        * 2467 MHz [12] (0.0 dBm)
                        * 2472 MHz [13] (0.0 dBm)
                        * 2484 MHz [14] (0.0 dBm)
(...)

To prevent this, only parse the caps on the first firmware load during
hardware probe, and store them locally to know we have already parsed
them.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowireless:rtlwifi: replaced kmalloc+memcpy with kmemdup
Andrei Epure [Sun, 10 Mar 2013 13:09:47 +0000 (15:09 +0200)]
wireless:rtlwifi: replaced kmalloc+memcpy with kmemdup

Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: fix sparse warnings
Stephen Hemminger [Fri, 8 Mar 2013 19:12:56 +0000 (11:12 -0800)]
iwlegacy: fix sparse warnings

Make local functions and tables static. Make ops table
Mark 3945 ops as read_mostly.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoorinoco_usb: don't release nonexistent firmware
Michal Pecio [Fri, 8 Mar 2013 21:42:03 +0000 (22:42 +0100)]
orinoco_usb: don't release nonexistent firmware

Initialize fw_entry to NULL to prevent cleanup code from passing
bogus pointer to release_firmware() when priv allocation fails.

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>