1. 14 10月, 2015 2 次提交
    • M
      ath10k: select board data based on BMI chip id and board id · db0984e5
      Manikanta Pubbisetty 提交于
      QCA99X0 uses radio specific board names based on chip id and
      board id combinations. We get these IDs from the target using BMI after otp.bin
      has been started.
      
      This patch reorders the call to the function ath10k_core_fetch_board_file
      so that we have OTP binary before requesting for boardid-chipid. We get this
      OTP data after parsing firmware-N.bin.
      
      [kvalo@qca.qualcomm.com: try BMI_PARAM_GET_EEPROM_BOARD_ID with
       all boards and detect if command is not supported]
      Signed-off-by: NManikanta Pubbisetty <c_mpubbi@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      db0984e5
    • M
      ath10k: add board 2 API support · 0a51b343
      Manikanta Pubbisetty 提交于
      QCA6174 needs different board files based on board type. To make it easier to
      distribute multiple board files and automatically choose correct board file
      create a simple TLV file format following the same principles as with FW IEs.
      The file is named board-2.bin and contain multiple board files. Each board file
      then can have multiple names.
      
      ath10k searches for file board-N.bin (where N is the interface version number
      for the board file, just like we for firmware files) in /lib/firmware/*, for
      example for qca99x0 it will try to find it here:
      
      /lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
      
      If ath10k doesn't find board-2.bin then it will fallback to the old board.bin file.
      
      This patch adds a simple name scheme using pci device id which for now will be
      used by qca6174:
      
      bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x
      
      This removes the old method of having subsystem ids in ar->spec_board_id and
      using that in the board file name.
      Signed-off-by: NManikanta Pubbisetty <c_mpubbi@qti.qualcomm.com>
      [kvalo@qca.qualcomm.com: simplified the file format, rewrote commit log, other smaller changes]
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      0a51b343
  2. 09 10月, 2015 3 次提交
  3. 06 10月, 2015 10 次提交
    • P
      ath10k: use pre-allocated DMA buffer in Tx · 683b95e8
      Peter Oh 提交于
      ath10k driver is using dma_pool_alloc per packet and dma_pool_free
      in coresponding at Tx completion.
      Use of pre-allocated DMA buffer in Tx will improve saving CPU resource
      by 5% while it consumes about 56KB memory more as trade off.
      Signed-off-by: NPeter Oh <poh@qca.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      683b95e8
    • P
      ath10k: use Rx decap mode configured when driver registered · bc27e8cd
      Peter Oh 提交于
      ath10k is using Native WiFi mode as default mode for both of
      Tx and Rx path, but it could be changed when driver registers
      with a module parameter for specific purpose such as mesh.
      
      The Rx decap mode sent to firmware during WMI initialization should
      use the same mode that driver configured at its registration stage
      in case of using raw mode, so that host driver receives MAC frame
      header containing necessary fields such as QoS and Mesh Control
      and uses them in right way to make data traffic work.
      Signed-off-by: NPeter Oh <poh@qca.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      bc27e8cd
    • M
      ath10k: implement debugfs interface for Transmit Power Control stats · 29542666
      Maharaja Kennadyrajan 提交于
      The Transmit Power Control (TPC) dump will show the power control values for
      each rate which makes it easier to debug calibration problems.
      
      Example usage:
      
      # cat /sys/kernel/debug/ieee80211/phy0/ath10k/tpc_stats
      TPC config for channel  5180  mode  10
      
      CTL             = 0x10 Reg. Domain              = 58
      Antenna Gain    = 1    Reg. Max Antenna Gain    = 0
      Power Limit     = 34   Reg. Max Power           = 34
      Num tx chains   = 3    Num supported rates      = 155
      
      **********CDD POWER TABLE*******
      
      No.  Preamble Rate_code tpc_valu1 tpc_value2 tpc_value3
      0       CCK     0x40       0            0       0
      1       CCk     0x41       0            0       0
      
      [...]
      
      154     HTCUP   0x 0       24           0       0
      **********STBC POWER TABLE******
      No.  Preamble Rate_code tpc_valu1 tpc_value2 tpc_value3
      0       CCK     0x40       0            0       0
      
      [...]
      
      154     HTCUP   0x 0       24           24      0
      **********TXBF POWER TABLE******
      
      is used to dump the tx power control stats.
      Signed-off-by: NMaharaja Kennadyrajan <c_mkenna@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      29542666
    • K
      ath10k: add a_sle32_to_cpu() · 3b8fc902
      Kalle Valo 提交于
      Copy a_sle32_to_cpu() from ath6kl so that we can easily handle signed __le32
      values. This is needed in struct wmi_pdev_tpc_config_event.
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      3b8fc902
    • K
      ath10k: split an unnecessary long line · 2a995088
      Kalle Valo 提交于
      from checkpatch:
      
      drivers/net/wireless/ath/ath10k/mac.c:1113: line over 90 characters
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      2a995088
    • K
      ath10k: fix whitespace usage · 9a14969f
      Kalle Valo 提交于
      checkpatch found:
      
      drivers/net/wireless/ath/ath10k/core.c:574: Blank lines aren't necessary before a close brace '}'
      drivers/net/wireless/ath/ath10k/mac.c:4067: Missing a blank line after declarations
      drivers/net/wireless/ath/ath10k/mac.c:4083: Missing a blank line after declarations
      drivers/net/wireless/ath/ath10k/mac.c:4084: spaces required around that '>>=' (ctx:WxV)
      drivers/net/wireless/ath/ath10k/pci.c:1507: Missing a blank line after declarations
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      9a14969f
    • K
      ath10k: remove void function return statements · 92438a2c
      Kalle Valo 提交于
      drivers/net/wireless/ath/ath10k/wmi.c:3023: void function return statements are not generally useful
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      92438a2c
    • K
      ath10k: brace style fixes · b9e284e5
      Kalle Valo 提交于
      drivers/net/wireless/ath/ath10k/htt_tx.c:457: braces {} are not necessary for single statement blocks
      drivers/net/wireless/ath/ath10k/htt_tx.c:545: braces {} are not necessary for single statement blocks
      drivers/net/wireless/ath/ath10k/mac.c:200: braces {} are not necessary for single statement blocks
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      b9e284e5
    • K
      ath10k: indentation fixes · 617b0f4d
      Kalle Valo 提交于
      checkpatch found:
      
      drivers/net/wireless/ath/ath10k/core.c:513: Alignment should match open parenthesis
      drivers/net/wireless/ath/ath10k/core.c:1266: code indent should use tabs where possible
      drivers/net/wireless/ath/ath10k/core.c:1267: code indent should use tabs where possible
      drivers/net/wireless/ath/ath10k/core.c:1268: code indent should use tabs where possible
      drivers/net/wireless/ath/ath10k/core.c:1269: code indent should use tabs where possible
      drivers/net/wireless/ath/ath10k/mac.c:4659: Alignment should match open parenthesis
      drivers/net/wireless/ath/ath10k/mac.c:6271: Alignment should match open parenthesis
      drivers/net/wireless/ath/ath10k/pci.c:2260: Alignment should match open parenthesis
      drivers/net/wireless/ath/ath10k/wmi.c:3510: Alignment should match open parenthesis
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      617b0f4d
    • K
      ath10k: fix checkpatch warning about logical continuations · be62e92a
      Kalle Valo 提交于
      checkpatch found:
      
      drivers/net/wireless/ath/ath9k/core.c:490: Logical continuations should be on the previous line
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      be62e92a
  4. 27 9月, 2015 2 次提交
  5. 17 9月, 2015 7 次提交
  6. 09 9月, 2015 6 次提交
    • M
      ath10k: print invalid mcs reported in rx descriptor · 6ccea107
      Manikanta Pubbisetty 提交于
      Sometimes hardware reports invalid mcs index in rx descriptor
      when operating in VHT80 mode and all packets with invalid mcs
      will be eventually dropped in mac80211. This issue is observerd during
      testing on QCA99X0 chipsets.
      
      This patch adds a warn message for dumping the rx desc info which helps
      in analysing the issue when invalid mcs is received.
      Signed-off-by: NManikanta Pubbisetty <c_mpubbi@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      6ccea107
    • B
      ath10k: fix beamformer VHT sounding dimensions capability · 0c6d6f26
      Bartosz Markowski 提交于
      Similarly to the VHT STS, this is supposed to be propagated by firmware.
      In case it's not, use the default value, but as last resort.
      Signed-off-by: NBartosz Markowski <bartosz.markowski@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      0c6d6f26
    • B
      ath10k: fix beamformee VHT STS capability · 707a0c81
      Bartosz Markowski 提交于
      The VHT STS CAP shall be reported by firmware to host, like in case of
      QCA99x0. For QCA6174 hw family this isn't set for some reason.
      So for this particular chips, let's assume it has the ability to
      support VHT NDP in up to 4 STSs (which is true by the way).
      
      Change the published beamformee STS cap accordingly to 3 or to what
      the firmware reports.
      
      Assumption so far, it suppose to be the num_rf_chains-1, was
      completely wrong.
      Signed-off-by: NBartosz Markowski <bartosz.markowski@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      707a0c81
    • V
      ath10k: drop probe responses when too many are queued · 7b7da0a0
      Vivek Natarajan 提交于
      In a noisy environment, when multiple interfaces are created,
      the management tx descriptors are fully occupied by the probe
      responses from all the interfaces. This prevents a new station
      from a successful association.
      
      Fix this by limiting the probe responses when the specified
      threshold limit is reached.
      Signed-off-by: NVivek Natarajan <nataraja@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      7b7da0a0
    • V
      ath10k: fix DMA alloc failure for target requested memory chunks · a925a376
      Vasanthakumar Thiagarajan 提交于
      During long hours of stress testing like AP interface up/down along
      with continuous ping flood from a station doing connect/disconnect,
      it is observed that the system is not able to allocate DMA consistent
      memory of size > 512KB chunks as requested by firmware in WMI_SERVICE_EVENTID.
      With the system memory getting fragmented during the run based on the
      size of the memory requested, the failure to return physically continguous
      memory of high order can happen. Once the system gets to this situation,
      bringing up the wifi interface will fail and a system reboot may be needed
      to make it work again. This problem is obseved with QCA99X0.
      
      To fix this issue, allocate the DMA memory requested by firmware during
      device probe time and keep it during the life time of the device. WMI service
      ready event handler is changed to allocate the memory chunks if it is
      not already allocated or if the memory allocated for the previous ready
      event is not same as the current requested ones. After this patch the
      memory usage when wifi is inactive will be inceased by few 100KB to
      3MB based on the target type.
      
      Failure happens with the following stack trace
      
      [29557.488773] kworker/u4:1: page allocation failure: order:8, mode:0xd0
      [29557.494297] CPU: 0 PID: 8402 Comm: kworker/u4:1 Not tainted 3.14.43 #7
      [29557.500793] Workqueue: ath10k_aux_wq ath10k_wmi_event_service_ready_work [ath10k_core]
      [29557.508602] [<c021e9b0>] (unwind_backtrace) from [<c021ba90>] (show_stack+0x10/0x14)
      [29557.516580] [<c021ba90>] (show_stack) from [<c03bdddc>] (dump_stack+0x88/0xcc)
      [29557.523612] [<c03bdddc>] (dump_stack) from [<c0290e34>] (warn_alloc_failed+0xdc/0x108)
      [29557.531515] [<c0290e34>] (warn_alloc_failed) from [<c0292d88>] (__alloc_pages_nodemask+0x4f0/0x654)
      [29557.540485] [<c0292d88>] (__alloc_pages_nodemask) from [<c0222b48>] (__dma_alloc_buffer.isra.20+0x2c/0x104)
      [29557.550260] [<c0222b48>] (__dma_alloc_buffer.isra.20) from [<c0222c34>] (__alloc_remap_buffer.isra.23+0x14/0xb8)
      [29557.560413] [<c0222c34>] (__alloc_remap_buffer.isra.23) from [<c022305c>] (__dma_alloc+0x224/0x2b8)
      [29557.569490] [<c022305c>] (__dma_alloc) from [<c0223208>] (arm_dma_alloc+0x84/0x90)
      [29557.577010] [<c0223208>] (arm_dma_alloc) from [<bf5159d0>] (ath10k_wmi_event_service_ready_work+0x2f8/0x420 [ath10k_core])
      [29557.588055] [<bf5159d0>] (ath10k_wmi_event_service_ready_work [ath10k_core]) from [<c024260c>] (process_one_work+0x20c/0x328)
      [29557.599305] [<c024260c>] (process_one_work) from [<c02432d0>] (worker_thread+0x228/0x360)
      [29557.607470] [<c02432d0>] (worker_thread) from [<c0247f88>] (kthread+0xd8/0xec)
      [29557.614750] [<c0247f88>] (kthread) from [<c0208d18>] (ret_from_fork+0x14/0x3c)
      [29557.712751] Normal: 696*4kB (UEMR) 512*8kB (UEMR) 367*16kB (UEMR) 404*32kB (UEMR) 455*64kB (UEMR) 424*128kB (UEMR) 379*256kB (UMR) 327*512kB (UMR) 1*1024kB (R) 0*2048kB 0*4096kB = 374544kB
      Signed-off-by: NVasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      a925a376
    • M
      ath10k: fix mu-mimo rx status reporting · 6986fdd6
      Michal Kazior 提交于
      MU-MIMO Rx involves different interpretation of
      the VHT-SIG-A compared to SU-MIMO.
      
      The incorrect interpretation led ath10k to report
      VHT MCS values greater than 9 which subsequently
      prompted mac80211 to drop such frames. This
      effectively broke Rx with MU-MIMO in many cases
      and manifested with a kernel warning in the log
      which looked like this:
      
        [   14.552520] WARNING: CPU: 2 PID: 0 at net/mac80211/rx.c:3578 ieee80211_rx+0x26c/0x940 [mac80211]()
        [   14.552522] Rate marked as a VHT rate but data is invalid: MCS: 10, NSS: 2
        ... call trace follows ...
      Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      6986fdd6
  7. 26 8月, 2015 5 次提交
    • R
      ath10k: fix compilation warnings in wmi phyerr pull function · ee92a209
      Raja Mani 提交于
      Below compilation warnings are observed in gcc version 4.8.2.
      Even though it's not seen in bit older gcc versions (for ex, 4.7.3),
      It's good to fix it by changing format specifier from %d to
      %zd in wmi pull phyerr functions.
      
      wmi.c: In function 'ath10k_wmi_op_pull_phyerr_ev':
      wmi.c:3567:8: warning: format '%d' expects argument of type 'int',
                    but argument 4 has type 'long unsigned int' [-Wformat=]
                    left_len, sizeof(*phyerr));
                              ^
      wmi.c: In function 'ath10k_wmi_10_4_op_pull_phyerr_ev':
      wmi.c:3612:8: warning: format '%d' expects argument of type 'int',
      	      but argument 4 has type 'long unsigned int' [-Wformat=]
                    left_len, sizeof(*phyerr));
                              ^
      Fixes: 991adf71 ("ath10k: refactor phyerr event handlers")
      Fixes: 2b0a2e0d ("ath10k: handle 10.4 firmware phyerr event")
      Signed-off-by: NRaja Mani <rmani@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      ee92a209
    • M
      ath10k: add qca6164 support · 36582e5d
      Michal Kazior 提交于
      This adds additional 0x0041 PCI Device ID
      definition to ath10k for QCA6164 which is a 1
      spatial stream sibling of the QCA6174 (which is 2
      spatial stream chip).
      
      The QCA6164 needs a dedicated board.bin file which
      is different than the one used for QCA6174. If the
      board.bin is wrong the device will crash early
      while trying to boot firmware. The register dump
      will look like this:
      
       ath10k_pci 0000:02:00.0: firmware register dump:
       ath10k_pci 0000:02:00.0: [00]: 0x05010000 0x000015B3 0x000A012D 0x00955B31
       ...
      
      Note the value 0x000A012D.
      
      Special credit goes to Alan Liu
      <alanliu@qca.qualcomm.com> for providing support
      help which enabled me to come up with this patch.
      Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      36582e5d
    • R
      ath10k: add spectral scan support for 10.4 fw · 4535edbd
      Raja Mani 提交于
      To enable/configure spectral scan parameters in 10.4 firmware, existing
      wmi spectral related functions can be reused. Link those functions in
      10.4 wmi ops table.
      
      In addition, adjust bin size (only when size is 68 bytes) before reporting
      bin samples to user space. The background for this adjustment is that
      qca99x0 reports bin size as 68 bytes (64 bytes + 4 bytes) in report
      mode 2. First 64 bytes carries in-band tones (-32 to +31) and last 4 byte
      carries band edge detection data (+32) mainly used in radar detection
      purpose. Additional last 4 bytes are stripped to make bin size valid one.
      
      This bin size adjustment will happen only for qca99x0, all other chipsets
      will report proper bin sizes (64/128) without extra 4 bytes being added
      at the end. The changes are validated in qca99x0 using 10.4 firmware.
      Signed-off-by: NRaja Mani <rmani@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      4535edbd
    • M
      ath10k: fix dma_mapping_error() handling · 5e55e3cb
      Michal Kazior 提交于
      The function returns 1 when DMA mapping fails. The
      driver would return bogus values and could
      possibly confuse itself if DMA failed.
      
      Fixes: 767d34fc ("ath10k: remove DMA mapping wrappers")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      5e55e3cb
    • M
      ath10k: add missing mutex unlock on failpath · 503422d9
      Michal Kazior 提交于
      Kernel would complain about leaving a held lock
      after going back to userspace and would
      subsequently deadlock.
      
      Fixes: e04cafbc ("ath10k: fix peer limit enforcement")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      503422d9
  8. 19 8月, 2015 2 次提交
  9. 17 8月, 2015 3 次提交
    • V
      ath10k: fill in wmi 10.4 command handlers for addba/delba debug commands · b2887410
      Vasanthakumar Thiagarajan 提交于
      WMI 10.4 uses the same command interface as QCA988X for addba/delba
      debug wmi commands. Fill wmi_10_4_ops table with the functions used
      for QCA988X for these commands.
      
      With this change, the following debugfs entries can be used to
      configure the aggregation mode and to send addba request,
      addba response and delba respectively in manual aggregation mode
      for QCA99X0 chip.
      
      /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/XX:XX:XX:XX:XX:XX/aggr_mode
      /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/XX:XX:XX:XX:XX:XX/addba
      /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/XX:XX:XX:XX:XX:XX/addba_resp
      /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/XX:XX:XX:XX:XX:XX/delba
      Signed-off-by: NVasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      b2887410
    • R
      ath10k: handle 10.4 firmware phyerr event · 2b0a2e0d
      Raja Mani 提交于
      Header format of 10.4 firmware phyerr event is not alligned
      with pre 10.4 firmware. Introduce new wmi handlers to parse
      10.4 firmware specific phyerror event header.
      
      With changes covered in this patch, radar detection works on
      qca9x0 hw 2.0 which uses 10.4 firmware.
      Signed-off-by: NRaja Mani <rmani@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      2b0a2e0d
    • R
      ath10k: refactor phyerr event handlers · 991adf71
      Raja Mani 提交于
      Existing phyerr event handlers directly uses phyerr header format
      (ie, struct wmi_phyerr and struct wmi_phyerr_event) in the code
      exactly on how firmware packs it. This is the problem in 10.4 fw
      specific phyerr event handling where it uses different phyerror
      header format. Before adding 10.4 specific handler, little bit of
      refactor is done in existing phyerr handlers.
      
      Two new abstracted structures (struct wmi_phyerr_ev_hdr_arg and
      struct wmi_phyerr_ev_arg) are introduced to remove dependency of using
      firmware specific header format in the code. So that firmware specific
      phyerror handlers can populate values to abstracted structures and
      the following code can use abstracted struct for further operation.
      
      .pull_phyerr_hdr is added newly to pull common phyerr header info
      like tsf, buf_len, number of phyerr packed. Existing .pull_phyerr
      handler is changed and called to parse every sub phyerrs in the event.
      
      Validated these refactoring on qca988x hw2.0 using fw 10.2.4 version.
      Signed-off-by: NRaja Mani <rmani@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      991adf71