firefly-linux-kernel-4.4.55.git
15 years agoat76c50x-usb: set firmware and hardware version in wiphy
Kalle Valo [Thu, 24 Sep 2009 18:02:51 +0000 (11:02 -0700)]
at76c50x-usb: set firmware and hardware version in wiphy

Set firmware and hardware version in wiphy so that user space can access
it.

(Modification from original in favor of cfg80211 ethtool support. -- JWL)

Cc: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: add firmware and hardware version to wiphy
Kalle Valo [Thu, 24 Sep 2009 18:02:42 +0000 (11:02 -0700)]
cfg80211: add firmware and hardware version to wiphy

It's useful to provide firmware and hardware version to user space and have a
generic interface to retrieve them. Users can provide the version information
in bug reports etc.

Add fields for firmware and hardware version to struct wiphy.

(Dropped nl80211 bits for now and modified remaining bits in favor of
ethtool. -- JWL)

Cc: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: implement basic ethtool support for cfg80211 devices
John W. Linville [Wed, 30 Sep 2009 18:50:17 +0000 (14:50 -0400)]
wireless: implement basic ethtool support for cfg80211 devices

Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: validate the signature for EEPROM and OTP
Wey-Yi Guy [Fri, 2 Oct 2009 20:44:06 +0000 (13:44 -0700)]
iwlwifi: validate the signature for EEPROM and OTP

Both 1000 & 6000 series NICs contain on-chip OTP memory that
replaces the off-chip EEPROM memory. The nature of OTP means
there is a limited number of times a particular board can go through the
factory flow and be (re)calibrated. As a consequence there will be some boards
that contain EEPROM memory because OTP blocks were full.

In the signature validation routine, iwlwifi needs to make sure
"select bit" and "EEPROM/OTP signature" agree on the type of
NVM to be used to configure the system.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: replace iwl_poll_direct_bit with iwl_poll_bit for CSR access
Abhijeet Kolekar [Fri, 2 Oct 2009 20:44:05 +0000 (13:44 -0700)]
iwlwifi: replace iwl_poll_direct_bit with iwl_poll_bit for CSR access

Replace iwl_poll_direct_bit with iwl_poll_bit when accessing CSR registers.
There is no need to power up the mac to access CSR registers.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Acked-by: Ben M Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi/iwl3945 : unify apm stop operation
Abhijeet Kolekar [Fri, 2 Oct 2009 20:44:04 +0000 (13:44 -0700)]
iwlwifi/iwl3945 : unify apm stop operation

Unify the usage of apm_stop_master and apm_stop
across all hardwares.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: LED cleanup
Johannes Berg [Fri, 2 Oct 2009 20:44:03 +0000 (13:44 -0700)]
iwlwifi: LED cleanup

The iwlwifi drivers have LED blinking requirements that
mac80211 cannot fulfill due to the use of just a single
LED instead of different ones for TX, RX, radio etc.
Instead, the single LED blinks according to transfers
and is solid on the rest of the time. As such, having
LED class devices registered that mac80211 triggers are
connected to is pointless as we don't use the triggers
anyway.

Remove all the useless code and add hooks into the
driver itself. At the same time, make the LED code
abstracted so the core code that determines blink rate
etc. can be shared between 3945 and agn in iwlcore.

At the same time, the fact that we removed the use of
the mac80211 LED triggers means we can also remove the
IWLWIFI_LEDS Kconfig symbol since the LED support is
now self-contained.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: device tracing
Johannes Berg [Fri, 2 Oct 2009 20:44:02 +0000 (13:44 -0700)]
iwlwifi: device tracing

In order to have an easier way to debug issues, create
trace events (using the ftrace framework) that will
allow us to follow exactly what the driver is doing
with the device.

The text format isn't all that useful, but the binary
format can also be obtained easily via debugfs and
then analysed on the fly or offline with debugging
tools.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: set default aggregation frame count limit to 31
Wey-Yi Guy [Fri, 2 Oct 2009 20:44:01 +0000 (13:44 -0700)]
iwlwifi: set default aggregation frame count limit to 31

Multiple MPDUs can be aggregated, transmitted, and finally acknowledged
together using a single BA frame. Block ACK (BA) contains
bitmap size of 64*16 bits so the maximum frame count is 64.
The default value of aggregation frame count suggested by uCode is 31 to
achieve best performance.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: clear the translate table area
Huaxu Wan [Fri, 2 Oct 2009 20:44:00 +0000 (13:44 -0700)]
iwlwifi: clear the translate table area

Driver should clear the translate table area after receiving "Alive"
response from uCode. This patch corrects a mistake when doing this.

Signed-off-by: Huaxu Wan <huaxu.wan@linux.intel.com>
Signed-off-by: Guo Chaohong <chaohong.guo@linux.intel.com>
Acked-by: Ben M Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: change valid EEPROM version for 1000 series
Wey-Yi Guy [Fri, 2 Oct 2009 20:43:59 +0000 (13:43 -0700)]
iwlwifi: change valid EEPROM version for 1000 series

In order to support different type of 1000 series NICs we release to
customers before the production release, iwlwifi driver need to support
all the NICs has EEPROM version greater than 0x15c.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: reliable entering of critical temperature state
Wey-Yi Guy [Fri, 2 Oct 2009 20:43:58 +0000 (13:43 -0700)]
iwlwifi: reliable entering of critical temperature state

