2024-03-26 01:48:39

by Ping-Ke Shih

[permalink] [raw]
Subject: [PATCH] wifi: rtw89: station mode only for SDIO chips

Since only station mode has been tested on SDIO chips, only keep it support
for SDIO chips to reflect correct supported features.

Link: https://lore.kernel.org/linux-wireless/[email protected]/T/#t
Link: https://lore.kernel.org/linux-wireless/[email protected]/
Cc: Martin Blumenstingl <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
---
Hi Martin,

I Cc'ed you to prevent you missing this patch that I disable AP mode.

---
drivers/net/wireless/realtek/rtw88/main.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 81ef4717dbf4..d1f0e7541bfa 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2203,6 +2203,7 @@ EXPORT_SYMBOL(rtw_core_deinit);

int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
{
+ bool sta_mode_only = rtwdev->hci.type == RTW_HCI_TYPE_SDIO;
struct rtw_hal *hal = &rtwdev->hal;
int max_tx_headroom = 0;
int ret;
@@ -2231,10 +2232,13 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
ieee80211_hw_set(hw, TX_AMSDU);
ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS);

- hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
- BIT(NL80211_IFTYPE_AP) |
- BIT(NL80211_IFTYPE_ADHOC) |
- BIT(NL80211_IFTYPE_MESH_POINT);
+ if (sta_mode_only)
+ hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
+ else
+ hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
+ BIT(NL80211_IFTYPE_AP) |
+ BIT(NL80211_IFTYPE_ADHOC) |
+ BIT(NL80211_IFTYPE_MESH_POINT);
hw->wiphy->available_antennas_tx = hal->antenna_tx;
hw->wiphy->available_antennas_rx = hal->antenna_rx;

@@ -2245,7 +2249,7 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
hw->wiphy->max_scan_ssids = RTW_SCAN_MAX_SSIDS;
hw->wiphy->max_scan_ie_len = rtw_get_max_scan_ie_len(rtwdev);

- if (rtwdev->chip->id == RTW_CHIP_TYPE_8822C) {
+ if (!sta_mode_only && rtwdev->chip->id == RTW_CHIP_TYPE_8822C) {
hw->wiphy->iface_combinations = rtw_iface_combs;
hw->wiphy->n_iface_combinations = ARRAY_SIZE(rtw_iface_combs);
}
--
2.25.1



2024-03-26 19:35:05

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH] wifi: rtw89: station mode only for SDIO chips

Hello Ping-Ke,

On Tue, Mar 26, 2024 at 2:48 AM Ping-Ke Shih <[email protected]> wrote:
>
> Since only station mode has been tested on SDIO chips, only keep it support
> for SDIO chips to reflect correct supported features.
Overall I'm fine with this patch, thanks for taking care of it!

I only have one small comment: the subject line should start with
"wifi: rtw88: ..." (currently it states rtw89)
With that changed:
Acked-by: Martin Blumenstingl <[email protected]>

Also I'm hoping that some people will step up and find the missing
link to get AP mode working on SDIO chips. I currently don't have time
for this.


Best regards,
Martin

2024-03-27 00:41:50

by Ping-Ke Shih

[permalink] [raw]
Subject: Re: [PATCH] wifi: rtw89: station mode only for SDIO chips

On Tue, 2024-03-26 at 20:34 +0100, Martin Blumenstingl wrote:
>
> Hello Ping-Ke,
>
> On Tue, Mar 26, 2024 at 2:48 AM Ping-Ke Shih <[email protected]> wrote:
> > Since only station mode has been tested on SDIO chips, only keep it support
> > for SDIO chips to reflect correct supported features.
> Overall I'm fine with this patch, thanks for taking care of it!
>
> I only have one small comment: the subject line should start with
> "wifi: rtw88: ..." (currently it states rtw89)

Ah. Somehow I made this mistake. I'm adding a rule to avoid this in my scripts
locally. Thanks for pointing out this.


> With that changed:
> Acked-by: Martin Blumenstingl <[email protected]>
>
> Also I'm hoping that some people will step up and find the missing
> link to get AP mode working on SDIO chips. I currently don't have time
> for this.
>

I hope so. Thanks for the effort you have made. :)

Ping-Ke