From 3a8aee661b87ff9bd9f4d8c38334d74b947e75bb Mon Sep 17 00:00:00 2001
From: "howard.hsu" <howard-yh.hsu@mediatek.com>
Date: Mon, 7 Mar 2022 17:48:02 +0800
Subject: [PATCH 08/18] [patch] HAL: implement ApMaxAssociatedDevice() and
 WaterMarkThreshold()

Change-Id: Ieae8fb5003b01eb4a13471c7f2a2d788dcf981a8
---
 source/wifi/wifi_hal.c | 57 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 54 insertions(+), 3 deletions(-)

diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
index 4f54626b..3ddbc802 100644
--- a/source/wifi/wifi_hal.c
+++ b/source/wifi/wifi_hal.c
@@ -93,6 +93,7 @@ Licensed under the ISC license
 
 #define MAX_BUF_SIZE 128
 #define MAX_CMD_SIZE 1024
+#define MAX_ASSOCIATED_STA_NUM 2007
 
 //Uncomment to enable debug logs
 //#define WIFI_DEBUG
@@ -4536,14 +4537,60 @@ INT wifi_getApMaxAssociatedDevices(INT apIndex, UINT *output_uint)
     //get the running status from driver
     if(!output_uint)
         return RETURN_ERR;
-    *output_uint = 5;
+
+    char output[16]={'\0'};
+    char config_file[MAX_BUF_SIZE] = {0};
+
+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex);
+    wifi_hostapdRead(config_file, "max_num_sta", output, sizeof(output));
+    if (strlen(output) == 0) *output_uint = MAX_ASSOCIATED_STA_NUM;
+    else {
+        int device_num = atoi(output);
+        if (device_num > MAX_ASSOCIATED_STA_NUM || device_num < 0) {
+            wifi_dbg_printf("\n[%s]: get max_num_sta error: %d", __func__, device_num);
+            return RETURN_ERR;
+        }
+        else {
+            *output_uint = device_num;
+        }
+    }
+
     return RETURN_OK;
 }
 
 INT wifi_setApMaxAssociatedDevices(INT apIndex, UINT number)
 {
     //store to wifi config, apply instantly
-    return RETURN_ERR;
+    char str[MAX_BUF_SIZE]={'\0'};
+    char cmd[MAX_CMD_SIZE]={'\0'};
+    struct params params;
+    char config_file[MAX_BUF_SIZE] = {0};
+
+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
+    if (number > MAX_ASSOCIATED_STA_NUM || number < 0) {
+        WIFI_ENTRY_EXIT_DEBUG("%s: Invalid input\n",__func__);
+        return RETURN_ERR;
+    }
+    sprintf(str, "%d", number);
+    params.name = "max_num_sta";
+    params.value = str;
+
+    sprintf(config_file,"%s%d.conf",CONFIG_PREFIX, apIndex);
+    int ret = wifi_hostapdWrite(config_file, &params, 1);
+    if (ret) {
+        WIFI_ENTRY_EXIT_DEBUG("Inside %s: wifi_hostapdWrite() return %d\n"
+                ,__func__, ret);
+    }
+
+    ret = wifi_hostapdProcessUpdate(apIndex, &params, 1);
+    if (ret) {
+        WIFI_ENTRY_EXIT_DEBUG("Inside %s: wifi_hostapdProcessUpdate() return %d\n"
+                ,__func__, ret);
+    }
+    wifi_reloadAp(apIndex);
+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
+
+    return RETURN_OK;
 }
 
 //The HighWatermarkThreshold value that is lesser than or equal to MaxAssociatedDevices. Setting this parameter does not actually limit the number of clients that can associate with this access point as that is controlled by MaxAssociatedDevices.	MaxAssociatedDevices or 50. The default value of this parameter should be equal to MaxAssociatedDevices. In case MaxAssociatedDevices is 0 (zero), the default value of this parameter should be 50. A value of 0 means that there is no specific limit and Watermark calculation algorithm should be turned off.
@@ -4552,13 +4599,17 @@ INT wifi_getApAssociatedDevicesHighWatermarkThreshold(INT apIndex, UINT *output_
     //get the current threshold
     if(!output_uint)
         return RETURN_ERR;
-    *output_uint = 50;
+    wifi_getApMaxAssociatedDevices(apIndex, output_uint);
+    if (*output_uint == 0)
+        *output_uint = 50;
     return RETURN_OK;
 }
 
 INT wifi_setApAssociatedDevicesHighWatermarkThreshold(INT apIndex, UINT Threshold)
 {
     //store the config, reset threshold, reset AssociatedDevicesHighWatermarkThresholdReached, reset AssociatedDevicesHighWatermarkDate to current time
+    if (!wifi_setApMaxAssociatedDevices(apIndex, Threshold))
+        return RETURN_OK;
     return RETURN_ERR;
 }
 
-- 
2.29.2

