RE: [PATCH rtw-next v3 2/3] wifi: rtlwifi: convert pci if-statement to ID table

From: Ping-Ke Shih

Date: Sun Jun 28 2026 - 22:01:53 EST


William Hansen-Baird <william.hansen.baird@xxxxxxxxx> wrote:
> Refactor the ASUSTek quirk logic from an if-statement to a standard
> rtl_aspm_quirks pci_device_id table. This allows future devices with
> the same quirk to be added more easily while avoiding a large if-chain.
>
> Signed-off-by: William Hansen-Baird <william.hansen.baird@xxxxxxxxx>

Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>


> ---
> drivers/net/wireless/realtek/rtlwifi/pci.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c
> b/drivers/net/wireless/realtek/rtlwifi/pci.c
> index 38eca8d91581..44121203671c 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -31,6 +31,12 @@ static const u8 ac_to_hwq[] = {
> BK_QUEUE
> };
>
> +static const struct pci_device_id rtl_aspm_quirks[] = {
> + /* ASUSTek F441U/X555UQ */
> + { PCI_DEVICE_SUB(PCI_VENDOR_ID_REALTEK, 0xb723, 0x11ad, 0x1723) },
> + { }

nit: we can just '{}' (without a space).

> +};
> +
> static u8 _rtl_mac_to_hwqueue(struct ieee80211_hw *hw, struct sk_buff *skb)
> {
> struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));