diff options
author | Amarnath Hullur Subramanyam <amarnath@qca.qualcomm.com> | 2015-03-27 00:15:27 -0700 |
---|---|---|
committer | Amarnath Hullur Subramanyam <amarnath@qca.qualcomm.com> | 2015-03-27 01:28:27 -0700 |
commit | 4af494a4400d1ee3944e227626d0452e033284d5 (patch) | |
tree | 26a5459ec0d1551a0d1205e075b295867e375d74 /qcwcn/wpa_supplicant_8_lib | |
parent | 91840a20fc7e54c2aa2393b982a0abc85baa8299 (diff) | |
download | wlan-4af494a4400d1ee3944e227626d0452e033284d5.tar.gz |
Fast forwarding all the changes till tip of l release.
Change-Id: I2eabf5c9d14a33e11e6fefaf54d70ac972292a55
Diffstat (limited to 'qcwcn/wpa_supplicant_8_lib')
-rw-r--r-- | qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c | 65 |
1 files changed, 46 insertions, 19 deletions
diff --git a/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c b/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c index 7911cd2..e82da16 100644 --- a/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c +++ b/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c @@ -17,7 +17,15 @@ #include "android_drv.h" #endif -#define MAX_WPSP2PIE_CMD_SIZE 512 +#define WPA_PS_ENABLED 0 +#define WPA_PS_DISABLED 1 + + +/* Return type for setBand*/ +enum { + SEND_CHANNEL_CHANGE_EVENT = 0, + DO_NOT_SEND_CHANNEL_CHANGE_EVENT, +}; typedef struct android_wifi_priv_cmd { char *buf; @@ -62,16 +70,21 @@ int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf, { struct i802_bss *bss = priv; struct wpa_driver_nl80211_data *drv = bss->drv; + struct wpa_driver_nl80211_data *driver; struct ifreq ifr; android_wifi_priv_cmd priv_cmd; 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"); + dl_list_for_each(driver, &drv->global->interfaces, struct wpa_driver_nl80211_data, list) { + linux_set_iface_flags(drv->global->ioctl_sock, driver->first_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"); + dl_list_for_each(driver, &drv->global->interfaces, struct wpa_driver_nl80211_data, list) { + linux_set_iface_flags(drv->global->ioctl_sock, driver->first_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] = {}; @@ -94,6 +107,11 @@ int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf, wpa_printf(MSG_ERROR, "%s: failed to issue private commands\n", __func__); } else { drv_errors = 0; + if((os_strncasecmp(cmd, "SETBAND", 7) == 0) && + ret == DO_NOT_SEND_CHANNEL_CHANGE_EVENT) { + return 0; + } + ret = 0; if ((os_strcasecmp(cmd, "LINKSPEED") == 0) || (os_strcasecmp(cmd, "RSSI") == 0) || @@ -107,7 +125,7 @@ int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf, else if (os_strcasecmp(cmd, "P2P_SET_NOA") == 0) wpa_printf(MSG_DEBUG, "%s: P2P: %s ", __func__, buf); else - wpa_printf(MSG_DEBUG, "%s %s len = %d, %d", __func__, buf, ret, strlen(buf)); + wpa_printf(MSG_DEBUG, "%s %s len = %d, %d", __func__, buf, ret, buf_len); wpa_driver_notify_country_change(drv->ctx, cmd); } } @@ -144,12 +162,12 @@ 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 *buf; + const struct wpabuf *ap_wps_p2p_ie = NULL; char *_cmd = "SET_AP_WPS_P2P_IE"; char *pbuf; int ret = 0; - int i; + int i, buf_len; struct cmd_desc { int cmd; const struct wpabuf *src; @@ -162,20 +180,29 @@ int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon, 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; + 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) + buf_len = strlen(_cmd) + 3 + wpabuf_len(ap_wps_p2p_ie); + buf = os_zalloc(buf_len); + if (NULL == buf) { + wpa_printf(MSG_DEBUG,"%s: Out of space for buf", + __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; |