1. 06 Sep, 2018 21 commits
    • Erik Stromdahl's avatar
      ath10k: add HTT TX HL ops · 852d1bf8
      Erik Stromdahl authored
      Initial HTT TX ops for high latency devices.
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      852d1bf8
    • Erik Stromdahl's avatar
      ath10k: DMA related fixes for high latency devices · e66d5361
      Erik Stromdahl authored
      Several DMA related functions (such as the dma_map_xxx functions)
      are not used with high latency devices and don't need to be invoked
      in this case.
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      e66d5361
    • Erik Stromdahl's avatar
      ath10k: add per target config of max_num_peers · 4875e0b5
      Erik Stromdahl authored
      This patch makes sure the value of max_num_peers matches
      num_peers in hw_params (if set to a non zero value).
      
      hw_params->num_peers is used in the TLV WMI init command.
      If ar->max_num_peers is not set to the same value, there is a risk
      that the user creates more peers than the maximum number of peers
      supported by the device.
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4875e0b5
    • Erik Stromdahl's avatar
      ath10k: use hw_params.num_peers for num_tids in TLV init · 9faaa143
      Erik Stromdahl authored
      As TARGET_TLV_NUM_TIDS is calculated like this:
      
      	#define TARGET_TLV_NUM_TIDS ((TARGET_TLV_NUM_PEERS) * 2)
      
      ... it is better to use the per device hw_params.num_peers value in
      the TLV init message (if set), rather than using a hard coded value.
      
      This makes the value used in the TLV init message match the hw_param
      value.
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      9faaa143
    • Erik Stromdahl's avatar
      ath10k: add bus type check in ath10k_init_hw_params · 367c899f
      Erik Stromdahl authored
      The bus type is used together with the other hw parameters
      to find a matching entry in ath10k_hw_params_list for the device.
      
      This is necessary since HL devices can have the same dev_id and
      target_version as a corresponding LL device (same chipset) and
      yet use a totally different configuration.
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      367c899f
    • Erik Stromdahl's avatar
      ath10k: add device type enum to ath10k_bus_params · 7c2dd615
      Erik Stromdahl authored
      Add dev_type parameter to struct ath10k_bus_params.
      
      The dev type specifies if the device is a high latency device (usb and
      sdio) or low latency device (pci, ahb and snoc)
      
      The setup of high latency chips is sometimes different than
      for chips using low latency interfaces.
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      7c2dd615
    • Erik Stromdahl's avatar
      ath10k: add struct ath10k_bus_params · c0d8d565
      Erik Stromdahl authored
      This struct is used as argument to ath10k_core_register in order to
      make it easier to add more bus parameters in the future.
      Signed-off-by: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      c0d8d565
    • Carl Huang's avatar
      ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377. · 39501ea6
      Carl Huang authored
      Downloading firmware via BMI protocol takes too long time. For example,
      a ~700K bytes firmware takes about 500ms to download via BMI protocol.
      This is too long especially in suspend and resume scenario where firmware
      is re-downloaded unless WoWLAN is enabled. Downloading firmware via diag CE
      can reduce the time to ~40ms for a ~700K bytes firmware binary.
      
      Ath10k driver parses the firmware to segments and downloads the segments
      to the specified address directly. If the firmware is compressed or has
      unsupported segments, ath10k driver will try BMI download again.
      
      It's tested with QCA6174 hw3.2 and
      firmware-6.bin_WLAN.RM.4.4.1-00111-QCARMSWP-1. QCA9377 is also affected.
      Signed-off-by: default avatarCarl Huang <cjhuang@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      39501ea6
    • Carl Huang's avatar
      ath10k: support to access target space below 1M for qca6174 and qca9377 · bc346c9a
      Carl Huang authored
      To download firmware via diag interface, driver needs to write the target
      memory space below 1M. It means the bit20 should be zero for the converted
      address if the target memory space is below 1M. Otherwise, bit20 is one if
      the target address is larger or equal to 1M space.
      
      As downloading firmware via diag interface is only required for qca6174
      and qca9377, a new specific function is introduced to convert the target
      address to ce address: ath10k_pci_qca6174_targ_cpu_to_ce_addri().
      This function supports to convert any target address to ce address.
      
      It's tested with QCA6174 hw3.2 and
      firmware-6.bin_WLAN.RM.4.4.1-00111-QCARMSWP-1. QCA9377 is also affected.
      Signed-off-by: default avatarCarl Huang <cjhuang@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      bc346c9a
    • Carl Huang's avatar
      ath10k: optimize pci diag mem read & write operations · d56bbeea
      Carl Huang authored
      Delay 1ms is too long for both diag read and write operations.
      This is observed when writing a big memory buffer to target or
      reading a big memory buffer from target. Take writing/reading
      512k bytes as example, the delay itself is 256ms as the maximum
      length of every write/read is 2k size.
      
      Reduce the delay to 50us for read and write operations.
      
      Take the ath10k_pci_targ_cpu_to_ce_addr() out of loop and put it
      in the beginning of the loop for ath10k_pci_diag_read_mem().
      
      The ath10k_pci_targ_cpu_to_ce_addr() is to convert the address
      from target cpu's perspective to CE's perspective, so it makes
      no sense to convert a CE's perspective address again in the loop.
      It's a wrong implementation but happens to work.
      
      If the target address is below 1M space, then the convert in the loop
      from the second time becomes wrong because the previously converted address
      is larger than 1M. The counterpart ath10k_pci_diag_write_mem() has the
      correct implementation.
      
      With this change, ath10k_pci_diage_read_mem() works correctly no matter
      the target address is below 1M or above 1M.
      
      It's tested with QCA6174 hw3.2 and
      firmware-6.bin_WLAN.RM.4.4.1-00111-QCARMSWP-1. QCA9377 is also affected.
      Signed-off-by: default avatarCarl Huang <cjhuang@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      d56bbeea
    • Balaji Pothunoori's avatar
      ath10k: average ack rssi support for data frames · c7fd8d23
      Balaji Pothunoori authored
      Average ack rssi value is weighted average of ack rssi for
      no of msdu's has been sent.
      This feature is enabled by the host driver if firmware is capable.
      After receiving event from host, firmware allocates the necessary
      memory to store the ack_rssi for data packets during the init time.
      
      After each successful transmission, If tx completion status is OK
      and 24th bit is set in HTT message header then host will fetch the
      ack_rssi else host can ignore the ack_rssi field.
      Signed-off-by: default avatarBalaji Pothunoori <bpothuno@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      c7fd8d23
    • K.T.VIJAYAKUMAAR's avatar
      ath10k: avoid possible memory access violation · 97c69a70
      K.T.VIJAYAKUMAAR authored
      array "ctl_power_table" access index "pream" is initialized with -1 and
      is raised as a static analysis tool issue.
      [drivers\net\wireless\ath\ath10k\wmi.c:4719] ->
      [drivers\net\wireless\ath\ath10k\wmi.c:4730]: (error) Array index -1 is
      out of bounds.
      
      Since the "pream" index for accessing ctl_power_table array is initialized
      with -1, there is a chance of memory access violation for the cases below.
      1) wmi_pdev_tpc_final_table_event change frequency is between 2483 and 5180
      2) pream_idx is out of the enumeration ranges of wmi_tpc_pream_2ghz,
      wmi_tpc_pream_5ghz
      Signed-off-by: default avatarK.T.VIJAYAKUMAAR <vijay.bvb@samsung.com>
      [kvalo@codeaurora.org: clean up the warning message]
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      97c69a70
    • Anilkumar Kolli's avatar
      ath10k: add debugfs support to dump per sta tx stats · 85dd28eb
      Anilkumar Kolli authored
      This patch adds 'tx_stats' in per station debugfs entry.
      
      Use this command to dump tx_stats:
      cat /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/
          stations/<MACADDR>/tx_stats
      Signed-off-by: default avatarAnilkumar Kolli <akolli@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      85dd28eb
    • Anilkumar Kolli's avatar
      ath10k: add extended per sta tx statistics support · a904417f
      Anilkumar Kolli authored
      This patch adds per station tx statistics support.
      
      Per station tx stats include
       - pkts/bytes transmitted at all possible rates(mcs/nss/bw/gi).
       - ACK fails count
       - ampdu bytes/pkts transmitted at all possible rates(mcs/nss/bw/gi).
       - BA fails count
      
      Tested on QCA9984/QCA4019/QCA988x
      Firmware: 10.4-3.5.3-00057
      	  10.2.4-1.0-00037
      Signed-off-by: default avatarAnilkumar Kolli <akolli@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      a904417f
    • Anilkumar Kolli's avatar
      ath10k: add debugfs entry to enable extended tx stats · 348cd95c
      Anilkumar Kolli authored
      This patch adds debugfs entry to enable/disable extended
      tx statistics. Extended tx statistics are from peer stats
      feature.
      Signed-off-by: default avatarAnilkumar Kolli <akolli@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      348cd95c
    • Anilkumar Kolli's avatar
      ath10k: get the legacy rate index to update the txrate table · 0189dbd7
      Anilkumar Kolli authored
      Get the legacy rate index to update the pkts/bytes counter
      against each possible tx rate.
      Signed-off-by: default avatarAnilkumar Kolli <akolli@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      0189dbd7
    • Gustavo A. R. Silva's avatar
      wil6210: fix unsigned cid comparison with >= 0 · 49925f24
      Gustavo A. R. Silva authored
      The comparison of cid >= 0 is always true because cid is of type u8
      (8 bits, unsigned).
      
      Fix this by removing such comparison and updating the type of
      variable cid to u8 in the caller function.
      
      Addresses-Coverity-ID: 1473079 ("Unsigned compared against 0")
      Fixes: b9010f10 ("wil6210: add FT roam support for AP and station")
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      49925f24
    • Govind Singh's avatar
      ath10k: enable pktlog for WCN3990 target · 713358c3
      Govind Singh authored
      WCN3990 target uses separate htc service for pktlog.
      Add pktlog service request and support for pktlog
      rx path handling.
      
      Testing:
          Tested on WCN3990 and QCA6174 HW.
          Tested FW: WLAN.HL.2.0-01192-QCAHLSWMTPLZ-1,
                     WLAN.RM.4.4.1-00109-QCARMSWPZ-1
      Signed-off-by: default avatarGovind Singh <govinds@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      713358c3
    • Govind Singh's avatar
      ath10k: introduce CE_ATTR_POLL attribute for polling pipe · 9abcb937
      Govind Singh authored
      Existing copy engine interrupt enable logic assumes that last
      CE is using polling mode and due to this interrupt for last copy engine
      are always disabled. WCN3990 uses last CE for pktlog and
      interrupt remains disabled with existing logic.
      
      To mitigate this issue, introduce CE_ATTR_POLL flag and control
      the interrupt based on the flag which can be set in ce_attr.
      
      Testing:
          Tested on WCN3990 and QCA6174 HW.
          Tested FW: WLAN.HL.2.0-01192-QCAHLSWMTPLZ-1,
                     WLAN.RM.4.4.1-00109-QCARMSWPZ-1
      Signed-off-by: default avatarGovind Singh <govinds@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      9abcb937
    • Sathishkumar Muruganandam's avatar
      ath10k: support extended board data download for dual-band QCA9984 · 31324d17
      Sathishkumar Muruganandam authored
      To support dual-band variant of QCA9984, new extended board data (eBDF)
      is introduced since existing board data ran out of space.
      
      Below is the brief implementation & design detail,
      ----------------------------------------------------
      
      1. New OTP changes to inform eBDF support in existing OTP download to
      fetch board ID and chip ID. This is backward compatible and older
      card sends 0 by default for eBDF support bit (bit 18 of OTP response) we
      check in ath10k driver.
      
      2. If eBDF is supported, then we need to fetch eBDF ID which is bundled
      in downloaded board data. So again OTP is executed for knowing the eBDF ID.
      This is done once we set 'board_data_initialized' bit. If eBDF ID
      returned is zero, we continue booting with previous board data downloaded.
      
      3. Based on the eBDF ID fetched, ath10k driver tries to download the
      extended board data to a new offset ahead of already downloaded board
      data address.
      
      4. A new BD IE type, ATH10K_BD_IE_BOARD_EXT is added to differentiate in
      bundling eBDF separately in board-2.bin and also to parse through
      board bundle for eBDF download in ath10k boot.
      
      5. If eBDF is not present in the board-2.bin bundle or when board ID is
      zero, we do a fallback boot to "eboard.bin" in the same QCA9984/hw1.0 dir.
      This is same as done to existing "board.bin" if board ID is not present
      in board-2.bin bundle.
      
      Current design is that eBDF size will be 2KB and eBDF ID will be
      byte value.
      
      Tested the above changes with dual-band variant of QCA9984 card. OTP
      update needed for the test will be part of next FW release 10.4-3.6-xxxx.
      
      Below are the logs with ath10k BOOT debugs enabled.
      
      First OTP response :
      ---------------------
      ..
      boot upload otp to 0x1234 len 9478 for board id
      boot get otp board id result 0x00040400 board_id 1 chip_id 0 ext_bid_support 1
      ..
      
      Second OTP response :
      ---------------------
      ..
      boot upload otp to 0x1234 len 9478 for ext board id
      boot get otp ext board id result 0x00000005 ext_board_id 5
      boot using eboard name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5'
      ..
      
      Extended board data download:
      ------------------------------
      ..
      board name
      00000000: 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70  bus=pci,bmi-chip
      00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 65 62 6f 61 72 64  -id=0,bmi-eboard
      00000020: 2d 69 64 3d 35                                   -id=5
      boot found match for name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5'
      boot found eboard data for 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5'
      using board api 2
      boot writing ext board data to addr 0xc3000
      ..
      
      Fallback Extended board data download from "eboard.bin":
      ---------------------------------------------------------
      ..
      board name
      00000000: 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70  bus=pci,bmi-chip
      00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 62 6f 61 72 64 2d  -id=0,bmi-board-
      00000020: 69 64 3d 31 30                                   id=10
      failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-eboard-id=5 from ath10k/QCA9984/hw1.0/board-2.bin
      boot fw request 'ath10k/QCA9984/hw1.0/eboard.bin': 0
      using board api 1
      boot writing ext board data to addr 0xc3000
      ..
      Signed-off-by: default avatarSathishkumar Muruganandam <murugana@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      31324d17
    • Sathishkumar Muruganandam's avatar
      ath10k: refactoring needed for extended board data download · 5849ed48
      Sathishkumar Muruganandam authored
      Just moving functions down in the file, no functional changes.
      Signed-off-by: default avatarSathishkumar Muruganandam <murugana@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      5849ed48
  2. 03 Sep, 2018 4 commits
  3. 28 Aug, 2018 15 commits