1 From 2bbd7d584046038ce655e476628bb15e1460fac6 Mon Sep 17 00:00:00 2001
2 From: Martin Kaistra <martin.kaistra@linutronix.de>
3 Date: Fri, 22 Dec 2023 11:14:23 +0100
4 Subject: [PATCH 02/21] wifi: rtl8xxxu: prepare supporting two virtual
7 To prepare for concurrent mode, add an array ("vifs") to rtl8xxxu_priv
8 to keep track of both interfaces.
10 Keep the old priv->vif as long there are still users of it and let
11 priv->vifs[0] point to the same location.
13 Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
14 Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
15 Signed-off-by: Kalle Valo <kvalo@kernel.org>
16 Link: https://msgid.link/20231222101442.626837-3-martin.kaistra@linutronix.de
18 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 ++
19 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 +++++++---
20 2 files changed, 9 insertions(+), 3 deletions(-)
22 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
23 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
24 @@ -1897,6 +1897,8 @@ struct rtl8xxxu_priv {
25 * is supported and no iface_combinations are provided.
27 struct ieee80211_vif *vif;
29 + struct ieee80211_vif *vifs[2];
30 struct delayed_work ra_watchdog;
31 struct work_struct c2hcmd_work;
32 struct sk_buff_head c2hcmd_queue;
33 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
34 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
35 @@ -6569,10 +6569,12 @@ static int rtl8xxxu_add_interface(struct
43 + priv->vifs[0] = vif;
49 case NL80211_IFTYPE_STATION:
50 @@ -6622,8 +6624,10 @@ static void rtl8xxxu_remove_interface(st
52 dev_dbg(&priv->udev->dev, "%s\n", __func__);
57 + priv->vifs[0] = NULL;
61 static int rtl8xxxu_config(struct ieee80211_hw *hw, u32 changed)