wifi: rtl8xxxu: Declare AP mode support for 8188f
authorMartin Kaistra <martin.kaistra@linutronix.de>
Fri, 28 Apr 2023 15:08:32 +0000 (17:08 +0200)
committerKalle Valo <kvalo@kernel.org>
Fri, 5 May 2023 07:30:15 +0000 (10:30 +0300)
Everything is in place now for AP mode, we can tell the system that we
support it. Put the feature behind a flag in priv->fops, because it is
not (yet) implemented for all chips.

Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230428150833.218605-18-martin.kaistra@linutronix.de
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c

index 1cf2ea4..296f345 100644 (file)
@@ -1943,6 +1943,7 @@ struct rtl8xxxu_fileops {
        u8 init_reg_hmtfr:1;
        u8 ampdu_max_time;
        u8 ustime_tsf_edca;
+       u8 supports_ap:1;
        u32 adda_1t_init;
        u32 adda_1t_path_on;
        u32 adda_2t_path_on_a;
index dbdfd77..7fd258b 100644 (file)
@@ -1748,6 +1748,7 @@ struct rtl8xxxu_fileops rtl8188fu_fops = {
        .init_reg_hmtfr = 1,
        .ampdu_max_time = 0x70,
        .ustime_tsf_edca = 0x28,
+       .supports_ap = 1,
        .adda_1t_init = 0x03c00014,
        .adda_1t_path_on = 0x03c00014,
        .trxff_boundary = 0x3f7f,
index aa430a9..71c715e 100644 (file)
@@ -7533,6 +7533,8 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
        hw->wiphy->max_scan_ssids = 1;
        hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
        hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
+       if (priv->fops->supports_ap)
+               hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP);
        hw->queues = 4;
 
        sband = &rtl8xxxu_supported_band;