]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: Add inactivity timeout configuration support
authorNetanel Bachner <netanel.bachner@intel.com>
Thu, 18 Jan 2018 18:38:11 +0000 (20:38 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 11 Oct 2018 10:32:11 +0000 (12:32 +0200)
Add inactivity time as an optional parameter, so that the time it takes
for the AP to free up a connected inactive station could be configured.

Signed-off-by: Netanel Bachner <netanel.bachner@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ap.c

diff --git a/ap.c b/ap.c
index dcce402e216c313568fc151f8d310f240c62efae..db9efb7b47ff1976a2f35ff88828b718dc729d24 100644 (file)
--- a/ap.c
+++ b/ap.c
@@ -110,6 +110,30 @@ static int handle_start_ap(struct nl80211_state *state,
        if (!argc)
                return 0;
 
+       /* inactivity time (optional) */
+       if (strcmp(argv[0], "inactivity-time") == 0) {
+               argv++;
+               argc--;
+
+               if (!argc)
+                       return -EINVAL;
+               len = strlen(argv[0]);
+               if (!len)
+                       return -EINVAL;
+
+               val = strtoul(argv[0], &end, 10);
+               if (*end != '\0')
+                       return -EINVAL;
+
+               NLA_PUT_U16(msg, NL80211_ATTR_INACTIVITY_TIMEOUT, val);
+               argv++;
+               argc--;
+       }
+
+       if (!argc) {
+               return 0;
+       }
+
        if (strcmp(*argv, "key") != 0 && strcmp(*argv, "keys") != 0)
                return 1;
 
@@ -125,7 +149,7 @@ COMMAND(ap, start, "",
        "<SSID> <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]]"
        " <beacon interval in TU> <DTIM period> [hidden-ssid|zeroed-ssid] head"
        " <beacon head in hexadecimal> [tail <beacon tail in hexadecimal>]"
-       " [key0:abcde d:1:6162636465]\n");
+       " [inactivity-time <inactivity time in seconds>] [key0:abcde d:1:6162636465]\n");
 
 static int handle_stop_ap(struct nl80211_state *state,
                          struct nl_msg *msg,