summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/htc_drv_main.c
Commit message (Collapse)AuthorAgeFilesLines
* mac80211: extend set_coverage_class signatureLorenzo Bianconi2014-09-051-1/+1
| | | | | | | | | | Extend mac80211 set_coverage_class API in order to enable ACK timeout estimation algorithm (dynack) passing coverage class equals to -1 to lower drivers. Synchronize set_coverage_class routine signature with mac80211 function pointer for p54, ath9k, ath9k_htc and ath5k drivers. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath9k_htc: Stop ANI before doing hw_resetRajkumar Manoharan2014-05-141-1/+4
| | | | | | | | | | | | | During remain on channel request, ANI worker thread is not stopped before doing hw reset. This is causing kernel crash in hw_per_calibration. This change ensures that ANI is stopped before doing chip reset and it will be rescheduled later when the chip is configured back to home channel and having valid bss. Reported-by: David Herrmann <dh.herrmann@gmail.com> Tested-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: sync beacon slot code with ath9kOleksij Rempel2014-03-171-4/+15
| | | | | | | we will need it for common-beacon Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: add ATH_OP_PRIM_STA_VIFOleksij Rempel2014-03-171-0/+4
| | | | | | | we will need it to make common-beacon code work. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: use common->op_flagsOleksij Rempel2014-03-171-11/+15
| | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: use ath_beacon_conf.enable_beaconOleksij Rempel2014-03-171-2/+2
| | | | | | | to reduce difference between ath9k and ath9k_htc Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2014-02-131-23/+40
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
| * ath9k_htc: avoid scheduling while atomic on sta_rc_updateStanislaw Gruszka2014-02-041-22/+38
| | | | | | | | | | | | | | | | | | | | | | | | mac80211 ->sta_rc_update() callback must be atomic. Since we have to take mutex and do other operations that can sleep when sending fimrware commands to device, the only option to satisfy atomicity requirement of ->sta_rc_update(), that I can see, is introduce work_struct and defer uploading new rates to that work. Tested-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_htc: make ->sta_rc_update atomic for most callsStanislaw Gruszka2014-02-041-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sta_rc_update() callback must be atomic, hence we can not take mutexes or do other operations, which can sleep in ath9k_htc_sta_rc_update(). I think we can just return from ath9k_htc_sta_rc_update(), if it is called without IEEE80211_RC_SUPP_RATES_CHANGED bit. That will help with scheduling while atomic bug for most cases (except mesh and IBSS modes). For mesh and IBSS I do not see other solution like creating additional workqueue, because sending firmware command require us to sleep, but this can be done in additional patch. Patch partially fixes bug: https://bugzilla.redhat.com/show_bug.cgi?id=990955 Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k_htc: use ath9k_cmn_process_rssiOleksij Rempel2014-02-121-0/+1
|/ | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: properly set MAC address and BSSID maskMathy Vanhoef2013-12-171-8/+17
| | | | | | | | Pick the MAC address of the first virtual interface as the new hardware MAC address. Set BSSID mask according to this MAC address. This fixes CVE-2013-4579. Signed-off-by: Mathy Vanhoef <vanhoefm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: make ath9k_cmn_update_ichannel staticFelix Fietkau2013-10-141-4/+2
| | | | | | | | Rework its wrapper function to make it more generic, using it as a replacement for previous calls to ath9k_cmn_update_ichannel. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove direct accesses to channel mode flagsFelix Fietkau2013-10-141-23/+3
| | | | | | | | Use wrappers where available. Simplifies code and helps with further improvements to the channel data structure Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: use chandef instead of channel_typeSimon Wunderlich2013-08-161-4/+1
| | | | | | | | | | To enable support for 5/10 MHz, some internal functions must be converted from using the (old) channel_type to chandef. This is a good chance to change all remaining occurences. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2013-06-261-1/+1
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
| * ath9k_htc: Handle IDLE state transition properlySujith Manoharan2013-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | Make sure that a chip reset is done when IDLE is turned off - this fixes authentication timeouts. Cc: stable@vger.kernel.org Reported-by: Ignacy Gawedzki <i@lri.fr> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k_htc: Add ethtool stats support.Ben Greear2013-06-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | This provides some of the same info found in the ath9k_htc debugfs through the standard ethtool stats API. This logic is only supported when ath9k_htc debugfs kernel feature is enabled, since that is the only time stats are actually gathered. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k_htc: Support reporting tx and rx chain mask.Ben Greear2013-06-241-0/+38
| | | | | | | | | | Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k_htc: add STBC TX supportOleksij Rempel2013-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | All known ar7010+ar* device and current FW support STBC TX. This patch make use of it and suggest to send STBC if peer support it. I use wort "suggest" since currenly we have separate rate controller in FW which will make decision based on rate and hardware. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: Simplify ANI initializationSujith Manoharan2013-06-031-4/+2
| | | | | | | | | | | | | | | | | | The check "enable_ani" is not required since it is always set to true and the logic for disabling/enabling ANI via debugfs is done at a higher layer. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k_htc: Add support for mesh interfacesJavier Cardona2013-05-221-8/+21
|/ | | | | | | | | | | | | | More specifically, enable AP-style beaconing on mesh ifaces and change the hw capabilities to reflect mesh support. Coexistence with a virtual STA interface was tested as working fine. Signed-off-by: Javier Cardona <javier@cozybit.com> [rebase, add iface combinations] Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: remove ath9k_cmn_padposFelix Fietkau2013-04-101-1/+1
| | | | | | | It is equivalent to ieee80211_hdrlen Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chanKarl Beldan2013-03-251-7/+9
| | | | | | | | | | Drivers that don't use chanctxes cannot perform VHT association because they still use a "backward compatibility" pair of {ieee80211_channel, nl80211_channel_type} in ieee80211_conf and ieee80211_local. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: split TX aggregation stop actionJohannes Berg2013-01-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | When TX aggregation is stopped, there are a few different cases: - connection with the peer was dropped - session stop was requested locally - session stop was requested by the peer - connection was dropped while a session is stopping The behaviour in these cases should be different, if the connection is dropped then the driver should drop all frames, otherwise the frames may continue to be transmitted, aggregated in the case of a locally requested session stop or unaggregated in the case of the peer requesting session stop. Split these different cases so that the driver can act accordingly; however, treat local and remote stop the same way and ask the driver to not send frames as aggregated packets any more. In the case of connection drop, the stop callback the driver is otherwise supposed to call is no longer required. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath9k/ath9k_htc: Remove WME macrosSujith Manoharan2012-11-211-2/+2
| | | | | | | | Use the macros provided by mac80211 and remove redundant declarations inside the drivers. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: clarify interface iteration and make it configurableJohannes Berg2012-11-091-8/+12
| | | | | | | | | | | | | | | | During hardware restart, all interfaces are iterated even though they haven't been re-added to the driver, document this behaviour. The same also happens during resume, which is even more confusing since all of the interfaces were previously removed from the driver. Make this optional so drivers relying on the current behaviour can still use it, but to let drivers that don't want this behaviour disable it. Also convert all API users, keeping the old semantics except in hwsim, where the new normal ones are desired. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath9k_htc: Remove interface combination specific checksMohammed Shafi Shajakhan2012-10-291-20/+0
| | | | | | | | | | Once the driver advertizes interface combination logic based on its firmware/hardware limitation, cfg80211 takes care of all the necessary logic such as maximum beaconing vifs, standlone interface etc. Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'for-john' of ↵John W. Linville2012-09-241-1/+1
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
| * mac80211: add key flag for management keysJohannes Berg2012-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Mark keys that might be used to receive management frames so drivers can fall back on software crypto for them if they don't support hardware offload. As the new flag is only set correctly for RX keys and the existing IEEE80211_KEY_FLAG_SW_MGMT flag can only affect TX, also rename the latter to IEEE80211_KEY_FLAG_SW_MGMT_TX. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | ath9k_htc: minor cleanup in ath9k_htc_add_stationMohammed Shafi Shajakhan2012-09-111-9/+5
|/ | | | | Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: implement sta_rc_update() mac80211 callbackAntonio Quartulli2012-08-211-0/+29
| | | | | | | | | | In case of changes in the supported rates set for a given station, it is now possible to use this callback to update the current internal state of the station in the htc driver. Reported-by: Gui Iribarren <gui@altermundi.net> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: move TX station pointer and restructure TXThomas Huehn2012-07-311-2/+4
| | | | | | | | | | | | | | Remove the control.sta pointer from ieee80211_tx_info to free up sufficient space in the TX skb control buffer for the upcoming Transmit Power Control (TPC). Instead, the pointer is now on the stack in a new control struct that is passed as a function parameter to the drivers' tx method. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: Felix Fietkau <nbd@openwrt.org> [reworded commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath9k_hw: Cleanup ath9k_hw_set_tsfadjustSujith Manoharan2012-07-171-1/+1
| | | | | Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k/ath9k_htc: fix txop limit handlingFelix Fietkau2012-07-171-1/+1
| | | | | | | | | In all those years apparently nobody noticed that the txop limit programmed into the chip was off by a factor of 32 (!), probably because the VI and VO queues aren't used that much aside from mgmt frames on VO. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2012-07-091-3/+2
|\ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless Conflicts: net/mac80211/mlme.c
| * ath9k_htc: configure bssid on ASSOC/IBSS changeRajkumar Manoharan2012-06-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | After the change "mac80211: remove spurious BSSID change flag", BSS_CHANGED_BSSID will not be passed on association or IBSS status changes. So it could be better to program bssid on ASSOC or IBSS change notification. Not doing so, is affecting the packet transmission. Cc: stable@vger.kernel.org [3.4+] Reported-by: Michael Leun <lkml20120218@newton.leun.net> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k_htc: Fix IDLE power saveSujith Manoharan2012-06-261-30/+20
| | | | | | | | | | | | | | | | Remove the radio enable/disable stuff and fix the transition to FULL_SLEEP mode when the device is idle. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k_htc: Use atomic operations for op_flagsSujith Manoharan2012-06-261-14/+14
|/ | | | | Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: remove ath9k_hw_htc_resetinitFelix Fietkau2012-03-151-1/+0
| | | | | | | Automatically set the ah->htc_reset_init on init and after PHY disable. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: Start/stop btcoex using a helperSujith Manoharan2012-02-271-12/+3
| | | | | Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: claim support for IBSS RSNAntonio Quartulli2012-01-241-0/+15
| | | | | | | | Skip group keys configuration in hardware in order to make IBSS RSN work. Keys will be managed using software. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: make bluetooth coexistence support optional at compile timeFelix Fietkau2011-12-191-2/+3
| | | | | | | | | | | | | | | | Many systems (e.g. embedded systems) do not have wifi modules connected to bluetooth modules, so bluetooth coexistence is irrelevant there. With the addition of MCI support, ath9k picked up quite a bit of extra code that can be compiled out this way. This patch redefines ATH9K_HW_CAP_MCI and adds an inline wrapper for querying the bluetooth coexistence scheme, allowing the compiler to eliminate code that uses it, with only very little use of #ifdef. On MIPS this reduces the total size for the modules by about 20k. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath: Convert ath_dbg(bar, ATH_DBG_<FOO>, to ath_dbg(bar, FOOJoe Perches2011-12-191-44/+39
| | | | | | | | | | | | | | Add ATH_DBG_ to macros to shorten the uses and reduce the line count. Coalesce ath_dbg formats. Add missing spaces to coalesced formats. Add missing newline terminations to ath_dbg formats. Align ath_dbg arguments where appropriate. Standardize ath_dbg formats without periods. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: use config.enable_ani to check if ani should be performedNikolay Martynov2011-12-071-2/+3
| | | | | | | | | | | | | | | | | | | | | Currently in ath9k code there is an attempt which is meant to disable ANI for ar9100 and ar9340. But it doesn't really achieve this. All it does is disable ANI init and setup (i.e. calls to ath9k_hw_ani_setup and ath9k_hw_ani_init). Since ath9k_hw_ani_setup is not called ah->config.ani_poll_interval is never initialized (i.e. it is always zero) and ath_ani_calibrate always executes ANI procedures (over uninitialized ANI parameters). Moreover, ath_ani_calibrate is being called each 1ms because common->ani.timer is set to zero interval because ah->config.ani_poll_interval==0 (and thus smallest value of all intervals). Normally it should not be called this often. This patch changes the code so config.enable_ani is used to check if ANI should be performed. config.enable_ani is initialized to true by default. This patch sets it to false for ar9100 and ar9340. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: pass vif param to conf_tx() callbackEliad Peller2011-10-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | tx params should be configured per interface. add ieee80211_vif param to the conf_tx callback, and change all the drivers that use this callback. The following spatch was used: @rule1@ struct ieee80211_ops ops; identifier conf_tx_op; @@ ops.conf_tx = conf_tx_op; @rule2@ identifier rule1.conf_tx_op; identifier hw, queue, params; @@ conf_tx_op ( - struct ieee80211_hw *hw, + struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) {...} Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: add ieee80211_vif param to tsf functionsEliad Peller2011-09-271-3/+6
| | | | | | | | | | | TSF can be kept per vif. Add ieee80211_vif param to set/get/reset_tsf, and move the debugfs entries to the per-vif directory. Update all the drivers that implement these callbacks. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: eliminate common->{rx,tx}_chainmaskFelix Fietkau2011-09-141-2/+1
| | | | | | | we already have ah->{rx,tx}chainmask for the same purpose Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix a smatch warningsLarry Finger2011-08-291-0/+1
| | | | | | | | | | | | | Smatch shows the following warnings: CHECK drivers/net/wireless/ath/ath9k/htc_drv_main.c drivers/net/wireless/ath/ath9k/htc_drv_main.c +1315 ath9k_htc_configure_filter(27) warn: inconsistent returns mutex:&priv->mutex: locked (1303) unlocked (1315) CHECK drivers/net/wireless/ath/ath9k/ar9003_eeprom.c drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +3321 ar9300_eeprom_restore_internal(20) warn: returning -1 instead of -ENOMEM is sloppy Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: Add get_stats call backMohammed Shafi Shajakhan2011-08-261-0/+17
| | | | | | | currently this call back is used only in debugfs of mac80211 Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: do not configure filter before driver is startedRajkumar Manoharan2011-07-081-2/+7
| | | | | Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>