mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
Merge branch 'cm-14.1' into followmsi-nougat
This commit is contained in:
commit
25a1fd4cf3
9 changed files with 38 additions and 4223 deletions
|
@ -24,14 +24,6 @@ config BCMDHD_NVRAM_PATH
|
|||
---help---
|
||||
Path to the calibration file.
|
||||
|
||||
config BCMDHD_WEXT
|
||||
bool "Enable WEXT support"
|
||||
depends on BCMDHD && CFG80211 = n
|
||||
select WIRELESS_EXT
|
||||
select WEXT_PRIV
|
||||
help
|
||||
Enables WEXT support
|
||||
|
||||
config DHD_USE_STATIC_BUF
|
||||
bool "Enable memory preallocation"
|
||||
depends on BCMDHD
|
||||
|
|
|
@ -71,9 +71,6 @@ extern void htsf_update(struct dhd_info *dhd, void *data);
|
|||
#endif
|
||||
int dhd_msg_level = DHD_ERROR_VAL;
|
||||
|
||||
|
||||
#include <wl_iw.h>
|
||||
|
||||
char fw_path[MOD_PARAM_PATHLEN];
|
||||
char nv_path[MOD_PARAM_PATHLEN];
|
||||
|
||||
|
@ -2137,201 +2134,3 @@ wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, const char token,
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* channel list parsing from cscan tlv list
|
||||
*/
|
||||
int
|
||||
wl_iw_parse_channel_list_tlv(char** list_str, uint16* channel_list,
|
||||
int channel_num, int *bytes_left)
|
||||
{
|
||||
char* str = *list_str;
|
||||
int idx = 0;
|
||||
|
||||
if ((list_str == NULL) || (*list_str == NULL) ||(bytes_left == NULL) || (*bytes_left < 0)) {
|
||||
DHD_ERROR(("%s error paramters\n", __FUNCTION__));
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (*bytes_left > 0) {
|
||||
|
||||
if (str[0] != CSCAN_TLV_TYPE_CHANNEL_IE) {
|
||||
*list_str = str;
|
||||
DHD_TRACE(("End channel=%d left_parse=%d %d\n", idx, *bytes_left, str[0]));
|
||||
return idx;
|
||||
}
|
||||
/* Get proper CSCAN_TLV_TYPE_CHANNEL_IE */
|
||||
*bytes_left -= 1;
|
||||
str += 1;
|
||||
|
||||
if (str[0] == 0) {
|
||||
/* All channels */
|
||||
channel_list[idx] = 0x0;
|
||||
}
|
||||
else {
|
||||
channel_list[idx] = (uint16)str[0];
|
||||
DHD_TRACE(("%s channel=%d \n", __FUNCTION__, channel_list[idx]));
|
||||
}
|
||||
*bytes_left -= 1;
|
||||
str += 1;
|
||||
|
||||
if (idx++ > 255) {
|
||||
DHD_ERROR(("%s Too many channels \n", __FUNCTION__));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
*list_str = str;
|
||||
return idx;
|
||||
}
|
||||
|
||||
/*
|
||||
* SSIDs list parsing from cscan tlv list
|
||||
*/
|
||||
int
|
||||
wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid, int max, int *bytes_left)
|
||||
{
|
||||
char* str;
|
||||
int idx = 0;
|
||||
|
||||
if ((list_str == NULL) || (*list_str == NULL) || (*bytes_left < 0)) {
|
||||
DHD_ERROR(("%s error paramters\n", __FUNCTION__));
|
||||
return -1;
|
||||
}
|
||||
str = *list_str;
|
||||
while (*bytes_left > 0) {
|
||||
|
||||
if (str[0] != CSCAN_TLV_TYPE_SSID_IE) {
|
||||
*list_str = str;
|
||||
DHD_TRACE(("nssid=%d left_parse=%d %d\n", idx, *bytes_left, str[0]));
|
||||
return idx;
|
||||
}
|
||||
|
||||
/* Get proper CSCAN_TLV_TYPE_SSID_IE */
|
||||
*bytes_left -= 1;
|
||||
str += 1;
|
||||
|
||||
if (str[0] == 0) {
|
||||
/* Broadcast SSID */
|
||||
ssid[idx].SSID_len = 0;
|
||||
memset((char*)ssid[idx].SSID, 0x0, DOT11_MAX_SSID_LEN);
|
||||
*bytes_left -= 1;
|
||||
str += 1;
|
||||
|
||||
DHD_TRACE(("BROADCAST SCAN left=%d\n", *bytes_left));
|
||||
}
|
||||
else if (str[0] <= DOT11_MAX_SSID_LEN) {
|
||||
/* Get proper SSID size */
|
||||
ssid[idx].SSID_len = str[0];
|
||||
*bytes_left -= 1;
|
||||
str += 1;
|
||||
|
||||
/* Get SSID */
|
||||
if (ssid[idx].SSID_len > *bytes_left) {
|
||||
DHD_ERROR(("%s out of memory range len=%d but left=%d\n",
|
||||
__FUNCTION__, ssid[idx].SSID_len, *bytes_left));
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy((char*)ssid[idx].SSID, str, ssid[idx].SSID_len);
|
||||
|
||||
*bytes_left -= ssid[idx].SSID_len;
|
||||
str += ssid[idx].SSID_len;
|
||||
|
||||
DHD_TRACE(("%s :size=%d left=%d\n",
|
||||
(char*)ssid[idx].SSID, ssid[idx].SSID_len, *bytes_left));
|
||||
}
|
||||
else {
|
||||
DHD_ERROR(("### SSID size more that %d\n", str[0]));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (idx++ > max) {
|
||||
DHD_ERROR(("%s number of SSIDs more that %d\n", __FUNCTION__, idx));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
*list_str = str;
|
||||
return idx;
|
||||
}
|
||||
|
||||
/* Parse a comma-separated list from list_str into ssid array, starting
|
||||
* at index idx. Max specifies size of the ssid array. Parses ssids
|
||||
* and returns updated idx; if idx >= max not all fit, the excess have
|
||||
* not been copied. Returns -1 on empty string, or on ssid too long.
|
||||
*/
|
||||
int
|
||||
wl_iw_parse_ssid_list(char** list_str, wlc_ssid_t* ssid, int idx, int max)
|
||||
{
|
||||
char* str, *ptr;
|
||||
|
||||
if ((list_str == NULL) || (*list_str == NULL))
|
||||
return -1;
|
||||
|
||||
for (str = *list_str; str != NULL; str = ptr) {
|
||||
|
||||
/* check for next TAG */
|
||||
if (!strncmp(str, GET_CHANNEL, strlen(GET_CHANNEL))) {
|
||||
*list_str = str + strlen(GET_CHANNEL);
|
||||
return idx;
|
||||
}
|
||||
|
||||
if ((ptr = strchr(str, ',')) != NULL) {
|
||||
*ptr++ = '\0';
|
||||
}
|
||||
|
||||
if (strlen(str) > DOT11_MAX_SSID_LEN) {
|
||||
DHD_ERROR(("ssid <%s> exceeds %d\n", str, DOT11_MAX_SSID_LEN));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strlen(str) == 0)
|
||||
ssid[idx].SSID_len = 0;
|
||||
|
||||
if (idx < max) {
|
||||
bcm_strcpy_s((char*)ssid[idx].SSID, sizeof(ssid[idx].SSID), str);
|
||||
ssid[idx].SSID_len = strlen(str);
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse channel list from iwpriv CSCAN
|
||||
*/
|
||||
int
|
||||
wl_iw_parse_channel_list(char** list_str, uint16* channel_list, int channel_num)
|
||||
{
|
||||
int num;
|
||||
int val;
|
||||
char* str;
|
||||
char* endptr = NULL;
|
||||
|
||||
if ((list_str == NULL)||(*list_str == NULL))
|
||||
return -1;
|
||||
|
||||
str = *list_str;
|
||||
num = 0;
|
||||
while (strncmp(str, GET_NPROBE, strlen(GET_NPROBE))) {
|
||||
val = (int)strtoul(str, &endptr, 0);
|
||||
if (endptr == str) {
|
||||
printf("could not parse channel number starting at"
|
||||
" substring \"%s\" in list:\n%s\n",
|
||||
str, *list_str);
|
||||
return -1;
|
||||
}
|
||||
str = endptr + strspn(endptr, " ,");
|
||||
|
||||
if (num == channel_num) {
|
||||
DHD_ERROR(("too many channels (more than %d) in channel list:\n%s\n",
|
||||
channel_num, *list_str));
|
||||
return -1;
|
||||
}
|
||||
|
||||
channel_list[num++] = (uint16)val;
|
||||
}
|
||||
*list_str = str;
|
||||
return num;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <dhd.h>
|
||||
|
||||
#include <wlioctl.h>
|
||||
#include <wl_iw.h>
|
||||
|
||||
#define WL_ERROR(x) printf x
|
||||
#define WL_TRACE(x)
|
||||
|
@ -195,6 +194,12 @@ dhd_custom_get_mac_address(unsigned char *buf)
|
|||
}
|
||||
#endif /* GET_CUSTOM_MAC_ENABLE */
|
||||
|
||||
struct cntry_locales_custom {
|
||||
char iso_abbrev[WLC_CNTRY_BUF_SZ];
|
||||
char custom_locale[WLC_CNTRY_BUF_SZ];
|
||||
int32 custom_locale_rev;
|
||||
};
|
||||
|
||||
/* Customized Locale table : OPTIONAL feature */
|
||||
const struct cntry_locales_custom translate_custom_table[] = {
|
||||
/* Table should be filled out based on custom platform regulatory requirement */
|
||||
|
|
|
@ -159,12 +159,6 @@ print_tainted()
|
|||
}
|
||||
#endif /* LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 15) */
|
||||
|
||||
/* Linux wireless extension support */
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
#include <wl_iw.h>
|
||||
extern wl_iw_extra_params_t g_wl_iw_params;
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
#if defined(CONFIG_HAS_EARLYSUSPEND)
|
||||
#include <linux/earlysuspend.h>
|
||||
extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len);
|
||||
|
@ -224,10 +218,6 @@ static uint32 maxdelay = 0, tspktcnt = 0, maxdelaypktno = 0;
|
|||
|
||||
/* Local private structure (extension of pub) */
|
||||
typedef struct dhd_info {
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
wl_iw_t iw; /* wireless extensions state (must be first) */
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
dhd_pub_t pub;
|
||||
|
||||
/* For supporting multiple interfaces */
|
||||
|
@ -473,10 +463,6 @@ int dhd_monitor_init(void *dhd_pub);
|
|||
int dhd_monitor_uninit(void);
|
||||
|
||||
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
struct iw_statistics *dhd_get_wireless_stats(struct net_device *dev);
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
static void dhd_dpc(ulong data);
|
||||
/* forward decl */
|
||||
extern int dhd_wait_pend8021x(struct net_device *dev);
|
||||
|
@ -2101,16 +2087,6 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
|
|||
return -1;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
/* linux wireless extensions */
|
||||
if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) {
|
||||
/* may recurse, do NOT lock */
|
||||
ret = wl_iw_ioctl(net, ifr, cmd);
|
||||
DHD_OS_WAKE_UNLOCK(&dhd->pub);
|
||||
return ret;
|
||||
}
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 2)
|
||||
if (cmd == SIOCETHTOOL) {
|
||||
ret = dhd_ethtool(dhd, (void*)ifr->ifr_data);
|
||||
|
@ -2746,17 +2722,6 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
|
|||
dhd_monitor_init(&dhd->pub);
|
||||
dhd_state |= DHD_ATTACH_STATE_CFG80211;
|
||||
#endif
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
/* Attach and link in the iw */
|
||||
if (!(dhd_state & DHD_ATTACH_STATE_CFG80211)) {
|
||||
if (wl_iw_attach(net, (void *)&dhd->pub) != 0) {
|
||||
DHD_ERROR(("wl_iw_attach failed\n"));
|
||||
goto fail;
|
||||
}
|
||||
dhd_state |= DHD_ATTACH_STATE_WL_ATTACH;
|
||||
}
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
|
||||
/* Set up the watchdog timer */
|
||||
init_timer(&dhd->timer);
|
||||
|
@ -3548,15 +3513,6 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
|
|||
net->ethtool_ops = &dhd_ethtool_ops;
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) */
|
||||
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
#if WIRELESS_EXT < 19
|
||||
net->get_wireless_stats = dhd_get_wireless_stats;
|
||||
#endif /* WIRELESS_EXT < 19 */
|
||||
#if WIRELESS_EXT > 12
|
||||
net->wireless_handlers = (struct iw_handler_def *)&wl_iw_handler_def;
|
||||
#endif /* WIRELESS_EXT > 12 */
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
dhd->pub.rxsz = DBUS_RX_BUFFER_SIZE_DHD(net);
|
||||
|
||||
memcpy(net->dev_addr, temp_addr, ETHER_ADDR_LEN);
|
||||
|
@ -3571,10 +3527,6 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
|
|||
net->dev_addr[0], net->dev_addr[1], net->dev_addr[2],
|
||||
net->dev_addr[3], net->dev_addr[4], net->dev_addr[5]);
|
||||
|
||||
#if defined(SOFTAP) && defined(CONFIG_WIRELESS_EXT) && !defined(WL_CFG80211)
|
||||
wl_iw_iscan_set_scan_broadcast_prep(net, 1);
|
||||
#endif
|
||||
|
||||
#if 1 && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
|
||||
if (ifidx == 0) {
|
||||
up(&dhd_registration_sem);
|
||||
|
@ -3655,14 +3607,6 @@ void dhd_detach(dhd_pub_t *dhdp)
|
|||
}
|
||||
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
|
||||
|
||||
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
if (dhd->dhd_state & DHD_ATTACH_STATE_WL_ATTACH) {
|
||||
/* Detatch and unlink in the iw */
|
||||
wl_iw_detach();
|
||||
}
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
if (&dhd->thr_sysioc_ctl.thr_pid >= 0) {
|
||||
PROC_STOP(&dhd->thr_sysioc_ctl);
|
||||
}
|
||||
|
@ -4172,26 +4116,6 @@ void dhd_os_prefree(void *osh, void *addr, uint size)
|
|||
}
|
||||
#endif /* defined(CONFIG_WIFI_CONTROL_FUNC) */
|
||||
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
struct iw_statistics *
|
||||
dhd_get_wireless_stats(struct net_device *dev)
|
||||
{
|
||||
int res = 0;
|
||||
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
|
||||
|
||||
if (!dhd->pub.up) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
res = wl_iw_get_wireless_stats(dev, &dhd->iw.wstats);
|
||||
|
||||
if (res == 0)
|
||||
return &dhd->iw.wstats;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
static int
|
||||
dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
|
||||
wl_event_msg_t *event, void **data)
|
||||
|
@ -4203,21 +4127,6 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
|
|||
if (bcmerror != BCME_OK)
|
||||
return (bcmerror);
|
||||
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
if (event->bsscfgidx == 0) {
|
||||
/*
|
||||
* Wireless ext is on primary interface only
|
||||
*/
|
||||
|
||||
ASSERT(dhd->iflist[*ifidx] != NULL);
|
||||
ASSERT(dhd->iflist[*ifidx]->net != NULL);
|
||||
|
||||
if (dhd->iflist[*ifidx]->net) {
|
||||
wl_iw_event(dhd->iflist[*ifidx]->net, event, *data);
|
||||
}
|
||||
}
|
||||
#endif /* defined(CONFIG_WIRELESS_EXT) */
|
||||
|
||||
#ifdef WL_CFG80211
|
||||
if ((ntoh32(event->event_type) == WLC_E_IF) &&
|
||||
(((dhd_if_event_t *)*data)->action == WLC_E_IF_ADD))
|
||||
|
@ -4531,9 +4440,6 @@ int net_os_send_hang_message(struct net_device *dev)
|
|||
if (dhd) {
|
||||
if (!dhd->pub.hang_was_sent) {
|
||||
dhd->pub.hang_was_sent = 1;
|
||||
#if defined(CONFIG_WIRELESS_EXT)
|
||||
ret = wl_iw_send_priv_event(dev, "HANG");
|
||||
#endif
|
||||
#if defined(WL_CFG80211)
|
||||
ret = wl_cfg80211_hang(dev, WLAN_REASON_UNSPECIFIED);
|
||||
dev_close(dev);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,161 +0,0 @@
|
|||
/*
|
||||
* Linux Wireless Extensions support
|
||||
*
|
||||
* Copyright (C) 1999-2012, Broadcom Corporation
|
||||
*
|
||||
* Unless you and Broadcom execute a separate written software license
|
||||
* agreement governing use of this software, this software is licensed to you
|
||||
* under the terms of the GNU General Public License version 2 (the "GPL"),
|
||||
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
|
||||
* following added to such license:
|
||||
*
|
||||
* As a special exception, the copyright holders of this software give you
|
||||
* permission to link this software with independent modules, and to copy and
|
||||
* distribute the resulting executable under terms of your choice, provided that
|
||||
* you also meet, for each linked independent module, the terms and conditions of
|
||||
* the license of that module. An independent module is a module which is not
|
||||
* derived from this software. The special exception does not apply to any
|
||||
* modifications of the software.
|
||||
*
|
||||
* Notwithstanding the above, under no circumstances may you combine this
|
||||
* software in any way with any other Broadcom software provided under a license
|
||||
* other than the GPL, without Broadcom's express prior written consent.
|
||||
*
|
||||
* $Id: wl_iw.h 291086 2011-10-21 01:17:24Z $
|
||||
*/
|
||||
|
||||
#ifndef _wl_iw_h_
|
||||
#define _wl_iw_h_
|
||||
|
||||
#include <linux/wireless.h>
|
||||
|
||||
#include <typedefs.h>
|
||||
#include <proto/ethernet.h>
|
||||
#include <wlioctl.h>
|
||||
|
||||
#define WL_SCAN_PARAMS_SSID_MAX 10
|
||||
#define GET_SSID "SSID="
|
||||
#define GET_CHANNEL "CH="
|
||||
#define GET_NPROBE "NPROBE="
|
||||
#define GET_ACTIVE_ASSOC_DWELL "ACTIVE="
|
||||
#define GET_PASSIVE_ASSOC_DWELL "PASSIVE="
|
||||
#define GET_HOME_DWELL "HOME="
|
||||
#define GET_SCAN_TYPE "TYPE="
|
||||
|
||||
#define BAND_GET_CMD "GETBAND"
|
||||
#define BAND_SET_CMD "SETBAND"
|
||||
#define DTIM_SKIP_GET_CMD "DTIMSKIPGET"
|
||||
#define DTIM_SKIP_SET_CMD "DTIMSKIPSET"
|
||||
#define SETSUSPEND_CMD "SETSUSPENDOPT"
|
||||
#define PNOSSIDCLR_SET_CMD "PNOSSIDCLR"
|
||||
|
||||
#define PNOSETUP_SET_CMD "PNOSETUP "
|
||||
#define PNOENABLE_SET_CMD "PNOFORCE"
|
||||
#define PNODEBUG_SET_CMD "PNODEBUG"
|
||||
#define TXPOWER_SET_CMD "TXPOWER"
|
||||
|
||||
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
|
||||
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
|
||||
|
||||
typedef struct wl_iw_extra_params {
|
||||
int target_channel;
|
||||
} wl_iw_extra_params_t;
|
||||
|
||||
struct cntry_locales_custom {
|
||||
char iso_abbrev[WLC_CNTRY_BUF_SZ];
|
||||
char custom_locale[WLC_CNTRY_BUF_SZ];
|
||||
int32 custom_locale_rev;
|
||||
};
|
||||
|
||||
|
||||
#define WL_IW_RSSI_MINVAL -200
|
||||
#define WL_IW_RSSI_NO_SIGNAL -91
|
||||
#define WL_IW_RSSI_VERY_LOW -80
|
||||
#define WL_IW_RSSI_LOW -70
|
||||
#define WL_IW_RSSI_GOOD -68
|
||||
#define WL_IW_RSSI_VERY_GOOD -58
|
||||
#define WL_IW_RSSI_EXCELLENT -57
|
||||
#define WL_IW_RSSI_INVALID 0
|
||||
#define MAX_WX_STRING 80
|
||||
#define SSID_FMT_BUF_LEN ((4 * 32) + 1)
|
||||
#define isprint(c) bcm_isprint(c)
|
||||
#define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1)
|
||||
#define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
|
||||
#define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)
|
||||
#define WL_IW_GET_LINK_SPEED (SIOCIWFIRSTPRIV+7)
|
||||
#define WL_IW_GET_CURR_MACADDR (SIOCIWFIRSTPRIV+9)
|
||||
#define WL_IW_SET_STOP (SIOCIWFIRSTPRIV+11)
|
||||
#define WL_IW_SET_START (SIOCIWFIRSTPRIV+13)
|
||||
|
||||
#define G_SCAN_RESULTS 8*1024
|
||||
#define WE_ADD_EVENT_FIX 0x80
|
||||
#define G_WLAN_SET_ON 0
|
||||
#define G_WLAN_SET_OFF 1
|
||||
|
||||
|
||||
typedef struct wl_iw {
|
||||
char nickname[IW_ESSID_MAX_SIZE];
|
||||
|
||||
struct iw_statistics wstats;
|
||||
|
||||
int spy_num;
|
||||
uint32 pwsec;
|
||||
uint32 gwsec;
|
||||
bool privacy_invoked;
|
||||
struct ether_addr spy_addr[IW_MAX_SPY];
|
||||
struct iw_quality spy_qual[IW_MAX_SPY];
|
||||
void *wlinfo;
|
||||
} wl_iw_t;
|
||||
|
||||
struct wl_ctrl {
|
||||
struct timer_list *timer;
|
||||
struct net_device *dev;
|
||||
long sysioc_pid;
|
||||
struct semaphore sysioc_sem;
|
||||
struct completion sysioc_exited;
|
||||
};
|
||||
|
||||
|
||||
#if WIRELESS_EXT > 12
|
||||
#include <net/iw_handler.h>
|
||||
extern const struct iw_handler_def wl_iw_handler_def;
|
||||
#endif
|
||||
|
||||
extern int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
extern void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data);
|
||||
extern int wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats);
|
||||
int wl_iw_attach(struct net_device *dev, void * dhdp);
|
||||
int wl_iw_send_priv_event(struct net_device *dev, char *flag);
|
||||
|
||||
void wl_iw_detach(void);
|
||||
|
||||
#define CSCAN_COMMAND "CSCAN "
|
||||
#define CSCAN_TLV_PREFIX 'S'
|
||||
#define CSCAN_TLV_VERSION 1
|
||||
#define CSCAN_TLV_SUBVERSION 0
|
||||
#define CSCAN_TLV_TYPE_SSID_IE 'S'
|
||||
#define CSCAN_TLV_TYPE_CHANNEL_IE 'C'
|
||||
#define CSCAN_TLV_TYPE_NPROBE_IE 'N'
|
||||
#define CSCAN_TLV_TYPE_ACTIVE_IE 'A'
|
||||
#define CSCAN_TLV_TYPE_PASSIVE_IE 'P'
|
||||
#define CSCAN_TLV_TYPE_HOME_IE 'H'
|
||||
#define CSCAN_TLV_TYPE_STYPE_IE 'T'
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
|
||||
#define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \
|
||||
iwe_stream_add_event(info, stream, ends, iwe, extra)
|
||||
#define IWE_STREAM_ADD_VALUE(info, event, value, ends, iwe, event_len) \
|
||||
iwe_stream_add_value(info, event, value, ends, iwe, event_len)
|
||||
#define IWE_STREAM_ADD_POINT(info, stream, ends, iwe, extra) \
|
||||
iwe_stream_add_point(info, stream, ends, iwe, extra)
|
||||
#else
|
||||
#define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \
|
||||
iwe_stream_add_event(stream, ends, iwe, extra)
|
||||
#define IWE_STREAM_ADD_VALUE(info, event, value, ends, iwe, event_len) \
|
||||
iwe_stream_add_value(event, value, ends, iwe, event_len)
|
||||
#define IWE_STREAM_ADD_POINT(info, stream, ends, iwe, extra) \
|
||||
iwe_stream_add_point(stream, ends, iwe, extra)
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -97,6 +97,7 @@ static char *debugfs_buf;
|
|||
static u32 debugfs_buf_size;
|
||||
static u32 debugfs_buf_used;
|
||||
static int wraparound;
|
||||
static struct mutex sps_debugfs_lock;
|
||||
|
||||
struct dentry *dent;
|
||||
struct dentry *dfile_info;
|
||||
|
@ -113,6 +114,7 @@ static struct sps_bam *phy2bam(u32 phys_addr);
|
|||
/* record debug info for debugfs */
|
||||
void sps_debugfs_record(const char *msg)
|
||||
{
|
||||
mutex_lock(&sps_debugfs_lock);
|
||||
if (debugfs_record_enabled) {
|
||||
if (debugfs_buf_used + MAX_MSG_LEN >= debugfs_buf_size) {
|
||||
debugfs_buf_used = 0;
|
||||
|
@ -126,6 +128,7 @@ void sps_debugfs_record(const char *msg)
|
|||
debugfs_buf_size - debugfs_buf_used,
|
||||
"\n**** end line of sps log ****\n\n");
|
||||
}
|
||||
mutex_unlock(&sps_debugfs_lock);
|
||||
}
|
||||
|
||||
/* read the recorded debug info to userspace */
|
||||
|
@ -135,6 +138,7 @@ static ssize_t sps_read_info(struct file *file, char __user *ubuf,
|
|||
int ret = 0;
|
||||
int size;
|
||||
|
||||
mutex_lock(&sps_debugfs_lock);
|
||||
if (debugfs_record_enabled) {
|
||||
if (wraparound)
|
||||
size = debugfs_buf_size - MAX_MSG_LEN;
|
||||
|
@ -144,6 +148,7 @@ static ssize_t sps_read_info(struct file *file, char __user *ubuf,
|
|||
ret = simple_read_from_buffer(ubuf, count, ppos,
|
||||
debugfs_buf, size);
|
||||
}
|
||||
mutex_unlock(&sps_debugfs_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -183,11 +188,13 @@ static ssize_t sps_set_info(struct file *file, const char __user *buf,
|
|||
|
||||
new_buf_size = buf_size_kb * SZ_1K;
|
||||
|
||||
mutex_lock(&sps_debugfs_lock);
|
||||
if (debugfs_record_enabled) {
|
||||
if (debugfs_buf_size == new_buf_size) {
|
||||
/* need do nothing */
|
||||
pr_info("sps:debugfs: input buffer size "
|
||||
"is the same as before.\n");
|
||||
mutex_unlock(&sps_debugfs_lock);
|
||||
return count;
|
||||
} else {
|
||||
/* release the current buffer */
|
||||
|
@ -207,12 +214,14 @@ static ssize_t sps_set_info(struct file *file, const char __user *buf,
|
|||
if (!debugfs_buf) {
|
||||
debugfs_buf_size = 0;
|
||||
pr_err("sps:fail to allocate memory for debug_fs.\n");
|
||||
mutex_unlock(&sps_debugfs_lock);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
debugfs_buf_used = 0;
|
||||
wraparound = false;
|
||||
debugfs_record_enabled = true;
|
||||
mutex_unlock(&sps_debugfs_lock);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -260,6 +269,7 @@ static ssize_t sps_set_logging_option(struct file *file, const char __user *buf,
|
|||
return count;
|
||||
}
|
||||
|
||||
mutex_lock(&sps_debugfs_lock);
|
||||
if (((option == 0) || (option == 2)) &&
|
||||
((logging_option == 1) || (logging_option == 3))) {
|
||||
debugfs_record_enabled = false;
|
||||
|
@ -271,6 +281,7 @@ static ssize_t sps_set_logging_option(struct file *file, const char __user *buf,
|
|||
}
|
||||
|
||||
logging_option = option;
|
||||
mutex_unlock(&sps_debugfs_lock);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -468,6 +479,8 @@ static void sps_debugfs_init(void)
|
|||
goto bam_addr_err;
|
||||
}
|
||||
|
||||
mutex_init(&sps_debugfs_lock);
|
||||
|
||||
return;
|
||||
|
||||
bam_addr_err:
|
||||
|
|
|
@ -49,26 +49,17 @@ extern u8 debug_level_option;
|
|||
extern u8 print_limit_option;
|
||||
|
||||
#define MAX_MSG_LEN 80
|
||||
#define SPS_DEBUGFS(msg, args...) do { \
|
||||
char buf[MAX_MSG_LEN]; \
|
||||
snprintf(buf, MAX_MSG_LEN, msg"\n", ##args); \
|
||||
sps_debugfs_record(buf); \
|
||||
} while (0)
|
||||
#define SPS_ERR(msg, args...) do { \
|
||||
if (unlikely(print_limit_option > 2)) \
|
||||
pr_err_ratelimited(msg, ##args); \
|
||||
else \
|
||||
pr_err(msg, ##args); \
|
||||
if (unlikely(debugfs_record_enabled)) \
|
||||
SPS_DEBUGFS(msg, ##args); \
|
||||
} while (0)
|
||||
#define SPS_INFO(msg, args...) do { \
|
||||
if (unlikely(print_limit_option > 1)) \
|
||||
pr_info_ratelimited(msg, ##args); \
|
||||
else \
|
||||
pr_info(msg, ##args); \
|
||||
if (unlikely(debugfs_record_enabled)) \
|
||||
SPS_DEBUGFS(msg, ##args); \
|
||||
} while (0)
|
||||
#define SPS_DBG(msg, args...) do { \
|
||||
if ((unlikely(logging_option > 1)) \
|
||||
|
@ -79,8 +70,6 @@ extern u8 print_limit_option;
|
|||
pr_info(msg, ##args); \
|
||||
} else \
|
||||
pr_debug(msg, ##args); \
|
||||
if (unlikely(debugfs_record_enabled)) \
|
||||
SPS_DEBUGFS(msg, ##args); \
|
||||
} while (0)
|
||||
#define SPS_DBG1(msg, args...) do { \
|
||||
if ((unlikely(logging_option > 1)) \
|
||||
|
@ -91,8 +80,6 @@ extern u8 print_limit_option;
|
|||
pr_info(msg, ##args); \
|
||||
} else \
|
||||
pr_debug(msg, ##args); \
|
||||
if (unlikely(debugfs_record_enabled)) \
|
||||
SPS_DEBUGFS(msg, ##args); \
|
||||
} while (0)
|
||||
#define SPS_DBG2(msg, args...) do { \
|
||||
if ((unlikely(logging_option > 1)) \
|
||||
|
@ -103,8 +90,6 @@ extern u8 print_limit_option;
|
|||
pr_info(msg, ##args); \
|
||||
} else \
|
||||
pr_debug(msg, ##args); \
|
||||
if (unlikely(debugfs_record_enabled)) \
|
||||
SPS_DEBUGFS(msg, ##args); \
|
||||
} while (0)
|
||||
#define SPS_DBG3(msg, args...) do { \
|
||||
if ((unlikely(logging_option > 1)) \
|
||||
|
@ -115,8 +100,6 @@ extern u8 print_limit_option;
|
|||
pr_info(msg, ##args); \
|
||||
} else \
|
||||
pr_debug(msg, ##args); \
|
||||
if (unlikely(debugfs_record_enabled)) \
|
||||
SPS_DEBUGFS(msg, ##args); \
|
||||
} while (0)
|
||||
#else
|
||||
#define SPS_DBG3(x...) pr_debug(x)
|
||||
|
|
|
@ -658,10 +658,18 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,
|
|||
if(pAssocReq->rsn.length)
|
||||
{
|
||||
// Unpack the RSN IE
|
||||
dot11fUnpackIeRSN(pMac,
|
||||
if (dot11fUnpackIeRSN(pMac,
|
||||
&pAssocReq->rsn.info[0],
|
||||
pAssocReq->rsn.length,
|
||||
&Dot11fIERSN);
|
||||
&Dot11fIERSN) != DOT11F_PARSE_SUCCESS)
|
||||
{
|
||||
limLog(pMac, LOG1,
|
||||
FL("Invalid RSNIE received"));
|
||||
limSendAssocRspMgmtFrame(pMac,
|
||||
eSIR_MAC_INVALID_RSN_IE_CAPABILITIES_STATUS,
|
||||
1, pHdr->sa, subType, 0,psessionEntry);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Check RSN version is supported or not */
|
||||
if(SIR_MAC_OUI_VERSION_1 == Dot11fIERSN.version)
|
||||
|
@ -721,10 +729,17 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,
|
|||
// Unpack the WPA IE
|
||||
if(pAssocReq->wpa.length)
|
||||
{
|
||||
dot11fUnpackIeWPA(pMac,
|
||||
if (dot11fUnpackIeWPA(pMac,
|
||||
&pAssocReq->wpa.info[4], //OUI is not taken care
|
||||
pAssocReq->wpa.length,
|
||||
&Dot11fIEWPA);
|
||||
&Dot11fIEWPA) != DOT11F_PARSE_SUCCESS)
|
||||
{
|
||||
limLog(pMac, LOGE, FL("Invalid WPA IE"));
|
||||
limSendAssocRspMgmtFrame(pMac,
|
||||
eSIR_MAC_INVALID_INFORMATION_ELEMENT_STATUS,
|
||||
1, pHdr->sa, subType, 0,psessionEntry);
|
||||
goto error;
|
||||
}
|
||||
/* check the groupwise and pairwise cipher suites */
|
||||
if(eSIR_SUCCESS != (status = limCheckRxWPAIeMatch(pMac, Dot11fIEWPA, psessionEntry, pAssocReq->HTCaps.present)))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue