openwrt/staging/blogic.git
14 years agoiwlwifi: beacon format related helper function
Wey-Yi Guy [Thu, 6 May 2010 15:54:10 +0000 (08:54 -0700)]
iwlwifi: beacon format related helper function

Move the ucode beacon formation related helper function from 3945 to
iwlcore, so both _3945 and _agn devices can utilize those functions.

When driver pass the beacon related timing information to uCode in both
spectrum measurement and channel switch commands, the beacon timing
parameter require in uCode beacon format; those helper functions will do
the conversation from uSec to the correct uCode format

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: remove unused parameter in iwl_priv
Wey-Yi Guy [Fri, 7 May 2010 22:31:05 +0000 (15:31 -0700)]
iwlwifi: remove unused parameter in iwl_priv

restrict_refcnt is no longer used, remove it from iwl_priv
structure

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: do not clear data after chain noise calib
Shanyu Zhao [Tue, 11 May 2010 22:25:03 +0000 (15:25 -0700)]
iwlwifi: do not clear data after chain noise calib

Chain noise calibration data are cleared after the calibration is done
in iwlagn_gain_computation() and iwl4965_gain_computation(). This cause
the debugfs entries for those data useless. To provide valid debugging
info, clear those data right before starting the calibration instead.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: remove debug frame dumping
Johannes Berg [Wed, 12 May 2010 10:33:13 +0000 (03:33 -0700)]
iwlwifi: remove debug frame dumping

This can now be much better achieved using
tracing and post-processing of the trace,
rather than doing the processing in place
in the driver, so remove a lot of code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: use virtual interface address for scan
Johannes Berg [Wed, 12 May 2010 10:33:12 +0000 (03:33 -0700)]
iwlwifi: use virtual interface address for scan

For probe request frames sent during scan, we
should use the virtual interface's mac address
that the scan was initiated on to avoid issues
when the wrong address is used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: set MAC address in RXON from interface
Johannes Berg [Wed, 12 May 2010 10:33:11 +0000 (03:33 -0700)]
iwlwifi: set MAC address in RXON from interface

When we do not have an interface, priv->mac_addr
is all zeroes, so the memcpy() is not useful as
the RXON buffer has been cleared previously.
Therefore, use the interface's address that we
are setting up the RXON for, if available.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: remove mac_addr assignment
Johannes Berg [Wed, 12 May 2010 10:33:10 +0000 (03:33 -0700)]
iwlwifi: remove mac_addr assignment

priv->mac_addr is the address of the operating
interface, not the permanent MAC address. They
are usually the same, but the user can override
the operating address, so we shouldn't set the
variable to the permanent one, it is assigned
when an interface is added.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: remove unused wlap_bssid_addr assignment
Johannes Berg [Wed, 12 May 2010 10:33:09 +0000 (03:33 -0700)]
iwlwifi: remove unused wlap_bssid_addr assignment

There's no microcode that actually uses this
variable, and it is reserved for functionality
that the driver doesn't support anyway, so we
shouldn't be setting it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: remove useless node_addr assignments
Johannes Berg [Wed, 12 May 2010 10:33:08 +0000 (03:33 -0700)]
iwlwifi: remove useless node_addr assignments

iwl_connection_init_rx_config() will already
have set up the entire RXON command, so these
assignments are duplicate.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agossb: remove the ssb DMA API
FUJITA Tomonori [Fri, 4 Jun 2010 02:37:44 +0000 (19:37 -0700)]
ssb: remove the ssb DMA API

Now they are unnecessary.  We can use the generic DMA API with any bus.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Michael Buesch <mb@bu3sch.de>
Cc: Gary Zambrano <zambrano@broadcom.com>
Cc: Stefano Brivio <stefano.brivio@polimi.it>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob44: replace the ssb_dma API with the generic DMA API
FUJITA Tomonori [Fri, 4 Jun 2010 02:37:40 +0000 (19:37 -0700)]
b44: replace the ssb_dma API with the generic DMA API

Note that dma_sync_single_for_device and dma_sync_single_for_cpu support a
partial sync.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Gary Zambrano <zambrano@broadcom.com>
Acked-by: Michael Buesch <mb@bu3sch.de>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: replace the ssb_dma API with the generic DMA API
FUJITA Tomonori [Fri, 4 Jun 2010 02:37:36 +0000 (19:37 -0700)]
b43: replace the ssb_dma API with the generic DMA API

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Stefano Brivio <stefano.brivio@polimi.it>
Cc: John W. Linville <linville@tuxdriver.com>
Acked-by: Michael Buesch <mb@bu3sch.de>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43legacy: replace the ssb_dma API with the generic DMA API
FUJITA Tomonori [Fri, 4 Jun 2010 02:37:33 +0000 (19:37 -0700)]
b43legacy: replace the ssb_dma API with the generic DMA API

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stefano Brivio <stefano.brivio@polimi.it>
Cc: John W. Linville <linville@tuxdriver.com>
Acked-by: Michael Buesch <mb@bu3sch.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agossb: add dma_dev to ssb_device structure
FUJITA Tomonori [Fri, 4 Jun 2010 02:37:27 +0000 (19:37 -0700)]
ssb: add dma_dev to ssb_device structure

