]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add DRIVER-STATUS command for hostapd
authorJouni Malinen <j@w1.fi>
Sun, 5 Jan 2014 19:50:34 +0000 (21:50 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jan 2014 08:45:12 +0000 (10:45 +0200)
This is just like the same command in wpa_supplicant, i.e., "hostapd_cli
status driver" can be used to fetch information about the driver status
and capabilities.

Signed-hostap: Jouni Malinen <j@w1.fi>

hostapd/ctrl_iface.c
hostapd/hostapd_cli.c
src/ap/ap_drv_ops.h

index bd251f74ce63dec7b752fe5b58384bb774bbaac8..72faeaea442560dd61dbfd4b02e3b78ac67a83ad 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * hostapd / UNIX domain socket -based control interface
- * Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -1140,6 +1140,8 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
        } else if (os_strcmp(buf, "STATUS") == 0) {
                reply_len = hostapd_ctrl_iface_status(hapd, reply,
                                                      reply_size);
+       } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
+               reply_len = hostapd_drv_status(hapd, reply, reply_size);
        } else if (os_strcmp(buf, "MIB") == 0) {
                reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
                if (reply_len >= 0) {
index 2706412396bc5b0b35bfc1397256bc21f18c48aa..4719e2b46ba708a74caf23ae37515e84de204c3b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * hostapd - command line interface for hostapd daemon
- * Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -218,6 +218,8 @@ static int hostapd_cli_cmd_relog(struct wpa_ctrl *ctrl, int argc, char *argv[])
 
 static int hostapd_cli_cmd_status(struct wpa_ctrl *ctrl, int argc, char *argv[])
 {
+       if (argc > 0 && os_strcmp(argv[0], "driver") == 0)
+               return wpa_ctrl_command(ctrl, "STATUS-DRIVER");
        return wpa_ctrl_command(ctrl, "STATUS");
 }
 
index b5f6a020e85311d32d48f0bd55648ed2a77a7a63..15a4b2678202ee842135b109fa10d792fa8f0e30 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * hostapd - Driver operations
- * Copyright (c) 2009-2013, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2009-2014, Jouni Malinen <j@w1.fi>
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -272,4 +272,12 @@ static inline int hostapd_drv_switch_channel(struct hostapd_data *hapd,
        return hapd->driver->switch_channel(hapd->drv_priv, settings);
 }
 
+static inline int hostapd_drv_status(struct hostapd_data *hapd, char *buf,
+                                    size_t buflen)
+{
+       if (hapd->driver == NULL || hapd->driver->status == NULL)
+               return -1;
+       return hapd->driver->status(hapd->drv_priv, buf, buflen);
+}
+
 #endif /* AP_DRV_OPS */