1. 02 Oct, 2018 7 commits
    • Felix Fietkau's avatar
      ath9k: add back support for using active monitor interfaces for tx99 · 6df0580b
      Felix Fietkau authored
      Various documented examples on how to set up tx99 with ath9k rely
      on setting up a regular monitor interface for setting the channel.
      My previous patch "ath9k: fix tx99 with monitor mode interface" made
      it possible to set it up this way again. However, it was removing support
      for using an active monitor interface, which is required for controlling
      the bitrate as well, since the bitrate is not passed down with a regular
      monitor interface.
      
      This patch partially reverts the previous one, but keeps support for using
      a regular monitor interface to keep documented steps working in cases
      where the bitrate does not matter
      
      Fixes: d9c52fd1 ("ath9k: fix tx99 with monitor mode interface")
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      6df0580b
    • Brian Norris's avatar
      ath10k: add missing sanity check on diag download · e720ba1d
      Brian Norris authored
      ath10k_hw_diag_fast_download() generally has good boundary checking, but
      it misses verifying that the next metadata header actually fits in the
      remaining buffer space. Add such a check.
      
      Fixes: 39501ea6 ("ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377.")
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      e720ba1d
    • Simon Wunderlich's avatar
      ath9k: fix reporting calculated new FFT upper max · 4fb5837a
      Simon Wunderlich authored
      Since the debug print code is outside of the loop, it shouldn't use the loop
      iterator anymore but instead print the found maximum index.
      
      Cc: Nick Kossifidis <mickflemm@gmail.com>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4fb5837a
    • Simon Wunderlich's avatar
      ath9k: FFT magnitude check: don't consider lower 3 data bits · 4e7a3fa5
      Simon Wunderlich authored
      There were a lot of Magnitude Mismatch while getting FFT samples on my
      hardware (Atheros AR9462. I've compared the reported magnitude with
      the data in the FFT bin, and the FFT bin was less accurate:
      
      [ 5395.193030] ath: phy0: FFT HT20 frame: max mag 0x89,max_mag_idx 28,
      ,magnitude 0x89 max_exp 0, data[28] = 0x88
      [ 5395.194525] ath: phy0: FFT HT20 frame: max mag 0x89,max_mag_idx 28,
      ,magnitude 0x89 max_exp 0, data[28] = 0x88
      [ 5395.196012] ath: phy0: FFT HT20 frame: max mag 0x88,max_mag_idx 28,
      ,magnitude 0x88 max_exp 0, data[28] = 0x88
      [ 5395.197509] ath: phy0: FFT HT20 frame: max mag 0x6C,max_mag_idx 28,
      ,magnitude 0x6C max_exp 0, data[28] = 0x68
      [ 5395.199015] ath: phy0: FFT HT20 frame: max mag 0x78,max_mag_idx 28,
      ,magnitude 0x78 max_exp 0, data[28] = 0x78
      [ 5395.200497] ath: phy0: FFT HT20 frame: max mag 0xA1,max_mag_idx 28,
      ,magnitude 0xA1 max_exp 0, data[28] = 0xA0
      [ 5395.202011] ath: phy0: FFT HT20 frame: max mag 0x91,max_mag_idx 28,
      ,magnitude 0x91 max_exp 0, data[28] = 0x90
      [ 5395.203482] ath: phy0: FFT HT20 frame: max mag 0x89,max_mag_idx 28,
      ,magnitude 0x89 max_exp 0, data[28] = 0x88
      [ 5395.204999] ath: phy0: FFT HT20 frame: max mag 0x27,max_mag_idx 4,
      ,magnitude 0x27 max_exp 0, data[4] = 0x20
      [ 5395.206461] ath: phy0: FFT HT20 frame: max mag 0x41,max_mag_idx 28,
      ,magnitude 0x41 max_exp 0, data[28] = 0x40
      [ 5395.207977] ath: phy0: FFT HT20 frame: max mag 0x51,max_mag_idx 28,
      ,magnitude 0x51 max_exp 0, data[28] = 0x50
      [ 5395.209454] ath: phy0: FFT HT20 frame: max mag 0x53,max_mag_idx 28,
      ,magnitude 0x53 max_exp 0, data[28] = 0x50
      [ 5395.210940] ath: phy0: FFT HT20 frame: max mag 0x40,max_mag_idx 28,
      ,magnitude 0x40 max_exp 0, data[28] = 0x40
      [ 5395.212441] ath: phy0: FFT HT20 frame: max mag 0x59,max_mag_idx 28,
      ,magnitude 0x59 max_exp 0, data[28] = 0x58
      [ 5395.213932] ath: phy0: FFT HT20 frame: max mag 0x53,max_mag_idx 28,
      ,magnitude 0x53 max_exp 0, data[28] = 0x50
      [ 5395.215428] ath: phy0: FFT HT20 frame: max mag 0x7D,max_mag_idx 28,
      ,magnitude 0x7D max_exp 0, data[28] = 0x78
      [ 5395.216910] ath: phy0: FFT HT20 frame: max mag 0x8C,max_mag_idx 28,
      ,magnitude 0x8C max_exp 0, data[28] = 0x88
      [ 5395.218413] ath: phy0: FFT HT20 frame: max mag 0x7B,max_mag_idx 28,
      ,magnitude 0x7B max_exp 0, data[28] = 0x78
      [ 5395.219900] ath: phy0: FFT HT20 frame: max mag 0x43,max_mag_idx 28,
      ,magnitude 0x43 max_exp 0, data[28] = 0x40
      
      It seems like the lower 3 bits on my hardware are always zeroed, but the
      magnitude matches otherwise. Therefore, let's not make the magnitude
      check so strict so we can get those samples released to userspace.
      
      Cc: Nick Kossifidis <mickflemm@gmail.com>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4e7a3fa5
    • Simon Wunderlich's avatar
      ath9k: fix and simplify FFT max index retrieval · 2f85786b
      Simon Wunderlich authored
      FFT max index retrieval was not retrieved correctly for HT20/HT40 FFT
      frames. Fixing the retrieval allows us to remove the fixup function as
      well. While at it, split the spectral_max_index function into versions
      for ht20 and ht40 to simplify the code.
      
      Cc: Nick Kossifidis <mickflemm@gmail.com>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      2f85786b
    • Simon Wunderlich's avatar
      ath9k: return when short FFT frame was handled · b796a6c0
      Simon Wunderlich authored
      With the loop break like this, there are false "FFT report truncated"
      messages because the iterator is not advanced as the check expects.
      
      Instead, just return, for a single frame there is nothing left to be
      done anyways.
      
      Cc: Nick Kossifidis <mickflemm@gmail.com>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      b796a6c0
    • Simon Wunderlich's avatar
      ath9k: add counters for good and errorneous FFT/spectral frames · 03224678
      Simon Wunderlich authored
      This is helpful to see whether spectral samples get discarded.
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      03224678
  2. 01 Oct, 2018 14 commits
    • YueHaibing's avatar
      wil6210: remove set but not used variable 'start' · ec95e84c
      YueHaibing authored
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/net/wireless/ath/wil6210/pm.c: In function 'wil_suspend_keep_radio_on':
      drivers/net/wireless/ath/wil6210/pm.c:193:16: warning:
       variable 'start' set but not used [-Wunused-but-set-variable]
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Reviewed-by: default avatarMaya Erez <merez@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      ec95e84c
    • YueHaibing's avatar
      ath9k: debug: remove set but not used variable 'fops_dump_nfcal' · b8f3d163
      YueHaibing authored
      'fops_dump_nfcal' is not used since commit 4447d815 ("ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      b8f3d163
    • Louie Lu's avatar
      ath9k: add reset for airtime station debugfs · 3fa8d218
      Louie Lu authored
      Let user can reset station airtime status by debugfs, it will
      reset all airtime deficit to ATH_AIRTIME_QUANTUM and reset rx/tx
      airtime accumulate to 0.
      Signed-off-by: default avatarLouie Lu <git@louie.lu>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      3fa8d218
    • Govind Singh's avatar
      ath10k: disable napi before resource cleanup to avoid "use after free" · 393b9b0f
      Govind Singh authored
      CE buffers are cleaned up prior to napi disable and this is causing
      NULL pointer dereference due to "use after free".
      
      Disable napi before resource cleanup to avoid "use after free".
      Signed-off-by: default avatarGovind Singh <govinds@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      393b9b0f
    • Govind Singh's avatar
      ath10k: move napi_enable to hif_start for consistent pairing · 752ed2a2
      Govind Singh authored
      There is unbalanced napi_{enable,disable}() behavior as they
      are being called from hif_snoc_{power_up/stop).
      
      The fix is to call napi_enable() from ath10k_snoc_hif_start()
      so that it matches with napi_disable() being called from
      ath10k_snoc_hif_stop().
      Signed-off-by: default avatarGovind Singh <govinds@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      752ed2a2
    • Maharaja Kennadyrajan's avatar
      ath10k: advertize beacon_int_min_gcd as 100 while bring up multi vaps · 4600563f
      Maharaja Kennadyrajan authored
      With the latest firmware design, the beacon interval should be
      greater than 100 to bring the multiple vaps.
      
      Set beacon_int_min_gcd to 100, when the wmi service
      WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT is enabled
      in the firmware. If not, beacon_int_min_gcd will be set
      to the default value 1.
      
      Tested in QCA4019 with firmware ver 10.4-3.2.1.1-00015
      Tested in QCA9888 with firmware ver 10.4-3.5.1-0005
      Signed-off-by: default avatarMaharaja Kennadyrajan <mkenna@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4600563f
    • Maharaja Kennadyrajan's avatar
      ath10k: add debugfs support to get power save state change of STA · d70c0d46
      Maharaja Kennadyrajan authored
      This patch helps to get the power save state change of each peer
      connected to the AP. With WMI_10_4_PEER_STA_PS_STATECHG_EVENTID
      event, ps state of each peer is reported to user space via
      debugfs.
      
      Use the below command to get the ps state of each sta:
      cat /sys/kernel/debug/ieee80211/phyX/netdev::wlanX/stations/
      XX:XX:XX:XX:XX:XX/peer_ps_state
      
      If STA is in power save state, we get the peer_ps_state value as 1.
      if STA is not in power save state, we get the peer_ps_state value as 0.
      If ps_state event is disabled, we get the peer_ps_state value as 2.
      
      We can enable/disable the ps_state events using the debugfs flag
      "ps_state_enable"
      
      echo Y > /sys/kernel/debug/ieee80211/phyX/ath10k/ps_state_enable
      
      Y = 1 to enable and Y = 0 to disable
      
      Tested in QCA4019 with firmware ver 10.4-3.2.1.1-00011
      Signed-off-by: default avatarMaharaja Kennadyrajan <mkenna@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      d70c0d46
    • YueHaibing's avatar
      ath10k: remove duplicated includes · 4be3b05e
      YueHaibing authored
      remove duplicated include from ath10k driver.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4be3b05e
    • Sriram R's avatar
      ath10k: add support for configuring management packet rate · f279294e
      Sriram R authored
      By default the firmware uses 1Mbps and 6Mbps rate for management packets
      in 2G and 5G bands respectively. But when the user selects different
      basic rates from the userspace, we need to send the management
      packets at the lowest basic rate selected by the user.
      
      This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for configuring the
      management packets rate to the firmware.
      
      Chipsets Tested : QCA988X, QCA9887, QCA9984
      FW Tested 	: 10.2.4-1.0-41, 10.4-3.6.104
      Signed-off-by: default avatarSriram R <srirrama@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      f279294e
    • Erik Stromdahl's avatar
      ath10k: remove num_peers in hw_params for most targets · 08fafd64
      Erik Stromdahl authored
      >From commit "ath10k: add per target config of max_num_peers",
      the num_peers value in struct ath10k_hw_params is used to override
      the value obtained from the WMI op version in the firmware file.
      
      Currently, only high latency devices (USB and SDIO) need to use this
      value, since the value obtained from the WMI op version is not
      applicable for these devices.
      
      Many devices in ath10k_hw_params_list have the wrong value set.
      
      An example of this is the QCA9880 hw2.0 chipset that had (before this
      patch) num_peers set to TARGET_TLV_NUM_PEERS although the firmware
      uses WMI version ATH10K_FW_WMI_OP_VERSION_10_2_4.
      
      Using the wrong value for the QCA9880 chip results in a fw crash:
      
      ath10k_pci 0000:01:00.0: firmware crashed! (guid ddf39880-3e64-4edf-b4e4-979d31724503)
      ath10k_pci 0000:01:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043202ff sub 0000:0000
      ath10k_pci 0000:01:00.0: kconfig debug 1 debugfs 1 tracing 1 dfs 1 testmode 0
      ath10k_pci 0000:01:00.0: firmware ver 10.2.4-1.0-00037 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 a4a52adb
      ath10k_pci 0000:01:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
      ath10k_pci 0000:01:00.0: htt-ver 0.0 wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1
      ath10k_pci 0000:01:00.0: firmware register dump:
      ath10k_pci 0000:01:00.0: [00]: 0x4100016C 0x000015B3 0x009B54B7 0x00955B31
      ath10k_pci 0000:01:00.0: [04]: 0x009B54B7 0x00060530 0x00000011 0x00400000
      ath10k_pci 0000:01:00.0: [08]: 0x000001B8 0x00000007 0x00443138 0x00955A00
      ath10k_pci 0000:01:00.0: [12]: 0x00000009 0x00000000 0x009B548E 0x009B54AB
      ath10k_pci 0000:01:00.0: [16]: 0x00958080 0x0094078E 0x00000000 0x00000000
      ath10k_pci 0000:01:00.0: [20]: 0x409B54B7 0x0040AC64 0x00400000 0x00000087
      ath10k_pci 0000:01:00.0: [24]: 0x809A3831 0x0040ACC4 0x000001B1 0xC09B54B7
      ath10k_pci 0000:01:00.0: [28]: 0x809A2F08 0x0040AD04 0x00410410 0x00000001
      ath10k_pci 0000:01:00.0: [32]: 0x80988856 0x0040AD24 0x00410410 0x00000001
      ath10k_pci 0000:01:00.0: [36]: 0x8098AF64 0x0040AD44 0x00410410 0x00000001
      ath10k_pci 0000:01:00.0: [40]: 0x809B5DEC 0x0040AD84 0x00410410 0x00410FF4
      ath10k_pci 0000:01:00.0: [44]: 0x809B1F20 0x0040ADA4 0x00400000 0x00416C54
      ath10k_pci 0000:01:00.0: [48]: 0x809C0295 0x0040ADE4 0x0040AE08 0x00411DC8
      ath10k_pci 0000:01:00.0: [52]: 0x809486FA 0x0040AE04 0x00000001 0x00000000
      ath10k_pci 0000:01:00.0: [56]: 0x80948E2C 0x0040AEA4 0x0041F290 0x004123D4
      ath10k_pci 0000:01:00.0: Copy Engine register dump:
      ath10k_pci 0000:01:00.0: [00]: 0x00057400  10  10   3   3
      ath10k_pci 0000:01:00.0: [01]: 0x00057800   3   3   8   9
      ath10k_pci 0000:01:00.0: [02]: 0x00057c00   2   2   1   2
      ath10k_pci 0000:01:00.0: [03]: 0x00058000   1   1   2   1
      ath10k_pci 0000:01:00.0: [04]: 0x00058400   0   0  40   0
      ath10k_pci 0000:01:00.0: [05]: 0x00058800   1   1   0   1
      ath10k_pci 0000:01:00.0: [06]: 0x00058c00   0   0   0   0
      ath10k_pci 0000:01:00.0: [07]: 0x00059000   0   0   0   0
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      08fafd64
    • Erik Stromdahl's avatar
      ath10k: add default value for num_peers in WMI TLV init · 8e8374db
      Erik Stromdahl authored
      The hw_params value will only be used if it was explicitly set in the
      global hw_params array.
      
      This makes it possible to have the num_peers member unset.
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      8e8374db
    • Brian Norris's avatar
      ath10k: utilize random MAC address if none is provided · 234e4307
      Brian Norris authored
      Since commit 9d580466 ("ath10k: retrieve MAC address from system
      firmware if provided"), we support pulling our MAC address from system
      firmware. Along with this, we should admit that it's possible for system
      firmware to be screwed up as well, omitting the MAC address there.
      
      Provide a fallback, such that we choose a randomly-generated MAC
      address, with the local assignment bit set.
      
      This is not a preferred mode of operation and really should only serve
      the purpose of keeping the system chugging along while someone figures
      out what's wrong with the system. Grepping through other wireless
      drivers shows very similar fallback logic though, so why not?
      
        git grep eth_random_addr drivers/net/wireless/
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      234e4307
    • Rakesh Pillai's avatar
      ath10k: fix tx status flag setting for management frames · 058a7eab
      Rakesh Pillai authored
      The tx_status for management frames is being filled
      incorrectly in the flags of skb_cb. This incorrect
      flag setting causes the upper layers to consider that
      the particular frame was not transmitted properly,
      leading to improper behavior.
      
      Set the IEEE80211_TX_STAT_ACK flag in the info flags
      of skb_cb, to indicate the successful transmission of
      the management frame.
      
      Tested HW: WCN3990
      Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1
      
      Fixes: dc405152Signed-off-by: default avatarRakesh Pillai <pillair@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      058a7eab
    • Ben Greear's avatar
      ath10k: fix vdev-start timeout on error · 833fd34d
      Ben Greear authored
      The vdev-start-response message should cause the
      completion to fire, even in the error case.  Otherwise,
      the user still gets no useful information and everything
      is blocked until the timeout period.
      
      Add some warning text to print out the invalid status
      code to aid debugging, and propagate failure code.
      Signed-off-by: default avatarBen Greear <greearb@candelatech.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      833fd34d
  3. 06 Sep, 2018 19 commits