Add dma_dev, a pointer to struct device, to struct ssb_device.  We pass it
to the generic DMA API with SSB_BUSTYPE_PCI and SSB_BUSTYPE_SSB.
ssb_devices_register() sets up it properly.

This is preparation for replacing the ssb bus specific DMA API (ssb_dma_*)
with the generic DMA API.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Michael Buesch <mb@bu3sch.de>
Cc: Gary Zambrano <zambrano@broadcom.com>
Cc: Stefano Brivio <stefano.brivio@polimi.it>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: John W. Linville <linville@tuxdriver.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: use the DMA state API instead of the pci equivalents
FUJITA Tomonori [Thu, 3 Jun 2010 05:19:20 +0000 (14:19 +0900)]
iwlwifi: use the DMA state API instead of the pci equivalents

This can be cleanly applied to wireless-2.6 and iwlwifi git trees.

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] iwlwifi: use the DMA state API instead of the pci equivalents

This replace the PCI DMA state API (include/linux/pci-dma.h) with the
DMA equivalents since the PCI DMA state API will be obsolete.

No functional change.

For further information about the background:

http://marc.info/?l=linux-netdev&m=127037540020276&w=2

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Fix bug in rate table
Vasanthakumar Thiagarajan [Thu, 3 Jun 2010 00:22:47 +0000 (17:22 -0700)]
ath9k: Fix bug in rate table

The following commit added an entry in 11na and 11ng rate
table but missed to update its rate count field. This
inconsistency between the rate count and the actual number
of rates in the table will leave out the final rate entry
(mcs15 with half gi in ht40) while forming the valid
rate indices. Not having mcs15+shortGI in ht40 will have
a performance impact (on max throughput) of about 10% both
in nght40 and naht40 mode.

Author: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Date:   Thu May 13 18:42:38 2010 -0700

     ath9k: Enable Short GI in 20 Mhz for ar9287 and later chips

     This patch enables short GI rx at all rates and tx at mcs15
     for 20 Mhz channel width also.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Configure credit size for AR7010
Sujith [Wed, 2 Jun 2010 10:23:54 +0000 (15:53 +0530)]
ath9k_htc: Configure credit size for AR7010

For non-AR9271 chips, the credit size is different
and has to be configured appropriately.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Setup 5GHz channels
Sujith [Wed, 2 Jun 2010 10:23:50 +0000 (15:53 +0530)]
ath9k_htc: Setup 5GHz channels

AR7010 is dual-band. Setup the channels and rateset
for 5GHz band.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Configure dual stream rates
Sujith [Wed, 2 Jun 2010 10:23:43 +0000 (15:53 +0530)]
ath9k_htc: Configure dual stream rates

The rate information on the target has to be updated
for 2-stream devices, along with the correct chainmask.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Setup HT capabilites for 2-stream devices
Sujith [Wed, 2 Jun 2010 10:23:40 +0000 (15:53 +0530)]
ath9k_htc: Setup HT capabilites for 2-stream devices

The supported MCS rate set has to be setup properly
for 2-stream devices.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_common: Move count_streams to common module
Sujith [Wed, 2 Jun 2010 10:23:37 +0000 (15:53 +0530)]
ath9k_common: Move count_streams to common module

This can be used by ath9k_htc.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Add support for AR7010
Sujith [Wed, 2 Jun 2010 10:23:34 +0000 (15:53 +0530)]
ath9k_htc: Add support for AR7010

Add the USB device IDs for AR7010 and handle
firmware loading properly.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Configure byte swap for non AR9271 chips
Sujith [Wed, 2 Jun 2010 10:23:31 +0000 (15:53 +0530)]
ath9k_hw: Configure byte swap for non AR9271 chips

This patch fixes programming the byte swap registers
for chipsets other than AR9271. This is needed for
AR7010.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Determine Firmware on probe
Sujith [Wed, 2 Jun 2010 10:23:30 +0000 (15:53 +0530)]
ath9k: Determine Firmware on probe

Do not assign the FW name to driver_info but determine
it dynamically on device probe. This facilitates adding new
firmware.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agop54spi: replace internal "cx3110x" name with "p54spi"
Luke-Jr [Wed, 2 Jun 2010 02:16:53 +0000 (21:16 -0500)]
p54spi: replace internal "cx3110x" name with "p54spi"

While the comment removed in this patch claims board_n800.c uses
"cx3110x", it was never merged to mainline like this.  Mainlined board
files for Nokia N8x0 devices are expected "p54spi", and thus don't
work because the modalias is "cx3110x".  To my knowledge, these
devices are the only real-world use of p54spi, and will not work
without this change.  Tested against my Nokia N810.

