developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame^] | 1 | From eaf45cd7a14dac2d5d601653792d2bc101118585 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Fri, 7 Jul 2023 17:16:11 +0800 |
| 4 | Subject: [PATCH 062/104] mtk: hostapd: Set STA TX queue parameters |
| 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 |
| 43 | index 2a9342318..8fd2f2049 100644 |
| 44 | --- a/wpa_supplicant/events.c |
| 45 | +++ b/wpa_supplicant/events.c |
| 46 | @@ -4070,6 +4070,20 @@ out: |
| 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) |
| 67 | @@ -4399,6 +4413,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s, |
| 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.39.2 |
| 78 | |