developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 1 | From e3453cf75d1d9067e97b6d0d370afb3805eccea7 Mon Sep 17 00:00:00 2001 |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame] | 2 | From: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 3 | Date: Thu, 9 Jun 2022 19:56:18 +0800 |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 4 | Subject: [PATCH 99903/99916] Support configuring BSS Termination TSF by using |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 5 | hostapd_cli command |
| 6 | |
| 7 | --- |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame] | 8 | hostapd/ctrl_iface.c | 5 +++++ |
| 9 | src/ap/ap_config.c | 1 + |
| 10 | src/ap/ap_config.h | 1 + |
| 11 | src/ap/ctrl_iface_ap.c | 4 ++++ |
| 12 | 4 files changed, 11 insertions(+) |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 13 | |
| 14 | diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 15 | index a2584920c..c2a282227 100644 |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 16 | --- a/hostapd/ctrl_iface.c |
| 17 | +++ b/hostapd/ctrl_iface.c |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 18 | @@ -1338,6 +1338,11 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd) |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 19 | #endif /* CONFIG_DPP */ |
| 20 | } else if (os_strcasecmp(cmd, "setband") == 0) { |
| 21 | ret = hostapd_ctrl_iface_set_band(hapd, value); |
| 22 | + } else if (os_strcasecmp(cmd, "bss_termination_tsf") == 0) { |
| 23 | + int termination_sec = atoi(value); |
| 24 | + hapd->conf->bss_termination_tsf = termination_sec; |
| 25 | + wpa_printf(MSG_DEBUG, "BSS Termination TSF: value = %d", |
| 26 | + termination_sec); |
| 27 | } else { |
| 28 | ret = hostapd_set_iface(hapd->iconf, hapd->conf, cmd, value); |
| 29 | if (ret) |
| 30 | diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 31 | index d7a0c7c80..4a20eb4e1 100644 |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 32 | --- a/src/ap/ap_config.c |
| 33 | +++ b/src/ap/ap_config.c |
| 34 | @@ -170,6 +170,7 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) |
| 35 | /* comeback after 10 TUs */ |
| 36 | bss->pasn_comeback_after = 10; |
| 37 | #endif /* CONFIG_PASN */ |
| 38 | + bss->bss_termination_tsf = 0; |
| 39 | } |
| 40 | |
| 41 | |
| 42 | diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 43 | index ed3bec7fe..3f68e76d5 100644 |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 44 | --- a/src/ap/ap_config.h |
| 45 | +++ b/src/ap/ap_config.h |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame] | 46 | @@ -557,6 +557,7 @@ struct hostapd_bss_config { |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 47 | int wnm_sleep_mode; |
| 48 | int wnm_sleep_mode_no_keys; |
| 49 | int bss_transition; |
| 50 | + unsigned int bss_termination_tsf; |
| 51 | |
| 52 | /* IEEE 802.11u - Interworking */ |
| 53 | int interworking; |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame] | 54 | diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 55 | index 96209ce7e..46a860905 100644 |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame] | 56 | --- a/src/ap/ctrl_iface_ap.c |
| 57 | +++ b/src/ap/ctrl_iface_ap.c |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 58 | @@ -1203,6 +1203,10 @@ int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd, |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame] | 59 | wpa_printf(MSG_DEBUG, "Invalid bss_term data"); |
| 60 | return -1; |
| 61 | } |
| 62 | + if (hapd->conf->bss_termination_tsf) { |
| 63 | + WPA_PUT_LE64(&bss_term_dur[2], hapd->conf->bss_termination_tsf); |
| 64 | + } |
| 65 | + |
| 66 | end++; |
| 67 | WPA_PUT_LE16(&bss_term_dur[10], atoi(end)); |
| 68 | } |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 69 | -- |
developer | 198585d | 2022-09-22 17:12:54 +0800 | [diff] [blame] | 70 | 2.25.1 |
developer | 7b43f2d | 2022-04-29 17:53:25 +0800 | [diff] [blame] | 71 | |