Signed-off-by: Luke Dashjr <luke-jr+git@utopios.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Remove deprecated sta_notify commands
Sujith [Wed, 19 May 2010 06:02:30 +0000 (11:32 +0530)]
mac80211: Remove deprecated sta_notify commands

STA_NOTIFY_ADD and STA_NOTIFY_REMOVE have no users anymore,
and station addition/removal are indicated to drivers
using sta_add() and sta_remove(), which can sleep.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Use proper station add/remove callbacks
Sujith [Tue, 18 May 2010 09:56:04 +0000 (15:26 +0530)]
ath9k_htc: Use proper station add/remove callbacks

sta_add/sta_remove are the callbacks that can sleep.
Use them instead of sta_notify.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agossb: Handle alternate SSPROM location
Larry Finger [Sat, 15 May 2010 03:08:58 +0000 (22:08 -0500)]
ssb: Handle alternate SSPROM location

In kernel Bugzilla #15825 (2 users), in a wireless mailing list thread
(http://lists.infradead.org/pipermail/b43-dev/2010-May/000124.html), and on a
netbook owned by John Linville
(http://marc.info/?l=linux-wireless&m=127230751408818&w=4), there are reports
of ssb failing to detect an SPROM at the normal location. After studying the
MMIO trace dump for the Broadcom wl driver, it was determined that the affected
boxes had a relocated SPROM.

This patch fixes all systems that have reported this problem.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: fix dma sync in rx path
Ming Lei [Sat, 15 May 2010 10:25:40 +0000 (18:25 +0800)]
ath9k: fix dma sync in rx path

If buffer is to be accessed by cpu after dma is over, but
between dma mapping and dma unmapping, we should use
dma_sync_single_for_cpu to sync the buffer between cpu with
device. And dma_sync_single_for_device is used to let
device gain the buffer again.

v2: Felix pointed out dma_sync_single_for_device is needed to return
buffer to device if an unsuccessful status bit check is found.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: make ARP filtering depend on CONFIG_INET
John W. Linville [Fri, 4 Jun 2010 18:25:44 +0000 (14:25 -0400)]
mac80211: make ARP filtering depend on CONFIG_INET

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: reduce debugfs code size
Felix Fietkau [Wed, 2 Jun 2010 00:57:34 +0000 (02:57 +0200)]
mac80211: reduce debugfs code size

This patch reduces the binary size by around 25k (measured on MIPS,
with CONFIG_MAC80211_DEBUG_COUNTERS enabled).

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: fix queue stop/start based on the number of pending frames
Felix Fietkau [Tue, 1 Jun 2010 19:33:13 +0000 (21:33 +0200)]
ath9k: fix queue stop/start based on the number of pending frames

Because there is a limited number of tx buffers available, once the
queue has been filled to a certain point, ath9k needs to stop accepting
new frames from mac80211. In order to prevent a full WMM queue from
stopping another queue with fewer frames, this patch limits the number
of queued frames to a quarter of the total available tx buffers, minus
some reserved frames to be used for other purposes (e.g. beacons).

Because tx buffers are reserved for frames when they're staged in
software queues as well, the actual queue depth cannot be used for
this, so this patch stores a reference to the tx queue in the ath_buf
struct and keeps track of the total number of pending frames.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Fix fair beacon distribution
Sujith [Tue, 1 Jun 2010 09:44:19 +0000 (15:14 +0530)]
ath9k_htc: Fix fair beacon distribution

This patch fixes beacon distribution in IBSS mode
by configuring the hardware beacon queue properly.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Handle host RX disable
Sujith [Tue, 1 Jun 2010 09:44:18 +0000 (15:14 +0530)]
ath9k_htc: Handle host RX disable

The MIB counters used by ANI have to be disabled
on the host because the FW doesn't do it on the target side.
Also, flush the receive buffers before initializing
RX on the target.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Handle monitor interface removal
Sujith [Tue, 1 Jun 2010 09:44:17 +0000 (15:14 +0530)]
ath9k_htc: Handle monitor interface removal

The monitor interface instance on the target has
to be removed before setting it to FULLSLEEP.
Handle this properly.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Fix locking for ps_idle
Sujith [Tue, 1 Jun 2010 09:44:16 +0000 (15:14 +0530)]
ath9k_htc: Fix locking for ps_idle

ps_idle is protected by the htc_pm_lock mutex.
Use it to protect the variable.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Remove useless cancel_work_sync
Sujith [Tue, 1 Jun 2010 09:44:15 +0000 (15:14 +0530)]
ath9k_htc: Remove useless cancel_work_sync

There is no need to cancel the PS work when disassociation
happens. The work handlers are cancelled in the stop()
callback.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Fix bug in handling CONF_IDLE
Sujith [Tue, 1 Jun 2010 09:44:14 +0000 (15:14 +0530)]
ath9k_htc: Fix bug in handling CONF_IDLE

Disable the radio only when mac80211 indicates it,
through the IEEE80211_CONF_CHANGE_IDLE flag.
Not handling this properly will result in multiple
calls to radio_disable() even though the radio is
already idle.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Add PS wrappers
Sujith [Tue, 1 Jun 2010 09:44:12 +0000 (15:14 +0530)]
ath9k_htc: Add PS wrappers

The HW has to be awake when registers are accessed.
Ensure this is so by using the PS wrappers at
appropriate places.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Revamp CONF_IDLE handling
Sujith [Tue, 1 Jun 2010 09:44:11 +0000 (15:14 +0530)]
ath9k_htc: Revamp CONF_IDLE handling

This patch revamps IDLE power save handling in the driver.
Two separate functions (radio enable/disable) are introduced,
because the semantics of radio handling is just not the same
as the start()/stop() callbacks. For example, the HW must not
be disabled, instead, the PHY has to be disabled in radio_disable().
Also, the HW has to be reset properly in radio enable/disable and
certain registers have to be programmed only once, in the
start() callback.

The radio_enable() routine doesn't need the PS wrappers since
we set the HW power mode to AWAKE anyway before calling it.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Fix async fifo for AR9287
Sujith [Tue, 1 Jun 2010 09:44:10 +0000 (15:14 +0530)]
ath9k_hw: Fix async fifo for AR9287

Async fifo is now enabled only for versions 1.3 and above.
Enable it in the appropriate place, in the reset routine,
instead of process_ini().

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Update the PCI WAR register
Sujith [Tue, 1 Jun 2010 09:44:09 +0000 (15:14 +0530)]
ath9k_hw: Update the PCI WAR register

This patch updates the PCI power save handling
code, fixing ASPM hangs and handling device state D3
properly.

The WAR register is programmed with the correct
values now.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Cleanup TX power calculation for AR9287
Sujith [Tue, 1 Jun 2010 09:44:07 +0000 (15:14 +0530)]
ath9k_hw: Cleanup TX power calculation for AR9287

* Add a few comments, and move the updation of max_power_level
  to a helper routine. This is also done by non-4K based chipsets,
  this will be fixed in a separate patch.

* Remove two WARs which are required for old AR5416 chipsets,
  and are not needed for AR9287.

* Fix indentation and make things readable.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Optimize ath9k_hw_ar9287_set_board_values
Sujith [Tue, 1 Jun 2010 09:44:06 +0000 (15:14 +0530)]
ath9k_hw: Optimize ath9k_hw_ar9287_set_board_values

Rather than doing a series of RMWs, calculate the
value to be written to the register in question and
do a single REGWRITE. This improves bringup time.

This depends on the analog_shiftreg configuration option,
which is currently buggy. For AP mode, a delay of 100us
has to be the default. For station mode, this knob has to
be enabled on a per-case basis, though it is a little
unclear on when to enable a delay. This can be fixed later though.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Cleanup eeprom_9287.c
Sujith [Tue, 1 Jun 2010 09:44:04 +0000 (15:14 +0530)]
ath9k_hw: Cleanup eeprom_9287.c

* Fix whitespace damage.
* Remove unused debug messages.
* Introduce a macro NUM_EEP_WORDS.
* Convert AR9287 to lowercase in function names.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: simplify key locking
Johannes Berg [Tue, 1 Jun 2010 08:19:19 +0000 (10:19 +0200)]
mac80211: simplify key locking

Since I recently made station management able
to sleep, I can now rework key management as
well; since it will no longer need a spinlock
and can also use a mutex instead, a bunch of
code to allow drivers' set_key to sleep while
key management is protected by a spinlock can
now be removed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless/ipw2x00/ipw2100.c: Remove unnecessary kmalloc casts
Joe Perches [Tue, 1 Jun 2010 03:23:15 +0000 (20:23 -0700)]
drivers/net/wireless/ipw2x00/ipw2100.c: Remove unnecessary kmalloc casts

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: move plink state
Johannes Berg [Mon, 31 May 2010 09:40:23 +0000 (11:40 +0200)]
mac80211: move plink state

For some odd reason, the plink_state enum is
declared in the middle between aggregation
related structures. Move it down to make the
file easier to read.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: drop control frames after processing
Johannes Berg [Sun, 30 May 2010 12:53:43 +0000 (14:53 +0200)]
mac80211: drop control frames after processing

After ieee80211_rx_h_ctrl() processing we only
want to process management (including action)
frames, so there's no point in letting control
frames continue.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: remove useless work starting
Johannes Berg [Fri, 28 May 2010 12:48:52 +0000 (14:48 +0200)]
mac80211: remove useless work starting

Ever since we use only cfg80211 for configuration,
there is no configuration that could be pending at
this point, cfg80211 will have the configuration
that is pending and apply it afterwards.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: move WEP weak IV check
Johannes Berg [Fri, 28 May 2010 12:24:19 +0000 (14:24 +0200)]
mac80211: move WEP weak IV check

I suspect the compiler will do this optimisation
anyway, but it seems cleaner to move this into
the WEP switch case.

Also make rx_h_decrypt use a local variable for
the frame_control so that we don't need to reload
the hdr variable for this after linearizing.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: clean up ieee80211_stop_tx_ba_session
Johannes Berg [Thu, 27 May 2010 12:41:07 +0000 (14:41 +0200)]
mac80211: clean up ieee80211_stop_tx_ba_session

There's no sense in letting anything but internal
mac80211 functions set the initiator to anything
but WLAN_BACK_INITIATOR, since WLAN_BACK_RECIPIENT
is only valid when we have received a frame from
the peer, which we react to directly in mac80211.

The debugfs code I recently added got this wrong
as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Add support for hardware ARP query filtering
Juuso Oikarinen [Thu, 27 May 2010 12:32:13 +0000 (15:32 +0300)]
mac80211: Add support for hardware ARP query filtering

Some hardware allow extended filtering of ARP frames not intended for
the host. To perform such filtering, the hardware needs to know the current
IP address(es) of the host, bound to its interface.

Add support for ARP filtering to mac80211 by adding a new op to the driver
interface, allowing to configure the current IP addresses. This op is called
upon association with the currently configured address(es), and when
associated whenever the IP address(es) change.

This patch adds configuration of IPv4 addresses only, as IPv6 addresses don't
need ARP filtering.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: remove tx status ampdu_ack_map
Johannes Berg [Wed, 26 May 2010 15:19:25 +0000 (17:19 +0200)]
mac80211: remove tx status ampdu_ack_map

There's a single use of this struct member, but
as it is write-only it clearly not necessary.
Thus we can free up some space here, even if we
don't need it right now it seems pointless to
carry around the variable.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: remove bogus mod_timer() call
Johannes Berg [Wed, 26 May 2010 14:41:40 +0000 (16:41 +0200)]
mac80211: remove bogus mod_timer() call

The IBSS code has a bogus mod_timer(..., 0) call,
we shouldn't ever pass a constant value to the
function since any constant value could be in the
future or the past.

However, invoking the timer here is not necessary
at all, since we just finished scanning and just
need to have the IBSS code run again from the
workqueue later, so factor out the work starting
and use that instead.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: use the key handling code from ath9k_common instead of duplicating it
Felix Fietkau [Tue, 25 May 2010 17:42:46 +0000 (19:42 +0200)]
ath9k: use the key handling code from ath9k_common instead of duplicating it

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_common: use allocated key cache entries for multi BSS crypto support
Felix Fietkau [Tue, 25 May 2010 17:42:45 +0000 (19:42 +0200)]
ath9k_common: use allocated key cache entries for multi BSS crypto support

This patch replaces the buggy 'ath9k: Group Key fix for VAPs' change.

For AP mode group keys, use the BSSID as lookup mac address, with
the multicast keysearch bit set.
For IBSS mode, use the peer's MAC address with multicast keysearch.
For STA mode, keep using the group key slots.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: add multicast key search support
Felix Fietkau [Tue, 25 May 2010 17:42:44 +0000 (19:42 +0200)]
ath9k_hw: add multicast key search support

If a MAC address for a key table entry is flagged with the
multicast bit (0x01), indicate to the hardware that multicast
lookup instead of unicast lookup should be used. The multicast
bit itself never makes it to the actual keytable entry register,
as it is shifted out.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agossb: fast powerup delay calculation for PMU capable devices
Rafał Miłecki [Mon, 24 May 2010 19:50:24 +0000 (21:50 +0200)]
ssb: fast powerup delay calculation for PMU capable devices

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agossb: update PMU init to match specs
Rafał Miłecki [Mon, 24 May 2010 19:50:23 +0000 (21:50 +0200)]
ssb: update PMU init to match specs

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoRevert "iwlwifi: move _agn statistics related structure"
John W. Linville [Thu, 3 Jun 2010 17:55:37 +0000 (13:55 -0400)]
Revert "iwlwifi: move _agn statistics related structure"

This reverts commit a2064b7a4a22d118087898e4308670da7ac07911.

when CONFIG_IWLAGN=n:

drivers/net/wireless/iwlwifi/iwl-rx.c:254: error: 'struct iwl_priv' has no member named '_agn'
drivers/net/wireless/iwlwifi/iwl-rx.c:303: error: 'struct iwl_priv' has no member named '_agn'
drivers/net/wireless/iwlwifi/iwl-rx.c:304: error: 'struct iwl_priv' has no member named '_agn'
drivers/net/wireless/iwlwifi/iwl-rx.c:305: error: 'struct iwl_priv' has no member named '_agn'
drivers/net/wireless/iwlwifi/iwl-rx.c:306: error: 'struct iwl_priv' has no member named '_agn'

and many more.

Conflicts:

drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-rx.c

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Remove suspicious register write
Helmut Schaa [Thu, 3 Jun 2010 08:52:17 +0000 (10:52 +0200)]
rt2x00: Remove suspicious register write

Remove suspicious register write as the reg variable is never filled
with an TX_SW_CFG2 associated value before.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: fix use of mcs rates
Helmut Schaa [Thu, 3 Jun 2010 08:52:15 +0000 (10:52 +0200)]
rt2x00: fix use of mcs rates

In case of mcs rates txrate->idx contains the mcs index to be used for
transmission. Previously the mcs values dedicated for legacy rates where
used for mcs transmissions which resulted in the use of mcs 0 in a number
of cases (e.g. for all mcs rates >= 15 as rt2x00 does not register legacy
rates with indexes >= 15).

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Update TX_SW_CFG initvals for 305x SoC
Helmut Schaa [Thu, 3 Jun 2010 08:52:13 +0000 (10:52 +0200)]
rt2x00: Update TX_SW_CFG initvals for 305x SoC

Update TX_SW_CFG initvals for 305x SoC to match with the appropriate
legacy driver.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Use IEEE80211_TX_CTL_STBC flag
Ivo van Doorn [Thu, 3 Jun 2010 08:52:11 +0000 (10:52 +0200)]
rt2x00: Use IEEE80211_TX_CTL_STBC flag

Use the IEEE80211_TX_CTL_STBC flag to determine the
correct value to be used for the STBC field in the
TX descriptor

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: rt2800: disable TX STBC for 1 stream devices
Helmut Schaa [Thu, 3 Jun 2010 08:52:10 +0000 (10:52 +0200)]
rt2x00: rt2800: disable TX STBC for 1 stream devices

Disable TX STBC for 1 stream devices as a minimum of 2 streams is needed for TX STBC.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Fix HT40 operation in rt2800.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:52:08 +0000 (10:52 +0200)]
rt2x00: Fix HT40 operation in rt2800.

Closer inspection of the legacy Ralink driver reveals that in case of HT40+
or HT40- we must adjust the frequency settings that we program to the device.
Implement the same adjustment in the rt2x00 code.

With this HT40 seems to work for all devices supported by rt2800pci and
rt2800usb.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Sync rt2800 MCU boot signal with Ralink driver.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:52:06 +0000 (10:52 +0200)]
rt2x00: Sync rt2800 MCU boot signal with Ralink driver.

