blob: 9c8c63ba12560a9d4a43d094aee2df0a43e4edf4 [file] [log] [blame]
developer36fe7092023-09-27 12:24:47 +08001From 55837ad406c9af8a398d6073809151f7a3779b74 Mon Sep 17 00:00:00 2001
developerdfb50982023-09-11 13:34:36 +08002From: Michael Lee <michael-cy.lee@mediatek.com>
3Date: Fri, 7 Jul 2023 17:16:11 +0800
developer36fe7092023-09-27 12:24:47 +08004Subject: [PATCH 39/40] hostapd: mtk: Set STA TX queue parameters configuration
developerdfb50982023-09-11 13:34:36 +08005 after association
6
7This patch adds the way for wpa_supplicant to set driver's TX queue
8parameters.
9Since STA parses and apply TX queue parameters from AP beacon's WMM IE
10during association, wpa_supplicant set driver's TX queue parameters
11after the association.
12
13Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
14---
15 wpa_supplicant/driver_i.h | 12 ++++++++++++
16 wpa_supplicant/events.c | 16 ++++++++++++++++
17 2 files changed, 28 insertions(+)
18
19diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
developer36fe7092023-09-27 12:24:47 +080020index 48953c1..0699689 100644
developerdfb50982023-09-11 13:34:36 +080021--- a/wpa_supplicant/driver_i.h
22+++ b/wpa_supplicant/driver_i.h
23@@ -321,6 +321,18 @@ static inline int wpa_drv_set_country(struct wpa_supplicant *wpa_s,
24 return 0;
25 }
26
27+static inline int wpa_drv_set_tx_queue_params(struct wpa_supplicant *wpa_s,
28+ int q, int aifs, int cw_min,
29+ int cw_max, int burst_time)
30+{
31+ int link_id = -1;
32+ if (wpa_s->driver->set_tx_queue_params)
33+ return wpa_s->driver->set_tx_queue_params(wpa_s->drv_priv, q,
34+ aifs, cw_min, cw_max,
35+ burst_time, link_id);
36+ return 0;
37+}
38+
39 static inline int wpa_drv_send_mlme(struct wpa_supplicant *wpa_s,
40 const u8 *data, size_t data_len, int noack,
41 unsigned int freq, unsigned int wait)
42diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
developer36fe7092023-09-27 12:24:47 +080043index 03442f5..5eb5248 100644
developerdfb50982023-09-11 13:34:36 +080044--- a/wpa_supplicant/events.c
45+++ b/wpa_supplicant/events.c
developer36fe7092023-09-27 12:24:47 +080046@@ -3557,6 +3557,20 @@ out:
developerdfb50982023-09-11 13:34:36 +080047 return wpa_sm_set_mlo_params(wpa_s->wpa, &wpa_mlo);
48 }
49
50+static void wpa_supplicant_tx_queue_params(struct wpa_supplicant *wpa_s){
51+ struct hostapd_tx_queue_params *p;
52+
53+ for (int i = 0; i < NUM_TX_QUEUES; i++){
54+ p = &wpa_s->conf->tx_queue[i];
55+ if(wpa_drv_set_tx_queue_params(wpa_s, i, p->aifs,
56+ p->cwmin, p->cwmax,
57+ p->burst)) {
58+ wpa_printf(MSG_DEBUG, "Failed to set TX queue "
59+ "parameters for queue %d.", i);
60+ /* Continue anyway */
61+ }
62+ }
63+}
64
65 static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
66 union wpa_event_data *data)
developer36fe7092023-09-27 12:24:47 +080067@@ -3884,6 +3898,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
developerdfb50982023-09-11 13:34:36 +080068
69 if (wpa_s->current_ssid && wpa_s->current_ssid->enable_4addr_mode)
70 wpa_supplicant_set_4addr_mode(wpa_s);
71+
72+ wpa_supplicant_tx_queue_params(wpa_s);
73 }
74
75
76--
772.18.0
78