]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoath9k: trivial: change spectral relayfs buffering
Zefir Kurtisi [Fri, 22 Mar 2013 11:58:23 +0000 (12:58 +0100)]
ath9k: trivial: change spectral relayfs buffering

The spectral data provided via relay-fs introduces a buffering
latency given by the subbuf_size. To meet the requirements for
delay-sensitive applications (like real-time spectral plotter),
reduce subbuf_size and increase n_subbufs.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: N-PHY: use more bits for offset in RSSI calibration
Rafał Miłecki [Wed, 27 Mar 2013 07:37:08 +0000 (08:37 +0100)]
b43: N-PHY: use more bits for offset in RSSI calibration

When calculating "offset" for final RSSI calibration we're using numbers
bigger than s8 can hold. We have for example:
offset[j] = 232 - poll_results[j];
formula. If poll_results[j] is small enough (it usually is) we treat
number's bit as a sign bit. For example 232 - 1 becomes:
0xE8 - 0x1 = 0xE7, which is not 231 but -25.

This code was introduced in e0c9a0219a8f542e3946fe972a68aacf8c3f906c
and caused stability regression on some cards, for ex. BCM4322.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agolibertas: drop maintainership
Dan Williams [Tue, 26 Mar 2013 19:40:51 +0000 (14:40 -0500)]
libertas: drop maintainership

Would be better maintained by somebody who actualy has time for it.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: 4965-rs: avoid null pointer dereference error
Colin Ian King [Tue, 26 Mar 2013 17:35:23 +0000 (17:35 +0000)]
iwlegacy: 4965-rs: avoid null pointer dereference error

il4965_rs_initialize_lq checks to see if sta is null, however, before that
check il4965_rs_use_green dereferences sta when intializing use_green.
Avoid a potential null pointer dereference error by only calling
il4965_rs_use_green after we are sure sta is not null.

Smatch analysis:

drivers/net/wireless/iwlegacy/4965-rs.c:2160 il4965_rs_initialize_lq() warn:
  variable dereferenced before check 'sta' (see line 2155)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: avoid queueing hw check work when suspended
Luis R. Rodriguez [Mon, 25 Mar 2013 18:27:46 +0000 (11:27 -0700)]
ath9k: avoid queueing hw check work when suspended

The following issue was reported.

WARNING: at net/mac80211/util.c:599 ieee80211_can_queue_work.isra.7+0x32/0x40 [mac80211]()
Hardware name: iMac12,1
queueing ieee80211 work while going to suspend
Pid: 0, comm: swapper/0 Tainted: PF          O 3.8.2-206.fc18.x86_64 #1
Call Trace: Mar 16 09:39:17 Parags-iMac kernel: [ 3993.642992]  <IRQ>
[<ffffffff8105e61f>] warn_slowpath_common+0x7f/0xc0
[<ffffffffa0581420>] ? ath_start_rx_poll+0x70/0x70 [ath9k]
<ffffffff8105e716>] warn_slowpath_fmt+0x46/0x50
[<ffffffffa045b542>] ieee80211_can_queue_work.isra.7+0x32/0x40

Fix this by avoiding to queue the work if our device has
already been marked as suspended or stopped.

Reported-by: Parag Warudkar <parag.lkml@gmail.com>
Tested-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: A fix for DMA transmission sequence errors
Iestyn C. Elfick [Wed, 20 Mar 2013 19:02:31 +0000 (14:02 -0500)]
b43: A fix for DMA transmission sequence errors

Intermittently, b43 will report "Out of order TX status report on DMA ring".
When this happens, the driver must be reset before communication can resume.
The cause of the problem is believed to be an error in the closed-source
firmware; however, all versions of the firmware are affected.

This change uses the observation that the expected status is always 2 less
than the observed value, and supplies a fake status report to skip one
header/data pair.

Not all devices suffer from this problem, but it can occur several times
per second under heavy load. As each occurence kills the unmodified driver,
this patch makes if possible for the affected devices to function. The patch
logs only the first instance of the reset operation to prevent spamming
the logs.