Latest versions of the Ralink rt2800 family drivers use 0 as the token value,
not 0xff.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Move PCI/USB specific register initializations to rt2800{pci,usb}.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:52:04 +0000 (10:52 +0200)]
rt2x00: Move PCI/USB specific register initializations to rt2800{pci,usb}.

This prevents us having common code depend on PCI or USB specific code.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Simplify check for external LNA in rt2800_init_rfcsr.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:52:02 +0000 (10:52 +0200)]
rt2x00: Simplify check for external LNA in rt2800_init_rfcsr.

Instead of parsing the EEPROM information, use the flag that was set during
device initialization.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Introduce separate interface type for PCI-express.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:52:00 +0000 (10:52 +0200)]
rt2x00: Introduce separate interface type for PCI-express.

Needed later for PCI-express specific code in rt2800pci.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Move all register definitions for rt2800 to rt2800.h.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:51:59 +0000 (10:51 +0200)]
rt2x00: Move all register definitions for rt2800 to rt2800.h.

There is no point on having them separated across 3 files.
At the same time rename USB_CYC_CFG to its proper name US_CYC_CNT
(as per the datasheet).

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Remove RT2870 chipset identification.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:51:57 +0000 (10:51 +0200)]
rt2x00: Remove RT2870 chipset identification.

