From 9e4545526749cc1d7b2eec18020d8329cf278dc0 Mon Sep 17 00:00:00 2001
From: "Allen.Ye" <allen.ye@mediatek.com>
Date: Fri, 26 Aug 2022 16:12:05 +0800
Subject: [PATCH] HAL add get channel stats

---
 source/wifi/wifi_hal.c | 76 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
index 453e551..f9639a2 100644
--- a/source/wifi/wifi_hal.c
+++ b/source/wifi/wifi_hal.c
@@ -75,6 +75,7 @@ Licensed under the ISC license
 #define VAP_STATUS_FILE "/tmp/vap-status"
 #define ESSID_FILE "/tmp/essid"
 #define GUARD_INTERVAL_FILE "/tmp/guard-interval"
+#define CHANNEL_STATS_FILE "/tmp/channel_stats"
 
 #ifdef MTK_IMPL
 #define DRIVER_2GHZ "mt7915e"
@@ -1065,6 +1066,81 @@ INT wifi_setRadioCountryCode(INT radioIndex, CHAR *CountryCode)
     return RETURN_OK;
 }
 
+INT wifi_getRadioChannelStats2(INT radioIndex, wifi_channelStats2_t *outputChannelStats2)
+{
+    char channel_util_file[64] = {0};
+    char cmd[128] =  {0};
+    char buf[128] = {0};
+    char *line = NULL, *param = NULL, *value = NULL;
+    int read = 0;
+    unsigned int ActiveTime = 0, BusyTime = 0, TransmitTime = 0;
+    unsigned int preActiveTime = 0, preBusyTime = 0, preTransmitTime = 0;
+    size_t len = 0;
+    FILE *f = NULL;
+
+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
+
+    snprintf(cmd, sizeof(cmd), "iw %s%d scan | grep signal | awk '{print $2}' | sort -n | tail -n1", AP_PREFIX, radioIndex);
+    _syscmd(cmd, buf, sizeof(buf));
+    outputChannelStats2->ch_Max80211Rssi = strtol(buf, NULL, 10);
+
+    memset(cmd, 0, sizeof(cmd));
+    memset(buf, 0, sizeof(buf));
+    snprintf(cmd, sizeof(cmd), "iw %s%d survey dump | grep 'in use' -A6", AP_PREFIX, radioIndex);
+    if ((f = popen(cmd, "r")) == NULL) {
+        wifi_dbg_printf("%s: popen %s error\n", __func__, cmd);
+        return RETURN_ERR;
+    }
+
+    read = getline(&line, &len, f);
+    while (read != -1) {
+        param = strtok(line, ":\t");
+        value = strtok(NULL, " ");
+        if(strstr(param, "frequency") != NULL) {
+            outputChannelStats2->ch_Frequency = strtol(value, NULL, 10);
+        }
+        if(strstr(param, "noise") != NULL) {
+            outputChannelStats2->ch_NoiseFloor = strtol(value, NULL, 10);
+            outputChannelStats2->ch_Non80211Noise = strtol(value, NULL, 10);
+        }
+        if(strstr(param, "channel active time") != NULL) {
+            ActiveTime = strtol(value, NULL, 10);
+        }
+        if(strstr(param, "channel busy time") != NULL) {
+            BusyTime = strtol(value, NULL, 10);
+        }
+        if(strstr(param, "channel transmit time") != NULL) {
+            TransmitTime = strtol(value, NULL, 10);
+        }
+        read = getline(&line, &len, f);
+    }
+    pclose(f);
+
+    // The file should store the last active, busy and transmit time
+    snprintf(channel_util_file, sizeof(channel_util_file), "%s%d.txt", CHANNEL_STATS_FILE, radioIndex);
+    f = fopen(channel_util_file, "r");
+    if (f != NULL) {
+        read = getline(&line, &len, f);
+        preActiveTime = strtol(line, NULL, 10);
+        read = getline(&line, &len, f);
+        preBusyTime = strtol(line, NULL, 10);
+        read = getline(&line, &len, f);
+        preTransmitTime = strtol(line, NULL, 10);
+        fclose(f);
+    }
+
+    outputChannelStats2->ch_ObssUtil = (BusyTime - preBusyTime)*100/(ActiveTime - preActiveTime);
+    outputChannelStats2->ch_SelfBssUtil = (TransmitTime - preTransmitTime)*100/(ActiveTime - preActiveTime);
+
+    f = fopen(channel_util_file, "w");
+    if (f != NULL) {
+        fprintf(f, "%u\n%u\n%u\n", ActiveTime, BusyTime, TransmitTime);
+        fclose(f);
+    }
+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
+    return RETURN_OK;
+}
+
 /**********************************************************************************
  *
  *  Wifi radio level function prototypes
-- 
2.18.0

