1. 04 10月, 2019 2 次提交
    • Y
      rtw88: allows to set RTS in TX descriptor · 942e2a5d
      Yan-Hsuan Chuang 提交于
      Allows driver to send RTS by filling tx descriptor.
      
      The user may want to set the rts threshold. But since we have not
      been taking over rate control from mac80211 to driver by setting flag
      IEEE80211_HW_HAS_RATE_CONTROL, there is nothing we can do about it.
      So here just store the value, and mac80211 will tell us to use rts
      protection by ieee80211_tx_info::control::use_rts.
      Signed-off-by: NYan-Hsuan Chuang <yhchuang@realtek.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      942e2a5d
    • C
      rtw88: check firmware leave lps successfully · 3a2dd6b7
      Chin-Yen Lee 提交于
      Driver needs to wait for firmware to restore hardware setting
      to active mode after leaving lps.
      
      After getting H2C from driver for leaving lps, firmware will
      issue null packet without PS bit to inform AP driver is active,
      and then restore REG_TCR Register if AP has receiced null packet.
      
      But the transmission of null packet may cost much more time
      in noisy environment. If driver does not wait for firmware,
      null packet with PS bit could be sent due to incorrect REG_TCR setting.
      And AP will be confused.
      
      In our test, 100ms is enough for firmware to send null packet
      to AP. If REG_TCR Register is still wrong after 100ms, we will
      modify it directly, force the PS bit to be cleared
      Signed-off-by: NChin-Yen Lee <timlee@realtek.com>
      Signed-off-by: NYan-Hsuan Chuang <yhchuang@realtek.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      3a2dd6b7
  2. 03 10月, 2019 6 次提交
    • K
      Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git · 97ef1226
      Kalle Valo 提交于
      ath.git patches for 5.5. Major changes:
      
      ath10k
      
      * add support for hardware rfkill on devices where firmware supports it
      97ef1226
    • D
      wil6210: check len before memcpy() calls · 2c840676
      Denis Efremov 提交于
      memcpy() in wmi_set_ie() and wmi_update_ft_ies() is called with
      src == NULL and len == 0. This is an undefined behavior. Fix it
      by checking "ie_len > 0" before the memcpy() calls.
      
      As suggested by GCC documentation:
      "The pointers passed to memmove (and similar functions in <string.h>)
      must be non-null even when nbytes==0, so GCC can use that information
      to remove the check after the memmove call." [1]
      
      [1] https://gcc.gnu.org/gcc-4.9/porting_to.html
      
      Cc: Maya Erez <merez@codeaurora.org>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDenis Efremov <efremov@linux.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      2c840676
    • D
      ar5523: check NULL before memcpy() in ar5523_cmd() · 315cee42
      Denis Efremov 提交于
      memcpy() call with "idata == NULL && ilen == 0" results in undefined
      behavior in ar5523_cmd(). For example, NULL is passed in callchain
      "ar5523_stat_work() -> ar5523_cmd_write() -> ar5523_cmd()". This patch
      adds ilen check before memcpy() call in ar5523_cmd() to prevent an
      undefined behavior.
      
      Cc: Pontus Fuchs <pontus.fuchs@gmail.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Laight <David.Laight@ACULAB.COM>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDenis Efremov <efremov@linux.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      315cee42
    • W
      ath10k: add support for hardware rfkill · 1382993f
      Wen Gong 提交于
      When hardware rfkill is enabled in the firmware it will report the
      capability via using WMI_TLV_SYS_CAP_INFO_RFKILL bit in the WMI_SERVICE_READY
      event to the host. ath10k will check the capability, and if it is enabled then
      ath10k will set the GPIO information to firmware using WMI_PDEV_SET_PARAM. When
      the firmware detects hardware rfkill is enabled by the user, it will report it
      via WMI_RFKILL_STATE_CHANGE_EVENTID. Once ath10k receives the event it will
      send wmi command WMI_PDEV_SET_PARAM to the firmware to enable/disable the radio
      and also notifies cfg80211.
      
      We can't power off the device when rfkill is enabled, as otherwise the
      firmware would not be able to detect GPIO changes and report them to the
      host. So when rfkill is enabled, we need to keep the firmware running.
      
      Tested with QCA6174 PCI with firmware
      WLAN.RM.4.4.1-00109-QCARMSWPZ-1.
      Signed-off-by: NAlan Liu <alanliu@codeaurora.org>
      Signed-off-by: NWen Gong <wgong@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      1382993f
    • C
      ath10k: restore QCA9880-AR1A (v1) detection · f8914a14
      Christian Lamparter 提交于
      This patch restores the old behavior that read
      the chip_id on the QCA988x before resetting the
      chip. This needs to be done in this order since
      the unsupported QCA988x AR1A chips fall off the
      bus when resetted. Otherwise the next MMIO Op
      after the reset causes a BUS ERROR and panic.
      
      Cc: stable@vger.kernel.org
      Fixes: 1a7fecb7 ("ath10k: reset chip before reading chip_id in probe")
      Signed-off-by: NChristian Lamparter <chunkeey@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      f8914a14
    • B
      ath10k: fix offchannel tx failure when no ath10k_mac_tx_frm_has_freq · cc6df017
      Ben Greear 提交于
      Offchannel management frames were failing:
      
      [18099.253732] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
      [18102.293686] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
      [18105.333653] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
      [18108.373712] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
      [18111.413687] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0
      [18114.453726] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00
      [18117.493773] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0
      [18120.533631] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00
      
      This bug appears to have been added between 4.0 (which works for us),
      and 4.4, which does not work.
      
      I think this is because the tx-offchannel logic gets in a loop when
      ath10k_mac_tx_frm_has_freq(ar) is false, so pkt is never actually
      sent to the firmware for transmit.
      
      This patch fixes the problem on 4.9 for me, and now HS20 clients
      can work again with my firmware.
      
      Antonio: tested with 10.4-3.5.3-00057 on QCA4019 and QCA9888
      Signed-off-by: NBen Greear <greearb@candelatech.com>
      Tested-by: NAntonio Quartulli <antonio.quartulli@kaiwoo.ai>
      [kvalo@codeaurora.org: improve commit log, remove unneeded parenthesis]
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      cc6df017
  3. 02 10月, 2019 20 次提交
  4. 01 10月, 2019 12 次提交
    • M
      ath9k_htc: Discard undersized packets · cd486e62
      Masashi Honma 提交于
      Sometimes the hardware will push small packets that trigger a WARN_ON
      in mac80211. Discard them early to avoid this issue.
      
      This patch ports 2 patches from ath9k to ath9k_htc.
      commit 3c0efb74 "ath9k: discard
      undersized packets".
      commit df5c4150 "ath9k: correctly
      handle short radar pulses".
      
      [  112.835889] ------------[ cut here ]------------
      [  112.835971] WARNING: CPU: 5 PID: 0 at net/mac80211/rx.c:804 ieee80211_rx_napi+0xaac/0xb40 [mac80211]
      [  112.835973] Modules linked in: ath9k_htc ath9k_common ath9k_hw ath mac80211 cfg80211 libarc4 nouveau snd_hda_codec_hdmi intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_intel snd_hda_codec video snd_hda_core ttm snd_hwdep drm_kms_helper snd_pcm crct10dif_pclmul snd_seq_midi drm snd_seq_midi_event crc32_pclmul snd_rawmidi ghash_clmulni_intel snd_seq aesni_intel aes_x86_64 crypto_simd cryptd snd_seq_device glue_helper snd_timer sch_fq_codel i2c_algo_bit fb_sys_fops snd input_leds syscopyarea sysfillrect sysimgblt intel_cstate mei_me intel_rapl_perf soundcore mxm_wmi lpc_ich mei kvm_intel kvm mac_hid irqbypass parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid hid raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear e1000e ahci libahci wmi
      [  112.836022] CPU: 5 PID: 0 Comm: swapper/5 Not tainted 5.3.0-wt #1
      [  112.836023] Hardware name: MouseComputer Co.,Ltd. X99-S01/X99-S01, BIOS 1.0C-W7 04/01/2015
      [  112.836056] RIP: 0010:ieee80211_rx_napi+0xaac/0xb40 [mac80211]
      [  112.836059] Code: 00 00 66 41 89 86 b0 00 00 00 e9 c8 fa ff ff 4c 89 b5 40 ff ff ff 49 89 c6 e9 c9 fa ff ff 48 c7 c7 e0 a2 a5 c0 e8 47 41 b0 e9 <0f> 0b 48 89 df e8 5a 94 2d ea e9 02 f9 ff ff 41 39 c1 44 89 85 60
      [  112.836060] RSP: 0018:ffffaa6180220da8 EFLAGS: 00010286
      [  112.836062] RAX: 0000000000000024 RBX: ffff909a20eeda00 RCX: 0000000000000000
      [  112.836064] RDX: 0000000000000000 RSI: ffff909a2f957448 RDI: ffff909a2f957448
      [  112.836065] RBP: ffffaa6180220e78 R08: 00000000000006e9 R09: 0000000000000004
      [  112.836066] R10: 000000000000000a R11: 0000000000000001 R12: 0000000000000000
      [  112.836068] R13: ffff909a261a47a0 R14: 0000000000000000 R15: 0000000000000004
      [  112.836070] FS:  0000000000000000(0000) GS:ffff909a2f940000(0000) knlGS:0000000000000000
      [  112.836071] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  112.836073] CR2: 00007f4e3ffffa08 CR3: 00000001afc0a006 CR4: 00000000001606e0
      [  112.836074] Call Trace:
      [  112.836076]  <IRQ>
      [  112.836083]  ? finish_td+0xb3/0xf0
      [  112.836092]  ? ath9k_rx_prepare.isra.11+0x22f/0x2a0 [ath9k_htc]
      [  112.836099]  ath9k_rx_tasklet+0x10b/0x1d0 [ath9k_htc]
      [  112.836105]  tasklet_action_common.isra.22+0x63/0x110
      [  112.836108]  tasklet_action+0x22/0x30
      [  112.836115]  __do_softirq+0xe4/0x2da
      [  112.836118]  irq_exit+0xae/0xb0
      [  112.836121]  do_IRQ+0x86/0xe0
      [  112.836125]  common_interrupt+0xf/0xf
      [  112.836126]  </IRQ>
      [  112.836130] RIP: 0010:cpuidle_enter_state+0xa9/0x440
      [  112.836133] Code: 3d bc 20 38 55 e8 f7 1d 84 ff 49 89 c7 0f 1f 44 00 00 31 ff e8 28 29 84 ff 80 7d d3 00 0f 85 e6 01 00 00 fb 66 0f 1f 44 00 00 <45> 85 ed 0f 89 ff 01 00 00 41 c7 44 24 10 00 00 00 00 48 83 c4 18
      [  112.836134] RSP: 0018:ffffaa61800e3e48 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffde
      [  112.836136] RAX: ffff909a2f96b340 RBX: ffffffffabb58200 RCX: 000000000000001f
      [  112.836137] RDX: 0000001a458adc5d RSI: 0000000026c9b581 RDI: 0000000000000000
      [  112.836139] RBP: ffffaa61800e3e88 R08: 0000000000000002 R09: 000000000002abc0
      [  112.836140] R10: ffffaa61800e3e18 R11: 000000000000002d R12: ffffca617fb40b00
      [  112.836141] R13: 0000000000000002 R14: ffffffffabb582d8 R15: 0000001a458adc5d
      [  112.836145]  ? cpuidle_enter_state+0x98/0x440
      [  112.836149]  ? menu_select+0x370/0x600
      [  112.836151]  cpuidle_enter+0x2e/0x40
      [  112.836154]  call_cpuidle+0x23/0x40
      [  112.836156]  do_idle+0x204/0x280
      [  112.836159]  cpu_startup_entry+0x1d/0x20
      [  112.836164]  start_secondary+0x167/0x1c0
      [  112.836169]  secondary_startup_64+0xa4/0xb0
      [  112.836173] ---[ end trace 9f4cd18479cc5ae5 ]---
      Signed-off-by: NMasashi Honma <masashi.honma@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      cd486e62
    • M
      ath9k_htc: Modify byte order for an error message · e01fddc1
      Masashi Honma 提交于
      rs_datalen is be16 so we need to convert it before printing.
      Signed-off-by: NMasashi Honma <masashi.honma@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      e01fddc1
    • D
      ath9k_hw: fix uninitialized variable data · 80e84f36
      Denis Efremov 提交于
      Currently, data variable in ar9003_hw_thermo_cal_apply() could be
      uninitialized if ar9300_otp_read_word() will fail to read the value.
      Initialize data variable with 0 to prevent an undefined behavior. This
      will be enough to handle error case when ar9300_otp_read_word() fails.
      
      Fixes: 80fe43f2 ("ath9k_hw: Read and configure thermocal for AR9462")
      Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
      Cc: John W. Linville <linville@tuxdriver.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDenis Efremov <efremov@linux.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      80e84f36
    • A
      ath10k: fix backtrace on coredump · d98ddae8
      Anilkumar Kolli 提交于
      In a multiradio board with one QCA9984 and one AR9987
      after enabling the crashdump with module parameter
      coredump_mask=7, below backtrace is seen.
      
      vmalloc: allocation failure: 0 bytes
       kworker/u4:0: page allocation failure: order:0, mode:0x80d2
       CPU: 0 PID: 6 Comm: kworker/u4:0 Not tainted 3.14.77 #130
       Workqueue: ath10k_wq ath10k_core_register_work [ath10k_core]
       (unwind_backtrace) from [<c021abf8>] (show_stack+0x10/0x14)
       (dump_stack+0x80/0xa0)
       (warn_alloc_failed+0xd0/0xfc)
       (__vmalloc_node_range+0x1b4/0x1d8)
       (__vmalloc_node+0x34/0x40)
       (vzalloc+0x24/0x30)
       (ath10k_coredump_register+0x6c/0x88 [ath10k_core])
       (ath10k_core_register_work+0x350/0xb34 [ath10k_core])
       (process_one_work+0x20c/0x32c)
       (worker_thread+0x228/0x360)
      
      This is due to ath10k_hw_mem_layout is not defined for AR9987.
      For coredump undefined hw ramdump_size is 0.
      Check for the ramdump_size before allocation memory.
      
      Tested on: AR9987, QCA9984
      FW version: 10.4-3.9.0.2-00044
      Signed-off-by: NAnilkumar Kolli <akolli@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      d98ddae8
    • A
      ath10k: coredump: fix IRAM addr for QCA9984, QCA4019, QCA9888 and QCA99x0 · 93f9fefc
      Anilkumar Kolli 提交于
      The IRAM start address in coredump was wrong for QCA9984, QCA4019, QCA9888 and
      QCA99x0.
      
      Tested on: QCA9984, QCA4019
      FW version: 10.4-3.9.0.2-00044
      Signed-off-by: NAnilkumar Kolli <akolli@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      93f9fefc
    • E
      ath10k: switch to ieee80211_tx_dequeue_ni · 30654760
      Erik Stromdahl 提交于
      Since ath10k_mac_tx_push_txq() can be called from process context, we
      must explicitly disable softirqs before the call into mac80211.
      
      By calling ieee80211_tx_dequeue_ni() instead of ieee80211_tx_dequeue()
      we make sure softirqs are always disabled even in the case when
      ath10k_mac_tx_push_txq() is called from process context.
      
      Calling ieee80211_tx_dequeue_ni() with softirq's already disabled
      (e.g., from softirq context) should be safe as the local_bh_disable()
      and local_bh_enable() functions (called from ieee80211_tx_dequeue_ni)
      are fully reentrant.
      Signed-off-by: NErik Stromdahl <erik.stromdahl@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      30654760
    • T
      ath10k: change sw version print format to hex · 7b308732
      Tomislav Požega 提交于
      Software version within WMI event ready message was displayed
      in a not very useful decimal format. Change this info to be shown
      in a hexadecimal format instead.
      Signed-off-by: NTomislav Požega <pozega.tomislav@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      7b308732
    • T
      ath10k: print supported MCS rates within service ready event · 73690c48
      Tomislav Požega 提交于
      Add vht_supp_mcs argument to service ready structure and print
      supported MCS rates in WMI service ready debug message.
      Signed-off-by: NTomislav Požega <pozega.tomislav@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      73690c48
    • T
      ath10k: print service ready returned channel range · 275ea1b2
      Tomislav Požega 提交于
      Displays lowest/highest supported channels for both 2ghz and 5ghz
      bands as they're fetched within WMI service ready event.
      These are shown in a frequency format.
      Signed-off-by: NTomislav Požega <pozega.tomislav@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      275ea1b2
    • T
      ath10k: add 2ghz channel arguments to service ready structure · fa879490
      Tomislav Požega 提交于
      Add lowest/highest 2ghz channel arguments for use within WMI service
      ready structure.
      Signed-off-by: NTomislav Požega <pozega.tomislav@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      fa879490
    • Y
      ath9k: remove unused including <linux/version.h> · 6aff90c5
      YueHaibing 提交于
      Remove including <linux/version.h> that don't need it.
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      6aff90c5
    • B
      mwifiex: use 'total_ie_len' in mwifiex_update_bss_desc_with_ie() · 0a3ce169
      Brian Norris 提交于
      This is clearer than copy/pasting the magic number '+ 2' around, and it
      even saves the need for one existing comment.
      
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      0a3ce169