There is no evidence, either in adapters or in the Ralink code, that such
a device actually exists. All so-call RT2870 adapter identify themselves
as RT2860.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Centralize rt2800 beacon writing.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:51:53 +0000 (10:51 +0200)]
rt2x00: Centralize rt2800 beacon writing.

The beacon writing functions of rt2800pci and rt2800usb are now identical.
Move them to rt2800lib to only have one central function.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Clean up USB vendor request buffer functions.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:51:51 +0000 (10:51 +0200)]
rt2x00: Clean up USB vendor request buffer functions.

There is no need to force the separation between a buffer USB vendor
request that does fit the CSR cache and one that doesn't onto the
callers. This is something that the rt2x00usb_vendor_request_buff
function can figure out by itself.
Combine the rt2x00usb_vendor_request_buff and
rt2x00usb_vendor_request_large_buff functions into a single one, as
both of them were equivalent for small buffers anyway.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Fix rt2800usb TX descriptor writing.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:51:50 +0000 (10:51 +0200)]
rt2x00: Fix rt2800usb TX descriptor writing.

The recent changes to skb handling introduced a bug in the rt2800usb
TX descriptor writing whereby the length of the USB packet wasn't
calculated correctly.
Found via code inspection, as the devices themselves didn't seem to mind.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Properly reserve room for descriptors in skbs.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:51:45 +0000 (10:51 +0200)]
rt2x00: Properly reserve room for descriptors in skbs.

