linux-2.6-block.git
7 months agowifi: mt76: mt7921: fix suspend issue on MediaTek COB platform
Michael Lo [Wed, 7 Feb 2024 01:39:45 +0000 (09:39 +0800)]
wifi: mt76: mt7921: fix suspend issue on MediaTek COB platform

MediaTek's controller driver on COB platform (e.g. MT8188) is
capable of controlling power supplies and reset pin of a component
(e.g. a WIFI chip) in power-on and power-off process.

Due to this optional feature, mt76 need to inform controller
that mt76 need to keep power during suspend. Otherwise WIFI will be
powered off when system enters suspend process.

The "wakeup-source" property was used for the device that need
this to go into suspend mode so that mt76 suspend handler doesn't
fail and the system is able to enter into a suspend state.

An example:
wifi: mt7921@0 {
wifi0{
reg = <0x0000 0 0 0 0>;
wakeup-source;
};
};

Signed-off-by: Michael Lo <michael.lo@mediatek.com>
Signed-off-by: Ming Yen Hsieh <MingYen.Hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7921: fix a potential association failure upon resuming
Leon Yen [Tue, 6 Feb 2024 08:53:04 +0000 (16:53 +0800)]
wifi: mt76: mt7921: fix a potential association failure upon resuming

In multi-channel scenarios, the granted channel must be aborted before
suspending. Otherwise, the firmware will be put into a wrong state,
resulting in an association failure after resuming.
With this patch, the granted channel will be aborted before suspending
if necessary.

Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7921: fix the unfinished command of regd_notifier before suspend
Ming Yen Hsieh [Tue, 16 Jan 2024 02:48:57 +0000 (10:48 +0800)]
wifi: mt76: mt7921: fix the unfinished command of regd_notifier before suspend

Before entering suspend, we need to ensure that all MCU command are
completed. In some cases, such as with regd_notifier, there is a
chance that CLC commands, will be executed before suspend.

Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt792x: update the country list of EU for ACPI SAR
Ming Yen Hsieh [Tue, 16 Jan 2024 02:48:56 +0000 (10:48 +0800)]
wifi: mt76: mt792x: update the country list of EU for ACPI SAR

This patch updates the EU country list to ensure the MTCL table
works correctly.

Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt792x: fix a potential loading failure of the 6Ghz channel config from...
Ming Yen Hsieh [Tue, 16 Jan 2024 02:48:55 +0000 (10:48 +0800)]
wifi: mt76: mt792x: fix a potential loading failure of the 6Ghz channel config from ACPI

In some case, the MTCL table will exist, but MTDS table will not.
So the SAR will init fail. This patch make MTCL and MTDS can exist
with no dependence.

Fixes: f965333e491e ("mt76: mt7921: introduce ACPI SAR support")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7921: fix incorrect type conversion for CLC command
Ming Yen Hsieh [Tue, 16 Jan 2024 02:48:54 +0000 (10:48 +0800)]
wifi: mt76: mt7921: fix incorrect type conversion for CLC command

clc->len is defined as 32 bits in length, so it must also be
operated on with 32 bits, not 16 bits.

Fixes: fa6ad88e023d ("wifi: mt76: mt7921: fix country count limitation for CLC")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312112104.Zkc3QUHr-lkp@intel.com/
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925e: fix use-after-free in free_irq()
Deren Wu [Sat, 13 Jan 2024 09:00:23 +0000 (17:00 +0800)]
wifi: mt76: mt7925e: fix use-after-free in free_irq()

From commit a304e1b82808 ("[PATCH] Debug shared irqs"), there is a test
to make sure the shared irq handler should be able to handle the unexpected
event after deregistration. For this case, let's apply MT76_REMOVED flag to
indicate the device was removed and do not run into the resource access
anymore.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7921e: fix use-after-free in free_irq()
Deren Wu [Sat, 13 Jan 2024 09:00:22 +0000 (17:00 +0800)]
wifi: mt76: mt7921e: fix use-after-free in free_irq()

From commit a304e1b82808 ("[PATCH] Debug shared irqs"), there is a test
to make sure the shared irq handler should be able to handle the unexpected
event after deregistration. For this case, let's apply MT76_REMOVED flag to
indicate the device was removed and do not run into the resource access
anymore.

BUG: KASAN: use-after-free in mt7921_irq_handler+0xd8/0x100 [mt7921e]
Read of size 8 at addr ffff88824a7d3b78 by task rmmod/11115
CPU: 28 PID: 11115 Comm: rmmod Tainted: G        W    L    5.17.0 #10
Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I
EDGE WIFI (MS-7D73), BIOS 1.81 01/05/2024
Call Trace:
 <TASK>
 dump_stack_lvl+0x6f/0xa0
 print_address_description.constprop.0+0x1f/0x190
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 kasan_report.cold+0x7f/0x11b
 ? mt7921_irq_handler+0xd8/0x100 [mt7921e]
 mt7921_irq_handler+0xd8/0x100 [mt7921e]
 free_irq+0x627/0xaa0
 devm_free_irq+0x94/0xd0
 ? devm_request_any_context_irq+0x160/0x160
 ? kobject_put+0x18d/0x4a0
 mt7921_pci_remove+0x153/0x190 [mt7921e]
 pci_device_remove+0xa2/0x1d0
 __device_release_driver+0x346/0x6e0
 driver_detach+0x1ef/0x2c0
 bus_remove_driver+0xe7/0x2d0
 ? __check_object_size+0x57/0x310
 pci_unregister_driver+0x26/0x250
 __do_sys_delete_module+0x307/0x510
 ? free_module+0x6a0/0x6a0
 ? fpregs_assert_state_consistent+0x4b/0xb0
 ? rcu_read_lock_sched_held+0x10/0x70
 ? syscall_enter_from_user_mode+0x20/0x70
 ? trace_hardirqs_on+0x1c/0x130
 do_syscall_64+0x5c/0x80
 ? trace_hardirqs_on_prepare+0x72/0x160
 ? do_syscall_64+0x68/0x80
 ? trace_hardirqs_on_prepare+0x72/0x160
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Closes: https://lore.kernel.org/linux-wireless/CABXGCsOdvVwdLmSsC8TZ1jF0UOg_F_W3wqLECWX620PUkvNk=A@mail.gmail.com/
Fixes: 9270270d6219 ("wifi: mt76: mt7921: fix PCI DMA hang after reboot")
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt792x: add the illegal value check for mtcl table of acpi
Ming Yen Hsieh [Thu, 11 Jan 2024 06:18:56 +0000 (14:18 +0800)]
wifi: mt76: mt792x: add the illegal value check for mtcl table of acpi

