Skip to content

Commit

Permalink
moorefield: bcmdhd update from 4.21.40.327 source release
Browse files Browse the repository at this point in the history
Change-Id: I2218d0aa5a65837bef013c01df5c4ff85c05173c
  • Loading branch information
jrior001 committed Aug 4, 2017
1 parent 71955c0 commit 1f8a9db
Show file tree
Hide file tree
Showing 16 changed files with 404 additions and 449 deletions.
8 changes: 0 additions & 8 deletions drivers/net/wireless/bcmdhd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,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
Expand Down
218 changes: 13 additions & 205 deletions drivers/net/wireless/bcmdhd/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ int dhd_msg_level = DHD_ERROR_VAL | DHD_MSGTRACE_VAL | DHD_FWLOG_VAL;
#else
#endif /* WL_WLC_SHIM */

#include <wl_iw.h>

#ifdef SOFTAP
char fw_path2[MOD_PARAM_PATHLEN];
extern bool softap_enabled;
Expand Down Expand Up @@ -129,7 +127,17 @@ const char dhd_version[] = "\nDongle Host Driver, version " EPI_VERSION_STR "\nC

void dhd_set_timer(void *bus, uint wdtick);


#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'

/* IOVar table */
enum {
Expand Down Expand Up @@ -3160,6 +3168,7 @@ int dhd_keep_alive_onoff(dhd_pub_t *dhd)
/*
* data parsing from ComboScan tlv list
*/
#ifdef WL_WIRELESS_EXT
int
wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, const char token,
int input_size, int *bytes_left)
Expand Down Expand Up @@ -3206,208 +3215,7 @@ 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;
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;
}
str = *list_str;

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_ext_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;
ssid[idx].hidden = TRUE;

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) {
bzero(ssid[idx].SSID, sizeof(ssid[idx].SSID));
strncpy((char*)ssid[idx].SSID, str, sizeof(ssid[idx].SSID) - 1);
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;
}

#endif /* WL_WIRELESS_EXT */

/* Given filename and download type, returns a buffer pointer and length
* for download to f/w. Type can be FW or NVRAM.
Expand Down
22 changes: 14 additions & 8 deletions drivers/net/wireless/bcmdhd/dhd_custom_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include <dhd_linux.h>

#include <wlioctl.h>
#if defined(WL_WIRELESS_EXT)
#include <wl_iw.h>
#endif
//#if defined(WL_WIRELESS_EXT)
//#include <wl_iw.h>
//#endif

#define WL_ERROR(x) printf x
#define WL_TRACE(x)
Expand Down Expand Up @@ -170,13 +170,19 @@ dhd_custom_get_mac_address(void *adapter, unsigned char *buf)
}
#endif /* GET_CUSTOM_MAC_ENABLE */

#if !defined(WL_WIRELESS_EXT)
struct cntry_locales_custom {
char iso_abbrev[WLC_CNTRY_BUF_SZ]; /* ISO 3166-1 country abbreviation */
char custom_locale[WLC_CNTRY_BUF_SZ]; /* Custom firmware locale */
int32 custom_locale_rev; /* Custom local revisin default -1 */
char iso_abbrev[WLC_CNTRY_BUF_SZ];
char custom_locale[WLC_CNTRY_BUF_SZ];
int32 custom_locale_rev;
};
#endif /* WL_WIRELESS_EXT */

//#if !defined(WL_WIRELESS_EXT)
//struct cntry_locales_custom {
// char iso_abbrev[WLC_CNTRY_BUF_SZ]; /* ISO 3166-1 country abbreviation */
// char custom_locale[WLC_CNTRY_BUF_SZ]; /* Custom firmware locale */
// int32 custom_locale_rev; /* Custom local revisin default -1 */
//};
//#endif /* WL_WIRELESS_EXT */

/* Customized Locale table : OPTIONAL feature */
const struct cntry_locales_custom translate_custom_table[] = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/bcmdhd/dhd_ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ extern pkt_frag_t pkt_frag_info(osl_t *osh, void *p);
#define TCPACKSZMAX (TCPACKSZMIN + 100)

/* Max number of TCP streams that have own src/dst IP addrs and TCP ports */
#define TCPACK_INFO_MAXNUM 32
#define TCPDATA_INFO_MAXNUM 32
#define TCPACK_INFO_MAXNUM 4
#define TCPDATA_INFO_MAXNUM 4
#define TCPDATA_PSH_INFO_MAXNUM (8 * TCPDATA_INFO_MAXNUM)

#define TCPDATA_INFO_TIMEOUT 5000 /* Remove tcpdata_info if inactive for this time (in ms) */
Expand Down
Loading

0 comments on commit 1f8a9db

Please sign in to comment.