When uCode detects critical temperature it should send "card state
notification" interrupt to driver and then shut itself down to prevent
overheating. There is a race condition where uCode shuts down before it
can deliver the interrupt to driver.
Additional method provided here for driver to enter CT_KILL state based
on temperature reading.

How it works:
Method 1:
If driver receive "card state notification" interrupt from uCode; it
enters "CT_KILL" state immediately

Method 2:
If the last temperature report by Card reach Critical temperature,
driver will send "statistic notification" request to uCode to verify the
temperature reading, if driver can not get reply from uCode within
300ms, driver will enter CT_KILL state automatically.

Method 3:
If the last temperature report by Card did not reach Critical
temperature, but uCode already shut down due to critical temperature.
All the host commands send to uCode will not get process by uCode;
when command queue reach the limit, driver will check the last reported
temperature reading, if it is within pre-defined margin, enter "CT_KILL"
state immediately. In this case, when uCode ready to exit from "CT_KILL" state,
driver need to restart the adapter in order to reset all the queues and
resume normal operation.

One additional issue being address here, when system is in CT_KILL
state, both tx and rx already stopped, but driver still can send host
command to uCode, it will flood the command queue since card was not
responding; adding STATUS_CT_KILL flag to reject enqueue host commands
to uCode if it is in CT_KILL state, when uCode is ready to come out of
CT_KILL, driver will clear  the STATUS_CT_KILL bit and allow enqueue the host
commands to uCode to recover from CT_KILL state.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowl1251: remove wl1251_netlink.h
Kalle Valo [Thu, 1 Oct 2009 09:51:20 +0000 (12:51 +0300)]
wl1251: remove wl1251_netlink.h

The file was accidentally added in commit ef2f8d4577 ("wl1251: add
wl1251 prefix to all 1251 files"). This happened when I rebased the
patches from a private tree.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agolibertas: Add auto deep sleep support for SD8385/SD8686/SD8688
Amitkumar Karwar [Thu, 1 Oct 2009 03:04:38 +0000 (20:04 -0700)]
libertas: Add auto deep sleep support for SD8385/SD8686/SD8688

Add timer based auto deep sleep feature in libertas driver which can be
configured using iwconfig command. This is tested on SD8688, SD8686 cards
with firmware versions 10.38.1.p25, 9.70.4.p0 respectively on 32-bit and 64-bit
platforms. Tests have been done for USB/CS cards to make sure that the patch
won't break USB/CS code. We didn't test the if_spi driver.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agostaging: Add proper selection of WIRELESS_EXT and WEXT_PRIV
Larry Finger [Thu, 1 Oct 2009 18:22:27 +0000 (13:22 -0500)]
staging: Add proper selection of WIRELESS_EXT and WEXT_PRIV

After the incorporation of the patch entitled "wext: refactor", some
of the wireless drivers in drivers/staging fail to build because they
need to have CONFIG_WIRELESS_EXT and CONFIG_WEXT_PRIV defined.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowext: refactor
Johannes Berg [Tue, 29 Sep 2009 21:27:28 +0000 (23:27 +0200)]
wext: refactor

Refactor wext to
 * split out iwpriv handling
 * split out iwspy handling
 * split out procfs support
 * allow cfg80211 to have wireless extensions compat code
   w/o CONFIG_WIRELESS_EXT

After this, drivers need to
 - select WIRELESS_EXT - for wext support
 - select WEXT_PRIV - for iwpriv support
 - select WEXT_SPY - for iwspy support

except cfg80211 -- which gets new hooks in wext-core.c
and can then get wext handlers without CONFIG_WIRELESS_EXT.

Wireless extensions procfs support is auto-selected
based on PROC_FS and anything that requires the wext core
(i.e. WIRELESS_EXT or CFG80211_WEXT).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros: define a common priv struct
Luis R. Rodriguez [Mon, 28 Sep 2009 06:54:40 +0000 (02:54 -0400)]
atheros: define a common priv struct

hw code should never use private driver data, but
sometimes we need a backpointer so just stuff it on
the common ath struct.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agonl80211: report age of scan results
Holger Schurig [Thu, 24 Sep 2009 10:21:01 +0000 (12:21 +0200)]
nl80211: report age of scan results

Linux keeps scan results up to 15 seconds. This can be a problem for fast
moving clients: they get back stale data. But if the kernel reports the age
of the BSS items, then user-space can simply weed out old entries by itself.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k_hw: add AR9271 srev and device ID to allow hw to support ar9271
Luis R. Rodriguez [Thu, 24 Sep 2009 03:07:02 +0000 (23:07 -0400)]
ath9k_hw: add AR9271 srev and device ID to allow hw to support ar9271

This allows for hw support to be enabled for ar9271.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k_hw: print device ID if not supported
Luis R. Rodriguez [Thu, 24 Sep 2009 03:07:01 +0000 (23:07 -0400)]
ath9k_hw: print device ID if not supported

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move hw code to its own module
Luis R. Rodriguez [Thu, 24 Sep 2009 03:07:00 +0000 (23:07 -0400)]
ath9k: move hw code to its own module

hw code for Atheros 802.11n hardware is commmon between
different chipsets. This moves this code into a separate
module, the next expected user of this code will be
the ath9k_htc module.

The ath9k/ dir is now selected by ATH9K_HW, an option which
gets selected by either ath9k or ath9k_htc, but remains
invisible for user menuconfig configuration. If either
ath9k or ath9k_htc will be compiled into the kernel
ath9k_hw will also be compiled in.

Cc: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: use common read/write ops on pci and debug code
Luis R. Rodriguez [Thu, 24 Sep 2009 03:06:59 +0000 (23:06 -0400)]
ath9k: use common read/write ops on pci and debug code

PCI and debug code will not be shared between ath9k and
ath9k_htc, so make that code use the common read/write ops.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43: Comment unused functions lpphy_restore_dig_flt_state and lpphy_disable_rx_gain_o...
Jaswinder Singh Rajput [Sun, 20 Sep 2009 08:09:24 +0000 (13:39 +0530)]
b43: Comment unused functions lpphy_restore_dig_flt_state and lpphy_disable_rx_gain_override

Commenting unused functions lpphy_restore_dig_flt_state and
lpphy_disable_rx_gain_override, may be we need these functions in future.

This also fixed following compilation warnings :
  CC [M]  drivers/net/wireless/b43/phy_lp.o
drivers/net/wireless/b43/phy_lp.c:383: warning: ‘lpphy_restore_dig_flt_state’ defined but not used
drivers/net/wireless/b43/phy_lp.c:891: warning: ‘lpphy_disable_rx_gain_override’ defined but not used

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: drop lib80211 dependency
Christian Lamparter [Fri, 18 Sep 2009 16:20:03 +0000 (18:20 +0200)]
iwlwifi: drop lib80211 dependency

Ever since Johannes' "iwlwifi: improve scan support" iwlwifi
no longer needs any of lib80211's functions or definitions.

This patch updates iwlwifi's Kconfig _selections_ and
removes all left lib80211.h inclusions from the source files.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix bugs in handling TX power
Senthil Balasubramanian [Fri, 18 Sep 2009 09:38:20 +0000 (15:08 +0530)]
ath9k: Fix bugs in handling TX power

* Get power table offset from the EEPROM instead of using
  a hardcoded value of -5 if the EEPROM rev is >= 21.
* Add support in the 4k eeprom code for tx power offset
  in case we have a 4k AR9280 implementation.
* Fix tx power accuracy at high powers.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Advertise midband for AR5416 devices
Senthil Balasubramanian [Fri, 18 Sep 2009 09:37:33 +0000 (15:07 +0530)]
ath9k: Advertise midband for AR5416 devices

This has to be done if the EEPROM supports FCC Midband
capability.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Reduce PLL Settle time and eliminate redundant PLL calls.
Senthil Balasubramanian [Fri, 18 Sep 2009 09:37:03 +0000 (15:07 +0530)]
ath9k: Reduce PLL Settle time and eliminate redundant PLL calls.

Reduce PLL Settle time and eliminate redundant PLL calls. Also reduce
the LoadNF timeout from 10 msec to 250usec as the 10 msec timeout was
hit with AR9285 in some cases.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Handle ATH9K_BEACON_RESET_TSF properly
Senthil Balasubramanian [Fri, 18 Sep 2009 09:36:37 +0000 (15:06 +0530)]
ath9k: Handle ATH9K_BEACON_RESET_TSF properly

Clearing a local variable is unnecessary.
Get rid of it.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Allow PSPOLL only when the interface is configured in AP mode
Senthil Balasubramanian [Fri, 18 Sep 2009 09:36:07 +0000 (15:06 +0530)]
ath9k: Allow PSPOLL only when the interface is configured in AP mode

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Update initvals
Vasanthakumar Thiagarajan [Fri, 18 Sep 2009 09:34:51 +0000 (15:04 +0530)]
ath9k: Update initvals

* Move 0xa274 and 0xa27c to the top of tx_gain table.
* Update initvals to fix random failure of noise floor calibration.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix RTC reset for AR5416
Sujith [Fri, 18 Sep 2009 09:34:27 +0000 (15:04 +0530)]
ath9k: Fix RTC reset for AR5416

For AR5416 chipsets, clearing RTC_RESET_EN when setting
the chip to SLEEP mode results in high power consumption.
This patch fixes this issue by not clearing it for AR5416.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Update INI release for AR9287
Sujith [Fri, 18 Sep 2009 09:34:07 +0000 (15:04 +0530)]
ath9k: Update INI release for AR9287

If the current channel is between 2412 and 2472 MHz and if the channel is
changing to 2484 MHz, then the registers 0xa1f4, 0xa1f8 and 0xa1fc need to be
programmed to the "japan_2484" values.  Conversely, if the current channel
is 2484 MHz and if the channel is changing to one between 2412 and 2472 MHz, then
the three registers need to be programmed to the "normal" values.

This is needed for compliance with Japanese regulatory requirements.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Add Calibration checks
Vivek Natarajan [Fri, 18 Sep 2009 09:33:42 +0000 (15:03 +0530)]
ath9k: Add Calibration checks

* Prevent divide-by-zero errors in IQ Calibration.
* Do not run temperature compensation if initPDADC or currPDADC is zero.
* Also, introduce a separate function for handling OLC for AR9287.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: handle overflow in tsf_low register during get_tsf
Joerg Albert [Tue, 15 Sep 2009 21:27:53 +0000 (23:27 +0200)]
ar9170: handle overflow in tsf_low register during get_tsf

ar9170_op_get_tsf: handle a carry from TSF_L into TSF_H
by reading TSF_H twice.

Signed-off-by: Joerg Albert <jal2@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: add heavy clip handling
Joerg Albert [Tue, 15 Sep 2009 20:23:06 +0000 (22:23 +0200)]
ar9170: add heavy clip handling

add heavy clip handling for 2.4GHz only (similar to the vendor driver).

Signed-off-by: Joerg Albert <jal2@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: fixed coding style, moved define
Joerg Albert [Tue, 15 Sep 2009 20:20:22 +0000 (22:20 +0200)]
ar9170: fixed coding style, moved define

This patch fixes some coding style issues and moves MAX_RATE_POWER into hw.h

Signed-off-by: Joerg Albert <jal2@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: add module firmware info for 1000 series
Huaxu Wan [Fri, 25 Sep 2009 21:24:28 +0000 (14:24 -0700)]
iwlwifi: add module firmware info for 1000 series

The module firmware information of 1000 series is missing from iwlagn.

Signed-off-by: Huaxu Wan <huaxu.wan@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: support idle for 6000 series hw
Johannes Berg [Fri, 25 Sep 2009 21:24:27 +0000 (14:24 -0700)]
iwlwifi: support idle for 6000 series hw

Using powersave while idle saves a lot of power, but
we've had problems with this on some cards (5150 has
been reported to be problematic). However, on the new
6000 series we're seeing no problems, so for now let
that hardware benefit from idle mode, we can look at
the problems with other hardware one by one and then
enable those once we figure out the problems.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: Chain Noise Calibration for 6000 series
Wey-Yi Guy [Fri, 25 Sep 2009 21:24:26 +0000 (14:24 -0700)]
iwlwifi: Chain Noise Calibration for 6000 series

Adding support of Chain Noise Calibration for 6000 series NICs.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: default to using all chains
Johannes Berg [Fri, 25 Sep 2009 21:24:25 +0000 (14:24 -0700)]
iwlwifi: default to using all chains

When instructing the microcode to use just a single
chain when we have power saving enabled, we should
also tell the AP that we are doing SM powersave.
However, using a single chain doesn't actually have
any power saving advantage while idle -- measurements
show that the power consumption is no different when
using one vs. two or three chains.

Therefore, always instruct the microcode to use all
chains.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: fix a typo
Johannes Berg [Fri, 25 Sep 2009 21:24:24 +0000 (14:24 -0700)]
iwlwifi: fix a typo

We never have four chains, but let's fix the typo
while we noticed it. You count 0, 1, 2, 3, not
0, 1, 2, 4 :)

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: add LED mode to support different LED behavior
Wey-Yi Guy [Thu, 17 Sep 2009 17:43:54 +0000 (10:43 -0700)]
iwlwifi: add LED mode to support different LED behavior

Today's implementation allow LED to blink based on the traffic
condition. We introduce an additional LED mode that reflects the RF
state.

The supported LED modes after this are:
  IWL_LED_BLINK (current/default) - blink rate based on current Tx/Rx
                                    traffic
  IWL_LED_RF_STATE (new) -
    LED OFF: No power/RF disabled, the LED is emitting no light
    LED ON:  Powered/RF enabled, the LED is emitting light
             in a stable non-flashing state.

In order to provide the flexibility to support different LED
behavior per user/system preference we add "led_mode" iwlcore module
parameter.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: update PCI Subsystem ID for 6000 series
Wey-Yi Guy [Thu, 17 Sep 2009 17:43:53 +0000 (10:43 -0700)]
iwlwifi: update PCI Subsystem ID for 6000 series

Update PCI Subsystem ID for 60x0 series based on HW SKU. Adding new SKU
for "ABG" and "BG" only devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: update PCI Subsystem ID for 1000 series
Wey-Yi Guy [Thu, 17 Sep 2009 17:43:52 +0000 (10:43 -0700)]
iwlwifi: update PCI Subsystem ID for 1000 series

Update PCI Subsystem ID for 1000 series based on HW SKU. Adding new SKU
for "BG" only devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: send cmd to uCode to configure valid tx antenna
Wey-Yi Guy [Thu, 17 Sep 2009 17:43:51 +0000 (10:43 -0700)]
iwlwifi: send cmd to uCode to configure valid tx antenna

In order for uCode to select the valid antennas for transmit, driver
need to configure the allowed tx antennas through host command.

The TX_ANT_CONFIGURATION_CMD should be used for 5000 series and up

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: add aggregation tables to the rate scaling algorithm
Daniel C Halperin [Thu, 17 Sep 2009 17:43:50 +0000 (10:43 -0700)]
iwlwifi: add aggregation tables to the rate scaling algorithm

Current rate scale algorithm fluctuates between different MIMO modes fairly
rapidly, causing widely varying performance. These fluctuations occur because in
the rate_scale tables for expected throughput the values are not very different
for different modes.

However, when aggregation is turned on and MAC overhead is reduced, the
expected throughput for different MIMO modes grows and different modes have
vastly different performance. Add expected throughput tables for this case.

We also need to keep track of aggregation status per-station, so we add the
"is_agg" field to struct lq_sta.

Also includes cleanup of comments and variable names in/around the affected
code.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: do not clear TX info flags when receiving BlockAckResponse
Daniel C Halperin [Thu, 17 Sep 2009 17:43:49 +0000 (10:43 -0700)]
iwlwifi: do not clear TX info flags when receiving BlockAckResponse

OR-in AMPDU flags rather than assigning them.  This lets the TX status for
aggregated packets be processed by rs_tx_status.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: clean up rs_tx_status
Daniel C Halperin [Thu, 17 Sep 2009 17:43:48 +0000 (10:43 -0700)]
iwlwifi: clean up rs_tx_status

Cut down on redundant code, reorganize structure, and add/improve comments.
Should contain no functional changes.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: use S_IRUGO and S_IWUSR in module parameters
Wey-Yi Guy [Thu, 17 Sep 2009 17:43:47 +0000 (10:43 -0700)]
iwlwifi: use S_IRUGO and S_IWUSR in module parameters

Instead of hardcode module parameter's permissions, use pre-defined.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: EEPROM version for 1000 and 6000 series
Wey-Yi Guy [Thu, 17 Sep 2009 17:43:46 +0000 (10:43 -0700)]
iwlwifi: EEPROM version for 1000 and 6000 series

Update EEPROM version requirement for 1000 and 6000 series of NIC
for EEPROM version verification.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: allow user change protection mechanism for HT
Wey-Yi Guy [Thu, 17 Sep 2009 17:43:45 +0000 (10:43 -0700)]
iwlwifi: allow user change protection mechanism for HT

Allow user to change protection mechanism for HT between RTS/CTS and
CTS-to-self through sysfs:

Show current protection mechanism for HT
   cat /sys/class/net/wlan0/device/rts_ht_protection

Change protection mechanism for HT (only allowed while not-associated)
CTS-to-self:
   echo 0 > /sys/class/net/wlan0/device/rts_ht_protection
RTS/CTS:
   echo 1 > /sys/class/net/wlan0/device/rts_ht_protection

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: Use RTS/CTS as the preferred protection mechanism for 6000 series
Wey-Yi Guy [Thu, 17 Sep 2009 17:43:44 +0000 (10:43 -0700)]
iwlwifi: Use RTS/CTS as the preferred protection mechanism for 6000 series

When 802.11g was introduced, we had RTS/CTS and CTS-to-Self protection
mechanisms. In an HT Beacon, HT stations use the "Operating Mode" field
in the HT Information Element to determine whether or not to use
protection.

The Operating Mode field has 4 possible settings: 0-3:
Mode 0: If all stations in the BSS are 20/40 MHz HT capable, or if the
BSS is 20/40 MHz capable, or if all stations in the BSS are 20 MHz HT
stations in a 20 MHz BSS
Mode 1: used if there are non-HT stations or APs using the primary or
secondary channels
Mode 2: if only HT stations are associated in the BSS and at least one
20 MHz HT station is associated.
Mode 3: used if one or more non-HT stations are associated in the BSS.

When in operating modes 1 or 3, and the Use_Protection field is 1 in the
Beacon's ERP IE, all HT transmissions must be protected using RTS/CTS or
CTS-to-Self.

By default, CTS-to-self is the preferred protection mechanism for less
overhead and higher throughput; but using the full RTS/CTS will better
protect the inner exchange from interference, especially in
highly-congested environment.

For 6000 series WIFI NIC, RTS/CTS protection mechanism is the
recommended choice for HT traffic based on the HW design.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: clarify and clean up chain settings
Johannes Berg [Fri, 11 Sep 2009 17:38:17 +0000 (10:38 -0700)]
iwlwifi: clarify and clean up chain settings

The chain settings we currently use in iwlwifi are
rather confusing -- and we also go by the wrong
settings entirely under certain circumstances. To
clean it up, create a new variable in the current
HT config -- single_chain_sufficient -- that tells
us whether we need more than one chain. Calculate
that based on the AP and operating mode (no IBSS
HT implemented -- so no need for multiple chains,
for station mode we use the AP's capabilities).

Additionally, since APs always send disabled SM PS
mode, keeping track of their sm_ps mode isn't very
useful -- doubly not so for our _own_ RX config
since that should depend on our, not the AP's, SM
PS mode.

Finally, document that our configuration of the
number of RX chains used is currently wrong when
in powersave (by adding a comment).

All together this removes the two remaining items
in struct iwl_ht_config that were done wrong there.

For the future, the number of RX chains and some
SM PS handshaking needs to be added to mac80211,
which then needs to tell us, and the new variable
current_ht_config.single_chain_sufficient should
also be calculated by mac80211.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: show NVM version in debugfs
Wey-Yi Guy [Fri, 11 Sep 2009 17:38:16 +0000 (10:38 -0700)]
iwlwifi: show NVM version in debugfs

Show version number along with dumping NVM data, the version information
being removed from sysfs, add it back to debugfs to help debugging.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: clean up ht config naming
Johannes Berg [Fri, 11 Sep 2009 17:38:15 +0000 (10:38 -0700)]
iwlwifi: clean up ht config naming

Daniel Halperin pointed out that the naming
here is rather inconsistent with at least 3
different names being used for one thing in
different contexts. Rename the struct to
iwl_ht_config (rather than iwl_ht_info) and
use ht_conf as a variable for it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: Adjust blink rate to compensate Clock difference
Wey-Yi Guy [Fri, 11 Sep 2009 17:38:14 +0000 (10:38 -0700)]
iwlwifi: Adjust blink rate to compensate Clock difference

Adjust led blink rate to compensate on a MAC Clock difference on every
HW. Led blink rate analysis showed an average deviation of 0% on 3945,
5% on 4965 HW and 20% on 5000 series and up.
Need to compensate on the led on/off time per HW according to the
deviation to achieve the desired led frequency
The calculation is: (100-averageDeviation)/100 * blinkTime
For code efficiency the calculation will be:
    compensation = (100 - averageDeviation) * 64 / 100
    NewBlinkTime = (compensation * BlinkTime) / 64

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: clean up ht config a little
Johannes Berg [Fri, 11 Sep 2009 17:38:13 +0000 (10:38 -0700)]
iwlwifi: clean up ht config a little

is_ht can be bool instead of u8, and there's
no need to use IWL_CHANNEL_WIDTH_* constants
in supported_chan_width when that could just
be named is_40mhz instead.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: separate set_hw_params function for 6000 series
Wey-Yi Guy [Fri, 11 Sep 2009 17:38:11 +0000 (10:38 -0700)]
iwlwifi: separate set_hw_params function for 6000 series

Separate set_hw_params() function for 6000
series from 5000/1000 series because:
    1) 6000 series use different set of sensitivity range table
    2) 6000 series has different uCode image size

Also include the new sensitivity parameters needed by sensitivity
algorithm.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: separate nic_config for different NIC
Wey-Yi Guy [Fri, 11 Sep 2009 17:38:10 +0000 (10:38 -0700)]
iwlwifi: separate nic_config for different NIC

Different NIC has different requirements for configuration. Currently all
5000 series hardware and later share the same configuration function even
though they do not need the same configurations. Fix this by separating the
needed configuration actions for each hardware model.

.5000 series: L1-ASPM H/W bug work-around
              configure radio
              write CSR_HW_IF_CONFIG_REG for uCode use
              work-around for NIC get stuck after early PCIe power off

.1000 series: write CSR_HW_IF_CONFIG_REG for uCode use
              setting digital SVR for 1000 card to 1.32V

.6000 series: configure radio
              write CSR_HW_IF_CONFIG_REG for uCode use
              write CSR_GP_DRIVER_REG to indicate radio sku

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: remove un-supported eeprom parameters
Wey-Yi Guy [Fri, 11 Sep 2009 17:38:09 +0000 (10:38 -0700)]
iwlwifi: remove un-supported eeprom parameters

Remove few of the parameters not used and no longer valid in EEPROM.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: modify LED blink index table
Wey-Yi Guy [Fri, 11 Sep 2009 17:38:07 +0000 (10:38 -0700)]
iwlwifi: modify LED blink index table

Modify LED blink index table to include 1Mbps.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: make ath9k_common_ops const
Luis R. Rodriguez [Mon, 14 Sep 2009 09:09:38 +0000 (02:09 -0700)]
ath9k: make ath9k_common_ops const

As noted by Jiri.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros: move bus ops to ath_common
Luis R. Rodriguez [Mon, 14 Sep 2009 07:55:09 +0000 (00:55 -0700)]
atheros: move bus ops to ath_common

This is the last part to make ath9k hw code core driver agnostic.
I believe ath9k_htc can now use use the hw code unmodified.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move ATH9K_RSSI_BAD to hw.h
Luis R. Rodriguez [Mon, 14 Sep 2009 06:55:05 +0000 (23:55 -0700)]
ath9k: move ATH9K_RSSI_BAD to hw.h

mac.c is now core driver independent.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: clarify what hw code is and remove ath9k.h from a few files
Luis R. Rodriguez [Mon, 14 Sep 2009 06:39:31 +0000 (23:39 -0700)]
ath9k: clarify what hw code is and remove ath9k.h from a few files

hw code will be shared between ath9k and ath9k_htc.
Just a few more files are left to clean up, mark them as well.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: remove driver ASSERT, just use BUG_ON()
Luis R. Rodriguez [Mon, 14 Sep 2009 06:28:00 +0000 (23:28 -0700)]
ath9k: remove driver ASSERT, just use BUG_ON()

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move ATH_AMPDU_LIMIT_MAX to hw.h
Luis R. Rodriguez [Mon, 14 Sep 2009 06:11:13 +0000 (23:11 -0700)]
ath9k: move ATH_AMPDU_LIMIT_MAX to hw.h

This is used by hw code.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: remove ath9k_ht_macmode
Luis R. Rodriguez [Mon, 14 Sep 2009 06:04:44 +0000 (23:04 -0700)]
ath9k: remove ath9k_ht_macmode

This is used just to determine how to program the MAC,
either for 20 MHz operation of 40 MHz so just use conf_is_ht40()

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: remove ath9k 25 MHz HT40 spacing stuff
Luis R. Rodriguez [Mon, 14 Sep 2009 05:05:04 +0000 (22:05 -0700)]
ath9k: remove ath9k 25 MHz HT40 spacing stuff

This was for supporting 25 MHz spacing for HT40, this is not used
as we use 20 MHz spacing instead for HT40 as per 802.11n. The hardware
is capable of it though so we leave the phymode definition and EEPROM
parsing for it. If some experimenter wants to work on this stuff stuff
you can add an extension enabling bool on ath_common and perhaps some
debugfs knob to enable it. Keep in mind you'll also need to update the
phymode with the AR_PHY_FC_DYN2040_EXT_CH which has been left on the
driver.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros: move tx/rx chainmask to ath_common
Luis R. Rodriguez [Mon, 14 Sep 2009 04:07:07 +0000 (21:07 -0700)]
atheros: move tx/rx chainmask to ath_common

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros: add common debug printing
Luis R. Rodriguez [Sun, 13 Sep 2009 09:42:02 +0000 (02:42 -0700)]
atheros: add common debug printing

ath9k uses this for now, ath9k_htc is expected to re-use this
as well. We lave ath5k as is, but it certainly can also be
converted later.

The ath9k module parameter and debugfs entry is kept.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: separate core driver and hw timer code
Luis R. Rodriguez [Sun, 13 Sep 2009 09:08:34 +0000 (02:08 -0700)]
ath9k: separate core driver and hw timer code

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros: add ieee80211_hw to ath_common
Luis R. Rodriguez [Sun, 13 Sep 2009 07:03:27 +0000 (00:03 -0700)]
atheros: add ieee80211_hw to ath_common

Make use of it on hw code in ath9k to avoid
using the ath9k ath_softc.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros: define shared bssidmask setting
Luis R. Rodriguez [Fri, 11 Sep 2009 00:52:45 +0000 (17:52 -0700)]
atheros: define shared bssidmask setting

Also make ath5k and ath9k use it, and share register definitions.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: define ath_common ops
Luis R. Rodriguez [Thu, 10 Sep 2009 23:55:11 +0000 (16:55 -0700)]
ath5k: define ath_common ops

Only common ath read/write ops go through the common ops.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: allocate ath5k_hw prior to initializing hw
Luis R. Rodriguez [Fri, 11 Sep 2009 01:04:47 +0000 (18:04 -0700)]
ath5k: allocate ath5k_hw prior to initializing hw

We can propagate better errors upon failed hw initialization,
and set up the ath_common structure for attach purposes. This
will become important once we start using the ath_common
for read/write ops.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros/ath9k: add common read/write ops and port ath9k to use it
Luis R. Rodriguez [Thu, 10 Sep 2009 23:11:21 +0000 (16:11 -0700)]
atheros/ath9k: add common read/write ops and port ath9k to use it

In an effort to make hw code driver core agnostic read
and write operations are defined on the ath_common structure.
This patch adds that and makes ath9k use it. This allows
drivers like ath9k_htc to define its own read/write ops and
still rely on the same hw code. This also paves the way for
sharing code between ath9k/ath5k/ath9k_htc.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Define bus agnostic bluetooth coex prep helper
Luis R. Rodriguez [Thu, 10 Sep 2009 19:12:23 +0000 (12:12 -0700)]
ath9k: Define bus agnostic bluetooth coex prep helper

We disable ASPM when enabling bluetooth coexistance. Disabling
ASPM is a bus specific operation. In the future other buses may
support bluetooth coexistance, an example is USB. To this end
move the current routine which disables ASPM into pci.c, and declare
it the PCI bt_coex_prep() helper. Additionally, since ASPM is
a PCI-Express primitive ensure we don't ever try to muck with ASPM
registers on non PCI-express devices.

This also cleans up hw.c to not include bus specific headers or
utilities.

Cc: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Zhifeng Cai <zhifeng.cai@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: move ath_common to ath5k_hw
Luis R. Rodriguez [Thu, 10 Sep 2009 18:20:57 +0000 (11:20 -0700)]
ath5k: move ath_common to ath5k_hw

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move ath_common to ath_hw
Luis R. Rodriguez [Thu, 10 Sep 2009 18:08:14 +0000 (11:08 -0700)]
ath9k: move ath_common to ath_hw

This ensures that we can access common on hw related code
independent of the driver core.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: initialize eeprom struct early on attach
Luis R. Rodriguez [Thu, 10 Sep 2009 17:57:00 +0000 (10:57 -0700)]
ath5k: initialize eeprom struct early on attach

This fixes this sparse warning:

  CHECK   drivers/net/wireless/ath/ath5k/attach.c
drivers/net/wireless/ath/ath5k/attach.c:288:42: warning: symbol 'ee' shadows an earlier one
drivers/net/wireless/ath/ath5k/attach.c:109:34: originally declared here

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: use common curbssid, bssidmask and macaddr
Luis R. Rodriguez [Thu, 10 Sep 2009 17:51:33 +0000 (10:51 -0700)]
ath5k: use common curbssid, bssidmask and macaddr

The ah_sta_id was really being used as the macaddr.
ath5k still does not use the association ID now passed
up by mac80211, that can be fixed later.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: make use of common macaddr and curbssid
Luis R. Rodriguez [Thu, 10 Sep 2009 17:10:54 +0000 (10:10 -0700)]
ar9170: make use of common macaddr and curbssid

These are provided by ath_common.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros/ath9k: move macaddr, curaid, curbssid and bssidmask to common
Luis R. Rodriguez [Thu, 10 Sep 2009 16:22:37 +0000 (09:22 -0700)]
atheros/ath9k: move macaddr, curaid, curbssid and bssidmask to common

These are common amongst ath9k and ath5k, so put them into the
common structure and make ath9k to use it. ar9170 can use macaddr,
and curbssid. We'll change ath5k and ar9170 separately.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: use ath9k_hw_write_associd() on reset
Luis R. Rodriguez [Thu, 10 Sep 2009 15:57:00 +0000 (08:57 -0700)]
ath9k: use ath9k_hw_write_associd() on reset

Use the already provided helper instead of rewriting the code
required in place.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Use ath9k_hw_setbssidmask() on reset
Luis R. Rodriguez [Thu, 10 Sep 2009 15:54:56 +0000 (08:54 -0700)]
ath9k: Use ath9k_hw_setbssidmask() on reset