The mtcl table provided regulatory information for 5.9/6Ghz channels and
configured by platform venders. So, sometimes vendors may write illegal
values, and therefore it is necessary to check and add corresponding
handling for such cases.

Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: fix the wrong data type for scan command
Ming Yen Hsieh [Wed, 10 Jan 2024 09:54:57 +0000 (17:54 +0800)]
wifi: mt76: mt7925: fix the wrong data type for scan command

For the member of 'struct scan_req_tlv', replace data type of
func_mask_ext from 'u8' to '__le32'.

Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: set page_pool napi pointer for mmio devices
Lorenzo Bianconi [Tue, 12 Dec 2023 09:15:19 +0000 (10:15 +0100)]
wifi: mt76: set page_pool napi pointer for mmio devices

In order to recycle skbs in the page_pool "hot" cache in
napi_pp_put_page routine, set napi pointer for MMIO devices in
mt76_create_page_pool().

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: move wed common utilities in wed.c
Lorenzo Bianconi [Mon, 11 Dec 2023 12:07:29 +0000 (13:07 +0100)]
wifi: mt76: move wed common utilities in wed.c

Introduce wed.c in order to collect mt76 wed common codebase used by
mt7915 and mt7996 drivers.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt792x: fix ethtool warning
Gen Xu [Sat, 27 Jan 2024 17:04:30 +0000 (09:04 -0800)]
wifi: mt76: mt792x: fix ethtool warning

Add a missing EHT related field to fix the following ethtool warning:
[98179.287352] mt7921e 0003:01:00.0: ei: 74  SSTATS_LEN: 73

Fixes: c74df1c067f2 ("wifi: mt76: mt792x: introduce mt792x-lib module")
Signed-off-by: Gen Xu <genxu6@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: fix HIF_TXD_V2_1 value
Benjamin Lin [Fri, 26 Jan 2024 09:09:23 +0000 (17:09 +0800)]
wifi: mt76: mt7996: fix HIF_TXD_V2_1 value

Sync the value of HIF_TXD_V2_1 with firmware to let it correctly fill
TXD values for HW path.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: connac: set correct muar_idx for mt799x chipsets
Shayne Chen [Fri, 26 Jan 2024 09:09:22 +0000 (17:09 +0800)]
wifi: mt76: connac: set correct muar_idx for mt799x chipsets

The MUAR (multicast unicast address) is an address mapping table that
participates in the process of searching WTBL entries. For mt799x
chipsets, the default muar index of BMC WTBL is 0xe.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: add locking for accessing mapped registers
Shayne Chen [Fri, 26 Jan 2024 09:09:21 +0000 (17:09 +0800)]
wifi: mt76: mt7996: add locking for accessing mapped registers

A race condition was observed when accessing mapped registers, so add
locking to protect against concurrent access.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: remove TXS queue setting
Peter Chiu [Fri, 26 Jan 2024 09:09:20 +0000 (17:09 +0800)]
wifi: mt76: mt7996: remove TXS queue setting

DMA queue settings of TXS will be initialized by the firmware.

Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: fix efuse reading issue
StanleyYP Wang [Fri, 26 Jan 2024 09:09:19 +0000 (17:09 +0800)]
wifi: mt76: mt7996: fix efuse reading issue

The efuse data starts from the 48th bytes instead of 64th bytes in the
returned event skb.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: mark GCMP IGTK unsupported
Michael-CY Lee [Fri, 26 Jan 2024 09:09:18 +0000 (17:09 +0800)]
wifi: mt76: mt7996: mark GCMP IGTK unsupported

Since the FW does not support to handle the integrity and validation of
IGTK in GCMP mode, return -EOPNOTSUPP to let it be handled by upper layer.

Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: fix HE beamformer phy cap for station vif
Howard Hsu [Fri, 26 Jan 2024 09:09:17 +0000 (17:09 +0800)]
wifi: mt76: mt7996: fix HE beamformer phy cap for station vif

Set correct beamformer capabilities for station vif in HE PHY
capability IE.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: ensure 4-byte alignment for beacon commands
Benjamin Lin [Fri, 26 Jan 2024 09:09:16 +0000 (17:09 +0800)]
wifi: mt76: mt7996: ensure 4-byte alignment for beacon commands

If TLV includes beacon content, its length might not be 4-byte aligned.
Make sure the length is aligned before sending beacon commands to FW.

Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps
Benjamin Lin [Fri, 26 Jan 2024 09:09:15 +0000 (17:09 +0800)]
wifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps

The EHT MCS map subfield of 20 MHz-Only is not present in the EHT
capability of AP, so STA does not need to parse the subfield.
Moreover, AP should parse the subfield only if STA is 20 MHz-Only, which
can be confirmed by checking supported channel width in HE capability.

Fixes: 92aa2da9fa49 ("wifi: mt76: mt7996: enable EHT support in firmware")
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: disable AMSDU for non-data frames
Peter Chiu [Fri, 26 Jan 2024 09:09:14 +0000 (17:09 +0800)]
wifi: mt76: mt7996: disable AMSDU for non-data frames

Disable AMSDU for non-data frames to prevent TX token leak issues.

Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: fix TWT issues
Peter Chiu [Fri, 26 Jan 2024 09:09:13 +0000 (17:09 +0800)]
wifi: mt76: mt7996: fix TWT issues

