Commit Graph

203 Commits (ff155a45cea56ad7a90c3f5192db59a4c7812fde)

Author SHA1 Message Date
Vasanthakumar Thiagarajan ff155a45ce ath9k: Add infrastructure for generic hw timers
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:51 -04:00
Vasanthakumar Thiagarajan 81fa16fbe0 ath9k: Remove hw capability bit meant for btcoex
We don't need a hw cap bit for btcoex anymore as btcoex scheme type
is enough to do this.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:51 -04:00
Vasanthakumar Thiagarajan 22f25d0d5e ath9k: Determine btcoex scheme type based on chip version
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:50 -04:00
Vasanthakumar Thiagarajan f14462c666 ath9k: Move btcoex related data to a separate struct
Also define macros for wlanactive and btactive (5 & 6) gpios.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:49 -04:00
Vasanthakumar Thiagarajan 42cc41edf2 ath9k: Configure btcoex register during every reset
Make sure btcoex register configured with appropriate values
after it is initialized with the default values from initvals.h
during reset.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:49 -04:00
Vasanthakumar Thiagarajan 17d50d1df4 ath9k: Move btcoex stuff from hw.[ch] to new btcoex.[ch]
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:48 -04:00
Vasanthakumar Thiagarajan f985ad12b5 ath9k: Split ath9k_hw_btcoex_enable() into two logical pieces
This function currently does initialization + enable the
btcoex support. Split it into two logical functions which
does the above operations separately. Btcoex initialization
is done during attach time and enabling this feature is done
in start(). Also, add code to disable btcoex support in stop().

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:48 -04:00
Sujith 7cf4a2e778 ath9k: Wrap DMA dump function with PS wakeup/restore
When dumping register contents, HW has to be awake.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:48 -04:00
Sujith b264c673a0 ath9k: Update INITVALs for AR9285
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:47 -04:00
Sujith 20caf0dd41 ath9k: Handle PA cal usage properly
PA Calibration is not needed for high power solutions.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:47 -04:00
Sujith 0abb096879 ath9k: Fix bugs in programming registers during PA CAL
* First PA driver (PDPADRV1) was not powered down properly.
* Compensation capacitor for dynamic PA was programmed incorrectly.

Also, remove a stray REG_READ.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:47 -04:00
Sujith a13883b0bf ath9k: Reduce the frequency of PA offset calibration
PA calibration need not be done if the offset is not varying.
The current logic does PA calibration even if the offset is the
same.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:46 -04:00
Roel Kluin 73f57f8398 ath9k: Fix read buffer overflow
Prevent a read of powInfo[-1] in the first iteration.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:46 -04:00
Sujith 3d832611d7 ath9k: Fix chainmask selection during scanning
The TX/RX chainmasks were set to 1x1 during scanning.
Configure them properly with the values retrieved from
the EEPROM.

Also, this requires scan_start/scan_end callbacks to be
locked with sc->mutex.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:30 -04:00
Javier Cardona 5eb6ba83aa ath9k: Add support FIF_OTHER_BSS filtering mode.
Support for FIF_OTHER_BSS was missing.  This patch adds support for this
filtering mode which in turn resolves a problem where mesh interfaces would not
receive broadcast traffic.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-28 14:40:24 -04:00
Vasanthakumar Thiagarajan 22e66a4c15 ath9k: Nuke struct ath9k_node_stats
Other than ns_avgbrssi (Average beacon rssi) no data of
ath9k_node_stats is being used anywhere. Nuke this structure
and move its only useful member to ar5416Anistate. Also cleanup
this redundant data in ath_softc.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:36:08 -04:00
Vasanthakumar Thiagarajan ff36041652 ath9k: Fix bug in retrieving average beacon rssi
Currently the beacon rssi that LPF gives is divided and rounded
up by ATH_RSSI_EP_MULTIPLIER twice. This will leave the incorrect rssi
in ANI. Having correct rssi in ANI fixes the connection stability at
< 30dB rssi range. This patch removes the unncessary computation of average
rssi over already valid average rssi. Also removes the redundant macros to
find average rssi.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:36:08 -04:00
Luis R. Rodriguez 608b88cb34 ath: move regulatory info into shared common structure
This moves the shared regulatory structure into the
common structure. We will use this ongoing for common
data.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:36:03 -04:00
Sujith 4c48381786 ath9k: Fix TX poll cancelling
In ath9k_stop(), tx_complete_work was being cancelled twice.
This patch fixes it. Also, locking sc->mutex should be done
at the beginning.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:36:03 -04:00
Johannes Berg 3ac64beecd mac80211: allow configure_filter callback to sleep
Over time, a whole bunch of drivers have come up
with their own scheme to delay the configure_filter
operation to a workqueue. To be able to simplify
things, allow configure_filter to sleep, and add
a new prepare_multicast callback that drivers that
need the multicast address list implement. This new
callback must be atomic, but most drivers either
don't care or just calculate a hash which can be
done atomically and then uploaded to the hardware
non-atomically.

A cursory look suggests that at76c50x-usb, ar9170,
mwl8k (which is actually very broken now), rt2x00,
wl1251, wl1271 and zd1211 should make use of this
new capability.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:35:58 -04:00
Vivek Natarajan 326bebbcb5 ath9k: Updates for AR9287_12 version of chipset.
Enable AsyncFIFO and AGGWEP for AR9287_12 and later revisions only.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:35:52 -04:00
Vivek Natarajan d4fe5afa00 ath9k: Fix ref power interpolation logic for AR9287 chipsets.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:35:52 -04:00
Vivek Natarajan 08fc5c1ba0 ath9k: Enable LEDs for AR9287 chipsets.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:35:52 -04:00
Vivek Natarajan d340b1f0e5 ath9k: Set AR_WA for AR9287 as it improves consistency in throughput.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:35:51 -04:00
Vivek Natarajan db91f2e4d4 ath9k: Add open loop power control support for AR9287.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:35:51 -04:00
Sujith eff563cf10 ath9k: Set HW state properly
This patch fixes a bug in ath9k_stop() where the HW
was not put into FULL_SLEEP state. Not doing so will
cause issues in suspend-resume and the HW will not respond
to chip resets.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:14:09 -04:00
Sujith 523c36fc9c ath9k: Fix bug in PCI resume
This patch fixes a bug where the device was enabled
before restoring the PCI state.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:14:09 -04:00
Sujith 1cf6873a19 ath9k: Remove duplicate variables
diversity_control and antenna_switch_swap are already
present in ath9k_ops_config. Remove duplicate occurrences
in ath_hw.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:14:08 -04:00
Sujith 1aa8e84736 ath9k: Remove has_hw_phycounters
PHY counters are available in all chipsets supported
by ath9k. Remove the check.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:14:08 -04:00
Luis R. Rodriguez 2a219eb267 ath9k: update kconfig to indicate support for AR9002 family
ath9k supports the AR9002 family of chipsets. This includes
the AR9285 and the miniPCI AR9223 and AR9220 (which themselves
have AR9280+AR5133).

We now refer people to the wiki page as it seems this is not
as popular as we would have hoped.

Reported-by: JD <jd1008@gmail.com>
Cc: Dakota Lee <Dakota.Lee@Atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:14:08 -04:00
Luis R. Rodriguez d15dd3e5d7 ath: add common ath_rxbuf_alloc() and make ath9k use it
Turns out ath5k and ath9k can share the same helper to
allocates RX skbs. We allocate skbs aligned to the cache line
size. This requirement seems to have come from AR5210; when
this was not done it seems sometimes we'd get bogus data. I'm
also told it may have been a performance enhancement
consideration. In the end I can't be sure we can remove this
on new hardware so just keep this and start sharing it through
ath.ko.

Make ath9k start using this, ath5k is next.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:14:05 -04:00
Luis R. Rodriguez af6a3fc7e7 ath9k: Fix regression on receiving PS poll frames
In the the patch:

ath9k: use new FIF_PSPOLL configure filter

