DO NOT MERGE ANYWHERE: Fix P2P failure when setting WPS P2P IE
Sohani Rao [Thu, 26 Jan 2017 22:14:32 +0000 (14:14 -0800)]
BRCM kernel has incorrect handling of the command to set WPS IE in
probe response. Regardless of the size of the vendor specific IE,
the kernel hangs.

P2P functionality doesn't need WPS IE to be sent in probe response
This CL removes sending of this command the driver to the kernel.

Change-Id: I8bbd12c40503205049129336a8d271b3d52d73da
Bug: 34619601
Test: Manual P2p tests between two devices with BRCM drivers
(cherry picked from commit bc88924cb534f2f80abee28942a0382658a371c9)

bcmdhd/wpa_supplicant_8_lib/driver_cmd_nl80211.c

index f9dbb95..5d24799 100644 (file)
@@ -168,48 +168,5 @@ int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon,
                                 const struct wpabuf *proberesp,
                                 const struct wpabuf *assocresp)
 {
-       char *buf;
-       const struct wpabuf *ap_wps_p2p_ie = NULL;
-
-       char *_cmd = "SET_AP_WPS_P2P_IE";
-       char *pbuf;
-       int ret = 0;
-       int i, buf_len;
-       struct cmd_desc {
-               int cmd;
-               const struct wpabuf *src;
-       } cmd_arr[] = {
-               {0x1, beacon},
-               {0x2, proberesp},
-               {0x4, assocresp},
-               {-1, NULL}
-       };
-
-       wpa_printf(MSG_DEBUG, "%s: Entry", __func__);
-       for (i = 0; cmd_arr[i].cmd != -1; i++) {
-               ap_wps_p2p_ie = cmd_arr[i].src;
-               if (ap_wps_p2p_ie) {
-                       buf_len = strlen(_cmd) + 3 + wpabuf_len(ap_wps_p2p_ie);
-                       buf = os_zalloc(buf_len);
-                       if (NULL == buf) {
-                               wpa_printf(MSG_ERROR, "%s: Out of memory",
-                                          __func__);
-                               ret = -1;
-                               break;
-                       }
-               } else {
-                       continue;
-               }
-               pbuf = buf;
-               pbuf += snprintf(pbuf, buf_len - wpabuf_len(ap_wps_p2p_ie),
-                                "%s %d",_cmd, cmd_arr[i].cmd);
-               *pbuf++ = '\0';
-               os_memcpy(pbuf, wpabuf_head(ap_wps_p2p_ie), wpabuf_len(ap_wps_p2p_ie));
-               ret = wpa_driver_nl80211_driver_cmd(priv, buf, buf, buf_len);
-               os_free(buf);
-               if (ret < 0)
-                       break;
-       }
-
-       return ret;
+        return 0;
 }