aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-09-28 20:29:53 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-24 20:46:38 (GMT)
commited8bfa6274772e7f127693265077f587e04ead65 (patch)
tree438ab533bb8ae04c06e0f864176648630e9430b3
parent85368139dfd5b53793f618d957559905a16cd088 (diff)
downloadhostap-ed8bfa6274772e7f127693265077f587e04ead65.zip
hostap-ed8bfa6274772e7f127693265077f587e04ead65.tar.gz
hostap-ed8bfa6274772e7f127693265077f587e04ead65.tar.bz2
nl80211: Add get_noa() support for WFD certification (BRCM)
BUG: b/5367351 Change-Id: I14ed79e10ade205c5dd4cdc0d2e888ed1279d1bb Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--src/drivers/driver_nl80211.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index c214440..ebb1678 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -366,7 +366,6 @@ static int android_pno_start(struct i802_bss *bss,
static int android_pno_stop(struct i802_bss *bss);
#endif /* ANDROID */
#ifdef ANDROID_P2P
-int wpa_driver_get_p2p_noa(void *priv, u8 *buf, size_t len);
int wpa_driver_set_p2p_ps(void *priv, int legacy_ps, int opp_ps, int ctwindow);
#endif /* ANDROID_P2P */
@@ -11086,7 +11085,8 @@ static int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf,
ret = 0;
if ((os_strcasecmp(cmd, "LINKSPEED") == 0) ||
(os_strcasecmp(cmd, "RSSI") == 0) ||
- (os_strcasecmp(cmd, "GETBAND") == 0))
+ (os_strcasecmp(cmd, "GETBAND") == 0) ||
+ (os_strcasecmp(cmd, "P2P_GET_NOA") == 0))
ret = strlen(buf);
wpa_printf(MSG_DEBUG, "%s %s len = %d, %d", __func__,
@@ -11112,6 +11112,25 @@ static int wpa_driver_set_p2p_noa(void *priv, u8 count, int start,
}
+static int wpa_driver_get_p2p_noa(void *priv, u8 *buf, size_t len)
+{
+ char rbuf[MAX_DRV_CMD_SIZE];
+ char *cmd = "P2P_GET_NOA";
+ int ret;
+
+ wpa_printf(MSG_DEBUG, "%s: Entry", __func__);
+ os_memset(buf, 0, len);
+ ret = wpa_driver_nl80211_driver_cmd(priv, cmd, rbuf, sizeof(rbuf));
+ if (ret <= 0)
+ return 0;
+ ret >>= 1;
+ if (ret > (int)len)
+ ret = (int)len;
+ hexstr2bin(rbuf, buf, ret);
+ return ret;
+}
+
+
static int wpa_driver_set_ap_wps_p2p_ie(void *priv,
const struct wpabuf *beacon,
const struct wpabuf *proberesp,