blob: 1a8a51e58beb446c825497ed1a1d0777f1126c64 [file] [log] [blame]
developer3b7aaa72022-07-15 11:55:52 +08001From de6ce6e2bffdd24772903f13161f1784fd739f09 Mon Sep 17 00:00:00 2001
2From: "howard.hsu" <howard-yh.hsu@mediatek.com>
3Date: Fri, 4 Mar 2022 18:02:33 +0800
4Subject: [PATCH 06/18] [patch] HAL: implement wifi_getApSecurityMFPConfig()
5
6Change-Id: I778dfabf00408f75109e122742894acf82fff799
7---
8 source/wifi/wifi_hal.c | 23 +++++++++++++++++++++++
9 1 file changed, 23 insertions(+)
10
11diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
12index 187de56c..090db60f 100644
13--- a/source/wifi/wifi_hal.c
14+++ b/source/wifi/wifi_hal.c
15@@ -6187,6 +6187,29 @@ INT wifi_getApSecurityWpaRekeyInterval(INT apIndex, INT *output_int)
16 //To-do
17 INT wifi_getApSecurityMFPConfig(INT apIndex, CHAR *output_string)
18 {
19+ char output[16]={'\0'};
20+ char config_file[MAX_BUF_SIZE] = {0};
21+
22+ if (!output_string)
23+ return RETURN_ERR;
24+
25+ sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex);
26+ wifi_hostapdRead(config_file, "ieee80211w", output, sizeof(output));
27+
28+ if (strlen(output) == 0)
29+ snprintf(output_string, 64, "Disabled");
30+ else if (strncmp(output, "0", 1) == 0)
31+ snprintf(output_string, 64, "Disabled");
32+ else if (strncmp(output, "1", 1) == 0)
33+ snprintf(output_string, 64, "Optional");
34+ else if (strncmp(output, "2", 1) == 0)
35+ snprintf(output_string, 64, "Required");
36+ else {
37+ wifi_dbg_printf("\n[%s]: Unexpected ieee80211w=%s", __func__, output);
38+ return RETURN_ERR;
39+ }
40+
41+ wifi_dbg_printf("\n[%s]: ieee80211w is : %s", __func__, output);
42 return RETURN_OK;
43 }
44 INT wifi_setApSecurityMFPConfig(INT apIndex, CHAR *MfpConfig)
45--
462.29.2
47