This patch fixes the following TWT issues:
- Change table_mask to u16 to support up to 16 TWT stations
- Reject TWT flows for duplicated establishment
- Fix possible unaligned pointer
- Remove unsupported TWT_CONTROL_WAKE_DUR_UNIT flag
- The minimum TWT duration supported by mt7996 chipsets is 64. Reply
  with TWT_SETUP_CMD_DICTATE if the min_twt_dur is smaller than 64

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: check txs format before getting skb by pid
Peter Chiu [Fri, 26 Jan 2024 09:09:12 +0000 (17:09 +0800)]
wifi: mt76: mt7996: check txs format before getting skb by pid

The PPDU TXS does not include the error bit so it cannot use to report
status to mac80211. This patch fixes issue that STA wrongly detects if AP
is still alive.

Fixes: 2569ea5326e2 ("wifi: mt76: mt7996: enable PPDU-TxS to host")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: support temperature sensor
Deren Wu [Sun, 24 Dec 2023 08:04:59 +0000 (16:04 +0800)]
wifi: mt76: mt7925: support temperature sensor

Allow sensors tool to read radio's temperature, example:

mt7925_phy8-pci-3b00
Adapter: PCI adapter
temp1:        +35.0°C

Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: update PCIe DMA settings
Deren Wu [Fri, 29 Dec 2023 03:09:37 +0000 (11:09 +0800)]
wifi: mt76: mt7925: update PCIe DMA settings

Fix the wrong WFDMA settings to improve TX performance.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
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>
7 months agowifi: mt76: mt7925: add support to set ifs time by mcu command
Ming Yen Hsieh [Fri, 29 Dec 2023 03:09:36 +0000 (11:09 +0800)]
wifi: mt76: mt7925: add support to set ifs time by mcu command

There's a race between driver and fw on some tx/rx control registers
when setting ifs, which will cause accidental hw queue pause problems.
Avoid this by setting ifs time with bss_info mcu command.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
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>
7 months agowifi: mt76: mt7925: add flow to avoid chip bt function fail
Quan Zhou [Fri, 29 Dec 2023 03:09:35 +0000 (11:09 +0800)]
wifi: mt76: mt7925: add flow to avoid chip bt function fail

A sub-process of Wifi L0.5 reset will make chip common partition
enter low power, and have chance lead to Bluetooth host-to-chip
command timeout, modify the software flow according to the chip's
design to solve the problem.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: fix the wrong header translation config
Ming Yen Hsieh [Fri, 29 Dec 2023 03:09:34 +0000 (11:09 +0800)]
wifi: mt76: mt7925: fix the wrong header translation config

The header translation config should set to broadcast and unicast
cases correctly, not only unicast case. And also remove the cmds
of wtbl (wlan table) series, because these MCU commands have
already been replaced by other commands in mt7925.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: fix WoW failed in encrypted mode
Ming Yen Hsieh [Fri, 29 Dec 2023 03:09:33 +0000 (11:09 +0800)]
wifi: mt76: mt7925: fix WoW failed in encrypted mode

When in suspend mode, WoW (Wake-on-WLAN) fails to wake the system remotely
due to incorrect encryption mode settings. For the new mt7925 chipset, the
old STA_REC_KEY_V2 command will send incorrect parameters to the firmware.
Therefore, STA_REC_KEY_V3 has been introduced as a replacement for it.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: fix fw download fail
Ming Yen Hsieh [Fri, 29 Dec 2023 03:09:32 +0000 (11:09 +0800)]
wifi: mt76: mt7925: fix fw download fail

Add an address of fw region for fw download.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: fix wmm queue mapping
Ming Yen Hsieh [Fri, 29 Dec 2023 03:09:31 +0000 (11:09 +0800)]
wifi: mt76: mt7925: fix wmm queue mapping

Firmware uses access class index (ACI) for wmm parameters update,
so convert mac80211 queue to ACI in mt7925_conf_tx().

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: fix mcu query command fail
Hao Zhang [Fri, 29 Dec 2023 03:09:30 +0000 (11:09 +0800)]
wifi: mt76: mt7925: fix mcu query command fail

Apply query command type properly to make the chip send the response back.
Otherwise, we may see the command timeout in driver side.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Hao Zhang <hao.zhang@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: fix SAP no beacon issue in 5Ghz and 6Ghz band
rong.yan [Fri, 29 Dec 2023 03:09:29 +0000 (11:09 +0800)]
wifi: mt76: mt7925: fix SAP no beacon issue in 5Ghz and 6Ghz band

Driver should configure basic rate and phy mode for SAP mode.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: rong.yan <rong.yan@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7925: fix connect to 80211b mode fail in 2Ghz band
Ming Yen Hsieh [Fri, 29 Dec 2023 03:09:28 +0000 (11:09 +0800)]
wifi: mt76: mt7925: fix connect to 80211b mode fail in 2Ghz band

Driver should setting correct phy mode to firmware when in legacy mode.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt76x2u: add netgear wdna3100v3 to device table
Dacio Romero [Sat, 23 Dec 2023 06:32:25 +0000 (22:32 -0800)]
wifi: mt76: mt76x2u: add netgear wdna3100v3 to device table

Netgear WDNA3100v3 has a chipset that's compatible with the mt76x2u driver
and works without modification with the mainline kernel by writing to sysfs.

Signed-off-by: Dacio Romero <dacioromero@gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt792xu: enable dmashdl support
Deren Wu [Sat, 23 Dec 2023 03:43:08 +0000 (11:43 +0800)]
wifi: mt76: mt792xu: enable dmashdl support

dmashdl(DMA scheduler) was disable and may cause packets corruption
without propoer resource handling. Enable this to control resources
between usb-bus/pse/hardware-ac-queue.

Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: usb: store usb endpoint in mt76_queue
Lorenzo Bianconi [Sat, 23 Dec 2023 03:43:07 +0000 (11:43 +0800)]
wifi: mt76: usb: store usb endpoint in mt76_queue

