summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/mac.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * ath10k: fix use of multiple blank linesKalle Valo2014-09-181-4/+0
| | | | | | | | | | | | | | | | Fixes checkpatch warnings: CHECK: Please don't use multiple blank lines Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath10k: fix checkpatch warnings about parenthesis alignmentKalle Valo2014-09-181-6/+7
| | | | | | | | | | | | CHECK: Alignment should match open parenthesis Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath10k: add testmodeKalle Valo2014-09-111-1/+8
| | | | | | | | | | | | | | | | | | Add testmode interface for starting and using UTF firmware which is used to run factory tests. This is implemented by adding new state ATH10K_STATE_UTF and user space can enable this state with ATH10K_TM_CMD_UTF_START command. To go back to normal mode user space can send ATH10K_TM_CMD_UTF_STOP. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath10k: don't access tx_info while overwriting itMichal Kazior2014-09-021-5/+4
| | | | | | | | | | | | | | | | Nothing important was being overwritten so it didn't yield any bugs yet. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath10k: stop monitor vdev for sta assocMichal Kazior2014-09-021-1/+9
| | | | | | | | | | | | | | | | | | | | This prevents some fw revisions from crashing in many cases when user is trying to run a promiscuous station interface (e.g. sniffing, 4addr bridge). Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath10k: fix monitor start/stop sequencesMichal Kazior2014-09-021-72/+49
| | | | | | | | | | | | | | | | | | | | Fix some cases where monitor start failure left the driver in a confused state. This also makes the monitor code simpler. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath10k: fix num_legacy_stations trackingMichal Kazior2014-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | If a station was reassociated, i.e. due to change of supported rates update via sta_rc_update() the num_legacy_stations would be (incorrectly) bumped up leading to unbalanced usage of the var. This in turn could lock rtscts protection up as enabled. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | Merge tag 'mac80211-next-for-john-2014-09-12' of ↵John W. Linville2014-09-151-2/+3
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg <johannes@sipsolutions.net> says: "This time, I have some rate minstrel improvements, support for a very small feature from CCX that Steinar reverse-engineered, dynamic ACK timeout support, a number of changes for TDLS, early support for radio resource measurement and many fixes. Also, I'm changing a number of places to clear key memory when it's freed and Intel claims copyright for code they developed." Conflicts: net/mac80211/iface.c Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mac80211: replace SMPS hw flags with wiphy feature bitsEliad Peller2014-09-111-2/+3
| | | | | | | | | | | | | | | | | | Use the new static_smps / dynamic_smps feature bits instead of mac80211-internal hw flags. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | ath10k: improve logging to include dev idMichal Kazior2014-08-261-209/+218
| | | | | | | | | | | | | | | | | | This makes it a lot easier to log and debug messages if there's more than 1 ath10k device on a system. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: fix typo in error messageBen Greear2014-08-141-1/+1
| | | | | | | | | | | | | | tranmist -> transmit Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: improve vdev map handlingBen Greear2014-08-141-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Check vdev map has space before calling ffs, fix invalid cleanup in failure to create vdev case. Open-code the BIT() logic since BIT does not properly handle 64-bit bitfields and future patches will make use of larger bitfields. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: embed ar_pci inside arMichal Kazior2014-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | Use the common convention of embedding private structures inside parent structures. This reduces allocations and simplifies pci probing code. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: introduce a stricter scan state machineMichal Kazior2014-08-121-94/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This aims at fixing some rare scan bugs related to firmware reporting unexpected scan event sequences. One such bug was if spectral scan phyerr reporting prevented firmware from properly propagating scan events to host. This led to scan timeout. After that next scan would trigger scan completed event first (before scan started event) leading to ar->scan.in_progress and timeout timer states to be overwritten incorrectly and making the very next scan to hang forever. Reported-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: add spectral scan featureSimon Wunderlich2014-08-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the spectral scan feature for ath10k. The spectral scan is triggered by configuring a mode through a debugfs control file. Samples can be gathered via another relay debugfs file. Essentially, to try it out: ip link set dev wlan0 up echo background > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl echo trigger > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl iw dev wlan0 scan echo disable > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl cat /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan0 > samples This feature is still experimental. Based on the original RFC patch of Sven Eckelmann. Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: improve channel switchingMichal Kazior2014-08-021-7/+24
|/ | | | | | | | | | | | | | | | | In some cases during heavy tx vdev stop-start would timeout on vdev synchronization causing traffic to stall for a few seconds. Instead of stop-starting use a dedicated vdev restart command and down vdevs explicitly before doing so. This gets rid of the synchronization warnings/timeouts and makes channel switching smoother during traffic. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: don't advertise IBSS iftype for 10.xMichal Kazior2014-07-251-1/+2
| | | | | | | | | The 10.x firmware does not support IBSS mode at all. It can't beacon and it crashes when trying to scan. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix Rx aggregation reorderingMichal Kazior2014-07-251-0/+33
| | | | | | | | | | | | | | | Firmware doesn't perform Rx reordering so it is left to the host driver to do that. Use mac80211 to perform reordering instead of re-inventing the wheel. This fixes TCP throughput issues in some environments. Reported-by: Denton Gentry <denton.gentry@gmail.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: workaround qos nullfunc bugMichal Kazior2014-07-221-0/+11
| | | | | | | | | | | | | | | | | | Apparently fw/hw generates a corrupted QoS Control Field in Qos NullFunc frames. The only way to workaround this is to downgrade frames to NullFunc. This should be okay since powersave is done by fw/hw and these frames are only used for CQM purposes (e.g. from hostapd to check if station is still connected). This doesn't fix any user visible bug that I know of. It just prevents from sending out funky frames on the air. Reported-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: simplify tx helpersMichal Kazior2014-07-221-29/+20
| | | | | | | | | | | | | | It always bugged me how tid is computed and stored in a temporary var before written to the control buffer. It was confusing and it made it difficult to work with tx helpers. While at it rename the qos workaround function as it was misleading - it's not a workaround but preparation for nwifi tx mode. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* mac80211: support more than one band in scan requestDavid Spinadel2014-06-251-1/+2
| | | | | | | | | | | | | | Some drivers (such as iwlmvm) can handle multiple bands in a single HW scan request. Add a HW flag to indicate that the driver support this. To hold the required data, create a separate structure for HW scan request that holds cfg scan request and data about different parts of the scan IEs. As this changes the mac80211 API, update all drivers using it to use the correct new function type/argument. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath10k: dont configure bssid for ap modeMichal Kazior2014-05-271-1/+6
| | | | | | | | | | | | | FW creates self-peer for AP internally. This prevents ath10k from trying to create explicit self-peer during hw recovery and thus prevents a timeout and a warning during teardown: ath10k: removing stale peer $AP_BSSID from vdev_id 0 Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: protect wep tx key setupMichal Kazior2014-05-271-2/+10
| | | | | | | | | | | | All configuration sequences should be protected with conf_mutex to avoid concurrent/conflicting requests. This should make sure that wep tx key setup is not performed while hw is restarted (at least). Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: drain tx before restarting hwMichal Kazior2014-05-271-9/+22
| | | | | | | | | | | | | | | This makes sure no further tx requests are submitted to HTT before driver teardown. This should prevent invalid pointer/NULL dereference on htt tx pool in ath10k_htt_tx() in some cases of heavy traffic. kvalo: remove the WARN_ON() if conf_mutex is held Reported-By: Ben Greear <greearb@candelatech.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: perform hw restart lazilyMichal Kazior2014-05-271-18/+16
| | | | | | | | | | | | | This reduces risk of races and prepares for more hw restart fixes. It also makes sense to perform teardown after mac80211 starts its restart routine as it guarantees it has stopped itself by then (including tx queues). Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: clean up start() callbackMichal Kazior2014-05-271-11/+23
| | | | | | | | | This fixes failpath when override AC pdev param setup fails and makes other pdev params setting fail as well. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath9k/ath10k: remove unnecessary channel_switch_beacon callbacksLuciano Coelho2014-05-231-9/+0
| | | | | | | | | | | The channel_switch_beacon callback is optional, so it doesn't have to be defined if it's not going to do anything useful with it. Both ath9k and ath10k define the callback and just returns. This commit removes them. Cc: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: support get/set antenna configurations.Ben Greear2014-05-221-0/+80
| | | | | | | | | | | | | Verified that target's tx/rx chain register is set appropriately, and that the tx rate goes down as number of chains decrease, but I did not actually try to verify antenna ceased to transmit when disabled. kvalo: move ar->supp_*_chainmask initialisation to ath10k_mac_register() Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix pmf for action framesMarek Kwaczynski2014-05-161-1/+4
| | | | | | | | | | | | | | Fix sending and receiveing protected managment frames. Lack of protected flag for received protected action frames causes report these frames as unprotected robust action frames. If the driver in AP mode sent frame with protected flag and CCMP header using IEEE80211_KEY_FLAG_SW_MGMT_TX flag, the FW encrypted frames once again. From user side all received SA Query Requests and Responses were skipped and all protected action frames were sent as malformed packets. Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* Merge remote-tracking branch 'wireless-next/master' into ath-nextKalle Valo2014-05-141-1/+2
|\
| * Merge branch 'for-john' of ↵John W. Linville2014-04-301-1/+2
| |\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Conflicts: net/mac80211/chan.c
| | * mac80211: add vif to flush callEmmanuel Grumbach2014-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow the low level driver to make decision based on the vif such as queues etc... Since the vif might be NULL, we can't add it to the tracing functions. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> [fix staging rtl8821ae driver] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | | ath10k: fix firmware recovery with ap interfaceMichal Kazior2014-04-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beacon data wasn't properly cleared during early phase of recovery. This in turn caused firmware to crash because the beacon data was submitted before vdevs were fully re-configured. Ultimately the device was considered wedged and nothing worked until driver was reloaded. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | | ath10k: make sure to not leak beacon dma mappingMichal Kazior2014-04-241-0/+3
|/ / | | | | | | | | | | | | | | | | | | | | If for some reason mac80211 wouldn't stop beaconing gracefully and just removed interface of a running AP/IBSS interface it was possible to leak pending beacon DMA mapping. It's very unlikely but better safe than sorry. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: refactor radar detection codeMichal Kazior2014-04-111-37/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If 20MHz CAC completed successfully then subsequent CAC with wider bandwidth (40Mhz, 80Mhz) with identical control frequency did not start monitor vdev making it impossible to detect any radar pulses during intended CAC. It also was incorrect to assume ath10k_config() will be called after CAC is finished. Theoretically for non-HT channels nothing changes between CAC and start_ap() (albeit in practice this can be different). The incorrect assumption led to CAC not being stopped on non-HT chandefs leading to all Rx being drooped making it impossible for clients to associate. While at it clean up the code a bit. kvalo: separate WARN_ON() from the if statement Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: reorder functionsMichal Kazior2014-04-111-85/+85
| | | | | | | | | | | | | | | | This is done to avoid forward declarations with upcomming patches. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: refactor monitor codeMichal Kazior2014-04-081-95/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was possible to create/delete/start/stop monitor vdev from a few places that were not exclusively protected against each other. This resulted in monitor vdev being stopped/removed by one call origin while another one was expecting it to continue running. For example if CAC was started and interface's promiscuous mode was toggled monitor vdev was removed from the driver meaning no radar would be detected. In additional a warning would be printed upon CAC completion complaining it tried to stop non-running monitor vdev. The patch simplifies monitor code by removing IEEE80211_HW_WANT_MONITOR_VIF (which wasn't really ever needed) and improves state tracking. It also unifies prints. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: unify warning messages in mac.cKalle Valo2014-03-281-129/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently there are different styles used for warning messages, unify them to look similar. The style basically is: 1) start with a verb (if possible) 2) lower case letters 3) use plain english as much as possible Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: update regulatory domain settings for 10.x firmwareMarek Puzyniak2014-03-241-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | Regulatory domain settings for firmware 10.x has more options than main firmware, so handle regulatory domain setup separately for both supported firmwares. Fill in additional dfs domain parameter according to current regulatory. This patch does not solve any known bug. Not handled parameter for firmware 10.x was found during code review. Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: add recalc RTS/CTS protection methodMarek Kwaczynski2014-03-131-11/+44
| | | | | | | | | | | | | | | | | | | | | | Add recalculation of RTS/CTS protection when one or more legacy stations are connected to ath10k. In this case enable RTS/CTS protection and set sw retry profile are needed in the FW. Without this change legacy station is starved and has very low throughput. Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath10k: allow the supported rate change by reassociate peerChun-Yeow Yeoh2014-03-111-11/+13
|/ | | | | | | | | | | IBSS mode requires the changing of supported rate. Do this by reassociate the peer. The investigation shows that if move from legacy to HT, the rate control won't work after changing the supported rate. But once changing the supported rate to HT, user can assign the TxRate in HT mode. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: add vdev-id, return code to error codesBen Greear2014-03-031-86/+115
| | | | | | | | | | | | When using multiple vdevs (stations, aps, etc), it is nice to be able to associate log messages with specific interfaces. So, add vdev-id to most logging messages. Add return code as well, where it was missing. kvalo: unify some of the messages to follow the same style Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: remove DMA mapping wrappersMichal Kazior2014-02-281-1/+3
| | | | | | | | | | | There's no real benefit from using them. DMA-API already provides debugging. Some skbuffs are already mapped directly with DMA-API since wrapper arguments were insufficient and extending them would be pointless. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: bitrate_mask add force_sgi supportJanusz Dziedzic2014-02-271-3/+32
| | | | | | | Add force SGI support. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: enable spectrum management supportJanusz Dziedzic2014-02-271-1/+2
| | | | | | | | | | Indicate spectrum management support in hardware flags, while we already handle power set (IEEE80211_CONF_CHANGE_POWER) in the ath10k driver. This enable 802.11h support for station mode. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix sta_rc_update for non-ap iftypeMichal Kazior2014-02-261-4/+7
| | | | | | | | | | The arsta structure wasn't initialized for non-ap interfaces. This should fix related warnings/crashes. Reported-By: Ben Greear <greearb@candelatech.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: add more details to some debug messagesBen Greear2014-02-261-1/+2
| | | | | | | | Makes it easier to determine why some failures happened. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: implement drv_get_tsf for ibss mergingChun-Yeow Yeoh2014-02-261-0/+11
| | | | | | | | | | Implement the get TSF by simply returning 0 so that IBSS merging is happening. Otherwise, IBSS nodes that have similar SSID naming won't merge. This is simply fooling the mac80211 that the TSF in the received beacon is higher than the local TSF. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: implement sta_rc_update()Michal Kazior2014-02-151-0/+157
| | | | | | | | | This allows dynamic changes of bandwidth/nss/smps, e.g. via ht/vht operation mode change notification. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath10k: fix SMPS supportMichal Kazior2014-02-151-12/+44
| | | | | | | | | | | | | | | Firmware ignores SMPS flags in peer assoc command. For SMPS to work it is necessary to set peer parameter after peer assoc command so that tx chainmask is setup properly. This should fix packet loss and improve throughput with stations that have SMPS enabled upon association. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
OpenPOWER on IntegriCloud