1. 14 Jun, 2018 11 commits
  2. 13 Jun, 2018 6 commits
  3. 25 May, 2018 23 commits
    • Eyal Ilsar's avatar
      wcn36xx: Add support for Factory Test Mode (FTM) · 87f825e6
      Eyal Ilsar authored
      Introduce infrastructure for supporting Factory Test Mode (FTM) of the
      wireless LAN subsystem. In order for the user space to access the
      firmware in test mode the relevant netlink channel needs to be exposed
      from the kernel driver.
      
      The above is achieved as follows:
      1) Register wcn36xx driver to testmode callback from netlink
      2) Add testmode callback implementation to handle incoming FTM commands
      3) Add FTM command packet structure
      4) Add handling for GET_BUILD_RELEASE_NUMBER (msgid=0x32A2)
      5) Add generic handling for all PTT_MSG packets
      Signed-off-by: default avatarEyal Ilsar <eilsar@codeaurora.org>
      Signed-off-by: default avatarRamon Fried <ramon.fried@linaro.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      87f825e6
    • Sriram R's avatar
      ath10k: DFS Host Confirmation · 6f6eb1bc
      Sriram R authored
      In the 10.4-3.6 firmware branch there's a new DFS Host confirmation
      feature which is advertised using WMI_SERVICE_HOST_DFS_CHECK_SUPPORT flag.
      
      This new features enables the ath10k host to send information to the
      firmware on the specifications of detected radar type. This allows the
      firmware to validate if the host's radar pattern detector unit is
      operational and check if the radar information shared by host matches
      the radar pulses sent as phy error events from firmware. If the check
      fails the firmware won't allow use of DFS channels on AP mode when using
      FCC regulatory region.
      
      Hence this patch is mandatory when using a firmware from 10.4-3.6 branch.
      Else, DFS channels on FCC regions cannot be used.
      
      Supported Chipsets : QCA9984/QCA9888/QCA4019
      Firmware Version : 10.4-3.6-00104
      Signed-off-by: default avatarSriram R <srirrama@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      6f6eb1bc
    • Sriram R's avatar
      ath: add support to get the detected radar specifications · f40105e6
      Sriram R authored
      This enables ath10k/ath9k drivers to collect the specifications of the
      radar type once it is detected by the dfs pattern detector unit.
      Usage of the collected info is specific to driver implementation.
      For example, collected radar info could be used by the host driver
      to send to co-processors for additional processing/validation.
      
      Note: 'radar_detector_specs' data containing the specifications of
      different radar types which was private within dfs_pattern_detector/
      dfs_pri_detector is now shared with drivers as well for making use
      of this information.
      Signed-off-by: default avatarSriram R <srirrama@codeaurora.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      f40105e6
    • Daniel Mack's avatar
      wcn36xx: improve debug and error messages for SMD · ffbc9197
      Daniel Mack authored
      Add a missing newline in wcn36xx_smd_send_and_wait() and also log the
      command request and response type that was processed.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      ffbc9197
    • Daniel Mack's avatar
      wcn36xx: simplify wcn36xx_smd_open() · a50c6c84
      Daniel Mack authored
      Drop the extra warning about failed allocations, both the core and the
      only caller of this function will warn loud enough in such cases.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      a50c6c84
    • Daniel Mack's avatar
      wcn36xx: drain pending indicator messages on shutdown · 773f9a28
      Daniel Mack authored
      When the interface is shut down, wcn36xx_smd_close() potentially races
      against the queue worker. Make sure to cancel the work, and then free all
      the remnants in hal_ind_queue manually.
      
      This is again just a theoretical issue, not something that was triggered in
      the wild.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      773f9a28
    • Daniel Mack's avatar
      wcn36xx: set PREASSOC and IDLE stated when BSS info changes · 2a46c829
      Daniel Mack authored
      When a BSSID is joined, set the link status to 'preassoc', and set it to
      'idle' when the BSS is deleted.
      
      This is what the downstream driver is doing, and it seems to improve the
      reliability during connect/disconnect stress tests.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      2a46c829
    • Daniel Mack's avatar
      wcn36xx: consider CTRL_EOP bit when looking for valid descriptors · 18c7ed13
      Daniel Mack authored
      In reap_tx_dxes(), when we iterate over the linked descriptors, only
      consider such valid that have WCN36xx_DXE_CTRL_EOP set.
      
      This is what the prima downstream driver is doing as well.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      18c7ed13
    • Daniel Mack's avatar
      wcn36xx: only handle packets when ED or DONE bit is set · ce1d4be8
      Daniel Mack authored
      On RX and TX interrupts, check for the WCN36XX_CH_STAT_INT_ED_MASK or
      WCN36XX_CH_STAT_INT_DONE_MASK in the interrupt reason register, and
      only handle packets when it is set. This way, reap_tx_dxes() is only
      invoked when needed.
      
      This brings the dequeing logic in line with what the prima downstream
      driver is doing.
      
      While at it, also log the interrupt reason.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      ce1d4be8
    • Daniel Mack's avatar
      wcn36xx: clear all masks in RX interrupt · edd23ab4
      Daniel Mack authored
      Like on the TX side, check for the interrupt reason when the RX interrupt
      is latched and clear the ERR, DONE and ED masks.
      
      This seems to help with connection timeouts and network stream
      starvatations. And FWIW, the downstream driver does the same thing.
      
      Note that in analogy to the TX side, WCN36XX_DXE_0_INT_CLR should be set to
      WCN36XX_INT_MASK_CHAN_RX_{L,H} rather than WCN36XX_DXE_INT_CH{1,3}_MASK. It
      did the right thing however, as the defines happen to have identical values.
      
      Also, instead of determining register addresses and values inside
      wcn36xx_rx_handle_packets(), pass them as arguments.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      edd23ab4
    • Daniel Mack's avatar
      wcn36xx: don't disable RX IRQ from handler · ba437e72
      Daniel Mack authored
      There's no need to disable the IRQ from inside its handler.
      Instead just grab the spinlock of the channel that is being processed.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      ba437e72
    • Daniel Mack's avatar
      wcn36xx: set DMA mask explicitly · 57e06e0e
      Daniel Mack authored
      The device takes 32-bit addresses only, so inform the DMA API about it.
      This is the default on msm8016, so that doesn't change anything, but
      it's best practice to be explicit.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      57e06e0e
    • Daniel Mack's avatar
      wcn36xx: fix buffer commit logic on TX path · 9a81cc23
      Daniel Mack authored
      When wcn36xx_dxe_tx_frame() is entered while the device is still processing
      the queue asyncronously, we are racing against the firmware code with
      updates to the buffer descriptors. Presumably, the firmware scans the ring
      buffer that holds the descriptors and scans for a valid control descriptor,
      and then assumes that the next descriptor contains the payload. If, however,
      the control descriptor is marked valid, but the payload descriptor isn't,
      the packet is not sent out.
      
      Another issue with the current code is that is lacks memory barriers before
      descriptors are marked valid. This is important because the CPU may reorder
      writes to memory, even if it is allocated as coherent DMA area, and hence
      the device may see incompletely written data.
      
      To fix this, the code in wcn36xx_dxe_tx_frame() was restructured a bit so
      that the payload descriptor is made valid before the control descriptor.
      Memory barriers are added to ensure coherency of shared memory areas.
      Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      9a81cc23
    • YueHaibing's avatar
      ath10k: remove useless test before clk_disable_unprepare · cf3c0ae6
      YueHaibing authored
      clk_disable_unprepare() already checks that the clock pointer is valid.
      No need to test it before calling it.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      cf3c0ae6
    • Sven Eckelmann's avatar
      ath: Map Zimbabwe to ETSI1_WORLD · f1abff21
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      The CTL mappings for this regdomain code were now changed to:
      
      * 2.4GHz: ETSI
      * 5GHz: NO_CTL -> ETSI
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      f1abff21
    • Sven Eckelmann's avatar
      ath: Map Ukraine to ETSI9_WORLD · 4e78075c
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      The CTL mappings for this regdomain code were now changed to:
      
      * 2.4GHz: ETSI
      * 5GHz: NO_CTL -> ETSI
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4e78075c
    • Sven Eckelmann's avatar
      ath: Map Singapore to FCC3_WORLD · 054e0778
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      The CTL mappings for this regdomain code were now changed to:
      
      * 2.4GHz: ETSI
      * 5GHz: ETSI -> FCC
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      054e0778
    • Sven Eckelmann's avatar
      ath: Map Russia to ETSI8_WORLD · b7e01513
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      The CTL mappings for this regdomain code were now changed to:
      
      * 2.4GHz: ETSI
      * 5GHz: NO_CTL -> ETSI
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      b7e01513
    • Sven Eckelmann's avatar
      ath: Map Romania to ETSI1_WORLD · 12f41556
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      The CTL mappings for this regdomain code were now changed to:
      
      * 2.4GHz: ETSI
      * 5GHz: NO_CTL -> ETSI
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      12f41556
    • Sven Eckelmann's avatar
      ath: Map Philippines to FCC3_WORLD · c454d4c2
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      This change itself doesn't change the selected CTL of this country and is
      only required to stay in sync with the QCA mappings.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      c454d4c2
    • Sven Eckelmann's avatar
      ath: Map Peru to APL1_WORLD · b5c11e47
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      This change itself doesn't change the selected CTL of this country and is
      only required to stay in sync with the QCA mappings.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      b5c11e47
    • Sven Eckelmann's avatar
      ath: Map New Zealand to FCC3_ETSIC · 9bfc2bb3
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      This change itself doesn't change the selected CTL of this country and is
      only required to stay in sync with the QCA mappings.
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      9bfc2bb3
    • Sven Eckelmann's avatar
      ath: Map Malasia to FCC1_WORLD · 823a6406
      Sven Eckelmann authored
      The regdomain code is used to select the correct the correct conformance
      test limits (CTL) for a country. If the regdomain code isn't correctly
      mapped to the actual CTL entries in EEPROM then it could happen that the
      device violates the regulations. But it can also happen that the device is
      then not able to be used with its full txpower on all rates.
      
      The CTL mappings for this regdomain code were now changed to:
      
      * 2.4GHz: ETSI
      * 5GHz: ETSI -> FCC
      Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@openmesh.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      823a6406