I forgot to add the new FIF_PSPOLL to the supported mask.
Without this we mask out the FIF_PSPOLL flag therefore
we'd ignore it from mac80211.

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>
2009-08-14 09:13:54 -04:00
Sujith 5e32b1ed7e ath9k: Update beacon RSSI
ANI uses the beacon RSSI for its operation.
Update this properly.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:13:35 -04:00
Sujith 180d674bab ath9k: Remove local chainmask variable
The chainmask can be obtained directly from ath_hw.
Also, use a helper macro for comparing CTLs - this improves readability.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:13:35 -04:00
Sujith bf466fb67c ath9k: Cleanup TX power calculation for 4K chips
Write CCK power-per-rate array always and report
correct TX power to regulatory.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:13:35 -04:00
Sujith 7f63845f2a ath9k: Clean antenna configuration for 4K EEPROM chips
This patch revamps the antenna configuration mechanism
for 4K chips.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:13:35 -04:00
Sujith 066edc80eb ath9k: Add macros for Antenna Diversity
A subsequent patch would use these for configuring
antennae on AR9285.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:13:34 -04:00
Sujith a37414a220 ath9k: Cleanup ath9k_hw_4k_set_gain() interface
regChainOffset is always zero, remove it.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:13:34 -04:00
Sujith b5aec950ee ath9k: Split eeprom.c into manageable pieces
Add eeprom_def.c, eeprom_4k.c and eeprom_9287.c
This improves maintainability.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:13:34 -04:00
Sujith 6780ccf565 ath9k: Remove a few DEBUG mesages
We have never used these at all.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:13:15 -04:00
Sujith c16c9d0657 ath9k: Try to fix whitespace damage
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:12:48 -04:00
Sujith 54e4cec69e ath9k: Cleanup function return types
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:12:48 -04:00
Sujith 87b5bee86d ath9k: Remove unneeded assignment of protocol field
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14 09:12:47 -04:00
Luis R. Rodriguez 63b08b8d97 ath9k: use new FIF_PSPOLL configure filter
We used to set pspoll filter on ath9k on AP mode but
we no longer need this mode specific check as mac80211
now does the check for us and informs us when we should
enable pspoll through FIF_PSPOLL.

Cc: Igor Perminov <igor.perminov@inbox.ru>
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>
2009-08-14 09:12:39 -04:00
Luis R. Rodriguez 6b4f645a49 ath9k: fix compile warning on ath9k_hw_AR9287_check_eeprom()
CC [M]  drivers/net/wireless/ath/ath9k/eeprom.o
drivers/net/wireless/ath/ath9k/eeprom.c: In function ‘ath9k_hw_AR9287_check_eeprom’:
drivers/net/wireless/ath/ath9k/eeprom.c:2866: warning: comparison of distinct pointer types lacks a cast

Cc: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-04 16:44:35 -04:00
Luis R. Rodriguez e48e3a2f17 ath9k: cancel xmit poll work at stop() callback
We forgot to cancel this work at the stop() callback.

------------[ cut here ]------------
WARNING: at net/mac80211/util.c:511 ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]()
Hardware name: 6460DWU
queueing ieee80211 work while going to suspend
Modules linked in: <-- snip -->
Pid: 5124, comm: phy0 Tainted: G        W  2.6.31-rc3-wl #4
Call Trace:
 [<ffffffffa03adcda>] ? ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]
 [<ffffffff810552b8>] warn_slowpath_common+0x78/0xd0
 [<ffffffff81055394>] warn_slowpath_fmt+0x64/0x70
 [<ffffffff814ed2c9>] ? thread_return+0x3e/0x635
 [<ffffffffa03adcda>] ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]
 [<ffffffffa0297690>] ath_tx_complete_poll_work+0xc0/0x100 [ath9k]
 [<ffffffffa02975d0>] ? ath_tx_complete_poll_work+0x0/0x100 [ath9k]
 [<ffffffff81069b68>] worker_thread+0x178/0x260
 [<ffffffff8106ecc0>] ? autoremove_wake_function+0x0/0x40
 [<ffffffff810699f0>] ? worker_thread+0x0/0x260
 [<ffffffff8106e89e>] kthread+0x9e/0xb0
 [<ffffffff8101302a>] child_rip+0xa/0x20
 [<ffffffff8106e800>] ? kthread+0x0/0xb0
 [<ffffffff81013020>] ? child_rip+0x0/0x20

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-04 16:44:34 -04:00
Luis R. Rodriguez d7e7d229c7 ath9k: add initial hardware support for ar9271
We will finalize this after some driver core changes, for now
we leave this unsupported.

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>
2009-08-04 16:44:34 -04:00
Luis R. Rodriguez 670388c5f5 ath9k: add initvals and registry definitions for AR9271
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>
2009-08-04 16:44:34 -04:00
Luis R. Rodriguez edb1f9152f ath9k: add ar9271 revision and subrevision ID helpers
These will be used later to add support for ar9271.

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>
2009-08-04 16:44:34 -04:00
Luis R. Rodriguez 475f5989d4 ath9k: Remove _t postfix for ar9287_eeprom structure
We don't use typdefs on ath9k, remove that _t.

Cc: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-04 16:44:33 -04:00