aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-07-07 21:22:14 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-24 20:46:38 (GMT)
commitbabba1ef31f4df73ab5ed00e945923e4e6106a76 (patch)
tree33e50f84fbf2fb73138e10b5286ef0a4be94f9a7
parent39e04835e6cbdeb0d20697ca04604faeb259b32b (diff)
downloadhostap-babba1ef31f4df73ab5ed00e945923e4e6106a76.zip
hostap-babba1ef31f4df73ab5ed00e945923e4e6106a76.tar.gz
hostap-babba1ef31f4df73ab5ed00e945923e4e6106a76.tar.bz2
nl80211: Add private function support
Change-Id: Iba9b2ac21f5c7760900c57826b7048ee58928338 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--src/drivers/driver_nl80211.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 64ab29a..258a792 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -362,8 +362,6 @@ static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss,
static int android_pno_start(struct i802_bss *bss,
struct wpa_driver_scan_params *params);
static int android_pno_stop(struct i802_bss *bss);
-extern int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf,
- size_t buf_len);
#endif /* ANDROID */
#ifdef ANDROID_P2P
int wpa_driver_set_p2p_noa(void *priv, u8 count, int start, int duration);
@@ -10937,6 +10935,39 @@ static int android_pno_stop(struct i802_bss *bss)
return android_priv_cmd(bss, "PNOFORCE 0");
}
+
+static int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf,
+ size_t buf_len)
+{
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ int ret = 0;
+
+ if (os_strcasecmp(cmd, "STOP") == 0) {
+ linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 0);
+ wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STOPPED");
+ } else if (os_strcasecmp(cmd, "START") == 0) {
+ linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1);
+ wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STARTED");
+ } else if (os_strcasecmp(cmd, "MACADDR") == 0) {
+ u8 macaddr[ETH_ALEN] = {};
+
+ ret = linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname,
+ macaddr);
+ if (!ret)
+ ret = os_snprintf(buf, buf_len,
+ "Macaddr = " MACSTR "\n",
+ MAC2STR(macaddr));
+ } else if (os_strcasecmp(cmd, "RELOAD") == 0) {
+ wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "HANGED");
+ } else {
+ wpa_printf(MSG_ERROR, "Unsupported command: %s", cmd);
+ ret = -1;
+ }
+
+ return ret;
+}
+
#endif /* ANDROID */