developer | 3b7aaa7 | 2022-07-15 11:55:52 +0800 | [diff] [blame^] | 1 | From de6ce6e2bffdd24772903f13161f1784fd739f09 Mon Sep 17 00:00:00 2001 |
| 2 | From: "howard.hsu" <howard-yh.hsu@mediatek.com> |
| 3 | Date: Fri, 4 Mar 2022 18:02:33 +0800 |
| 4 | Subject: [PATCH 06/18] [patch] HAL: implement wifi_getApSecurityMFPConfig() |
| 5 | |
| 6 | Change-Id: I778dfabf00408f75109e122742894acf82fff799 |
| 7 | --- |
| 8 | source/wifi/wifi_hal.c | 23 +++++++++++++++++++++++ |
| 9 | 1 file changed, 23 insertions(+) |
| 10 | |
| 11 | diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c |
| 12 | index 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 | -- |
| 46 | 2.29.2 |
| 47 | |