Commit Graph

7375 Commits

Author SHA1 Message Date
Grazvydas Ignotas
a02a295680 wl1251: add support for dedicated IRQ line
wl1251 has WLAN_IRQ pin for generating interrupts to host processor,
which is mandatory in SPI mode and optional in SDIO mode (which can
use SDIO interrupts instead). However TI recommends using deditated
IRQ line for SDIO too.

Add support for using dedicated interrupt line with SDIO, but also leave
ability to switch to SDIO interrupts in case it's needed.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:14 -04:00
Sujith
7f1f5a0060 ath9k_htc: Fix sparse endian warnings
This patch fixes a bunch of endian issues that
were exposed by sparse. It's a miracle that the driver
worked at all till now.

The Lord be praised.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:13 -04:00
Sujith
6ce34ec11c ath9k_htc: Handle WMI timeouts properly
If a WMI command has timed out for some reason,
a late WMI response would end up updating the
response region of a new WMI request that has been
issued in the meantime.

Fix this race condition by dropping a WMI response
if a new WMI command has been issued.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:12 -04:00
Sujith
eac8e385e9 ath9k_htc: Add dropped SKB count to debugfs
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:11 -04:00
Sujith
0daa3e3a7d ath9k_htc: Remove GPIO set on unload
There is no point in trying to set the LED pin
when the module is being unloaded. The target
would be reset anyway.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:10 -04:00
Sujith
7d0d0df0ec ath9k_hw: Use buffered register writes
This patch adds macros at certain places
which could be optimized for multiple register writes.

The performance of ath9k_htc improves considerably,
especially reducing the latency involved in a scan run.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:09 -04:00
Sujith
6819d57f07 ath9k_hw: Relocate Opmode initialization
Programming the opmode in the HW can be done
before the assoc_id and STA_ID registers are
setup. This helps ath9k_htc when multiple register
writes are used.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:07 -04:00
Sujith
20b3efd979 ath9k_hw: Add macros for multiple register writes
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:06 -04:00
Sujith
4a22fe108e ath9k_htc: Implement multiple register write support
This patch adds support for writing multiple registers
in a single USB command.

Specific calls from the HW code that performs multiple
register writes would be modified to make use of this
in subsequent patches.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:05 -04:00
Sujith
50f56316ae ath: Add buffered register write operations
This is required to implement delayed/buffered
register writes in ath9k_htc.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:04 -04:00
Sujith
fcb9392ff7 ath9k_htc: Cleanup beacon configuration
This patch cleans up beacon configuration,
removing a redundant interface type check
and updating beacon interval in the correct place.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:03 -04:00
Samuel Ortiz
e88402fbdd iwmc3200wifi: check sparse endianness annotations
Add -D__CHECK_ENDIAN__ to driver ccflags so that sparse will
always check endianness by default.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:02 -04:00
Samuel Ortiz
3c997e8849 iwmc3200wifi: Fix sparse warnings
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:47:00 -04:00
Benoit Papillault
1c0fc65e6d ath5k/ath9k: Fix 64 bits TSF reads
According to tests, both TSF lower and upper registers kept counting, so
the higher part could have been updated after the lower part has been
read, as shown in the following log where the upper part is read first
and the lower part next.

tsf = {00000003-fffffffd}
tsf = {00000003-00000001}
tsf = {00000004-0000000b}

This patch corrects this by checking that the upper part has not been
changed while the lower part was read. It has been tested in an IBSS
network where artifical IBSS merges have been done in order to trigger
hundreds of rollover for the TSF lower part.

It follows the logic mentionned by Derek, with only 2 register reads
needed at each additional steps instead of 3 (the minimum number of
register reads is still 3).

Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:46:54 -04:00
Luis R. Rodriguez
733f0ea449 ath9k_hw: add the PCI ID for the first AR9300 device
The first AR9003 hardware family device supported is the
AR9300, which has the vendor:device id 168c:0030

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:49 -04:00
Vasanthakumar Thiagarajan
9b9cc61c46 ath9k_hw: Abort rx if hw is not coming out of full sleep in reset
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:49 -04:00
Vasanthakumar Thiagarajan
afe754d66f ath9k: Enable TXOK and TXERR interrupts for TX EDMA
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:48 -04:00
Luis R. Rodriguez
b0a3344834 ath9k: add LDPC support
LDPC is enabled by the rate control if the its determined
that the target peer supports LDPC. We would have already
intersected the HT capabilities so if our peer supports
LDPC so do we.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:48 -04:00
Luis R. Rodriguez
ce01805a22 ath9k_hw: add LDPC support for AR9003
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:48 -04:00
Vasanthakumar Thiagarajan
e5003249ae ath9k: Add Tx EDMA support
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:48 -04:00
Vasanthakumar Thiagarajan
eb8232535b ath9k_hw: Compute pointer checksum over the link descriptor
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:47 -04:00
Vasanthakumar Thiagarajan
5088c2f1a2 ath9k: Initialize and configure tx status for EDMA
Also add a function to clean up tx status ring.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:47 -04:00
Vasanthakumar Thiagarajan
4adfcdedd4 ath9k: Setup appropriate tx desc for regular dma and edma
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:47 -04:00
Luis R. Rodriguez
3deb4da554 ath9k_hw: set cwmin and cwmax to 0 for for AR9003 upon txq reset
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:47 -04:00
Luis R. Rodriguez
79de23751a ath9k_hw: enable CRC check of descriptors for AR9003
Enable CRC check on the descriptor fetched from host on AR9003
upon reseting the TX queue.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:46 -04:00
Luis R. Rodriguez
a9616f417e ath9k: add RXLP and RXHP to debugfs counters
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:46 -04:00
Vasanthakumar Thiagarajan
994089db03 ath9k_hw: Fill descriptor abstrations for AR9003
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:45 -04:00
Luis R. Rodriguez
b622a720b4 ath9k_hw: move AR9002 mac ops to its own file
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:45 -04:00
Vasanthakumar Thiagarajan
744d402580 ath9k_hw: Add function to configure tx status ring buffer
Also reset tx status ring suring chip reset.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:44 -04:00
Vasanthakumar Thiagarajan
cc610ac055 ath9k_hw: Define abstraction for tx desc access
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:44 -04:00
Vasanthakumar Thiagarajan
d8903a5361 ath9k: Load SW filtered NF values and start NF cal during full reset for AR9003
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:44 -04:00
Luis R. Rodriguez
6c94fdc97a ath9k_hw: skip WEP aggregation enable code for AR9003
The AR9002 hardware code enables aggregation for WEP but
mac80211 doesn't enable aggregation with WEP, and the AR9003
code family does not need this so skip it for now for AR9003
but leave the code and annotate we should eventually consider
how to remove this in consideration for the HAL unification
goals.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:44 -04:00
Luis R. Rodriguez
78ec267788 ath9k_hw: skip asynch fifo enablement to AR9003
The asynch fifo code is specific to >= AR9287 so stuff it
into the AR9002 hardware family code and skip it for AR9003
cards.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:43 -04:00
Felix Fietkau
57b32227cd ath9k_hw: Update ath9k_hw_set_dma for AR9300
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:43 -04:00
Luis R. Rodriguez
c14a85dad4 ath9k_hw: add TX/RX gain register initialization for AR9003
This is done depending on what the EEPROM settings indicates.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:43 -04:00
Luis R. Rodriguez
ec83903e67 ath9k_hw: add the AR9300 SREV hw name print
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:43 -04:00
Vasanthakumar Thiagarajan
7f62a13691 ath9k_hw: Configure Tx interrupt mitigation timer
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:41 -04:00
Luis R. Rodriguez
ebd5a14a45 ath9k_hw: move the RF claim stuff to AR9002 hardware family
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:41 -04:00
Felix Fietkau
57b98384e5 ath9k_hw: move AR9280 PCI EEPROM fix to eeprom_def.c
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:40 -04:00
Vasanthakumar Thiagarajan
6c84ce08aa ath9k_hw: Fill get_isr() for AR9003
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:39 -04:00
Luis R. Rodriguez
1547da37db ath9k_hw: add OFDM spur mitigation for AR9003
We add this now as OFDM spur mitigation required accessing
the EEPROM for the AR9003 devices.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:38 -04:00
Senthil Balasubramanian
15c9ee7af8 ath9k_hw: Implement AR9003 eeprom callbacks
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:37 -04:00
Luis R. Rodriguez
49101676b2 ath9k_hw: restore mac address reading logic
Once upon a time the AR_EEPROM_MAC macro was added to let us
add a random attribute to the three 4-bytes of MAC addresses
entries we read from the EEPROM. This was good while a random
high-enough value was used which did not conflict with any
of the already existing enum eeprom_param values. With AR9003
support the enums overlap and it means we either increment
the random offset or just restore the reading logic to match
what the HAL has. I choose to do the later to synchronize
the logic on both code bases.

This should fix reading the MAC address from the EEPROM
on AR9003 hardware.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:36 -04:00
Luis R. Rodriguez
0b8f6f2b1b ath9k_hw: rename eep_AR9287_ops to eep_ar9287_ops
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:35 -04:00
Luis R. Rodriguez
df23acaa5d ath9k_hw: complete AR9003 calibration
This goes with some new shiny TX IQ calibration that AR9003
hardware family supports.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:35 -04:00
Luis R. Rodriguez
4b01931e3a ath9k_hw: fill in the callbacks for calibration for AR9003
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:35 -04:00
Luis R. Rodriguez
77d6d39a77 ath9k_hw: abstract loading noisefloor
This is the last call on calib.c which acceses PHY stuff,
with this change we calib.c is now generic between both
all supported hardware families.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:34 -04:00
Luis R. Rodriguez
400b738678 ath9k_hw: abstract the AR_PHY_AGC_CONTROL register access
This is so we can share routines which access this register
on calib.c

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:34 -04:00
Vasanthakumar Thiagarajan
668602404d ath9k_hw: Initialize interrupt mask for AR9003
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:34 -04:00
Vasanthakumar Thiagarajan
55e82df4be ath9k_hw: Abstract the routine which returns interrupt status
Also move interrupt related code to mac.c

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:34 -04:00
Luis R. Rodriguez
991312d88c ath9k_hw: move TX/RX gain INI stuff to its own hardware family code
The AR9003 TX/RX gain is currently initialized with the other
components, so for now AR9003 does not implment this callback,
after hardware bring up  we can test moving the TX/RX gain there
as well and if it works well move them to its own callback as
well.

Since all INI stuff is now moved out hw.c no longer needs to
include and touch any original INI headers/structs.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:33 -04:00
Luis R. Rodriguez
d8f492b7d9 ath9k_hw: move the cck channel 14 INI to the AR9002 hw code
This is specific to the AR9002 family only.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:33 -04:00
Luis R. Rodriguez
b3950e6a52 ath9k_hw: split the generic hardware code by hardware family
Move out the generic hardware family code out into their own
files, we have one for AR5008, AR9001, and AR9002 family (ar9002_hw.c)
and another file for the new AR9003 hardware family (ar9003_hw.c).

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:32 -04:00
Luis R. Rodriguez
204729fd18 ath9k_hw: add the config_pci_powersave AR9003 callback
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:31 -04:00
Luis R. Rodriguez
590b7d2f10 ath9k_hw: add the AR9003 ar9003_hw_init_cal callback
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:31 -04:00
Luis R. Rodriguez
795f5e2ca6 ath9k_hw: split calib code by hardware families
Calibration code touches phy registers and since these
change the calibration code needs to be abstracted.

Noise floor calibration is the only thing remaining but
since the remaining calls only touch the AR_PHY_AGC_CONTROL
register we'll just define that register conditionally, that
will be done separately. The goal is to remove the dependency
of ar9002_phy.h on calib.c

This also adds stubs to be filled for AR9003 calibration code.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:31 -04:00
Luis R. Rodriguez
0df13da455 ath9k_hw: move the cal AR9100 calibration settings
The calibration settings should go into the respective
hardware family AR9002 calibration settings callback,
ar9002_hw_init_cal_settings().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:30 -04:00
Luis R. Rodriguez
b43d59fb3e ath9k_hw: rename getNoiseFloorThresh() to ath9k_hw_loadnf()
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:30 -04:00
Luis R. Rodriguez
37c3e8b9d7 ath9k_hw: rename the PA calib routines to match their families
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:30 -04:00
Luis R. Rodriguez
af6757e95e ath9k_hw: simplify OLC temp compensation for AR9002
We can do the family revision check on the top level caller.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:30 -04:00
Luis R. Rodriguez
2b5facfe76 ath9k_hw: move the AR9280 OLC temp comp to its own helper
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:29 -04:00
Luis R. Rodriguez
80b99932fd ath9k_hw: shift code for AR9280 OLC temp comp
We're bailing out on the alternative code path so remove the
else branch.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:29 -04:00
Luis R. Rodriguez
becdbc542f ath9k_hw: rename PA calib for AR9287
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:29 -04:00
Luis R. Rodriguez
e83a1134de ath9k_hw: add a helper for the OLC tem compensation for AR9002
Open Loop Control temperature compensation changes between our
hardware so use a helper for it.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:28 -04:00
Luis R. Rodriguez
4d001d18f2 ath9k_hw: add a helper for Power Amplifier calibration for AR9002
The code can be simplified and shared between two locations if we bring
this into a helper. During reset we do not account for the skip count.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:28 -04:00
Senthil Balasubramanian
939ad86de5 ath9k_hw: the eep_map is used only for AR9280 PCI card ini fixup
We can reorganize the code in such a way that eep_map can be removed,
which makes the code more clearer.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:28 -04:00
Felix Fietkau
641d99217f ath9k_hw: Split out the function for reading the noise floor
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:27 -04:00
Felix Fietkau
b5c80475ab ath9k: Add Rx EDMA support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:26 -04:00
Vasanthakumar Thiagarajan
c38d4d2eb9 ath9k: Make bf_desc of ath_buf opaque
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:26 -04:00
Vasanthakumar Thiagarajan
6d913f7db3 ath9k: Remove ATH9K_TX_SW_ABORTED and introduce a bool for this purpose
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:26 -04:00
Vasanthakumar Thiagarajan
d826c83277 ath9k: Use memcpy in ath_clone_txbuf()
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:26 -04:00
Vasanthakumar Thiagarajan
5c3a338fcf ath9k: Use abstraction to get link pointer
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:26 -04:00
Vasanthakumar Thiagarajan
87d5efbbd6 ath9k_hw: Add abstraction to set/get link pointer
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:25 -04:00
Vasanthakumar Thiagarajan
3f3a1c8031 ath9k_hw: Move code which populates ds_data to ath9k_hw
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:25 -04:00
Vasanthakumar Thiagarajan
162c3be378 ath9k_hw: Define tx control struct for AR9003
Store appropriate desc length which will be used by the
ath9k module while duplicating tx desc.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:25 -04:00
Luis R. Rodriguez
af914a9ffd ath9k_hw: add all the AR9003 PHY callbacks
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:25 -04:00
Felix Fietkau
c16fcb49b3 ath9k_hw: Split off ANI control to the PHY ops
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:25 -04:00
Luis R. Rodriguez
cffb5e49a1 ath9k_hw: add helpers for processing the AR9003 INI
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:24 -04:00
Luis R. Rodriguez
13ce3e997c ath9k_hw: add initvals for the AR9003 hardware family
The AR9003 hardware family now initializes hardware by block
components and into stages: pre, core and init.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:24 -04:00
Luis R. Rodriguez
af01c04e21 ath9k_hw: split initvals.h by hardware family
The initvals.h file is over 7000 lines now, so instead of adding
AR9003 initvals to it instead lets split the current initvals.h by
hardware family: AR5008, AR9001, AR9002

The AR9003 family will have its own initval file later.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:24 -04:00
Felix Fietkau
ca37555407 ath9k_hw: Implement spur mitigation on AR9003
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:24 -04:00
Felix Fietkau
317d33280c ath9k_hw: Implement PLL control on AR9003
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:23 -04:00
Felix Fietkau
f7abf0c195 ath9k_hw: Set the channel on AR9003
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:23 -04:00
Luis R. Rodriguez
7152451aa1 ath9k_hw: add common channel select helpers for ar900[23]
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:23 -04:00
Felix Fietkau
da6f1d7f5f ath9k_hw: Add AR9003 PHY register definitions
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:23 -04:00
Senthil Balasubramanian
84e2169b0f ath9k_hw: prevent reset control register zeroing on AR9003 reset
Also, no need for the udelay(2) on AR9003 hardware.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:23 -04:00
Senthil Balasubramanian
1f3f061840 ath9k_hw: update the chip tests for AR9003
The AR9003 family requires a change on the loop and can also skip
testing the PHY timing registers. This chip test can now be used
by all Atheros hardware families, including legacy. We can
eventually move this out to the generic ath module.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:22 -04:00
Vasanthakumar Thiagarajan
ad7b806065 ath9k_hw: Add few routines for rx edma support
* Set rx buf size in register 0x60
* Set rxdp on the respective hw rx queue (HP and LP queues)
* Process rx descriptor

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:22 -04:00
Vasanthakumar Thiagarajan
ae3bb6d462 ath9k_hw: Fill rx_enable() for the AR9003 hardware family
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:22 -04:00
Vasanthakumar Thiagarajan
cee1f625bf ath9k_hw: Add abstraction for rx enable
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:21 -04:00
Vasanthakumar Thiagarajan
ceb2644576 ath9k_hw: Fill few hw cap for edma
HP & LP queue depth and rx status length.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:21 -04:00
Vasanthakumar Thiagarajan
1adf02ffad ath9k_hw: Add hw cap flag for EDMA for the AR9003 family
AR9003 supports extended DMA (EDMA), this comes with some
bells and whistles on top of the legacy DMA that we are used
to. Mark AR9003 and later chips EDMA capable.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:21 -04:00
Luis R. Rodriguez
3448f912c6 ath9k: disable the MIB interrupt if ANI is disabled
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:21 -04:00
Luis R. Rodriguez
31a0bd3c75 ath9k_hw: disable ANI for AR9003
ANI is still being debugged on AR9003 by our systems team
so it should not yet be enabled yet. When ANI will be
enabled all ANI functionality is expected to be enabled
so fill the ANI functionality to all for AR9003 for now
as well.

Cc: Enis Akay <Enis.Akay@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:20 -04:00
Luis R. Rodriguez
61accab9b5 ath9k_hw: add the AR9003 ar9003_hw_macversion_supported()
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:20 -04:00
Luis R. Rodriguez
bab1f62e21 ath9k_hw: move init config and default after chip is up
This allows us to add SREV checks on these helpers.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:20 -04:00
Luis R. Rodriguez
8525f2801d ath9k_hw: Add AR9003 PHY support
This add stubs for PHY support for the AR9003 hardware family.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:20 -04:00
Senthil Balasubramanian
db3cc53a2f ath9k_hw: Add the PCI IDs for AR9300 and fill up the pci_id_tables
Also, clean up and reorganize the AR9287 macro to have better
ordering. We won't add the PCI ID to the supported device list
until we have some functional code for it.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:19 -04:00
Luis R. Rodriguez
647739645b ath9k_hw: add a private callback for PLL control computation
The PLL control computation used to program the AR_RTC_PLL_CONTROL
register varies between our harware so just add a private callback for it.
AR9003 will use its own callback.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:19 -04:00
Luis R. Rodriguez
bbd79af563 ath9k_hw: add some comments for ath9k_set_power_network_sleep()
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16 15:43:19 -04:00