Store usb endpoint in mt76_queue structure and rework q2ep routine.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: usb: create a dedicated queue for psd traffic
Lorenzo Bianconi [Sat, 23 Dec 2023 03:43:06 +0000 (11:43 +0800)]
wifi: mt76: usb: create a dedicated queue for psd traffic

Create a dedicate queue for psd/mgmt traffic and do not rely on voice
one. This is a preliminary patch to fix mt7921u/mt7925 usb dmasl
configuration.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7996: fix fw loading timeout
Lorenzo Bianconi [Thu, 21 Dec 2023 09:41:18 +0000 (10:41 +0100)]
wifi: mt76: mt7996: fix fw loading timeout

Fix the following firmware loading error due to a wrong dma register
configuration if wed is disabled.

[    8.245881] mt7996e_hif 0001:01:00.0: assign IRQ: got 128
[    8.251308] mt7996e_hif 0001:01:00.0: enabling device (0000 -> 0002)
[    8.257674] mt7996e_hif 0001:01:00.0: enabling bus mastering
[    8.263488] mt7996e 0000:01:00.0: assign IRQ: got 126
[    8.268537] mt7996e 0000:01:00.0: enabling device (0000 -> 0002)
[    8.274551] mt7996e 0000:01:00.0: enabling bus mastering
[   28.648773] mt7996e 0000:01:00.0: Message 00000010 (seq 1) timeout
[   28.654959] mt7996e 0000:01:00.0: Failed to get patch semaphore
[   29.661033] mt7996e: probe of 0000:01:00.0 failed with error -11

Suggested-by: Sujuan Chen" <sujuan.chen@mediatek.com>
Fixes: 4920a3a1285f ("wifi: mt76: mt7996: set DMA mask to 36 bits for boards with more than 4GB of RAM")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agodt-bindings: net: wireless: mt76: add interrupts description for MT7986
Peter Chiu [Thu, 21 Dec 2023 03:26:48 +0000 (11:26 +0800)]
dt-bindings: net: wireless: mt76: add interrupts description for MT7986

The mt7986 can support four interrupts to distribute the interrupts
to different CPUs.

Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7915: update mt798x_wmac_adie_patch_7976
Peter Chiu [Tue, 17 Oct 2023 08:32:51 +0000 (16:32 +0800)]
wifi: mt76: mt7915: update mt798x_wmac_adie_patch_7976

Add support for a newer ADIE version

Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7915: add locking for accessing mapped registers
Shayne Chen [Tue, 15 Aug 2023 09:28:30 +0000 (17:28 +0800)]
wifi: mt76: mt7915: add locking for accessing mapped registers

Sicne the mapping is global, mapped register access needs to be protected
against concurrent access, otherwise a race condition might cause the reads
or writes to go towards the wrong register

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: mt7915: fix error recovery with WED enabled
Felix Fietkau [Thu, 18 Jan 2024 14:51:53 +0000 (15:51 +0100)]
wifi: mt76: mt7915: fix error recovery with WED enabled

Do not clear the interrupt mask register on MT7915, since that prevents
MCU_CMD interrupts from being reported, thus causing timeouts during the
reset sequence. Defer stopping WED until tx/rx processing activity has
stopped.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: check txs format before getting skb by pid
Peter Chiu [Thu, 7 Dec 2023 23:35:39 +0000 (07:35 +0800)]
wifi: mt76: check txs format before getting skb by pid

The PPDU TxS does not include the error bit so it cannot use to report
status to mac80211.

Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: mt76: disable HW AMSDU when using fixed rate
Peter Chiu [Wed, 6 Sep 2023 08:27:25 +0000 (16:27 +0800)]
wifi: mt76: disable HW AMSDU when using fixed rate

When using fixed rate, HW uses txd DW9 to store tx arrivial time if VTA
is set. It would overwrite the msdu_id in txd and lead to token pending
if amsdu is enable.

Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 months agowifi: wilc1000: revert reset line logic flip
Alexis Lothoré [Sat, 17 Feb 2024 13:22:41 +0000 (14:22 +0100)]
wifi: wilc1000: revert reset line logic flip

This reverts commit fcf690b0b47494df51d214db5c5a714a400b0257.

When using a wilc1000 chip over a spi bus, users can optionally define a
reset gpio and a chip enable gpio. The reset line of wilc1000 is active
low, so to hold the chip in reset, a low (physical) value must be applied.

