1. 27 9月, 2016 2 次提交
  2. 13 9月, 2016 3 次提交
  3. 09 9月, 2016 1 次提交
    • R
      ath10k: implement NAPI support · 3c97f5de
      Rajkumar Manoharan 提交于
      Add NAPI support for rx and tx completion. NAPI poll is scheduled
      from interrupt handler. The design is as below
      
       - on interrupt
           - schedule napi and mask interrupts
       - on poll
         - process all pipes (no actual Tx/Rx)
         - process Rx within budget
         - if quota exceeds budget reschedule napi poll by returning budget
         - process Tx completions and update budget if necessary
         - process Tx fetch indications (pull-push)
         - push any other pending Tx (if possible)
         - before resched or napi completion replenish htt rx ring buffer
         - if work done < budget, complete napi poll and unmask interrupts
      
      This change also get rid of two tasklets (intr_tq and txrx_compl_task).
      
      Measured peak throughput with NAPI on IPQ4019 platform in controlled
      environment. No noticeable reduction in throughput is seen and also
      observed improvements in CPU usage. Approx. 15% CPU usage got reduced
      in UDP uplink case.
      
      DL: AP DUT Tx
      UL: AP DUT Rx
      
      IPQ4019 (avg. cpu usage %)
      
      ========
                      TOT              +NAPI
                    ===========      =============
      TCP DL       644 Mbps (42%)    645 Mbps (36%)
      TCP UL       673 Mbps (30%)    675 Mbps (26%)
      UDP DL       682 Mbps (49%)    680 Mbps (49%)
      UDP UL       720 Mbps (28%)    717 Mbps (11%)
      Signed-off-by: NRajkumar Manoharan <rmanohar@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      3c97f5de
  4. 02 9月, 2016 4 次提交
    • M
      ath10k: Fix broken NULL func data frame status for 10.4 · 2cdce425
      Mohammed Shafi Shajakhan 提交于
      Older firmware with HTT delivers incorrect tx status for null func
      frames to driver, but this fixed in 10.2 and 10.4 firmware versions.
      Also this workaround results in reporting of incorrect null func status
      for 10.4. Fix this is by introducing a firmware feature flag for 10.4
      so that this workaround is skipped and proper tx status for null func
      frames are reported
      Signed-off-by: NTamizh chelvam <c_traja@qti.qualcomm.com>
      Signed-off-by: NMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      2cdce425
    • D
      ath10k: use complete() instead complete_all() · 881ed54e
      Daniel Wagner 提交于
      There is only one waiter for the completion, therefore there
      is no need to use complete_all(). Let's make that clear by
      using complete() instead of complete_all().
      
      The usage pattern of the completion is:
      
      waiter context                          waker context
      
      scan.started
      ------------
      
      ath10k_start_scan()
        lockdep_assert_held(conf_mutex)
        auth10k_wmi_start_scan()
        wait_for_completion_timeout(scan.started)
      
      					ath10k_wmi_event_scan_start_failed()
      					  complete(scan.started)
      
      					ath10k_wmi_event_scan_started()
      					  complete(scan.started)
      
      scan.completed
      --------------
      
      ath10k_scan_stop()
        lockdep_assert_held(conf_mutex)
        ath10k_wmi_stop_scan()
        wait_for_completion_timeout(scan.completed)
      
      					__ath10k_scan_finish()
      					  complete(scan.completed)
      
      scan.on_channel
      ---------------
      
      ath10k_remain_on_channel()
        mutex_lock(conf_mutex)
        ath10k_start_scan()
        wait_for_completion_timeout(scan.on_channel)
      
      					ath10k_wmi_event_scan_foreign_chan()
      					  complete(scan.on_channel)
      
      offchan_tx_completed
      --------------------
      
      ath10k_offchan_tx_work()
        mutex_lock(conf_mutex)
        reinit_completion(offchan_tx_completed)
        wait_for_completion_timeout(offchan_tx_completed)
      
      					ath10k_report_offchain_tx()
      					  complete(offchan_tx_completed)
      
      install_key_done
      ----------------
      ath10k_install_key()
        lockep_assert_held(conf_mutex)
        reinit_completion(install_key_done)
        wait_for_completion_timeout(install_key_done)
      
      				        ath10k_htt_t2h_msg_handler()
      					  complete(install_key_done)
      
      vdev_setup_done
      ---------------
      
      ath10k_monitor_vdev_start()
        lockdep_assert_held(conf_mutex)
         reinit_completion(vdev_setup_done)
        ath10k_vdev_setup_sync()
          wait_for_completion_timeout(vdev_setup_done)
      
      					ath10k_wmi_event_vdev_start_resp()
      					  complete(vdev_setup_done)
      
      ath10k_monitor_vdev_stop()
        lockdep_assert_held(conf_mutex)
        reinit_completion(vdev_setup_done()
        ath10k_vdev_setup_sync()
          wait_for_completion_timeout(vdev_setup_done)
      
      					ath10k_wmi_event_vdev_stopped()
      					 complete(vdev_setup_done)
      
      thermal.wmi_sync
      ----------------
      ath10k_thermal_show_temp()
        mutex_lock(conf_mutex)
        reinit_completion(thermal.wmi_sync)
        wait_for_completion_timeout(thermal.wmi_sync)
      
      					ath10k_thermal_event_temperature()
      					  complete(thermal.wmi_sync)
      
      bss_survey_done
      ---------------
      ath10k_mac_update_bss_chan_survey
        lockdep_assert_held(conf_mutex)
        reinit_completion(bss_survey_done)
        wait_for_completion_timeout(bss_survey_done)
      
      					ath10k_wmi_event_pdev_bss_chan_info()
      					  complete(bss_survey_done)
      
      All complete() calls happen while the conf_mutex is taken. That means
      at max one waiter is possible.
      Signed-off-by: NDaniel Wagner <daniel.wagner@bmw-carit.de>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      881ed54e
    • R
      ath10k: fix group privacy action frame decryption for qca4019 · 7d42298e
      Rajkumar Manoharan 提交于
      Recent commit 46f6b060 ("mac80211: Encrypt "Group addressed privacy" action
      frames") encrypts group privacy action frames. But qca99x0 family chipset
      delivers broadcast/multicast management frames as encrypted and it should be
      decrypted by mac80211. Setting RX_FLAG_DECRYPTED stats for those frames is
      breaking mesh connection establishment.
      Signed-off-by: NRajkumar Manoharan <rmanohar@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      7d42298e
    • M
      ath10k: hide kernel addresses from logs using %pK format specifier · 75b34800
      Maharaja Kennadyrajan 提交于
      With the %pK format specifier we hide the kernel addresses
      with the help of kptr_restrict sysctl.
      In this patch, %p is changed to %pK in the driver code.
      
      The sysctl is documented in Documentation/sysctl/kernel.txt.
      Signed-off-by: NMaharaja Kennadyrajan <c_mkenna@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      75b34800
  5. 31 8月, 2016 2 次提交
    • M
      ath10k: fix spurious tx/rx during boot · 47b1848d
      Michal Kazior 提交于
      HW Rx filters and masks are not configured
      properly by firmware during boot sequences. The
      MAC_PCU_ADDR1 is set to 0s instead of 1s which
      allows the HW to ACK any frame that passes through
      MAC_PCU_RX_FILTER. The MAC_PCU_RX_FILTER itself
      is misconfigured on boot as well.
      
      The combination of these bugs ended up with the
      following manifestations:
       - "no channel configured; ignoring frame(s)!"
         warnings in the driver
       - spurious ACKs (transmission) on the air during
         firmware bootup sequences
      
      The former was a long standing and known bug
      originally though mostly harmless.
      
      However Marek recently discovered that this
      problem also involves ACKing *all* frames the HW
      receives (including beacons ;). Such frames
      are delivered to host and generate the former
      warning as well.
      
      This could be a problem with regulatory compliance
      in some rare cases (e.g. Taiwan which forbids
      transmissions on channel 36 which is the default
      bootup channel on 5Ghz band cards). The good news
      is that it'd require someone else to violate
      regulatory first to coerce our device to generate
      and transmit an ACK.
      
      The problem could be reproduced in a rather busy
      environment that has a lot of APs. The likelihood
      could be increased by injecting an msleep() of
      5000 or longer immediately after
      ath10k_htt_setup() in ath10k_core_start().
      
      The reason why the former warnings were only
      showing up seldom is because the device was either
      quickly reset again (i.e. during firmware probing)
      or wmi vdev was created (which fixes hw and fw
      states).
      
      It is technically possible for host driver to
      override adequate hw registers however this can't
      work reliably because the bug root cause lies in
      incorrect firmware state on boot (internal
      structure used to program MAC_PCU_ADDR1 is not
      properly initialized) and only vdev create/delete
      events can fix it. This is why the patch takes
      dummy vdev approach.
      
      This could be fixed in firmware as well but having
      this fixed in driver is more robust, most notably
      when thinking of users of older firmware such as
      999.999.0.636.
      Reported-by: NMarek Puzyniak <marek.puzyniak@tieto.com>
      Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      47b1848d
    • T
      ath10k: move firmware_swap_code_seg_info to ath10k_fw_file · 5459c5d4
      Tamizh chelvam 提交于
      Preparation to make use of firmware_swap_code_seg_info for UTF binary.
      Signed-off-by: NTamizh chelvam <c_traja@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      5459c5d4
  6. 08 7月, 2016 2 次提交
  7. 14 6月, 2016 3 次提交
    • V
      ath10k: fix cycle counter wraparound handling for QCA4019 · 8e100354
      Vasanthakumar Thiagarajan 提交于
      In QCA4019, cycle counter wraparound is not tied to rx
      clear counter. Each counter would wraparound individually
      and after wraparound the respective counter will be reset
      to 0x7fffffff while other counter still running unaffected.
      Define a new wraparound type for this behaviour and handle
      it separately so that rx clear counter wraparound is also
      handled just like cycle counter. With this type of
      wraparound we can accurately compute and report channel
      active/busy time when any of the counter overflows.
      
      Fixes: ee9ca147 ("ath10k: Fix survey reporting with QCA4019")
      Signed-off-by: NVasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      8e100354
    • V
      ath10k: define an enum to enable cycle counter wraparound logic · 26c19760
      Vasanthakumar Thiagarajan 提交于
      QCA988X hw implements a different cycle counter wraparound
      behaviour when compared to QCA4019. To properly handle different
      wraparound logic for these chipsets replace already available
      bool hw_params member, has_shifted_cc_wraparound, with an
      enum which could be extended to handle different wraparound
      behaviour. This patch keeps the existing logic functionally
      same and a prepares cycle counter wraparound handling to
      extend for other chips.
      Signed-off-by: NVasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
      [kvalo@qca.qualcomm.com: change also QCA9887 wrap type]
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      26c19760
    • M
      ath10k: fix CCK h/w rates for QCA99X0 and newer chipsets · 5269c659
      Mohammed Shafi Shajakhan 提交于
      CCK hardware table mapping from QCA99X0 onwards got revised.
      The CCK hardware rate values are in a proper order wrt. to
      rate and preamble as below
      
      ATH10K_HW_RATE_REV2_CCK_LP_1M = 1,
      ATH10K_HW_RATE_REV2_CCK_LP_2M = 2,
      ATH10K_HW_RATE_REV2_CCK_LP_5_5M = 3,
      ATH10K_HW_RATE_REV2_CCK_LP_11M = 4,
      ATH10K_HW_RATE_REV2_CCK_SP_2M = 5,
      ATH10K_HW_RATE_REV2_CCK_SP_5_5M = 6,
      ATH10K_HW_RATE_REV2_CCK_SP_11M = 7,
      
      This results in reporting of rx frames (with CCK rates)
      totally wrong for QCA99X0, QCA4019. Fix this by having
      separate CCK rate table for these chipsets with rev2 suffix
      and registering the correct rate mapping to mac80211 based on
      the new hw_param (introduced) 'cck_rate_map_rev2' which shall
      be true for any newchipsets from QCA99X0 onwards
      Signed-off-by: NMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      5269c659
  8. 07 6月, 2016 3 次提交
  9. 02 6月, 2016 3 次提交
  10. 25 5月, 2016 1 次提交
  11. 12 5月, 2016 1 次提交
  12. 06 5月, 2016 3 次提交
    • R
      ath10k: release pre_cal_file while unloading driver · 9a5f91a1
      Rajkumar Manoharan 提交于
      Failing to release pre_cal_file caldata on deinit causes memory leak.
      
      Fixes: b131129d ("ath10k: fix calibration init sequence of qca99x0")
      Signed-off-by: NRajkumar Manoharan <rmanohar@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      9a5f91a1
    • R
      ath10k: update bss channel survey information · fa7937e3
      Rajkumar Manoharan 提交于
      During hw scan, firmware sends two channel information events (pre-
      complete, complete) to host for each channel change. The snap shot of cycle
      counters (rx_clear and total) between these two events are given for
      survey dump. In order to get latest survey statistics of all channels, a
      scan request has to be issued. In general, an AP DUT is brought up, it
      won't leave BSS channel except few cases like overlapping bss or radar
      detection. So survey statistics of bss channel is always referring to
      older data that are collected before starting AP (either ACS/OBSS scan).
      
      To collect latest survey information from target, firmware provides WMI
      interface to read cycle counters from hardware. For each survey dump
      request, BSS channel cycle counters are read and cleared in hardware.
      This makes sure that behavior is in align with ath9k survey report.
      So survey dump always gives snap shot of cycle counters b/w two survey
      requests.
      Signed-off-by: NYanbo Li <yanbol@qca.qualcomm.com>
      Signed-off-by: NRajkumar Manoharan <rmanohar@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      fa7937e3
    • A
      ath10k: fix kernel panic, move arvifs list head init before htt init · 4ad24a9d
      Anilkumar Kolli 提交于
      It is observed that while loading and unloading ath10k modules
      in an infinite loop, before ath10k_core_start() completion HTT
      rx frames are received, while processing these frames,
      dereferencing the arvifs list code is getting hit before
      initilizing the arvifs list, causing a kernel panic.
      
      This patch initilizes the arvifs list before initilizing htt.
      
      Fixes the below issue:
       [<bf88b058>] (ath10k_htt_rx_pktlog_completion_handler+0x278/0xd08 [ath10k_core])
       [<bf88b058>] (ath10k_htt_rx_pktlog_completion_handler [ath10k_core])
       [<bf88c0dc>] (ath10k_htt_txrx_compl_task+0x5f4/0xeb0 [ath10k_core])
       [<bf88c0dc>] (ath10k_htt_txrx_compl_task [ath10k_core])
       [<c0234100>] (tasklet_action+0x8c/0xec)
       [<c0234100>] (tasklet_action)
       [<c02337c0>] (__do_softirq+0xf8/0x228)
       [<c02337c0>] (__do_softirq)  [<c0233920>] (run_ksoftirqd+0x30/0x90)
       Code: e5954ad8 e2899008 e1540009 0a00000d (e5943008)
       ---[ end trace 71de5c2e011dbf56 ]---
       Kernel panic - not syncing: Fatal exception in interrupt
      
      Fixes: 500ff9f9 ("ath10k: implement chanctx API")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAnilkumar Kolli <akolli@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      4ad24a9d
  13. 21 4月, 2016 8 次提交
  14. 19 4月, 2016 1 次提交
    • R
      ath10k: add dynamic tx mode switch config support for qca4019 · 7e247a9e
      Raja Mani 提交于
      push-pull mode needs certain amount the host driver involvement for
      managing queues in the host memory and packet delivery to firmware.
      qca4019 wifi firmware has an option to stay in push mode for less
      number of active traffic flow and then switch to push-pull mode when
      the active traffic flow goes beyond the certain limit.
      
      The advantage of staying in push mode for less active traffic is, the
      host cpu consumption is reduced. qca4019 firmware supports this
      flexibility of the mode switch. It takes the host driver interest
      (LOW_PERF/HIGH_PERF) via WMI_EXT_RESOURCE_CFG_CMDID,
      
       LOW_PERF  - fw would stay in push mode and switch to push-pull
                     based on demand.
       HIGH_PERF - fw would stay in push-pull mode from the boot.
      
      To make this configuration generic, new WMI services
      WMI_SERVICE_TX_MODE_PUSH_ONLY, WMI_SERVICE_TX_MODE_PUSH_PULL,
      WMI_SERVICE_TX_MODE_DYNAMIC are introduced to take dynamic tx mode
      switch support availability in firmware.
      Based on WMI_SERVICE_TX_MODE_DYNAMIC, LOW_PERF or HIGHT_PERF is
      configured to the firmware.
      Signed-off-by: NRaja Mani <rmani@qti.qualcomm.com>
      Signed-off-by: NTamizh chelvam <c_traja@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      7e247a9e
  15. 04 4月, 2016 1 次提交
  16. 23 3月, 2016 2 次提交
    • M
      ath10k: enable debugfs provision to enable Peer Stats feature · cc61a1bb
      Mohammed Shafi Shajakhan 提交于
      Provide a debugfs entry to enable/ disable Peer Stats feature.
      Peer Stats feature is for developers/users who are more interested
      in studying in Rx/Tx stats with multiple clients connected, hence
      disable this by default. Enabling this feature by default results
      in unneccessary processing of Peer Stats event for every 500ms
      and updating peer_stats list (allocating memory) and cleaning it up
      ifexceeds the higher limit and this can be an unnecessary overhead
      during long run stress testing.
      Signed-off-by: NMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      cc61a1bb
    • R
      ath10k: incorporate qca4019 cal data download sequence · 3d9195ea
      Raja Mani 提交于
      qca4019 calibration data is stored in the host memory and it's mandatory
      to download it even before reading board id and chip id from the target.
      Also, there is a need to execute otp (download and run) twice, one after
      cal data download and another one after board data download.
      
      Existing cal data file name 'cal-<bus>-<id>.bin' and device tree entry
      'qcom,ath10k-calibration-data' used in ath10k has assumption that it
      carries other data (like board data) also along with the calibration data.
      But, qca4019 cal data contains pure calibration data (doesn't include
      any other info). So, using existing same cal file name and DT entry
      in qca4019 case would alter the purpose of it. To avoid this, new cal
      file name 'pre-cal-<bus>-<id>.bin' and new device tree entry name
      'qcom,ath10k-pre-calibration-data are introduced.
      
      Overall qca4019's firmware download sequence would look like,
      
         1) Download cal data (either from a file or device tree entry)
            at the address specified by target in the host interest area
            member "hi_board_data".
      
         2) Download otp and run with 0x10 (PARAM_GET_EEPROM_BOARD_ID)
            as a argument.
      
            At this point, otp will take back up of downloaded cal data
            content in another location in the target and return valid
            board id and chip id to the host.
      
         3) Download board data at the address specified by target
            in host interest area member "hi_board_data".
      
         4) Download otp and run with 0x10000 (PARAM_FLASH_SECTION_ALL) as
            a argument.
      
            Now otp will apply cal data content from it's backup on top
            of board data download in step 3 and prepare final data base.
      
         5) Download code swap and athwlan binary content.
      
      Above sequences are implemented (step 1 to step 4) in the name of
      pre calibration configuration.
      Signed-off-by: NRaja Mani <rmani@qti.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      3d9195ea