]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add get_noa() support for WFD certification (BRCM)
authorDmitry Shmidt <dimitrysh@google.com>
Wed, 28 Sep 2011 20:29:53 +0000 (13:29 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 24 Nov 2013 20:46:38 +0000 (22:46 +0200)
BUG: b/5367351

Change-Id: I14ed79e10ade205c5dd4cdc0d2e888ed1279d1bb
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
src/drivers/driver_nl80211.c

index c21444091b841e78f934843ed4177f2fed781a6c..ebb167851cacd132b811916203d6855fb9bde69f 100644 (file)
@@ -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,