The corresponding device tree binding documentation was introduced by
commit f31ee3c0a555 ("wilc1000: Document enable-gpios and reset-gpios
properties") and correctly indicates that the reset line is an active-low
signal. The corresponding driver part, brought by commit ec031ac4792c
("wilc1000: Add reset/enable GPIO support to SPI driver") was applying the
correct logic. But commit fcf690b0b474 ("wifi: wilc1000: use correct
sequence of RESET for chip Power-UP/Down") eventually flipped this logic
and started misusing the gpiod APIs, applying an inverted logic when
powering up/down the chip (for example, setting the reset line to a logic
"1" during power up, which in fact asserts the reset line when device tree
describes the reset line as GPIO_ACTIVE_LOW). As a consequence, any
platform currently using the driver in SPI mode must use a faulty reset
line description in device tree, or else chip will be maintained in reset
and will not even allow to bring up the chip.

Fix reset line usage by inverting back the gpiod APIs usage, setting the
reset line to the logic value "0" when powering the chip, and the logic
value "1" when powering off the chip.

Fixes: fcf690b0b474 ("wifi: wilc1000: use correct sequence of RESET for chip Power-UP/Down")
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240217-wilc_1000_reset_line-v2-1-b216f433d7d5@bootlin.com
7 months agowifi: brcmfmac: Add DMI nvram filename quirk for ACEPC W5 Pro
Hans de Goede [Fri, 16 Feb 2024 21:36:49 +0000 (22:36 +0100)]
wifi: brcmfmac: Add DMI nvram filename quirk for ACEPC W5 Pro

The ACEPC W5 Pro HDMI stick contains quite generic names in the sys_vendor
and product_name DMI strings, without this patch brcmfmac will try to load:
"brcmfmac43455-sdio.$(DEFAULT_STRING)-$(DEFAULT_STRING).txt" as nvram file
which is both too generic and messy with the $ symbols in the name.

The ACEPC W5 Pro uses the same Ampak AP6255 module as the ACEPC T8
and the nvram for the T8 is already in linux-firmware, so point the new
DMI nvram filename quirk to the T8 nvram file.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240216213649.251718-1-hdegoede@redhat.com
7 months agowifi: rtlwifi: set initial values for unexpected cases of USB endpoint priority
Ping-Ke Shih [Fri, 16 Feb 2024 03:39:49 +0000 (11:39 +0800)]
wifi: rtlwifi: set initial values for unexpected cases of USB endpoint priority

Map USB endpoints to hardware and AC queues according to number of USB
endpoints. However, original only give a warning for unexpected cases but
initial values are not given. Then, smatch warns:

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:642
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:644
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:649
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:650
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.

The regular selection is high and low queues, so move default (unexpected)
case along with that.

Compile tested only.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240216033949.34765-1-pkshih@realtek.com
7 months agowifi: rtl8xxxu: check vif before using in rtl8xxxu_tx()
Ping-Ke Shih [Fri, 16 Feb 2024 03:39:23 +0000 (11:39 +0800)]
wifi: rtl8xxxu: check vif before using in rtl8xxxu_tx()

The 'vif' is from tx_info of SKB, and other codes check 'vif' before using,
which raises smatch warnings:

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:5656 rtl8xxxu_tx()
   warn: variable dereferenced before check 'vif' (see line 5553)

Compile tested only.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240216033923.34683-1-pkshih@realtek.com
7 months agowifi: rtlwifi: rtl8192cu: Fix TX aggregation
Bitterblue Smith [Thu, 15 Feb 2024 18:57:59 +0000 (20:57 +0200)]
wifi: rtlwifi: rtl8192cu: Fix TX aggregation

rtl8192cu is checking rtl_mac.tids when deciding if it should enable
aggregation. This is wrong because rtl_mac.tids is not initialised
anywhere. Check rtl_sta_info.tids instead, which is initialised.

Also, when enabling aggregation also enable RTS. The vendor driver does
this, my router does this. It seems like the thing to do.

Also also, it seems right to set the AMPDU density only when enabling
aggregation.

Also also also, delete the unused member rtl_mac.tids and the unused
macros RTL_AGG_ON and RTL_AGG_OFF.

Naturally, with working AMPDU the download/upload speeds are better.
Before: 59/32 Mbps.
After:  68/46 Mbps.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/4e936334-5f81-403f-a495-0628ebfb6903@gmail.com
7 months agowifi: wilc1000: remove AKM suite be32 conversion for external auth request
Alexis Lothoré [Thu, 15 Feb 2024 14:13:53 +0000 (15:13 +0100)]
wifi: wilc1000: remove AKM suite be32 conversion for external auth request

The driver currently raises the following sparse warning:
[...] cfg80211.c:360:42: warning: incorrect type in assignment (different
base types)
[...] cfg80211.c:360:42:    expected unsigned int key_mgmt_suite
[...] cfg80211.c:360:42:    got restricted __be32 [usertype]
  CHECK   drivers/net/wireless/microchip/wilc1000/netdev.c

This conversion was needed because historically the external supplicant
(observed with wpa_supplicant) expects AKM suite as big endian in
NL80211_CMD_EXTERNAL_AUTH message when the AKM suite is WLAN_AKM_SUITE_SAE.
This is not needed anymore:
- new (to be released) versions of wpa_supplicant now reads it in host
  endian _while_ keeping compatibility for older drivers
- for new drivers used with current/old wpa_supplicant, this conversion has
  been added to nl80211 to force big endian when the AKM suite is
  WLAN_AKM_SUITE_SAE

Remove this not-needed-anymore conversion to fix the sparse warning.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308290615.lUTIgqUl-lkp@intel.com/
Tested-on: WILC1000 hwB SPI WILC_WIFI_FW_REL_16_1-13452
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240215-nl80211_fix_akm_suites_endianness-v1-2-57e902632f9d@bootlin.com
7 months agowifi: nl80211: refactor parsing CSA offsets
Johannes Berg [Wed, 21 Feb 2024 11:48:18 +0000 (12:48 +0100)]
wifi: nl80211: refactor parsing CSA offsets

The CSA offset parsing happens the same way for all of
beacon template offsets, probe response template offsets
and TX offsets (for using during probe response TX from
userspace directly).

Refactor the parsing here. There's an additional check
this introduces, which is that the number of counters in
TX offsets doesn't exceed the driver capability, but as
only two counters are used at most for anything, this is
hopefully OK.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: nl80211: force WLAN_AKM_SUITE_SAE in big endian in NL80211_CMD_EXTERNAL_AUTH
Alexis Lothoré [Thu, 15 Feb 2024 14:13:52 +0000 (15:13 +0100)]
wifi: nl80211: force WLAN_AKM_SUITE_SAE in big endian in NL80211_CMD_EXTERNAL_AUTH

User-space supplicant (observed at least on wpa_supplicant) historically
parses the NL80211_ATTR_AKM_SUITES from the NL80211_CMD_EXTERNAL_AUTH
message as big endian _only_ when its value is WLAN_AKM_SUITE_SAE, while
processing anything else in host endian. This behavior makes any driver
relying on SAE external auth to switch AKM suite to big endian if it is
WLAN_AKM_SUITE_SAE. A fix bringing compatibility with both endianness
has been brought into wpa_supplicant, however we must keep compatibility
with older versions, while trying to reduce the occurences of this manual
conversion in wireless drivers.

Add the be32 conversion specifically on WLAN_AKM_SUITE_SAE in nl80211 layer
to keep compatibility with older wpa_supplicant versions.

Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Link: https://msgid.link/20240215-nl80211_fix_akm_suites_endianness-v1-1-57e902632f9d@bootlin.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: load b0 version of ucode for HR1/HR2
Mukesh Sisodiya [Sun, 18 Feb 2024 17:51:52 +0000 (19:51 +0200)]
wifi: iwlwifi: load b0 version of ucode for HR1/HR2

load b0 version of ucode for both a0 and b0 step of HR RF.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.0166f5d2d5d2.I34c1d46aefd70b34c1c75cea67792bc5ec8bc285@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: handle per-phy statistics from fw
Miri Korenblit [Sun, 18 Feb 2024 17:51:51 +0000 (19:51 +0200)]
wifi: iwlwifi: handle per-phy statistics from fw

In the operational statistics notifications (both old and new
API) the driver receives the statistics per phy.
currently this statistics wasn't handled because they wasn't needed.

Now the channel_load_by_us parameter in these statistics will be used
for the link grading calculation (implemented in another patch),
so store its value in phy_ctxt.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240218194912.e84f975b69ee.Ibbc7817135827e45adaaa47b796be165f9f1ca48@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: iwl-fh.h: fix kernel-doc issues
Johannes Berg [Sun, 18 Feb 2024 17:51:49 +0000 (19:51 +0200)]
wifi: iwlwifi: iwl-fh.h: fix kernel-doc issues

Clean up kernel-doc in iwl-fh.h. In one case, rename the
(otherwise unused) struct member to have the correct name.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.4a342ac06f0b.I604ea964a094b43df0ab29b06231c2f42d6bd79b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: api: fix kernel-doc reference
Johannes Berg [Sun, 18 Feb 2024 17:51:48 +0000 (19:51 +0200)]
wifi: iwlwifi: api: fix kernel-doc reference

This is for iwl_tas_config_cmd_v4, not iwl_tas_config_cmd_v3.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.5475d49bce86.I640a12bc799612e82c3e7a4d628bbb7760511297@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: unlock mvm if there is no primary link
Benjamin Berg [Sun, 18 Feb 2024 17:51:46 +0000 (19:51 +0200)]
wifi: iwlwifi: mvm: unlock mvm if there is no primary link

At that point in the code mvm->mutex has already been taken, so jump to
out_noreset in order to unlock before returning the error.

Fixes: 8c9bef26e98b ("wifi: iwlwifi: mvm: d3: implement suspend with MLO")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.21de6e68d9e5.I3c0ebe577dec6b26ab6b4eac48035d6f35a8b0f8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: bump FW API to 90 for BZ/SC devices
Miri Korenblit [Sun, 18 Feb 2024 17:51:45 +0000 (19:51 +0200)]
wifi: iwlwifi: bump FW API to 90 for BZ/SC devices

Start supporting API version 90 for new devices.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.21cf0b641f12.I2f9196191f1ea78e96e92f9db8ecb3cc9bbfd9b3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: support PHY context version 6
Johannes Berg [Sun, 18 Feb 2024 17:51:44 +0000 (19:51 +0200)]
wifi: iwlwifi: mvm: support PHY context version 6

Fill the new puncture mask in the PHY context command if
supported. In this case, also don't send it in the link
context command.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.16d9f5fc41df.I9eeb55787d8483f820f5790e8874761f598da314@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: partially support PHY context version 6
Johannes Berg [Sun, 18 Feb 2024 17:51:43 +0000 (19:51 +0200)]
wifi: iwlwifi: mvm: partially support PHY context version 6

The version 6 command adds the puncture mask to the PHY
context and is otherwise the same. Support that in the
API definitions, but don't fill it yet.

While at it, also mark the field as removed from the link
context command since it moved from there to PHY context.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.2156fca5b1a5.I57f47f26ec0d96ecfb1192039f72b1c6d4e8a357@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: support wider-bandwidth OFDMA
Johannes Berg [Sun, 18 Feb 2024 17:51:42 +0000 (19:51 +0200)]
wifi: iwlwifi: mvm: support wider-bandwidth OFDMA

To support wider-bandwidth OFDMA we need to configure the
PHY context in the firmware, which will in turn configure
the DSP accordingly. Pass the relevant information down.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.ca666ede5dd6.I357972823d20e9045e2c97dbb7ac24fe9f5a6e41@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: use ML element parsing helpers
Johannes Berg [Fri, 16 Feb 2024 11:54:32 +0000 (13:54 +0200)]
wifi: cfg80211: use ML element parsing helpers

Use the existing ML element parsing helpers and add a new
one for this (ieee80211_mle_get_mld_id).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240216135047.4da47b1f035b.I437a5570ac456449facb0b147851ef24a1e473c2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: align ieee80211_mle_get_bss_param_ch_cnt()
Johannes Berg [Fri, 16 Feb 2024 11:54:31 +0000 (13:54 +0200)]
wifi: mac80211: align ieee80211_mle_get_bss_param_ch_cnt()

Align the prototype of ieee80211_mle_get_bss_param_ch_cnt()
to also take a u8 * like the other functions, and make it
return -1 when the field isn't found, so that mac80211 can
check that instead of explicitly open-coding the check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240216135047.583309181bc3.Ia61cb0b4fc034d5ac8fcfaf6f6fb2e115fadafe7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: refactor RNR parsing
Johannes Berg [Fri, 16 Feb 2024 11:54:30 +0000 (13:54 +0200)]
wifi: cfg80211: refactor RNR parsing

We'll need more parsing of the reduced neighbor report element,
and we already have two places doing pretty much the same.
Combine by refactoring the parsing into a separate function
with a callback for each item found.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240216135047.cfff14b692fc.Ibe25be88a769eab29ebb17b9d19af666df6a2227@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: clean up cfg80211_inform_bss_frame_data()
Johannes Berg [Fri, 16 Feb 2024 11:54:29 +0000 (13:54 +0200)]
wifi: cfg80211: clean up cfg80211_inform_bss_frame_data()

Make cfg80211_inform_bss_frame_data() call the existing
cfg80211_inform_bss_data() after parsing the frame in the
appropriate way, so we have less code duplication. This
required introducing a new CFG80211_BSS_FTYPE_S1G_BEACON,
but that can be used by other drivers as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240216135047.874aed1eff5f.Ib7d88d126eec50c64763251a78cb432bb5df14df@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: remove cfg80211_inform_single_bss_frame_data()
Johannes Berg [Fri, 16 Feb 2024 11:54:28 +0000 (13:54 +0200)]
wifi: cfg80211: remove cfg80211_inform_single_bss_frame_data()

This function pretty much does what cfg80211_inform_single_bss_data()
already does, except on a frame data. But we can call the other one,
after populating the inform_data more completely, so we don't need to
do everything twice.

This also uncovered a few bugs:
 * the 6 GHz power type checks were only done in this function, move
   (and rename from 'uhb') those;
 * the chains/chain_signal information wasn't used in the latter,
   add that

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240216135047.f3f864f94c78.I2192adb32ab10713e71f395a9d203386264f6ed5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: set correct param change count in ML element
Benjamin Berg [Fri, 16 Feb 2024 11:54:27 +0000 (13:54 +0200)]
wifi: cfg80211: set correct param change count in ML element

The ML element generation code to create a BSS entry from a per-STA
profile was not overwriting the BSS parameter change count. This meant
that the incorrect parameter change count would be reported within the
multi-link element.

Fix this by returning the BSS parameter change count from the function
and placing it into the ML element. The returned tbtt info was never
used, so just drop that to simplify the code.

Fixes: 5f478adf1f99 ("wifi: cfg80211: generate an ML element for per-STA profiles")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240216135047.f2a507634692.I06b122c7a319a38b4e970f5e0bd3d3ef9cac4cbe@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: Add KHZ_PER_GHZ to units.h and reuse
Andy Shevchenko [Thu, 15 Feb 2024 15:41:36 +0000 (17:41 +0200)]
wifi: cfg80211: Add KHZ_PER_GHZ to units.h and reuse

The KHZ_PER_GHZ might be used by others (with the name aligned
with similar constants). Define it in units.h and convert
wireless to use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://msgid.link/20240215154136.630029-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: clean up assignments to pointer cache.
Colin Ian King [Thu, 15 Feb 2024 23:21:51 +0000 (23:21 +0000)]
wifi: mac80211: clean up assignments to pointer cache.

The assignment to pointer cache in function mesh_fast_tx_gc can
be made at the declaration time rather than a later assignment.
There are also 3 functions where pointer cache is being initialized
at declaration time and later re-assigned again with the same
value, these are redundant and can be removed.

Cleans up code and three clang scan build warnings:
warning: Value stored to 'cache' during its initialization is never
read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://msgid.link/20240215232151.2075483-1-colin.i.king@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: make associated BSS pointer visible to the driver
Miri Korenblit [Tue, 6 Feb 2024 14:54:06 +0000 (16:54 +0200)]
wifi: mac80211: make associated BSS pointer visible to the driver

Some drivers need the data in it, so move it to the link conf,
which is exposed to the driver.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240206164849.6fe9782b87b4.Ifbffef638f07ca7f5c2b27f40d2cf2942d21de0b@changeid
[remove bss pointer from internal struct, update docs]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211_hwsim: add support for switch_vif_chanctx callback
Aditya Kumar Singh [Fri, 16 Feb 2024 14:46:21 +0000 (20:16 +0530)]
wifi: mac80211_hwsim: add support for switch_vif_chanctx callback

Currently switch_vif_chanctx mac80211 callback is not supported for
MLO. Add it.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://msgid.link/20240216144621.514385-3-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: check beacon countdown is complete on per link basis
Aditya Kumar Singh [Fri, 16 Feb 2024 14:46:20 +0000 (20:16 +0530)]
wifi: mac80211: check beacon countdown is complete on per link basis

Currently, function to check if beacon countdown is complete uses deflink
to fetch the beacon and check the counter. However, with MLO, there is
a need to check the counter for the beacon in a particular link.

Add support to use link_id in order to fetch the beacon from a particular
link data.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://msgid.link/20240216144621.514385-2-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agoMerge tag 'wireless-next-2024-02-20' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Wed, 21 Feb 2024 11:48:20 +0000 (11:48 +0000)]
Merge tag 'wireless-next-2024-02-20' of git://git./linux/kernel/git/wireless/wireless-next

Kalle Valo says:

====================
wireless-next patches for v6.9

The second "new features" pull request for v6.9.  Lots of iwlwifi and
stack changes this time. And naturally smaller changes to other drivers.

We also twice merged wireless into wireless-next to avoid conflicts
between the trees.

Major changes:

stack

* mac80211: negotiated TTLM request support

* SPP A-MSDU support

* mac80211: wider bandwidth OFDMA config support

iwlwifi

* kunit tests

* bump FW API to 89 for AX/BZ/SC devices

* enable SPP A-MSDUs

* support for new devices

ath12k

* refactoring in preparation for Multi-Link Operation (MLO) support

* 1024 Block Ack window size support

* provide firmware wmi logs via a trace event

ath11k

* 36 bit DMA mask support

* support 6 GHz station power modes: Low Power Indoor (LPI), Standard
  Power) SP and Very Low Power (VLP)

rtl8xxxu

* TP-Link TL-WN823N V2 support
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agoMerge branch 'net-kmem-cache-create'
David S. Miller [Wed, 21 Feb 2024 11:28:58 +0000 (11:28 +0000)]
Merge branch 'net-kmem-cache-create'

Kunwu Chan says:

====================
net: Use KMEM_CACHE instead of kmem_cache_create

As Jiri Pirko suggests,
I'm using a patchset to cleanup the same issues in the 'net' module.
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Some cache names are changed to be the same as struct names.
This change is recorded in the changelog for easy reference.
It's harmless cause it's used in /proc/slabinfo to identify this cache.
---
Changes in v2:
- Delete a patch as Eric said in https://lore.kernel.org/all/CANn89iLkWvum6wSqSya_K+1eqnFvp=L2WLW=kAYrZTF8Ei4b7g@mail.gmail.com/
- No code changes,only add Reviewed-by tag
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agoipv6: Simplify the allocation of slab caches
Kunwu Chan [Tue, 20 Feb 2024 07:36:46 +0000 (15:36 +0800)]
ipv6: Simplify the allocation of slab caches

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agoipv4: Simplify the allocation of slab caches in ip_rt_init
Kunwu Chan [Tue, 20 Feb 2024 07:36:45 +0000 (15:36 +0800)]
ipv4: Simplify the allocation of slab caches in ip_rt_init

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
And change cache name from 'ip_dst_cache' to 'rtable'.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agoipmr: Simplify the allocation of slab caches
Kunwu Chan [Tue, 20 Feb 2024 07:36:44 +0000 (15:36 +0800)]
ipmr: Simplify the allocation of slab caches

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
And change cache name from 'ip_mrt_cache' to 'mfc_cache'.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agoip6mr: Simplify the allocation of slab caches in ip6_mr_init
Kunwu Chan [Tue, 20 Feb 2024 07:36:43 +0000 (15:36 +0800)]
ip6mr: Simplify the allocation of slab caches in ip6_mr_init

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
And change cache name from 'ip6_mrt_cache' to 'mfc6_cache'.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: kcm: Simplify the allocation of slab caches
Kunwu Chan [Tue, 20 Feb 2024 07:36:42 +0000 (15:36 +0800)]
net: kcm: Simplify the allocation of slab caches

Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
And change cache name from 'kcm_mux_cache' to 'kcm_mux',
'kcm_psock_cache' to 'kcm_psock'.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet/dummy: Move stats allocation to core
Breno Leitao [Mon, 19 Feb 2024 13:43:28 +0000 (05:43 -0800)]
net/dummy: Move stats allocation to core

With commit 34d21de99cea9 ("net: Move {l,t,d}stats allocation to core and
convert veth & vrf"), stats allocation could be done on net core instead
of this driver.

With this new approach, the driver doesn't have to bother with error
handling (allocation failure checking, making sure free happens in the
right spot, etc). This is core responsibility now.

Move dummy driver to leverage the core allocation.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agotg3: simplify tg3_phy_autoneg_cfg
Heiner Kallweit [Sun, 18 Feb 2024 18:04:42 +0000 (19:04 +0100)]
tg3: simplify tg3_phy_autoneg_cfg

Make use of ethtool_adv_to_mmd_eee_adv_t() to simplify the code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agotg3: copy only needed fields from userspace-provided EEE data
Heiner Kallweit [Sun, 18 Feb 2024 14:49:55 +0000 (15:49 +0100)]
tg3: copy only needed fields from userspace-provided EEE data

The current code overwrites fields in tp->eee with unchecked data from
edata, e.g. the bitmap with supported modes. ethtool properly returns
the received data from get_eee() call, but we have no guarantee that
other users of the ioctl set_eee() interface behave properly too.
Therefore copy only fields which are actually needed.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agoMerge branch 'net-constify-device_type'
David S. Miller [Wed, 21 Feb 2024 09:45:24 +0000 (09:45 +0000)]
Merge branch 'net-constify-device_type'

Ricardo B. Marliere says:

====================
net: constify struct device_type usage

This is a simple and straight forward cleanup series that makes all device
types in the net subsystem constants. This has been possible since 2011 [1]
but not all occurrences were cleaned. I have been sweeping the tree to fix
them all.

I was not sure if I should send these squashed, but there are quite a few
changes so I decided to send them separately. Please let me know if that is
not desirable.

[1] https://lore.kernel.org/all/1305850262-9575-5-git-send-email-gregkh@suse.de/

====================

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
7 months agonet: hso: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:34 +0000 (17:13 -0300)]
net: hso: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the hso_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: wwan: core: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:33 +0000 (17:13 -0300)]
net: wwan: core: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the wwan_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: netdevsim: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:32 +0000 (17:13 -0300)]
net: netdevsim: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
nsim_bus_dev_type variable to be a constant structure as well, placing it
into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: vlan: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:31 +0000 (17:13 -0300)]
net: vlan: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the vlan_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: l2tp: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:30 +0000 (17:13 -0300)]
net: l2tp: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the l2tpeth_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: hsr: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:29 +0000 (17:13 -0300)]
net: hsr: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the hsr_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: geneve: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:28 +0000 (17:13 -0300)]
net: geneve: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the geneve_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: ppp: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:27 +0000 (17:13 -0300)]
net: ppp: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the ppp_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: vxlan: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:26 +0000 (17:13 -0300)]
net: vxlan: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the vxlan_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: bridge: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:25 +0000 (17:13 -0300)]
net: bridge: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the br_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: dsa: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:24 +0000 (17:13 -0300)]
net: dsa: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the dsa_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: usbnet: constify the struct device_type usage
Ricardo B. Marliere [Sat, 17 Feb 2024 20:13:23 +0000 (17:13 -0300)]
net: usbnet: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the wlan_type
and wwan_type variables to be constant structures as well, placing it into
read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 months agonet: wan: framer: constify of_phandle_args in xlate
Krzysztof Kozlowski [Sat, 17 Feb 2024 10:03:06 +0000 (11:03 +0100)]
net: wan: framer: constify of_phandle_args in xlate

The xlate callbacks are supposed to translate of_phandle_args to proper
provider without modifying the of_phandle_args.  Make the argument
pointer to const for code safety and readability.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240217100306.86740-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
7 months agor8169: add MODULE_FIRMWARE entry for RTL8126A
Heiner Kallweit [Sat, 17 Feb 2024 14:48:23 +0000 (15:48 +0100)]
r8169: add MODULE_FIRMWARE entry for RTL8126A

Add the missing MODULE_FIRMWARE entry for RTL8126A.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/47ef79d2-59c4-4d44-9595-366c70c4ad87@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>