summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/htc_drv_init.c
AgeCommit message (Collapse)Author
2020-08-27ath9k: convert tasklets to use new tasklet_setup() APIAllen Pais
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: Allen Pais <allen.lkml@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200817090637.26887-3-allen.cryptic@gmail.com
2020-08-14ath9k: Fix typo in function namePavel Machek
Typo "destoy" made me wonder if correct patch is wrong; fix it. No functional change. Signed-off-by: Pavel Machek (CIP) <pavel@denx.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200724083910.GA31930@amd
2020-05-30ath9k_htc: Set RX filter based to allow broadcast Action frame RXJouni Malinen
Advertise support for multicast frame registration and update the RX filter based on the recently added FIF_MCAST_ACTION to allow broadcast Action frames to be received. This is needed for Device Provisioning Protocol (DPP) use cases that use broadcast Public Action frames. Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200426084733.7889-2-jouni@codeaurora.org
2020-04-07ath9k: Fix use-after-free Read in ath9k_wmi_ctrl_rxQiujun Huang
Free wmi later after cmd urb has been killed, as urb cb will access wmi. the case reported by syzbot: https://lore.kernel.org/linux-usb/0000000000000002fc05a1d61a68@google.com BUG: KASAN: use-after-free in ath9k_wmi_ctrl_rx+0x416/0x500 drivers/net/wireless/ath/ath9k/wmi.c:215 Read of size 1 at addr ffff8881cef1417c by task swapper/1/0 Call Trace: <IRQ> ath9k_wmi_ctrl_rx+0x416/0x500 drivers/net/wireless/ath/ath9k/wmi.c:215 ath9k_htc_rx_msg+0x2da/0xaf0 drivers/net/wireless/ath/ath9k/htc_hst.c:459 ath9k_hif_usb_reg_in_cb+0x1ba/0x630 drivers/net/wireless/ath/ath9k/hif_usb.c:718 __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650 usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716 dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 Reported-and-tested-by: syzbot+5d338854440137ea0fef@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang <hqjagain@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200404041838.10426-3-hqjagain@gmail.com
2019-09-10ath9k: Remove unneeded variable to store return valuezhong jiang
ath9k_reg_rmw_single do not need return value to cope with different cases. And change functon return type to void. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-29ath: Remove unnecessary ath_bcast_mac and use eth_broadcast_addrJoe Perches
Remove the static array and use the generic routine to set the Ethernet broadcast address. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-03-21ath9k_htc: use non-QoS NDP for AP probingJohannes Berg
When switching mac80211 to use QoS NDP, it turned out that ath9k_htc is somehow broken by this, e.g. see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891060. Fix this by using the new mac80211 flag to go back to the old, incorrect, behaviour for this driver. Fixes: 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing") Reported-by: Ben Caradoc-Davies <ben@transient.nz> Acked-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-10-27ath: Convert timers to use timer_setup()Kees Cook
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Kalle Valo <kvalo@qca.qualcomm.com> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-09-25ath9k: remove cast to void pointerHimanshu Jha
casting to void pointer from any pointer type and vice-versa is done implicitly and therefore casting is not needed in such a case. Done using Coccinellle. Semantic Patch used : @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-08-08ath9k: make ath_ps_ops structures as constBhumika Goyal
ath_ps_ops structures are only stored as a reference in the ps_ops field of a ath_common structure. This field is of type const, so make the structures as const. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2017-03-06wireless: Set NL80211_EXT_FEATURE_CQM_RSSI_LIST in multiple driversAndrew Zaborowski
Set the NL80211_EXT_FEATURE_CQM_RSSI_LIST wiphy extended feature wholesale in all mac80211-based drivers that do not set the IEEE80211_VIF_BEACON_FILTER flags on their interfaces. mac80211 will be processing supplied RSSI values in ieee80211_rx_mgmt_beacon and will detect when the thresholds set by ieee80211_set_cqm_rssi_range_config are crossed. Remaining (few) drivers need code to enable the firmware to monitor the thresholds. This is mostly only compile-tested. Signed-off-by: Andrew Zaborowski <andrew.zaborowski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-07-08ath9k: Remove some #defined constants to decrease verbosityBenjamin Berg
The removed ATH9K_SLOT_TIME_X constants simply map the value in microseconds to the same integer. These constants were not used consistently, so fix the inconsistency issue by replacing all occurances with the integer equivalent. Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg
This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-03-11ath9k_htc: fix up indents with spacesBob Copeland
Use tabs here. Found by smatch. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-09-29ath9k: Add support for OCB modeJan Kaisrlik
The patch adds support for "outside the context of a BSS"(OCB) mode to ath9k driver and extends debugfs files by OCB ralated information. This patch was tested on AR9380-AL1A cards. Signed-off-by: Jan Kaisrlik <kaisrja1@fel.cvut.cz> Cc: Michal Sojka <sojkam1@fel.cvut.cz> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-18ath9k_htc: introduce support for different fw versionsOleksij Rempel
Current kernel support only one fw name with theoretically only one fw version located in “firmware/htc_[9271|7010].fw”. Which is ok so far we have only one fw version (1.3). After we realised new fw 1.4, we faced compatibility problem which was decided to solve by firmware name and location: - new firmware is located now in firmware/ath9k_htc/htc_[9271|7010]-1.4.0.fw - old version 1.3 should be on old place, so old kernel have no issues with it. - new kernels including this patch should be able to try different supported (min..max) fw version. - new kernel should be able to support old fw location too. At least for now. At same time this patch will add new module option which should allow user to play with development fw version without replacing stable one. If user will set “ath9k_htc use_dev_fw=1” module will try to find firmware/ath9k_htc/htc_[9271|7010]-1.dev.0.fw first and if it fails, use stable version: for example...1.4.0.fw. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-13ath9k_htc: drv_init: match wait_for_completion_timeout return typeNicholas Mc Guire
Return type of wait_for_completion_timeout is unsigned long not int. As time_left is exclusively used for wait_for_completion_timeout here its type is simply changed to unsigned long. API conformance testing for completions with coccinelle spatches are being used to locate API usage inconsistencies: ./drivers/net/wireless/ath/ath9k/htc_drv_init.c:81 int return assigned to unsigned long Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m, CONFIG_ATH9K_HTC=m Patch is against 4.1-rc3 (localversion-next is -next-20150514) Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-06-23Merge tag 'wireless-drivers-next-for-davem-2015-06-18' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== Major changes: mwifiex: * enhancements for AP mode: support verbose information in station dump command and also information about AP link. * enable power save by default brcmfmac: * fix module reload issue for PCIe * improving msgbuf protocol for PCIe devices * rework .get_station() cfg80211 callback operation * determine interface combinations upon device feature support ath9k: * ath9k_htc: add support of channel switch wil6210: * add modparam for bcast ring size * support hidden SSID * add per-MCS Rx stats ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-06-15ath9k_htc: add support of channel switchChun-Yeow Yeoh
Add the support of channel switching functionality, similar to ath9k support. Tested with TP-Link TL-WN722N and TL-WN821N. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-06-10mac80211: convert HW flags to unsigned long bitmapJohannes Berg
As we're running out of hardware capability flags pretty quickly, convert them to use the regular test_bit() style unsigned long bitmaps. This introduces a number of helper functions/macros to set and to test the bits, along with new debugfs code. The occurrences of an explicit __clear_bit() are intentional, the drivers were never supposed to change their supported bits on the fly. We should investigate changing this to be a per-frame flag. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-05-09ath9k: Enable short repeat by default on ath9k_htcNick Kossifidis
Normal FFT reports generate a LOT of data, to save resources enable short repeat by default also on ath9k_htc (it's already enabled by default on ath9k). This can always be changed from userspace if needed. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-30ath9k_htc: add new WMI_REG_RMW_CMDID commandOleksij Rempel
Since usb bus add extra delay on each request, a command with read + write requests is too expensive. We can dramtically reduce usb load by moving this command to firmware. In my tests, this patch will reduce channel scan time for about 5-10 seconds. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-27ath9k and ath9k_htc: rename variable "led_blink"Hong Xu
ath9k and ath9k_htc use the variable name "led_blink" to indicate whether the module parameter "blink" is on. This name is easy to conflict with other variables, and has caused a compiler error found by kbuild test bot. The compiler error is as following: drivers/net/wireless/ath/ath9k/ath9k_htc.o:(.data+0x47c): multiple definition of `led_blink' drivers/net/wireless/ath/ath9k/ath9k.o:(.bss+0x20): first defined here Fixes: 3a939a671225 ("ath9k_htc: Add a module parameter to disable blink") Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Hong Xu <hong@topbug.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-23ath9k_htc: Add a module parameter to disable blinkHong Xu
Add an option "blink" to enable or disable the LED blink. The default value is set to 1 so that existing users would not experience any unexpected changes. Signed-off-by: Hong Xu <hong@topbug.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-11-17ath9k_htc: ath9k_htc_op_ps_wakeup() can be statickbuild test robot
drivers/net/wireless/ath/ath9k/htc_drv_init.c:56:6: sparse: symbol 'ath9k_htc_op_ps_wakeup' was not declared. Should it be static? drivers/net/wireless/ath/ath9k/htc_drv_init.c:61:6: sparse: symbol 'ath9k_htc_op_ps_restore' was not declared. Should it be static? drivers/net/wireless/ath/ath9k/htc_drv_init.c:66:19: sparse: symbol 'ath9k_htc_ps_ops' was not declared. Should it be static? Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11ath9k_htc: add spectral scan debug interfaceOleksij Rempel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11ath9k_htc: set initial spec_config valuesOleksij Rempel
use values provided by Ashish Patro <patro@cs.wisc.edu> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11ath9k_htc: add ath_ps_ops bindingsOleksij Rempel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-07ath9k_htc: avoid kernel panic in ath9k_hw_resetMarek Puzyniak
hw pointer of ath_hw is not assigned to proper value in function ath9k_hw_reset what finally causes kernel panic. This can be solved by proper initialization of ath_hw in ath9k_init_priv. Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com> Acked-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28ath9k_htc: advertise support for TDLSCsaba Kiraly
Based on a quick test with AR9271, TDLS seems to be working fine. Tests were done with 2 Atheros AR9271 based devices with firmware 1.3 (sha1 8d49f928aa40ac53c729189bff1333cd373a7fb5), associated with a WAP54G access point. TDLS worked fine both in WPA2 mode and without encryption. Stations maintained ping flood traffic between each other and towards the AP without significant losses. Not tested with AR7010. TDLS was enabled in earlier patches the same way for other Atheros drivers: ath9k (fd6562344dea2b8b2a5d644cf971f4e56004500a), and carl9170 (d1f3de71a584a82ee4e84505fce9acccf40215ff). Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k_htc: sync beacon slot code with ath9kOleksij Rempel
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>
2014-03-17ath9k_htc: use common->op_flagsOleksij Rempel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k_htc: move beaconq to struct htc_beaconOleksij Rempel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k_htc: use common ath_beacon_configOleksij Rempel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28ath9k_htc: add function ath9k_regwrite_multiOleksij Rempel
... to remove duplicate code Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28ath9k_htc: use ath9k_cmn_reload_chainmaskOleksij Rempel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28ath9k_htc: use ath9k_cmn_setup_ht_capOleksij Rempel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28ath9k_htc: use ath9k_cmn_init_channels_ratesOleksij Rempel
and ath_common sbands. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
2014-02-12ath9k_htc: use ath9k_cmn_process_rssiOleksij Rempel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-04ath9k_htc: Do not support PowerSave by defaultOleksij Rempel
It is a copy/paste of patch provided by Sujith for ath9k. "Even though we make sure PowerSave is not enabled by default by disabling the flag, WIPHY_FLAG_PS_ON_BY_DEFAULT on init, PS could be enabled by userspace based on various factors like battery usage etc. Since PS in ath9k is just broken and has been untested for years, remove support for it, but allow a user to explicitly enable it using a module parameter." Cc: stable@vger.kernel.org Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-13Merge branch 'for-john' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
2014-01-07mac80211: remove channel_change_timeJohannes Berg
This value is no longer used by mac80211, and practically no driver ever set it to a correct value anyway, so remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-12-18ath9k_htc: reconfigure led_gpios after resumeOleksij Rempel
On suspend/resume, firmware will restart and gpios configuration will be reseted. Restore this configureation at least for LEDs Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-22ath9k_htc: do some initial hardware configurationOleksij Rempel
Currently we configure harwdare and clock, only after interface start. In this case, if we reload module or reboot PC without configuring adapter, firmware will freeze. There is no software way to reset adpter. This patch add initial configuration and set it in disabled state, to avoid this freeze. Behaviour of this patch should be similar to: ifconfig wlan0 up; ifconfig wlan0 down. Bug: https://github.com/qca/open-ath9k-htc-firmware/issues/1 Tested-by: Bo Shi <cnshibo@gmail.com> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Cc: <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-27ath9k_htc: ifdef out IFTYPE_MESH advertisementThomas Pedersen
This is needed so the interface combination can still be validated when CONFIG_MAC80211_MESH is not enabled. Otherwise wiphy registration fails. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-24ath9k_htc: Support reporting tx and rx chain mask.Ben Greear
Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-12ath9k_htc: add STBC TX supportOleksij Rempel
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>
2013-05-22ath9k_htc: Claim support for mgmt frame protectionJavier Cardona
Advertise support for management frame protection in hardware. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22ath9k_htc: Add support for mesh interfacesJavier Cardona
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>