developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From 9aa3ee6838af657f932ed1e7e70420ecfae8452e Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: Michael Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Fri, 7 Jul 2023 17:16:11 +0800 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 044/126] mtk: hostapd: Set STA TX queue parameters |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 5 | configuration after association |
| 6 | |
| 7 | This patch adds the way for wpa_supplicant to set driver's TX queue |
| 8 | parameters. |
| 9 | Since STA parses and apply TX queue parameters from AP beacon's WMM IE |
| 10 | during association, wpa_supplicant set driver's TX queue parameters |
| 11 | after the association. |
| 12 | |
| 13 | Signed-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 | |
| 19 | diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h |
| 20 | index d01b52bb1..663e16053 100644 |
| 21 | --- 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) |
| 42 | diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 43 | index 5c08d4a19..68f4d2dbe 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 44 | --- a/wpa_supplicant/events.c |
| 45 | +++ b/wpa_supplicant/events.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 46 | @@ -4187,6 +4187,20 @@ out: |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 47 | 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) |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 67 | @@ -4516,6 +4530,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 68 | |
| 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 | -- |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 77 | 2.18.0 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 78 | |