diff mbox series

[RFC,10/14] wifi: rtl8xxxu: Add sta_add() callback

Message ID 20230322171905.492855-11-martin.kaistra@linutronix.de
State New
Headers show
Series wifi: rtl8xxxu: Add AP mode support for 8188f | expand

Commit Message

Martin Kaistra March 22, 2023, 5:19 p.m. UTC
This function gets called in AP mode, when a new STA gets associated to
us. Call rtl8xxxu_refresh_rate_mask() to set a rate mask for the newly
connected STA (referenced by the macid) and then send a media connnect
report.

Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
---
 .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Ping-Ke Shih March 27, 2023, 1:56 a.m. UTC | #1
> -----Original Message-----
> From: Martin Kaistra <martin.kaistra@linutronix.de>
> Sent: Thursday, March 23, 2023 1:19 AM
> To: linux-wireless@vger.kernel.org
> Cc: Jes Sorensen <Jes.Sorensen@gmail.com>; Kalle Valo <kvalo@kernel.org>; Ping-Ke Shih
> <pkshih@realtek.com>; Bitterblue Smith <rtl8821cerfe2@gmail.com>; Sebastian Andrzej Siewior
> <bigeasy@linutronix.de>
> Subject: [RFC PATCH 10/14] wifi: rtl8xxxu: Add sta_add() callback
> 
> This function gets called in AP mode, when a new STA gets associated to
> us. Call rtl8xxxu_refresh_rate_mask() to set a rate mask for the newly
> connected STA (referenced by the macid) and then send a media connnect
> report.
> 
> Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>

> ---
>  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c  | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 5e36fddbbb488..d74a3c6452507 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -7159,6 +7159,19 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw)
>         rtl8xxxu_free_tx_resources(priv);
>  }
> 
> +static int rtl8xxxu_sta_add(struct ieee80211_hw *hw,
> +                           struct ieee80211_vif *vif,
> +                           struct ieee80211_sta *sta)
> +{
> +       struct rtl8xxxu_priv *priv = hw->priv;
> +
> +       if (sta) {
> +               rtl8xxxu_refresh_rate_mask(priv, 0, sta);
> +               priv->fops->report_connect(priv, sta->aid + 1, H2C_ROLE_STA, true);
> +       }
> +       return 0;
> +}
> +
>  static const struct ieee80211_ops rtl8xxxu_ops = {
>         .tx = rtl8xxxu_tx,
>         .wake_tx_queue = ieee80211_handle_wake_tx_queue,
> @@ -7179,6 +7192,7 @@ static const struct ieee80211_ops rtl8xxxu_ops = {
>         .sta_statistics = rtl8xxxu_sta_statistics,
>         .get_antenna = rtl8xxxu_get_antenna,
>         .set_tim = rtl8xxxu_set_tim,
> +       .sta_add = rtl8xxxu_sta_add,
>  };
> 
>  static int rtl8xxxu_parse_usb(struct rtl8xxxu_priv *priv,
> --
> 2.30.2
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 5e36fddbbb488..d74a3c6452507 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -7159,6 +7159,19 @@  static void rtl8xxxu_stop(struct ieee80211_hw *hw)
 	rtl8xxxu_free_tx_resources(priv);
 }
 
+static int rtl8xxxu_sta_add(struct ieee80211_hw *hw,
+			    struct ieee80211_vif *vif,
+			    struct ieee80211_sta *sta)
+{
+	struct rtl8xxxu_priv *priv = hw->priv;
+
+	if (sta) {
+		rtl8xxxu_refresh_rate_mask(priv, 0, sta);
+		priv->fops->report_connect(priv, sta->aid + 1, H2C_ROLE_STA, true);
+	}
+	return 0;
+}
+
 static const struct ieee80211_ops rtl8xxxu_ops = {
 	.tx = rtl8xxxu_tx,
 	.wake_tx_queue = ieee80211_handle_wake_tx_queue,
@@ -7179,6 +7192,7 @@  static const struct ieee80211_ops rtl8xxxu_ops = {
 	.sta_statistics = rtl8xxxu_sta_statistics,
 	.get_antenna = rtl8xxxu_get_antenna,
 	.set_tim = rtl8xxxu_set_tim,
+	.sta_add = rtl8xxxu_sta_add,
 };
 
 static int rtl8xxxu_parse_usb(struct rtl8xxxu_priv *priv,