summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-09-27 13:51:28 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-09-27 13:51:28 -0700
commit7119f025f7c249abb40f2e409e54f6241dfe42b6 (patch)
tree6f7a47bdf874f8c50a2da98afafeccb718d8d7ca
parent7165b552f2dc4bf8b523e929c86803a08475be05 (diff)
parent500b326cccb307e79f3146fc59cd9dc5bfc14595 (diff)
downloadhardware_broadcom_wlan-7119f025f7c249abb40f2e409e54f6241dfe42b6.zip
hardware_broadcom_wlan-7119f025f7c249abb40f2e409e54f6241dfe42b6.tar.gz
hardware_broadcom_wlan-7119f025f7c249abb40f2e409e54f6241dfe42b6.tar.bz2
am 500b326c: am b05da5a8: bcmdhd: wpa_supplicant: Fix WFD and WPS certification problem for GO
* commit '500b326cccb307e79f3146fc59cd9dc5bfc14595': bcmdhd: wpa_supplicant: Fix WFD and WPS certification problem for GO
-rw-r--r--bcmdhd/wpa_supplicant_8_lib/driver_cmd_common.h5
-rw-r--r--bcmdhd/wpa_supplicant_8_lib/driver_cmd_nl80211.c61
-rw-r--r--bcmdhd/wpa_supplicant_8_lib/driver_nl80211.h1
3 files changed, 67 insertions, 0 deletions
diff --git a/bcmdhd/wpa_supplicant_8_lib/driver_cmd_common.h b/bcmdhd/wpa_supplicant_8_lib/driver_cmd_common.h
index 5469e99..03ce253 100644
--- a/bcmdhd/wpa_supplicant_8_lib/driver_cmd_common.h
+++ b/bcmdhd/wpa_supplicant_8_lib/driver_cmd_common.h
@@ -17,6 +17,11 @@
#define MAX_DRV_CMD_SIZE 248
#define DRV_NUMBER_SEQUENTIAL_ERRORS 4
+#define RSSI_CMD "RSSI"
+#define LINKSPEED_CMD "LINKSPEED"
+
+#define MAX_WPSP2PIE_CMD_SIZE 384
+
#define WEXT_PNOSETUP_HEADER "PNOSETUP "
#define WEXT_PNOSETUP_HEADER_SIZE 9
#define WEXT_PNO_TLV_PREFIX 'S'
diff --git a/bcmdhd/wpa_supplicant_8_lib/driver_cmd_nl80211.c b/bcmdhd/wpa_supplicant_8_lib/driver_cmd_nl80211.c
index 2c9241e..5300315 100644
--- a/bcmdhd/wpa_supplicant_8_lib/driver_cmd_nl80211.c
+++ b/bcmdhd/wpa_supplicant_8_lib/driver_cmd_nl80211.c
@@ -282,3 +282,64 @@ int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf,
}
return ret;
}
+
+int wpa_driver_set_p2p_noa(void *priv, u8 count, int start, int duration)
+{
+ char buf[MAX_DRV_CMD_SIZE];
+
+ memset(buf, 0, sizeof(buf));
+ wpa_printf(MSG_DEBUG, "%s: Entry", __func__);
+ snprintf(buf, sizeof(buf), "P2P_SET_NOA %d %d %d", count, start, duration);
+ return wpa_driver_nl80211_driver_cmd(priv, buf, buf, strlen(buf)+1);
+}
+
+int wpa_driver_set_p2p_ps(void *priv, int legacy_ps, int opp_ps, int ctwindow)
+{
+ char buf[MAX_DRV_CMD_SIZE];
+
+ memset(buf, 0, sizeof(buf));
+ wpa_printf(MSG_DEBUG, "%s: Entry", __func__);
+ snprintf(buf, sizeof(buf), "P2P_SET_PS %d %d %d", legacy_ps, opp_ps, ctwindow);
+ return wpa_driver_nl80211_driver_cmd(priv, buf, buf, strlen(buf) + 1);
+}
+
+int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon,
+ const struct wpabuf *proberesp,
+ const struct wpabuf *assocresp)
+{
+ char buf[MAX_WPSP2PIE_CMD_SIZE];
+ struct wpabuf *ap_wps_p2p_ie = NULL;
+ char *_cmd = "SET_AP_WPS_P2P_IE";
+ char *pbuf;
+ int ret = 0;
+ int i;
+ 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++) {
+ os_memset(buf, 0, sizeof(buf));
+ pbuf = buf;
+ pbuf += sprintf(pbuf, "%s %d", _cmd, cmd_arr[i].cmd);
+ *pbuf++ = '\0';
+ ap_wps_p2p_ie = cmd_arr[i].src ?
+ wpabuf_dup(cmd_arr[i].src) : NULL;
+ if (ap_wps_p2p_ie) {
+ os_memcpy(pbuf, wpabuf_head(ap_wps_p2p_ie), wpabuf_len(ap_wps_p2p_ie));
+ ret = wpa_driver_nl80211_driver_cmd(priv, buf, buf,
+ strlen(_cmd) + 3 + wpabuf_len(ap_wps_p2p_ie));
+ wpabuf_free(ap_wps_p2p_ie);
+ if (ret < 0)
+ break;
+ }
+ }
+
+ return ret;
+}
diff --git a/bcmdhd/wpa_supplicant_8_lib/driver_nl80211.h b/bcmdhd/wpa_supplicant_8_lib/driver_nl80211.h
index 0a0f3f4..7d19995 100644
--- a/bcmdhd/wpa_supplicant_8_lib/driver_nl80211.h
+++ b/bcmdhd/wpa_supplicant_8_lib/driver_nl80211.h
@@ -128,6 +128,7 @@ struct wpa_driver_nl80211_data {
u64 send_action_cookie;
unsigned int last_mgmt_freq;
+ unsigned int ap_oper_freq;
struct wpa_driver_scan_filter *filter_ssids;
size_t num_filter_ssids;