Backporting upstream patches to improve RTL8188F support. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
68 lines
2.2 KiB
Diff
68 lines
2.2 KiB
Diff
From 3ff7a05996f901a7a10068b42e9dc8435f908a4c Mon Sep 17 00:00:00 2001
|
|
From: Martin Kaistra <martin.kaistra@linutronix.de>
|
|
Date: Fri, 22 Dec 2023 11:14:30 +0100
|
|
Subject: [PATCH 09/21] wifi: rtl8xxxu: support setting bssid register for
|
|
multiple interfaces
|
|
|
|
To prepare for concurrent mode, enhance rtl8xxxu_set_bssid() to write the
|
|
BSSID of the respective interface to REG_BSSID or REG_BSSID1.
|
|
|
|
Like done with rtl8xxxu_set_mac(), call rtl8xxxu_set_bssid() with
|
|
port_num = 0, until the callers also support multiple interfaces.
|
|
|
|
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://msgid.link/20231222101442.626837-10-martin.kaistra@linutronix.de
|
|
---
|
|
.../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 18 ++++++++++++++----
|
|
1 file changed, 14 insertions(+), 4 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
|
|
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
|
|
@@ -3603,14 +3603,24 @@ static int rtl8xxxu_set_mac(struct rtl8x
|
|
return 0;
|
|
}
|
|
|
|
-static int rtl8xxxu_set_bssid(struct rtl8xxxu_priv *priv, const u8 *bssid)
|
|
+static int rtl8xxxu_set_bssid(struct rtl8xxxu_priv *priv, const u8 *bssid, int port_num)
|
|
{
|
|
int i;
|
|
u16 reg;
|
|
|
|
dev_dbg(&priv->udev->dev, "%s: (%pM)\n", __func__, bssid);
|
|
|
|
- reg = REG_BSSID;
|
|
+ switch (port_num) {
|
|
+ case 0:
|
|
+ reg = REG_BSSID;
|
|
+ break;
|
|
+ case 1:
|
|
+ reg = REG_BSSID1;
|
|
+ break;
|
|
+ default:
|
|
+ WARN_ONCE("%s: invalid port_num\n", __func__);
|
|
+ return -EINVAL;
|
|
+ }
|
|
|
|
for (i = 0; i < ETH_ALEN; i++)
|
|
rtl8xxxu_write8(priv, reg + i, bssid[i]);
|
|
@@ -5068,7 +5078,7 @@ rtl8xxxu_bss_info_changed(struct ieee802
|
|
|
|
if (changed & BSS_CHANGED_BSSID) {
|
|
dev_dbg(dev, "Changed BSSID!\n");
|
|
- rtl8xxxu_set_bssid(priv, bss_conf->bssid);
|
|
+ rtl8xxxu_set_bssid(priv, bss_conf->bssid, 0);
|
|
}
|
|
|
|
if (changed & BSS_CHANGED_BASIC_RATES) {
|
|
@@ -5097,7 +5107,7 @@ static int rtl8xxxu_start_ap(struct ieee
|
|
struct device *dev = &priv->udev->dev;
|
|
|
|
dev_dbg(dev, "Start AP mode\n");
|
|
- rtl8xxxu_set_bssid(priv, vif->bss_conf.bssid);
|
|
+ rtl8xxxu_set_bssid(priv, vif->bss_conf.bssid, 0);
|
|
rtl8xxxu_write16(priv, REG_BCN_INTERVAL, vif->bss_conf.beacon_int);
|
|
priv->fops->report_connect(priv, RTL8XXXU_BC_MC_MACID, 0, true);
|
|
|