On 19/04/2023 13:01, Martin Kaistra wrote: > Set maximum number of associated stations supported in AP mode. For > 8188f, the maximum number of supported macids is 16, reserve one for > broadcast/multicast frames. > > Signed-off-by: Martin Kaistra <martin.kaistra@xxxxxxxxxxxxx> > --- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 + > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c | 1 + > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 ++ > 3 files changed, 4 insertions(+) > > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > index 64e823f216967..e996168d0bfd1 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > @@ -1946,6 +1946,7 @@ struct rtl8xxxu_fileops { > u8 ampdu_max_time; > u8 ustime_tsf_edca; > u8 supports_ap:1; > + u16 max_sta_num; > u32 adda_1t_init; > u32 adda_1t_path_on; > u32 adda_2t_path_on_a; > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c > index 7dc2fd8aa5317..085721c734ae2 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c > @@ -1752,6 +1752,7 @@ struct rtl8xxxu_fileops rtl8188fu_fops = { > .ampdu_max_time = 0x70, > .ustime_tsf_edca = 0x28, > .supports_ap = 1, > + .max_sta_num = 16, > .adda_1t_init = 0x03c00014, > .adda_1t_path_on = 0x03c00014, > .trxff_boundary = 0x3f7f, > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > index bf471c3f98b86..6d0c775244274 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > @@ -7464,6 +7464,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; > + if (priv->fops->max_sta_num) > + hw->wiphy->max_ap_assoc_sta = priv->fops->max_sta_num - 1; The way you use it, "max_macid_num" would be a more accurate name. > hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); > if (priv->fops->supports_ap) > hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP);