blob: aab9689290fe63cebf2c501347d6491b936405e6 [file] [log] [blame]
developerd243af02023-12-21 14:49:33 +08001From 7a02e5965652229833be92a9bd8f675e2015144a 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
developerd243af02023-12-21 14:49:33 +08004Subject: [PATCH 37/54] mtk: hostapd: 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
developerd243af02023-12-21 14:49:33 +080020index dcf576487..36ff854ad 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
developerd243af02023-12-21 14:49:33 +080043index 3b8596d6f..f5ac62eda 100644
developerdfb50982023-09-11 13:34:36 +080044--- a/wpa_supplicant/events.c
45+++ b/wpa_supplicant/events.c
developere35b8e42023-10-16 11:04:00 +080046@@ -3559,6 +3559,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)
developere35b8e42023-10-16 11:04:00 +080067@@ -3886,6 +3900,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