summaryrefslogtreecommitdiffstats
path: root/drivers/net (follow)
Commit message (Collapse)AuthorAgeFilesLines
* wifi: rt2x00: add RF self TXDC calibration for MT7620Tomislav Požega2022-09-241-0/+48
| | | | | | | | | | Add TX self calibration based on mtk driver. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/dbb6e5a0c12d6101477bd09e83253091d21512c9.1663445157.git.daniel@makrotopia.org
* wifi: rt2x00: move up and reuse busy wait functionsDaniel Golle2022-09-241-53/+46
| | | | | | | | | | | | Move bbp_ready and rf_ready busy wait functions up in the code so they can more easily be used. Allow specifying register mask in rf_ready function which is useful for calibration routines which will be added in follow-up commits. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/3fdb9dc15e76a9f9c1948b4a3a1308a7a5677bb8.1663445157.git.daniel@makrotopia.org
* wifi: rt2x00: add support for external PA on MT7620Daniel Golle2022-09-242-1/+52
| | | | | | | | | | | Implement support for external PA connected to MT7620A. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> [pozega.tomislav@gmail.com: use chanreg and dccal helpers.] Signed-off-by: Daniel Golle <daniel@makrotopia.org> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/af2c68ff831816a86fc39b0c10911c129a1f03dc.1663445157.git.daniel@makrotopia.org
* wifi: rt2x00: add throughput LED triggerDavid Bauer2022-09-241-0/+18
| | | | | | | | | | | | | This adds a (currently missing) throughput LED trigger for the rt2x00 driver. Previously, LED triggers had to be assigned to the netdev, which was limited to a single VAP. Tested-by: Christoph Krapp <achterin@googlemail.com> Signed-off-by: David Bauer <mail@david-bauer.net> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/73f5ba4134e621462a26186449400cf0c1ac1730.1663445157.git.daniel@makrotopia.org
* wifi: rt2x00: define RF5592 in init_eeprom routineTomislav Požega2022-09-241-0/+2
| | | | | | | | | | | Fix incorrect RF value encoded in EEPROM on devices with Ralink Rt5592 PCIe radio (a single chip 2T2R 802.11abgn solution). Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/d7eccb2c7b8ec4cd360fa2007796abffc35abb0d.1663445157.git.daniel@makrotopia.org
* Merge tag 'iwlwifi-next-for-kalle-2022-09-18' of ↵Kalle Valo2022-09-2213-413/+846
|\ | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next iwlwifi patches for v6.1
| * wifi: iwlwifi: mvm: d3: parse keys from wowlan info notificationNaftali Goldstein2022-09-181-83/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This notification replaces the WOWLAN_GET_STATUSES command-and-response, so it's required to parse all the keys in the notification just like what happened when that command was used. Move around a few required static functions in order to avoid forward declarations. Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.ca3fb23cab81.I0a9fe7729af4567b98813bc51bad13ee5512a0ae@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: iterate over interfaces after an assert in d3Yedidya Benshimol2022-09-181-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In recent patches notifications based d3 resume flow was added, and the resume flow was changed. Currently, when resuming from d3 during which an assert was thrown, the resume flow skips the iteration over active interfaces preventing the sta to reconnect to the ap. Perform the iteration in case an assert was thrown to fix it. Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.ad888cc6cd91.Ib56e416fce17df089edf76d22896430df5ebe080@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: trigger resume flow before wait for notificationsHaim, Dreyfuss2022-09-181-34/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have recently enabled resume flow based on notifications. These notifications are sent by the FW when completing the resume flow. From IWL_DEVICE_FAMILY_AX210 the resume flow is triggered by the transport layer on iwl_trans_d3_resume. On IWL_DEVICE_FAMILY_22000 and earlier we trigger the resume flow by sending the D0I3 command. Currently, we are waiting for the notifications before sending the command, the notifications won't be sent by the FW since there is no resume trigger to piggyback on. Send the command before starting the wait flow to fix it. Signed-off-by: Haim, Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.5f0f251edf9c.Ia49ab73105af6f52aa7d318f4984edecd3b0671a@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: Add handling for scan offload match info notificationIlan Peer2022-09-184-59/+166
| | | | | | | | | | | | | | | | | | | | To support FW versions that send the scan match information as an asynchronous notification. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.bbc5602d0b6f.I1329c231f82e7bf18f7dba0ccbd9f2d4080cbfc1@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: enable resume based on notificationsHaim Dreyfuss2022-09-181-2/+11
| | | | | | | | | | | | | | | | | | | | We have recently added support for resume based on notifications. Enable it. Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.a6344ba23df5.I09fce8cf5aac1d46b40ae81b1abcf7a0e54af196@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: Add support for d3 end notificationHaim Dreyfuss2022-09-184-4/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | Due to IMR, when host returns from hibernate, commands cannot be sent as part of the resume flow, and so after ending d3 the FW needs to send notifications instead of responses. This notification indicates whether a fw reset is required. Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com> Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.898ecba881b2.I13eb69bb5af08b9ac33043647eaed6b8d50e8659@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: Add support for wowlan wake packet notificationHaim Dreyfuss2022-09-184-28/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The wowlan info notification is quite big. (~750 bytes without the wake packet itself). The max FW notification size is ~2K. There might be cases where the wake packet gets truncated because of this limit. Separating the wake packet from the wowlan info notification allows us to get more data without trimming it. Note: we currently limit the wake packet to 1600 bytes. Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com> Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.06d1e6aecf10.Ib3d6a46ffe71d10cbc69bdb5654e6b14c28df245@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: Add support for wowlan info notificationHaim Dreyfuss2022-09-184-44/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IMR (Isolated Memory Regions) is a mechanism to protect memory regions from unwarranted access by agents in the system that should not have access to that memory. When IMR is enabled, pages in the DRAM will be located within the IMR memory space, accessible only by the device. As a side effect, during S4 (a.k.a hibernate) the IMR memory space is not retained. While the DRAM is saved to the disk and restored by the OS upon resume, the IMR, which is hidden from the OS neither saved upon suspend nor restored upon resume. As a consequence of the above, it turned out that commands cannot be sent as part of the resume flow, and so after ending d3 the FW needs to use notifications instead of cmd-resp. The resume flow becomes asynchronous, with a series of notifications, starting with wowlan_info_notif, through wowlan_pkt_notif and complete the resume flow by d3_end_notif. This patch adds the support for wowlan info notification. The wake packet has been removed from the wowlan info struct and will be handled in a dedicated notification. Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com> Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.3ce8deefd929.Ieba8610e8bb4bec788076371ae38becb4a3d20d5@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: don't check D0I3 versionHaim Dreyfuss2022-09-183-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | This code is dead, even old FW versions don't use it. The IWL_D0I3_RESET_REQUIRE flag will be sent by the FW via a notification, instead of command, the notification handler will be introduced later in the series. Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.87c82482229a.I70456c38ed8f7beb7d62dd618f58e7dc0a7d33b2@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: cfg: remove IWL_DEVICE_BZ_COMMON macroJohannes Berg2022-09-181-6/+3
| | | | | | | | | | | | | | | | | | | | We only have a single use of this inside the IWL_DEVICE_BZ macro, so just combine the contents here. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.23d6c92e9a11.I4a11928a6d698079dc742e3ba3d3ce6fd7a878d1@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: refactor iwl_mvm_set_sta_rate() a bitJohannes Berg2022-09-181-13/+12
| | | | | | | | | | | | | | | | | | | | Use a switch statement over the rate type instead of the if chain, to simplify. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.623e32931b67.Id743a7879e84ae37a849179e536c58b1bf55380f@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: rxmq: further unify some VHT/HE codeJohannes Berg2022-09-181-22/+14
| | | | | | | | | | | | | | | | | | | | There's some duplication here, unify it so that adding EHT becomes easier. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.d1e8673b9443.I6d81fc9dd0856d75e3a799c23f0f8d212b077fca@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: rxmq: refactor mac80211 rx_status settingJohannes Berg2022-09-181-191/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a bunch of duplicated code in the normal data RX and the no-data RX paths, refactor that. Note that we're evidently not implementing the 6 GHz band in the no-data path correctly, need to fix that in firmware first. Also, we were setting the NSS differently, keep doing that, but just override the previous values. Note also that we used to drop frames with bad rate data, to simplify that just report rate 0 and continue. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.a81580d5e769.I3ee7a1fe1adf8684c48713dbbdc2cbc60bd24cd1@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: mvm: fix typo in struct iwl_rx_no_data APIJohannes Berg2022-09-181-2/+2
| | | | | | | | | | | | | | | | | | The version 2 is also for RX, of course, that's just a typo. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.80f7eda56163.Ib783512104f0c135695b4d59b637f3eef3e8f537@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
| * wifi: iwlwifi: pcie: add support for BZ devicesYaara Baruch2022-09-183-2/+53
| | | | | | | | | | | | | | | | | | | | Add support in BZ-FM and BZ-GL devices. Adjust current structs steps to differ between the new devices. Signed-off-by: Yaara Baruch <yaara.baruch@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.0b7fc8487039.I984dcb58272e2f38c835e7aaa7e1ac646bc2f65e@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
* | Merge tag 'mt76-for-kvalo-2022-09-15' of https://github.com/nbd168/wirelessKalle Valo2022-09-2237-516/+859
|\ \ | | | | | | | | | | | | | | | | | | | | | mt76 patches for 6.1 - fixes - suspend/resume improvements - tx status reporting improvements
| * | wifi: mt76: mt7921s: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Deren Wu2022-09-151-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle the .suspend/.resume callbacks. The new macros allow suspend and resume functions to be automatically dropped without any #ifdef guards. Tested-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7663s: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Deren Wu2022-09-151-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle the .suspend/.resume callbacks. The new macros allow suspend and resume functions to be automatically dropped without any #ifdef guards. Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921e: fix random fw download failDeren Wu2022-09-153-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of PCIe interoperability problem shows up, the firmware payload may be corrupted in download stage. Turn off L0s to keep fw download process accurately. [ 1093.528363] mt7921e 0000:3b:00.0: Message 00000007 (seq 7) timeout [ 1093.528414] mt7921e 0000:3b:00.0: Failed to start patch [ 1096.600156] mt7921e 0000:3b:00.0: Message 00000010 (seq 8) timeout [ 1096.600207] mt7921e 0000:3b:00.0: Failed to release patch semaphore [ 1097.699031] mt7921e 0000:3b:00.0: Timeout for driver own [ 1098.758427] mt7921e 0000:3b:00.0: Timeout for driver own [ 1099.834408] mt7921e 0000:3b:00.0: Timeout for driver own [ 1100.915264] mt7921e 0000:3b:00.0: Timeout for driver own [ 1101.990625] mt7921e 0000:3b:00.0: Timeout for driver own [ 1103.077587] mt7921e 0000:3b:00.0: Timeout for driver own [ 1104.173258] mt7921e 0000:3b:00.0: Timeout for driver own [ 1105.248466] mt7921e 0000:3b:00.0: Timeout for driver own [ 1106.336969] mt7921e 0000:3b:00.0: Timeout for driver own [ 1106.397542] mt7921e 0000:3b:00.0: hardware init failed Cc: stable@vger.kernel.org Fixes: bf3747ae2e25 ("mt76: mt7921: enable aspm by default") Signed-off-by: Deren Wu <deren.wu@mediatek.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921: introduce Country Location Control supportMing Yen Hsieh2022-09-156-3/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Country Location Control (CLC) is an additional control for country rules in firmware. We introduce this new feature to make sure mt7921 series working properly in all region. The addtional policies would be put into firmware based on differnt regions. mt76 driver should be in charge of submitting per region policy. Reviewed-by: Sean Wang <sean.wang@mediatek.com> Tested-by: YN Chen <YN.Chen@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921e: fix rmmod crash in driver reload testDeren Wu2022-09-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In insmod/rmmod stress test, the following crash dump shows up immediately. The problem is caused by missing mt76_dev in mt7921_pci_remove(). We should make sure the drvdata is ready before probe() finished. [168.862789] ================================================================== [168.862797] BUG: KASAN: user-memory-access in try_to_grab_pending+0x59/0x480 [168.862805] Write of size 8 at addr 0000000000006df0 by task rmmod/5361 [168.862812] CPU: 7 PID: 5361 Comm: rmmod Tainted: G OE 5.19.0-rc6 #1 [168.862816] Hardware name: Intel(R) Client Systems NUC8i7BEH/NUC8BEB, 05/04/2020 [168.862820] Call Trace: [168.862822] <TASK> [168.862825] dump_stack_lvl+0x49/0x63 [168.862832] print_report.cold+0x493/0x6b7 [168.862845] kasan_report+0xa7/0x120 [168.862857] kasan_check_range+0x163/0x200 [168.862861] __kasan_check_write+0x14/0x20 [168.862866] try_to_grab_pending+0x59/0x480 [168.862870] __cancel_work_timer+0xbb/0x340 [168.862898] cancel_work_sync+0x10/0x20 [168.862902] mt7921_pci_remove+0x61/0x1c0 [mt7921e] [168.862909] pci_device_remove+0xa3/0x1d0 [168.862914] device_remove+0xc4/0x170 [168.862920] device_release_driver_internal+0x163/0x300 [168.862925] driver_detach+0xc7/0x1a0 [168.862930] bus_remove_driver+0xeb/0x2d0 [168.862935] driver_unregister+0x71/0xb0 [168.862939] pci_unregister_driver+0x30/0x230 [168.862944] mt7921_pci_driver_exit+0x10/0x1b [mt7921e] [168.862949] __x64_sys_delete_module+0x2f9/0x4b0 [168.862968] do_syscall_64+0x38/0x90 [168.862973] entry_SYSCALL_64_after_hwframe+0x63/0xcd Test steps: 1. insmode 2. do not ifup 3. rmmod quickly (within 1 second) Fixes: 1c71e03afe4b ("mt76: mt7921: move mt7921_init_hw in a dedicated work") Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw valueSean Wang2022-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should reset mstat->airtime_ac along with clear up the entries in the hardware WLAN table for the Rx and Rx accumulative airtime. Otherwsie, the value msta->airtime_ac - [tx, rx]_last may be a negative and that is not the actual airtime the device took in the last run. Reported-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7915: do not check state before configuring implicit beamformHoward Hsu2022-09-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not need to check running state before configuring implicit Tx beamform. It is okay to configure implicit Tx beamform in run time. Noted that the existing connected stations will be applied for new configuration only if they reconnected to the interface. Fixes: 6d6dc980e07d ("mt76: mt7915: add implicit Tx beamforming support") Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: fix uninitialized pointer in mt7921_mac_fill_rxLorenzo Bianconi2022-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize msta pointer to NULL in mt7921_mac_fill_rx() in order to not dereference a uninitialized pointer. Fixes: 0880d40871d1d ("mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7915: fix mcs value in ht modeHoward Hsu2022-09-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Fix the error that mcs will be reduced to a range of 0 to 7 in ht mode. Fixes: 70fd1333cd32 ("mt76: mt7915: rework .set_bitrate_mask() to support more options") Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921: get rid of the false positive resetSean Wang2022-09-153-18/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | False positive reset would be possibly triggered by those commands we applied in suspend with HZ MCU timeout, especially it happened when we enabled kernel log in pm core to diagnose how much time we spend in each driver during suspend procedure. So we enlarge the value and align the MCU timeout as other commands we did to reduce the false positive reset. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: connac: fix in commentRuffalo Lavoisier2022-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | Correct spelling on 'transmitted' in comment Signed-off-by: Ruffalo Lavoisier <RuffaloLavoisier@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: add PPDU based TxS support for WED deviceRyder Lee2022-09-159-32/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that there's no data coming from network stack for binding flows, hence driver counts and reports station's statistics directly through NL80211_STA_INFO_* based on active PPDU based TxS for offloading data. Apart from that, WA firmware and its offloading engine (SDO) have hardcoded "2" as PID, so we introduce MT_PACKET_ID_WED to differentiate WED reporting. Note that PPDU format TxS is mutually exclusive with MT_TXD5_TX_STATUS_HOST. Co-developed-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com> Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: move move mt76_sta_stats to mt76_wcidRyder Lee2022-09-159-33/+29
| | | | | | | | | | | | | | | | | | | | | This is a preliminary patch for WED's TxS support. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921: fix the firmware version reportSean Wang2022-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the regression of the firmware version report since 'b9ec27102ac0 ('mt76: connac: move mt76_connac2_load_ram in connac module')'. Fixes: b9ec27102ac0 ("mt76: connac: move mt76_connac2_load_ram in connac module") Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_sta_set_decap_offloadSean Wang2022-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race with the context holding dev->muxtex and the driver might access the device in low power state. Fixes: 24299fc869f7 ("mt76: mt7921: enable rx header traslation offload") Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_[start, stop]_apSean Wang2022-09-151-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mt7921_mutex_acquire at mt7921_[start, stop]_ap to fix the race with the context holding dev->muxtex and the driver might access the device in low power state. Fixes: 9d958b60ebc2 ("mt76: mt7921: fix command timeout in AP stop period") Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt76_usb.mt76u_mcu.burst is always false remove related codeGergo Koteles2022-09-152-23/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify mt76x02u_multiple_mcu_reads routine since burst is always false. Signed-off-by: Gergo Koteles <soyer@irl.hu> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7663s: add rx_check callbackLorenzo Bianconi2022-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | Introduce rx_check callback support for mt7663s driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: connac: fix possible unaligned access in ↵Lorenzo Bianconi2022-09-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mt76_connac_mcu_add_nested_tlv Fix possible unaligned pointer in mt76_connac_mcu_add_nested_tlv routine. Reported-by: kernel test robot <lkp@intel.com> Fixes: 25702d9c55dc5 ("mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7915: fix possible unaligned access in mt7915_mac_add_twt_setupLorenzo Bianconi2022-09-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix possible unaligned pointer in mt7915_mac_add_twt_setup routine. Reported-by: kernel test robot <lkp@intel.com> Fixes: 3782b69d03e71 ("mt76: mt7915: introduce mt7915_mac_add_twt_setup routine") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7615: add mt7615_mutex_acquire/release in ↵Lorenzo Bianconi2022-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mt7615_sta_set_decap_offload Similar to mt7921 driver, introduce mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload in order to avoid sending mcu commands while the device is in low-power state. Fixes: d4b98c63d7a77 ("mt76: mt7615: add support for rx decapsulation offload") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: sdio: fix transmitting packet hangsYN Chen2022-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix transmitting packets hangs with continuing to pull the pending packet from mac80211 queues when receiving Tx status notification from the device. Fixes: aac5104bf631 ("mt76: sdio: do not run mt76_txq_schedule directly") Acked-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: YN Chen <yn.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: sdio: add rx_check callback for sdio devicesLorenzo Bianconi2022-09-152-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce rx_check callback support for mt7921s driver. Tested-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921: delete stray if statementDan Carpenter2022-09-151-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This if statement is never true. It was supposed to have been deleted as part of commit 454b768f9ba6 ("mt76: mt7921: Let PCI core handle power state and use pm_sleep_ptr()") but was missed. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7921: fix use after free in mt7921_acpi_read()Dan Carpenter2022-09-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Don't dereference "sar_root" after it has been freed. Fixes: f965333e491e ("mt76: mt7921: introduce ACPI SAR support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: mt7915: fix an uninitialized variable bugDan Carpenter2022-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Smatch complains that: drivers/net/wireless/mediatek/mt76/mt7915/mac.c:428 mt7915_mac_fill_rx() error: uninitialized symbol 'msta'. It looks like this was supposed to be initialized to NULL. Fixes: 0880d40871d1 ("mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: sdio: poll sta stat when device transmits dataSean Wang2022-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not meaningful to poll sta stat when there is no data traffic. So polling sta stat when the device has transmitted data instead to save CPU power. That implies that it is unallowed the stat_work to work while MCU is being initialized in the really early stage to fix the possible time to time MCU initialization failure. Fixes: d39b52e31aa6 ("mt76: introduce mt76_sdio module") Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * | wifi: mt76: sdio: fix the deadlock caused by sdio->stat_workSean Wang2022-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because wake_work and sdio->stat_work share the same workqueue mt76->wq, if sdio->stat_work cannot acquire the mutex lock such as that was possibly held up by [mt7615, mt7921]_mutex_acquire. Additionally, if [mt7615, mt7921]_mutex_acquire was called by sdio->stat_work self, the wake would be blocked by itself. Thus, we move the stat_work into ieee80211_workqueue instead to break the deadlock. Fixes: d39b52e31aa6 ("mt76: introduce mt76_sdio module") Co-developed-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: YN Chen <YN.Chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>