developer | e35b8e4 | 2023-10-16 11:04:00 +0800 | [diff] [blame^] | 1 | From 33cbd77949640d337e4e39d462bbb6b575792de3 Mon Sep 17 00:00:00 2001 |
developer | dfb5098 | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 2 | From: Michael Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Fri, 7 Jul 2023 17:16:11 +0800 |
developer | e35b8e4 | 2023-10-16 11:04:00 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 37/38] hostapd: mtk: Set STA TX queue parameters configuration |
developer | dfb5098 | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 5 | 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 |
developer | e35b8e4 | 2023-10-16 11:04:00 +0800 | [diff] [blame^] | 20 | index dcf5764..36ff854 100644 |
developer | dfb5098 | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 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 | e35b8e4 | 2023-10-16 11:04:00 +0800 | [diff] [blame^] | 43 | index 3b8596d..f5ac62e 100644 |
developer | dfb5098 | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 44 | --- a/wpa_supplicant/events.c |
| 45 | +++ b/wpa_supplicant/events.c |
developer | e35b8e4 | 2023-10-16 11:04:00 +0800 | [diff] [blame^] | 46 | @@ -3559,6 +3559,20 @@ out: |
developer | dfb5098 | 2023-09-11 13:34:36 +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 | e35b8e4 | 2023-10-16 11:04:00 +0800 | [diff] [blame^] | 67 | @@ -3886,6 +3900,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s, |
developer | dfb5098 | 2023-09-11 13:34:36 +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 | -- |
| 77 | 2.18.0 |
| 78 | |