aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/rc.c
Commit message (Collapse)AuthorAge
* ath9k: Add data structure for supporting virtual radio/wiphy operationJouni Malinen2009-03-05
| | | | | | | | | | | | | | | | | | | | | | | This is the initial step in allowing ath9k to register multiple virtual radios (wiphys). The goal of virtual radios is to allow the same radio to be shared for multiple virtual interfaces that may operate on different channels. The mac80211 virtual interface support is designed only for single channel operation and as such, it is not suitable for this type of use. Anyway, it can be used on top of the virtual radio concept, if desired (e.g., use two virtual radios to handle two channels and then add multiple mac80211 virtual interfaces on top of each virtual radio). The new struct ath_wiphy is now registered as the driver data structure for wiphy. This structure has a pointer to the shared (among virtual wiphys of the same physical radio) struct ath_softc data. The primary wiphy maintains the allocated memory for ath_softc. Secondary (virtual) wiphys will only allocate the new ath_wiphy structure. Registration of secondary wiphys is added in a separate patch. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fill in rate_update mac80211 callbackSujith2009-03-05
| | | | | | | | This callback can be used to handle dynamic 20/40, and changes in the operating channel's HT parameters. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove ununsed ack duration stuff with long/short preambleVasanthakumar Thiagarajan2009-03-05
| | | | | Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Add PER to RC debug statisticsSujith2009-02-27
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix PTK/GTK handshake timeoutVasanthakumar Thiagarajan2009-02-27
| | | | | | | | | | Some APs don't start BA negotiation with the client before it is done with the key handshake in WPA/RSN. With those APs, key handshake times out if EAPOL frames are sent after addba request. So defer the BA negotiation until we are done with tx/rx of all EAPOL frames. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Add open loop control supportSenthil Balasubramanian2009-02-27
| | | | | | | | This patch adds Open Loop Control support for Atheros chipsets that supports open loop power control. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove all the useless ah_ variable prefixesSujith2009-02-13
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Header file cleanupSujith2009-02-13
| | | | | | | Split the core header files into manageable pieces. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Add retry counters to rate control debug fileSujith2009-02-11
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Add debugfs files for printing TX rate detailsSujith2009-02-09
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Handle mac80211's RC flags for MCS ratesSujith2009-02-09
| | | | | | | | | | | mac80211 notifies the RC algorithm if RTS/CTS and short preamble are needed. The RC flags for MCS rates are currently not handled by mac80211, and ath9k's RC doesn't set the flags either. Fix this. Also, set the rts_cts_rate_idx inside the RC algorithm. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Cleanup get_rate() interfaceSujith2009-02-09
| | | | | | | | | The interface to calculate the TX rate for a data frame was convoluted with lots of redundant arguments being passed around. Remove all of that and make it simple. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix lockdep warningSujith2009-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the lockdep warning shown below, and also initializes the starting sequence number when starting a TX aggregation session. ============================================= [ INFO: possible recursive locking detected ] 2.6.29-rc2-wl #21 --------------------------------------------- swapper/0 is trying to acquire lock: (_xmit_IEEE80211#2){-+..}, at: [<ffffffff80456d71>] __qdisc_run+0x221/0x290 but task is already holding lock: (_xmit_IEEE80211#2){-+..}, at: [<ffffffff80456d71>] __qdisc_run+0x221/0x290 other info that might help us debug this: 7 locks held by swapper/0: #0: (rcu_read_lock){..--}, at: [<ffffffff80442a63>] dev_queue_xmit+0x53/0x620 #1: (_xmit_ETHER#2){-+..}, at: [<ffffffff80456d71>] __qdisc_run+0x221/0x290 #2: (rcu_read_lock){..--}, at: [<ffffffff80442a63>] dev_queue_xmit+0x53/0x620 #3: (_xmit_IEEE80211#2){-+..}, at: [<ffffffff80456d71>] __qdisc_run+0x221/0x290 #4: (rcu_read_lock){..--}, at: [<ffffffffa0154919>] ieee80211_master_start_xmit+0x219/0x6c0 [mac80211] #5: (rcu_read_lock){..--}, at: [<ffffffffa01427c6>] ieee80211_start_tx_ba_session+0x66/0x4e0 [mac80211] #6: (rcu_read_lock){..--}, at: [<ffffffff80442a63>] dev_queue_xmit+0x53/0x620 stack backtrace: Pid: 0, comm: swapper Not tainted 2.6.29-rc2-wl #21 Call Trace: <IRQ> [<ffffffff8026c329>] __lock_acquire+0x1be9/0x1c40 [<ffffffff80442af1>] dev_queue_xmit+0xe1/0x620 [<ffffffff8026a8cc>] __lock_acquire+0x18c/0x1c40 [<ffffffff8026c3d5>] lock_acquire+0x55/0x70 [<ffffffff80456d71>] __qdisc_run+0x221/0x290 [<ffffffff804dbeb9>] _spin_lock+0x39/0x50 [<ffffffff80456d71>] __qdisc_run+0x221/0x290 [<ffffffff804dbd2f>] _spin_unlock+0x1f/0x50 [<ffffffff80456d71>] __qdisc_run+0x221/0x290 [<ffffffff80442d18>] dev_queue_xmit+0x308/0x620 [<ffffffff80442a63>] dev_queue_xmit+0x53/0x620 [<ffffffffa0142a63>] ieee80211_start_tx_ba_session+0x303/0x4e0 [mac80211] [<ffffffffa01427c6>] ieee80211_start_tx_ba_session+0x66/0x4e0 [mac80211] [<ffffffffa0149dae>] rate_control_get_rate+0xae/0xc0 [mac80211] [<ffffffffa01526b5>] invoke_tx_handlers+0x655/0x1000 [mac80211] [<ffffffff802699fd>] mark_held_locks+0x4d/0x90 [<ffffffff804dbcf5>] _spin_unlock_irqrestore+0x65/0x80 [<ffffffffa0151aaa>] __ieee80211_tx_prepare+0x16a/0x310 [mac80211] [<ffffffffa0151adc>] __ieee80211_tx_prepare+0x19c/0x310 [mac80211] [<ffffffff80439cc2>] pskb_expand_head+0x112/0x190 [<ffffffffa0154986>] ieee80211_master_start_xmit+0x286/0x6c0 [mac80211] [<ffffffffa0154919>] ieee80211_master_start_xmit+0x219/0x6c0 [mac80211] [<ffffffff8026a8cc>] __lock_acquire+0x18c/0x1c40 [<ffffffff80456d8e>] __qdisc_run+0x23e/0x290 [<ffffffff80442d18>] dev_queue_xmit+0x308/0x620 [<ffffffff80442a63>] dev_queue_xmit+0x53/0x620 [<ffffffffa0154221>] ieee80211_subif_start_xmit+0x4a1/0x980 [mac80211] [<ffffffffa0153f18>] ieee80211_subif_start_xmit+0x198/0x980 [mac80211] [<ffffffff80456d8e>] __qdisc_run+0x23e/0x290 [<ffffffff80442d18>] dev_queue_xmit+0x308/0x620 [<ffffffff80442a63>] dev_queue_xmit+0x53/0x620 [<ffffffffa028ecfd>] ip6_output+0x62d/0x1230 [ipv6] [<ffffffff8024ca00>] __mod_timer+0xb0/0xd0 [<ffffffffa02ad25a>] mld_sendpack+0x3fa/0x4a0 [ipv6] [<ffffffffa02ace60>] mld_sendpack+0x0/0x4a0 [ipv6] [<ffffffffa02adf90>] mld_ifc_timer_expire+0x0/0x340 [ipv6] [<ffffffffa02ae219>] mld_ifc_timer_expire+0x289/0x340 [ipv6] [<ffffffffa02adf90>] mld_ifc_timer_expire+0x0/0x340 [ipv6] [<ffffffff8024c097>] run_timer_softirq+0x147/0x220 [<ffffffff802473fb>] __do_softirq+0x9b/0x180 [<ffffffff80265516>] tick_dev_program_event+0x36/0xb0 [<ffffffff8020d77c>] call_softirq+0x1c/0x30 [<ffffffff8020f2c5>] do_softirq+0x65/0xb0 [<ffffffff80246ebd>] irq_exit+0x9d/0xc0 [<ffffffff80221db6>] smp_apic_timer_interrupt+0x86/0xd0 [<ffffffff8020d1b3>] apic_timer_interrupt+0x13/0x20 Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Handle chainmask for A9280Sujith2009-01-30
| | | | | | | | | The default chainmask for AR9280 is 3, so handle that when setting the supported MCS rates. Also, check for the HW supported chainmask when choosing single/dual stream. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix bug in rate control capability registrationSujith2009-01-29
| | | | | | | | Dual stream capability must be registered only when the hardware supports it. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Reorganize code in xmit.cSujith2009-01-29
| | | | | | | | This patch starts cleaning up all the crufty code in transmission path, grouping functions into logical blocks. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Update short guard interval in rate controlSujith2009-01-29
| | | | | | | | | The rate control algorithm needs to know if a STA allows short guard interval, fixing this allows RC to use the correct table. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: rateCodeToIndex is not used, remove itSujith2009-01-29
| | | | | | | | | Calculation of rate indices from ratecode is done in recv.c in a straightforward manner for both HT and legacy rates. This variable is not needed anymore. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: make use of conf_is_ht*() in the rest of the driverLuis R. Rodriguez2009-01-29
| | | | | | | | Use shiny new conf_is_ht*() helpers, we can later remove ht.enabled if desired. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix an operator typo in phy rate validationJouni Malinen2009-01-16
| | | | | | | | | | | This was not supposed to be a bitwise AND operation, but a check of two separate conditions. Anyway, the old code happened to result in the same behavior, so this is just changing the code to be easier to understand and also to keep sparse from warning about dubious operators. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix a NULL pointer dereference in ath_rate_getJouni Malinen2008-12-19
| | | | | | | | | It looks like mac80211 may try to send unicast frames to a STA that does not have a STA entry. We need to make sure that that is caught in the rate control code before dereferencing STA data. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Maintain rate table choice after associationSujith2008-12-12
| | | | | | | | | | A scan run after association would change sc_curmode which is used to get the current rate table. This patch fixes it by removing sc_curmode and setting the rate table in usage in cur_rate_table on association. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix bug in rate table managementSujith2008-12-12
| | | | | | | | | | The proper rate table wouldn't be used if a disassoc happens and a new attempt is made to associate using wpa_supplicant. This patch fixes it by storing the rate table to be used on association. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Replace ath9k_opmode with nl80211_iftypeColin McCabe2008-12-05
| | | | | | | | This patch kills ath9k's ath9k_opmode enum by replacing it with nl80211_iftype. Signed-off-by: Colin McCabe <colin@cozybit.com> Signed-off-by: Andrey Yurovsky <andrey@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Use cleaner debug masksSujith2008-12-05
| | | | | | | | Remove all the useless __func__ prefixes in debug messages, and replace the DPRINTF macro with a function. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Handle channel initialization for AP modeSujith2008-12-05
| | | | | | | | Hostapd now passes the HT parameters through the config() callback, use these to set the appropriate channel in AP mode. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Code scrubSujith2008-11-26
| | | | | | | | | | Merge core.c and base.c Remove Antenna Diversity (unused now). Remove unused chainmask handling code. Comment, indentation scrub. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Dont update rate control for every AMPDUVasanthakumar Thiagarajan2008-11-26
| | | | | | | | | Update the rate control only with the tx status of first AMPDU of an aggregation. This patch fixes frequent drops in throughput. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Use helpersSujith2008-11-26
| | | | | | | | Break down huge functions, use helper functions or macros instead. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: General code scrubSujith2008-11-26
| | | | | | | | | | | Replace TRUE/FALSE macros with VALID/INVALID macros. Follow a consistent variable convention. Remove unnecessary comments. Add all RC phy macros into a single enum. Merge functions into reasonably sized entities. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove ath9k_rate_tableSujith2008-11-26
| | | | | | | | Maintaining two sets of rate tables is redundant, remove one and use struct ath_rate_table exclusively. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Use rate_driver_dataSujith2008-11-26
| | | | | | | | | | Remove the hack using vif, and use rate_driver_data within skb->cb to hold driver specific rate information. Setup the rate series in the skb's tx control area and remove all references to ath9k specific rate series ( using struct ath_rc_series ). Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove ath_rate_softcSujith2008-11-26
| | | | | | | | | Move the hw rate tables to ath_softc, and access them directly. tx_triglevel_max is global, move it to ath_rate_node. Now that ath_rate_softc is gone, rate control attach becomes simpler. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove rate control reference in VAPSujith2008-11-26
| | | | | | | | Rate control init is now confined to itself, using the HT capabilites of the STA from rate_init(). Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Nuke fixed rate handling in driverSujith2008-11-26
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove half/quarter rate tablesSujith2008-11-26
| | | | | | | Half/Quarter rate tables are needed only for legacy chipsets. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove ath_rate_newassoc()Sujith2008-11-26
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove ath_setup_ratesSujith2008-11-26
| | | | | | | Setup legacy rates in ath_rate_init() itself. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Simplify RC alloc/free functionsSujith2008-11-26
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Merge struct ath_tx_ratectrl with ath_rate_nodeSujith2008-11-26
| | | | | | | Avoid casting of ath_tx_ratctrl and access the elements directly. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* drivers/net/wireless/ath9k/rc.c: use ARRAY_SIZEJulia Lawall2008-11-21
| | | | | | | | | | | | | | | | | | | | | | | | | | ARRAY_SIZE is more concise to use when the size of an array is divided by the size of its type or the size of its first element. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @i@ @@ #include <linux/kernel.h> @depends on i using "paren.iso"@ type T; T[] E; @@ - (sizeof(E)/sizeof(E[...])) + ARRAY_SIZE(E) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove ath_tx_aggr_resp()Sujith2008-11-10
| | | | | | | | Accessing mac80211's internal state machine is wrong. Will add resumption of a TID in a later patch. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Revamp VAP managementSujith2008-11-10
| | | | | | | | | Remove the internal VAP management routines and embed ath_vap in mac80211's driver private area provided in ieee80211_vif. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Use bitfields to store tid's state in a single variableSujith2008-11-10
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Ensure ath_node is not NULL when updating tx chainmaskSujith2008-11-10
| | | | | | | Also, random indentation and whitespace cleanup. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Node cleanupSujith2008-11-10
| | | | | | | | | Start removing the internal node list in ath9k, in preparation for using mac80211's STA list. Remove lists, locks, routines, flags, functions managing nodes in ath9k. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Check if the STA supports HT when initializing rate controlSujith2008-10-31
| | | | | Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: remove rate_control_clearJohannes Berg2008-10-31
| | | | | | | | | | "Clearing" the rate control algorithm is pointless, none of the algorithms actually uses this operation and it's not even invoked properly for all channel switching. Also, there's no need to since rate control algorithms work per station. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211/drivers: rewrite the rate control APIJohannes Berg2008-10-31
| | | | | | | | | | | | So after the previous changes we were still unhappy with how convoluted the API is and decided to make things simpler for everybody. This completely changes the rate control API, now taking into account 802.11n with MCS rates and more control, most drivers don't support that though. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: rewrite HT handlingJohannes Berg2008-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HT handling has the following deficiencies, which I've (partially) fixed: * it always uses the AP info even if there is no AP, hence has no chance of working as an AP * it pretends to be HW config, but really is per-BSS * channel sanity checking is left to the drivers * it generally lets the driver control too much HT enabling is still wrong with this patch if you have more than one virtual STA mode interface, but that never happens currently. Once WDS, IBSS or AP/VLAN gets HT capabilities, it will also be wrong, see the comment in ieee80211_enable_ht(). Additionally, this fixes a number of bugs: * mac80211: ieee80211_set_disassoc doesn't notify the driver any more since the refactoring * iwl-agn-rs: always uses the HT capabilities from the wrong stuff mac80211 gives it rather than the actual peer STA * ath9k: a number of bugs resulting from the broken HT API I'm not entirely happy with putting the HT capabilities into struct ieee80211_sta as restricted to our own HT TX capabilities, but I see no cleaner solution for now. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>