developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 1 | From a99b5bf7bcae0aa2d2f161cd28ef0f34c52b31ad Mon Sep 17 00:00:00 2001 |
| 2 | From: "howard.hsu" <howard-yh.hsu@mediatek.com> |
| 3 | Date: Mon, 7 Mar 2022 10:50:32 +0800 |
| 4 | Subject: [PATCH 07/18] [patch] HAL: implement wifi_setApSecurityMFPConfig() |
| 5 | |
| 6 | Change-Id: If05c3550c2f9a152cfea2b8323c6c23973a881ca |
| 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 090db60f..4f54626b 100644 |
| 13 | --- a/source/wifi/wifi_hal.c |
| 14 | +++ b/source/wifi/wifi_hal.c |
| 15 | @@ -6214,6 +6214,29 @@ INT wifi_getApSecurityMFPConfig(INT apIndex, CHAR *output_string) |
| 16 | } |
| 17 | INT wifi_setApSecurityMFPConfig(INT apIndex, CHAR *MfpConfig) |
| 18 | { |
| 19 | + char str[MAX_BUF_SIZE]={'\0'}; |
| 20 | + char cmd[MAX_CMD_SIZE]={'\0'}; |
| 21 | + struct params params; |
| 22 | + char config_file[MAX_BUF_SIZE] = {0}; |
| 23 | + |
| 24 | + WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__); |
| 25 | + if(NULL == MfpConfig || strlen(MfpConfig) >= 32 ) |
| 26 | + return RETURN_ERR; |
| 27 | + |
| 28 | + params.name = "ieee80211w"; |
| 29 | + if (strncmp(MfpConfig, "Disabled", strlen("Disabled")) == 0) |
| 30 | + params.value = "0"; |
| 31 | + else if (strncmp(MfpConfig, "Optional", strlen("Optional")) == 0) |
| 32 | + params.value = "1"; |
| 33 | + else if (strncmp(MfpConfig, "Required", strlen("Required")) == 0) |
| 34 | + params.value = "2"; |
| 35 | + else{ |
| 36 | + wifi_dbg_printf("%s: invalid MfpConfig. Input has to be Disabled, Optional or Required \n", __func__); |
| 37 | + return RETURN_ERR; |
| 38 | + } |
| 39 | + sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex); |
| 40 | + wifi_hostapdWrite(config_file, ¶ms, 1); |
| 41 | + WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n", __func__, __LINE__); |
| 42 | return RETURN_OK; |
| 43 | } |
| 44 | INT wifi_getRadioAutoChannelEnable(INT radioIndex, BOOL *output_bool) |
| 45 | -- |
| 46 | 2.29.2 |
| 47 | |