]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Add max_txpower into STATUS command
authorbhagavathi perumal s <bperumal@qti.qualcomm.com>
Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 31 Oct 2017 09:49:41 +0000 (11:49 +0200)
Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
src/ap/ctrl_iface_ap.c

index 1b0aaa9274ef933518a1aefe022b23fd9a9db185..bb3efa60b65d92eb7c5cda426cbb738af27600a2 100644 (file)
@@ -586,7 +586,8 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
                              size_t buflen)
 {
        struct hostapd_iface *iface = hapd->iface;
-       int len = 0, ret;
+       struct hostapd_hw_modes *mode = iface->current_mode;
+       int len = 0, ret, j;
        size_t i;
 
        ret = os_snprintf(buf + len, buflen - len,
@@ -684,6 +685,18 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
                len += ret;
        }
 
+       for (j = 0; mode && j < mode->num_channels; j++) {
+               if (mode->channels[j].freq == iface->freq) {
+                       ret = os_snprintf(buf + len, buflen - len,
+                                         "max_txpower=%u\n",
+                                         mode->channels[j].max_tx_power);
+                       if (os_snprintf_error(buflen - len, ret))
+                               return len;
+                       len += ret;
+                       break;
+               }
+       }
+
        for (i = 0; i < iface->num_bss; i++) {
                struct hostapd_data *bss = iface->bss[i];
                ret = os_snprintf(buf + len, buflen - len,