1. 03 10月, 2019 1 次提交
    • W
      ath10k: add support for hardware rfkill · 1382993f
      Wen Gong 提交于
      When hardware rfkill is enabled in the firmware it will report the
      capability via using WMI_TLV_SYS_CAP_INFO_RFKILL bit in the WMI_SERVICE_READY
      event to the host. ath10k will check the capability, and if it is enabled then
      ath10k will set the GPIO information to firmware using WMI_PDEV_SET_PARAM. When
      the firmware detects hardware rfkill is enabled by the user, it will report it
      via WMI_RFKILL_STATE_CHANGE_EVENTID. Once ath10k receives the event it will
      send wmi command WMI_PDEV_SET_PARAM to the firmware to enable/disable the radio
      and also notifies cfg80211.
      
      We can't power off the device when rfkill is enabled, as otherwise the
      firmware would not be able to detect GPIO changes and report them to the
      host. So when rfkill is enabled, we need to keep the firmware running.
      
      Tested with QCA6174 PCI with firmware
      WLAN.RM.4.4.1-00109-QCARMSWPZ-1.
      Signed-off-by: NAlan Liu <alanliu@codeaurora.org>
      Signed-off-by: NWen Gong <wgong@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      1382993f
  2. 01 10月, 2019 2 次提交
  3. 23 9月, 2019 2 次提交
  4. 12 9月, 2019 1 次提交
    • R
      ath10k: fix channel info parsing for non tlv target · 6be6c04b
      Rakesh Pillai 提交于
      The tlv targets such as WCN3990 send more data in the chan info event, which is
      not sent by the non tlv targets. There is a minimum size check in the wmi event
      for non-tlv targets and hence we cannot update the common channel info
      structure as it was done in commit 13104929 ("ath10k: fill the channel
      survey results for WCN3990 correctly"). This broke channel survey results on
      10.x firmware versions.
      
      If the common channel info structure is updated, the size check for chan info
      event for non-tlv targets will fail and return -EPROTO and we see the below
      error messages
      
         ath10k_pci 0000:01:00.0: failed to parse chan info event: -71
      
      Add tlv specific channel info structure and restore the original size of the
      common channel info structure to mitigate this issue.
      
      Tested HW: WCN3990
      	   QCA9887
      Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
      	   10.2.4-1.0-00037
      
      Fixes: 13104929 ("ath10k: fill the channel survey results for WCN3990 correctly")
      Cc: stable@vger.kernel.org # 5.0
      Signed-off-by: NRakesh Pillai <pillair@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      6be6c04b
  5. 25 6月, 2019 2 次提交
  6. 07 5月, 2019 2 次提交
  7. 28 2月, 2019 1 次提交
    • S
      ath10k: Fill rx duration for each peer in fw_stats for WCN3990 · f40a307e
      Surabhi Vishnoi 提交于
      Currently, rx_duration for each peer is not getting populated in
      fw_stats debugfs entry for WCN3990.
      
      WCN3990 firmware sends rx duration for each peer as part of
      peer_extd_stats in WMI_UPDATE_STATS_EVENT. To enable peer_extd_stats,
      firmware expects host to send fw_stats_req_mask with flag
      WMI_TLV_PEER_STATS_EXTD set in WMI_REQUEST_STATS_CMD.
      
      Send fw_stats_req_mask with flag WMI_TLV_PEER_STATS_EXTD set in
      WMI_REQUEST_STATS_CMD and parse the peer_extd_stats in
      WMI_UPDATE_STATS_EVENT to populate the rx_duration of each peer
      in fw_stats debugfs entry.
      
      Currently the driver handles 32-bit rx_duration, but the rx_duration
      for WCN3990 can be upto 63 bit. The firmware sends rx_duration split
      into two 32-bit fields, with the upper 32-bits being valid only if its
      MSB is set. This change handles the 63-bit rx_duration obtained from
      WCN3990 and maintain the backward compatibility.
      
      To get the rx_duration of each connected peer :
      cat /sys/kernel/debug/ieee80211/phyX/ath10k/fw_stats
      
      Tested HW: WCN3990
      Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
      Signed-off-by: NSurabhi Vishnoi <svishnoi@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      f40a307e
  8. 26 2月, 2019 4 次提交
  9. 20 2月, 2019 1 次提交
  10. 12 2月, 2019 2 次提交
  11. 07 2月, 2019 3 次提交
  12. 21 12月, 2018 1 次提交
  13. 05 11月, 2018 2 次提交
    • Y
      ath10k: remove set but not used variable 'tlv_len' · 3468404f
      YueHaibing 提交于
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/net/wireless/ath/ath10k/wmi-tlv.c: In function 'ath10k_wmi_tlv_op_gen_config_pno_start':
      drivers/net/wireless/ath/ath10k/wmi-tlv.c:3455:6: warning:
       variable 'tlv_len' set but not used [-Wunused-but-set-variable]
      
      It never used since inroduction in commit
      ce834e28 ("ath10k: support NET_DETECT WoWLAN feature")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      3468404f
    • R
      ath10k: fill the channel survey results for WCN3990 correctly · 13104929
      Rakesh Pillai 提交于
      The host driver currently expects the channel info event to be
      received in pairs for all the channels, i.e. the first
      chan_info event for a particular channel will not have the
      COMPLETE flag set and the second chan_info event for the
      same channel will have the COMPLETE flag set.
      
      The HL2.0 firmware sends only one channel info event per channel
      which is scanned without the COMPLETE flag set. After sending the
      chan_info_event for all the channels, the HL2.0 firmware sends a
      chan_info_event with COMPLETE flag set to indicate the completion
      of the channel info event.
      
      The firmware does not indicate this behavior with any service bitmap
      and hence a new firmware feature flag is used to handle the modified
      parsing of the channel info events, in the host driver, for the
      firmware which sends single channel info event per scanned channel.
      
      Tested HW: WCN3990
      Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1
      Co-developed-by: NSurabhi Vishnoi <svishnoi@codeaurora.org>
      Signed-off-by: NSurabhi Vishnoi <svishnoi@codeaurora.org>
      Signed-off-by: NRakesh Pillai <pillair@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      13104929
  14. 14 10月, 2018 1 次提交
    • W
      ath10k: support NET_DETECT WoWLAN feature · ce834e28
      Wen Gong 提交于
      For WoWLAN support it is expected to support wake up based on discovery of
      one or more known SSIDs. This is the WIPHY_WOWLAN_NET_DETECT feature,
      which shows up as an NL80211 feature flag.
      
      This shows up in 'iw phy' as:
      
      WoWLAN support:
      * wake up on network detection, up to 16 match sets
      
      And it can be enabled with command:
      
      iw phy0 wowlan enable net-detect interval 5000 delay 30 freqs 2412 matches ssid foo
      
      Firmware will do scan by the configured parameters after suspend and
      wakeup if it found matched SSIDs. Tested with QCA6174 hw3.0 with
      firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1.
      Signed-off-by: NWen Gong <wgong@codeaurora.org>
      [kvalo@codeaurora.org: fix lots of endian bugs, whitespace, commit log and style cleanup]
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      ce834e28
  15. 01 10月, 2018 2 次提交
  16. 07 9月, 2018 1 次提交
  17. 31 7月, 2018 4 次提交
  18. 28 6月, 2018 2 次提交
    • Z
      ath10k: fix tlv 5ghz channel missing issue · 98dc04ba
      Zhi Chen 提交于
      The 5ghz channel parameters of TLV target wasn't passed to host, it caused
      host can only use lower channels from 36 to 64.
      Signed-off-by: NZhi Chen <zhichen@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      98dc04ba
    • Z
      ath10k: fix scan crash due to incorrect length calculation · c8291988
      Zhi Chen 提交于
      Length of WMI scan message was not calculated correctly. The allocated
      buffer was smaller than what we expected. So WMI message corrupted
      skb_info, which is at the end of skb->data. This fix takes TLV header
      into account even if the element is zero-length.
      
      Crash log:
        [49.629986] Unhandled kernel unaligned access[#1]:
        [49.634932] CPU: 0 PID: 1176 Comm: logd Not tainted 4.4.60 #180
        [49.641040] task: 83051460 ti: 8329c000 task.ti: 8329c000
        [49.646608] $ 0   : 00000000 00000001 80984a80 00000000
        [49.652038] $ 4   : 45259e89 8046d484 8046df30 8024ba70
        [49.657468] $ 8   : 00000000 804cc4c0 00000001 20306320
        [49.662898] $12   : 33322037 000110f2 00000000 31203930
        [49.668327] $16   : 82792b40 80984a80 00000001 804207fc
        [49.673757] $20   : 00000000 0000012c 00000040 80470000
        [49.679186] $24   : 00000000 8024af7c
        [49.684617] $28   : 8329c000 8329db88 00000001 802c58d0
        [49.690046] Hi    : 00000000
        [49.693022] Lo    : 453c0000
        [49.696013] epc   : 800efae4 put_page+0x0/0x58
        [49.700615] ra    : 802c58d0 skb_release_data+0x148/0x1d4
        [49.706184] Status: 1000fc03 KERNEL EXL IE
        [49.710531] Cause : 00800010 (ExcCode 04)
        [49.714669] BadVA : 45259e89
        [49.717644] PrId  : 00019374 (MIPS 24Kc)
      Signed-off-by: NZhi Chen <zhichen@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      c8291988
  19. 13 6月, 2018 1 次提交
    • K
      treewide: kzalloc() -> kcalloc() · 6396bb22
      Kees Cook 提交于
      The kzalloc() function has a 2-factor argument form, kcalloc(). This
      patch replaces cases of:
      
              kzalloc(a * b, gfp)
      
      with:
              kcalloc(a * b, gfp)
      
      as well as handling cases of:
      
              kzalloc(a * b * c, gfp)
      
      with:
      
              kzalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kzalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kzalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kzalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kzalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kzalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kzalloc
      + kcalloc
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kzalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(sizeof(THING) * C2, ...)
      |
        kzalloc(sizeof(TYPE) * C2, ...)
      |
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(C1 * C2, ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6396bb22
  20. 12 5月, 2018 1 次提交
    • Y
      ath10k: add quiet mode support for QCA6174/QCA9377 · cfb353c0
      Yu Wang 提交于
      To enable thermal throttling for QCA6174 and QCA9377,
      implement gen_pdev_set_quiet_mode for them.
      With this change, quiet period for QCA6174/QCA9377 can
      be also set/get via debugfs.
      Usage:
      To set quiet period:
       echo <period> > /sys/kernel/debug/ieee80211/phyX/ath10k/quiet_period
      To get the current quiet period:
       cat /sys/kernel/debug/ieee80211/phyX/ath10k/quiet_period
      
      This change has been verified with
      QCA6174 hw3.2(fw: WLAN_RM.4.4.1-00102-QCARMSWP-1).
      Signed-off-by: NYu Wang <yyuwang@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      cfb353c0
  21. 24 4月, 2018 2 次提交
  22. 29 3月, 2018 2 次提交