Tested-by: Chris Vine <chris@cvine.freeserve.co.uk>
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 agob43: N-PHY: increase initial value of "mind" in RSSI calibration
Rafał Miłecki [Tue, 19 Mar 2013 06:52:48 +0000 (07:52 +0100)]
b43: N-PHY: increase initial value of "mind" in RSSI calibration

We're using "mind" variable to find the VCM that got the best polling
results. For each VCM we calculte "currd" which is compared to the
"mind". For PHY rev3+ "currd" gets values around 14k-40k. Looking for a
value smaller than 40 makes no sense, so increase the initial value.

This fixes a regression introduced in 3.4 by commit:
e0c9a0219a8f542e3946fe972a68aacf8c3f906c
(my BCM4322 performance dropped from 18,4Mb/s to 9,26Mb/s)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Wed, 27 Mar 2013 15:05:18 +0000 (11:05 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes

11 years agoRevert "brcmsmac: support 4313iPA"
John W. Linville [Wed, 27 Mar 2013 14:52:11 +0000 (10:52 -0400)]
Revert "brcmsmac: support 4313iPA"

This reverts commit b6fc28a158076ca2764edc9a6d1e1402f56e1c0c.

This commit is reported to cause a regression in the support for some
revisions of 4313 ePA devices.

http://marc.info/?l=linux-wireless&m=136360340200943&w=2

Conflicts:
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c

Reported-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: remove warning for LP-PHY with sprom < 8
Hauke Mehrtens [Thu, 21 Mar 2013 19:28:40 +0000 (20:28 +0100)]
b43: remove warning for LP-PHY with sprom < 8

The BCM5354 SoC has a build in ieee80211 core rev 13 with a LP-PHY on
it. This devices has a sprom version 3 stored in the nvram. This patch
removes the warning and uses the opo values from the sprom as mentioned
in the specs.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: read additional sprom v2 and v3 attributes.
Hauke Mehrtens [Thu, 21 Mar 2013 19:25:21 +0000 (20:25 +0100)]
ssb: read additional sprom v2 and v3 attributes.

These attributes should be in the sprom for rev 2 and 3, but they were
not read out.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: fix sprom constant for ant_available_{bg,a}
Hauke Mehrtens [Thu, 21 Mar 2013 15:26:19 +0000 (16:26 +0100)]
ssb: fix sprom constant for ant_available_{bg,a}

This was done accordingly to new specs.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: use bcma_chipco_gpio_control()
Hauke Mehrtens [Thu, 21 Mar 2013 15:19:45 +0000 (16:19 +0100)]
b43: use bcma_chipco_gpio_control()

With this patch the same registers are written, but this access is now
protected by a lock.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: define board types
Rafał Miłecki [Tue, 19 Mar 2013 15:58:59 +0000 (16:58 +0100)]
bcma: define board types

Using that IDs we can write workarounds for various cards

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: define more board types
Rafał Miłecki [Tue, 19 Mar 2013 15:58:58 +0000 (16:58 +0100)]
ssb: define more board types

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: extract board_type from SPROM
Rafał Miłecki [Tue, 19 Mar 2013 12:18:44 +0000 (13:18 +0100)]
bcma: extract board_type from SPROM

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: extract board_type from SPROM
Rafał Miłecki [Tue, 19 Mar 2013 12:18:43 +0000 (13:18 +0100)]
ssb: extract board_type from SPROM

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: add support to configure VHT for AP mode
Yogesh Ashok Powar [Tue, 19 Mar 2013 03:06:03 +0000 (20:06 -0700)]
mwifiex: add support to configure VHT for AP mode

Currently, default VHT configuration from the firmware is used
for the VHT operations. Adding vhtcfg command to configure the
firmware based on input received from cfg.

Enable VHT for AP mode only when cfg80211_ap_settings has a
VHT IE i.e., when ieee80211ac is set to 1 in the hostapd.conf.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: usb: add NET_IP_ALIGN padding to RX skb when needed
Jussi Kivilinna [Sun, 17 Mar 2013 09:59:29 +0000 (11:59 +0200)]
rtlwifi: usb: add NET_IP_ALIGN padding to RX skb when needed

Add proper alignment at first packet copy, to avoid extra copies made later
in networking stack.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: usb: defer rx processing to tasklet
Jussi Kivilinna [Sun, 17 Mar 2013 09:59:24 +0000 (11:59 +0200)]
rtlwifi: usb: defer rx processing to tasklet

Move processing of received packets to tasklet from hard-irq context.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: usb: remove extra skb copy on RX path
Jussi Kivilinna [Sun, 17 Mar 2013 09:59:18 +0000 (11:59 +0200)]
rtlwifi: usb: remove extra skb copy on RX path

RX path has extra copying of packets, that can be avoided.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: usb: use usb_alloc_coherent for RX buffers
Jussi Kivilinna [Sun, 17 Mar 2013 09:59:13 +0000 (11:59 +0200)]
rtlwifi: usb: use usb_alloc_coherent for RX buffers

Use dedicated DMA coherent buffers for RX urbs, to avoid allocation of large
skbuffs in hard-irq context and improve performance.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca...
John W. Linville [Mon, 25 Mar 2013 20:40:52 +0000 (16:40 -0400)]
Merge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx

11 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Mon, 25 Mar 2013 20:39:06 +0000 (16:39 -0400)]
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Mon, 25 Mar 2013 20:38:28 +0000 (16:38 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Mon, 25 Mar 2013 20:38:02 +0000 (16:38 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

11 years agomwifiex: reset skb->data after processing PCIe sleep confirm cmd respose
Avinash Patil [Thu, 21 Mar 2013 00:56:23 +0000 (17:56 -0700)]
mwifiex: reset skb->data after processing PCIe sleep confirm cmd respose

This patch is a bug fix for an issue wherein power save was not
working for PCIe. This happens because for processing power save
sleep confirm command we pull skb so that skb->data points ahead
of interface header. We use same skb to get other cmda responses
as well. So if we don't push skb after processing cmd response,
it results into reduction in skb->len and finally skb->len reaches
zero. This causes failure in processing sleep command response.
Fix this by pushing skb by INTF_HEADER_LEN at the end of command
response processing.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
John W. Linville [Mon, 25 Mar 2013 18:50:17 +0000 (14:50 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

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 agomac80211: Don't restart sta-timer if not associated.
Ben Greear [Wed, 20 Mar 2013 00:50:50 +0000 (17:50 -0700)]
mac80211: Don't restart sta-timer if not associated.

I found another crash when deleting lots of virtual stations
in a congested environment.  I think the problem is that
the ieee80211_mlme_notify_scan_completed could call
ieee80211_restart_sta_timer for a stopped interface
that was about to be deleted.

With the following patch I am unable to reproduce the
crash.

Signed-off-by: Ben Greear <greearb@candelatech.com>
[move check, also make the same change in mesh]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: always check for scan end on P2P device
Johannes Berg [Tue, 19 Mar 2013 14:04:07 +0000 (15:04 +0100)]
cfg80211: always check for scan end on P2P device

If a P2P device wdev is removed while it has a scan, then the
scan completion might crash later as it is already freed by
that time. To avoid the crash always check the scan completion
when the P2P device is being removed for some reason. If the
driver already canceled it, don't want and free it, otherwise
warn and leak it to avoid later crashes.

In order to do this, locking needs to be changed away from the
rdev mutex (which can't always be guaranteed). For now, use
the sched_scan_mtx instead, I'll rename it to just scan_mtx in
a later patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix virtual monitor interface locking
Johannes Berg [Wed, 20 Mar 2013 21:25:17 +0000 (22:25 +0100)]
mac80211: fix virtual monitor interface locking

The virtual monitor interface has a locking issue, it calls
into the channel context code with the iflist mutex held
which isn't allowed since it is usually acquired the other
way around. The mutex is still required for the interface
iteration, but need not be held across the channel calls.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix wdev tracing crash
Johannes Berg [Tue, 19 Mar 2013 19:26:57 +0000 (20:26 +0100)]
cfg80211: fix wdev tracing crash

Arend reported a crash in tracing if the driver returns an
ERR_PTR() value from the add_virtual_intf() callback. This
is due to the tracing then still attempting to dereference
the "pointer", fix this by using IS_ERR_OR_NULL().

Reported-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoBluetooth: fix error return code in rfcomm_add_listener()
Wei Yongjun [Wed, 20 Mar 2013 12:23:37 +0000 (20:23 +0800)]
Bluetooth: fix error return code in rfcomm_add_listener()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoiwlwifi: mvm: Add support for different ROC types
Ilan Peer [Wed, 13 Feb 2013 09:05:18 +0000 (11:05 +0200)]
iwlwifi: mvm: Add support for different ROC types

Schedule different time event based on the ROC type

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoMerge remote-tracking branch 'wireless-next/master' into iwlwifi-next
Johannes Berg [Wed, 20 Mar 2013 13:30:42 +0000 (14:30 +0100)]
Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next

11 years agoiwlwifi: mvm: Increase the max remain on channel time
Ilan Peer [Wed, 20 Feb 2013 06:41:54 +0000 (08:41 +0200)]
iwlwifi: mvm: Increase the max remain on channel time

Increase the maximal remain on channel time as longer remain
on channel requests are handled by the FW using fragmented
time events.

This reduces the number of user/kernel space iterations during
flows such as p2p_listen. In addition it is currently required
for flows which require longer duration such as p2p_sd.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: fix WoWLAN RF-kill bug
Johannes Berg [Wed, 20 Mar 2013 09:40:05 +0000 (10:40 +0100)]
iwlwifi: mvm: fix WoWLAN RF-kill bug

The RF-kill wakeup trigger flag is set in the wrong command,
which means it won't work. Also fix the comment in the TCP
wakeup trigger code -- the firmware was changed to look at
all the different trigger flags.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: tune the move to static SMPS due to BT load
Emmanuel Grumbach [Tue, 19 Mar 2013 12:40:38 +0000 (14:40 +0200)]
iwlwifi: mvm: tune the move to static SMPS due to BT load

We should disable MIMO only if bt_traffic_load goes up to 3.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: take the valid_{rx,tx}_ant from the TLV
Emmanuel Grumbach [Sat, 9 Mar 2013 18:38:19 +0000 (20:38 +0200)]
iwlwifi: mvm: take the valid_{rx,tx}_ant from the TLV

This is the right source of information for the valid Tx
antennas, not the NVM.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: take the radio type / step / dash from TLVs
Emmanuel Grumbach [Thu, 7 Mar 2013 15:27:40 +0000 (17:27 +0200)]
iwlwifi: mvm: take the radio type / step / dash from TLVs

This data should taken from TLVs and not from the NVM. This
is true for the value written in CSR_HW_IF_CONFIG_REG too.

Also, no need to set the CSR_HW_IF_CONFIG_REG_BIT_MAC_SI bit
for 7000 devices which are the only devices currently
supported.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: specify filter flags in monitor mode
Johannes Berg [Mon, 18 Mar 2013 12:04:50 +0000 (13:04 +0100)]
iwlwifi: mvm: specify filter flags in monitor mode

In firmware "listener" (monitor) mode, we still need to
open up the filters with the filter flags to receive all
frames.

Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: add debug message when a CMD is dropped in RFKILL
Emmanuel Grumbach [Wed, 13 Mar 2013 20:16:20 +0000 (22:16 +0200)]
iwlwifi: add debug message when a CMD is dropped in RFKILL

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: print the flags in ALIVE notification
Emmanuel Grumbach [Wed, 13 Mar 2013 15:02:41 +0000 (17:02 +0200)]
iwlwifi: mvm: print the flags in ALIVE notification

This has valuable data about RFkill state seen from the fw
side.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: remove 5ghz_disable option
Stanislaw Gruszka [Tue, 12 Mar 2013 16:35:58 +0000 (17:35 +0100)]
iwlwifi: remove 5ghz_disable option

5ghz_disable has no effect any longer, that was changed during
refactoring of EEPROM reading/parsing. Remove it, wpa_supplicant
allow now to specify frequencies, on which device will operate.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: Fix quota handling for monitor interface
Ilan Peer [Wed, 13 Mar 2013 12:52:04 +0000 (14:52 +0200)]
iwlwifi: mvm: Fix quota handling for monitor interface

1. Quota for the monitor interface should be added only if there is
   a channel context assigned to the interface.
2. In the unassign channel context flow, need to remove the quota
   for the monitor interface binding, before unbinding.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: use kmemdup instead of kmalloc+memcpy
Andrei Epure [Sun, 10 Mar 2013 13:22:33 +0000 (15:22 +0200)]
iwlwifi: use kmemdup instead of kmalloc+memcpy

Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: Remove obsolete queue definitions
Ilan Peer [Wed, 13 Mar 2013 13:20:35 +0000 (15:20 +0200)]
iwlwifi: mvm: Remove obsolete queue definitions

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: don't support multi-channel inhibition
Emmanuel Grumbach [Sun, 10 Mar 2013 10:06:12 +0000 (12:06 +0200)]
iwlwifi: mvm: don't support multi-channel inhibition

This feature is not implemented yet in firmware.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: fix the {ack,cts}_kill_msk
Emmanuel Grumbach [Sun, 10 Mar 2013 18:15:24 +0000 (20:15 +0200)]
iwlwifi: mvm: fix the {ack,cts}_kill_msk

The masks were wrong. They should be 0xffffffff when SCO,
HID or SNIFF profiles are used. They should be 0xffff0000
in any other case (default) to get a bit more throughput
when the BT profile allows for it.

Fix a debug print on the way.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix error return code in cfg80211_init()
Wei Yongjun [Wed, 20 Mar 2013 12:22:54 +0000 (20:22 +0800)]
cfg80211: fix error return code in cfg80211_init()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix potential connection work crash
Johannes Berg [Wed, 20 Mar 2013 13:05:52 +0000 (14:05 +0100)]
cfg80211: fix potential connection work crash

If wpa_supplicant and iw/iwconfig are used together, very
rarely the system crashes. It seems to be related to the
connection parameters not being set up, but it's not all
clear to me how this happens. In any case, checking that
the conn pointer exists here is probably a good idea.

Signed-off-by: Johannes Berg <johannes.berg@intel.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 agoiwlwifi: dvm: don't send HCMD in restart flow
Emmanuel Grumbach [Thu, 31 Jan 2013 13:03:55 +0000 (15:03 +0200)]
iwlwifi: dvm: don't send HCMD in restart flow

There is a race between the restart flow and the workers.
The workers are cancelled after the fw is already killed
and might send HCMD when there is fw to handle them.
Simply check that there is a fw to which the HCMD can be
sent before actually sending it.

Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: set rfkill in internal state of the transport
Emmanuel Grumbach [Wed, 13 Mar 2013 14:38:32 +0000 (16:38 +0200)]
iwlwifi: set rfkill in internal state of the transport

We didn't update the internal of the PCIe transport when
we read the RFkill state directly. Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: fix length check in multi-TB HCMD
Emmanuel Grumbach [Thu, 14 Mar 2013 06:35:06 +0000 (08:35 +0200)]
iwlwifi: fix length check in multi-TB HCMD

As reported by Ben Hutchings, there was a harmless issue in
the checks being done on the lengths of the TBs while
building the TFD for a multi-TB host command.

Cc: stable@vger@kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: Add beacon notification handler
Ilan Peer [Tue, 5 Mar 2013 13:26:03 +0000 (15:26 +0200)]
iwlwifi: mvm: Add beacon notification handler

Mostly for debugging purposes

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: suppress key error messages in AP mode
Johannes Berg [Wed, 6 Mar 2013 12:15:21 +0000 (13:15 +0100)]
iwlwifi: mvm: suppress key error messages in AP mode

In AP mode, don't attempt to program GTKs into the
device, they're used for TX only so not needed and
programming them causes error messages. Also, in
this case and if key programming fails, avoid trying
to remove the key that isn't present later.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: MVM op_mode is supported on 7000 only
Emmanuel Grumbach [Wed, 6 Mar 2013 09:34:44 +0000 (11:34 +0200)]
iwlwifi: mvm: MVM op_mode is supported on 7000 only

The code removed in this patch was used for bring up on
older NICs. No MVM capable fw will ever be released for
older NICs, so remove that code.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211_hwsim: assign CAB queue properly on interface type change
Johannes Berg [Mon, 18 Mar 2013 21:13:18 +0000 (22:13 +0100)]
mac80211_hwsim: assign CAB queue properly on interface type change

When an interface change type, the CAB queue must be reassigned,
do this in hwsim to avoid warnings/crashes.

Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.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>