The same code was being implemented on reset for setting the bssidmask,
instead just use the already provided helper.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: make ath9k_hw_setbssidmask() and ath9k_hw_write_associd() use ath_hw
Luis R. Rodriguez [Thu, 10 Sep 2009 15:50:20 +0000 (08:50 -0700)]
ath9k: make ath9k_hw_setbssidmask() and ath9k_hw_write_associd() use ath_hw

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoatheros: use get_unaligned_le*() for bssid mask setting
Luis R. Rodriguez [Thu, 10 Sep 2009 05:43:17 +0000 (22:43 -0700)]
atheros: use get_unaligned_le*() for bssid mask setting

Historically some macro helpers have been users for this,
AR5K_LOW_ID() and AR5K_HIGH_ID(), use upstream unaligned
helpers instead. This applid to ath5k and ar9170. ath9k
already uses this.

Worth noting is ath5k uses an ah_sta_id but that is already
the MAC address combined with the associaiton ID, ah_sta_id
is really ETH_ALEN in size.

Cc: Bob Copeland <me@bobcopeland.com>
Cc: Nick Kossifidis <mick@madwifi-project.org>
Cc: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath: move ath_bcast_mac to common header
Luis R. Rodriguez [Thu, 10 Sep 2009 05:19:26 +0000 (22:19 -0700)]
ath: move ath_bcast_mac to common header

This is used by both ath5k and ath9k to set the first bssid mask.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: rename driver core and hw power save helpers
Luis R. Rodriguez [Thu, 10 Sep 2009 04:10:09 +0000 (21:10 -0700)]
ath9k: rename driver core and hw power save helpers

ath9k_hw_setpower_nolock --> ath9k_hw_setpower()
ath9k_hw_setpower() --> ath9k_setpower()

Also change the param for ath9k_setpower() to pass the ath_softc.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move ath9k_hw_setpower() to main.c
Luis R. Rodriguez [Thu, 10 Sep 2009 04:02:34 +0000 (21:02 -0700)]
ath9k: move ath9k_hw_setpower() to main.c

And we make it static.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: avoid usage of ath9k_hw_setpower() on hw.c
Luis R. Rodriguez [Thu, 10 Sep 2009 03:54:36 +0000 (20:54 -0700)]
ath9k: avoid usage of ath9k_hw_setpower() on hw.c

ath9k_hw_setpower() is a core driver helper with locking
protection. Locking protection should be left to the driver
core, not the hw code. Hardware code no longer contends for
locking when it needs to wake up the chip or put it to sleep.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move ath9k_ps_wakeup() and ath9k_ps_restore() to main.c
Luis R. Rodriguez [Thu, 10 Sep 2009 03:29:18 +0000 (20:29 -0700)]
ath9k: move ath9k_ps_wakeup() and ath9k_ps_restore() to main.c

These are driver core helpers.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move ps helpers onto core driver when reseting tsf
Luis R. Rodriguez [Thu, 10 Sep 2009 03:05:39 +0000 (20:05 -0700)]
ath9k: move ps helpers onto core driver when reseting tsf

When the TSF is reset power save state is disabled and
then restored. The helpers to disable power save and restore
it use a lock provided by the driver core. Move the callers
of the helpers outside of the hw code.

We reset the TSF when mac80211 tells us and on the beacon.c
helper ath9k_hw_beaconinit() when it is made explicitly required.
Add a helper on beacon.c which will deal with ps awake/restore
if we need to reset the TSF upon ath9k_hw_beaconinit().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: rename ath_btcoex_supported() to ath9k_hw_btcoex_supported()
Luis R. Rodriguez [Wed, 9 Sep 2009 23:05:32 +0000 (16:05 -0700)]
ath9k: rename ath_btcoex_supported() to ath9k_hw_btcoex_supported()

Also just pass the ath_hw as the parameter.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move ath_btcoex_config and ath_bt_mode to btcoex.c
Luis R. Rodriguez [Wed, 9 Sep 2009 22:24:02 +0000 (15:24 -0700)]
ath9k: move ath_btcoex_config and ath_bt_mode to btcoex.c

These are only used by btcoex.c on one routine, so stuff them
into that file.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: now move ath9k_hw_btcoex_set_weight() to btcoex.c
Luis R. Rodriguez [Wed, 9 Sep 2009 22:15:55 +0000 (15:15 -0700)]
ath9k: now move ath9k_hw_btcoex_set_weight() to btcoex.c

After some necessary cleanups we now move ath9k_hw_btcoex_set_weight()
to where it belongs.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: simplify ath_btcoex_bt_stomp()
Luis R. Rodriguez [Wed, 9 Sep 2009 22:05:00 +0000 (15:05 -0700)]
ath9k: simplify ath_btcoex_bt_stomp()

The second argument is always the hardware bt coex struct, so
remove it, and rename the function on the path with a ath9k_ prefix.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: rename ath_btcoex_info to ath_btcoex_hw
Luis R. Rodriguez [Wed, 9 Sep 2009 21:52:02 +0000 (14:52 -0700)]
ath9k: rename ath_btcoex_info to ath_btcoex_hw

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: rename btcoex_scheme to just scheme
Luis R. Rodriguez [Wed, 9 Sep 2009 21:34:22 +0000 (14:34 -0700)]
ath9k: rename btcoex_scheme to just scheme

btcoex_scheme is already part of a btcoex struct, its implied
this is btcoex related.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>