Instead of fiddling with the skb->data pointer and thereby risking
out of bounds accesses, properly reserve the space needed in an
skb for descriptors.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:51:43 +0000 (10:51 +0200)]
rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc.

For rt2800 reverse the calling order of rt2x00pci_write_data and
rt2800pci_write_data. Currently rt2800pci_write_data calls rt2x00pci_write_data
as there can be only 1 driver callback function specified by the driver.
Reverse this calling order by introducing a new driver callback function,
called write_tx_datadesc, which is called from the bus-specific write_tx_data
functions.
Preparation for futher cleanups in the skb data handling of rt2x00.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agort2x00: Push beacon TX descriptor writing to drivers.
Gertjan van Wingerde [Thu, 3 Jun 2010 08:51:41 +0000 (10:51 +0200)]
rt2x00: Push beacon TX descriptor writing to drivers.

Not all the devices require a TX descriptor to be written (i.e. rt2800
device don't require them). Push down the creation of the TX descriptor
to the device drivers so that they can decide for themselves whether
a TX descriptor is to be created.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 years agoath9k_htc: fix build error when ATH9K_HTC_DEBUGFS not enabled
John W. Linville [Wed, 2 Jun 2010 20:53:58 +0000 (16:53 -0400)]
ath9k_htc: fix build error when ATH9K_HTC_DEBUGFS not enabled

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Fix scan parameter handling for 5GHz
Juuso Oikarinen [Mon, 24 May 2010 08:18:20 +0000 (11:18 +0300)]
wl1271: Fix scan parameter handling for 5GHz

The 5GHz bands were scanned without the proper IE's in place, preventing
proper 5GHz scanning. This patches fixes the problem by storing a pointer
to the scan request (with the IE's) for all iterations of scan.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Use proper rates for PSM entry/exit null-funcs for 5GHz
Juuso Oikarinen [Mon, 24 May 2010 08:18:19 +0000 (11:18 +0300)]
wl1271: Use proper rates for PSM entry/exit null-funcs for 5GHz

A fixed 1 mbps rate was used for the PSM entry/exit null-func frames. Fix this
by using the basic rates instead.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: the core wl1271 module shouldn't depend on SPI_MASTER
Luciano Coelho [Mon, 24 May 2010 08:18:18 +0000 (11:18 +0300)]
wl1271: the core wl1271 module shouldn't depend on SPI_MASTER

The core wl1271 module can also be used with SDIO, so it should not depend on
SPI_MASTER.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Flush TX buffers to air before going to idle
Juuso Oikarinen [Mon, 24 May 2010 08:18:17 +0000 (11:18 +0300)]
wl1271: Flush TX buffers to air before going to idle

The mac80211 changes to idle almost immediately after transmitting some
frames, such as deauth etc. When going to idle, the wl1271 is disconnected,
which causes TX frames already on buffers, but not yet transmitted, to be
deleted.

To make sure deauth frames reach the air, allow the TX buffers to flush
before proceeding to idle.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Idle handling into own function
Juuso Oikarinen [Mon, 24 May 2010 08:18:16 +0000 (11:18 +0300)]
wl1271: Idle handling into own function

As there is more and more stuff triggered by going in and out of idle,
create a separate function for handling that.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Prevent dropping of TX frames in joins
Juuso Oikarinen [Mon, 24 May 2010 08:18:15 +0000 (11:18 +0300)]
wl1271: Prevent dropping of TX frames in joins

The wl1271 uses a session counter in CMD_JOIN and TX frame descriptors. This
counter is used to determine which frames to drop when the CMD_JOIN is
executed.

The driver executes CMD_JOIN multiple times upon association and sometimes
disassociation, and we don't want any frames to get lost.

Fix this by incrementing the session counter only when leaving idle (not every
CMD_JOIN as before.) Also, remove the TX flush flag from the CMD_JOIN options.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: cleanup: remove unneeded null check
Dan Carpenter [Sat, 22 May 2010 20:33:11 +0000 (22:33 +0200)]
ath9k: cleanup: remove unneeded null check

We dereference "wmi" on the line before and also when we initialize "ah".
This check has always been after a dereference since the first commit a
couple months ago.  Looking through the code, it looks like "wmi" can't
actually be null here so I just removed the check.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless/prism54: Use memdup_user
Julia Lawall [Sat, 22 May 2010 08:25:44 +0000 (10:25 +0200)]
drivers/net/wireless/prism54: Use memdup_user

Use memdup_user when user data is immediately copied into the
allocated region.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
position p;
identifier l1,l2;
@@

-  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
+  to = memdup_user(from,size);
   if (
-      to==NULL
+      IS_ERR(to)
                 || ...) {
   <+... when != goto l1;
-  -ENOMEM
+  PTR_ERR(to)
   ...+>
   }
-  if (copy_from_user(to, from, size) != 0) {
-    <+... when != goto l2;
-    -EFAULT
-    ...+>
-  }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Fix bug in validating received data length for edma
Vasanthakumar Thiagarajan [Thu, 20 May 2010 21:34:48 +0000 (14:34 -0700)]
ath9k: Fix bug in validating received data length for edma

The rx status length should also be taken into account while
validating the length of a received frame.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Fix bug in accessing skb->data of rx frame for edma
Vasanthakumar Thiagarajan [Thu, 20 May 2010 21:34:47 +0000 (14:34 -0700)]
ath9k: Fix bug in accessing skb->data of rx frame for edma

Skip the rx status portion in skb->data before accessing ieee80211
frame header.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Clean up few function parameters in recv.c
Vasanthakumar Thiagarajan [Thu, 20 May 2010 21:34:46 +0000 (14:34 -0700)]
ath9k: Clean up few function parameters in recv.c

ath9k_rx_skb_preprocess() needs only ieee80211 frame header,
pass only frame headers instead of skb to that function. Also
remove ineffective frame dump in ath9k_process_rate().

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Move driver specific structures
Sujith [Thu, 20 May 2010 10:04:40 +0000 (15:34 +0530)]
ath9k: Move driver specific structures

A bunch of data structures are present in the
common module, which are internal to ath9k.
Move them to ath9k.h

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Move ath9k specific RX code to driver
Sujith [Thu, 20 May 2010 10:04:38 +0000 (15:34 +0530)]
ath9k: Move ath9k specific RX code to driver

This patch relocates RX processing code from the
common module to ath9k. This reduces the size
of the common module which is also used by ath9k_htc.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless: Storage class should be before const qualifier
Tobias Klauser [Thu, 20 May 2010 08:38:11 +0000 (10:38 +0200)]
drivers/net/wireless: Storage class should be before const qualifier

The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Enable TX IQ calibration on AR9003
Luis R. Rodriguez [Wed, 19 May 2010 20:45:50 +0000 (16:45 -0400)]
ath9k_hw: Enable TX IQ calibration on AR9003

To enable it we now disable and re-enable the PHY chips
after TX IQ calibration.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocfg80211: make action channel type optional
Johannes Berg [Wed, 19 May 2010 10:17:12 +0000 (12:17 +0200)]
cfg80211: make action channel type optional

When sending action frames, we want to verify
that we do that on the correct channel. However,
checking the channel type in addition can get in
the way, since the channel type could change on
the fly during an association, and it's not
useful to have the channel type anyway since it
has no effect on the transmission. Therefore,
make it optional to specify so that if wanted,
it can still be checked, but is not required.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: print error message if ANI levels are out of range
Bruno Randolf [Wed, 19 May 2010 01:31:42 +0000 (10:31 +0900)]
ath5k: print error message if ANI levels are out of range

Since we have sysfs to manually set the ANI levels, we should print errors to
the kernel log if the values are out of bounds.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: always calculate ANI listen time
Bruno Randolf [Wed, 19 May 2010 01:31:37 +0000 (10:31 +0900)]
ath5k: always calculate ANI listen time

Calculate 'listen' time also when automatic ANI is off, since this and the
"busy" time is useful information also in manual mode.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: add sysfs files for ANI parameters
Bruno Randolf [Wed, 19 May 2010 01:31:32 +0000 (10:31 +0900)]
ath5k: add sysfs files for ANI parameters

/sys/class/ieee80211/phy0/device/ani/ani_mode
/sys/class/ieee80211/phy0/device/ani/noise_immunity_level
/sys/class/ieee80211/phy0/device/ani/spur_level
/sys/class/ieee80211/phy0/device/ani/firstep_level
/sys/class/ieee80211/phy0/device/ani/ofdm_weak_signal_detection
/sys/class/ieee80211/phy0/device/ani/cck_weak_signal_detection
/sys/class/ieee80211/phy0/device/ani/noise_immunity_level_max
/sys/class/ieee80211/phy0/device/ani/spur_level_max
/sys/class/ieee80211/phy0/device/ani/firstep_level_max

sysfs has a lot of symlinks, so you can find the files also in other locations,
like (by PCI ID) /sys/devices/pci0000:00/0000:00:11.0/ani and others.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: use ath5k_softc as driver data
Bruno Randolf [Wed, 19 May 2010 01:31:26 +0000 (10:31 +0900)]
ath5k: use ath5k_softc as driver data

It's our "private driver data"... It's used more often and hw is the mac80211
part. This makes more sense with the next (sysfs) patch.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>