1. 22 3月, 2019 1 次提交
    • J
      iwlwifi: mvm: fix TX crypto on 22560+ devices · 475c6bde
      Johannes Berg 提交于
      In the old days, we could transmit with HW crypto with an arbitrary
      key by filling it into TX_CMD. This was broken first with the advent
      of CCMP/GCMP-256 keys which don't fit there.
      
      This was broken *again* with the newer TX_CMD format on 22560+,
      where we simply cannot pass key material anymore. However, we forgot
      to update all the cases when we get a key from mac80211 and don't
      program it into the hardware but still return 0 for HW crypto on TX.
      
      In AP mode with WEP, we tried to fix this by programming the keys
      separately for each station later, but this ultimately turns out to
      be buggy, for example now it leaks memory when we have more than one
      WEP key.
      
      Fix this by simply using only SW crypto for WEP in newer devices by
      returning -EOPNOTSUPP instead of trying to program WEP keys later.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      475c6bde
  2. 19 3月, 2019 5 次提交
    • S
      mt76x02: do not enable RTS/CTS by default · 7dfc45e6
      Stanislaw Gruszka 提交于
      My commit 26a7b547 ("mt76x02: set protection according to ht
      operation element") enabled by default RTS/CTS protection for OFDM
      and CCK traffic, because MT_TX_RTS_CFG_THRESH is configured to non
      0xffff by initvals and .set_rts_threshold callback is not called by
      mac80211 on initialization, only on user request or during
      ieee80211_reconfig() (suspend/resuem or restart_hw).
      
      Enabling RTS/CTS cause some problems when sending probe request
      frames by hcxdumptool penetration tool, but I expect it can cause
      other issues on different scenarios.
      
      Restore previous setting of RTS/CTS being disabled by default for
      OFDM/CCK by changing MT_TX_RTS_CFG_THRESH initvals to 0xffff.
      
      Fixes: 26a7b547 ("mt76x02: set protection according to ht operation element")
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      7dfc45e6
    • L
      mt76: fix schedule while atomic in mt76x02_reset_state · 13f61dfc
      Lorenzo Bianconi 提交于
      Fix following schedule while atomic in mt76x02_reset_state
      since synchronize_rcu is run inside a RCU section
      
      [44036.944222] mt76x2e 0000:06:00.0: MCU message 31 (seq 3) timed out
      [44036.944281] BUG: sleeping function called from invalid context at kernel/rcu/tree_exp.h:818
      [44036.944284] in_atomic(): 1, irqs_disabled(): 0, pid: 28066, name: kworker/u4:1
      [44036.944287] INFO: lockdep is turned off.
      [44036.944292] CPU: 1 PID: 28066 Comm: kworker/u4:1 Tainted: G        W         5.0.0-rc7-wdn-t1+ #7
      [44036.944294] Hardware name: Dell Inc. Studio XPS 1340/0K183D, BIOS A11 09/08/2009
      [44036.944305] Workqueue: phy1 mt76x02_wdt_work [mt76x02_lib]
      [44036.944308] Call Trace:
      [44036.944317]  dump_stack+0x67/0x90
      [44036.944322]  ___might_sleep.cold.88+0x9f/0xaf
      [44036.944327]  rcu_blocking_is_gp+0x13/0x50
      [44036.944330]  synchronize_rcu+0x17/0x80
      [44036.944337]  mt76_sta_state+0x138/0x1d0 [mt76]
      [44036.944349]  mt76x02_wdt_work+0x1c9/0x610 [mt76x02_lib]
      [44036.944355]  process_one_work+0x2a5/0x620
      [44036.944361]  worker_thread+0x35/0x3e0
      [44036.944368]  kthread+0x11c/0x140
      [44036.944376]  ret_from_fork+0x3a/0x50
      [44036.944384] BUG: scheduling while atomic: kworker/u4:1/28066/0x00000002
      [44036.944387] INFO: lockdep is turned off.
      [44036.944389] Modules linked in: cmac ctr ccm af_packet snd_hda_codec_hdmi
      
      Introduce __mt76_sta_remove in order to run sta_remove without holding dev->mutex.
      Move __mt76_sta_remove outside of RCU section in mt76x02_reset_state
      
      Fixes: e4ebb8b403d1 ("mt76: mt76x2: implement full device restart on watchdog reset")
      Signed-off-by: NLorenzo Bianconi <lorenzo@kernel.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      13f61dfc
    • F
      mt76: mt7603: use the correct hweight8() function · f2a00a82
      Felix Fietkau 提交于
      __sw_hweight8() is only defined if CONFIG_GENERIC_HWEIGHT is enabled.
      The function that works on all architectures is hweight8().
      Signed-off-by: NFelix Fietkau <nbd@nbd.name>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      f2a00a82
    • S
      mt76x02u: check chip version on probe · 40b94161
      Stanislaw Gruszka 提交于
      Since some USB device IDs are duplicated between mt76x0u, mt7601u
      and mt76x2u device, check chip version on probe and return error if
      not match the driver.
      
      Don't think this is serious issue, probe most likely will fail at
      some other point for wrong device, but we do not have to configure
      it if we know is not our device.
      Reported-by: NXose Vazquez Perez <xose.vazquez@gmail.com>
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      40b94161
    • S
      mt7601u: check chip version on probe · c0316470
      Stanislaw Gruszka 提交于
      Since some USB device IDs are duplicated between mt7601u and mt76x0u
      devices, check chip version on probe and return error if not match
      0x7601.
      
      Don't think this is serious issue, probe most likely will fail at
      some other point for wrong device, but we do not have to configure
      it if we know is not mt7601u device.
      Reported-by: NXose Vazquez Perez <xose.vazquez@gmail.com>
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Acked-by: NJakub Kicinski <kubakici@wp.pl>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      c0316470
  3. 08 3月, 2019 1 次提交
    • A
      iwlwifi: fix 64-bit division · 688cd8bd
      Arnd Bergmann 提交于
      do_div() expects unsigned operands and otherwise triggers a warning like:
      
      drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:465:2: error: comparison of distinct pointer types ('typeof ((rtt_avg)) *' (aka 'long long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Werror,-Wcompare-distinct-pointer-types]
              do_div(rtt_avg, 6666);
              ^~~~~~~~~~~~~~~~~~~~~
      include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div'
              (void)(((typeof((n)) *)0) == ((uint64_t *)0));  \
                     ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
      1 error generated.
      
      Change the do_div() to the simpler div_s64() that can handle
      negative inputs correctly.
      
      Fixes: 937b10c0 ("iwlwifi: mvm: add debug prints for FTM")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      688cd8bd
  4. 07 3月, 2019 19 次提交
  5. 05 3月, 2019 9 次提交
  6. 04 3月, 2019 5 次提交