StanleyYP Wang [Mon, 13 Nov 2023 07:06:15 +0000 (15:06 +0800)]
wifi: mt76: mt7996: rework register offsets for mt7992
Add mt7992_offs to differentiate registers that share the same
definitions with mt7996 chipsets but have differnet offsets.
This is a preliminary patch for mt7992 chipsets support.
Shayne Chen [Mon, 13 Nov 2023 07:06:12 +0000 (15:06 +0800)]
wifi: mt76: mt7996: introduce mt7996_band_valid()
Replace dbdc_support and tbtc_support with mt7996_band_valid() to
support mt7996 variants with band0/band2 dual-band support.
This changes reduces ambiguity when checking supported bands on different
variants or new chipsets, as well as during the init configurations on
DMA TX/RX queues or irq masks.
The internal struct and union inside mt7996_mcu_all_sta_info_event is
marked as being aligned, which conflicts with it being unaligned
within that structure:
drivers/net/wireless/mediatek/mt76/mt7996/mcu.h:165:2: error: field within 'struct mt7996_mcu_all_sta_info_event' is less aligned than 'union mt7996_mcu_all_sta_info_event::(anonymous at ../drivers/net/wireless/mediatek/mt76/mt7996/mcu.h:165:2)' and is usually due to 'struct mt7996_mcu_all_sta_info_event' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
Mark all three as being packed as well to ensure byte packing for
the entire thing.
Fixes: adde3eed4a75 ("wifi: mt76: mt7996: Add mcu commands for getting sta tx statistic") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
StanleyYP Wang [Mon, 6 Nov 2023 22:39:31 +0000 (22:39 +0000)]
wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band
Just like MT7916 also MT7981 can handle 3T3R DBDC frontend and should
hence be included in the corresponding conditional expression in the
driver. Add it.
Fixes: 6bad146d162e ("wifi: mt76: mt7915: add support for MT7981") Signed-off-by: StanleyYP Wang <[email protected]> Signed-off-by: Daniel Golle <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
StanleyYP Wang [Mon, 6 Nov 2023 22:38:53 +0000 (22:38 +0000)]
wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981
The offset of the TSSI flag on the EEPROM of MT7981 devices was wrong.
Set the correct offset instead.
Fixes: 6bad146d162e ("wifi: mt76: mt7915: add support for MT7981") Signed-off-by: StanleyYP Wang <[email protected]> Signed-off-by: Daniel Golle <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
MeiChia Chiu [Thu, 2 Nov 2023 10:03:02 +0000 (18:03 +0800)]
wifi: mt76: connac: fix EHT phy mode check
Add a BSS eht_support check before returning EHT phy mode. Without this
patch, there might be an inconsistency where the softmac layer thinks
the BSS is in HE mode, while the FW thinks it is in EHT mode.
Peter Chiu [Thu, 2 Nov 2023 10:03:00 +0000 (18:03 +0800)]
wifi: mt76: mt7996: rework ampdu params setting
Add sta_rec_ht_uni struct to pass HT ampdu params to firmware. For VHT,
HE, and EHT mode, firmware will get the ampdu params by parsing the
corresponding capability.
Shayne Chen [Thu, 2 Nov 2023 10:02:55 +0000 (18:02 +0800)]
wifi: mt76: change txpower init to per-phy
Use per-phy structure for maximum txpower value initializing, since each
phy may have a different chainmask, which can impact the calculation of
power gain.
MeiChia Chiu [Mon, 23 Oct 2023 15:38:54 +0000 (23:38 +0800)]
wifi: mt76: mt7996: fix rate usage of inband discovery frames
For UBPR and FILS frames, the BSS_CHANGED_BEACON flag will also be set,
which causes those frames to use the beacon rate in TX descriptors.
Adjust the statement to fix this issue.
Howard Hsu [Mon, 23 Oct 2023 15:38:51 +0000 (23:38 +0800)]
wifi: mt76: connac: set fixed_bw bit in TX descriptor for fixed rate frames
Always set the fixed_bw bitfield for fixed rate frames to keep it being
sent with specific bandwidth. Without this change, the bw of fixed rate
frames will still be decided by hardware.
StanleyYP Wang [Mon, 23 Oct 2023 15:38:48 +0000 (23:38 +0800)]
wifi: mt76: connac: add beacon duplicate TX mode support for mt7996
For connac3 chipsets, setting of spe_idx is moved from TX descriptor to
the fixed rate table. This patch implements the setting to support
duplicate TX mode for beacon.
Howard Hsu [Mon, 23 Oct 2023 15:38:47 +0000 (23:38 +0800)]
wifi: mt76: mt7996: add thermal sensor device support
This patch adds support for thermal sensor device, including the
following features:
- Support to read current chip temperature.
- Support to set/get the trigger/restore temperature for thermal service.
- Support to read current chip tx cycle.
Shayne Chen [Mon, 23 Oct 2023 15:38:44 +0000 (23:38 +0800)]
wifi: mt76: mt7996: add support for variants with auxiliary RX path
Add support to correctly configure the rx chainmask of variants that
have additional auxiliary RX path. e.g., 4T5R.
The auxiliary RX path is transparent to driver, but driver needs to
correctly configure it in the set channel fw command.
Lorenzo Bianconi [Fri, 20 Oct 2023 10:45:19 +0000 (12:45 +0200)]
wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init()
mt76 assumes mt7915_mmio_wed_init can fail just after wed driver has
been attached running mtk_wed_device_attach().
Fall back to non-wed mode if platform_get_resource fails in
mt7915_mmio_wed_init routines.
Fixes: eebb70976be5 ("wifi: mt76: mt7915: enable wed for mt7986-wmac chipset") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
Lorenzo Bianconi [Fri, 20 Oct 2023 10:30:52 +0000 (12:30 +0200)]
wifi: mt76: introduce wed pointer in mt76_queue
Introduce mtk_wed_device pointer in mt76_queue structure in order to
configure WED chip.
Get rid of dev parameter in Q_READ and Q_WRITE macros.
Introduce wed parameter to the following routine signatures:
- mt76_init_queue
- mt76_init_tx_queue
This is a preliminary patch to introduce WED support for mt7996 since
mt7996 runs two separate WED chips.
Lorenzo Bianconi [Fri, 20 Oct 2023 10:30:48 +0000 (12:30 +0200)]
wifi: mt76: mmio: move mt76_mmio_wed_{init,release}_rx_buf in common code
Move mt76_mmio_wed_init_rx_buf and mt76_mmio_wed_release_rx_buf routines
in common code.
This is a preliminary patch to introduce WED support for mt7996
wifi: mt76: limit support of precal loading for mt7915 to MTD only
Limit support for precal loading for mt7915 only to MTD. Passing data
from DT doesn't support offset and NVMEM require a different cell name
and doesn't support offset hence only MTD way is actually supported.
Rename mt76_get_of_eeprom_from_mtd to mt76_get_of_data_from_mtd as it is
now used for a more generic purpose and export it.
wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function
Fix typo in mt76_get_of_eeprom_from_nvmem where eeprom was misspelled as
epprom.
Fixes: 5bef3a406c6e ("wifi: mt76: add support for providing eeprom in nvmem cells") Signed-off-by: Christian Marangi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
wifi: mt76: fix broken precal loading from MTD for mt7915
Commit 495184ac91bb ("mt76: mt7915: add support for applying
pre-calibration data") was fundamentally broken and never worked.
The idea (before NVMEM support) was to expand the MTD function and pass
an additional offset. For normal EEPROM load the offset would always be
0. For the purpose of precal loading, an offset was passed that was
internally the size of EEPROM, since precal data is right after the
EEPROM.
Problem is that the offset value passed is never handled and is actually
overwrite by
offset = be32_to_cpup(list);
ret = mtd_read(mtd, offset, len, &retlen, eep);
resulting in the passed offset value always ingnored. (and even passing
garbage data as precal as the start of the EEPROM is getting read)
Fix this by adding to the current offset value, the offset from DT to
correctly read the piece of data at the requested location.
Cc: [email protected] Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data") Signed-off-by: Christian Marangi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
Rong Yan [Sun, 1 Oct 2023 15:02:05 +0000 (23:02 +0800)]
wifi: mt76: mt7921: support 5.9/6GHz channel config in acpi
The mtcl table, configured by platform vendor, provides regulatory
information for 5.9/6 GHz channels. mt792x should work on
corresponding channels supported by mtcl. This patch would parse
the settings in mtcl table and apply the result into chip side.
Ping-Ke Shih [Mon, 4 Dec 2023 08:07:51 +0000 (16:07 +0800)]
wifi: rtw89: mac: refine SER setting during WiFi CPU power on
Don't enable firmware debug mode to prevent SER flow stuck due to fail
to reset payload buffer, and clear HALT_C2H_INT to avoid handling
unexpected interrupt at beginning.
Chia-Yuan Li [Mon, 4 Dec 2023 08:07:50 +0000 (16:07 +0800)]
wifi: rtw89: 8922a: dump MAC registers when SER occurs
To diagnose the reason why firmware or hardware get abnormal, add to dump
MAC registers related to counters and interrupt masks. With these values,
people can classify problems and check if registers values are unexpected,
and then correct them. However, it could possible false alarm because
firmware triggers this SER event by wrong conditions that we should
correct it at firmware or register settings.
In field, SER might happen under special conditions, and very hard to
happen again, so dump lots of registers to provide rich information to
catch the problem.
Ping-Ke Shih [Mon, 4 Dec 2023 08:07:49 +0000 (16:07 +0800)]
wifi: rtw89: 8922a: add SER IMR tables
To activate SER (system error recovery) in firmware, we have to configure
IMR to trigger interrupts, and then SER can check registers to know if it
need to reset hardware or notify driver to re-configure whole settings.
RTL8922A FW supports CRASH_TRIGGER feature from v0.34.30.0.
After it, debugfs fw_crash can accept type 1 on RTL8922A to
trigger firmware crash and verify L2 recovery.
Besides, RTL8922A sync address offset of reserved payload engine.
And, SER (system error recovery) tweaks conversion from WCPU address
to indirect access address for RTL8922A. The new conversion works
for all supported chips.
clang-struct [1] found that ee_antenna in struct ath5k_eeprom_info is
unused. The commit 1048643ea94d ("ath5k: Clean up eeprom
parsing and add missing calibration data") added it, but did not use it
in any way. Neither, there is a later user.
James Prestwood [Tue, 5 Dec 2023 15:15:36 +0000 (17:15 +0200)]
wifi: ath10k: add support to allow broadcast action frame RX
Broadcast action frames are needed for the Device Provisioning
Protocol (DPP) for Presence and PKEX Exchange requests. Currently
just ath9k has this capability so this is being enabled for
ath10k (for at least one hardware variant).
Add a new capability flag in ath10k_hw_params to indicate support
for receiving multicast action frames. This bit is then checked
when configuring the RX filter and (if set) multicast action frame
registration is enabled.
Until more hardware can be tested only the "qca6174 hw3.2" variant
is enabling this feature.
Note: I went ahead and removed the 'changed_flags' mask operation
since it had no effect, that parameter was not being used anywhere.
Currently repeated access of wiphy data from mac80211 hw structure is
happen inside the mac80211 registration helper functions. So optimize
these helper functions by storing wiphy data locally and accessing it
directly.
Kang Yang [Fri, 1 Dec 2023 16:09:48 +0000 (18:09 +0200)]
wifi: ath12k: fix and enable AP mode for WCN7850
For AP mode, the peer is created earlier in ath12k_mac_op_add_interface() but
ath12k_mac_op_assign_vif_chanctx() will try to create peer again. Then an
error will return which makes AP mode startup fail.
Kernel log:
[ 5017.665006] ath12k_pci 0000:04:00.0: failed to create peer after vdev start delay: -22
wpa_supplicant log:
Failed to set beacon parameters
Interface initialization failed
wls1: interface state UNINITIALIZED->DISABLED
wls1: AP-DISABLED
wls1: Unable to setup interface.
Failed to initialize AP interface
wls1: interface state DISABLED->DISABLED
wls1: AP-DISABLED
So fix this check and enable AP mode for WCN7850, as now AP mode works normally.
Kang Yang [Fri, 1 Dec 2023 16:09:48 +0000 (18:09 +0200)]
wifi: ath12k: set IRQ affinity to CPU0 in case of one MSI vector
With VT-d disabled on Intel platform, ath12k gets only one MSI
vector. In that case, ath12k does not free IRQ when doing suspend,
hence the kernel has to migrate it to CPU0 (if it was affine to
other CPUs) and allocates a new MSI vector. However, ath12k has
no chance to reconfig it to HW srngs during this phase, thus
ath12k fails to resume.
This issue can be fixed by setting IRQ affinity to CPU0 before
request_irq is called. With such affinity, migration will not
happen and thus the vector keeps unchanged during suspend/resume.
Kang Yang [Fri, 1 Dec 2023 16:09:47 +0000 (18:09 +0200)]
wifi: ath12k: do not restore ASPM in case of single MSI vector
Current code enables ASPM by default, it allows MHI to enter M2 state.
In case of one MSI vector, system hang is observed if ath12k does MHI
register reading in this state.
The workaround here is to prevent MHI from entering M2 state, this can
be done by disabling ASPM if only one MSI vector is used. When using 32
vectors ASPM is enabled as before.
Kang Yang [Fri, 1 Dec 2023 16:09:47 +0000 (18:09 +0200)]
wifi: ath12k: add support one MSI vector
On some platforms it's not possible to allocate 32 MSI vectors for
various reasons, maybe kernel configuration, VT-d disabled, buggy BIOS
etc. So ath12k was not able to use WCN7850 PCI devices on those
platforms. Add support for one MSI vector to solve that.
In case of one MSI vector, interrupt migration needs to be disabled.
This is because when interrupt migration happens, the msi_data may
change. However, msi_data is already programmed to rings during initial
phase and ath12k has no way to know that msi_data is changed during run
time and reprogram again.
In case of one MSI vector, MHI subsystem should not use IRQF_NO_SUSPEND
as WCN7850 doesn't set this flag too. Ath12k doesn't need to leave IRQ
enabled in suspend state.
Kang Yang [Fri, 1 Dec 2023 16:09:47 +0000 (18:09 +0200)]
wifi: ath12k: add CE and ext IRQ flag to indicate irq_handler
Add two flags to indicate whether IRQ handler for CE and DP can be called.
This is because in one MSI vector case, interrupt is not disabled in
hif_stop and hif_irq_disable. So if interrupt is disabled, MHI interrupt
is disabled too.
Kang Yang [Fri, 1 Dec 2023 16:09:47 +0000 (18:09 +0200)]
wifi: ath12k: get msi_data again after request_irq is called
The reservation mode of interrupts in kernel assigns a dummy vector
when the interrupt is allocated and assigns a real vector when the
request_irq is called. The reservation mode helps to ease vector
pressure when devices with a large amount of queues/interrupts are
initialized, but only a minimal subset of those queues/interrupts
is actually used.
So on reservation mode, the msi_data may change after request_irq is
called, then it will lead to spurious interrupt. But when VT-d in
BIOS is enabled and ath12k can get 32 MSI vectors, ath12k always get
the same msi_data before and after request_irq.
So in case of one MSI vector, ath12k need read msi_data again after
request_irq is called, and then the correct msi_data is programmed
into WCN7850 hardware components.
Uwe Kleine-König [Fri, 17 Nov 2023 09:31:01 +0000 (10:31 +0100)]
wifi: wcn36xx: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Uwe Kleine-König [Fri, 17 Nov 2023 09:30:59 +0000 (10:30 +0100)]
wifi: ath5k: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Currently, the helper functions are accessing mac80211 hw data from the
radio (ar) structure repeatedly. So optimize these helper functions by
storing mac80211 hw data locally and accessing it directly.
wifi: ath12k: Optimize the mac80211 hw data access
Currently mac80211 hw data is accessed by convert the hw to radio (ar)
structure and then radio to hw structure which is not necessary in some
places where mac80211 hw data is already present. So in that kind of
places avoid the conversion and directly access the mac80211 hw data.
Muna Sinada [Thu, 30 Nov 2023 17:09:51 +0000 (19:09 +0200)]
wifi: ath12k: add 320 MHz bandwidth enums
Add 320 MHz bandwidth as a new bandwidth enum for ATH12k driver. This
is extending existing bandwidth related enums to include 320 MHz. This
is a precursor to supporting 320 MHz in the future.
Sanity test performed to confirm that there was no impact in existing
bandwidths.
Additionally update QuIC copyright to include 2023 in hal_rx.h.
Chih-Kang Chang [Wed, 29 Nov 2023 07:00:46 +0000 (15:00 +0800)]
wifi: rtw89: fix misbehavior of TX beacon in concurrent mode
In concurrent mode, when STA interface is scanning, it causes
AP interface TX beacon on wrong channel. We modified it to scan
with the operating channel when one of the interfaces is already
connected. Additionally, STA interface need to stop scan when AP
interface is starting to avoid TX beacon on wrong channel. Finally,
AP interface need to stop TX beacon when STA interface is scanning
and switching to non-OP channel,This prevent other device to get
beacons on wrong channel.
Chih-Kang Chang [Wed, 29 Nov 2023 07:00:45 +0000 (15:00 +0800)]
wifi: rtw89: refine remain on channel flow to improve P2P connection
We add a scanning check to avoid entering IPS after ROC (remain on
channel) during scanning. Additionally, When P2P scanning, the flow is
`1. p2p_listen step` and `2. configure filter` and `3. p2p_scan starts`
in wpas, but in kernel, cfg80211 uses another workqueue to notify driver
the filter change, so sometimes we see (1 > 3 > 2), that will cause Rx
filter related to scan to be cleared. Therefore, we add a scanning check
when configure filter to avoid scan results to be filtered. Finally, we
cancel the ROC delayed workqueue before entering ROC to avoid entering
twice, which might cause leaving ROC too early.
Po-Hao Huang [Wed, 29 Nov 2023 07:00:44 +0000 (15:00 +0800)]
wifi: rtw89: Refine active scan behavior in 6 GHz
The interval between sending each probe request is regulated. Before
this patch, some packets are not sent out properly because of our HW
limit. Extend the 6 GHz channel dwell time to cope with this.
Po-Hao Huang [Wed, 29 Nov 2023 07:00:43 +0000 (15:00 +0800)]
wifi: rtw89: fix not entering PS mode after AP stops
The attempt to enter power save mode might fail if there are still
beacons pending in the queue. This sometimes happens after stopping
P2P GO or AP mode. Extend stop AP function and flush all beacons to
resolve this.
We can run PCI/MMIO devices together with USB devices in the system.
Make watchdog parameter per device to avoid situation when plugin
USB device change modparam_watchdog for PCI/MMIO device.
Ilpo Järvinen [Fri, 24 Nov 2023 08:47:19 +0000 (10:47 +0200)]
wifi: rtlwifi: rtl8821ae: Remove unnecessary PME_Status bit set
BIT(7) (PME_Status) is first checked and then set unnecessarily. Remove
the unnecessary setting for the bit that is already on and adjust the
comment related to it.
Ilpo Järvinen [Fri, 24 Nov 2023 08:47:17 +0000 (10:47 +0200)]
wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors
The rtlwifi driver comes with custom code to write into PCIe Link
Control register. RMW access for the Link Control register requires
locking that is already provided by the standard PCIe capability
accessors.
Convert the custom RMW code writing into LNKCTL register to standard
RMW capability accessors. The accesses are changed to cover the full
LNKCTL register instead of touching just a single byte of the register.
Ilpo Järvinen [Fri, 24 Nov 2023 08:47:16 +0000 (10:47 +0200)]
wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code
Ever since introduction in the commit 0c8173385e54 ("rtl8192ce: Add new
driver") the rtlwifi code has, according to comments, attempted to
disable/enable ASPM of the upstream bridge by writing into its LNKCTL
register. However, the code has never been correct because it performs
the writes to the device instead of the upstream bridge.
Worse yet, the offset where the PCIe capabilities reside is derived
from the offset of the upstream bridge. As a result, the write will use
an offset on the device that does not relate to the LNKCTL register
making the ASPM disable/enable code outright dangerous.
Because of those problems, there is no indication that the driver needs
disable/enable ASPM on the upstream bridge. As the Capabilities offset
is not correctly calculated for the write to target device's LNKCTL
register, the code is not disabling/enabling device's ASPM either.
Therefore, just remove the upstream bridge related ASPM disable/enable
code entirely.
The upstream bridge related ASPM code was the only user of the struct
mp_adapter members num4bytes, pcibridge_pciehdr_offset, and
pcibridge_linkctrlreg so those are removed as well.
Note: This change does not remove the code related to changing the
device's ASPM on purpose (which is independent of this flawed code
related to upstream bridge's ASPM).
wifi: rtw88: sdio: Honor the host max_req_size in the RX path
Lukas reports skb_over_panic errors on his Banana Pi BPI-CM4 which comes
with an Amlogic A311D (G12B) SoC and a RTL8822CS SDIO wifi/Bluetooth
combo card. The error he observed is identical to what has been fixed
in commit e967229ead0e ("wifi: rtw88: sdio: Check the HISR RX_REQUEST
bit in rtw_sdio_rx_isr()") but that commit didn't fix Lukas' problem.
Lukas found that disabling or limiting RX aggregation works around the
problem for some time (but does not fully fix it). In the following
discussion a few key topics have been discussed which have an impact on
this problem:
- The Amlogic A311D (G12B) SoC has a hardware bug in the SDIO controller
which prevents DMA transfers. Instead all transfers need to go through
the controller SRAM which limits transfers to 1536 bytes
- rtw88 chips don't split incoming (RX) packets, so if a big packet is
received this is forwarded to the host in it's original form
- rtw88 chips can do RX aggregation, meaning more multiple incoming
packets can be pulled by the host from the card with one MMC/SDIO
transfer. This Depends on settings in the REG_RXDMA_AGG_PG_TH
register (BIT_RXDMA_AGG_PG_TH limits the number of packets that will
be aggregated, BIT_DMA_AGG_TO_V1 configures a timeout for aggregation
and BIT_EN_PRE_CALC makes the chip honor the limits more effectively)
Use multiple consecutive reads in rtw_sdio_read_port() and limit the
number of bytes which are copied by the host from the card in one
MMC/SDIO transfer. This allows receiving a buffer that's larger than
the hosts max_req_size (number of bytes which can be transferred in
one MMC/SDIO transfer). As a result of this the skb_over_panic error
is gone as the rtw88 driver is now able to receive more than 1536 bytes
from the card (either because the incoming packet is larger than that
or because multiple packets have been aggregated).
In case of an receive errors (-EILSEQ has been observed by Lukas) we
need to drain the remaining data from the card's buffer, otherwise the
card will return corrupt data for the next rtw_sdio_read_port() call.
Ping-Ke Shih [Fri, 24 Nov 2023 07:17:02 +0000 (15:17 +0800)]
wifi: rtw89: mac: use pointer to access functions of hardware engine and quota
To share flow with WiFi 7 chips, abstract functions related hardware
engines and their quota, so use pointer to access them. This doesn't change
logic at all.
Ping-Ke Shih [Fri, 24 Nov 2023 07:17:01 +0000 (15:17 +0800)]
wifi: rtw89: mac: move code related to hardware engine to individual functions
WiFi 7 chips will use the same functionalities but different registers to
control hardware components, so move these stuff into functions, and then
we can implement these for WiFi 7 chips later. This patch doesn't change
logic.
Zong-Zhe Yang [Fri, 24 Nov 2023 07:17:00 +0000 (15:17 +0800)]
wifi: rtw89: mac: check queue empty according to chip gen
This function, currently called by WoWLAN flow, polls until specific HW
queues are empty. The polling bit definitions are not totally the same
between WiFi 6 and 7 chips. In addition, the check conditions are also
a little different. So, we differentiate the implementations according to
chip gen.
Zong-Zhe Yang [Fri, 24 Nov 2023 07:16:59 +0000 (15:16 +0800)]
wifi: rtw89: refine element naming used by queue empty check
In queue empty check, one group contains 32 queues. And, the two elements,
wde_qempty_acq_num and wde_qempty_mgq_sel, are number of group and select
of group. To avoid confusing them with queue number and queue selection,
we refine their naming.
Ping-Ke Shih [Fri, 24 Nov 2023 07:16:58 +0000 (15:16 +0800)]
wifi: rtw89: add reserved size as factor of DLE used size
DLE stands for Double Link Engine that is used to maintain buffer page.
To avoid linking to wrong pages, we check the used page size during
initialization and stop driver probe if the used size is unexpected.
Currently, we check the page size used by PLE (payload engine) and WDE
(WiFi descriptor engine). For coming WiFi 7 chips, additional reserved
size is added for BB as buffer to run LA mode, so add and check the
reserved size as well.
Ping-Ke Shih [Fri, 24 Nov 2023 07:16:56 +0000 (15:16 +0800)]
wifi: rtw89: 8922a: extend and add quota number
Define 8922A buffer quota that are used by HCI control flow, payload
engine, descriptor engine and etc for operation modes, such as SCC (single
channel concurrence) and download firmware. Since WiFi 7 chips has more
buffer classifications, add fields and struct according to design.
Justin Stitt [Thu, 19 Oct 2023 17:44:59 +0000 (17:44 +0000)]
wifi: iwlwifi: fw: replace deprecated strncpy with strscpy_pad
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.
Based on the deliberate `sizeof(dest) ... - 1` pattern we can see that
both dump_info->dev_human_readable and dump_info->bus_human_readable are
intended to be NUL-terminated.
Moreover, since this seems to cross the file boundary let's NUL-pad to
ensure no behavior change.
strscpy_pad() covers both the NUL-termination and NUL-padding, let's use
it.
Ping-Ke Shih [Wed, 22 Nov 2023 06:04:57 +0000 (14:04 +0800)]
wifi: rtw89: debug: add debugfs entry to disable dynamic mechanism
A dynamic mechanism is usually an algorithm to adjust registers to adapt
to different environment every two seconds. In field, it could get
unexpected result, so we need to stop it and adjust registers manually, and
then fine tune the algorithm.
To stop mechanisms to assist debugging, add a debugfs entry shown as