diff mbox series

[RFC,02/14] wifi: rtl8xxxu: Select correct queue for beacon frames

Message ID 20230322171905.492855-3-martin.kaistra@linutronix.de (mailing list archive)
State RFC
Delegated to: Kalle Valo
Headers show
Series wifi: rtl8xxxu: Add AP mode support for 8188f | expand

Commit Message

Martin Kaistra March 22, 2023, 5:18 p.m. UTC
Use the special beacon queue for beacon frames instead of the management
frame queue, so that the HW sends them periodically instead of only
once.

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

Comments

Ping-Ke Shih March 27, 2023, 12:51 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 02/14] wifi: rtl8xxxu: Select correct queue for beacon frames
> 
> Use the special beacon queue for beacon frames instead of the management
> frame queue, so that the HW sends them periodically instead of only
> once.

Frames with beacon queue will be put in a special area called reserved page
where hardware will treat the frame as beacon frame and send out periodically
when net_type is configured as AP mode.

> 
> Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>

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

> ---
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 90b98b9dcbd9d..daeaa7d6864f9 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -4941,7 +4941,9 @@ static u32 rtl8xxxu_queue_select(struct ieee80211_hdr *hdr, struct sk_buff *skb)
>  {
>         u32 queue;
> 
> -       if (ieee80211_is_mgmt(hdr->frame_control))
> +       if (unlikely(ieee80211_is_beacon(hdr->frame_control)))
> +               queue = TXDESC_QUEUE_BEACON;
> +       else if (ieee80211_is_mgmt(hdr->frame_control))
>                 queue = TXDESC_QUEUE_MGNT;
>         else
>                 queue = rtl8xxxu_80211_to_rtl_queue(skb_get_queue_mapping(skb));
> --
> 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 90b98b9dcbd9d..daeaa7d6864f9 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -4941,7 +4941,9 @@  static u32 rtl8xxxu_queue_select(struct ieee80211_hdr *hdr, struct sk_buff *skb)
 {
 	u32 queue;
 
-	if (ieee80211_is_mgmt(hdr->frame_control))
+	if (unlikely(ieee80211_is_beacon(hdr->frame_control)))
+		queue = TXDESC_QUEUE_BEACON;
+	else if (ieee80211_is_mgmt(hdr->frame_control))
 		queue = TXDESC_QUEUE_MGNT;
 	else
 		queue = rtl8xxxu_80211_to_rtl_queue(skb_get_queue_mapping(skb));