aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
Commit message (Collapse)AuthorAgeFilesLines
* ath9k: resume aggregation immediately after a hardware resetFelix Fietkau2010-10-253-4/+4
| | | | | | | | | | | | Since aggregation is usually triggered by tx completion, a hardware reset (because of beacon stuck, tx hang or baseband hang) can significantly delay the transmission of the next AMPDU (until the next tx completion event). Fix this by rescheduling aggregation after such a reset. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fix handling of rate control probe framesFelix Fietkau2010-10-251-0/+6
| | | | | | | | | | | The ath9k aggregation code was already checking the rate control probe flag to prevent starting an aggregate frame with a sampling rate. What was missing was closing an aggregate before adding a probing frame to it. Without that, rate control cannot have precise control over probing, which delays using faster rates when the channel conditions improve. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fix crash in ath_update_survey_statsFelix Fietkau2010-10-251-0/+3
| | | | | | | | If ah->curchan is uninitialized, the channel index is bogus, which leads to invalid memory access when the cycle counters are updated. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: Fix divide by zero cases in paprd.Senthil Balasubramanian2010-10-251-5/+9
| | | | | | | | | | | We are not handling all divide by zero cases in paprd. Add additional checks for divide by zero cases in papard. This patch has fixes intended for kernel 2.6.36. Cc: stable@kernel.org Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: Fix TX carrier leakage for IEEE compliance on AR9003 2.2Luis R. Rodriguez2010-10-251-56/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the initvals for the AR9003 2.2 chipsets. The initvals are the initial register values we use for our registers upon hardware reset. This synchs up the initvals to match what our latest recommendation from our systems engineering team. The description of changes in this update: Improves ability to support very strong Rx conditions. Enhances DFS support for AP-mode. Improves performance of Tx carrier leak calibration. Adds support for Japan channel 14 Tx filtering requirements. Improves Tx power accuracy. Impact: Update required to address degraded throughput at very short range. Update required for AP-mode DFS certification. Update required to comply to IEEE Tx carrier leak specification. May not meet expected +/- 2 dB Tx power accuracy without update. The most important fix here would be the TX carrier leakage required to comply with IEEE 802.11 specifications. The group of changes have been tested all together in one release. References: Osprey 2.2 header file ver #33 Checksums: $ ./initvals -f ar9003-2p2 0x000000004a488fc7 ar9300_2p2_radio_postamble 0x0000000046cb1300 ar9300Modes_lowest_ob_db_tx_gain_table_2p2 0x00000000e912711f ar9300Modes_fast_clock_2p2 0x0000000037ac0ee8 ar9300_2p2_radio_core 0x00000000047a7700 ar9300Common_rx_gain_table_merlin_2p2 0x0000000003f783bb ar9300_2p2_mac_postamble 0x00000000301fc841 ar9300_2p2_soc_postamble 0x000000005ec8075f ar9200_merlin_2p2_radio_core 0x0000000083372ffa ar9300_2p2_baseband_postamble 0x00000000c4f59974 ar9300_2p2_baseband_core 0x00000000e20d2e72 ar9300Modes_high_power_tx_gain_table_2p2 0x000000007fd55c70 ar9300Modes_high_ob_db_tx_gain_table_2p2 0x0000000029495000 ar9300Common_rx_gain_table_2p2 0x0000000042cb1300 ar9300Modes_low_ob_db_tx_gain_table_2p2 0x00000000c4739cd6 ar9300_2p2_mac_core 0x000000003521a300 ar9300Common_wo_xlna_rx_gain_table_2p2 0x00000000a15ccf1b ar9300_2p2_soc_preamble 0x0000000029734396 ar9300PciePhy_pll_on_clkreq_disable_L1_2p2 0x000000002d834396 ar9300PciePhy_clkreq_enable_L1_2p2 0x0000000029834396 ar9300PciePhy_clkreq_disable_L1_2p2 $ ./initvals -f ar9003-2p2 | sha1sum 0ceddb5cf66737610fb51f04cf3e9ff71870c7b4 - Cc: stable@kernel.org Cc: Yixiang Li <yixiang.li@atheros.com> Cc: Don Breslin <don.breslin@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Properly initialize ath_common->cc_lock.Ben Greear2010-10-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, lockdep splats, at the least: INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. Pid: 2240, comm: ip Not tainted 2.6.36-rc8-wl+ #32 Call Trace: [<c075d940>] ? printk+0xf/0x17 [<c045507a>] register_lock_class+0x5a/0x29e [<c0455be2>] ? mark_lock+0x1e/0x1de [<c0456af5>] __lock_acquire+0xa2/0xb8c [<c0455be2>] ? mark_lock+0x1e/0x1de [<c0457639>] lock_acquire+0x5a/0x78 [<f8c5115b>] ? ath9k_config+0x274/0x3d8 [ath9k] [<c075f602>] _raw_spin_lock_irqsave+0x2f/0x3f [<f8c5115b>] ? ath9k_config+0x274/0x3d8 [ath9k] [<f8c5115b>] ath9k_config+0x274/0x3d8 [ath9k] [<f8c0ba2e>] ieee80211_hw_config+0x11b/0x125 [mac80211] [<f8c17edf>] ieee80211_do_open+0x3c5/0x466 [mac80211] [<f8c171d6>] ? ieee80211_check_concurrent_iface+0x21/0x13a [mac80211] [<f8c17fdb>] ieee80211_open+0x5b/0x5e [mac80211] [<c06ce76b>] __dev_open+0x80/0xae [<c06cc99b>] __dev_change_flags+0xa0/0x115 [<c06ce6bf>] dev_change_flags+0x13/0x3f [<c06d7e78>] do_setlink+0x23a/0x51b [<c0455037>] ? register_lock_class+0x17/0x29e [<c06d847c>] rtnl_newlink+0x269/0x431 [<c06d8291>] ? rtnl_newlink+0x7e/0x431 [<c0455be2>] ? mark_lock+0x1e/0x1de [<c0455de9>] ? mark_held_locks+0x47/0x5f [<c075ebcf>] ? __mutex_lock_common+0x2bb/0x2d6 [<c0456045>] ? trace_hardirqs_on_caller+0x104/0x125 [<c075ebe0>] ? __mutex_lock_common+0x2cc/0x2d6 [<c06d8213>] ? rtnl_newlink+0x0/0x431 [<c06d79e2>] rtnetlink_rcv_msg+0x182/0x198 [<c06d7860>] ? rtnetlink_rcv_msg+0x0/0x198 [<c06e503c>] netlink_rcv_skb+0x30/0x77 [<c06d7859>] rtnetlink_rcv+0x1b/0x22 [<c06e4e77>] netlink_unicast+0xbe/0x119 [<c06e5a15>] netlink_sendmsg+0x234/0x24c [<c06bf93a>] __sock_sendmsg+0x51/0x5a [<c06bfba4>] sock_sendmsg+0x93/0xa7 [<c04968cf>] ? might_fault+0x47/0x81 [<c0496904>] ? might_fault+0x7c/0x81 [<c06c7904>] ? copy_from_user+0x8/0xa [<c06c7c2d>] ? verify_iovec+0x3e/0x6d [<c06bfd8c>] sys_sendmsg+0x149/0x193 [<c0455037>] ? register_lock_class+0x17/0x29e [<c0455be2>] ? mark_lock+0x1e/0x1de [<c0498d7a>] ? __do_fault+0x1fc/0x3a5 [<c048690a>] ? unlock_page+0x40/0x43 [<c0498ef7>] ? __do_fault+0x379/0x3a5 [<c04576dd>] ? lock_release_non_nested+0x86/0x1d8 [<c04968cf>] ? might_fault+0x47/0x81 [<c04968cf>] ? might_fault+0x47/0x81 [<c06c148b>] sys_socketcall+0x15e/0x1a5 [<c0402f1c>] sysenter_do_call+0x12/0x38 Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6Linus Torvalds2010-10-2354-4205/+2170
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1699 commits) bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL. vlan: Calling vlan_hwaccel_do_receive() is always valid. tproxy: use the interface primary IP address as a default value for --on-ip tproxy: added IPv6 support to the socket match cxgb3: function namespace cleanup tproxy: added IPv6 support to the TPROXY target tproxy: added IPv6 socket lookup function to nf_tproxy_core be2net: Changes to use only priority codes allowed by f/w tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled tproxy: added tproxy sockopt interface in the IPV6 layer tproxy: added udp6_lib_lookup function tproxy: added const specifiers to udp lookup functions tproxy: split off ipv6 defragmentation to a separate module l2tp: small cleanup nf_nat: restrict ICMP translation for embedded header can: mcp251x: fix generation of error frames can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set can-raw: add msg_flags to distinguish local traffic 9p: client code cleanup rds: make local functions/variables static ... Fix up conflicts in net/core/dev.c, drivers/net/pcmcia/smc91c92_cs.c and drivers/net/wireless/ath/ath9k/debug.c as per David
| * ath9k: Null out references to stale pointers.Ben Greear2010-10-153-0/+16
| | | | | | | | | | | | | | | | | | This doesn't fix any problem that I'm aware of, but should make it harder to add use-after-free type bugs in the future. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: Remove bf_dmacontext.Ben Greear2010-10-154-20/+12
| | | | | | | | | | | | | | | | | | The bf_dmacontext seems to be totally useless and duplicated by bf_buf_addr. Remove it entirely, use bf_buf_addr in its place. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: remove AR9003 2.0 supportLuis R. Rodriguez2010-10-153-1923/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These chipsets will not hit the market, all customers will be on >= AR9003 2.2. This shaves down the ath9k_hw size by 24161 bytes (24 KB) on my system. Before: $ size drivers/net/wireless/ath/ath9k/ath9k_hw.ko text data bss dec hex filename 292328 616 1824 294768 47f70 drivers/net/wireless/ath/ath9k/ath9k_hw.ko $ du -b drivers/net/wireless/ath/ath9k/ath9k_hw.ko 5987825 drivers/net/wireless/ath/ath9k/ath9k_hw.ko After: $ size drivers/net/wireless/ath/ath9k/ath9k_hw.ko text data bss dec hex filename 277192 616 1824 279632 44450 drivers/net/wireless/ath/ath9k/ath9k_hw.ko $ du -b drivers/net/wireless/ath/ath9k/ath9k_hw.ko 5963664 drivers/net/wireless/ath/ath9k/ath9k_hw.ko Cc: Yixiang Li <yixiang.li@atheros.com> Cc: Don Breslin <don.breslin@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_htc: set probe request rx filterRajkumar Manoharan2010-10-152-2/+2
| | | | | | | | | | | | | | | | This patch enables to receive probe request frames on p2p client mode. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: remove enum wireless_mode and its usersFelix Fietkau2010-10-155-89/+25
| | | | | | | | | | | | | | | | The wireless mode bitfield was only used to detect 2.4 and 5 GHz support, which can be simplified by using ATH9K_HW_CAP_* capabilities. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: remove sc->cur_rate_table and sc->cur_rate_modeFelix Fietkau2010-10-153-53/+8
| | | | | | | | | | | | | | | | | | Set the rate table in the rc module properly based on band and HT capabilities instead, which was already partially done, but not for every mode. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: make rate control debugfs stats per stationFelix Fietkau2010-10-154-116/+124
| | | | | | | | | | | | | | Move them to the same debugfs file that the other rc modules use. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: add missing locking around ath9k_hw_proc_mib_eventFelix Fietkau2010-10-151-0/+2
| | | | | | | | | | | | | | | | ath9k_hw_proc_mib_event updates the cycle counters, so it common->cc_lock must be acquired. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: fix PHY counter overflow handling in ANI v1Felix Fietkau2010-10-151-1/+1
| | | | | | | | | | | | | | | | | | PHY counter overflows need to be checked for the old ANI version, because of its use of interrupt based counter overflow reports when the counters exceed the configured thresholds. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: fix division by zero in the ANI monitor codeFelix Fietkau2010-10-151-6/+7
| | | | | | | | | | | | | | | | | | | | | | The commit "ath9k_hw: remove code duplication in phy error counter handling" split off some duplicate code into a separate function, but did not have a return code for aborting ANI processing based on counter values. This introduced a divide by zero issue. This patch adds the missing return code check in ath9k_hw_ani_monitor Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: do not track cycle counter updates in powersave modeFelix Fietkau2010-10-151-1/+18
| | | | | | | | | | | | | | | | | | | | | | While the chip is in powersave mode, the cycle counter updates do not contain useful values. While the chip is in full sleep, the rx_clear signal stays high, indicating a busy medium. To ensure sane values, update cycle counters before going into powersave, and clear them right after switching back to awake. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: Fix potential use-after-free.Ben Greear2010-10-131-1/+1
| | | | | | | | | | | | | | | | | | The ath_debug_stat_tx references bf->bf_mpdu, which is the skb consumed by ath_tx_complete. So, call the ath_debug_stat_tx method first. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: Set RX filter for Probe Request based on filter flagJouni Malinen2010-10-132-2/+2
| | | | | | | | | | | | | | | | This allows mac80211 to enable receiving of Probe Request frames in station mode which is needed for P2P. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: Fix documentation in rate controlMohammed Shafi Shajakhan2010-10-132-8/+9
| | | | | | | | | | | | | | This fix updates the documenation in Rate Control Table structure Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: built-in rate control A-MPDU fixBjörn Smedman2010-10-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch attempts to ensure that ath9k's built-in rate control algorithm does not rely on the value of the ampdu_len and ampdu_ack_len tx status fields unless the IEEE80211_TX_STAT_AMPDU flag is set. This patch has not been tested. Cc: <stable@kernel.org> Signed-off-by: Björn Smedman <bjorn.smedman@venatech.se> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: A-MPDU rate control info fixBjörn Smedman2010-10-111-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following problems with the rate control feedback generated by ath9k for A-MPDU frames: 1. Rate control feedback is carried on the first frame of an aggregate that is either ACKed, or has execeeded the software retry count and is considered failed. However, ath9k would incorrectly assume the aggregate had the length 1 if one of these conditions did not apply to the first frame of the aggregate, but instead a later frame. This fix therefor copies the bf_nframes field of the buffer in the same manner as the rates field of the tx status. 2. Sometimes the ampdu_len and ampdu_ack_len fields of the tx status was left uninitialized eventhough the IEEE80211_TX_STAT_AMPDU flag was set. This is now avoid by setting flag and fields in the same place. 3. Even if a frame has been selected for aggregation by mac80211 and marked with the IEEE80211_TX_CTL_AMPDU flag it can sometimes happen that ath9k transmits the frame without aggregation. In these cases the ampdu_ack_len field could be incorrectly computed because the nbad parameter to ath_tx_rc_status was incorrect. Cc: <stable@kernel.org> Signed-off-by: Björn Smedman <bjorn.smedman@venatech.se> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: implement channel utilization stats for surveyFelix Fietkau2010-10-112-16/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Results for the active channel are updated whenever a new survey dump is requested, the old data is kept to allow multiple processes to make their own channel utilization averages. All other channels only contain the data for the last time that the hardware was on the channel, i.e. the last scan result or other off-channel activity. Running a background scan does not clear the data for the active channel. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: add compile time checking for the size of the channel listFelix Fietkau2010-10-112-1/+7
| | | | | | | | | | | | | | | | This prevents random memory corruption if the number of channels ever gets changed without an update to the internal channel array size. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: move the cycle counter tracking to athFelix Fietkau2010-10-116-87/+17
| | | | | | | | | | | | | | | | | | | | Instead of keeping track of wraparound, clear the counters on every access and keep separate deltas for ANI and later survey use. Also moves the function for calculating the 'listen time' for ANI Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: store the clock rate in common data on channel changesFelix Fietkau2010-10-112-37/+21
| | | | | | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: Fix hw reset failure with HTC driverRajkumar Manoharan2010-10-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following commit removed DISABLE_REGWRITE_BUFFER ops. The unnecessary REGWRITE_BUFFER_FLUSH was not removed properly which is causing failure on hw reset. Author: Felix Fietkau <nbd@openwrt.org> Date: Tue Oct 5 12:03:42 2010 +0200 ath9k_hw: clean up register write buffering Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: Introduce a wrapper for power save disable.Senthil Balasubramanian2010-10-061-18/+22
| | | | | | | | | | Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: remove unnecessary power save flags.Senthil Balasubramanian2010-10-063-48/+4
| | | | | | | | | | | | | | | | | | | | | | drv_config callback is called only after the ack for the nullframe is received and so driver need not do anything special for this. So remove NULLFUNC_COMPLETED, PS_ENABLED flags and bf_isnullfunc flags from ath9k as mac80211 already handles them properly. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: merge ath9k_hw_ani_monitor_old and ath9k_hw_ani_monitor_newFelix Fietkau2010-10-065-101/+3
| | | | | | | | | | | | | | | | | | After the last rounds of cleanup, these functions are now functionally equivalent and can thus be merged. Also get rid of some excessive (and redundant) debug messages. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: remove function pointer abstraction for internal ANI opsFelix Fietkau2010-10-063-45/+29
| | | | | | | | | | | | | | | | | | The code gets more concise and readable when making the new ANI functions fall back to the old ones if ANI v2 is disabled. This also makes further code cleanup easier. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: remove code duplication in phy error counter handlingFelix Fietkau2010-10-064-119/+34
| | | | | | | | | | | | | | | | | | Split out the PHY error counter update from ath9k_hw_ani_monitor_*, reuse it in ath9k_hw_proc_mib_event (merged from ath9k_hw_proc_mib_event_old and ath9k_hw_proc_mib_event_new). Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: clean up ANI state handlingFelix Fietkau2010-10-066-260/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ANI state is kept per channel, so instead of keeping an array of ANI states with an arbitrary size of 255, move the ANI state into the channel struct. Move some config settings that are not per-channel out of the per-channel struct to save some memory. With those changes, ath9k_ani_restart_old and ath9k_ani_restart_new can be merged into a single function. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: add a helper function to check for the new ANI implementationFelix Fietkau2010-10-061-2/+7
| | | | | | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: clean up register write bufferingFelix Fietkau2010-10-0611-58/+6
| | | | | | | | | | | | | | | | | | | | Throughout the code, DISABLE_REGWRITE_BUFFER is always called right after REGWRITE_BUFFER_FLUSH. Since that's unlikely to change any time soon, that makes keeping those ops separate rather pointless, as it only increases code size and line number counts. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: merge codepaths that access the cycle counter registersFelix Fietkau2010-10-065-92/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | The cycle counters are used by ANI to determine the amount of time that the radio spent not receiving or transmitting. They're also used for debugging purposes if the baseband watchdog on AR9003 detects a lockup. In the future, we want to use these counters to determine the medium utilization and export this information via survey. For that, we need to make sure that the counter is only accessed from one place, which also ensures that wraparounds won't occur at inconvenient points in time. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: clean up calibration flagsFelix Fietkau2010-10-066-77/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The calibration actual calibration flags are only used by the per chip family source files, so it makes more sense to define them in those files instead of globally. That way the code has to test for less flags. Also instead of using a separate callback for testing whether a particular calibration type is supported, simply adjust ah->supp_cals in the calibration init which is called right after the hardware reset, before any of the calibrations are run. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * Merge branch 'master' of ↵John W. Linville2010-10-061-1/+1
| |\ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
| * | ath9k: get correct tx gain type in ath9k_hw_4k_get_eepromGabor Juhos2010-10-051-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The base_eep_header_4k structure contains information that the device supports high power tx gain table or not. However the ath9k_hw_4k_get_eeprom function does not return that value when it is called with EEP_TXGAIN_TYPE. This leads to that the tx gain initialization will use the init values from the original tx gain table even if the device inidicates that the high power table should be used. Changes-licensed-under: ISC Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Shu Hwa Shen <shensh@zcomm.com.cn> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k: Report total tx/rx bytes and packets in debugfs.Ben Greear2010-10-052-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | Includes pkts/bytes that may have had errors, and includes wireless headers when counting bytes. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k: add WDS interfaces to ath9kBill Jordan2010-10-052-0/+4
| | | | | | | | | | | | | | | | | | | | | Enable WDS for the ath9k driver. Signed-off-by: Bill Jordan <bjordan@rajant.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k : Fix for displaying the channel numberMohammed Shafi Shajakhan2010-10-051-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the ath9k debugging feature 'wiphy' the current channel used by the station is incorrectly displayed.This is because the channels available are sequentially mapped from numbers 0 to 37.This mapping cannot be changed as the channel number is also used as an array index This fix solves the above problem by calculating the channel number from center frequency. Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k_hw: remove some useless calibration dataFelix Fietkau2010-10-054-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | The percal struct and bitmask for the initial DC calibration are not used anywhere, so they can be removed. Signed-off-by: Felix Fietkau <nbd@openwrt.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k: fix channel flag / regd issues with multiple cardsFelix Fietkau2010-10-051-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the regulatory code touches the channel array, it needs to be copied for each device instance. That way the original channel array can also be made const. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org [all] Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k: return survey data for all channels instead of just the current oneFelix Fietkau2010-10-051-6/+21
| | | | | | | | | | | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k: remove the noise floor value in the ani structFelix Fietkau2010-10-052-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | common->ani.noise_floor is now only used for a similar redundant debug message similar to the one that was removed from ath9k_htc in an earlier patch. Remove it from ath9k as well now. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k: do not return default noise floor values via surveyFelix Fietkau2010-10-051-3/+5
| | | | | | | | | | | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k_hw: keep calibrated noise floor values per channelFelix Fietkau2010-10-053-22/+22
| | | | | | | | | | | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * | ath9k_htc: remove use of common->ani.noise_floorFelix Fietkau2010-10-051-12/+1
| | | | | | | | | | | | | | | | | | | | | It is unused aside from a single redundant debug message Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>