1. 20 4月, 2017 3 次提交
  2. 05 4月, 2017 2 次提交
    • B
      mwifiex: catch mwifiex_fw_dpc() errors properly in reset · 755b37c9
      Brian Norris 提交于
      When resetting the device, we take a synchronous firmware-loading code
      path, which borrows a lot from the asynchronous path used at probe time.
      We don't catch errors correctly though, which means that in the PCIe
      driver, we may try to dereference the 'adapter' struct after
      mwifiex_fw_dpc() has freed it. See this (erronous) print in
      mwifiex_pcie_reset_notify():
      
      	mwifiex_dbg(adapter, INFO, "%s, successful\n", __func__);
      
      Let's instead refactor the synchronous (or "!req_fw_nowait") path so
      that we propagate errors and handle them properly.
      
      This fixes a use-after-free issue in the PCIe driver, as well as a
      misleading debug message ("successful"). It looks like the SDIO driver
      doesn't have these problems, since it doesn't do anything after
      mwifiex_reinit_sw().
      
      Fixes: 4c5dae59 ("mwifiex: add PCIe function level reset support")
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      755b37c9
    • B
      mwifiex: fix use-after-free for FW reinit errors · ce8fad9a
      Brian Norris 提交于
      If we fail to reinit the FW when resetting the device (in the
      synchronous version of mwifiex_init_hw_fw() -> mwifiex_fw_dpc()),
      mwifiex_fw_dpc() will tear down the interface and free up the adapter.
      But we don't actually check for all failure cases of mwifiex_fw_dpc(),
      so some of them fall through and dereference adapter->fw_done with a
      freed adapter, causing a use-after-free bug.
      
      In any case, mwifiex_fw_dpc() will always signal FW completion -- in the
      error OR success case -- so at best, this was repeat work. Let's not do
      it.
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      ce8fad9a
  3. 21 3月, 2017 1 次提交
  4. 16 3月, 2017 2 次提交
    • B
      mwifiex: uninit wakeup info when removing device · 36908c4e
      Brian Norris 提交于
      We manually init wakeup info, but we don't detach it on device removal.
      This means that if we (for example) rmmod + modprobe the driver, the
      device framework might return -EEXIST the second time, and we'll
      complain in the logs:
      
      [  839.311881] mwifiex_pcie 0000:01:00.0: fail to init wakeup for mwifiex
      
      AFAICT, there's no other negative effect.
      
      But we can fix this by disabling wakeup on remove, similar to what a few
      other drivers do (e.g., the power supply framework).
      
      This code (and bug) has existed on SDIO for a while, but it got moved
      around and enabled for PCIe with commit 853402a0 ("mwifiex: Enable
      WoWLAN for both sdio and pcie").
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      36908c4e
    • B
      mwifiex: set adapter->dev before starting to use mwifiex_dbg() · ba1c7e45
      Brian Norris 提交于
      The mwifiex_dbg() log handler utilizes the struct device in
      adapter->dev. Without it, it decides not to print anything.
      
      As of commit 2e02b581 ("mwifiex: Allow mwifiex early access to device
      structure"), we started assigning that pointer only after we finished
      mwifiex_register() -- this effectively neuters any mwifiex_dbg() logging
      done before this point.
      
      Let's move the device assignment into mwifiex_register().
      
      Fixes: 2e02b581 ("mwifiex: Allow mwifiex early access to device structure")
      Cc: Rajat Jain <rajatja@google.com>
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      ba1c7e45
  5. 15 2月, 2017 1 次提交
    • B
      mwifiex: don't enable/disable IRQ 0 during suspend/resume · 2447e2ca
      Brian Norris 提交于
      If we don't have an out-of-band wakeup IRQ configured through DT (as
      most platforms don't), then we fall out of this function with
      'irq_wakeup == 0'. Other code (e.g., mwifiex_disable_wake() and
      mwifiex_enable_wake()) treats 'irq_wakeup >= 0' as a valid IRQ, and so
      we end up calling {enable,disable}_irq() on IRQ 0.
      
      That seems bad, so let's not do that.
      
      Same problem as fixed in this patch:
      
      https://patchwork.kernel.org/patch/9531693/
      [PATCH v2 2/3] btmrvl: set irq_bt to -1 when failed to parse it
      
      with the difference that:
      (a) this one is actually a regression and
      (b) this affects both device tree and non-device-tree systems
      
      While fixing the regression, also drop the verbosity on the parse
      failure, so we don't see this when a DT node is present but doesn't have
      an interrupt property (this is perfectly legal):
      
      [   21.999000] mwifiex_pcie 0000:01:00.0: fail to parse irq_wakeup from device tree
      
      Fixes: 853402a0 ("mwifiex: Enable WoWLAN for both sdio and pcie")
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Acked-by: NRajat Jain <rajatja@google.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      2447e2ca
  6. 12 1月, 2017 4 次提交
  7. 29 11月, 2016 1 次提交
  8. 19 11月, 2016 5 次提交
  9. 17 9月, 2016 1 次提交
  10. 09 9月, 2016 2 次提交
  11. 03 9月, 2016 1 次提交
  12. 06 7月, 2016 1 次提交
    • A
      nl80211: support beacon report scanning · 1d76250b
      Avraham Stern 提交于
      Beacon report radio measurement requires reporting observed BSSs
      on the channels specified in the beacon request. If the measurement
      mode is set to passive or active, it requires actually performing a
      scan (passive or active, accordingly), and reporting the time that
      the scan was started and the time each beacon/probe was received
      (both in terms of TSF of the BSS of the requesting AP). If the
      request mode is table, this information is optional.
      In addition, the radio measurement request specifies the channel
      dwell time for the measurement.
      
      In order to use scan for beacon report when the mode is active or
      passive, add a parameter to scan request that specifies the
      channel dwell time, and add scan start time and beacon received time
      to scan results information.
      
      Supporting beacon report is required for Multi Band Operation (MBO).
      Signed-off-by: NAssaf Krauss <assaf.krauss@intel.com>
      Signed-off-by: NDavid Spinadel <david.spinadel@intel.com>
      Signed-off-by: NAvraham Stern <avraham.stern@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1d76250b
  13. 18 6月, 2016 1 次提交
    • A
      mwifiex: fix link error against sdio · 2095b142
      Arnd Bergmann 提交于
      Calling sdio_claim_host() from the interface independent part of
      the mwifiex driver is not only a layering violation, but also causes
      a link error if MMC support is disabled, or if CONFIG_MMC=m
      and CONFIG_MWIFIEX=y:
      
      drivers/net/built-in.o: In function `mwifiex_fw_dpc':
      :(.text+0xff138): undefined reference to `sdio_claim_host'
      :(.text+0xff158): undefined reference to `sdio_release_host'
      
      The right way to do this is to have the sdio specific code in the
      sdio driver front-end, and we already have a callback pointer that
      we can use for this after exporting the generic fw download
      function from the core driver.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 65c71efe ("mwifiex: fix racing condition when downloading firmware")
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      2095b142
  14. 14 6月, 2016 1 次提交
    • W
      mwifiex: fix racing condition when downloading firmware · 65c71efe
      Wei-Ning Huang 提交于
      The action 'check for winner' and 'download firmware' should be an
      atomic action. This is true for btmrvl driver but not mwmfiex, which
      cause firmware download to fail when the following senerio happens:
      
      1) mwifiex check winner status: true
      2) btmrvl check winner status: true, and start downloading firmware
      3) mwfieix tries to download firmware, but failed because btmrvl is
      already downloading.
      
      This won't happen if 1) and 3) is an atomic action. This patch adds
      sdio_claim/release_host call around those two actions to make sure it's
      atomic.
      Signed-off-by: NWei-Ning Huang <wnhuang@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      65c71efe
  15. 26 4月, 2016 1 次提交
  16. 14 4月, 2016 1 次提交
  17. 08 4月, 2016 1 次提交
  18. 29 1月, 2016 2 次提交
  19. 07 1月, 2016 1 次提交
    • A
      mwifiex: reduce cloned skb queue size · ee548d4b
      Amitkumar Karwar 提交于
      Driver supports Tx status ack feature. When hostapd/
      wpa_supplicant asks for ack status of an EAPOL/ACTION
      frame, driver maintains a cloned skb for the packet
      until TX_STATUS event is received from firmware.
      
      Cloned skb queue gets flushed when connection is terminated
      or driver is unloaded.
      
      Let's reduce the queue size to avoid unnecessarily
      keeping memory allocated when environment is busy.
      Signed-off-by: NAmitkumar Karwar <akarwar@marvell.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      ee548d4b
  20. 18 11月, 2015 1 次提交
  21. 14 10月, 2015 1 次提交
  22. 29 9月, 2015 3 次提交
  23. 21 7月, 2015 2 次提交
  24. 03 6月, 2015 1 次提交
    • A
      mwifiex: device dump support via devcoredump framework · 57670ee8
      Amitkumar Karwar 提交于
      Currently device dump generated in the driver is retrieved
      using ethtool set/get dump commands. We will get rid of
      ethtool approach and use devcoredump framework.
      
      Device dump can be trigger by
      cat /debugfs/mwifiex/mlanX/device_dump
      and when the dump operation is completed, data can be read by
      cat /sys/class/devcoredump/devcdX/data
      
      We have prepared following script to split device dump data
      into multiple files.
      
       [root]# cat mwifiex_split_dump_data.sh
       #!/bin/bash
       # usage: ./mwifiex_split_dump_data.sh dump_data
      
       fw_dump_data=$1
      
       mem_type="driverinfo ITCM DTCM SQRAM APU CIU ICU MAC"
      
       for name in ${mem_type[@]}
       do
           sed -n "/Start dump $name/,/End dump/p" $fw_dump_data  > tmp.$name.log
           if [ ! -s tmp.$name.log ]
           then
               rm -rf tmp.$name.log
           else
               #Remove the describle info "Start dump" and "End dump"
               sed '1d' tmp.$name.log | sed '$d' > /data/$name.log
               if [ -s /data/$name.log ]
               then
                   echo "generate /data/$name.log"
               else
                   sed '1d' tmp.$name.log | sed '$d' > /var/$name.log
                   echo "generate /var/$name.log"
               fi
               rm -rf tmp.$name.log
           fi
       done
      Signed-off-by: NAmitkumar Karwar <akarwar@marvell.com>
      Signed-off-by: NCathy Luo <cluo@marvell.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      57670ee8