1 From 1cd165adf314f6bf25cde58f02f4ff51d01730b0 Mon Sep 17 00:00:00 2001
2 From: Martin Kaistra <martin.kaistra@linutronix.de>
3 Date: Fri, 22 Dec 2023 11:14:42 +0100
4 Subject: [PATCH 21/21] wifi: rtl8xxxu: declare concurrent mode support for
7 Everything is in place now for concurrent mode, we can tell the system
9 We will allow a maximum of 2 virtual interfaces, one of them can be in
12 Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
13 Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
14 Signed-off-by: Kalle Valo <kvalo@kernel.org>
15 Link: https://msgid.link/20231222101442.626837-22-martin.kaistra@linutronix.de
17 .../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
18 .../realtek/rtl8xxxu/rtl8xxxu_8188f.c | 1 +
19 .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 19 +++++++++++++++++++
20 3 files changed, 21 insertions(+)
22 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
23 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
24 @@ -1992,6 +1992,7 @@ struct rtl8xxxu_fileops {
25 u8 init_reg_rxfltmap:1;
26 u8 init_reg_pkt_life_time:1;
28 + u8 supports_concurrent:1;
32 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c
33 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c
34 @@ -1752,6 +1752,7 @@ struct rtl8xxxu_fileops rtl8188fu_fops =
37 .max_sec_cam_num = 16,
38 + .supports_concurrent = 1,
39 .adda_1t_init = 0x03c00014,
40 .adda_1t_path_on = 0x03c00014,
41 .trxff_boundary = 0x3f7f,
42 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
43 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
44 @@ -7665,6 +7665,20 @@ static void rtl8xxxu_deinit_led(struct r
45 led_classdev_unregister(led);
48 +struct ieee80211_iface_limit rtl8xxxu_limits[] = {
49 + { .max = 2, .types = BIT(NL80211_IFTYPE_STATION), },
50 + { .max = 1, .types = BIT(NL80211_IFTYPE_AP), },
53 +struct ieee80211_iface_combination rtl8xxxu_combinations[] = {
55 + .limits = rtl8xxxu_limits,
56 + .n_limits = ARRAY_SIZE(rtl8xxxu_limits),
57 + .max_interfaces = 2,
58 + .num_different_channels = 1,
62 static int rtl8xxxu_probe(struct usb_interface *interface,
63 const struct usb_device_id *id)
65 @@ -7810,6 +7824,11 @@ static int rtl8xxxu_probe(struct usb_int
66 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP);
69 + if (priv->fops->supports_concurrent) {
70 + hw->wiphy->iface_combinations = rtl8xxxu_combinations;
71 + hw->wiphy->n_iface_combinations = ARRAY_SIZE(rtl8xxxu_combinations);
74 sband = &rtl8xxxu_supported_band;
75 sband->ht_cap.ht_supported = true;
76 sband->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;