openwrt/staging/blogic.git
14 years agoath5k/ath9k: Fix 64 bits TSF reads
Benoit Papillault [Thu, 15 Apr 2010 22:07:26 +0000 (00:07 +0200)]
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>
14 years agoath9k_hw: add the PCI ID for the first AR9300 device
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:42 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Abort rx if hw is not coming out of full sleep in reset
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:41 +0000 (17:39 -0400)]
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>
14 years agoath9k: Enable TXOK and TXERR interrupts for TX EDMA
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:40 +0000 (17:39 -0400)]
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>
14 years agoath9k: add LDPC support
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:39 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: add LDPC support for AR9003
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:38 +0000 (17:39 -0400)]
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>
14 years agomac80211: add LDPC control flag
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:37 +0000 (17:39 -0400)]
mac80211: add LDPC control flag

LDPC will be enabled through the rate control algorithm
for each buffer the the tx_info flags.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Add Tx EDMA support
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:36 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Compute pointer checksum over the link descriptor
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:35 +0000 (17:39 -0400)]
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>
14 years agoath9k: Initialize and configure tx status for EDMA
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:34 +0000 (17:39 -0400)]
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>
14 years agoath9k: Setup appropriate tx desc for regular dma and edma
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:33 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: set cwmin and cwmax to 0 for for AR9003 upon txq reset
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:32 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: enable CRC check of descriptors for AR9003
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:31 +0000 (17:39 -0400)]
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>
14 years agoath9k: add RXLP and RXHP to debugfs counters
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:30 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Fill descriptor abstrations for AR9003
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:29 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: move AR9002 mac ops to its own file
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:28 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Add function to configure tx status ring buffer
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:27 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Define abstraction for tx desc access
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:26 +0000 (17:39 -0400)]
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>
14 years agoath9k: Load SW filtered NF values and start NF cal during full reset for AR9003
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:25 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: skip WEP aggregation enable code for AR9003
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:24 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: skip asynch fifo enablement to AR9003
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:23 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Update ath9k_hw_set_dma for AR9300
Felix Fietkau [Thu, 15 Apr 2010 21:39:22 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: add TX/RX gain register initialization for AR9003
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:21 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: add the AR9300 SREV hw name print
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:20 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Configure Tx interrupt mitigation timer
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:19 +0000 (17:39 -0400)]
ath9k_hw: Configure Tx interrupt mitigation timer

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: move the RF claim stuff to AR9002 hardware family
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:18 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: move AR9280 PCI EEPROM fix to eeprom_def.c
Felix Fietkau [Thu, 15 Apr 2010 21:39:17 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Fill get_isr() for AR9003
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:16 +0000 (17:39 -0400)]
ath9k_hw: Fill get_isr() for AR9003

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: add OFDM spur mitigation for AR9003
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:15 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Implement AR9003 eeprom callbacks
Senthil Balasubramanian [Thu, 15 Apr 2010 21:39:14 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: restore mac address reading logic
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:13 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: rename eep_AR9287_ops to eep_ar9287_ops
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:12 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: complete AR9003 calibration
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:11 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: fill in the callbacks for calibration for AR9003
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:10 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: abstract loading noisefloor
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:09 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: abstract the AR_PHY_AGC_CONTROL register access
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:08 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: Initialize interrupt mask for AR9003
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:07 +0000 (17:39 -0400)]
ath9k_hw: Initialize interrupt mask for AR9003

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Abstract the routine which returns interrupt status
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:39:06 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: move TX/RX gain INI stuff to its own hardware family code
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:05 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: move the cck channel 14 INI to the AR9002 hw code
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:04 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: split the generic hardware code by hardware family
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:03 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: add the config_pci_powersave AR9003 callback
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:02 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: add the AR9003 ar9003_hw_init_cal callback
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:01 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: split calib code by hardware families
Luis R. Rodriguez [Thu, 15 Apr 2010 21:39:00 +0000 (17:39 -0400)]
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>
14 years agoath9k_hw: move the cal AR9100 calibration settings
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:59 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: rename getNoiseFloorThresh() to ath9k_hw_loadnf()
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:58 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: rename the PA calib routines to match their families
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:57 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: simplify OLC temp compensation for AR9002
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:56 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: move the AR9280 OLC temp comp to its own helper
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:55 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: shift code for AR9280 OLC temp comp
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:54 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: rename PA calib for AR9287
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:53 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add a helper for the OLC tem compensation for AR9002
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:52 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add a helper for Power Amplifier calibration for AR9002
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:51 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: the eep_map is used only for AR9280 PCI card ini fixup
Senthil Balasubramanian [Thu, 15 Apr 2010 21:38:50 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Split out the function for reading the noise floor
Felix Fietkau [Thu, 15 Apr 2010 21:38:49 +0000 (17:38 -0400)]
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>
14 years agoath9k: Add Rx EDMA support
Felix Fietkau [Thu, 15 Apr 2010 21:38:48 +0000 (17:38 -0400)]
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>
14 years agoath9k: Make bf_desc of ath_buf opaque
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:47 +0000 (17:38 -0400)]
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>
14 years agoath9k: Remove ATH9K_TX_SW_ABORTED and introduce a bool for this purpose
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:46 +0000 (17:38 -0400)]
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>
14 years agoath9k: Use memcpy in ath_clone_txbuf()
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:45 +0000 (17:38 -0400)]
ath9k: Use memcpy in ath_clone_txbuf()

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Use abstraction to get link pointer
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:44 +0000 (17:38 -0400)]
ath9k: Use abstraction to get link pointer

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Add abstraction to set/get link pointer
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:43 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Move code which populates ds_data to ath9k_hw
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:42 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Define tx control struct for AR9003
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:41 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add all the AR9003 PHY callbacks
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:40 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Split off ANI control to the PHY ops
Felix Fietkau [Thu, 15 Apr 2010 21:38:39 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add helpers for processing the AR9003 INI
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:38 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add initvals for the AR9003 hardware family
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:37 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: split initvals.h by hardware family
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:36 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Implement spur mitigation on AR9003
Felix Fietkau [Thu, 15 Apr 2010 21:38:35 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Implement PLL control on AR9003
Felix Fietkau [Thu, 15 Apr 2010 21:38:34 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Set the channel on AR9003
Felix Fietkau [Thu, 15 Apr 2010 21:38:33 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add common channel select helpers for ar900[23]
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:32 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Add AR9003 PHY register definitions
Felix Fietkau [Thu, 15 Apr 2010 21:38:31 +0000 (17:38 -0400)]
ath9k_hw: Add AR9003 PHY register definitions

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: prevent reset control register zeroing on AR9003 reset
Senthil Balasubramanian [Thu, 15 Apr 2010 21:38:30 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: update the chip tests for AR9003
Senthil Balasubramanian [Thu, 15 Apr 2010 21:38:29 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Add few routines for rx edma support
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:28 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Fill rx_enable() for the AR9003 hardware family
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:27 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Add abstraction for rx enable
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:26 +0000 (17:38 -0400)]
ath9k_hw: Add abstraction for rx enable

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Fill few hw cap for edma
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:25 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Add hw cap flag for EDMA for the AR9003 family
Vasanthakumar Thiagarajan [Thu, 15 Apr 2010 21:38:24 +0000 (17:38 -0400)]
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>
14 years agoath9k: disable the MIB interrupt if ANI is disabled
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:23 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: disable ANI for AR9003
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:22 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add the AR9003 ar9003_hw_macversion_supported()
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:21 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: move init config and default after chip is up
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:20 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Add AR9003 PHY support
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:19 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: Add the PCI IDs for AR9300 and fill up the pci_id_tables
Senthil Balasubramanian [Thu, 15 Apr 2010 21:38:18 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add a private callback for PLL control computation
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:17 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: add some comments for ath9k_set_power_network_sleep()
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:16 +0000 (17:38 -0400)]
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>
14 years agoath9k_hw: skip PLL initialization on AR9003 on Power-On-Reset
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:15 +0000 (17:38 -0400)]
ath9k_hw: skip PLL initialization on AR9003 on Power-On-Reset

This is not required for the AR9003 family.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Move some RF ops to the private callbacks
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:14 +0000 (17:38 -0400)]
ath9k_hw: Move some RF ops to the private callbacks

The PHY split is easier done in a few steps. First move
the RF ops to the private ops and rename them accordingly.
We split PHY stuff up first for the AR5008 and AR9002
families. There are some callbacks that AR9002 share
with the AR5008 familiy so we set those first, if AR9002
has some different callbacks it will override them upon
hardware init.

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>
14 years agoath9k_hw: remove wrapper ath9k_hw_write_regs()
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:13 +0000 (17:38 -0400)]
ath9k_hw: remove wrapper ath9k_hw_write_regs()

This is used only once by ath9k_hw_process_ini() to
write an array of phy registers through REG_WRITE_ARRAY(),
but we already call REG_WRITE_ARRAY() multiple times
on the same caller so just remove this pointless wrapper.
We'll eventually just move the ath9k_hw_process_ini()
caller as an callback to abstract away between different
hardware families.

Although this change is subtle I should note that this
does change the delay pattern on writing the next series
of registers. REG_WRITE_ARRAY() uses a counter for each
register write and does a udelay(1) every 64 writes. By
removing this call it means that the counter is processed
for all the iniBB_RfGain registers and is incremented
on ath9k_hw_process_ini(), before this the after the call
ath9k_hw_write_regs() was made the register counter was
kept at the same index number prior to the call.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: AR9003 does not have AR_RC_AHB skip its setting
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:12 +0000 (17:38 -0400)]
ath9k_hw: AR9003 does not have AR_RC_AHB skip its setting

AR9003 does not have a reset control for AHB.

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>
14 years agoath9k_hw: add support for GPIO differences on AR9003
Felix Fietkau [Thu, 15 Apr 2010 21:38:11 +0000 (17:38 -0400)]
ath9k_hw: add support for GPIO differences on AR9003

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: add simple register abstraction for some AR9300 registers
Felix Fietkau [Thu, 15 Apr 2010 21:38:10 +0000 (17:38 -0400)]
ath9k_hw: add simple register abstraction for some AR9300 registers

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: fix a missing hex prefix for a register mask
Felix Fietkau [Thu, 15 Apr 2010 21:38:09 +0000 (17:38 -0400)]
ath9k_hw: fix a missing hex prefix for a register mask

This is not a stable code fix as this register is not used anywhere.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: add a macro for abstracting generic timer access
Felix Fietkau [Thu, 15 Apr 2010 21:38:08 +0000 (17:38 -0400)]
ath9k_hw: add a macro for abstracting generic timer access

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: add silicon revision macros for AR9300
Felix Fietkau [Thu, 15 Apr 2010 21:38:07 +0000 (17:38 -0400)]
ath9k_hw: add silicon revision macros for AR9300

AR9300 will be the first device supported of the AR9003
family. AR9300 1.0 hardware exists but it is not going to
be sold anywhere so we completely skip its support.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: start building an abstraction layer for hardware routines
Luis R. Rodriguez [Thu, 15 Apr 2010 21:38:06 +0000 (17:38 -0400)]
ath9k_hw: start building an abstraction layer for hardware routines

ath9k supports the AR5008, AR9001 and AR9002 family of Atheros
chipsets, all 802.11n. The new breed of 802.11n chips, the
AR9003 family will be supported as well soon. To help with its
support we're going to add a few callbacks for hardware routines
which differ considerably instead of adding branch checks for
the revision at runtime.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: Davinci platforms need more time loading helper firmware
Dan Williams [Thu, 15 Apr 2010 20:32:58 +0000 (13:32 -0700)]
libertas: Davinci platforms need more time loading helper firmware

Davinci platforms apparently need more time in-between helper firmware
blocks.  Even though this is an increased delay, we only take this hit
once at initialization time.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: consolidate SDIO firmware wait code
Dan Williams [Thu, 15 Apr 2010 20:27:44 +0000 (13:27 -0700)]
libertas: consolidate SDIO firmware wait code

Consolidate a bunch of C&P code that waits for the firmware to be ready.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>