diff options
Diffstat (limited to 'drivers')
24 files changed, 745 insertions, 3322 deletions
diff --git a/drivers/net/wireless/bcmdhd/Makefile b/drivers/net/wireless/bcmdhd/Makefile index fccef9a..ea312d5 100644 --- a/drivers/net/wireless/bcmdhd/Makefile +++ b/drivers/net/wireless/bcmdhd/Makefile @@ -18,7 +18,7 @@ DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER \ -DEMBEDDED_PLATFORM -DENABLE_INSMOD_NO_FW_LOAD -DPNO_SUPPORT \ -DDHD_USE_IDLECOUNT -DSET_RANDOM_MAC_SOFTAP \ -DROAM_ENABLE -DVSDB -DWL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST \ - -DWL_CFG80211_SYNC_GON \ + -DWL_CFG80211_SYNC_GON -DESCAN_RESULT_PATCH \ -Idrivers/net/wireless/bcmdhd -Idrivers/net/wireless/bcmdhd/include DHDOFILES = aiutils.o bcmsdh_sdmmc_linux.o dhd_linux.o siutils.o bcmutils.o \ diff --git a/drivers/net/wireless/bcmdhd/dhd.h b/drivers/net/wireless/bcmdhd/dhd.h index 5003749..1b9e82b 100644 --- a/drivers/net/wireless/bcmdhd/dhd.h +++ b/drivers/net/wireless/bcmdhd/dhd.h @@ -24,7 +24,7 @@ * 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: dhd.h 347624 2012-07-27 10:49:56Z $ + * $Id: dhd.h 350938 2012-08-16 07:16:25Z $ */ /**************** @@ -76,11 +76,12 @@ enum dhd_bus_state { #define STA_MASK 0x0001 #define HOSTAPD_MASK 0x0002 #define WFD_MASK 0x0004 -#define SOFTAP_FW_MASK 0x0008 +#define SOFTAP_FW_MASK 0x0008 #define CONCURRENT_FW_MASK (STA_MASK | WFD_MASK) #define P2P_GO_ENABLED 0x0010 #define P2P_GC_ENABLED 0x0020 #define CONCURENT_MASK 0x00F0 +#define CONCURRENT_MULTI_CHAN 0x0100 #define MANUFACTRING_FW "WLTEST" /* max sequential rxcntl timeouts to set HANG event */ diff --git a/drivers/net/wireless/bcmdhd/dhd_cdc.c b/drivers/net/wireless/bcmdhd/dhd_cdc.c index 31eb62e..56cfbf7 100644 --- a/drivers/net/wireless/bcmdhd/dhd_cdc.c +++ b/drivers/net/wireless/bcmdhd/dhd_cdc.c @@ -21,7 +21,7 @@ * 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: dhd_cdc.c 347640 2012-07-27 11:53:21Z $ + * $Id: dhd_cdc.c 349167 2012-08-07 06:58:11Z $ * * BDC is like CDC, except it includes a header for data packets to convey * packet priority over the bus, and flags (e.g. to indicate checksum status @@ -2377,10 +2377,15 @@ dhd_wlfc_cleanup(dhd_pub_t *dhd) dhd->wlfc_state; wlfc_mac_descriptor_t* table; wlfc_hanger_t* h; - + int prec; + void *pkt = NULL; + struct pktq *txq = NULL; if (dhd->wlfc_state == NULL) return; - + /* flush bus->txq */ + txq = dhd_bus_txq(dhd->bus); + /* any in the hanger? */ + h = (wlfc_hanger_t*)wlfc->hanger; total_entries = sizeof(wlfc->destination_entries)/sizeof(wlfc_mac_descriptor_t); /* search all entries, include nodes as well as interfaces */ table = (wlfc_mac_descriptor_t*)&wlfc->destination_entries; @@ -2399,8 +2404,26 @@ dhd_wlfc_cleanup(dhd_pub_t *dhd) /* release packets held in SENDQ */ if (wlfc->SENDQ.len) pktq_flush(wlfc->osh, &wlfc->SENDQ, TRUE, NULL, 0); - /* any in the hanger? */ - h = (wlfc_hanger_t*)wlfc->hanger; + for (prec = 0; prec < txq->num_prec; prec++) { + pkt = pktq_pdeq(txq, prec); + while (pkt) { + for (i = 0; i < h->max_items; i++) { + if (pkt == h->items[i].pkt) { + if (h->items[i].state == WLFC_HANGER_ITEM_STATE_INUSE) { + PKTFREE(wlfc->osh, h->items[i].pkt, TRUE); + h->items[i].state = WLFC_HANGER_ITEM_STATE_FREE; + } else if (h->items[i].state == + WLFC_HANGER_ITEM_STATE_INUSE_SUPPRESSED) { + /* These are already freed from the psq */ + h->items[i].state = WLFC_HANGER_ITEM_STATE_FREE; + } + break; + } + } + pkt = pktq_pdeq(txq, prec); + } + } + /* flush remained pkt in hanger queue, not in bus->txq */ for (i = 0; i < h->max_items; i++) { if (h->items[i].state == WLFC_HANGER_ITEM_STATE_INUSE) { PKTFREE(wlfc->osh, h->items[i].pkt, TRUE); diff --git a/drivers/net/wireless/bcmdhd/dhd_cfg80211.c b/drivers/net/wireless/bcmdhd/dhd_cfg80211.c index accff9e..b687812 100644 --- a/drivers/net/wireless/bcmdhd/dhd_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/dhd_cfg80211.c @@ -547,15 +547,14 @@ int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, char *command) strncpy((char *)&powermode_val, command + strlen("BTCOEXMODE") +1, 1); if (strnicmp((char *)&powermode_val, "1", strlen("1")) == 0) { - - WL_TRACE(("%s: DHCP session starts\n", __FUNCTION__)); + WL_TRACE2(("%s: DHCP session starts\n", __FUNCTION__)); #ifdef PKT_FILTER_SUPPORT dhd->dhcp_in_progress = 1; /* Disable packet filtering */ if (dhd_pkt_filter_enable && dhd->early_suspended) { - WL_TRACE(("DHCP in progressing , disable packet filter!!!\n")); + WL_TRACE2(("DHCP in progressing , disable packet filter!!!\n")); for (i = 0; i < dhd->pktfilter_count; i++) { dhd_pktfilter_offload_enable(dhd, dhd->pktfilter[i], 0, dhd_master_mode); @@ -609,10 +608,11 @@ int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, char *command) #ifdef PKT_FILTER_SUPPORT dhd->dhcp_in_progress = 0; + WL_TRACE2(("%s: DHCP is complete \n", __FUNCTION__)); /* Enable packet filtering */ if (dhd_pkt_filter_enable && dhd->early_suspended) { - WL_TRACE(("DHCP is complete , enable packet filter!!!\n")); + WL_TRACE2(("DHCP is complete , enable packet filter!!!\n")); for (i = 0; i < dhd->pktfilter_count; i++) { dhd_pktfilter_offload_enable(dhd, dhd->pktfilter[i], 1, dhd_master_mode); diff --git a/drivers/net/wireless/bcmdhd/dhd_common.c b/drivers/net/wireless/bcmdhd/dhd_common.c index d1fae5a..26f306c 100644 --- a/drivers/net/wireless/bcmdhd/dhd_common.c +++ b/drivers/net/wireless/bcmdhd/dhd_common.c @@ -21,7 +21,7 @@ * 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: dhd_common.c 347624 2012-07-27 10:49:56Z $ + * $Id: dhd_common.c 350938 2012-08-16 07:16:25Z $ */ #include <typedefs.h> #include <osl.h> @@ -94,7 +94,7 @@ void dhd_iscan_lock(void); void dhd_iscan_unlock(void); extern int dhd_change_mtu(dhd_pub_t *dhd, int new_mtu, int ifidx); #if !defined(AP) && defined(WLP2P) -extern bool dhd_concurrent_fw(dhd_pub_t *dhd); +extern int dhd_get_concurrent_capabilites(dhd_pub_t *dhd); #endif bool ap_cfg_running = FALSE; bool ap_fw_loaded = FALSE; @@ -277,11 +277,12 @@ dhd_wl_ioctl(dhd_pub_t *dhd_pub, int ifindex, wl_ioctl_t *ioc, void *buf, int le dhd_os_proto_block(dhd_pub); ret = dhd_prot_ioctl(dhd_pub, ifindex, ioc, buf, len); + if ((ret) && (dhd_pub->up)) /* Send hang event only if dhd_open() was success */ - if (ret && dhd_pub->up) - dhd_os_check_hang(dhd_pub, ifindex, ret); + dhd_os_check_hang(dhd_pub, ifindex, ret); dhd_os_proto_unblock(dhd_pub); + return ret; } diff --git a/drivers/net/wireless/bcmdhd/dhd_dbg.h b/drivers/net/wireless/bcmdhd/dhd_dbg.h index c8be78b..a920a9a 100644 --- a/drivers/net/wireless/bcmdhd/dhd_dbg.h +++ b/drivers/net/wireless/bcmdhd/dhd_dbg.h @@ -21,17 +21,20 @@ * 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: dhd_dbg.h 343390 2012-07-06 22:34:19Z $ + * $Id: dhd_dbg.h 350488 2012-08-14 04:36:26Z $ */ #ifndef _dhd_dbg_ #define _dhd_dbg_ +#define USE_NET_RATELIMIT net_ratelimit() + #if defined(DHD_DEBUG) -#define DHD_ERROR(args) do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \ +#define DHD_ERROR(args) do {if ((dhd_msg_level & DHD_ERROR_VAL) && USE_NET_RATELIMIT) \ printf args;} while (0) #define DHD_TRACE(args) do {if (dhd_msg_level & DHD_TRACE_VAL) printf args;} while (0) +#define DHD_TRACE2(args) do {if (dhd_msg_level & DHD_TRACE2_VAL) printf args;} while (0) #define DHD_INFO(args) do {if (dhd_msg_level & DHD_INFO_VAL) printf args;} while (0) #define DHD_DATA(args) do {if (dhd_msg_level & DHD_DATA_VAL) printf args;} while (0) #define DHD_CTL(args) do {if (dhd_msg_level & DHD_CTL_VAL) printf args;} while (0) @@ -48,6 +51,7 @@ #define DHD_ERROR_ON() (dhd_msg_level & DHD_ERROR_VAL) #define DHD_TRACE_ON() (dhd_msg_level & DHD_TRACE_VAL) +#define DHD_TRACE2_ON() (dhd_msg_level & DHD_TRACE2_VAL) #define DHD_INFO_ON() (dhd_msg_level & DHD_INFO_VAL) #define DHD_DATA_ON() (dhd_msg_level & DHD_DATA_VAL) #define DHD_CTL_ON() (dhd_msg_level & DHD_CTL_VAL) @@ -64,8 +68,9 @@ #else /* defined(BCMDBG) || defined(DHD_DEBUG) */ -#define DHD_ERROR(args) do {if (net_ratelimit()) printf args;} while (0) +#define DHD_ERROR(args) do {if (USE_NET_RATELIMIT) printf args;} while (0) #define DHD_TRACE(args) +#define DHD_TRACE2(args) #define DHD_INFO(args) #define DHD_DATA(args) #define DHD_CTL(args) @@ -82,6 +87,7 @@ #define DHD_ERROR_ON() 0 #define DHD_TRACE_ON() 0 +#define DHD_TRACE2_ON() 0 #define DHD_INFO_ON() 0 #define DHD_DATA_ON() 0 #define DHD_CTL_ON() 0 diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c index e4ffa61..e01939a 100644 --- a/drivers/net/wireless/bcmdhd/dhd_linux.c +++ b/drivers/net/wireless/bcmdhd/dhd_linux.c @@ -22,7 +22,7 @@ * 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: dhd_linux.c 347643 2012-07-27 12:22:15Z $ + * $Id: dhd_linux.c 351203 2012-08-17 06:23:09Z $ */ #include <typedefs.h> @@ -201,7 +201,7 @@ extern int dhd_check_module_mac(dhd_pub_t *dhd); extern int dhd_sel_ant_from_file(dhd_pub_t *dhd); #endif -#ifdef CUSTOMER_SET_COUNTRY +#ifdef GLOBALCONFIG_WLAN_COUNTRY_CODE int dhd_customer_set_country(dhd_pub_t *dhd); #endif @@ -405,7 +405,7 @@ module_param(dhd_pkt_filter_init, uint, 0); uint dhd_master_mode = FALSE; #else uint dhd_master_mode = TRUE; -#endif +#endif /* GAL_LITE_NAT_KEEPALIVE_FILTER */ module_param(dhd_master_mode, uint, 0); #ifdef DHDTHREAD @@ -718,7 +718,7 @@ static void dhd_early_suspend(struct early_suspend *h) { struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend); - DHD_TRACE(("%s: enter\n", __FUNCTION__)); + DHD_TRACE2(("%s: enter\n", __FUNCTION__)); if (dhd) dhd_suspend_resume_helper(dhd, 1, 0); @@ -728,7 +728,7 @@ static void dhd_late_resume(struct early_suspend *h) { struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend); - DHD_TRACE(("%s: enter\n", __FUNCTION__)); + DHD_TRACE2(("%s: enter\n", __FUNCTION__)); if (dhd) dhd_suspend_resume_helper(dhd, 0, 0); @@ -944,7 +944,8 @@ _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx) cnt--; } #else - for (mclist = dev->mc_list; (mclist && (cnt > 0)); cnt--, mclist = mclist->next) { + for (mclist = dev->mc_list; (mclist && (cnt > 0)); + cnt--, mclist = mclist->next) { memcpy(bufp, (void *)mclist->dmi_addr, ETHER_ADDR_LEN); bufp += ETHER_ADDR_LEN; } @@ -1611,13 +1612,13 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan) if (!ifp->net || ifp->net->reg_state != NETREG_REGISTERED) { #else if (!ifp->net || ifp->net->reg_state != NETREG_REGISTERED || !dhd->pub.up) { -#endif +#endif /* BCMDHDUSB */ DHD_ERROR(("%s: net device is NOT registered yet. drop packet\n", __FUNCTION__)); PKTFREE(dhdp->osh, pktbuf, TRUE); continue; } -#endif +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) */ pnext = PKTNEXT(dhdp->osh, pktbuf); PKTSETNEXT(wl->sh.osh, pktbuf, NULL); @@ -1915,7 +1916,7 @@ dhd_watchdog_thread(void *data) /* Reschedule the watchdog */ if (dhd->wd_timer_valid) mod_timer(&dhd->timer, - jiffies + msecs_to_jiffies(dhd_watchdog_ms)); + jiffies + msecs_to_jiffies(dhd_watchdog_ms)); dhd_os_spin_unlock(&dhd->pub, flags); } dhd_os_sdunlock(&dhd->pub); @@ -2558,6 +2559,10 @@ dhd_stop(struct net_device *net) ifidx = dhd_net2idx(dhd, net); BCM_REFERENCE(ifidx); + /* Set state and stop OS transmissions */ + netif_stop_queue(net); + dhd->pub.up = 0; + #ifdef WL_CFG80211 if (ifidx == 0) { wl_cfg80211_down(NULL); @@ -2576,10 +2581,6 @@ dhd_stop(struct net_device *net) #ifdef PROP_TXSTATUS dhd_wlfc_cleanup(&dhd->pub); #endif - /* Set state and stop OS transmissions */ - dhd->pub.up = 0; - netif_stop_queue(net); - /* Stop the protocol module */ dhd_prot_stop(&dhd->pub); @@ -2607,6 +2608,7 @@ dhd_open(struct net_device *net) #endif int ifidx; int32 ret = 0; + DHD_OS_WAKE_LOCK(&dhd->pub); /* Update FW path if it was changed */ if (strlen(firmware_path) != 0) { @@ -3208,43 +3210,51 @@ dhd_bus_start(dhd_pub_t *dhdp) * firmware and accordingly enable concurrent mode (Apply P2P settings). SoftAP firmware * would still be named as fw_bcmdhd_apsta. */ -bool -dhd_concurrent_fw(dhd_pub_t *dhd) +int +dhd_get_concurrent_capabilites(dhd_pub_t *dhd) { -#ifdef WL_ENABLE_P2P_IF - if (strstr(fw_path, "_apsta") == NULL) - return 1; - else - return 0; -#else /* WL_ENABLE_P2P_IF */ - int i; int ret = 0; char buf[WLC_IOCTL_SMLEN]; - char *cap[] = {"p2p", "mchan", "dsta", NULL}; - - if ((!op_mode) && (strstr(fw_path, "_p2p") == NULL) && - (strstr(fw_path, "_apsta") == NULL)) { - /* Given path is for the STA firmware. Check whether VSDB + P2P support - * is present in the firmware. If so, set mode as P2P (concurrent support). - */ - for (i = 0; cap[i] != NULL; ) { - memset(buf, 0, sizeof(buf)); - bcm_mkiovar(cap[i++], 0, 0, buf, sizeof(buf)); - if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, buf, sizeof(buf), - FALSE, 0)) < 0) { - DHD_TRACE(("%s: Get VSDB Capability(%s) failed (error=%d)\n", - __FUNCTION__, cap[i-1], ret)); - return 0; - } else if (buf[0] != 1) { - DHD_TRACE(("VSDB(%s) is not supported , ret : %d\n", - cap[i-1], buf[0])); - return 0; + bool vsdb_supported = false; + memset(buf, 0, sizeof(buf)); + bcm_mkiovar("cap", 0, 0, buf, sizeof(buf)); + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, buf, sizeof(buf), + FALSE, 0)) < 0) { + DHD_ERROR(("%s: Get Capability failed (error=%d)\n", + __FUNCTION__, ret)); + return 0; + } + if (strstr(buf, "vsdb")) { + vsdb_supported = true; + } + if (strstr(buf, "p2p") == NULL) { + DHD_TRACE(("Chip does not support p2p\n")); + return 0; + } + else { + /* Chip supports p2p but ensure that p2p is really implemented in firmware or not */ + memset(buf, 0, sizeof(buf)); + bcm_mkiovar("p2p", 0, 0, buf, sizeof(buf)); + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, buf, sizeof(buf), + FALSE, 0)) < 0) { + DHD_ERROR(("%s: Get P2P failed (error=%d)\n", __FUNCTION__, ret)); + return 0; + } + else { + if (buf[0] == 1) { + /* Chip supports p2p, now lets check for vsdb */ + if (vsdb_supported) + return 2; + else +#ifdef WL_ENABLE_P2P_IF + return 1; +#else + return 0; +#endif } } - return 1; } return 0; -#endif /* WL_ENABLE_P2P_IF */ } #endif int @@ -3345,13 +3355,23 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) } #endif /* GET_CUSTOM_MAC_ENABLE */ -#ifdef SET_RANDOM_MAC_SOFTAP + DHD_TRACE(("Firmware = %s\n", fw_path)); + if ((!op_mode && strstr(fw_path, "_apsta") != NULL) || (op_mode == HOSTAPD_MASK)) { +#ifdef SET_RANDOM_MAC_SOFTAP uint rand_mac; - +#endif + op_mode = HOSTAPD_MASK; +#if defined(ARP_OFFLOAD_SUPPORT) + arpoe = 0; +#endif +#ifdef PKT_FILTER_SUPPORT + dhd_pkt_filter_enable = FALSE; +#endif +#ifdef SET_RANDOM_MAC_SOFTAP srandom32((uint)jiffies); rand_mac = random32(); - iovbuf[0] = 0x02; /* locally administered bit */ + iovbuf[0] = 0x02; /* locally administered bit */ iovbuf[1] = 0x1A; iovbuf[2] = 0x11; iovbuf[3] = (unsigned char)(rand_mac & 0x0F) | 0xF0; @@ -3364,80 +3384,67 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) DHD_ERROR(("%s: can't set MAC address , error=%d\n", __FUNCTION__, ret)); } else memcpy(dhd->mac.octet, iovbuf, ETHER_ADDR_LEN); - } #endif /* SET_RANDOM_MAC_SOFTAP */ - - DHD_TRACE(("Firmware = %s\n", fw_path)); -#if !defined(AP) && defined(WLP2P) - /* Check if firmware with WFD support used */ - if ((!op_mode && strstr(fw_path, "_p2p") != NULL) || (op_mode == 0x04) || - (dhd_concurrent_fw(dhd))) { - bcm_mkiovar("apsta", (char *)&apsta, 4, iovbuf, sizeof(iovbuf)); - if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, - iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) { - DHD_ERROR(("%s APSTA for WFD failed ret= %d\n", __FUNCTION__, ret)); - } else if (!dhd_concurrent_fw(dhd)) { - dhd->op_mode |= WFD_MASK; -#if defined(ARP_OFFLOAD_SUPPORT) - arpoe = 0; -#endif /* (ARP_OFFLOAD_SUPPORT) */ -#ifdef PKT_FILTER_SUPPORT - dhd_pkt_filter_enable = FALSE; -#endif - } - - memcpy(&p2p_ea, &dhd->mac, ETHER_ADDR_LEN); - ETHER_SET_LOCALADDR(&p2p_ea); - bcm_mkiovar("p2p_da_override", (char *)&p2p_ea, - ETHER_ADDR_LEN, iovbuf, sizeof(iovbuf)); - if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, - iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) { - DHD_ERROR(("%s p2p_da_override ret= %d\n", __FUNCTION__, ret)); - } else { - DHD_INFO(("dhd_preinit_ioctls: p2p_da_override succeeded\n")); - } - } -#endif - #if !defined(AP) && defined(WL_CFG80211) - /* Check if firmware with HostAPD support used */ - if ((!op_mode && strstr(fw_path, "_apsta") != NULL) || (op_mode == 0x02)) { /* Turn off MPC in AP mode */ bcm_mkiovar("mpc", (char *)&mpc, 4, iovbuf, sizeof(iovbuf)); if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) { DHD_ERROR(("%s mpc for HostAPD failed %d\n", __FUNCTION__, ret)); - } else { - dhd->op_mode |= HOSTAPD_MASK; + } +#endif + + } + else { + int concurrent_capab = 0; + if ((!op_mode && strstr(fw_path, "_p2p") != NULL) || (op_mode == WFD_MASK)) { #if defined(ARP_OFFLOAD_SUPPORT) arpoe = 0; -#endif /* (ARP_OFFLOAD_SUPPORT) */ +#endif #ifdef PKT_FILTER_SUPPORT dhd_pkt_filter_enable = FALSE; #endif + op_mode = WFD_MASK; } - } -#endif - - if ((dhd->op_mode != WFD_MASK) && (dhd->op_mode != HOSTAPD_MASK)) { - /* STA only operation mode */ - dhd->op_mode |= STA_MASK; -#ifdef PKT_FILTER_SUPPORT - dhd_pkt_filter_enable = TRUE; -#endif + else + op_mode = STA_MASK; #if !defined(AP) && defined(WLP2P) - if (dhd_concurrent_fw(dhd)) { - dhd->op_mode |= WFD_MASK; + if ((concurrent_capab = dhd_get_concurrent_capabilites(dhd)) > 0) { + op_mode = STA_MASK | WFD_MASK; + if (concurrent_capab == 2) + op_mode = STA_MASK | WFD_MASK | CONCURRENT_MULTI_CHAN; } -#endif + + /* Check if we are enabling p2p */ + if (op_mode & WFD_MASK) { + bcm_mkiovar("apsta", (char *)&apsta, 4, iovbuf, sizeof(iovbuf)); + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, + iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) { + DHD_ERROR(("%s APSTA for WFD failed ret= %d\n", __FUNCTION__, ret)); + } + + memcpy(&p2p_ea, &dhd->mac, ETHER_ADDR_LEN); + ETHER_SET_LOCALADDR(&p2p_ea); + bcm_mkiovar("p2p_da_override", (char *)&p2p_ea, + ETHER_ADDR_LEN, iovbuf, sizeof(iovbuf)); + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, + iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) { + DHD_ERROR(("%s p2p_da_override ret= %d\n", __FUNCTION__, ret)); + } else { + DHD_INFO(("dhd_preinit_ioctls: p2p_da_override succeeded\n")); + } + } +#else + (void)concurrent_capab; +#endif } + dhd->op_mode = op_mode; DHD_ERROR(("Firmware up: op_mode=%d, " - "Broadcom Dongle Host Driver mac=%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", - dhd->op_mode, - dhd->mac.octet[0], dhd->mac.octet[1], dhd->mac.octet[2], - dhd->mac.octet[3], dhd->mac.octet[4], dhd->mac.octet[5])); - + "Broadcom Dongle Host Driver mac=%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + dhd->op_mode, + dhd->mac.octet[0], dhd->mac.octet[1], dhd->mac.octet[2], + dhd->mac.octet[3], dhd->mac.octet[4], dhd->mac.octet[5])); /* Set Country code */ if (dhd->dhd_cspec.ccode[0] != 0) { bcm_mkiovar("country", (char *)&dhd->dhd_cspec, @@ -3879,7 +3886,8 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx) #else net->netdev_ops = &dhd_ops_pri; #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) */ - memcpy(temp_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN); + if (!ETHER_ISNULLADDR(dhd->pub.mac.octet)) + memcpy(temp_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN); } else { /* * We have to use the primary MAC for virtual interfaces @@ -4910,7 +4918,6 @@ static void dhd_hang_process(struct work_struct *work) #endif } } -#endif int dhd_os_send_hang_message(dhd_pub_t *dhdp) { @@ -4919,9 +4926,7 @@ int dhd_os_send_hang_message(dhd_pub_t *dhdp) if (dhdp) { if (!dhdp->hang_was_sent) { dhdp->hang_was_sent = 1; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) schedule_work(&dhdp->info->work_hang); -#endif } } return ret; @@ -4933,10 +4938,14 @@ int net_os_send_hang_message(struct net_device *dev) int ret = 0; if (dhd) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) ret = dhd_os_send_hang_message(&dhd->pub); - +#else + ret = wl_cfg80211_hang(dev, WLAN_REASON_UNSPECIFIED); +#endif return ret; } +#endif void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec) { diff --git a/drivers/net/wireless/bcmdhd/dhd_sdio.c b/drivers/net/wireless/bcmdhd/dhd_sdio.c index ea2abec..b9e130f 100644 --- a/drivers/net/wireless/bcmdhd/dhd_sdio.c +++ b/drivers/net/wireless/bcmdhd/dhd_sdio.c @@ -21,7 +21,7 @@ * 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: dhd_sdio.c 347641 2012-07-27 11:55:19Z $ + * $Id: dhd_sdio.c 350866 2012-08-16 00:29:10Z $ */ #include <typedefs.h> @@ -743,18 +743,55 @@ dhdsdio_clk_kso_init(dhd_bus_t *bus) return 0; } +#define KSO_DBG(x) +#define MAX_KSO_ATTEMPTS 64 static int dhdsdio_clk_kso_enab(dhd_bus_t *bus, bool on) { - uint8 val = 0; + uint8 wr_val = 0, rd_val, cmp_val, bmask; int err = 0; + int try_cnt = 0; - /* Don't read here since sdio could be off so just write only */ - val |= (on << SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT); - bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, val, &err); + KSO_DBG(("%s> op:%s\n", __FUNCTION__, (on ? "KSO_SET" : "KSO_CLR"))); - if (err) - DHD_TRACE(("%s: KSO toggle %d failed: %d\n", __FUNCTION__, on, err)); + wr_val |= (on << SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT); + + bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err); + + if (on) { + cmp_val = SBSDIO_FUNC1_SLEEPCSR_KSO_MASK | SBSDIO_FUNC1_SLEEPCSR_DEVON_MASK; + bmask = cmp_val; + + msleep(3); + + } else { + /* Put device to sleep, turn off KSO */ + cmp_val = 0; + bmask = SBSDIO_FUNC1_SLEEPCSR_KSO_MASK; + } + + do { + rd_val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, &err); + if (((rd_val & bmask) == cmp_val) && !err) + break; + + KSO_DBG(("%s> KSO wr/rd retry:%d, ERR:%x \n", __FUNCTION__, try_cnt, err)); + OSL_DELAY(50); + + bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err); + + } while (try_cnt++ < MAX_KSO_ATTEMPTS); + + + if (try_cnt > 1) { + KSO_DBG(("%s> op:%s, try_cnt:%d, rd_val:%x, ERR:%x \n", + __FUNCTION__, (on ? "KSO_SET" : "KSO_CLR"), try_cnt, rd_val, err)); + } + + if (try_cnt > MAX_KSO_ATTEMPTS) { + DHD_ERROR(("%s> op:%s, ERROR: try_cnt:%d, rd_val:%x, ERR:%x \n", + __FUNCTION__, (on ? "KSO_SET" : "KSO_CLR"), try_cnt, rd_val, err)); + } return err; } diff --git a/drivers/net/wireless/bcmdhd/include/bcmnvram.h b/drivers/net/wireless/bcmdhd/include/bcmnvram.h deleted file mode 100644 index ce0e035..0000000 --- a/drivers/net/wireless/bcmdhd/include/bcmnvram.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * NVRAM variable manipulation - * - * 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: bcmnvram.h 320632 2012-03-12 19:22:42Z $ - */ - -#ifndef _bcmnvram_h_ -#define _bcmnvram_h_ - -#ifndef _LANGUAGE_ASSEMBLY - -#include <typedefs.h> -#include <bcmdefs.h> - -struct nvram_header { - uint32 magic; - uint32 len; - uint32 crc_ver_init; - uint32 config_refresh; - uint32 config_ncdl; -}; - -struct nvram_tuple { - char *name; - char *value; - struct nvram_tuple *next; -}; - - -extern char *nvram_default_get(const char *name); - - -extern int nvram_init(void *sih); - - -extern int nvram_append(void *si, char *vars, uint varsz); - -extern void nvram_get_global_vars(char **varlst, uint *varsz); - - - -extern int nvram_reset(void *sih); - - -extern void nvram_exit(void *sih); - - -extern char * nvram_get(const char *name); - - -extern int nvram_resetgpio_init(void *sih); - - -static INLINE char * -nvram_safe_get(const char *name) -{ - char *p = nvram_get(name); - return p ? p : ""; -} - - -static INLINE int -nvram_match(char *name, char *match) -{ - const char *value = nvram_get(name); - return (value && !strcmp(value, match)); -} - - -static INLINE int -nvram_invmatch(char *name, char *invmatch) -{ - const char *value = nvram_get(name); - return (value && strcmp(value, invmatch)); -} - - -extern int nvram_set(const char *name, const char *value); - - -extern int nvram_unset(const char *name); - - -extern int nvram_commit(void); - - -extern int nvram_getall(char *nvram_buf, int count); - - -uint8 nvram_calc_crc(struct nvram_header * nvh); - -#endif - - -#define NVRAM_SOFTWARE_VERSION "1" - -#define NVRAM_MAGIC 0x48534C46 -#define NVRAM_CLEAR_MAGIC 0x0 -#define NVRAM_INVALID_MAGIC 0xFFFFFFFF -#define NVRAM_VERSION 1 -#define NVRAM_HEADER_SIZE 20 -#define NVRAM_SPACE 0x8000 - -#define NVRAM_MAX_VALUE_LEN 255 -#define NVRAM_MAX_PARAM_LEN 64 - -#define NVRAM_CRC_START_POSITION 9 -#define NVRAM_CRC_VER_MASK 0xffffff00 - - -#define NVRAM_START_COMPRESSED 0x400 -#define NVRAM_START 0x1000 - -#define BCM_JUMBO_NVRAM_DELIMIT '\n' -#define BCM_JUMBO_START "Broadcom Jumbo Nvram file" - -#if (defined(FAILSAFE_UPGRADE) || defined(CONFIG_FAILSAFE_UPGRADE) || \ - defined(__CONFIG_FAILSAFE_UPGRADE_SUPPORT__)) -#define IMAGE_SIZE "image_size" -#define BOOTPARTITION "bootpartition" -#define IMAGE_BOOT BOOTPARTITION -#define PARTIALBOOTS "partialboots" -#define MAXPARTIALBOOTS "maxpartialboots" -#define IMAGE_1ST_FLASH_TRX "flash0.trx" -#define IMAGE_1ST_FLASH_OS "flash0.os" -#define IMAGE_2ND_FLASH_TRX "flash0.trx2" -#define IMAGE_2ND_FLASH_OS "flash0.os2" -#define IMAGE_FIRST_OFFSET "image_first_offset" -#define IMAGE_SECOND_OFFSET "image_second_offset" -#define LINUX_FIRST "linux" -#define LINUX_SECOND "linux2" -#endif - -#if (defined(DUAL_IMAGE) || defined(CONFIG_DUAL_IMAGE) || \ - defined(__CONFIG_DUAL_IMAGE_FLASH_SUPPORT__)) - -#define IMAGE_BOOT "image_boot" -#define BOOTPARTITION IMAGE_BOOT - -#define IMAGE_1ST_FLASH_TRX "flash0.trx" -#define IMAGE_1ST_FLASH_OS "flash0.os" -#define IMAGE_2ND_FLASH_TRX "flash0.trx2" -#define IMAGE_2ND_FLASH_OS "flash0.os2" -#define IMAGE_SIZE "image_size" - - -#define IMAGE_FIRST_OFFSET "image_first_offset" -#define IMAGE_SECOND_OFFSET "image_second_offset" - - -#define LINUX_FIRST "linux" -#define LINUX_SECOND "linux2" -#define POLICY_TOGGLE "toggle" -#define LINUX_PART_TO_FLASH "linux_to_flash" -#define LINUX_FLASH_POLICY "linux_flash_policy" - -#endif - -#endif diff --git a/drivers/net/wireless/bcmdhd/include/bcmsrom_fmt.h b/drivers/net/wireless/bcmdhd/include/bcmsrom_fmt.h deleted file mode 100644 index f5246a5..0000000 --- a/drivers/net/wireless/bcmdhd/include/bcmsrom_fmt.h +++ /dev/null @@ -1,607 +0,0 @@ -/* - * SROM format definition. - * - * 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: bcmsrom_fmt.h 327439 2012-04-13 17:44:48Z $ - */ - -#ifndef _bcmsrom_fmt_h_ -#define _bcmsrom_fmt_h_ - -#define SROM_MAXREV 11 /* max revisiton supported by driver */ - -/* Maximum srom: 6 Kilobits == 768 bytes */ -#define SROM_MAX 768 -#define SROM_MAXW 384 -#define VARS_MAX 4096 - -/* PCI fields */ -#define PCI_F0DEVID 48 - - -#define SROM_WORDS 64 - -#define SROM3_SWRGN_OFF 28 /* s/w region offset in words */ - -#define SROM_SSID 2 - -#define SROM_WL1LHMAXP 29 - -#define SROM_WL1LPAB0 30 -#define SROM_WL1LPAB1 31 -#define SROM_WL1LPAB2 32 - -#define SROM_WL1HPAB0 33 -#define SROM_WL1HPAB1 34 -#define SROM_WL1HPAB2 35 - -#define SROM_MACHI_IL0 36 -#define SROM_MACMID_IL0 37 -#define SROM_MACLO_IL0 38 -#define SROM_MACHI_ET0 39 -#define SROM_MACMID_ET0 40 -#define SROM_MACLO_ET0 41 -#define SROM_MACHI_ET1 42 -#define SROM_MACMID_ET1 43 -#define SROM_MACLO_ET1 44 -#define SROM3_MACHI 37 -#define SROM3_MACMID 38 -#define SROM3_MACLO 39 - -#define SROM_BXARSSI2G 40 -#define SROM_BXARSSI5G 41 - -#define SROM_TRI52G 42 -#define SROM_TRI5GHL 43 - -#define SROM_RXPO52G 45 - -#define SROM2_ENETPHY 45 - -#define SROM_AABREV 46 -/* Fields in AABREV */ -#define SROM_BR_MASK 0x00ff -#define SROM_CC_MASK 0x0f00 -#define SROM_CC_SHIFT 8 -#define SROM_AA0_MASK 0x3000 -#define SROM_AA0_SHIFT 12 -#define SROM_AA1_MASK 0xc000 -#define SROM_AA1_SHIFT 14 - -#define SROM_WL0PAB0 47 -#define SROM_WL0PAB1 48 -#define SROM_WL0PAB2 49 - -#define SROM_LEDBH10 50 -#define SROM_LEDBH32 51 - -#define SROM_WL10MAXP 52 - -#define SROM_WL1PAB0 53 -#define SROM_WL1PAB1 54 -#define SROM_WL1PAB2 55 - -#define SROM_ITT 56 - -#define SROM_BFL 57 -#define SROM_BFL2 28 -#define SROM3_BFL2 61 - -#define SROM_AG10 58 - -#define SROM_CCODE 59 - -#define SROM_OPO 60 - -#define SROM3_LEDDC 62 - -#define SROM_CRCREV 63 - -/* SROM Rev 4: Reallocate the software part of the srom to accomodate - * MIMO features. It assumes up to two PCIE functions and 440 bytes - * of useable srom i.e. the useable storage in chips with OTP that - * implements hardware redundancy. - */ - -#define SROM4_WORDS 220 - -#define SROM4_SIGN 32 -#define SROM4_SIGNATURE 0x5372 - -#define SROM4_BREV 33 - -#define SROM4_BFL0 34 -#define SROM4_BFL1 35 -#define SROM4_BFL2 36 -#define SROM4_BFL3 37 -#define SROM5_BFL0 37 -#define SROM5_BFL1 38 -#define SROM5_BFL2 39 -#define SROM5_BFL3 40 - -#define SROM4_MACHI 38 -#define SROM4_MACMID 39 -#define SROM4_MACLO 40 -#define SROM5_MACHI 41 -#define SROM5_MACMID 42 -#define SROM5_MACLO 43 - -#define SROM4_CCODE 41 -#define SROM4_REGREV 42 -#define SROM5_CCODE 34 -#define SROM5_REGREV 35 - -#define SROM4_LEDBH10 43 -#define SROM4_LEDBH32 44 -#define SROM5_LEDBH10 59 -#define SROM5_LEDBH32 60 - -#define SROM4_LEDDC 45 -#define SROM5_LEDDC 45 - -#define SROM4_AA 46 -#define SROM4_AA2G_MASK 0x00ff -#define SROM4_AA2G_SHIFT 0 -#define SROM4_AA5G_MASK 0xff00 -#define SROM4_AA5G_SHIFT 8 - -#define SROM4_AG10 47 -#define SROM4_AG32 48 - -#define SROM4_TXPID2G 49 -#define SROM4_TXPID5G 51 -#define SROM4_TXPID5GL 53 -#define SROM4_TXPID5GH 55 - -#define SROM4_TXRXC 61 -#define SROM4_TXCHAIN_MASK 0x000f -#define SROM4_TXCHAIN_SHIFT 0 -#define SROM4_RXCHAIN_MASK 0x00f0 -#define SROM4_RXCHAIN_SHIFT 4 -#define SROM4_SWITCH_MASK 0xff00 -#define SROM4_SWITCH_SHIFT 8 - - -/* Per-path fields */ -#define MAX_PATH_SROM 4 -#define SROM4_PATH0 64 -#define SROM4_PATH1 87 -#define SROM4_PATH2 110 -#define SROM4_PATH3 133 - -#define SROM4_2G_ITT_MAXP 0 -#define SROM4_2G_PA 1 -#define SROM4_5G_ITT_MAXP 5 -#define SROM4_5GLH_MAXP 6 -#define SROM4_5G_PA 7 -#define SROM4_5GL_PA 11 -#define SROM4_5GH_PA 15 - -/* Fields in the ITT_MAXP and 5GLH_MAXP words */ -#define B2G_MAXP_MASK 0xff -#define B2G_ITT_SHIFT 8 -#define B5G_MAXP_MASK 0xff -#define B5G_ITT_SHIFT 8 -#define B5GH_MAXP_MASK 0xff -#define B5GL_MAXP_SHIFT 8 - -/* All the miriad power offsets */ -#define SROM4_2G_CCKPO 156 -#define SROM4_2G_OFDMPO 157 -#define SROM4_5G_OFDMPO 159 -#define SROM4_5GL_OFDMPO 161 -#define SROM4_5GH_OFDMPO 163 -#define SROM4_2G_MCSPO 165 -#define SROM4_5G_MCSPO 173 -#define SROM4_5GL_MCSPO 181 -#define SROM4_5GH_MCSPO 189 -#define SROM4_CDDPO 197 -#define SROM4_STBCPO 198 -#define SROM4_BW40PO 199 -#define SROM4_BWDUPPO 200 - -#define SROM4_CRCREV 219 - - -/* SROM Rev 8: Make space for a 48word hardware header for PCIe rev >= 6. - * This is acombined srom for both MIMO and SISO boards, usable in - * the .130 4Kilobit OTP with hardware redundancy. - */ - -#define SROM8_SIGN 64 - -#define SROM8_BREV 65 - -#define SROM8_BFL0 66 -#define SROM8_BFL1 67 -#define SROM8_BFL2 68 -#define SROM8_BFL3 69 - -#define SROM8_MACHI 70 -#define SROM8_MACMID 71 -#define SROM8_MACLO 72 - -#define SROM8_CCODE 73 -#define SROM8_REGREV 74 - -#define SROM8_LEDBH10 75 -#define SROM8_LEDBH32 76 - -#define SROM8_LEDDC 77 - -#define SROM8_AA 78 - -#define SROM8_AG10 79 -#define SROM8_AG32 80 - -#define SROM8_TXRXC 81 - -#define SROM8_BXARSSI2G 82 -#define SROM8_BXARSSI5G 83 -#define SROM8_TRI52G 84 -#define SROM8_TRI5GHL 85 -#define SROM8_RXPO52G 86 - -#define SROM8_FEM2G 87 -#define SROM8_FEM5G 88 -#define SROM8_FEM_ANTSWLUT_MASK 0xf800 -#define SROM8_FEM_ANTSWLUT_SHIFT 11 -#define SROM8_FEM_TR_ISO_MASK 0x0700 -#define SROM8_FEM_TR_ISO_SHIFT 8 -#define SROM8_FEM_PDET_RANGE_MASK 0x00f8 -#define SROM8_FEM_PDET_RANGE_SHIFT 3 -#define SROM8_FEM_EXTPA_GAIN_MASK 0x0006 -#define SROM8_FEM_EXTPA_GAIN_SHIFT 1 -#define SROM8_FEM_TSSIPOS_MASK 0x0001 -#define SROM8_FEM_TSSIPOS_SHIFT 0 - -#define SROM8_THERMAL 89 - -/* Temp sense related entries */ -#define SROM8_MPWR_RAWTS 90 -#define SROM8_TS_SLP_OPT_CORRX 91 -/* FOC: freiquency offset correction, HWIQ: H/W IOCAL enable, IQSWP: IQ CAL swap disable */ -#define SROM8_FOC_HWIQ_IQSWP 92 - -#define SROM8_EXTLNAGAIN 93 - -/* Temperature delta for PHY calibration */ -#define SROM8_PHYCAL_TEMPDELTA 94 - -/* Measured power 1 & 2, 0-13 bits at offset 95, MSB 2 bits are unused for now. */ -#define SROM8_MPWR_1_AND_2 95 - - -/* Per-path offsets & fields */ -#define SROM8_PATH0 96 -#define SROM8_PATH1 112 -#define SROM8_PATH2 128 -#define SROM8_PATH3 144 - -#define SROM8_2G_ITT_MAXP 0 -#define SROM8_2G_PA 1 -#define SROM8_5G_ITT_MAXP 4 -#define SROM8_5GLH_MAXP 5 -#define SROM8_5G_PA 6 -#define SROM8_5GL_PA 9 -#define SROM8_5GH_PA 12 - -/* All the miriad power offsets */ -#define SROM8_2G_CCKPO 160 - -#define SROM8_2G_OFDMPO 161 -#define SROM8_5G_OFDMPO 163 -#define SROM8_5GL_OFDMPO 165 -#define SROM8_5GH_OFDMPO 167 - -#define SROM8_2G_MCSPO 169 -#define SROM8_5G_MCSPO 177 -#define SROM8_5GL_MCSPO 185 -#define SROM8_5GH_MCSPO 193 - -#define SROM8_CDDPO 201 -#define SROM8_STBCPO 202 -#define SROM8_BW40PO 203 -#define SROM8_BWDUPPO 204 - -/* SISO PA parameters are in the path0 spaces */ -#define SROM8_SISO 96 - -/* Legacy names for SISO PA paramters */ -#define SROM8_W0_ITTMAXP (SROM8_SISO + SROM8_2G_ITT_MAXP) -#define SROM8_W0_PAB0 (SROM8_SISO + SROM8_2G_PA) -#define SROM8_W0_PAB1 (SROM8_SISO + SROM8_2G_PA + 1) -#define SROM8_W0_PAB2 (SROM8_SISO + SROM8_2G_PA + 2) -#define SROM8_W1_ITTMAXP (SROM8_SISO + SROM8_5G_ITT_MAXP) -#define SROM8_W1_MAXP_LCHC (SROM8_SISO + SROM8_5GLH_MAXP) -#define SROM8_W1_PAB0 (SROM8_SISO + SROM8_5G_PA) -#define SROM8_W1_PAB1 (SROM8_SISO + SROM8_5G_PA + 1) -#define SROM8_W1_PAB2 (SROM8_SISO + SROM8_5G_PA + 2) -#define SROM8_W1_PAB0_LC (SROM8_SISO + SROM8_5GL_PA) -#define SROM8_W1_PAB1_LC (SROM8_SISO + SROM8_5GL_PA + 1) -#define SROM8_W1_PAB2_LC (SROM8_SISO + SROM8_5GL_PA + 2) -#define SROM8_W1_PAB0_HC (SROM8_SISO + SROM8_5GH_PA) -#define SROM8_W1_PAB1_HC (SROM8_SISO + SROM8_5GH_PA + 1) -#define SROM8_W1_PAB2_HC (SROM8_SISO + SROM8_5GH_PA + 2) - -#define SROM8_CRCREV 219 - -/* SROM REV 9 */ -#define SROM9_2GPO_CCKBW20 160 -#define SROM9_2GPO_CCKBW20UL 161 -#define SROM9_2GPO_LOFDMBW20 162 -#define SROM9_2GPO_LOFDMBW20UL 164 - -#define SROM9_5GLPO_LOFDMBW20 166 -#define SROM9_5GLPO_LOFDMBW20UL 168 -#define SROM9_5GMPO_LOFDMBW20 170 -#define SROM9_5GMPO_LOFDMBW20UL 172 -#define SROM9_5GHPO_LOFDMBW20 174 -#define SROM9_5GHPO_LOFDMBW20UL 176 - -#define SROM9_2GPO_MCSBW20 178 -#define SROM9_2GPO_MCSBW20UL 180 -#define SROM9_2GPO_MCSBW40 182 - -#define SROM9_5GLPO_MCSBW20 184 -#define SROM9_5GLPO_MCSBW20UL 186 -#define SROM9_5GLPO_MCSBW40 188 -#define SROM9_5GMPO_MCSBW20 190 -#define SROM9_5GMPO_MCSBW20UL 192 -#define SROM9_5GMPO_MCSBW40 194 -#define SROM9_5GHPO_MCSBW20 196 -#define SROM9_5GHPO_MCSBW20UL 198 -#define SROM9_5GHPO_MCSBW40 200 - -#define SROM9_PO_MCS32 202 -#define SROM9_PO_LOFDM40DUP 203 -#define SROM8_RXGAINERR_2G 205 -#define SROM8_RXGAINERR_5GL 206 -#define SROM8_RXGAINERR_5GM 207 -#define SROM8_RXGAINERR_5GH 208 -#define SROM8_RXGAINERR_5GU 209 -#define SROM8_SUBBAND_PPR 210 -#define SROM8_PCIEINGRESS_WAR 211 -#define SROM9_SAR 212 - -#define SROM8_NOISELVL_2G 213 -#define SROM8_NOISELVL_5GL 214 -#define SROM8_NOISELVL_5GM 215 -#define SROM8_NOISELVL_5GH 216 -#define SROM8_NOISELVL_5GU 217 - -#define SROM9_REV_CRC 219 - -#define SROM10_CCKPWROFFSET 218 -#define SROM10_SIGN 219 -#define SROM10_SWCTRLMAP_2G 220 -#define SROM10_CRCREV 229 - -#define SROM10_WORDS 230 -#define SROM10_SIGNATURE SROM4_SIGNATURE - - -/* SROM REV 11 */ -#define SROM11_BREV 65 - -#define SROM11_BFL0 66 -#define SROM11_BFL1 67 -#define SROM11_BFL2 68 -#define SROM11_BFL3 69 -#define SROM11_BFL4 70 -#define SROM11_BFL5 71 - -#define SROM11_MACHI 72 -#define SROM11_MACMID 73 -#define SROM11_MACLO 74 - -#define SROM11_CCODE 75 -#define SROM11_REGREV 76 - -#define SROM11_LEDBH10 77 -#define SROM11_LEDBH32 78 - -#define SROM11_LEDDC 79 - -#define SROM11_AA 80 - -#define SROM11_AGBG10 81 -#define SROM11_AGBG2A0 82 -#define SROM11_AGA21 83 - -#define SROM11_TXRXC 84 - -#define SROM11_FEM_CFG1 85 -#define SROM11_FEM_CFG2 86 - -/* Masks and offsets for FEM_CFG */ -#define SROM11_FEMCTRL_MASK 0xf800 -#define SROM11_FEMCTRL_SHIFT 11 -#define SROM11_PAPDCAP_MASK 0x0400 -#define SROM11_PAPDCAP_SHIFT 10 -#define SROM11_TWORANGETSSI_MASK 0x0200 -#define SROM11_TWORANGETSSI_SHIFT 9 -#define SROM11_PDGAIN_MASK 0x01f0 -#define SROM11_PDGAIN_SHIFT 4 -#define SROM11_EPAGAIN_MASK 0x000e -#define SROM11_EPAGAIN_SHIFT 1 -#define SROM11_TSSIPOSSLOPE_MASK 0x0001 -#define SROM11_TSSIPOSSLOPE_SHIFT 0 -#define SROM11_GAINCTRLSPH_MASK 0xf800 -#define SROM11_GAINCTRLSPH_SHIFT 11 - -#define SROM11_THERMAL 87 -#define SROM11_MPWR_RAWTS 88 -#define SROM11_TS_SLP_OPT_CORRX 89 -#define SROM11_PHYCAL_TEMPDELTA 92 -#define SROM11_MPWR_1_AND_2 93 - -/* Masks and offsets for Terrmal parameters */ -#define SROM11_TEMPS_PERIOD_MASK 0xf0 -#define SROM11_TEMPS_PERIOD_SHIFT 4 -#define SROM11_TEMPS_HYSTERESIS_MASK 0x0f -#define SROM11_TEMPS_HYSTERESIS_SHIFT 0 -#define SROM11_TEMPCORRX_MASK 0xfc -#define SROM11_TEMPCORRX_SHIFT 2 -#define SROM11_TEMPSENSE_OPTION_MASK 0x3 -#define SROM11_TEMPSENSE_OPTION_SHIFT 0 - -#define SROM11_PDOFF_40M_A0 101 -#define SROM11_PDOFF_40M_A1 102 -#define SROM11_PDOFF_40M_A2 103 -#define SROM11_PDOFF_80M_A0 104 -#define SROM11_PDOFF_80M_A1 105 -#define SROM11_PDOFF_80M_A2 106 - -#define SROM11_SUBBAND5GVER 107 - -/* Per-path fields and offset */ -#define MAX_PATH_SROM_11 3 -#define SROM11_PATH0 108 -#define SROM11_PATH1 128 -#define SROM11_PATH2 148 - -#define SROM11_2G_MAXP 0 -#define SROM11_2G_PA 1 -#define SROM11_RXGAINS1 4 -#define SROM11_RXGAINS 5 -#define SROM11_5GB1B0_MAXP 6 -#define SROM11_5GB3B2_MAXP 7 -#define SROM11_5GB0_PA 8 -#define SROM11_5GB1_PA 11 -#define SROM11_5GB2_PA 14 -#define SROM11_5GB3_PA 17 - -/* Masks and offsets for rxgains */ -#define SROM11_RXGAINS5GTRELNABYPA_MASK 0x8000 -#define SROM11_RXGAINS5GTRELNABYPA_SHIFT 15 -#define SROM11_RXGAINS5GTRISOA_MASK 0x7800 -#define SROM11_RXGAINS5GTRISOA_SHIFT 11 -#define SROM11_RXGAINS5GELNAGAINA_MASK 0x0700 -#define SROM11_RXGAINS5GELNAGAINA_SHIFT 8 -#define SROM11_RXGAINS2GTRELNABYPA_MASK 0x0080 -#define SROM11_RXGAINS2GTRELNABYPA_SHIFT 7 -#define SROM11_RXGAINS2GTRISOA_MASK 0x0078 -#define SROM11_RXGAINS2GTRISOA_SHIFT 3 -#define SROM11_RXGAINS2GELNAGAINA_MASK 0x0007 -#define SROM11_RXGAINS2GELNAGAINA_SHIFT 0 -#define SROM11_RXGAINS5GHTRELNABYPA_MASK 0x8000 -#define SROM11_RXGAINS5GHTRELNABYPA_SHIFT 15 -#define SROM11_RXGAINS5GHTRISOA_MASK 0x7800 -#define SROM11_RXGAINS5GHTRISOA_SHIFT 11 -#define SROM11_RXGAINS5GHELNAGAINA_MASK 0x0700 -#define SROM11_RXGAINS5GHELNAGAINA_SHIFT 8 -#define SROM11_RXGAINS5GMTRELNABYPA_MASK 0x0080 -#define SROM11_RXGAINS5GMTRELNABYPA_SHIFT 7 -#define SROM11_RXGAINS5GMTRISOA_MASK 0x0078 -#define SROM11_RXGAINS5GMTRISOA_SHIFT 3 -#define SROM11_RXGAINS5GMELNAGAINA_MASK 0x0007 -#define SROM11_RXGAINS5GMELNAGAINA_SHIFT 0 - -/* Power per rate */ -#define SROM11_CCKBW202GPO 168 -#define SROM11_CCKBW20UL2GPO 169 -#define SROM11_MCSBW202GPO 170 -#define SROM11_MCSBW202GPO_1 171 -#define SROM11_MCSBW402GPO 172 -#define SROM11_MCSBW402GPO_1 173 -#define SROM11_DOT11AGOFDMHRBW202GPO 174 -#define SROM11_OFDMLRBW202GPO 175 - -#define SROM11_MCSBW205GLPO 176 -#define SROM11_MCSBW205GLPO_1 177 -#define SROM11_MCSBW405GLPO 178 -#define SROM11_MCSBW405GLPO_1 179 -#define SROM11_MCSBW805GLPO 180 -#define SROM11_MCSBW805GLPO_1 181 -#define SROM11_MCSBW1605GLPO 182 -#define SROM11_MCSBW1605GLPO_1 183 -#define SROM11_MCSBW205GMPO 184 -#define SROM11_MCSBW205GMPO_1 185 -#define SROM11_MCSBW405GMPO 186 -#define SROM11_MCSBW405GMPO_1 187 -#define SROM11_MCSBW805GMPO 188 -#define SROM11_MCSBW805GMPO_1 189 -#define SROM11_MCSBW1605GMPO 190 -#define SROM11_MCSBW1605GMPO_1 191 -#define SROM11_MCSBW205GHPO 192 -#define SROM11_MCSBW205GHPO_1 193 -#define SROM11_MCSBW405GHPO 194 -#define SROM11_MCSBW405GHPO_1 195 -#define SROM11_MCSBW805GHPO 196 -#define SROM11_MCSBW805GHPO_1 197 -#define SROM11_MCSBW1605GHPO 198 -#define SROM11_MCSBW1605GHPO_1 199 - -#define SROM11_MCSLR5GLPO 200 -#define SROM11_MCSLR5GMPO 201 -#define SROM11_MCSLR5GHPO 202 - -#define SROM11_SB20IN40HRPO 203 -#define SROM11_SB20IN80AND160HR5GLPO 204 -#define SROM11_SB40AND80HR5GLPO 205 -#define SROM11_SB20IN80AND160HR5GMPO 206 -#define SROM11_SB40AND80HR5GMPO 207 -#define SROM11_SB20IN80AND160HR5GHPO 208 -#define SROM11_SB40AND80HR5GHPO 209 -#define SROM11_SB20IN40LRPO 210 -#define SROM11_SB20IN80AND160LR5GLPO 211 -#define SROM11_SB40AND80LR5GLPO 212 -#define SROM11_SB20IN80AND160LR5GMPO 213 -#define SROM11_SB40AND80LR5GMPO 214 -#define SROM11_SB20IN80AND160LR5GHPO 215 -#define SROM11_SB40AND80LR5GHPO 216 - -#define SROM11_DOT11AGDUPHRPO 217 -#define SROM11_DOT11AGDUPLRPO 218 - -/* MISC */ -#define SROM11_PCIEINGRESS_WAR 220 -#define SROM11_SAR 221 - -#define SROM11_NOISELVL_2G 222 -#define SROM11_NOISELVL_5GL 223 -#define SROM11_NOISELVL_5GM 224 -#define SROM11_NOISELVL_5GH 225 -#define SROM11_NOISELVL_5GU 226 - -#define SROM11_RXGAINERR_2G 227 -#define SROM11_RXGAINERR_5GL 228 -#define SROM11_RXGAINERR_5GM 229 -#define SROM11_RXGAINERR_5GH 230 -#define SROM11_RXGAINERR_5GU 231 - -#define SROM11_SIGN 64 -#define SROM11_CRCREV 233 - -#define SROM11_WORDS 234 -#define SROM11_SIGNATURE 0x0634 - -typedef struct { - uint8 tssipos; /* TSSI positive slope, 1: positive, 0: negative */ - uint8 extpagain; /* Ext PA gain-type: full-gain: 0, pa-lite: 1, no_pa: 2 */ - uint8 pdetrange; /* support 32 combinations of different Pdet dynamic ranges */ - uint8 triso; /* TR switch isolation */ - uint8 antswctrllut; /* antswctrl lookup table configuration: 32 possible choices */ -} srom_fem_t; - -#endif /* _bcmsrom_fmt_h_ */ diff --git a/drivers/net/wireless/bcmdhd/include/bcmsrom_tbl.h b/drivers/net/wireless/bcmdhd/include/bcmsrom_tbl.h deleted file mode 100644 index 040ae6a..0000000 --- a/drivers/net/wireless/bcmdhd/include/bcmsrom_tbl.h +++ /dev/null @@ -1,900 +0,0 @@ -/* - * Table that encodes the srom formats for PCI/PCIe NICs. - * - * 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: bcmsrom_tbl.h 327694 2012-04-16 13:22:24Z $ - */ - -#ifndef _bcmsrom_tbl_h_ -#define _bcmsrom_tbl_h_ - -#include "sbpcmcia.h" -#include "wlioctl.h" - -typedef struct { - const char *name; - uint32 revmask; - uint32 flags; - uint16 off; - uint16 mask; -} sromvar_t; - -#define SRFL_MORE 1 /* value continues as described by the next entry */ -#define SRFL_NOFFS 2 /* value bits can't be all one's */ -#define SRFL_PRHEX 4 /* value is in hexdecimal format */ -#define SRFL_PRSIGN 8 /* value is in signed decimal format */ -#define SRFL_CCODE 0x10 /* value is in country code format */ -#define SRFL_ETHADDR 0x20 /* value is an Ethernet address */ -#define SRFL_LEDDC 0x40 /* value is an LED duty cycle */ -#define SRFL_NOVAR 0x80 /* do not generate a nvram param, entry is for mfgc */ -#define SRFL_ARRAY 0x100 /* value is in an array. All elements EXCEPT FOR THE LAST - * ONE in the array should have this flag set. - */ - - -/* Assumptions: - * - Ethernet address spans across 3 consective words - * - * Table rules: - * - Add multiple entries next to each other if a value spans across multiple words - * (even multiple fields in the same word) with each entry except the last having - * it's SRFL_MORE bit set. - * - Ethernet address entry does not follow above rule and must not have SRFL_MORE - * bit set. Its SRFL_ETHADDR bit implies it takes multiple words. - * - The last entry's name field must be NULL to indicate the end of the table. Other - * entries must have non-NULL name. - */ - -static const sromvar_t pci_sromvars[] = { - {"devid", 0xffffff00, SRFL_PRHEX|SRFL_NOVAR, PCI_F0DEVID, 0xffff}, - {"boardrev", 0x0000000e, SRFL_PRHEX, SROM_AABREV, SROM_BR_MASK}, - {"boardrev", 0x000000f0, SRFL_PRHEX, SROM4_BREV, 0xffff}, - {"boardrev", 0xffffff00, SRFL_PRHEX, SROM8_BREV, 0xffff}, - {"boardflags", 0x00000002, SRFL_PRHEX, SROM_BFL, 0xffff}, - {"boardflags", 0x00000004, SRFL_PRHEX|SRFL_MORE, SROM_BFL, 0xffff}, - {"", 0, 0, SROM_BFL2, 0xffff}, - {"boardflags", 0x00000008, SRFL_PRHEX|SRFL_MORE, SROM_BFL, 0xffff}, - {"", 0, 0, SROM3_BFL2, 0xffff}, - {"boardflags", 0x00000010, SRFL_PRHEX|SRFL_MORE, SROM4_BFL0, 0xffff}, - {"", 0, 0, SROM4_BFL1, 0xffff}, - {"boardflags", 0x000000e0, SRFL_PRHEX|SRFL_MORE, SROM5_BFL0, 0xffff}, - {"", 0, 0, SROM5_BFL1, 0xffff}, - {"boardflags", 0xffffff00, SRFL_PRHEX|SRFL_MORE, SROM8_BFL0, 0xffff}, - {"", 0, 0, SROM8_BFL1, 0xffff}, - {"boardflags2", 0x00000010, SRFL_PRHEX|SRFL_MORE, SROM4_BFL2, 0xffff}, - {"", 0, 0, SROM4_BFL3, 0xffff}, - {"boardflags2", 0x000000e0, SRFL_PRHEX|SRFL_MORE, SROM5_BFL2, 0xffff}, - {"", 0, 0, SROM5_BFL3, 0xffff}, - {"boardflags2", 0xffffff00, SRFL_PRHEX|SRFL_MORE, SROM8_BFL2, 0xffff}, - {"", 0, 0, SROM8_BFL3, 0xffff}, - {"boardtype", 0xfffffffc, SRFL_PRHEX, SROM_SSID, 0xffff}, - - {"boardnum", 0x00000006, 0, SROM_MACLO_IL0, 0xffff}, - {"boardnum", 0x00000008, 0, SROM3_MACLO, 0xffff}, - {"boardnum", 0x00000010, 0, SROM4_MACLO, 0xffff}, - {"boardnum", 0x000000e0, 0, SROM5_MACLO, 0xffff}, - {"boardnum", 0x00000700, 0, SROM8_MACLO, 0xffff}, - {"cc", 0x00000002, 0, SROM_AABREV, SROM_CC_MASK}, - {"regrev", 0x00000008, 0, SROM_OPO, 0xff00}, - {"regrev", 0x00000010, 0, SROM4_REGREV, 0x00ff}, - {"regrev", 0x000000e0, 0, SROM5_REGREV, 0x00ff}, - {"regrev", 0x00000700, 0, SROM8_REGREV, 0x00ff}, - {"ledbh0", 0x0000000e, SRFL_NOFFS, SROM_LEDBH10, 0x00ff}, - {"ledbh1", 0x0000000e, SRFL_NOFFS, SROM_LEDBH10, 0xff00}, - {"ledbh2", 0x0000000e, SRFL_NOFFS, SROM_LEDBH32, 0x00ff}, - {"ledbh3", 0x0000000e, SRFL_NOFFS, SROM_LEDBH32, 0xff00}, - {"ledbh0", 0x00000010, SRFL_NOFFS, SROM4_LEDBH10, 0x00ff}, - {"ledbh1", 0x00000010, SRFL_NOFFS, SROM4_LEDBH10, 0xff00}, - {"ledbh2", 0x00000010, SRFL_NOFFS, SROM4_LEDBH32, 0x00ff}, - {"ledbh3", 0x00000010, SRFL_NOFFS, SROM4_LEDBH32, 0xff00}, - {"ledbh0", 0x000000e0, SRFL_NOFFS, SROM5_LEDBH10, 0x00ff}, - {"ledbh1", 0x000000e0, SRFL_NOFFS, SROM5_LEDBH10, 0xff00}, - {"ledbh2", 0x000000e0, SRFL_NOFFS, SROM5_LEDBH32, 0x00ff}, - {"ledbh3", 0x000000e0, SRFL_NOFFS, SROM5_LEDBH32, 0xff00}, - {"ledbh0", 0x00000700, SRFL_NOFFS, SROM8_LEDBH10, 0x00ff}, - {"ledbh1", 0x00000700, SRFL_NOFFS, SROM8_LEDBH10, 0xff00}, - {"ledbh2", 0x00000700, SRFL_NOFFS, SROM8_LEDBH32, 0x00ff}, - {"ledbh3", 0x00000700, SRFL_NOFFS, SROM8_LEDBH32, 0xff00}, - {"pa0b0", 0x0000000e, SRFL_PRHEX, SROM_WL0PAB0, 0xffff}, - {"pa0b1", 0x0000000e, SRFL_PRHEX, SROM_WL0PAB1, 0xffff}, - {"pa0b2", 0x0000000e, SRFL_PRHEX, SROM_WL0PAB2, 0xffff}, - {"pa0itssit", 0x0000000e, 0, SROM_ITT, 0x00ff}, - {"pa0maxpwr", 0x0000000e, 0, SROM_WL10MAXP, 0x00ff}, - {"pa0b0", 0x00000700, SRFL_PRHEX, SROM8_W0_PAB0, 0xffff}, - {"pa0b1", 0x00000700, SRFL_PRHEX, SROM8_W0_PAB1, 0xffff}, - {"pa0b2", 0x00000700, SRFL_PRHEX, SROM8_W0_PAB2, 0xffff}, - {"pa0itssit", 0x00000700, 0, SROM8_W0_ITTMAXP, 0xff00}, - {"pa0maxpwr", 0x00000700, 0, SROM8_W0_ITTMAXP, 0x00ff}, - {"opo", 0x0000000c, 0, SROM_OPO, 0x00ff}, - {"opo", 0x00000700, 0, SROM8_2G_OFDMPO, 0x00ff}, - {"aa2g", 0x0000000e, 0, SROM_AABREV, SROM_AA0_MASK}, - {"aa2g", 0x000000f0, 0, SROM4_AA, 0x00ff}, - {"aa2g", 0x00000700, 0, SROM8_AA, 0x00ff}, - {"aa5g", 0x0000000e, 0, SROM_AABREV, SROM_AA1_MASK}, - {"aa5g", 0x000000f0, 0, SROM4_AA, 0xff00}, - {"aa5g", 0x00000700, 0, SROM8_AA, 0xff00}, - {"ag0", 0x0000000e, 0, SROM_AG10, 0x00ff}, - {"ag1", 0x0000000e, 0, SROM_AG10, 0xff00}, - {"ag0", 0x000000f0, 0, SROM4_AG10, 0x00ff}, - {"ag1", 0x000000f0, 0, SROM4_AG10, 0xff00}, - {"ag2", 0x000000f0, 0, SROM4_AG32, 0x00ff}, - {"ag3", 0x000000f0, 0, SROM4_AG32, 0xff00}, - {"ag0", 0x00000700, 0, SROM8_AG10, 0x00ff}, - {"ag1", 0x00000700, 0, SROM8_AG10, 0xff00}, - {"ag2", 0x00000700, 0, SROM8_AG32, 0x00ff}, - {"ag3", 0x00000700, 0, SROM8_AG32, 0xff00}, - {"pa1b0", 0x0000000e, SRFL_PRHEX, SROM_WL1PAB0, 0xffff}, - {"pa1b1", 0x0000000e, SRFL_PRHEX, SROM_WL1PAB1, 0xffff}, - {"pa1b2", 0x0000000e, SRFL_PRHEX, SROM_WL1PAB2, 0xffff}, - {"pa1lob0", 0x0000000c, SRFL_PRHEX, SROM_WL1LPAB0, 0xffff}, - {"pa1lob1", 0x0000000c, SRFL_PRHEX, SROM_WL1LPAB1, 0xffff}, - {"pa1lob2", 0x0000000c, SRFL_PRHEX, SROM_WL1LPAB2, 0xffff}, - {"pa1hib0", 0x0000000c, SRFL_PRHEX, SROM_WL1HPAB0, 0xffff}, - {"pa1hib1", 0x0000000c, SRFL_PRHEX, SROM_WL1HPAB1, 0xffff}, - {"pa1hib2", 0x0000000c, SRFL_PRHEX, SROM_WL1HPAB2, 0xffff}, - {"pa1itssit", 0x0000000e, 0, SROM_ITT, 0xff00}, - {"pa1maxpwr", 0x0000000e, 0, SROM_WL10MAXP, 0xff00}, - {"pa1lomaxpwr", 0x0000000c, 0, SROM_WL1LHMAXP, 0xff00}, - {"pa1himaxpwr", 0x0000000c, 0, SROM_WL1LHMAXP, 0x00ff}, - {"pa1b0", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB0, 0xffff}, - {"pa1b1", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB1, 0xffff}, - {"pa1b2", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB2, 0xffff}, - {"pa1lob0", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB0_LC, 0xffff}, - {"pa1lob1", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB1_LC, 0xffff}, - {"pa1lob2", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB2_LC, 0xffff}, - {"pa1hib0", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB0_HC, 0xffff}, - {"pa1hib1", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB1_HC, 0xffff}, - {"pa1hib2", 0x00000700, SRFL_PRHEX, SROM8_W1_PAB2_HC, 0xffff}, - {"pa1itssit", 0x00000700, 0, SROM8_W1_ITTMAXP, 0xff00}, - {"pa1maxpwr", 0x00000700, 0, SROM8_W1_ITTMAXP, 0x00ff}, - {"pa1lomaxpwr", 0x00000700, 0, SROM8_W1_MAXP_LCHC, 0xff00}, - {"pa1himaxpwr", 0x00000700, 0, SROM8_W1_MAXP_LCHC, 0x00ff}, - {"bxa2g", 0x00000008, 0, SROM_BXARSSI2G, 0x1800}, - {"rssisav2g", 0x00000008, 0, SROM_BXARSSI2G, 0x0700}, - {"rssismc2g", 0x00000008, 0, SROM_BXARSSI2G, 0x00f0}, - {"rssismf2g", 0x00000008, 0, SROM_BXARSSI2G, 0x000f}, - {"bxa2g", 0x00000700, 0, SROM8_BXARSSI2G, 0x1800}, - {"rssisav2g", 0x00000700, 0, SROM8_BXARSSI2G, 0x0700}, - {"rssismc2g", 0x00000700, 0, SROM8_BXARSSI2G, 0x00f0}, - {"rssismf2g", 0x00000700, 0, SROM8_BXARSSI2G, 0x000f}, - {"bxa5g", 0x00000008, 0, SROM_BXARSSI5G, 0x1800}, - {"rssisav5g", 0x00000008, 0, SROM_BXARSSI5G, 0x0700}, - {"rssismc5g", 0x00000008, 0, SROM_BXARSSI5G, 0x00f0}, - {"rssismf5g", 0x00000008, 0, SROM_BXARSSI5G, 0x000f}, - {"bxa5g", 0x00000700, 0, SROM8_BXARSSI5G, 0x1800}, - {"rssisav5g", 0x00000700, 0, SROM8_BXARSSI5G, 0x0700}, - {"rssismc5g", 0x00000700, 0, SROM8_BXARSSI5G, 0x00f0}, - {"rssismf5g", 0x00000700, 0, SROM8_BXARSSI5G, 0x000f}, - {"tri2g", 0x00000008, 0, SROM_TRI52G, 0x00ff}, - {"tri5g", 0x00000008, 0, SROM_TRI52G, 0xff00}, - {"tri5gl", 0x00000008, 0, SROM_TRI5GHL, 0x00ff}, - {"tri5gh", 0x00000008, 0, SROM_TRI5GHL, 0xff00}, - {"tri2g", 0x00000700, 0, SROM8_TRI52G, 0x00ff}, - {"tri5g", 0x00000700, 0, SROM8_TRI52G, 0xff00}, - {"tri5gl", 0x00000700, 0, SROM8_TRI5GHL, 0x00ff}, - {"tri5gh", 0x00000700, 0, SROM8_TRI5GHL, 0xff00}, - {"rxpo2g", 0x00000008, SRFL_PRSIGN, SROM_RXPO52G, 0x00ff}, - {"rxpo5g", 0x00000008, SRFL_PRSIGN, SROM_RXPO52G, 0xff00}, - {"rxpo2g", 0x00000700, SRFL_PRSIGN, SROM8_RXPO52G, 0x00ff}, - {"rxpo5g", 0x00000700, SRFL_PRSIGN, SROM8_RXPO52G, 0xff00}, - {"txchain", 0x000000f0, SRFL_NOFFS, SROM4_TXRXC, SROM4_TXCHAIN_MASK}, - {"rxchain", 0x000000f0, SRFL_NOFFS, SROM4_TXRXC, SROM4_RXCHAIN_MASK}, - {"antswitch", 0x000000f0, SRFL_NOFFS, SROM4_TXRXC, SROM4_SWITCH_MASK}, - {"txchain", 0x00000700, SRFL_NOFFS, SROM8_TXRXC, SROM4_TXCHAIN_MASK}, - {"rxchain", 0x00000700, SRFL_NOFFS, SROM8_TXRXC, SROM4_RXCHAIN_MASK}, - {"antswitch", 0x00000700, SRFL_NOFFS, SROM8_TXRXC, SROM4_SWITCH_MASK}, - {"tssipos2g", 0x00000700, 0, SROM8_FEM2G, SROM8_FEM_TSSIPOS_MASK}, - {"extpagain2g", 0x00000700, 0, SROM8_FEM2G, SROM8_FEM_EXTPA_GAIN_MASK}, - {"pdetrange2g", 0x00000700, 0, SROM8_FEM2G, SROM8_FEM_PDET_RANGE_MASK}, - {"triso2g", 0x00000700, 0, SROM8_FEM2G, SROM8_FEM_TR_ISO_MASK}, - {"antswctl2g", 0x00000700, 0, SROM8_FEM2G, SROM8_FEM_ANTSWLUT_MASK}, - {"tssipos5g", 0x00000700, 0, SROM8_FEM5G, SROM8_FEM_TSSIPOS_MASK}, - {"extpagain5g", 0x00000700, 0, SROM8_FEM5G, SROM8_FEM_EXTPA_GAIN_MASK}, - {"pdetrange5g", 0x00000700, 0, SROM8_FEM5G, SROM8_FEM_PDET_RANGE_MASK}, - {"triso5g", 0x00000700, 0, SROM8_FEM5G, SROM8_FEM_TR_ISO_MASK}, - {"antswctl5g", 0x00000700, 0, SROM8_FEM5G, SROM8_FEM_ANTSWLUT_MASK}, - {"txpid2ga0", 0x000000f0, 0, SROM4_TXPID2G, 0x00ff}, - {"txpid2ga1", 0x000000f0, 0, SROM4_TXPID2G, 0xff00}, - {"txpid2ga2", 0x000000f0, 0, SROM4_TXPID2G + 1, 0x00ff}, - {"txpid2ga3", 0x000000f0, 0, SROM4_TXPID2G + 1, 0xff00}, - {"txpid5ga0", 0x000000f0, 0, SROM4_TXPID5G, 0x00ff}, - {"txpid5ga1", 0x000000f0, 0, SROM4_TXPID5G, 0xff00}, - {"txpid5ga2", 0x000000f0, 0, SROM4_TXPID5G + 1, 0x00ff}, - {"txpid5ga3", 0x000000f0, 0, SROM4_TXPID5G + 1, 0xff00}, - {"txpid5gla0", 0x000000f0, 0, SROM4_TXPID5GL, 0x00ff}, - {"txpid5gla1", 0x000000f0, 0, SROM4_TXPID5GL, 0xff00}, - {"txpid5gla2", 0x000000f0, 0, SROM4_TXPID5GL + 1, 0x00ff}, - {"txpid5gla3", 0x000000f0, 0, SROM4_TXPID5GL + 1, 0xff00}, - {"txpid5gha0", 0x000000f0, 0, SROM4_TXPID5GH, 0x00ff}, - {"txpid5gha1", 0x000000f0, 0, SROM4_TXPID5GH, 0xff00}, - {"txpid5gha2", 0x000000f0, 0, SROM4_TXPID5GH + 1, 0x00ff}, - {"txpid5gha3", 0x000000f0, 0, SROM4_TXPID5GH + 1, 0xff00}, - - {"ccode", 0x0000000f, SRFL_CCODE, SROM_CCODE, 0xffff}, - {"ccode", 0x00000010, SRFL_CCODE, SROM4_CCODE, 0xffff}, - {"ccode", 0x000000e0, SRFL_CCODE, SROM5_CCODE, 0xffff}, - {"ccode", 0x00000700, SRFL_CCODE, SROM8_CCODE, 0xffff}, - {"macaddr", 0x00000700, SRFL_ETHADDR, SROM8_MACHI, 0xffff}, - {"macaddr", 0x000000e0, SRFL_ETHADDR, SROM5_MACHI, 0xffff}, - {"macaddr", 0x00000010, SRFL_ETHADDR, SROM4_MACHI, 0xffff}, - {"macaddr", 0x00000008, SRFL_ETHADDR, SROM3_MACHI, 0xffff}, - {"il0macaddr", 0x00000007, SRFL_ETHADDR, SROM_MACHI_IL0, 0xffff}, - {"et1macaddr", 0x00000007, SRFL_ETHADDR, SROM_MACHI_ET1, 0xffff}, - {"leddc", 0x00000700, SRFL_NOFFS|SRFL_LEDDC, SROM8_LEDDC, 0xffff}, - {"leddc", 0x000000e0, SRFL_NOFFS|SRFL_LEDDC, SROM5_LEDDC, 0xffff}, - {"leddc", 0x00000010, SRFL_NOFFS|SRFL_LEDDC, SROM4_LEDDC, 0xffff}, - {"leddc", 0x00000008, SRFL_NOFFS|SRFL_LEDDC, SROM3_LEDDC, 0xffff}, - - {"tempthresh", 0x00000700, 0, SROM8_THERMAL, 0xff00}, - {"tempoffset", 0x00000700, 0, SROM8_THERMAL, 0x00ff}, - {"rawtempsense", 0x00000700, SRFL_PRHEX, SROM8_MPWR_RAWTS, 0x01ff}, - {"measpower", 0x00000700, SRFL_PRHEX, SROM8_MPWR_RAWTS, 0xfe00}, - {"tempsense_slope", 0x00000700, SRFL_PRHEX, SROM8_TS_SLP_OPT_CORRX, 0x00ff}, - {"tempcorrx", 0x00000700, SRFL_PRHEX, SROM8_TS_SLP_OPT_CORRX, 0xfc00}, - {"tempsense_option", 0x00000700, SRFL_PRHEX, SROM8_TS_SLP_OPT_CORRX, 0x0300}, - {"freqoffset_corr", 0x00000700, SRFL_PRHEX, SROM8_FOC_HWIQ_IQSWP, 0x000f}, - {"iqcal_swp_dis", 0x00000700, SRFL_PRHEX, SROM8_FOC_HWIQ_IQSWP, 0x0010}, - {"hw_iqcal_en", 0x00000700, SRFL_PRHEX, SROM8_FOC_HWIQ_IQSWP, 0x0020}, - {"elna2g", 0x00000700, 0, SROM8_EXTLNAGAIN, 0x00ff}, - {"elna5g", 0x00000700, 0, SROM8_EXTLNAGAIN, 0xff00}, - {"phycal_tempdelta", 0x00000700, 0, SROM8_PHYCAL_TEMPDELTA, 0x00ff}, - {"temps_period", 0x00000700, 0, SROM8_PHYCAL_TEMPDELTA, 0x0f00}, - {"temps_hysteresis", 0x00000700, 0, SROM8_PHYCAL_TEMPDELTA, 0xf000}, - {"measpower1", 0x00000700, SRFL_PRHEX, SROM8_MPWR_1_AND_2, 0x007f}, - {"measpower2", 0x00000700, SRFL_PRHEX, SROM8_MPWR_1_AND_2, 0x3f80}, - - {"cck2gpo", 0x000000f0, 0, SROM4_2G_CCKPO, 0xffff}, - {"cck2gpo", 0x00000100, 0, SROM8_2G_CCKPO, 0xffff}, - {"ofdm2gpo", 0x000000f0, SRFL_MORE, SROM4_2G_OFDMPO, 0xffff}, - {"", 0, 0, SROM4_2G_OFDMPO + 1, 0xffff}, - {"ofdm5gpo", 0x000000f0, SRFL_MORE, SROM4_5G_OFDMPO, 0xffff}, - {"", 0, 0, SROM4_5G_OFDMPO + 1, 0xffff}, - {"ofdm5glpo", 0x000000f0, SRFL_MORE, SROM4_5GL_OFDMPO, 0xffff}, - {"", 0, 0, SROM4_5GL_OFDMPO + 1, 0xffff}, - {"ofdm5ghpo", 0x000000f0, SRFL_MORE, SROM4_5GH_OFDMPO, 0xffff}, - {"", 0, 0, SROM4_5GH_OFDMPO + 1, 0xffff}, - {"ofdm2gpo", 0x00000100, SRFL_MORE, SROM8_2G_OFDMPO, 0xffff}, - {"", 0, 0, SROM8_2G_OFDMPO + 1, 0xffff}, - {"ofdm5gpo", 0x00000100, SRFL_MORE, SROM8_5G_OFDMPO, 0xffff}, - {"", 0, 0, SROM8_5G_OFDMPO + 1, 0xffff}, - {"ofdm5glpo", 0x00000100, SRFL_MORE, SROM8_5GL_OFDMPO, 0xffff}, - {"", 0, 0, SROM8_5GL_OFDMPO + 1, 0xffff}, - {"ofdm5ghpo", 0x00000100, SRFL_MORE, SROM8_5GH_OFDMPO, 0xffff}, - {"", 0, 0, SROM8_5GH_OFDMPO + 1, 0xffff}, - {"mcs2gpo0", 0x000000f0, 0, SROM4_2G_MCSPO, 0xffff}, - {"mcs2gpo1", 0x000000f0, 0, SROM4_2G_MCSPO + 1, 0xffff}, - {"mcs2gpo2", 0x000000f0, 0, SROM4_2G_MCSPO + 2, 0xffff}, - {"mcs2gpo3", 0x000000f0, 0, SROM4_2G_MCSPO + 3, 0xffff}, - {"mcs2gpo4", 0x000000f0, 0, SROM4_2G_MCSPO + 4, 0xffff}, - {"mcs2gpo5", 0x000000f0, 0, SROM4_2G_MCSPO + 5, 0xffff}, - {"mcs2gpo6", 0x000000f0, 0, SROM4_2G_MCSPO + 6, 0xffff}, - {"mcs2gpo7", 0x000000f0, 0, SROM4_2G_MCSPO + 7, 0xffff}, - {"mcs5gpo0", 0x000000f0, 0, SROM4_5G_MCSPO, 0xffff}, - {"mcs5gpo1", 0x000000f0, 0, SROM4_5G_MCSPO + 1, 0xffff}, - {"mcs5gpo2", 0x000000f0, 0, SROM4_5G_MCSPO + 2, 0xffff}, - {"mcs5gpo3", 0x000000f0, 0, SROM4_5G_MCSPO + 3, 0xffff}, - {"mcs5gpo4", 0x000000f0, 0, SROM4_5G_MCSPO + 4, 0xffff}, - {"mcs5gpo5", 0x000000f0, 0, SROM4_5G_MCSPO + 5, 0xffff}, - {"mcs5gpo6", 0x000000f0, 0, SROM4_5G_MCSPO + 6, 0xffff}, - {"mcs5gpo7", 0x000000f0, 0, SROM4_5G_MCSPO + 7, 0xffff}, - {"mcs5glpo0", 0x000000f0, 0, SROM4_5GL_MCSPO, 0xffff}, - {"mcs5glpo1", 0x000000f0, 0, SROM4_5GL_MCSPO + 1, 0xffff}, - {"mcs5glpo2", 0x000000f0, 0, SROM4_5GL_MCSPO + 2, 0xffff}, - {"mcs5glpo3", 0x000000f0, 0, SROM4_5GL_MCSPO + 3, 0xffff}, - {"mcs5glpo4", 0x000000f0, 0, SROM4_5GL_MCSPO + 4, 0xffff}, - {"mcs5glpo5", 0x000000f0, 0, SROM4_5GL_MCSPO + 5, 0xffff}, - {"mcs5glpo6", 0x000000f0, 0, SROM4_5GL_MCSPO + 6, 0xffff}, - {"mcs5glpo7", 0x000000f0, 0, SROM4_5GL_MCSPO + 7, 0xffff}, - {"mcs5ghpo0", 0x000000f0, 0, SROM4_5GH_MCSPO, 0xffff}, - {"mcs5ghpo1", 0x000000f0, 0, SROM4_5GH_MCSPO + 1, 0xffff}, - {"mcs5ghpo2", 0x000000f0, 0, SROM4_5GH_MCSPO + 2, 0xffff}, - {"mcs5ghpo3", 0x000000f0, 0, SROM4_5GH_MCSPO + 3, 0xffff}, - {"mcs5ghpo4", 0x000000f0, 0, SROM4_5GH_MCSPO + 4, 0xffff}, - {"mcs5ghpo5", 0x000000f0, 0, SROM4_5GH_MCSPO + 5, 0xffff}, - {"mcs5ghpo6", 0x000000f0, 0, SROM4_5GH_MCSPO + 6, 0xffff}, - {"mcs5ghpo7", 0x000000f0, 0, SROM4_5GH_MCSPO + 7, 0xffff}, - {"mcs2gpo0", 0x00000100, 0, SROM8_2G_MCSPO, 0xffff}, - {"mcs2gpo1", 0x00000100, 0, SROM8_2G_MCSPO + 1, 0xffff}, - {"mcs2gpo2", 0x00000100, 0, SROM8_2G_MCSPO + 2, 0xffff}, - {"mcs2gpo3", 0x00000100, 0, SROM8_2G_MCSPO + 3, 0xffff}, - {"mcs2gpo4", 0x00000100, 0, SROM8_2G_MCSPO + 4, 0xffff}, - {"mcs2gpo5", 0x00000100, 0, SROM8_2G_MCSPO + 5, 0xffff}, - {"mcs2gpo6", 0x00000100, 0, SROM8_2G_MCSPO + 6, 0xffff}, - {"mcs2gpo7", 0x00000100, 0, SROM8_2G_MCSPO + 7, 0xffff}, - {"mcs5gpo0", 0x00000100, 0, SROM8_5G_MCSPO, 0xffff}, - {"mcs5gpo1", 0x00000100, 0, SROM8_5G_MCSPO + 1, 0xffff}, - {"mcs5gpo2", 0x00000100, 0, SROM8_5G_MCSPO + 2, 0xffff}, - {"mcs5gpo3", 0x00000100, 0, SROM8_5G_MCSPO + 3, 0xffff}, - {"mcs5gpo4", 0x00000100, 0, SROM8_5G_MCSPO + 4, 0xffff}, - {"mcs5gpo5", 0x00000100, 0, SROM8_5G_MCSPO + 5, 0xffff}, - {"mcs5gpo6", 0x00000100, 0, SROM8_5G_MCSPO + 6, 0xffff}, - {"mcs5gpo7", 0x00000100, 0, SROM8_5G_MCSPO + 7, 0xffff}, - {"mcs5glpo0", 0x00000100, 0, SROM8_5GL_MCSPO, 0xffff}, - {"mcs5glpo1", 0x00000100, 0, SROM8_5GL_MCSPO + 1, 0xffff}, - {"mcs5glpo2", 0x00000100, 0, SROM8_5GL_MCSPO + 2, 0xffff}, - {"mcs5glpo3", 0x00000100, 0, SROM8_5GL_MCSPO + 3, 0xffff}, - {"mcs5glpo4", 0x00000100, 0, SROM8_5GL_MCSPO + 4, 0xffff}, - {"mcs5glpo5", 0x00000100, 0, SROM8_5GL_MCSPO + 5, 0xffff}, - {"mcs5glpo6", 0x00000100, 0, SROM8_5GL_MCSPO + 6, 0xffff}, - {"mcs5glpo7", 0x00000100, 0, SROM8_5GL_MCSPO + 7, 0xffff}, - {"mcs5ghpo0", 0x00000100, 0, SROM8_5GH_MCSPO, 0xffff}, - {"mcs5ghpo1", 0x00000100, 0, SROM8_5GH_MCSPO + 1, 0xffff}, - {"mcs5ghpo2", 0x00000100, 0, SROM8_5GH_MCSPO + 2, 0xffff}, - {"mcs5ghpo3", 0x00000100, 0, SROM8_5GH_MCSPO + 3, 0xffff}, - {"mcs5ghpo4", 0x00000100, 0, SROM8_5GH_MCSPO + 4, 0xffff}, - {"mcs5ghpo5", 0x00000100, 0, SROM8_5GH_MCSPO + 5, 0xffff}, - {"mcs5ghpo6", 0x00000100, 0, SROM8_5GH_MCSPO + 6, 0xffff}, - {"mcs5ghpo7", 0x00000100, 0, SROM8_5GH_MCSPO + 7, 0xffff}, - {"cddpo", 0x000000f0, 0, SROM4_CDDPO, 0xffff}, - {"stbcpo", 0x000000f0, 0, SROM4_STBCPO, 0xffff}, - {"bw40po", 0x000000f0, 0, SROM4_BW40PO, 0xffff}, - {"bwduppo", 0x000000f0, 0, SROM4_BWDUPPO, 0xffff}, - {"cddpo", 0x00000100, 0, SROM8_CDDPO, 0xffff}, - {"stbcpo", 0x00000100, 0, SROM8_STBCPO, 0xffff}, - {"bw40po", 0x00000100, 0, SROM8_BW40PO, 0xffff}, - {"bwduppo", 0x00000100, 0, SROM8_BWDUPPO, 0xffff}, - - /* power per rate from sromrev 9 */ - {"cckbw202gpo", 0x00000600, 0, SROM9_2GPO_CCKBW20, 0xffff}, - {"cckbw20ul2gpo", 0x00000600, 0, SROM9_2GPO_CCKBW20UL, 0xffff}, - {"legofdmbw202gpo", 0x00000600, SRFL_MORE, SROM9_2GPO_LOFDMBW20, 0xffff}, - {"", 0, 0, SROM9_2GPO_LOFDMBW20 + 1, 0xffff}, - {"legofdmbw20ul2gpo", 0x00000600, SRFL_MORE, SROM9_2GPO_LOFDMBW20UL, 0xffff}, - {"", 0, 0, SROM9_2GPO_LOFDMBW20UL + 1, 0xffff}, - {"legofdmbw205glpo", 0x00000600, SRFL_MORE, SROM9_5GLPO_LOFDMBW20, 0xffff}, - {"", 0, 0, SROM9_5GLPO_LOFDMBW20 + 1, 0xffff}, - {"legofdmbw20ul5glpo", 0x00000600, SRFL_MORE, SROM9_5GLPO_LOFDMBW20UL, 0xffff}, - {"", 0, 0, SROM9_5GLPO_LOFDMBW20UL + 1, 0xffff}, - {"legofdmbw205gmpo", 0x00000600, SRFL_MORE, SROM9_5GMPO_LOFDMBW20, 0xffff}, - {"", 0, 0, SROM9_5GMPO_LOFDMBW20 + 1, 0xffff}, - {"legofdmbw20ul5gmpo", 0x00000600, SRFL_MORE, SROM9_5GMPO_LOFDMBW20UL, 0xffff}, - {"", 0, 0, SROM9_5GMPO_LOFDMBW20UL + 1, 0xffff}, - {"legofdmbw205ghpo", 0x00000600, SRFL_MORE, SROM9_5GHPO_LOFDMBW20, 0xffff}, - {"", 0, 0, SROM9_5GHPO_LOFDMBW20 + 1, 0xffff}, - {"legofdmbw20ul5ghpo", 0x00000600, SRFL_MORE, SROM9_5GHPO_LOFDMBW20UL, 0xffff}, - {"", 0, 0, SROM9_5GHPO_LOFDMBW20UL + 1, 0xffff}, - {"mcsbw202gpo", 0x00000600, SRFL_MORE, SROM9_2GPO_MCSBW20, 0xffff}, - {"", 0, 0, SROM9_2GPO_MCSBW20 + 1, 0xffff}, - {"mcsbw20ul2gpo", 0x00000600, SRFL_MORE, SROM9_2GPO_MCSBW20UL, 0xffff}, - {"", 0, 0, SROM9_2GPO_MCSBW20UL + 1, 0xffff}, - {"mcsbw402gpo", 0x00000600, SRFL_MORE, SROM9_2GPO_MCSBW40, 0xffff}, - {"", 0, 0, SROM9_2GPO_MCSBW40 + 1, 0xffff}, - {"mcsbw205glpo", 0x00000600, SRFL_MORE, SROM9_5GLPO_MCSBW20, 0xffff}, - {"", 0, 0, SROM9_5GLPO_MCSBW20 + 1, 0xffff}, - {"mcsbw20ul5glpo", 0x00000600, SRFL_MORE, SROM9_5GLPO_MCSBW20UL, 0xffff}, - {"", 0, 0, SROM9_5GLPO_MCSBW20UL + 1, 0xffff}, - {"mcsbw405glpo", 0x00000600, SRFL_MORE, SROM9_5GLPO_MCSBW40, 0xffff}, - {"", 0, 0, SROM9_5GLPO_MCSBW40 + 1, 0xffff}, - {"mcsbw205gmpo", 0x00000600, SRFL_MORE, SROM9_5GMPO_MCSBW20, 0xffff}, - {"", 0, 0, SROM9_5GMPO_MCSBW20 + 1, 0xffff}, - {"mcsbw20ul5gmpo", 0x00000600, SRFL_MORE, SROM9_5GMPO_MCSBW20UL, 0xffff}, - {"", 0, 0, SROM9_5GMPO_MCSBW20UL + 1, 0xffff}, - {"mcsbw405gmpo", 0x00000600, SRFL_MORE, SROM9_5GMPO_MCSBW40, 0xffff}, - {"", 0, 0, SROM9_5GMPO_MCSBW40 + 1, 0xffff}, - {"mcsbw205ghpo", 0x00000600, SRFL_MORE, SROM9_5GHPO_MCSBW20, 0xffff}, - {"", 0, 0, SROM9_5GHPO_MCSBW20 + 1, 0xffff}, - {"mcsbw20ul5ghpo", 0x00000600, SRFL_MORE, SROM9_5GHPO_MCSBW20UL, 0xffff}, - {"", 0, 0, SROM9_5GHPO_MCSBW20UL + 1, 0xffff}, - {"mcsbw405ghpo", 0x00000600, SRFL_MORE, SROM9_5GHPO_MCSBW40, 0xffff}, - {"", 0, 0, SROM9_5GHPO_MCSBW40 + 1, 0xffff}, - {"mcs32po", 0x00000600, 0, SROM9_PO_MCS32, 0xffff}, - {"legofdm40duppo", 0x00000600, 0, SROM9_PO_LOFDM40DUP, 0xffff}, - {"pcieingress_war", 0x00000700, 0, SROM8_PCIEINGRESS_WAR, 0xf}, - {"rxgainerr2ga0", 0x00000700, 0, SROM8_RXGAINERR_2G, 0x003f}, - {"rxgainerr2ga1", 0x00000700, 0, SROM8_RXGAINERR_2G, 0x07c0}, - {"rxgainerr2ga2", 0x00000700, 0, SROM8_RXGAINERR_2G, 0xf800}, - {"rxgainerr5gla0", 0x00000700, 0, SROM8_RXGAINERR_5GL, 0x003f}, - {"rxgainerr5gla1", 0x00000700, 0, SROM8_RXGAINERR_5GL, 0x07c0}, - {"rxgainerr5gla2", 0x00000700, 0, SROM8_RXGAINERR_5GL, 0xf800}, - {"rxgainerr5gma0", 0x00000700, 0, SROM8_RXGAINERR_5GM, 0x003f}, - {"rxgainerr5gma1", 0x00000700, 0, SROM8_RXGAINERR_5GM, 0x07c0}, - {"rxgainerr5gma2", 0x00000700, 0, SROM8_RXGAINERR_5GM, 0xf800}, - {"rxgainerr5gha0", 0x00000700, 0, SROM8_RXGAINERR_5GH, 0x003f}, - {"rxgainerr5gha1", 0x00000700, 0, SROM8_RXGAINERR_5GH, 0x07c0}, - {"rxgainerr5gha2", 0x00000700, 0, SROM8_RXGAINERR_5GH, 0xf800}, - {"rxgainerr5gua0", 0x00000700, 0, SROM8_RXGAINERR_5GU, 0x003f}, - {"rxgainerr5gua1", 0x00000700, 0, SROM8_RXGAINERR_5GU, 0x07c0}, - {"rxgainerr5gua2", 0x00000700, 0, SROM8_RXGAINERR_5GU, 0xf800}, - {"sar2g", 0x00000600, 0, SROM9_SAR, 0x00ff}, - {"sar5g", 0x00000600, 0, SROM9_SAR, 0xff00}, - {"noiselvl2ga0", 0x00000700, 0, SROM8_NOISELVL_2G, 0x001f}, - {"noiselvl2ga1", 0x00000700, 0, SROM8_NOISELVL_2G, 0x03e0}, - {"noiselvl2ga2", 0x00000700, 0, SROM8_NOISELVL_2G, 0x7c00}, - {"noiselvl5gla0", 0x00000700, 0, SROM8_NOISELVL_5GL, 0x001f}, - {"noiselvl5gla1", 0x00000700, 0, SROM8_NOISELVL_5GL, 0x03e0}, - {"noiselvl5gla2", 0x00000700, 0, SROM8_NOISELVL_5GL, 0x7c00}, - {"noiselvl5gma0", 0x00000700, 0, SROM8_NOISELVL_5GM, 0x001f}, - {"noiselvl5gma1", 0x00000700, 0, SROM8_NOISELVL_5GM, 0x03e0}, - {"noiselvl5gma2", 0x00000700, 0, SROM8_NOISELVL_5GM, 0x7c00}, - {"noiselvl5gha0", 0x00000700, 0, SROM8_NOISELVL_5GH, 0x001f}, - {"noiselvl5gha1", 0x00000700, 0, SROM8_NOISELVL_5GH, 0x03e0}, - {"noiselvl5gha2", 0x00000700, 0, SROM8_NOISELVL_5GH, 0x7c00}, - {"noiselvl5gua0", 0x00000700, 0, SROM8_NOISELVL_5GU, 0x001f}, - {"noiselvl5gua1", 0x00000700, 0, SROM8_NOISELVL_5GU, 0x03e0}, - {"noiselvl5gua2", 0x00000700, 0, SROM8_NOISELVL_5GU, 0x7c00}, - {"subband5gver", 0x00000700, 0, SROM8_SUBBAND_PPR, 0x7}, - - {"cckPwrOffset", 0x00000400, 0, SROM10_CCKPWROFFSET, 0xffff}, - /* swctrlmap_2g array, note that the last element doesn't have SRFL_ARRAY flag set */ - {"swctrlmap_2g", 0x00000400, SRFL_MORE|SRFL_PRHEX|SRFL_ARRAY, SROM10_SWCTRLMAP_2G, 0xffff}, - {"", 0x00000400, SRFL_ARRAY, SROM10_SWCTRLMAP_2G + 1, 0xffff}, - {"", 0x00000400, SRFL_MORE|SRFL_PRHEX|SRFL_ARRAY, SROM10_SWCTRLMAP_2G + 2, 0xffff}, - {"", 0x00000400, SRFL_ARRAY, SROM10_SWCTRLMAP_2G + 3, 0xffff}, - {"", 0x00000400, SRFL_MORE|SRFL_PRHEX|SRFL_ARRAY, SROM10_SWCTRLMAP_2G + 4, 0xffff}, - {"", 0x00000400, SRFL_ARRAY, SROM10_SWCTRLMAP_2G + 5, 0xffff}, - {"", 0x00000400, SRFL_MORE|SRFL_PRHEX|SRFL_ARRAY, SROM10_SWCTRLMAP_2G + 6, 0xffff}, - {"", 0x00000400, SRFL_ARRAY, SROM10_SWCTRLMAP_2G + 7, 0xffff}, - {"", 0x00000400, SRFL_PRHEX, SROM10_SWCTRLMAP_2G + 8, 0xffff}, - - /* sromrev 11 */ - {"boardflags3", 0xfffff800, SRFL_PRHEX|SRFL_MORE, SROM11_BFL3, 0xffff}, - {"", 0, 0, SROM11_BFL3, 0xffff}, - {"boardnum", 0xfffff800, 0, SROM11_MACLO, 0xffff}, - {"macaddr", 0xfffff800, SRFL_ETHADDR, SROM11_MACHI, 0xffff}, - {"ccode", 0xfffff800, SRFL_CCODE, SROM11_CCODE, 0xffff}, - {"regrev", 0xfffff800, 0, SROM11_REGREV, 0x00ff}, - {"ledbh0", 0xfffff800, SRFL_NOFFS, SROM11_LEDBH10, 0x00ff}, - {"ledbh1", 0xfffff800, SRFL_NOFFS, SROM11_LEDBH10, 0xff00}, - {"ledbh2", 0xfffff800, SRFL_NOFFS, SROM11_LEDBH32, 0x00ff}, - {"ledbh3", 0xfffff800, SRFL_NOFFS, SROM11_LEDBH32, 0xff00}, - {"leddc", 0xfffff800, SRFL_NOFFS|SRFL_LEDDC, SROM11_LEDDC, 0xffff}, - {"aa2g", 0xfffff800, 0, SROM11_AA, 0x00ff}, - {"aa5g", 0xfffff800, 0, SROM11_AA, 0xff00}, - {"agbg0", 0xfffff800, 0, SROM11_AGBG10, 0x00ff}, - {"agbg1", 0xfffff800, 0, SROM11_AGBG10, 0xff00}, - {"agbg2", 0xfffff800, 0, SROM11_AGBG2A0, 0x00ff}, - {"aga0", 0xfffff800, 0, SROM11_AGBG2A0, 0xff00}, - {"aga1", 0xfffff800, 0, SROM11_AGA21, 0x00ff}, - {"aga2", 0xfffff800, 0, SROM11_AGA21, 0xff00}, - {"txchain", 0xfffff800, SRFL_NOFFS, SROM11_TXRXC, SROM4_TXCHAIN_MASK}, - {"rxchain", 0xfffff800, SRFL_NOFFS, SROM11_TXRXC, SROM4_RXCHAIN_MASK}, - {"antswitch", 0xfffff800, SRFL_NOFFS, SROM11_TXRXC, SROM4_SWITCH_MASK}, - - {"tssiposslope2g", 0xfffff800, 0, SROM11_FEM_CFG1, 0x0001}, - {"epagain2g", 0xfffff800, 0, SROM11_FEM_CFG1, 0x000e}, - {"pdgain2g", 0xfffff800, 0, SROM11_FEM_CFG1, 0x01f0}, - {"tworangetssi2g", 0xfffff800, 0, SROM11_FEM_CFG1, 0x0200}, - {"papdcap2g", 0xfffff800, 0, SROM11_FEM_CFG1, 0x0400}, - {"femctrl", 0xfffff800, 0, SROM11_FEM_CFG1, 0xf800}, - - {"tssiposslope5g", 0xfffff800, 0, SROM11_FEM_CFG2, 0x0001}, - {"epagain5g", 0xfffff800, 0, SROM11_FEM_CFG2, 0x000e}, - {"pdgain5g", 0xfffff800, 0, SROM11_FEM_CFG2, 0x01f0}, - {"tworangetssi5g", 0xfffff800, 0, SROM11_FEM_CFG2, 0x0200}, - {"papdcap5g", 0xfffff800, 0, SROM11_FEM_CFG2, 0x0400}, - {"gainctrlsph", 0xfffff800, 0, SROM11_FEM_CFG2, 0xf800}, - - {"tempthresh", 0xfffff800, 0, SROM11_THERMAL, 0xff00}, - {"tempoffset", 0xfffff800, 0, SROM11_THERMAL, 0x00ff}, - {"rawtempsense", 0xfffff800, SRFL_PRHEX, SROM11_MPWR_RAWTS, 0x01ff}, - {"measpower", 0xfffff800, SRFL_PRHEX, SROM11_MPWR_RAWTS, 0xfe00}, - {"tempsense_slope", 0xfffff800, SRFL_PRHEX, SROM11_TS_SLP_OPT_CORRX, 0x00ff}, - {"tempcorrx", 0xfffff800, SRFL_PRHEX, SROM11_TS_SLP_OPT_CORRX, 0xfc00}, - {"tempsense_option", 0xfffff800, SRFL_PRHEX, SROM11_TS_SLP_OPT_CORRX, 0x0300}, - {"phycal_tempdelta", 0xfffff800, 0, SROM11_PHYCAL_TEMPDELTA, 0x00ff}, - {"temps_period", 0xfffff800, 0, SROM11_PHYCAL_TEMPDELTA, 0x0f00}, - {"temps_hysteresis", 0xfffff800, 0, SROM11_PHYCAL_TEMPDELTA, 0xf000}, - {"measpower1", 0xfffff800, SRFL_PRHEX, SROM11_MPWR_1_AND_2, 0x007f}, - {"measpower2", 0xfffff800, SRFL_PRHEX, SROM11_MPWR_1_AND_2, 0x3f80}, - {"pdoffset40ma0", 0xfffff800, 0, SROM11_PDOFF_40M_A0, 0xffff}, - {"pdoffset40ma1", 0xfffff800, 0, SROM11_PDOFF_40M_A1, 0xffff}, - {"pdoffset40ma2", 0xfffff800, 0, SROM11_PDOFF_40M_A2, 0xffff}, - {"pdoffset80ma0", 0xfffff800, 0, SROM11_PDOFF_80M_A0, 0xffff}, - {"pdoffset80ma1", 0xfffff800, 0, SROM11_PDOFF_80M_A1, 0xffff}, - {"pdoffset80ma2", 0xfffff800, 0, SROM11_PDOFF_80M_A2, 0xffff}, - - {"subband5gver", 0xfffff800, SRFL_PRHEX, SROM11_SUBBAND5GVER, 0xffff}, - - /* power per rate */ - {"cckbw202gpo", 0xfffff800, 0, SROM11_CCKBW202GPO, 0xffff}, - {"cckbw20ul2gpo", 0xfffff800, 0, SROM11_CCKBW20UL2GPO, 0xffff}, - {"mcsbw202gpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW202GPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW202GPO_1, 0xffff}, - {"mcsbw402gpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW402GPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW402GPO_1, 0xffff}, - {"dot11agofdmhrbw202gpo", 0xfffff800, 0, SROM11_DOT11AGOFDMHRBW202GPO, 0xffff}, - {"ofdmlrbw202gpo", 0xfffff800, 0, SROM11_OFDMLRBW202GPO, 0xffff}, - {"mcsbw205glpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW205GLPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW205GLPO_1, 0xffff}, - {"mcsbw405glpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW405GLPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW405GLPO_1, 0xffff}, - {"mcsbw805glpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW805GLPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW805GLPO_1, 0xffff}, - {"mcsbw1605glpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW1605GLPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW1605GLPO_1, 0xffff}, - {"mcsbw205gmpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW205GMPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW205GMPO_1, 0xffff}, - {"mcsbw405gmpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW405GMPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW405GMPO_1, 0xffff}, - {"mcsbw805gmpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW805GMPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW805GMPO_1, 0xffff}, - {"mcsbw1605gmpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW1605GMPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW1605GMPO_1, 0xffff}, - {"mcsbw205ghpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW205GHPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW205GHPO_1, 0xffff}, - {"mcsbw405ghpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW405GHPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW405GHPO_1, 0xffff}, - {"mcsbw805ghpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW805GHPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW805GHPO_1, 0xffff}, - {"mcsbw1605ghpo", 0xfffff800, SRFL_MORE, SROM11_MCSBW1605GHPO, 0xffff}, - {"", 0xfffff800, 0, SROM11_MCSBW1605GHPO_1, 0xffff}, - {"mcslr5glpo", 0xfffff800, 0, SROM11_MCSLR5GLPO, 0xffff}, - {"mcslr5gmpo", 0xfffff800, 0, SROM11_MCSLR5GMPO, 0xffff}, - {"mcslr5ghpo", 0xfffff800, 0, SROM11_MCSLR5GHPO, 0xffff}, - {"sb20in40hrrpo", 0xfffff800, 0, SROM11_SB20IN40HRPO, 0xffff}, - {"sb20in80and160hr5glpo", 0xfffff800, 0, SROM11_SB20IN80AND160HR5GLPO, 0xffff}, - {"sb40and80hr5glpo", 0xfffff800, 0, SROM11_SB40AND80HR5GLPO, 0xffff}, - {"sb20in80and160hr5gmpo", 0xfffff800, 0, SROM11_SB20IN80AND160HR5GMPO, 0xffff}, - {"sb40and80hr5gmpo", 0xfffff800, 0, SROM11_SB40AND80HR5GMPO, 0xffff}, - {"sb20in80and160hr5ghpo", 0xfffff800, 0, SROM11_SB20IN80AND160HR5GHPO, 0xffff}, - {"sb40and80hr5ghpo", 0xfffff800, 0, SROM11_SB40AND80HR5GHPO, 0xffff}, - {"sb20in40lrpo", 0xfffff800, 0, SROM11_SB20IN40LRPO, 0xffff}, - {"sb20in80and160lr5glpo", 0xfffff800, 0, SROM11_SB20IN80AND160LR5GLPO, 0xffff}, - {"sb40and80lr5glpo", 0xfffff800, 0, SROM11_SB40AND80LR5GLPO, 0xffff}, - {"sb20in80and160lr5gmpo", 0xfffff800, 0, SROM11_SB20IN80AND160LR5GMPO, 0xffff}, - {"sb40and80lr5gmpo", 0xfffff800, 0, SROM11_SB40AND80LR5GMPO, 0xffff}, - {"sb20in80and160lr5ghpo", 0xfffff800, 0, SROM11_SB20IN80AND160LR5GHPO, 0xffff}, - {"sb40and80lr5ghpo", 0xfffff800, 0, SROM11_SB40AND80LR5GHPO, 0xffff}, - {"dot11agduphrpo", 0xfffff800, 0, SROM11_DOT11AGDUPHRPO, 0xffff}, - {"dot11agduplrpo", 0xfffff800, 0, SROM11_DOT11AGDUPLRPO, 0xffff}, - - /* Misc */ - {"pcieingress_war", 0xfffff800, 0, SROM11_PCIEINGRESS_WAR, 0xf}, - {"sar2g", 0xfffff800, 0, SROM11_SAR, 0x00ff}, - {"sar5g", 0xfffff800, 0, SROM11_SAR, 0xff00}, - - {"noiselvl2ga0", 0xfffff800, 0, SROM11_NOISELVL_2G, 0x001f}, - {"noiselvl2ga1", 0xfffff800, 0, SROM11_NOISELVL_2G, 0x03e0}, - {"noiselvl2ga2", 0xfffff800, 0, SROM11_NOISELVL_2G, 0x7c00}, - {"noiselvl5ga0", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GL, 0x001f}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GM, 0x001f}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GH, 0x001f}, - {"", 0xfffff800, 0, SROM11_NOISELVL_5GU, 0x001f}, - {"noiselvl5ga1", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GL, 0x03e0}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GM, 0x03e0}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GH, 0x03e0}, - {"", 0xfffff800, 0, SROM11_NOISELVL_5GU, 0x03e0}, - {"noiselvl5ga2", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GL, 0x7c00}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GM, 0x7c00}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_NOISELVL_5GH, 0x7c00}, - {"", 0xfffff800, 0, SROM11_NOISELVL_5GU, 0x7c00}, - - {"rxgainerr2ga0", 0xfffff800, 0, SROM11_RXGAINERR_2G, 0x003f}, - {"rxgainerr2ga1", 0xfffff800, 0, SROM11_RXGAINERR_2G, 0x07c0}, - {"rxgainerr2ga2", 0xfffff800, 0, SROM11_RXGAINERR_2G, 0xf800}, - {"rxgainerr5ga0", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GL, 0x003f}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GM, 0x003f}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GH, 0x003f}, - {"", 0xfffff800, 0, SROM11_RXGAINERR_5GU, 0x003f}, - {"rxgainerr5ga1", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GL, 0x07c0}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GM, 0x07c0}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GH, 0x07c0}, - {"", 0xfffff800, 0, SROM11_RXGAINERR_5GU, 0x07c0}, - {"rxgainerr5ga2", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GL, 0xf800}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GM, 0xf800}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_RXGAINERR_5GH, 0xf800}, - {"", 0xfffff800, 0, SROM11_RXGAINERR_5GU, 0xf800}, - - {NULL, 0, 0, 0, 0} -}; - -static const sromvar_t perpath_pci_sromvars[] = { - {"maxp2ga", 0x000000f0, 0, SROM4_2G_ITT_MAXP, 0x00ff}, - {"itt2ga", 0x000000f0, 0, SROM4_2G_ITT_MAXP, 0xff00}, - {"itt5ga", 0x000000f0, 0, SROM4_5G_ITT_MAXP, 0xff00}, - {"pa2gw0a", 0x000000f0, SRFL_PRHEX, SROM4_2G_PA, 0xffff}, - {"pa2gw1a", 0x000000f0, SRFL_PRHEX, SROM4_2G_PA + 1, 0xffff}, - {"pa2gw2a", 0x000000f0, SRFL_PRHEX, SROM4_2G_PA + 2, 0xffff}, - {"pa2gw3a", 0x000000f0, SRFL_PRHEX, SROM4_2G_PA + 3, 0xffff}, - {"maxp5ga", 0x000000f0, 0, SROM4_5G_ITT_MAXP, 0x00ff}, - {"maxp5gha", 0x000000f0, 0, SROM4_5GLH_MAXP, 0x00ff}, - {"maxp5gla", 0x000000f0, 0, SROM4_5GLH_MAXP, 0xff00}, - {"pa5gw0a", 0x000000f0, SRFL_PRHEX, SROM4_5G_PA, 0xffff}, - {"pa5gw1a", 0x000000f0, SRFL_PRHEX, SROM4_5G_PA + 1, 0xffff}, - {"pa5gw2a", 0x000000f0, SRFL_PRHEX, SROM4_5G_PA + 2, 0xffff}, - {"pa5gw3a", 0x000000f0, SRFL_PRHEX, SROM4_5G_PA + 3, 0xffff}, - {"pa5glw0a", 0x000000f0, SRFL_PRHEX, SROM4_5GL_PA, 0xffff}, - {"pa5glw1a", 0x000000f0, SRFL_PRHEX, SROM4_5GL_PA + 1, 0xffff}, - {"pa5glw2a", 0x000000f0, SRFL_PRHEX, SROM4_5GL_PA + 2, 0xffff}, - {"pa5glw3a", 0x000000f0, SRFL_PRHEX, SROM4_5GL_PA + 3, 0xffff}, - {"pa5ghw0a", 0x000000f0, SRFL_PRHEX, SROM4_5GH_PA, 0xffff}, - {"pa5ghw1a", 0x000000f0, SRFL_PRHEX, SROM4_5GH_PA + 1, 0xffff}, - {"pa5ghw2a", 0x000000f0, SRFL_PRHEX, SROM4_5GH_PA + 2, 0xffff}, - {"pa5ghw3a", 0x000000f0, SRFL_PRHEX, SROM4_5GH_PA + 3, 0xffff}, - {"maxp2ga", 0x00000700, 0, SROM8_2G_ITT_MAXP, 0x00ff}, - {"itt2ga", 0x00000700, 0, SROM8_2G_ITT_MAXP, 0xff00}, - {"itt5ga", 0x00000700, 0, SROM8_5G_ITT_MAXP, 0xff00}, - {"pa2gw0a", 0x00000700, SRFL_PRHEX, SROM8_2G_PA, 0xffff}, - {"pa2gw1a", 0x00000700, SRFL_PRHEX, SROM8_2G_PA + 1, 0xffff}, - {"pa2gw2a", 0x00000700, SRFL_PRHEX, SROM8_2G_PA + 2, 0xffff}, - {"maxp5ga", 0x00000700, 0, SROM8_5G_ITT_MAXP, 0x00ff}, - {"maxp5gha", 0x00000700, 0, SROM8_5GLH_MAXP, 0x00ff}, - {"maxp5gla", 0x00000700, 0, SROM8_5GLH_MAXP, 0xff00}, - {"pa5gw0a", 0x00000700, SRFL_PRHEX, SROM8_5G_PA, 0xffff}, - {"pa5gw1a", 0x00000700, SRFL_PRHEX, SROM8_5G_PA + 1, 0xffff}, - {"pa5gw2a", 0x00000700, SRFL_PRHEX, SROM8_5G_PA + 2, 0xffff}, - {"pa5glw0a", 0x00000700, SRFL_PRHEX, SROM8_5GL_PA, 0xffff}, - {"pa5glw1a", 0x00000700, SRFL_PRHEX, SROM8_5GL_PA + 1, 0xffff}, - {"pa5glw2a", 0x00000700, SRFL_PRHEX, SROM8_5GL_PA + 2, 0xffff}, - {"pa5ghw0a", 0x00000700, SRFL_PRHEX, SROM8_5GH_PA, 0xffff}, - {"pa5ghw1a", 0x00000700, SRFL_PRHEX, SROM8_5GH_PA + 1, 0xffff}, - {"pa5ghw2a", 0x00000700, SRFL_PRHEX, SROM8_5GH_PA + 2, 0xffff}, - - /* sromrev 11 */ - {"maxp2ga", 0xfffff800, 0, SROM11_2G_MAXP, 0x00ff}, - {"pa2ga", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_2G_PA, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_2G_PA + 1, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX, SROM11_2G_PA + 2, 0xffff}, - {"rxgains5gmelnagaina", 0xfffff800, 0, SROM11_RXGAINS1, 0x0007}, - {"rxgains5gmtrisoa", 0xfffff800, 0, SROM11_RXGAINS1, 0x0078}, - {"rxgains5gmtrelnabypa", 0xfffff800, 0, SROM11_RXGAINS1, 0x0080}, - {"rxgains5ghelnagaina", 0xfffff800, 0, SROM11_RXGAINS1, 0x0700}, - {"rxgains5ghtrisoa", 0xfffff800, 0, SROM11_RXGAINS1, 0x7800}, - {"rxgains5ghtrelnabypa", 0xfffff800, 0, SROM11_RXGAINS1, 0x8000}, - {"rxgains2gelnagaina", 0xfffff800, 0, SROM11_RXGAINS, 0x0007}, - {"rxgains2gtrisoa", 0xfffff800, 0, SROM11_RXGAINS, 0x0078}, - {"rxgains2gtrelnabypa", 0xfffff800, 0, SROM11_RXGAINS, 0x0080}, - {"rxgains5gelnagaina", 0xfffff800, 0, SROM11_RXGAINS, 0x0700}, - {"rxgains5gtrisoa", 0xfffff800, 0, SROM11_RXGAINS, 0x7800}, - {"rxgains5gtrelnabypa", 0xfffff800, 0, SROM11_RXGAINS, 0x8000}, - {"maxp5ga", 0xfffff800, SRFL_ARRAY, SROM11_5GB1B0_MAXP, 0x00ff}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_5GB1B0_MAXP, 0xff00}, - {"", 0xfffff800, SRFL_ARRAY, SROM11_5GB3B2_MAXP, 0x00ff}, - {"", 0xfffff800, 0, SROM11_5GB3B2_MAXP, 0xff00}, - {"pa5ga", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB0_PA, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB0_PA + 1, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB0_PA + 2, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB1_PA, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB1_PA + 1, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB1_PA + 2, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB2_PA, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB2_PA + 1, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB2_PA + 2, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB3_PA, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX | SRFL_ARRAY, SROM11_5GB3_PA + 1, 0xffff}, - {"", 0xfffff800, SRFL_PRHEX, SROM11_5GB3_PA + 2, 0xffff}, - - {NULL, 0, 0, 0, 0} -}; - -#if !(defined(PHY_TYPE_HT) && defined(PHY_TYPE_N) && defined(PHY_TYPE_LP)) -#define PHY_TYPE_HT 7 /* HT-Phy value */ -#define PHY_TYPE_N 4 /* N-Phy value */ -#define PHY_TYPE_LP 5 /* LP-Phy value */ -#endif /* !(defined(PHY_TYPE_HT) && defined(PHY_TYPE_N) && defined(PHY_TYPE_LP)) */ -#if !defined(PHY_TYPE_AC) -#define PHY_TYPE_AC 11 /* AC-Phy value */ -#endif /* !defined(PHY_TYPE_AC) */ -#if !defined(PHY_TYPE_NULL) -#define PHY_TYPE_NULL 0xf /* Invalid Phy value */ -#endif /* !defined(PHY_TYPE_NULL) */ - -typedef struct { - uint16 phy_type; - uint16 bandrange; - uint16 chain; - const char *vars; -} pavars_t; - -static const pavars_t pavars[] = { - /* HTPHY */ - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_2G, 0, "pa2gw0a0 pa2gw1a0 pa2gw2a0"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_2G, 1, "pa2gw0a1 pa2gw1a1 pa2gw2a1"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_2G, 2, "pa2gw0a2 pa2gw1a2 pa2gw2a2"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND0, 0, "pa5glw0a0 pa5glw1a0 pa5glw2a0"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND0, 1, "pa5glw0a1 pa5glw1a1 pa5glw2a1"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND0, 2, "pa5glw0a2 pa5glw1a2 pa5glw2a2"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND1, 0, "pa5gw0a0 pa5gw1a0 pa5gw2a0"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND1, 1, "pa5gw0a1 pa5gw1a1 pa5gw2a1"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND1, 2, "pa5gw0a2 pa5gw1a2 pa5gw2a2"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND2, 0, "pa5ghw0a0 pa5ghw1a0 pa5ghw2a0"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND2, 1, "pa5ghw0a1 pa5ghw1a1 pa5ghw2a1"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND2, 2, "pa5ghw0a2 pa5ghw1a2 pa5ghw2a2"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND3, 0, "pa5gw0a3 pa5gw1a3 pa5gw2a3"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND3, 1, "pa5glw0a3 pa5glw1a3 pa5glw2a3"}, - {PHY_TYPE_HT, WL_CHAN_FREQ_RANGE_5G_BAND3, 2, "pa5ghw0a3 pa5ghw1a3 pa5ghw2a3"}, - /* NPHY */ - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_2G, 0, "pa2gw0a0 pa2gw1a0 pa2gw2a0"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_2G, 1, "pa2gw0a1 pa2gw1a1 pa2gw2a1"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5G_BAND0, 0, "pa5glw0a0 pa5glw1a0 pa5glw2a0"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5G_BAND0, 1, "pa5glw0a1 pa5glw1a1 pa5glw2a1"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5G_BAND1, 0, "pa5gw0a0 pa5gw1a0 pa5gw2a0"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5G_BAND1, 1, "pa5gw0a1 pa5gw1a1 pa5gw2a1"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5G_BAND2, 0, "pa5ghw0a0 pa5ghw1a0 pa5ghw2a0"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5G_BAND2, 1, "pa5ghw0a1 pa5ghw1a1 pa5ghw2a1"}, - /* LPPHY */ - {PHY_TYPE_LP, WL_CHAN_FREQ_RANGE_2G, 0, "pa0b0 pa0b1 pa0b2"}, - {PHY_TYPE_LP, WL_CHAN_FREQ_RANGE_5GL, 0, "pa1lob0 pa1lob1 pa1lob2"}, - {PHY_TYPE_LP, WL_CHAN_FREQ_RANGE_5GM, 0, "pa1b0 pa1b1 pa1b2"}, - {PHY_TYPE_LP, WL_CHAN_FREQ_RANGE_5GH, 0, "pa1hib0 pa1hib1 pa1hib2"}, - /* ACPHY */ - {PHY_TYPE_AC, WL_CHAN_FREQ_RANGE_2G, 0, "pa2ga0"}, - {PHY_TYPE_AC, WL_CHAN_FREQ_RANGE_2G, 1, "pa2ga1"}, - {PHY_TYPE_AC, WL_CHAN_FREQ_RANGE_2G, 2, "pa2ga2"}, - {PHY_TYPE_AC, WL_CHAN_FREQ_RANGE_5G_4BAND, 0, "pa5ga0"}, - {PHY_TYPE_AC, WL_CHAN_FREQ_RANGE_5G_4BAND, 1, "pa5ga1"}, - {PHY_TYPE_AC, WL_CHAN_FREQ_RANGE_5G_4BAND, 2, "pa5ga2"}, - {PHY_TYPE_NULL, 0, 0, ""} -}; - -typedef struct { - uint16 phy_type; - uint16 bandrange; - const char *vars; -} povars_t; - -static const povars_t povars[] = { - /* NPHY */ - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_2G, "mcs2gpo0 mcs2gpo1 mcs2gpo2 mcs2gpo3 " - "mcs2gpo4 mcs2gpo5 mcs2gpo6 mcs2gpo7"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5GL, "mcs5glpo0 mcs5glpo1 mcs5glpo2 mcs5glpo3 " - "mcs5glpo4 mcs5glpo5 mcs5glpo6 mcs5glpo7"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5GM, "mcs5gpo0 mcs5gpo1 mcs5gpo2 mcs5gpo3 " - "mcs5gpo4 mcs5gpo5 mcs5gpo6 mcs5gpo7"}, - {PHY_TYPE_N, WL_CHAN_FREQ_RANGE_5GH, "mcs5ghpo0 mcs5ghpo1 mcs5ghpo2 mcs5ghpo3 " - "mcs5ghpo4 mcs5ghpo5 mcs5ghpo6 mcs5ghpo7"}, - {PHY_TYPE_NULL, 0, ""} -}; - -typedef struct { - uint8 tag; /* Broadcom subtag name */ - uint32 revmask; /* Supported cis_sromrev */ - uint8 len; /* Length field of the tuple, note that it includes the - * subtag name (1 byte): 1 + tuple content length - */ - const char *params; -} cis_tuple_t; - -#define OTP_RAW (0xff - 1) /* Reserved tuple number for wrvar Raw input */ -#define OTP_VERS_1 (0xff - 2) /* CISTPL_VERS_1 */ -#define OTP_MANFID (0xff - 3) /* CISTPL_MANFID */ -#define OTP_RAW1 (0xff - 4) /* Like RAW, but comes first */ - -static const cis_tuple_t cis_hnbuvars[] = { - {OTP_RAW1, 0xffffffff, 0, ""}, /* special case */ - {OTP_VERS_1, 0xffffffff, 0, "smanf sproductname"}, /* special case (non BRCM tuple) */ - {OTP_MANFID, 0xffffffff, 4, "2manfid 2prodid"}, /* special case (non BRCM tuple) */ - /* Unified OTP: tupple to embed USB manfid inside SDIO CIS */ - {HNBU_UMANFID, 0xffffffff, 8, "8usbmanfid"}, - {HNBU_SROMREV, 0xffffffff, 2, "1sromrev"}, - /* NOTE: subdevid is also written to boardtype. - * Need to write HNBU_BOARDTYPE to change it if it is different. - */ - {HNBU_CHIPID, 0xffffffff, 11, "2vendid 2devid 2chiprev 2subvendid 2subdevid"}, - {HNBU_BOARDREV, 0xffffffff, 3, "2boardrev"}, - {HNBU_PAPARMS, 0xffffffff, 10, "2pa0b0 2pa0b1 2pa0b2 1pa0itssit 1pa0maxpwr 1opo"}, - {HNBU_AA, 0xffffffff, 3, "1aa2g 1aa5g"}, - {HNBU_AA, 0xffffffff, 3, "1aa0 1aa1"}, /* backward compatibility */ - {HNBU_AG, 0xffffffff, 5, "1ag0 1ag1 1ag2 1ag3"}, - {HNBU_BOARDFLAGS, 0xffffffff, 13, "4boardflags 4boardflags2 4boardflags3"}, - {HNBU_LEDS, 0xffffffff, 5, "1ledbh0 1ledbh1 1ledbh2 1ledbh3"}, - {HNBU_CCODE, 0xffffffff, 4, "2ccode 1cctl"}, - {HNBU_CCKPO, 0xffffffff, 3, "2cckpo"}, - {HNBU_OFDMPO, 0xffffffff, 5, "4ofdmpo"}, - {HNBU_PAPARMS5G, 0xffffffff, 23, "2pa1b0 2pa1b1 2pa1b2 2pa1lob0 2pa1lob1 2pa1lob2 " - "2pa1hib0 2pa1hib1 2pa1hib2 1pa1itssit " - "1pa1maxpwr 1pa1lomaxpwr 1pa1himaxpwr"}, - {HNBU_RDLID, 0xffffffff, 3, "2rdlid"}, - {HNBU_RSSISMBXA2G, 0xffffffff, 3, "0rssismf2g 0rssismc2g " - "0rssisav2g 0bxa2g"}, /* special case */ - {HNBU_RSSISMBXA5G, 0xffffffff, 3, "0rssismf5g 0rssismc5g " - "0rssisav5g 0bxa5g"}, /* special case */ - {HNBU_XTALFREQ, 0xffffffff, 5, "4xtalfreq"}, - {HNBU_TRI2G, 0xffffffff, 2, "1tri2g"}, - {HNBU_TRI5G, 0xffffffff, 4, "1tri5gl 1tri5g 1tri5gh"}, - {HNBU_RXPO2G, 0xffffffff, 2, "1rxpo2g"}, - {HNBU_RXPO5G, 0xffffffff, 2, "1rxpo5g"}, - {HNBU_BOARDNUM, 0xffffffff, 3, "2boardnum"}, - {HNBU_MACADDR, 0xffffffff, 7, "6macaddr"}, /* special case */ - {HNBU_RDLSN, 0xffffffff, 3, "2rdlsn"}, - {HNBU_BOARDTYPE, 0xffffffff, 3, "2boardtype"}, - {HNBU_LEDDC, 0xffffffff, 3, "2leddc"}, - {HNBU_RDLRNDIS, 0xffffffff, 2, "1rdlndis"}, - {HNBU_CHAINSWITCH, 0xffffffff, 5, "1txchain 1rxchain 2antswitch"}, - {HNBU_REGREV, 0xffffffff, 2, "1regrev"}, - {HNBU_FEM, 0x000007fe, 5, "0antswctl2g 0triso2g 0pdetrange2g 0extpagain2g " - "0tssipos2g 0antswctl5g 0triso5g 0pdetrange5g 0extpagain5g 0tssipos5g"}, /* special case */ - {HNBU_PAPARMS_C0, 0x000007fe, 31, "1maxp2ga0 1itt2ga0 2pa2gw0a0 2pa2gw1a0 " - "2pa2gw2a0 1maxp5ga0 1itt5ga0 1maxp5gha0 1maxp5gla0 2pa5gw0a0 2pa5gw1a0 2pa5gw2a0 " - "2pa5glw0a0 2pa5glw1a0 2pa5glw2a0 2pa5ghw0a0 2pa5ghw1a0 2pa5ghw2a0"}, - {HNBU_PAPARMS_C1, 0x000007fe, 31, "1maxp2ga1 1itt2ga1 2pa2gw0a1 2pa2gw1a1 " - "2pa2gw2a1 1maxp5ga1 1itt5ga1 1maxp5gha1 1maxp5gla1 2pa5gw0a1 2pa5gw1a1 2pa5gw2a1 " - "2pa5glw0a1 2pa5glw1a1 2pa5glw2a1 2pa5ghw0a1 2pa5ghw1a1 2pa5ghw2a1"}, - {HNBU_PO_CCKOFDM, 0xffffffff, 19, "2cck2gpo 4ofdm2gpo 4ofdm5gpo 4ofdm5glpo " - "4ofdm5ghpo"}, - {HNBU_PO_MCS2G, 0xffffffff, 17, "2mcs2gpo0 2mcs2gpo1 2mcs2gpo2 2mcs2gpo3 " - "2mcs2gpo4 2mcs2gpo5 2mcs2gpo6 2mcs2gpo7"}, - {HNBU_PO_MCS5GM, 0xffffffff, 17, "2mcs5gpo0 2mcs5gpo1 2mcs5gpo2 2mcs5gpo3 " - "2mcs5gpo4 2mcs5gpo5 2mcs5gpo6 2mcs5gpo7"}, - {HNBU_PO_MCS5GLH, 0xffffffff, 33, "2mcs5glpo0 2mcs5glpo1 2mcs5glpo2 2mcs5glpo3 " - "2mcs5glpo4 2mcs5glpo5 2mcs5glpo6 2mcs5glpo7 " - "2mcs5ghpo0 2mcs5ghpo1 2mcs5ghpo2 2mcs5ghpo3 " - "2mcs5ghpo4 2mcs5ghpo5 2mcs5ghpo6 2mcs5ghpo7"}, - {HNBU_CCKFILTTYPE, 0xffffffff, 2, "1cckdigfilttype"}, - {HNBU_PO_CDD, 0xffffffff, 3, "2cddpo"}, - {HNBU_PO_STBC, 0xffffffff, 3, "2stbcpo"}, - {HNBU_PO_40M, 0xffffffff, 3, "2bw40po"}, - {HNBU_PO_40MDUP, 0xffffffff, 3, "2bwduppo"}, - {HNBU_RDLRWU, 0xffffffff, 2, "1rdlrwu"}, - {HNBU_WPS, 0xffffffff, 3, "1wpsgpio 1wpsled"}, - {HNBU_USBFS, 0xffffffff, 2, "1usbfs"}, - {HNBU_ELNA2G, 0xffffffff, 2, "1elna2g"}, - {HNBU_ELNA5G, 0xffffffff, 2, "1elna5g"}, - {HNBU_CUSTOM1, 0xffffffff, 5, "4customvar1"}, - {OTP_RAW, 0xffffffff, 0, ""}, /* special case */ - {HNBU_OFDMPO5G, 0xffffffff, 13, "4ofdm5gpo 4ofdm5glpo 4ofdm5ghpo"}, - {HNBU_USBEPNUM, 0xffffffff, 3, "2usbepnum"}, - {HNBU_CCKBW202GPO, 0xffffffff, 5, "2cckbw202gpo 2cckbw20ul2gpo"}, - {HNBU_LEGOFDMBW202GPO, 0xffffffff, 9, "4legofdmbw202gpo 4legofdmbw20ul2gp"}, - {HNBU_LEGOFDMBW205GPO, 0xffffffff, 25, "4legofdmbw205glpo 4legofdmbw20ul5glpo " - "4legofdmbw205gmpo 4legofdmbw20ul5gmpo 4legofdmbw205ghpo 4legofdmbw20ul5ghpo"}, - {HNBU_MCS2GPO, 0xffffffff, 13, "4mcsbw202gpo 4mcsbw20ul2gpo 4mcsbw402gpo"}, - {HNBU_MCS5GLPO, 0xffffffff, 13, "4mcsbw205glpo 4mcsbw20ul5glpo 4mcsbw405glpo"}, - {HNBU_MCS5GMPO, 0xffffffff, 13, "4mcsbw205gmpo 4mcsbw20ul5gmpo 4mcsbw405gmpo"}, - {HNBU_MCS5GHPO, 0xffffffff, 13, "4mcsbw205ghpo 4mcsbw20ul5ghpo 4mcsbw405ghpo"}, - {HNBU_MCS32PO, 0xffffffff, 3, "2mcs32po"}, - {HNBU_LEG40DUPPO, 0xffffffff, 3, "2legofdm40duppo"}, - {HNBU_TEMPTHRESH, 0xffffffff, 7, "1tempthresh 0temps_period 0temps_hysteresis " - "1tempoffset 1tempsense_slope 0tempcorrx 0tempsense_option " - "1phycal_tempdelta"}, /* special case */ - {HNBU_MUXENAB, 0xffffffff, 2, "1muxenab"}, - {HNBU_FEM_CFG, 0xfffff800, 5, "0femctrl 0papdcap2g 0tworangetssi2g 0pdgain2g " - "0epagain2g 0tssiposslope2g 0gainctrlsph 0papdcap5g 0tworangetssi5g 0pdgain5g 0epagain5g " - "0tssiposslope5g"}, /* special case */ - {HNBU_ACPA_C0, 0xfffff800, 39, "2subband5gver 2maxp2ga0 2*3pa2ga0 " - "1*4maxp5ga0 2*12pa5ga0"}, - {HNBU_ACPA_C1, 0xfffff800, 37, "2maxp2ga1 2*3pa2ga1 1*4maxp5ga1 2*12pa5ga1"}, - {HNBU_ACPA_C2, 0xfffff800, 37, "2maxp2ga2 2*3pa2ga2 1*4maxp5ga2 2*12pa5ga2"}, - {HNBU_MEAS_PWR, 0xfffff800, 5, "1measpower 1measpower1 1measpower2 2rawtempsense"}, - {HNBU_PDOFF, 0xfffff800, 13, "2pdoffset40ma0 2pdoffset40ma1 2pdoffset40ma2 " - "2pdoffset80ma0 2pdoffset80ma1 2pdoffset80ma2"}, - {HNBU_ACPPR_2GPO, 0xfffff800, 5, "2dot11agofdmhrbw202gpo 2ofdmlrbw202gpo"}, - {HNBU_ACPPR_5GPO, 0xfffff800, 31, "4mcsbw805glpo 4mcsbw1605glpo 4mcsbw805gmpo " - "4mcsbw1605gmpo 4mcsbw805ghpo 4mcsbw1605ghpo 2mcslr5rlpo 2mcslr5gmpo 2mcslr5ghpo"}, - {HNBU_ACPPR_SBPO, 0xfffff800, 33, "2sb20in40hrrpo 2sb20in80and160hr5glpo " - "2sb40and80hr5glpo 2sb20in80and160hr5gmpo 2sb40and80hr5gmpo 2sb20in80and160hr5ghpo " - "2sb40and80hr5ghpo 2sb20in40lrpo 2sb20in80and160lr5glpo 2sb40and80lr5glpo " - "2sb20in80and160lr5gmpo 2sb40and80lr5gmpo 2sb20in80and160lr5ghpo 2sb40and80lr5ghpo " - "2dot11agduphrpo 2dot11agduplrpo"}, - {HNBU_NOISELVL, 0xfffff800, 16, "1noiselvl2ga0 1noiselvl2ga1 1noiselvl2ga2 " - "1*4noiselvl5ga0 1*4noiselvl5ga1 1*4noiselvl5ga2"}, - {HNBU_RXGAIN_ERR, 0xfffff800, 16, "1rxgainerr2ga0 1rxgainerr2ga1 1rxgainerr2ga2 " - "1*4rxgainerr5ga0 1*4rxgainerr5ga1 1*4rxgainerr5ga2"}, - {HNBU_AGBGA, 0xfffff800, 7, "1agbg0 1agbg1 1agbg2 1aga0 1aga1 1aga2"}, - {HNBU_UUID, 0xffffffff, 17, "16uuid"}, - {HNBU_WOWLGPIO, 0xffffffff, 2, "1wowl_gpio"}, - {HNBU_ACRXGAINS_C0, 0xfffff800, 5, "0rxgains5gtrelnabypa0 0rxgains5gtrisoa0 " - "0rxgains5gelnagaina0 0rxgains2gtrelnabypa0 0rxgains2gtrisoa0 0rxgains2gelnagaina0 " - "0rxgains5ghtrelnabypa0 0rxgains5ghtrisoa0 0rxgains5ghelnagaina0 0rxgains5gmtrelnabypa0 " - "0rxgains5gmtrisoa0 0rxgains5gmelnagaina0"}, /* special case */ - {HNBU_ACRXGAINS_C1, 0xfffff800, 5, "0rxgains5gtrelnabypa1 0rxgains5gtrisoa1 " - "0rxgains5gelnagaina1 0rxgains2gtrelnabypa1 0rxgains2gtrisoa1 0rxgains2gelnagaina1 " - "0rxgains5ghtrelnabypa1 0rxgains5ghtrisoa1 0rxgains5ghelnagaina1 0rxgains5gmtrelnabypa1 " - "0rxgains5gmtrisoa1 0rxgains5gmelnagaina1"}, /* special case */ - {HNBU_ACRXGAINS_C2, 0xfffff800, 5, "0rxgains5gtrelnabypa2 0rxgains5gtrisoa2 " - "0rxgains5gelnagaina2 0rxgains2gtrelnabypa2 0rxgains2gtrisoa2 0rxgains2gelnagaina2 " - "0rxgains5ghtrelnabypa2 0rxgains5ghtrisoa2 0rxgains5ghelnagaina2 0rxgains5gmtrelnabypa2 " - "0rxgains5gmtrisoa2 0rxgains5gmelnagaina2"}, /* special case */ - {0xFF, 0xffffffff, 0, ""} -}; - -#endif /* _bcmsrom_tbl_h_ */ diff --git a/drivers/net/wireless/bcmdhd/bcmwifi_channels.h b/drivers/net/wireless/bcmdhd/include/bcmwifi_channels.h index c797047..c797047 100644 --- a/drivers/net/wireless/bcmdhd/bcmwifi_channels.h +++ b/drivers/net/wireless/bcmdhd/include/bcmwifi_channels.h diff --git a/drivers/net/wireless/bcmdhd/bcmwifi_rates.h b/drivers/net/wireless/bcmdhd/include/bcmwifi_rates.h index 9896b23..9896b23 100644 --- a/drivers/net/wireless/bcmdhd/bcmwifi_rates.h +++ b/drivers/net/wireless/bcmdhd/include/bcmwifi_rates.h diff --git a/drivers/net/wireless/bcmdhd/include/dbus.h b/drivers/net/wireless/bcmdhd/include/dbus.h deleted file mode 100644 index c5ea223..0000000 --- a/drivers/net/wireless/bcmdhd/include/dbus.h +++ /dev/null @@ -1,571 +0,0 @@ -/* - * Dongle BUS interface Abstraction layer - * target serial buses like USB, SDIO, SPI, etc. - * - * 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: dbus.h 323680 2012-03-26 17:52:31Z $ - */ - -#ifndef __DBUS_H__ -#define __DBUS_H__ - -#include "typedefs.h" - -#define DBUSTRACE(args) -#define DBUSERR(args) -#define DBUSINFO(args) -#define DBUSTRACE(args) -#define DBUSDBGLOCK(args) - -enum { - DBUS_OK = 0, - DBUS_ERR = -200, - DBUS_ERR_TIMEOUT, - DBUS_ERR_DISCONNECT, - DBUS_ERR_NODEVICE, - DBUS_ERR_UNSUPPORTED, - DBUS_ERR_PENDING, - DBUS_ERR_NOMEM, - DBUS_ERR_TXFAIL, - DBUS_ERR_TXTIMEOUT, - DBUS_ERR_TXDROP, - DBUS_ERR_RXFAIL, - DBUS_ERR_RXDROP, - DBUS_ERR_TXCTLFAIL, - DBUS_ERR_RXCTLFAIL, - DBUS_ERR_REG_PARAM, - DBUS_STATUS_CANCELLED, - DBUS_ERR_NVRAM, - DBUS_JUMBO_NOMATCH, - DBUS_JUMBO_BAD_FORMAT, - DBUS_NVRAM_NONTXT -}; - -#define BCM_OTP_SIZE_43236 84 /* number of 16 bit values */ -#define BCM_OTP_SW_RGN_43236 24 /* start offset of SW config region */ -#define BCM_OTP_ADDR_43236 0x18000800 /* address of otp base */ - -#define ERR_CBMASK_TXFAIL 0x00000001 -#define ERR_CBMASK_RXFAIL 0x00000002 -#define ERR_CBMASK_ALL 0xFFFFFFFF - -#define DBUS_CBCTL_WRITE 0 -#define DBUS_CBCTL_READ 1 -#if defined(INTR_EP_ENABLE) -#define DBUS_CBINTR_POLL 2 -#endif /* defined(INTR_EP_ENABLE) */ - -#define DBUS_TX_RETRY_LIMIT 3 /* retries for failed txirb */ -#define DBUS_TX_TIMEOUT_INTERVAL 250 /* timeout for txirb complete, in ms */ - -#define DBUS_BUFFER_SIZE_TX 16000 -#define DBUS_BUFFER_SIZE_RX 5000 - -#define DBUS_BUFFER_SIZE_TX_NOAGG 2048 -#define DBUS_BUFFER_SIZE_RX_NOAGG 2048 - -/* DBUS types */ -enum { - DBUS_USB, - DBUS_SDIO, - DBUS_SPI, - DBUS_UNKNOWN -}; - -enum dbus_state { - DBUS_STATE_DL_PENDING, - DBUS_STATE_DL_DONE, - DBUS_STATE_UP, - DBUS_STATE_DOWN, - DBUS_STATE_PNP_FWDL, - DBUS_STATE_DISCONNECT, - DBUS_STATE_SLEEP -}; - -enum dbus_pnp_state { - DBUS_PNP_DISCONNECT, - DBUS_PNP_SLEEP, - DBUS_PNP_RESUME -}; - -enum dbus_file { - DBUS_FIRMWARE, - DBUS_NVFILE -}; - -typedef enum _DEVICE_SPEED { - INVALID_SPEED = -1, - LOW_SPEED = 1, /* USB 1.1: 1.5 Mbps */ - FULL_SPEED, /* USB 1.1: 12 Mbps */ - HIGH_SPEED, /* USB 2.0: 480 Mbps */ - SUPER_SPEED, /* USB 3.0: 4.8 Gbps */ -} DEVICE_SPEED; - -typedef struct { - int bustype; - int vid; - int pid; - int devid; - int chiprev; /* chip revsion number */ - int mtu; - int nchan; /* Data Channels */ - int has_2nd_bulk_in_ep; -} dbus_attrib_t; - -/* FIX: Account for errors related to DBUS; - * Let upper layer account for packets/bytes - */ -typedef struct { - uint32 rx_errors; - uint32 tx_errors; - uint32 rx_dropped; - uint32 tx_dropped; -} dbus_stats_t; - -/* - * Configurable BUS parameters - */ -typedef struct { - bool rxctl_deferrespok; -} dbus_config_t; - -/* - * External Download Info - */ -typedef struct dbus_extdl { - uint8 *fw; - int fwlen; - uint8 *vars; - int varslen; -} dbus_extdl_t; - -struct dbus_callbacks; -struct exec_parms; - -typedef void *(*probe_cb_t)(void *arg, const char *desc, uint32 bustype, uint32 hdrlen); -typedef void (*disconnect_cb_t)(void *arg); -typedef void *(*exec_cb_t)(struct exec_parms *args); - -/* Client callbacks registered during dbus_attach() */ -typedef struct dbus_callbacks { - void (*send_complete)(void *cbarg, void *info, int status); - void (*recv_buf)(void *cbarg, uint8 *buf, int len); - void (*recv_pkt)(void *cbarg, void *pkt); - void (*txflowcontrol)(void *cbarg, bool onoff); - void (*errhandler)(void *cbarg, int err); - void (*ctl_complete)(void *cbarg, int type, int status); - void (*state_change)(void *cbarg, int state); - void *(*pktget)(void *cbarg, uint len, bool send); - void (*pktfree)(void *cbarg, void *p, bool send); -} dbus_callbacks_t; - -struct dbus_pub; -struct bcmstrbuf; -struct dbus_irb; -struct dbus_irb_rx; -struct dbus_irb_tx; -struct dbus_intf_callbacks; - -typedef struct { - void* (*attach)(struct dbus_pub *pub, void *cbarg, struct dbus_intf_callbacks *cbs); - void (*detach)(struct dbus_pub *pub, void *bus); - - int (*up)(void *bus); - int (*down)(void *bus); - int (*send_irb)(void *bus, struct dbus_irb_tx *txirb); - int (*recv_irb)(void *bus, struct dbus_irb_rx *rxirb); - int (*cancel_irb)(void *bus, struct dbus_irb_tx *txirb); - int (*send_ctl)(void *bus, uint8 *buf, int len); - int (*recv_ctl)(void *bus, uint8 *buf, int len); - int (*get_stats)(void *bus, dbus_stats_t *stats); - int (*get_attrib)(void *bus, dbus_attrib_t *attrib); - - int (*pnp)(void *bus, int evnt); - int (*remove)(void *bus); - int (*resume)(void *bus); - int (*suspend)(void *bus); - int (*stop)(void *bus); - int (*reset)(void *bus); - - /* Access to bus buffers directly */ - void *(*pktget)(void *bus, int len); - void (*pktfree)(void *bus, void *pkt); - - int (*iovar_op)(void *bus, const char *name, void *params, int plen, void *arg, int len, - bool set); - void (*dump)(void *bus, struct bcmstrbuf *strbuf); - int (*set_config)(void *bus, dbus_config_t *config); - int (*get_config)(void *bus, dbus_config_t *config); - - bool (*device_exists)(void *bus); - bool (*dlneeded)(void *bus); - int (*dlstart)(void *bus, uint8 *fw, int len); - int (*dlrun)(void *bus); - bool (*recv_needed)(void *bus); - - void *(*exec_rxlock)(void *bus, exec_cb_t func, struct exec_parms *args); - void *(*exec_txlock)(void *bus, exec_cb_t func, struct exec_parms *args); - - int (*tx_timer_init)(void *bus); - int (*tx_timer_start)(void *bus, uint timeout); - int (*tx_timer_stop)(void *bus); - - int (*sched_dpc)(void *bus); - int (*lock)(void *bus); - int (*unlock)(void *bus); - int (*sched_probe_cb)(void *bus); - - int (*shutdown)(void *bus); - - int (*recv_stop)(void *bus); - int (*recv_resume)(void *bus); - - int (*recv_irb_from_ep)(void *bus, struct dbus_irb_rx *rxirb, uint ep_idx); - - int (*readreg)(void *bus, uint32 regaddr, int datalen, uint32 *value); - - /* Add from the bottom */ -} dbus_intf_t; - -typedef struct dbus_pub { - struct osl_info *osh; - dbus_stats_t stats; - dbus_attrib_t attrib; - enum dbus_state busstate; - DEVICE_SPEED device_speed; - int ntxq, nrxq, rxsize; - void *bus; - struct shared_info *sh; - void *dev_info; -} dbus_pub_t; - -#define BUS_INFO(bus, type) (((type *) bus)->pub->bus) - -#define ALIGNED_LOCAL_VARIABLE(var, align) \ - uint8 buffer[SDALIGN+64]; \ - uint8 *var = (uint8 *)(((uintptr)&buffer[0]) & ~(align-1)) + align; - -/* - * Public Bus Function Interface - */ - -/* - * FIX: Is there better way to pass OS/Host handles to DBUS but still - * maintain common interface for all OS?? - * Under NDIS, param1 needs to be MiniportHandle - * For NDIS60, param2 is WdfDevice - * Under Linux, param1 and param2 are NULL; - */ -extern int dbus_register(int vid, int pid, probe_cb_t prcb, disconnect_cb_t discb, void *prarg, - void *param1, void *param2); -extern int dbus_deregister(void); - -extern dbus_pub_t *dbus_attach(struct osl_info *osh, int rxsize, int nrxq, int ntxq, - void *cbarg, dbus_callbacks_t *cbs, dbus_extdl_t *extdl, struct shared_info *sh); -extern void dbus_detach(dbus_pub_t *pub); - -extern int dbus_up(dbus_pub_t *pub); -extern int dbus_down(dbus_pub_t *pub); -extern int dbus_stop(dbus_pub_t *pub); -extern int dbus_shutdown(dbus_pub_t *pub); -extern void dbus_flowctrl_rx(dbus_pub_t *pub, bool on); - -extern int dbus_send_txdata(dbus_pub_t *dbus, void *pktbuf); -extern int dbus_send_buf(dbus_pub_t *pub, uint8 *buf, int len, void *info); -extern int dbus_send_pkt(dbus_pub_t *pub, void *pkt, void *info); -extern int dbus_send_ctl(dbus_pub_t *pub, uint8 *buf, int len); -extern int dbus_recv_ctl(dbus_pub_t *pub, uint8 *buf, int len); -extern int dbus_recv_bulk(dbus_pub_t *pub, uint32 ep_idx); -extern int dbus_poll_intr(dbus_pub_t *pub); - -extern int dbus_get_stats(dbus_pub_t *pub, dbus_stats_t *stats); -extern int dbus_get_attrib(dbus_pub_t *pub, dbus_attrib_t *attrib); -extern int dbus_get_device_speed(dbus_pub_t *pub); -extern int dbus_set_config(dbus_pub_t *pub, dbus_config_t *config); -extern int dbus_get_config(dbus_pub_t *pub, dbus_config_t *config); -extern void * dbus_get_devinfo(dbus_pub_t *pub); - -extern void *dbus_pktget(dbus_pub_t *pub, int len); -extern void dbus_pktfree(dbus_pub_t *pub, void* pkt); - -extern int dbus_set_errmask(dbus_pub_t *pub, uint32 mask); -extern int dbus_pnp_sleep(dbus_pub_t *pub); -extern int dbus_pnp_resume(dbus_pub_t *pub, int *fw_reload); -extern int dbus_pnp_disconnect(dbus_pub_t *pub); - -extern int dbus_iovar_op(dbus_pub_t *pub, const char *name, - void *params, int plen, void *arg, int len, bool set); - -extern void *dhd_dbus_txq(const dbus_pub_t *pub); -extern uint dhd_dbus_hdrlen(const dbus_pub_t *pub); - -/* - * Private Common Bus Interface - */ - -/* IO Request Block (IRB) */ -typedef struct dbus_irb { - struct dbus_irb *next; /* it's casted from dbus_irb_tx or dbus_irb_rx struct */ -} dbus_irb_t; - -typedef struct dbus_irb_rx { - struct dbus_irb irb; /* Must be first */ - uint8 *buf; - int buf_len; - int actual_len; - void *pkt; - void *info; - void *arg; -} dbus_irb_rx_t; - -typedef struct dbus_irb_tx { - struct dbus_irb irb; /* Must be first */ - uint8 *buf; - int len; - void *pkt; - int retry_count; - void *info; - void *arg; - void *send_buf; /* linear bufffer for LINUX when aggreagtion is enabled */ -} dbus_irb_tx_t; - -/* DBUS interface callbacks are different from user callbacks - * so, internally, different info can be passed to upper layer - */ -typedef struct dbus_intf_callbacks { - void (*send_irb_timeout)(void *cbarg, dbus_irb_tx_t *txirb); - void (*send_irb_complete)(void *cbarg, dbus_irb_tx_t *txirb, int status); - void (*recv_irb_complete)(void *cbarg, dbus_irb_rx_t *rxirb, int status); - void (*errhandler)(void *cbarg, int err); - void (*ctl_complete)(void *cbarg, int type, int status); - void (*state_change)(void *cbarg, int state); - bool (*isr)(void *cbarg, bool *wantdpc); - bool (*dpc)(void *cbarg, bool bounded); - void (*watchdog)(void *cbarg); - void *(*pktget)(void *cbarg, uint len, bool send); - void (*pktfree)(void *cbarg, void *p, bool send); - struct dbus_irb* (*getirb)(void *cbarg, bool send); - void (*rxerr_indicate)(void *cbarg, bool on); -} dbus_intf_callbacks_t; - -/* - * Porting: To support new bus, port these functions below - */ - -/* - * Bus specific Interface - * Implemented by dbus_usb.c/dbus_sdio.c - */ -extern int dbus_bus_register(int vid, int pid, probe_cb_t prcb, disconnect_cb_t discb, void *prarg, - dbus_intf_t **intf, void *param1, void *param2); -extern int dbus_bus_deregister(void); -extern void dbus_bus_fw_get(void *bus, uint8 **fw, int *fwlen, int *decomp); - -/* - * Bus-specific and OS-specific Interface - * Implemented by dbus_usb_[linux/ndis].c/dbus_sdio_[linux/ndis].c - */ -extern int dbus_bus_osl_register(int vid, int pid, probe_cb_t prcb, disconnect_cb_t discb, - void *prarg, dbus_intf_t **intf, void *param1, void *param2); -extern int dbus_bus_osl_deregister(void); - -/* - * Bus-specific, OS-specific, HW-specific Interface - * Mainly for SDIO Host HW controller - */ -extern int dbus_bus_osl_hw_register(int vid, int pid, probe_cb_t prcb, disconnect_cb_t discb, - void *prarg, dbus_intf_t **intf); -extern int dbus_bus_osl_hw_deregister(void); - -extern uint usbdev_bulkin_eps(void); -#if defined(BCM_REQUEST_FW) -extern void *dbus_get_fw_nvfile(int devid, uint8 **fw, int *fwlen, int type, - uint16 boardtype, uint16 boardrev); -extern void dbus_release_fw_nvfile(void *firmware); -#endif /* #if defined(BCM_REQUEST_FW) */ - - -#if defined(EHCI_FASTPATH_TX) || defined(EHCI_FASTPATH_RX) - - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)) - /* Backward compatibility */ - typedef unsigned int gfp_t; - - #define dma_pool pci_pool - #define dma_pool_create(name, dev, size, align, alloc) \ - pci_pool_create(name, dev, size, align, alloc, GFP_DMA | GFP_ATOMIC) - #define dma_pool_destroy(pool) pci_pool_destroy(pool) - #define dma_pool_alloc(pool, flags, handle) pci_pool_alloc(pool, flags, handle) - #define dma_pool_free(pool, vaddr, addr) pci_pool_free(pool, vaddr, addr) - - #define dma_map_single(dev, addr, size, dir) pci_map_single(dev, addr, size, dir) - #define dma_unmap_single(dev, hnd, size, dir) pci_unmap_single(dev, hnd, size, dir) - #define DMA_FROM_DEVICE PCI_DMA_FROMDEVICE - #define DMA_TO_DEVICE PCI_DMA_TODEVICE -#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)) */ - -/* Availability of these functions varies (when present, they have two arguments) */ -#ifndef hc32_to_cpu - #define hc32_to_cpu(x) le32_to_cpu(x) - #define cpu_to_hc32(x) cpu_to_le32(x) - typedef unsigned int __hc32; -#else - #error Two-argument functions needed -#endif - -/* Private USB opcode base */ -#define EHCI_FASTPATH 0x31 -#define EHCI_SET_EP_BYPASS EHCI_FASTPATH -#define EHCI_SET_BYPASS_CB (EHCI_FASTPATH + 1) -#define EHCI_SET_BYPASS_DEV (EHCI_FASTPATH + 2) -#define EHCI_DUMP_STATE (EHCI_FASTPATH + 3) -#define EHCI_SET_BYPASS_POOL (EHCI_FASTPATH + 4) -#define EHCI_CLR_EP_BYPASS (EHCI_FASTPATH + 5) - -/* - * EHCI QTD structure (hardware and extension) - * NOTE that is does not need to (and does not) match its kernel counterpart - */ -#define EHCI_QTD_NBUFFERS 5 -#define EHCI_QTD_ALIGN 32 -#define EHCI_BULK_PACKET_SIZE 512 -#define EHCI_QTD_XACTERR_MAX 32 - -struct ehci_qtd { - /* Hardware map */ - volatile uint32_t qtd_next; - volatile uint32_t qtd_altnext; - volatile uint32_t qtd_status; -#define EHCI_QTD_GET_BYTES(x) (((x)>>16) & 0x7fff) -#define EHCI_QTD_IOC 0x00008000 -#define EHCI_QTD_GET_CERR(x) (((x)>>10) & 0x3) -#define EHCI_QTD_SET_CERR(x) ((x) << 10) -#define EHCI_QTD_GET_PID(x) (((x)>>8) & 0x3) -#define EHCI_QTD_SET_PID(x) ((x) << 8) -#define EHCI_QTD_ACTIVE 0x80 -#define EHCI_QTD_HALTED 0x40 -#define EHCI_QTD_BUFERR 0x20 -#define EHCI_QTD_BABBLE 0x10 -#define EHCI_QTD_XACTERR 0x08 -#define EHCI_QTD_MISSEDMICRO 0x04 - volatile uint32_t qtd_buffer[EHCI_QTD_NBUFFERS]; - volatile uint32_t qtd_buffer_hi[EHCI_QTD_NBUFFERS]; - - /* Implementation extension */ - dma_addr_t qtd_self; /* own hardware address */ - struct ehci_qtd *obj_next; /* software link to the next QTD */ - void *rpc; /* pointer to the rpc buffer */ - size_t length; /* length of the data in the buffer */ - void *buff; /* pointer to the reassembly buffer */ - int xacterrs; /* retry counter for qtd xact error */ -} __attribute__ ((aligned(EHCI_QTD_ALIGN))); - -#define EHCI_NULL __constant_cpu_to_le32(1) /* HW null pointer shall be odd */ - -#define SHORT_READ_Q(token) (EHCI_QTD_GET_BYTES(token) != 0 && EHCI_QTD_GET_PID(token) == 1) - -/* Queue Head */ -/* NOTE This structure is slightly different from the one in the kernel; but needs to stay - * compatible - */ -struct ehci_qh { - /* Hardware map */ - volatile uint32_t qh_link; - volatile uint32_t qh_endp; - volatile uint32_t qh_endphub; - volatile uint32_t qh_curqtd; - - /* QTD overlay */ - volatile uint32_t ow_next; - volatile uint32_t ow_altnext; - volatile uint32_t ow_status; - volatile uint32_t ow_buffer [EHCI_QTD_NBUFFERS]; - volatile uint32_t ow_buffer_hi [EHCI_QTD_NBUFFERS]; - - /* Extension (should match the kernel layout) */ - dma_addr_t unused0; - void *unused1; - struct list_head unused2; - struct ehci_qtd *dummy; - struct ehci_qh *unused3; - - struct ehci_hcd *unused4; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)) - struct kref unused5; - unsigned unused6; - - uint8_t unused7; - - /* periodic schedule info */ - uint8_t unused8; - uint8_t unused9; - uint8_t unused10; - uint16_t unused11; - uint16_t unused12; - uint16_t unused13; - struct usb_device *unused14; -#else - unsigned unused5; - - u8 unused6; - - /* periodic schedule info */ - u8 unused7; - u8 unused8; - u8 unused9; - unsigned short unused10; - unsigned short unused11; -#define NO_FRAME ((unsigned short)~0) -#ifdef EHCI_QUIRK_FIX - struct usb_device *unused12; -#endif /* EHCI_QUIRK_FIX */ -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)) */ - struct ehci_qtd *first_qtd; - /* Link to the first QTD; this is an optimized equivalent of the qtd_list field */ - /* NOTE that ehci_qh in ehci.h shall reserve this word */ -} __attribute__ ((aligned(EHCI_QTD_ALIGN))); - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)) -/* The corresponding structure in the kernel is used to get the QH */ -struct hcd_dev { /* usb_device.hcpriv points to this */ - struct list_head unused0; - struct list_head unused1; - - /* array of QH pointers */ - void *ep[32]; -}; -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)) */ - -int optimize_qtd_fill_with_rpc(const dbus_pub_t *pub, int epn, struct ehci_qtd *qtd, void *rpc, - int token, int len); -int optimize_qtd_fill_with_data(const dbus_pub_t *pub, int epn, struct ehci_qtd *qtd, void *data, - int token, int len); -int optimize_submit_async(struct ehci_qtd *qtd, int epn); -void inline optimize_ehci_qtd_init(struct ehci_qtd *qtd, dma_addr_t dma); -struct ehci_qtd *optimize_ehci_qtd_alloc(gfp_t flags); -void optimize_ehci_qtd_free(struct ehci_qtd *qtd); -void optimize_submit_rx_request(const dbus_pub_t *pub, int epn, struct ehci_qtd *qtd_in, void *buf); -#endif /* EHCI_FASTPATH_TX || EHCI_FASTPATH_RX */ - -void dbus_flowctrl_tx(void *dbi, bool on); -#endif /* __DBUS_H__ */ diff --git a/drivers/net/wireless/bcmdhd/include/dhdioctl.h b/drivers/net/wireless/bcmdhd/include/dhdioctl.h index 03c44ad..2c8358f 100644 --- a/drivers/net/wireless/bcmdhd/include/dhdioctl.h +++ b/drivers/net/wireless/bcmdhd/include/dhdioctl.h @@ -25,7 +25,7 @@ * 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: dhdioctl.h 327460 2012-04-13 18:38:41Z $ + * $Id: dhdioctl.h 350488 2012-08-14 04:36:26Z $ */ #ifndef _dhdioctl_h_ @@ -93,6 +93,7 @@ enum { #define DHD_ARPOE_VAL 0x4000 #define DHD_REORDER_VAL 0x8000 #define DHD_WL_VAL 0x10000 +#define DHD_TRACE2_VAL 0x20000 #ifdef SDTEST /* For pktgen iovar */ diff --git a/drivers/net/wireless/bcmdhd/include/epivers.h b/drivers/net/wireless/bcmdhd/include/epivers.h index f73fab9..c3471cb 100644 --- a/drivers/net/wireless/bcmdhd/include/epivers.h +++ b/drivers/net/wireless/bcmdhd/include/epivers.h @@ -30,19 +30,27 @@ #define EPI_MINOR_VERSION 28 -#define EPI_RC_NUMBER 8 +#define EPI_RC_NUMBER 9 -#define EPI_INCREMENTAL_NUMBER 0 +#define EPI_INCREMENTAL_NUMBER 2 #define EPI_BUILD_NUMBER 0 -#define EPI_VERSION 1, 28, 8, 0 +#define EPI_VERSION 1, 28, 9, 2 -#define EPI_VERSION_NUM 0x011c0800 +#define EPI_VERSION_NUM 0x011c0902 -#define EPI_VERSION_DEV 1.28.8 +#define EPI_VERSION_DEV 1.28.9 - -#define EPI_VERSION_STR "1.28.8 (r347653)" +/* Driver Version String, ASCII, 32 chars max */ +#ifdef BCMINTERNAL +#define EPI_VERSION_STR "1.28.9.2 (r BCMINT)" +#else +#ifdef WLTEST +#define EPI_VERSION_STR "1.28.9.2 (r WLTEST)" +#else +#define EPI_VERSION_STR "1.28.9.2 (r)" +#endif +#endif /* BCMINTERNAL */ #endif diff --git a/drivers/net/wireless/bcmdhd/include/proto/bcmipv6.h b/drivers/net/wireless/bcmdhd/include/proto/bcmipv6.h deleted file mode 100644 index 9533391..0000000 --- a/drivers/net/wireless/bcmdhd/include/proto/bcmipv6.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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. - * - * Fundamental constants relating to Neighbor Discovery Protocol - * - * $Id: bcmipv6.h 309193 2012-01-19 00:03:57Z $ - */ - -#ifndef _bcmipv6_h_ -#define _bcmipv6_h_ - -#ifndef _TYPEDEFS_H_ -#include <typedefs.h> -#endif - -/* This marks the start of a packed structure section. */ -#include <packed_section_start.h> - -#define ICMPV6_HEADER_TYPE 0x3A -#define ICMPV6_PKT_TYPE_NS 135 -#define ICMPV6_PKT_TYPE_NA 136 - -#define ICMPV6_ND_OPT_TYPE_TARGET_MAC 2 -#define ICMPV6_ND_OPT_TYPE_SRC_MAC 1 - -#define IPV6_VERSION 6 -#define IPV6_HOP_LIMIT 255 - -#define IPV6_ADDR_NULL(a) ((a[0] | a[1] | a[2] | a[3] | a[4] | \ - a[5] | a[6] | a[7] | a[8] | a[9] | \ - a[10] | a[11] | a[12] | a[13] | \ - a[14] | a[15]) == 0) - -/* IPV6 address */ -BWL_PRE_PACKED_STRUCT struct ipv6_addr { - uint8 addr[16]; -} BWL_POST_PACKED_STRUCT; - - -/* ICMPV6 Header */ -BWL_PRE_PACKED_STRUCT struct icmp6_hdr { - uint8 icmp6_type; - uint8 icmp6_code; - uint16 icmp6_cksum; - BWL_PRE_PACKED_STRUCT union { - uint32 reserved; - BWL_PRE_PACKED_STRUCT struct nd_advt { - uint32 reserved1:5, - override:1, - solicited:1, - router:1, - reserved2:24; - } BWL_POST_PACKED_STRUCT nd_advt; - } BWL_POST_PACKED_STRUCT opt; -} BWL_POST_PACKED_STRUCT; - -/* Ipv6 Header Format */ -BWL_PRE_PACKED_STRUCT struct ipv6_hdr { - uint8 priority:4, - version:4; - uint8 flow_lbl[3]; - uint16 payload_len; - uint8 nexthdr; - uint8 hop_limit; - struct ipv6_addr saddr; - struct ipv6_addr daddr; -} BWL_POST_PACKED_STRUCT; - -/* Neighbor Advertisement/Solicitation Packet Structure */ -BWL_PRE_PACKED_STRUCT struct nd_msg { - struct icmp6_hdr icmph; - struct ipv6_addr target; -} BWL_POST_PACKED_STRUCT; - - -/* Neighibor Solicitation/Advertisement Optional Structure */ -BWL_PRE_PACKED_STRUCT struct nd_msg_opt { - uint8 type; - uint8 len; - uint8 mac_addr[ETHER_ADDR_LEN]; -} BWL_POST_PACKED_STRUCT; - -/* This marks the end of a packed structure section. */ -#include <packed_section_end.h> - -#endif /* !defined(_bcmipv6_h_) */ diff --git a/drivers/net/wireless/bcmdhd/include/proto/wps.h b/drivers/net/wireless/bcmdhd/include/proto/wps.h deleted file mode 100644 index cccbfff..0000000 --- a/drivers/net/wireless/bcmdhd/include/proto/wps.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * WPS IE definitions - * - * 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$ - */ - -#ifndef _WPS_ -#define _WPS_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Data Element Definitions */ -#define WPS_ID_AP_CHANNEL 0x1001 -#define WPS_ID_ASSOC_STATE 0x1002 -#define WPS_ID_AUTH_TYPE 0x1003 -#define WPS_ID_AUTH_TYPE_FLAGS 0x1004 -#define WPS_ID_AUTHENTICATOR 0x1005 -#define WPS_ID_CONFIG_METHODS 0x1008 -#define WPS_ID_CONFIG_ERROR 0x1009 -#define WPS_ID_CONF_URL4 0x100A -#define WPS_ID_CONF_URL6 0x100B -#define WPS_ID_CONN_TYPE 0x100C -#define WPS_ID_CONN_TYPE_FLAGS 0x100D -#define WPS_ID_CREDENTIAL 0x100E -#define WPS_ID_DEVICE_NAME 0x1011 -#define WPS_ID_DEVICE_PWD_ID 0x1012 -#define WPS_ID_E_HASH1 0x1014 -#define WPS_ID_E_HASH2 0x1015 -#define WPS_ID_E_SNONCE1 0x1016 -#define WPS_ID_E_SNONCE2 0x1017 -#define WPS_ID_ENCR_SETTINGS 0x1018 -#define WPS_ID_ENCR_TYPE 0x100F -#define WPS_ID_ENCR_TYPE_FLAGS 0x1010 -#define WPS_ID_ENROLLEE_NONCE 0x101A -#define WPS_ID_FEATURE_ID 0x101B -#define WPS_ID_IDENTITY 0x101C -#define WPS_ID_IDENTITY_PROOF 0x101D -#define WPS_ID_KEY_WRAP_AUTH 0x101E -#define WPS_ID_KEY_IDENTIFIER 0x101F -#define WPS_ID_MAC_ADDR 0x1020 -#define WPS_ID_MANUFACTURER 0x1021 -#define WPS_ID_MSG_TYPE 0x1022 -#define WPS_ID_MODEL_NAME 0x1023 -#define WPS_ID_MODEL_NUMBER 0x1024 -#define WPS_ID_NW_INDEX 0x1026 -#define WPS_ID_NW_KEY 0x1027 -#define WPS_ID_NW_KEY_INDEX 0x1028 -#define WPS_ID_NEW_DEVICE_NAME 0x1029 -#define WPS_ID_NEW_PWD 0x102A -#define WPS_ID_OOB_DEV_PWD 0x102C -#define WPS_ID_OS_VERSION 0x102D -#define WPS_ID_POWER_LEVEL 0x102F -#define WPS_ID_PSK_CURRENT 0x1030 -#define WPS_ID_PSK_MAX 0x1031 -#define WPS_ID_PUBLIC_KEY 0x1032 -#define WPS_ID_RADIO_ENABLED 0x1033 -#define WPS_ID_REBOOT 0x1034 -#define WPS_ID_REGISTRAR_CURRENT 0x1035 -#define WPS_ID_REGISTRAR_ESTBLSHD 0x1036 -#define WPS_ID_REGISTRAR_LIST 0x1037 -#define WPS_ID_REGISTRAR_MAX 0x1038 -#define WPS_ID_REGISTRAR_NONCE 0x1039 -#define WPS_ID_REQ_TYPE 0x103A -#define WPS_ID_RESP_TYPE 0x103B -#define WPS_ID_RF_BAND 0x103C -#define WPS_ID_R_HASH1 0x103D -#define WPS_ID_R_HASH2 0x103E -#define WPS_ID_R_SNONCE1 0x103F -#define WPS_ID_R_SNONCE2 0x1040 -#define WPS_ID_SEL_REGISTRAR 0x1041 -#define WPS_ID_SERIAL_NUM 0x1042 -#define WPS_ID_SC_STATE 0x1044 -#define WPS_ID_SSID 0x1045 -#define WPS_ID_TOT_NETWORKS 0x1046 -#define WPS_ID_UUID_E 0x1047 -#define WPS_ID_UUID_R 0x1048 -#define WPS_ID_VENDOR_EXT 0x1049 -#define WPS_ID_VERSION 0x104A -#define WPS_ID_X509_CERT_REQ 0x104B -#define WPS_ID_X509_CERT 0x104C -#define WPS_ID_EAP_IDENTITY 0x104D -#define WPS_ID_MSG_COUNTER 0x104E -#define WPS_ID_PUBKEY_HASH 0x104F -#define WPS_ID_REKEY_KEY 0x1050 -#define WPS_ID_KEY_LIFETIME 0x1051 -#define WPS_ID_PERM_CFG_METHODS 0x1052 -#define WPS_ID_SEL_REG_CFG_METHODS 0x1053 -#define WPS_ID_PRIM_DEV_TYPE 0x1054 -#define WPS_ID_SEC_DEV_TYPE_LIST 0x1055 -#define WPS_ID_PORTABLE_DEVICE 0x1056 -#define WPS_ID_AP_SETUP_LOCKED 0x1057 -#define WPS_ID_APP_LIST 0x1058 -#define WPS_ID_EAP_TYPE 0x1059 -#define WPS_ID_INIT_VECTOR 0x1060 -#define WPS_ID_KEY_PROVIDED_AUTO 0x1061 -#define WPS_ID_8021X_ENABLED 0x1062 -#define WPS_ID_WEP_TRANSMIT_KEY 0x1064 -#define WPS_ID_REQ_DEV_TYPE 0x106A - -/* WSC 2.0, WFA Vendor Extension Subelements */ -#define WFA_VENDOR_EXT_ID "\x00\x37\x2A" -#define WPS_WFA_SUBID_VERSION2 0x00 -#define WPS_WFA_SUBID_AUTHORIZED_MACS 0x01 -#define WPS_WFA_SUBID_NW_KEY_SHAREABLE 0x02 -#define WPS_WFA_SUBID_REQ_TO_ENROLL 0x03 -#define WPS_WFA_SUBID_SETTINGS_DELAY_TIME 0x04 - - -/* WCN-NET Windows Rally Vertical Pairing Vendor Extensions */ -#define MS_VENDOR_EXT_ID "\x00\x01\x37" -#define WPS_MS_ID_VPI 0x1001 /* Vertical Pairing Identifier TLV */ -#define WPS_MS_ID_TRANSPORT_UUID 0x1002 /* Transport UUID TLV */ - -/* Vertical Pairing Identifier TLV Definitions */ -#define WPS_MS_VPI_TRANSPORT_NONE 0x00 /* None */ -#define WPS_MS_VPI_TRANSPORT_DPWS 0x01 /* Devices Profile for Web Services */ -#define WPS_MS_VPI_TRANSPORT_UPNP 0x02 /* uPnP */ -#define WPS_MS_VPI_TRANSPORT_SDNWS 0x03 /* Secure Devices Profile for Web Services */ -#define WPS_MS_VPI_NO_PROFILE_REQ 0x00 /* Wi-Fi profile not requested. - * Not supported in Windows 7 - */ -#define WPS_MS_VPI_PROFILE_REQ 0x01 /* Wi-Fi profile requested. */ - -/* sizes of the fixed size elements */ -#define WPS_ID_AP_CHANNEL_S 2 -#define WPS_ID_ASSOC_STATE_S 2 -#define WPS_ID_AUTH_TYPE_S 2 -#define WPS_ID_AUTH_TYPE_FLAGS_S 2 -#define WPS_ID_AUTHENTICATOR_S 8 -#define WPS_ID_CONFIG_METHODS_S 2 -#define WPS_ID_CONFIG_ERROR_S 2 -#define WPS_ID_CONN_TYPE_S 1 -#define WPS_ID_CONN_TYPE_FLAGS_S 1 -#define WPS_ID_DEVICE_PWD_ID_S 2 -#define WPS_ID_ENCR_TYPE_S 2 -#define WPS_ID_ENCR_TYPE_FLAGS_S 2 -#define WPS_ID_FEATURE_ID_S 4 -#define WPS_ID_MAC_ADDR_S 6 -#define WPS_ID_MSG_TYPE_S 1 -#define WPS_ID_SC_STATE_S 1 -#define WPS_ID_RF_BAND_S 1 -#define WPS_ID_OS_VERSION_S 4 -#define WPS_ID_VERSION_S 1 -#define WPS_ID_SEL_REGISTRAR_S 1 -#define WPS_ID_SEL_REG_CFG_METHODS_S 2 -#define WPS_ID_REQ_TYPE_S 1 -#define WPS_ID_RESP_TYPE_S 1 -#define WPS_ID_AP_SETUP_LOCKED_S 1 - -/* WSC 2.0, WFA Vendor Extension Subelements */ -#define WPS_WFA_SUBID_VERSION2_S 1 -#define WPS_WFA_SUBID_NW_KEY_SHAREABLE_S 1 -#define WPS_WFA_SUBID_REQ_TO_ENROLL_S 1 -#define WPS_WFA_SUBID_SETTINGS_DELAY_TIME_S 1 - -/* Association states */ -#define WPS_ASSOC_NOT_ASSOCIATED 0 -#define WPS_ASSOC_CONN_SUCCESS 1 -#define WPS_ASSOC_CONFIG_FAIL 2 -#define WPS_ASSOC_ASSOC_FAIL 3 -#define WPS_ASSOC_IP_FAIL 4 - -/* Authentication types */ -#define WPS_AUTHTYPE_OPEN 0x0001 -#define WPS_AUTHTYPE_WPAPSK 0x0002 /* Deprecated in WSC 2.0 */ -#define WPS_AUTHTYPE_SHARED 0x0004 /* Deprecated in WSC 2.0 */ -#define WPS_AUTHTYPE_WPA 0x0008 /* Deprecated in WSC 2.0 */ -#define WPS_AUTHTYPE_WPA2 0x0010 -#define WPS_AUTHTYPE_WPA2PSK 0x0020 - -/* Config methods */ -#define WPS_CONFMET_USBA 0x0001 /* Deprecated in WSC 2.0 */ -#define WPS_CONFMET_ETHERNET 0x0002 /* Deprecated in WSC 2.0 */ -#define WPS_CONFMET_LABEL 0x0004 -#define WPS_CONFMET_DISPLAY 0x0008 -#define WPS_CONFMET_EXT_NFC_TOK 0x0010 -#define WPS_CONFMET_INT_NFC_TOK 0x0020 -#define WPS_CONFMET_NFC_INTF 0x0040 -#define WPS_CONFMET_PBC 0x0080 -#define WPS_CONFMET_KEYPAD 0x0100 -/* WSC 2.0 */ -#define WPS_CONFMET_VIRT_PBC 0x0280 -#define WPS_CONFMET_PHY_PBC 0x0480 -#define WPS_CONFMET_VIRT_DISPLAY 0x2008 -#define WPS_CONFMET_PHY_DISPLAY 0x4008 - -/* WPS error messages */ -#define WPS_ERROR_NO_ERROR 0 -#define WPS_ERROR_OOB_INT_READ_ERR 1 -#define WPS_ERROR_DECRYPT_CRC_FAIL 2 -#define WPS_ERROR_CHAN24_NOT_SUPP 3 -#define WPS_ERROR_CHAN50_NOT_SUPP 4 -#define WPS_ERROR_SIGNAL_WEAK 5 /* Deprecated in WSC 2.0 */ -#define WPS_ERROR_NW_AUTH_FAIL 6 /* Deprecated in WSC 2.0 */ -#define WPS_ERROR_NW_ASSOC_FAIL 7 /* Deprecated in WSC 2.0 */ -#define WPS_ERROR_NO_DHCP_RESP 8 /* Deprecated in WSC 2.0 */ -#define WPS_ERROR_FAILED_DHCP_CONF 9 /* Deprecated in WSC 2.0 */ -#define WPS_ERROR_IP_ADDR_CONFLICT 10 /* Deprecated in WSC 2.0 */ -#define WPS_ERROR_FAIL_CONN_REGISTRAR 11 -#define WPS_ERROR_MULTI_PBC_DETECTED 12 -#define WPS_ERROR_ROGUE_SUSPECTED 13 -#define WPS_ERROR_DEVICE_BUSY 14 -#define WPS_ERROR_SETUP_LOCKED 15 -#define WPS_ERROR_MSG_TIMEOUT 16 /* Deprecated in WSC 2.0 */ -#define WPS_ERROR_REG_SESSION_TIMEOUT 17 /* Deprecated in WSC 2.0 */ -#define WPS_ERROR_DEV_PWD_AUTH_FAIL 18 - -/* Connection types */ -#define WPS_CONNTYPE_ESS 0x01 -#define WPS_CONNTYPE_IBSS 0x02 - -/* Device password ID */ -#define WPS_DEVICEPWDID_DEFAULT 0x0000 -#define WPS_DEVICEPWDID_USER_SPEC 0x0001 -#define WPS_DEVICEPWDID_MACHINE_SPEC 0x0002 -#define WPS_DEVICEPWDID_REKEY 0x0003 -#define WPS_DEVICEPWDID_PUSH_BTN 0x0004 -#define WPS_DEVICEPWDID_REG_SPEC 0x0005 - -/* Encryption type */ -#define WPS_ENCRTYPE_NONE 0x0001 -#define WPS_ENCRTYPE_WEP 0x0002 /* Deprecated in WSC 2.0 */ -#define WPS_ENCRTYPE_TKIP 0x0004 /* Deprecated in version 2.0. TKIP can only - * be advertised on the AP when Mixed Mode - * is enabled (Encryption Type is 0x000c). - */ -#define WPS_ENCRTYPE_AES 0x0008 - - -/* WPS Message Types */ -#define WPS_ID_BEACON 0x01 -#define WPS_ID_PROBE_REQ 0x02 -#define WPS_ID_PROBE_RESP 0x03 -#define WPS_ID_MESSAGE_M1 0x04 -#define WPS_ID_MESSAGE_M2 0x05 -#define WPS_ID_MESSAGE_M2D 0x06 -#define WPS_ID_MESSAGE_M3 0x07 -#define WPS_ID_MESSAGE_M4 0x08 -#define WPS_ID_MESSAGE_M5 0x09 -#define WPS_ID_MESSAGE_M6 0x0A -#define WPS_ID_MESSAGE_M7 0x0B -#define WPS_ID_MESSAGE_M8 0x0C -#define WPS_ID_MESSAGE_ACK 0x0D -#define WPS_ID_MESSAGE_NACK 0x0E -#define WPS_ID_MESSAGE_DONE 0x0F - -/* WSP private ID for local use */ -#define WPS_PRIVATE_ID_IDENTITY (WPS_ID_MESSAGE_DONE + 1) -#define WPS_PRIVATE_ID_WPS_START (WPS_ID_MESSAGE_DONE + 2) -#define WPS_PRIVATE_ID_FAILURE (WPS_ID_MESSAGE_DONE + 3) -#define WPS_PRIVATE_ID_FRAG (WPS_ID_MESSAGE_DONE + 4) -#define WPS_PRIVATE_ID_FRAG_ACK (WPS_ID_MESSAGE_DONE + 5) -#define WPS_PRIVATE_ID_EAPOL_START (WPS_ID_MESSAGE_DONE + 6) - - -/* Device Type categories for primary and secondary device types */ -#define WPS_DEVICE_TYPE_CAT_COMPUTER 1 -#define WPS_DEVICE_TYPE_CAT_INPUT_DEVICE 2 -#define WPS_DEVICE_TYPE_CAT_PRINTER 3 -#define WPS_DEVICE_TYPE_CAT_CAMERA 4 -#define WPS_DEVICE_TYPE_CAT_STORAGE 5 -#define WPS_DEVICE_TYPE_CAT_NW_INFRA 6 -#define WPS_DEVICE_TYPE_CAT_DISPLAYS 7 -#define WPS_DEVICE_TYPE_CAT_MM_DEVICES 8 -#define WPS_DEVICE_TYPE_CAT_GAME_DEVICES 9 -#define WPS_DEVICE_TYPE_CAT_TELEPHONE 10 -#define WPS_DEVICE_TYPE_CAT_AUDIO_DEVICES 11 /* WSC 2.0 */ - -/* Device Type sub categories for primary and secondary device types */ -#define WPS_DEVICE_TYPE_SUB_CAT_COMP_PC 1 -#define WPS_DEVICE_TYPE_SUB_CAT_COMP_SERVER 2 -#define WPS_DEVICE_TYPE_SUB_CAT_COMP_MEDIA_CTR 3 -#define WPS_DEVICE_TYPE_SUB_CAT_COMP_UM_PC 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_COMP_NOTEBOOK 5 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_COMP_DESKTOP 6 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_COMP_MID 7 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_COMP_NETBOOK 8 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_Keyboard 1 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_MOUSE 2 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_JOYSTICK 3 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_TRACKBALL 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_GAM_CTRL 5 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_REMOTE 6 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_TOUCHSCREEN 7 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_BIO_READER 8 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_INP_BAR_READER 9 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_PRINTER 1 -#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_SCANNER 2 -#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_FAX 3 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_COPIER 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_PRTR_ALLINONE 5 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_CAM_DGTL_STILL 1 -#define WPS_DEVICE_TYPE_SUB_CAT_CAM_VIDEO_CAM 2 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_CAM_WEB_CAM 3 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_CAM_SECU_CAM 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_STOR_NAS 1 -#define WPS_DEVICE_TYPE_SUB_CAT_NW_AP 1 -#define WPS_DEVICE_TYPE_SUB_CAT_NW_ROUTER 2 -#define WPS_DEVICE_TYPE_SUB_CAT_NW_SWITCH 3 -#define WPS_DEVICE_TYPE_SUB_CAT_NW_GATEWAY 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_NW_BRIDGE 5 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_DISP_TV 1 -#define WPS_DEVICE_TYPE_SUB_CAT_DISP_PIC_FRAME 2 -#define WPS_DEVICE_TYPE_SUB_CAT_DISP_PROJECTOR 3 -#define WPS_DEVICE_TYPE_SUB_CAT_DISP_MONITOR 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_MM_DAR 1 -#define WPS_DEVICE_TYPE_SUB_CAT_MM_PVR 2 -#define WPS_DEVICE_TYPE_SUB_CAT_MM_MCX 3 -#define WPS_DEVICE_TYPE_SUB_CAT_MM_STB 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_MM_MS_ME 5 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_MM_PVP 6 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_GAM_XBOX 1 -#define WPS_DEVICE_TYPE_SUB_CAT_GAM_XBOX_360 2 -#define WPS_DEVICE_TYPE_SUB_CAT_GAM_PS 3 -#define WPS_DEVICE_TYPE_SUB_CAT_GAM_GC 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_GAM_PGD 5 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_WM 1 -#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_PSM 2 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_PDM 3 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_SSM 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_PHONE_SDM 5 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_TUNER 1 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_SPEAKERS 2 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_PMP 3 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_HEADSET 4 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_HPHONE 5 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_MPHONE 6 /* WSC 2.0 */ -#define WPS_DEVICE_TYPE_SUB_CAT_AUDIO_HTS 7 /* WSC 2.0 */ - - -/* Device request/response type */ -#define WPS_MSGTYPE_ENROLLEE_INFO_ONLY 0x00 -#define WPS_MSGTYPE_ENROLLEE_OPEN_8021X 0x01 -#define WPS_MSGTYPE_REGISTRAR 0x02 -#define WPS_MSGTYPE_AP_WLAN_MGR 0x03 - -/* RF Band */ -#define WPS_RFBAND_24GHZ 0x01 -#define WPS_RFBAND_50GHZ 0x02 - -/* Simple Config state */ -#define WPS_SCSTATE_UNCONFIGURED 0x01 -#define WPS_SCSTATE_CONFIGURED 0x02 -#define WPS_SCSTATE_OFF 11 - -/* WPS Vendor extension key */ -#define WPS_OUI_HEADER_LEN 2 -#define WPS_OUI_HEADER_SIZE 4 -#define WPS_OUI_FIXED_HEADER_OFF 16 -#define WPS_WFA_SUBID_V2_OFF 3 -#define WPS_WFA_V2_OFF 5 - -#ifdef __cplusplus -} -#endif - -#endif /* _WPS_ */ diff --git a/drivers/net/wireless/bcmdhd/linux_osl.c b/drivers/net/wireless/bcmdhd/linux_osl.c index 5467cdf..ddb8372 100644 --- a/drivers/net/wireless/bcmdhd/linux_osl.c +++ b/drivers/net/wireless/bcmdhd/linux_osl.c @@ -21,7 +21,7 @@ * 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: linux_osl.c 347629 2012-07-27 10:57:10Z $ + * $Id: linux_osl.c 350283 2012-08-12 07:47:25Z $ */ #define LINUX_PORT @@ -252,8 +252,9 @@ osl_attach(void *pdev, uint bustype, bool pkttag) bcm_static_skb = (bcm_static_pkt_t *)((char *)bcm_static_buf + 2048); skb_buff_ptr = dhd_os_prealloc(osh, 4, 0); - bcopy(skb_buff_ptr, bcm_static_skb, sizeof(struct sk_buff *)*16); - for (i = 0; i < STATIC_PKT_MAX_NUM * 2; i++) + bcopy(skb_buff_ptr, bcm_static_skb, sizeof(struct sk_buff *)* + (STATIC_PKT_MAX_NUM * 2 + STATIC_PKT_4PAGE_NUM)); + for (i = 0; i < (STATIC_PKT_MAX_NUM * 2 + STATIC_PKT_4PAGE_NUM); i++) bcm_static_skb->pkt_use[i] = 0; sema_init(&bcm_static_skb->osl_pkt_sem, 1); diff --git a/drivers/net/wireless/bcmdhd/wl_android.c b/drivers/net/wireless/bcmdhd/wl_android.c index f67c7b5..cc76cff 100644 --- a/drivers/net/wireless/bcmdhd/wl_android.c +++ b/drivers/net/wireless/bcmdhd/wl_android.c @@ -21,7 +21,7 @@ * 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_android.c 347544 2012-07-27 05:02:38Z $ + * $Id: wl_android.c 350488 2012-08-14 04:36:26Z $ */ #include <linux/module.h> @@ -137,6 +137,9 @@ extern bool ap_fw_loaded; extern char iface_name[IFNAMSIZ]; #endif +#ifndef WIFI_TURNOFF_DELAY +#define WIFI_TURNOFF_DELAY 0 +#endif /** * Local (static) functions and variables */ @@ -647,7 +650,7 @@ int wl_android_init(void) { int ret = 0; - dhd_msg_level |= DHD_ERROR_VAL; + dhd_msg_level |= DHD_ERROR_VAL | DHD_TRACE2_VAL; #ifdef ENABLE_INSMOD_NO_FW_LOAD dhd_download_fw_on_driverload = FALSE; #endif /* ENABLE_INSMOD_NO_FW_LOAD */ @@ -656,7 +659,7 @@ int wl_android_init(void) memset(iface_name, 0, IFNAMSIZ); bcm_strncpy_s(iface_name, IFNAMSIZ, "wlan", IFNAMSIZ); } -#endif /* CUSTOMER_HW2 */ +#endif return ret; } @@ -819,7 +822,7 @@ static int wifi_remove(struct platform_device *pdev) DHD_ERROR(("## %s\n", __FUNCTION__)); wifi_control_data = wifi_ctrl; - wifi_set_power(0, 0); /* Power Off */ + wifi_set_power(0, WIFI_TURNOFF_DELAY); /* Power Off */ wifi_set_carddetect(0); /* CardDetect (1->0) */ up(&wifi_control_sem); diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index 022fbef..59e446d 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -21,7 +21,7 @@ * 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_cfg80211.c 347620 2012-07-27 10:38:40Z $ + * $Id: wl_cfg80211.c 351262 2012-08-17 12:15:01Z $ */ #include <typedefs.h> @@ -65,7 +65,6 @@ static struct device *cfg80211_parent_dev = NULL; -static int vsdb_supported = 0; struct wl_priv *wlcfg_drv_priv = NULL; u32 wl_dbg_level = WL_DBG_ERR; @@ -782,20 +781,28 @@ static void swap_key_to_BE(struct wl_wsec_key *key) #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0) /* For debug: Dump the contents of the encoded wps ie buffe */ static void -wl_validate_wps_ie(char *wps_ie, bool *pbc) +wl_validate_wps_ie(char *wps_ie, s32 wps_ie_len, bool *pbc) { #define WPS_IE_FIXED_LEN 6 - u16 len = (u16) wps_ie[TLV_LEN_OFF]; - u8 *subel = wps_ie+ WPS_IE_FIXED_LEN; + u16 len; + u8 *subel = NULL; u16 subelt_id; u16 subelt_len; u16 val; u8 *valptr = (uint8*) &val; + if (wps_ie == NULL || wps_ie_len < WPS_IE_FIXED_LEN) { + WL_ERR(("invalid argument : NULL\n")); + return; + } + len = (u16)wps_ie[TLV_LEN_OFF]; + if (len > wps_ie_len) { + WL_ERR(("invalid length len %d, wps ie len %d\n", len, wps_ie_len)); + return; + } WL_DBG(("wps_ie len=%d\n", len)); - len -= 4; /* for the WPS IE's OUI, oui_type fields */ - + subel = wps_ie + WPS_IE_FIXED_LEN; while (len >= 4) { /* must have attr id, attr len fields */ valptr[0] = *subel++; valptr[1] = *subel++; @@ -859,40 +866,35 @@ wl_validate_wps_ie(char *wps_ie, bool *pbc) static chanspec_t wl_cfg80211_get_shared_freq(struct wiphy *wiphy) { - if (vsdb_supported) { + chanspec_t chspec; + int err = 0; + struct wl_priv *wl = wiphy_priv(wiphy); + struct net_device *dev = wl_to_prmry_ndev(wl); + struct ether_addr bssid; + struct wl_bss_info *bss = NULL; + + if ((err = wldev_ioctl(dev, WLC_GET_BSSID, &bssid, sizeof(bssid), false))) { + /* STA interface is not associated. So start the new interface on a temp + * channel . Later proper channel will be applied by the above framework + * via set_channel (cfg80211 API). + */ + WL_DBG(("Not associated. Return a temp channel. \n")); return wl_ch_host_to_driver(WL_P2P_TEMP_CHAN); } - else { - chanspec_t chspec; - int err = 0; - struct wl_priv *wl = wiphy_priv(wiphy); - struct net_device *dev = wl_to_prmry_ndev(wl); - struct ether_addr bssid; - struct wl_bss_info *bss = NULL; - - if ((err = wldev_ioctl(dev, WLC_GET_BSSID, &bssid, sizeof(bssid), false))) { - /* STA interface is not associated. So start the new interface on a temp - * channel . Later proper channel will be applied by the above framework - * via set_channel (cfg80211 API). - */ - WL_DBG(("Not associated. Return a temp channel. \n")); - return wl_ch_host_to_driver(WL_P2P_TEMP_CHAN); - } - *(u32 *) wl->extra_buf = htod32(WL_EXTRA_BUF_MAX); - if ((err = wldev_ioctl(dev, WLC_GET_BSS_INFO, wl->extra_buf, - WL_EXTRA_BUF_MAX, false))) { - WL_ERR(("Failed to get associated bss info, use temp channel \n")); - chspec = wl_ch_host_to_driver(WL_P2P_TEMP_CHAN); - } - else { - bss = (struct wl_bss_info *) (wl->extra_buf + 4); - chspec = bss->chanspec; - WL_DBG(("Valid BSS Found. chanspec:%d \n", bss->chanspec)); - } - return chspec; + *(u32 *) wl->extra_buf = htod32(WL_EXTRA_BUF_MAX); + if ((err = wldev_ioctl(dev, WLC_GET_BSS_INFO, wl->extra_buf, + WL_EXTRA_BUF_MAX, false))) { + WL_ERR(("Failed to get associated bss info, use temp channel \n")); + chspec = wl_ch_host_to_driver(WL_P2P_TEMP_CHAN); + } + else { + bss = (struct wl_bss_info *) (wl->extra_buf + 4); + chspec = bss->chanspec; + WL_DBG(("Valid BSS Found. chanspec:%d \n", bss->chanspec)); } + return chspec; } static struct net_device* wl_cfg80211_add_monitor_if(char *name) @@ -1905,7 +1907,7 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, } #ifdef WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST if (wl_get_drv_status_all(wl, REMAINING_ON_CHANNEL)) { - /* wl_cfg80211_scan_abort(wl, ndev); abort doesn't existed */ + WL_DBG(("Remain_on_channel bit is set, somehow it didn't get cleared\n")); wl_notify_escan_complete(wl, ndev, true, true); } #endif /* WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */ @@ -1964,11 +1966,7 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, } } if (!wl->p2p_supported || !p2p_scan(wl)) { - if ((wl_cfgp2p_find_p2pie((u8 *)request->ie, - request->ie_len)) && - (ndev != wl_to_prmry_ndev(wl))) { - bssidx = wl_cfgp2p_find_idx(wl, ndev); - } + bssidx = wl_cfgp2p_find_idx(wl, ndev); err = wl_cfgp2p_set_management_ie(wl, ndev, bssidx, VNDR_IE_PRBREQ_FLAG, (u8 *)request->ie, request->ie_len); @@ -2592,7 +2590,9 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, CHECK_SYS_UP(wl); - + /* + * Cancel ongoing scan to sync up with sme state machine of cfg80211. + */ #if !defined(ESCAN_RESULT_PATCH) if (wl->scan_request) { wl_notify_escan_complete(wl, dev, true, true); @@ -2640,36 +2640,10 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, if (!wl_get_drv_status(wl, DISCONNECTING, dev)) wl_update_prof(wl, dev, NULL, (void *)&bssid, WL_PROF_BSSID); - if (!memcmp(sme->ssid, WL_P2P_WILDCARD_SSID, WL_P2P_WILDCARD_SSID_LEN) && - (dev != wl_to_prmry_ndev(wl))) { + if (p2p_is_on(wl) && (dev != wl_to_prmry_ndev(wl))) { /* we only allow to connect using virtual interface in case of P2P */ - if (p2p_is_on(wl) && is_wps_conn(sme)) { - WL_DBG(("ASSOC1 p2p index : %d sme->ie_len %d\n", - wl_cfgp2p_find_idx(wl, dev), sme->ie_len)); - /* Have to apply WPS IE + P2P IE in assoc req frame */ - wl_cfgp2p_set_management_ie(wl, dev, - wl_cfgp2p_find_idx(wl, dev), VNDR_IE_PRBREQ_FLAG, - wl_to_p2p_bss_saved_ie(wl, P2PAPI_BSSCFG_DEVICE).p2p_probe_req_ie, - wl_to_p2p_bss_saved_ie(wl, - P2PAPI_BSSCFG_DEVICE).p2p_probe_req_ie_len); wl_cfgp2p_set_management_ie(wl, dev, wl_cfgp2p_find_idx(wl, dev), VNDR_IE_ASSOCREQ_FLAG, sme->ie, sme->ie_len); - } else if (p2p_is_on(wl) && (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2)) { - /* This is the connect req after WPS is done [credentials exchanged] - * currently identified with WPA_VERSION_2 . - * Update the previously set IEs with - * the newly received IEs from Supplicant. This will remove the WPS IE from - * the Assoc Req. - */ - WL_DBG(("ASSOC2 p2p index : %d sme->ie_len %d\n", - wl_cfgp2p_find_idx(wl, dev), sme->ie_len)); - wl_cfgp2p_set_management_ie(wl, dev, - wl_cfgp2p_find_idx(wl, dev), VNDR_IE_PRBREQ_FLAG, - sme->ie, sme->ie_len); - wl_cfgp2p_set_management_ie(wl, dev, wl_cfgp2p_find_idx(wl, dev), - VNDR_IE_ASSOCREQ_FLAG, sme->ie, sme->ie_len); - } - } else if (dev == wl_to_prmry_ndev(wl)) { /* find the RSN_IE */ if ((wpa2_ie = bcm_parse_tlvs((u8 *)sme->ie, sme->ie_len, @@ -2692,7 +2666,7 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, wl->ioctl_buf, WLC_IOCTL_MAXLEN, &wl->ioctl_buf_sync); } - err = wl_cfgp2p_set_management_ie(wl, dev, -1, + err = wl_cfgp2p_set_management_ie(wl, dev, wl_cfgp2p_find_idx(wl, dev), VNDR_IE_ASSOCREQ_FLAG, (u8 *)sme->ie, sme->ie_len); if (unlikely(err)) { return err; @@ -2760,7 +2734,7 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, /* Set up join scan parameters */ ext_join_params->scan.scan_type = -1; ext_join_params->scan.nprobes - = (ext_join_params->scan.active_time/(WL_SCAN_ACTIVE_TIME *2)); + = (ext_join_params->scan.active_time/(WL_SCAN_ACTIVE_TIME / 2)); ext_join_params->scan.home_time = -1; if (sme->bssid) @@ -2845,13 +2819,15 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, act = *(bool *) wl_read_prof(wl, dev, WL_PROF_ACT); curbssid = wl_read_prof(wl, dev, WL_PROF_BSSID); if (act) { - + /* + * Cancel ongoing scan to sync up with sme state machine of cfg80211. + */ #if !defined(ESCAN_RESULT_PATCH) - + /* Let scan aborted by F/W */ if (wl->scan_request) { wl_notify_escan_complete(wl, dev, true, true); } -#endif +#endif /* ESCAN_RESULT_PATCH */ wl_set_drv_status(wl, DISCONNECTING, dev); scbval.val = reason_code; memcpy(&scbval.ea, curbssid, ETHER_ADDR_LEN); @@ -3339,20 +3315,18 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev, sinfo->filled |= STATION_INFO_SIGNAL; sinfo->signal = rssi; WL_DBG(("RSSI %d dBm\n", rssi)); - err = wldev_ioctl(dev, WLC_GET_PKTCNTS, &pktcnt, - sizeof(pktcnt), false); + sizeof(pktcnt), false); if (!err) { sinfo->filled |= (STATION_INFO_RX_PACKETS | - STATION_INFO_RX_DROP_MISC | - STATION_INFO_TX_PACKETS | - STATION_INFO_TX_FAILED); + STATION_INFO_RX_DROP_MISC | + STATION_INFO_TX_PACKETS | + STATION_INFO_TX_FAILED); sinfo->rx_packets = pktcnt.rx_good_pkt; sinfo->rx_dropped_misc = pktcnt.rx_bad_pkt; sinfo->tx_packets = pktcnt.tx_good_pkt; sinfo->tx_failed = pktcnt.tx_bad_pkt; } - get_station_err: if (err && (err != -ERESTARTSYS)) { /* Disconnect due to zero BSSID or error to get RSSI */ @@ -3774,41 +3748,7 @@ wl_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, struct net_device *dev WL_DBG((" enter ) netdev_ifidx: %d \n", dev->ifindex)); return err; } -static s32 -wl_cfg80211_send_pending_tx_act_frm(struct wl_priv *wl) -{ - wl_af_params_t *tx_act_frm; - struct net_device *dev = wl->afx_hdl->dev; - if (dev == NULL) - return -1; - - if (!p2p_is_on(wl)) - return -1; - - if (dev == wl->p2p_net) { - dev = wl_to_prmry_ndev(wl); - } - - tx_act_frm = wl->afx_hdl->pending_tx_act_frm; - WL_DBG(("Sending the action frame\n")); - wl->afx_hdl->pending_tx_act_frm = NULL; - if (tx_act_frm != NULL) { - /* Suspend P2P discovery's search-listen to prevent it from - * starting a scan or changing the channel. - */ - wl_clr_drv_status(wl, SCANNING, wl->afx_hdl->dev); -/* Do not abort scan for VSDB. Scan will be aborted in firmware if necessary */ -#ifndef WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST - wl_notify_escan_complete(wl, dev, true, true); -#endif /* not WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */ - wl_cfgp2p_discover_enable_search(wl, false); - tx_act_frm->channel = wl->afx_hdl->peer_chan; - wl->afx_hdl->ack_recv = (wl_cfgp2p_tx_action_frame(wl, dev, - tx_act_frm, wl->afx_hdl->bssidx)) ? false : true; - } - return 0; -} static void wl_cfg80211_afx_handler(struct work_struct *work) { @@ -3819,7 +3759,8 @@ wl_cfg80211_afx_handler(struct work_struct *work) afx_instance = container_of(work, struct afx_hdl, work); if (afx_instance != NULL && wl->afx_hdl->is_active) { if (wl->afx_hdl->is_listen && wl->afx_hdl->my_listen_chan) { - ret = wl_cfgp2p_discover_listen(wl, wl->afx_hdl->my_listen_chan, 200); + ret = wl_cfgp2p_discover_listen(wl, wl->afx_hdl->my_listen_chan, + (100 * (1 + (random32() % 3)))); /* 100ms ~ 300ms */ } else { ret = wl_cfgp2p_act_frm_search(wl, wl->afx_hdl->dev, wl->afx_hdl->bssidx, wl->afx_hdl->peer_listen_chan); @@ -3832,26 +3773,20 @@ wl_cfg80211_afx_handler(struct work_struct *work) } } -static bool -wl_cfg80211_send_at_common_channel(struct wl_priv *wl, - struct net_device *dev, - wl_af_params_t *af_params) +static s32 +wl_cfg80211_af_searching_channel(struct wl_priv *wl, struct net_device *dev) { u32 max_retry = WL_CHANNEL_SYNC_RETRY; + if (dev == NULL) + return -1; + WL_DBG((" enter ) \n")); - /* initialize afx_hdl */ - wl->afx_hdl->pending_tx_act_frm = af_params; - wl->afx_hdl->bssidx = wl_cfgp2p_find_idx(wl, dev); - wl->afx_hdl->dev = dev; - wl->afx_hdl->retry = 0; - wl->afx_hdl->peer_chan = WL_INVALID; - wl->afx_hdl->ack_recv = false; wl_set_drv_status(wl, FINDING_COMMON_CHANNEL, dev); wl->afx_hdl->is_active = TRUE; - /* Loop to wait until we have sent the pending tx action frame or the + /* Loop to wait until we find a peer's channel or the * pending action frame tx is cancelled. */ while ((wl->afx_hdl->retry < max_retry) && @@ -3890,21 +3825,329 @@ wl_cfg80211_send_at_common_channel(struct wl_priv *wl, wl_clr_drv_status(wl, SCANNING, dev); wl_clr_drv_status(wl, FINDING_COMMON_CHANNEL, dev); - if (wl->afx_hdl->peer_chan != WL_INVALID) - wl_cfg80211_send_pending_tx_act_frm(wl); - else { - WL_ERR(("Couldn't find the peer after %d retries\n", - wl->afx_hdl->retry)); + return (wl->afx_hdl->peer_chan); +} + +struct p2p_config_af_params { + s32 max_tx_retry; /* max tx retry count if tx no ack */ + /* To make sure to send successfully action frame, we have to turn off mpc + * 0: off, 1: on, (-1): do nothing + */ + s32 mpc_onoff; +#ifdef WL_CFG80211_SYNC_GON + bool extra_listen; +#endif + bool search_channel; /* 1: search peer's channel to send af */ +}; + +static s32 +wl_cfg80211_config_p2p_pub_af_tx(struct wiphy *wiphy, + wl_action_frame_t *action_frame, wl_af_params_t *af_params, + struct p2p_config_af_params *config_af_params) +{ + s32 err = BCME_OK; + struct wl_priv *wl = wiphy_priv(wiphy); + wifi_p2p_pub_act_frame_t *act_frm = + (wifi_p2p_pub_act_frame_t *) (action_frame->data); + + /* initialize default value */ +#ifdef WL_CFG80211_SYNC_GON + config_af_params->extra_listen = true; +#endif + config_af_params->search_channel = false; + config_af_params->max_tx_retry = WL_AF_TX_MAX_RETRY; + config_af_params->mpc_onoff = -1; + + switch (act_frm->subtype) { + case P2P_PAF_GON_REQ: { + WL_DBG(("P2P: GO_NEG_PHASE status set \n")); + wl_set_p2p_status(wl, GO_NEG_PHASE); + + config_af_params->mpc_onoff = 0; + config_af_params->search_channel = true; + wl->next_af_subtype = act_frm->subtype + 1; + + /* increase dwell time to wait for RESP frame */ + af_params->dwell_time = WL_MED_DWELL_TIME; + + break; + } + case P2P_PAF_GON_RSP: { + wl->next_af_subtype = act_frm->subtype + 1; + /* increase dwell time to wait for CONF frame */ + af_params->dwell_time = WL_MED_DWELL_TIME; + break; } - wl->afx_hdl->is_listen = FALSE; - wl->afx_hdl->pending_tx_act_frm = NULL; - wl->afx_hdl->dev = NULL; - wl->afx_hdl->bssidx = WL_INVALID; + case P2P_PAF_GON_CONF: { + /* If we reached till GO Neg confirmation reset the filter */ + WL_DBG(("P2P: GO_NEG_PHASE status cleared \n")); + wl_clr_p2p_status(wl, GO_NEG_PHASE); - if (wl->afx_hdl->ack_recv) - return true; /* ACK */ - else - return false; /* NO ACK */ + /* turn on mpc again if go nego is done */ + config_af_params->mpc_onoff = 1; + + /* minimize dwell time */ + af_params->dwell_time = WL_MIN_DWELL_TIME; + +#ifdef WL_CFG80211_SYNC_GON + config_af_params->extra_listen = false; +#endif /* WL_CFG80211_SYNC_GON */ + break; + } + case P2P_PAF_INVITE_REQ: { + config_af_params->search_channel = true; + wl->next_af_subtype = act_frm->subtype + 1; + + /* increase dwell time */ + af_params->dwell_time = WL_MED_DWELL_TIME; + break; + } + case P2P_PAF_INVITE_RSP: + /* minimize dwell time */ + af_params->dwell_time = WL_MIN_DWELL_TIME; +#ifdef WL_CFG80211_SYNC_GON + config_af_params->extra_listen = false; +#endif /* WL_CFG80211_SYNC_GON */ + break; + case P2P_PAF_DEVDIS_REQ: { + config_af_params->search_channel = true; + + wl->next_af_subtype = act_frm->subtype + 1; + /* maximize dwell time to wait for RESP frame */ + af_params->dwell_time = WL_LONG_DWELL_TIME; + break; + } + case P2P_PAF_DEVDIS_RSP: + /* minimize dwell time */ + af_params->dwell_time = WL_MIN_DWELL_TIME; +#ifdef WL_CFG80211_SYNC_GON + config_af_params->extra_listen = false; +#endif /* WL_CFG80211_SYNC_GON */ + break; + case P2P_PAF_PROVDIS_REQ: { + if (IS_PROV_DISC_WITHOUT_GROUP_ID(&act_frm->elts[0], + action_frame->len)) { + config_af_params->search_channel = true; + } + + config_af_params->mpc_onoff = 0; + wl->next_af_subtype = act_frm->subtype + 1; + /* increase dwell time to wait for RESP frame */ + af_params->dwell_time = WL_MED_DWELL_TIME; + break; + } + case P2P_PAF_PROVDIS_RSP: { + wl->next_af_subtype = P2P_PAF_GON_REQ; + /* increase dwell time to MED level */ + af_params->dwell_time = WL_MED_DWELL_TIME; +#ifdef WL_CFG80211_SYNC_GON + config_af_params->extra_listen = false; +#endif /* WL_CFG80211_SYNC_GON */ + break; + } + default: + WL_DBG(("Unknown p2p pub act frame subtype: %d\n", + act_frm->subtype)); + err = BCME_BADARG; + } + return err; +} + + +static bool +wl_cfg80211_send_action_frame(struct wiphy *wiphy, struct net_device *dev, + struct net_device *ndev, wl_af_params_t *af_params, + wl_action_frame_t *action_frame, u16 action_frame_len, s32 bssidx) +{ + struct wl_priv *wl = wiphy_priv(wiphy); + bool ack = false; + u8 category, action; + s32 tx_retry; + struct p2p_config_af_params config_af_params; + + if (!af_params || !action_frame || !p2p_is_on(wl)) + return false; + + wl_cfgp2p_print_actframe(true, action_frame->data, action_frame->len); + + category = action_frame->data[DOT11_ACTION_CAT_OFF]; + action = action_frame->data[DOT11_ACTION_ACT_OFF]; + + /* initialize variables */ + tx_retry = 0; + wl->next_af_subtype = -1; + config_af_params.max_tx_retry = WL_AF_TX_MAX_RETRY; + config_af_params.mpc_onoff = -1; + config_af_params.search_channel = false; +#ifdef WL_CFG80211_SYNC_GON + config_af_params.extra_listen = false; +#endif + + /* config parameters */ + /* Public Action Frame Process - DOT11_ACTION_CAT_PUBLIC */ + if (category == DOT11_ACTION_CAT_PUBLIC) { + if ((action == P2P_PUB_AF_ACTION) && + (action_frame_len >= sizeof(wifi_p2p_pub_act_frame_t))) { + /* p2p public action frame process */ + if (BCME_OK != wl_cfg80211_config_p2p_pub_af_tx(wiphy, + action_frame, af_params, &config_af_params)) { + WL_DBG(("Unknown subtype.\n")); + } + + } else if (action_frame_len >= sizeof(wifi_p2psd_gas_pub_act_frame_t)) { + /* service discovery process */ + if (action == P2PSD_ACTION_ID_GAS_IREQ || + action == P2PSD_ACTION_ID_GAS_IREQ) { + /* configure service discovery query frame */ + + config_af_params.search_channel = true; + + /* save next af suptype to cancel remained dwell time */ + wl->next_af_subtype = action + 1; + + af_params->dwell_time = WL_MED_DWELL_TIME; + } else if (action == P2PSD_ACTION_ID_GAS_IRESP || + action == P2PSD_ACTION_ID_GAS_IRESP) { + /* configure service discovery response frame */ + af_params->dwell_time = WL_MIN_DWELL_TIME; + } else { + WL_DBG(("Unknown action type: %d\n", action)); + } + } else { + WL_DBG(("Unknown Frame: category 0x%x, action 0x%x, length %d\n", + category, action, action_frame_len)); + } + } else if (category == P2P_AF_CATEGORY) { + /* do not configure anything. it will be sent with a default configuration */ + } else { + WL_DBG(("Unknown Frame: category 0x%x, action 0x%x\n", + category, action)); + } + + /* To make sure to send successfully action frame, we have to turn off mpc */ + if (config_af_params.mpc_onoff == 0) { + wldev_iovar_setint(dev, "mpc", 0); + } + + /* validate channel and p2p ies */ + if (config_af_params.search_channel && IS_P2P_SOCIAL(af_params->channel) && + wl_to_p2p_bss_saved_ie(wl, P2PAPI_BSSCFG_DEVICE).p2p_probe_req_ie_len) { + config_af_params.search_channel = true; + } else { + config_af_params.search_channel = false; + } + +#ifdef VSDB + /* if connecting on primary iface, sleep for a while before sending af tx for VSDB */ + if (wl_get_drv_status(wl, CONNECTING, wl_to_prmry_ndev(wl))) { + msleep(50); + } +#endif + + /* if scan is ongoing, abort current scan. */ + if (wl_get_drv_status_all(wl, SCANNING)) { + wl_notify_escan_complete(wl, ndev, true, true); + } + + /* set status and destination address before sending af */ + if (wl->next_af_subtype != -1) { + /* set this status to cancel the remained dwell time in rx process */ + wl_set_drv_status(wl, WAITING_NEXT_ACT_FRM, dev); + } + wl_set_drv_status(wl, SENDING_ACT_FRM, dev); + memcpy(wl->afx_hdl->tx_dst_addr.octet, + af_params->action_frame.da.octet, + sizeof(wl->afx_hdl->tx_dst_addr.octet)); + + /* save af_params for rx process */ + wl->afx_hdl->pending_tx_act_frm = af_params; + + /* search peer's channel */ + if (config_af_params.search_channel) { + /* initialize afx_hdl */ + wl->afx_hdl->bssidx = wl_cfgp2p_find_idx(wl, dev); + wl->afx_hdl->dev = dev; + wl->afx_hdl->retry = 0; + wl->afx_hdl->peer_chan = WL_INVALID; + + if (wl_cfg80211_af_searching_channel(wl, dev) == WL_INVALID) { + WL_ERR(("couldn't find peer's channel.\n")); + goto exit; + } + + /* Suspend P2P discovery's search-listen to prevent it from + * starting a scan or changing the channel. + */ + wl_clr_drv_status(wl, SCANNING, wl->afx_hdl->dev); +/* Do not abort scan for VSDB. Scan will be aborted in firmware if necessary */ +#ifndef WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST + wl_notify_escan_complete(wl, dev, true, true); +#endif /* not WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */ + wl_cfgp2p_discover_enable_search(wl, false); + + /* update channel */ + af_params->channel = wl->afx_hdl->peer_chan; + } + + /* Now send a tx action frame */ + ack = wl_cfgp2p_tx_action_frame(wl, dev, af_params, bssidx) ? false : true; + + /* if failed, retry it. tx_retry_max value is configure by .... */ + while ((ack == false) && (tx_retry++ < config_af_params.max_tx_retry)) { + WL_AF_TX_KEEP_PRI_CONNECTION_VSDB(wl); + + ack = wl_cfgp2p_tx_action_frame(wl, dev, af_params, bssidx) ? + false : true; + } + if (ack == false) { + WL_ERR(("Failed to send Action Frame(retry %d)\n", tx_retry)); + } +exit: + /* Clear SENDING_ACT_FRM after all sending af is done */ + wl_clr_drv_status(wl, SENDING_ACT_FRM, dev); + +#ifdef WL_CFG80211_SYNC_GON + /* WAR: sometimes dongle does not keep the dwell time of 'actframe'. + * if we coundn't get the next action response frame and dongle does not keep + * the dwell time, go to listen state again to get next action response frame. + */ + if (ack && config_af_params.extra_listen && + wl_get_drv_status_all(wl, WAITING_NEXT_ACT_FRM) && + wl->af_sent_channel == wl->afx_hdl->my_listen_chan) { + s32 extar_listen_time; + + extar_listen_time = af_params->dwell_time - + jiffies_to_msecs(jiffies - wl->af_tx_sent_jiffies); + + if (extar_listen_time > 50) { + wl_set_drv_status(wl, WAITING_NEXT_ACT_FRM_LISTEN, dev); + WL_DBG(("Wait more time! actual af time:%d," + "calculated extar listen:%d\n", + af_params->dwell_time, extar_listen_time)); + if (wl_cfgp2p_discover_listen(wl, wl->af_sent_channel, + extar_listen_time + 100) == BCME_OK) { + wait_for_completion_timeout(&wl->wait_next_af, + msecs_to_jiffies(extar_listen_time + 100 + 300)); + } + wl_clr_drv_status(wl, WAITING_NEXT_ACT_FRM_LISTEN, dev); + } + } +#endif /* WL_CFG80211_SYNC_GON */ + wl_clr_drv_status(wl, WAITING_NEXT_ACT_FRM, dev); + + if (wl->afx_hdl->pending_tx_act_frm) + wl->afx_hdl->pending_tx_act_frm = NULL; + + WL_INFO(("-- sending Action Frame is %s, listen chan: %d\n", + (ack) ? "Succeeded!!":"Failed!!", wl->afx_hdl->my_listen_chan)); + + + /* if all done, turn mpc on again */ + if (config_af_params.mpc_onoff == 1) { + wldev_iovar_setint(dev, "mpc", 1); + } + + return ack; } static s32 @@ -3930,15 +4173,8 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev, s32 err = BCME_OK; s32 bssidx = 0; u32 id; - u32 retry = 0; bool ack = false; - wifi_p2p_pub_act_frame_t *act_frm = NULL; - wifi_p2p_action_frame_t *p2p_act_frm = NULL; - wifi_p2psd_gas_pub_act_frame_t *sd_act_frm = NULL; s8 eabuf[ETHER_ADDR_STR_LEN]; -#ifdef WL_CFG80211_SYNC_GON - bool is_waiting_more_time = false; -#endif /* WL_CFG80211_SYNC_GON */ WL_DBG(("Enter \n")); @@ -3975,7 +4211,8 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev, if (ieee80211_is_probe_resp(mgmt->frame_control)) { s32 ie_offset = DOT11_MGMT_HDR_LEN + DOT11_BCN_PRB_FIXED_LEN; s32 ie_len = len - ie_offset; - + if (dev == wl_to_prmry_ndev(wl)) + bssidx = wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE); wl_cfgp2p_set_management_ie(wl, dev, bssidx, VNDR_IE_PRBRSP_FLAG, (u8 *)(buf + ie_offset), ie_len); cfg80211_mgmt_tx_status(ndev, *cookie, buf, len, true, GFP_KERNEL); @@ -4043,222 +4280,19 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev, wl->afx_hdl->peer_listen_chan = af_params->channel; WL_DBG(("channel from upper layer %d\n", wl->afx_hdl->peer_listen_chan)); - /* Add the dwell time + /* Add the default dwell time * Dwell time to stay off-channel to wait for a response action frame * after transmitting an GO Negotiation action frame */ af_params->dwell_time = WL_DWELL_TIME; memcpy(action_frame->data, &buf[DOT11_MGMT_HDR_LEN], action_frame->len); - if (wl_cfgp2p_is_pub_action(action_frame->data, action_frame->len)) { - act_frm = (wifi_p2p_pub_act_frame_t *) (action_frame->data); - WL_DBG(("P2P PUB action_frame->len: %d chan %d category %d subtype %d\n", - action_frame->len, af_params->channel, - act_frm->category, act_frm->subtype)); - - if (act_frm->subtype == P2P_PAF_GON_REQ) { - WL_DBG(("P2P: GO_NEG_PHASE status set \n")); - wl_set_p2p_status(wl, GO_NEG_PHASE); - } else if (act_frm->subtype == P2P_PAF_GON_CONF) { - /* If we reached till GO Neg confirmation - * reset the filter - */ - WL_DBG(("P2P: GO_NEG_PHASE status cleared \n")); - wl_clr_p2p_status(wl, GO_NEG_PHASE); - } - - } else if (wl_cfgp2p_is_p2p_action(action_frame->data, action_frame->len)) { - p2p_act_frm = (wifi_p2p_action_frame_t *) (action_frame->data); - WL_DBG(("P2P action_frame->len: %d chan %d category %d subtype %d\n", - action_frame->len, af_params->channel, - p2p_act_frm->category, p2p_act_frm->subtype)); - } else if (wl_cfgp2p_is_gas_action(action_frame->data, action_frame->len)) { - sd_act_frm = (wifi_p2psd_gas_pub_act_frame_t *) (action_frame->data); - WL_DBG(("Service Discovery action_frame->len: %d chan %d category %d action %d\n", - action_frame->len, af_params->channel, - sd_act_frm->category, sd_act_frm->action)); - if (sd_act_frm) { - if (sd_act_frm->action == P2PSD_ACTION_ID_GAS_IREQ || - sd_act_frm->action == P2PSD_ACTION_ID_GAS_CREQ) { - af_params->dwell_time = WL_MED_DWELL_TIME; - /* save the next sd af action type to cancel - * the remained dwell time in rx process - */ - wl->next_af_subtype = sd_act_frm->action + 1; - wl_set_drv_status(wl, WAITING_NEXT_ACT_FRM, dev); - } else { - af_params->dwell_time = WL_MIN_DWELL_TIME; - wl->next_af_subtype = -1; - } - } - } - wl_cfgp2p_print_actframe(true, action_frame->data, action_frame->len); - - if (act_frm) { - /* - * To make sure to send successfully action frame, we have to turn off mpc - */ - if ((act_frm->subtype == P2P_PAF_GON_REQ) || - (act_frm->subtype == P2P_PAF_GON_RSP) || - (act_frm->subtype == P2P_PAF_GON_CONF) || - (act_frm->subtype == P2P_PAF_PROVDIS_REQ)) { - wldev_iovar_setint(dev, "mpc", 0); - } - - if (act_frm->subtype == P2P_PAF_DEVDIS_REQ) { - af_params->dwell_time = WL_LONG_DWELL_TIME; - } else if (act_frm->subtype == P2P_PAF_PROVDIS_REQ || - act_frm->subtype == P2P_PAF_PROVDIS_RSP || - act_frm->subtype == P2P_PAF_GON_REQ || - act_frm->subtype == P2P_PAF_GON_RSP || - act_frm->subtype == P2P_PAF_INVITE_REQ) { - af_params->dwell_time = WL_MED_DWELL_TIME; - } else { - af_params->dwell_time = WL_MIN_DWELL_TIME; - } - - - if (act_frm->subtype == P2P_PAF_GON_REQ) { - wl->afx_hdl->my_listen_chan = - wl_find_listen_channel(wl, act_frm->elts, action_frame->len); - } - - if (act_frm->subtype == P2P_PAF_PROVDIS_REQ || - act_frm->subtype == P2P_PAF_DEVDIS_REQ || - act_frm->subtype == P2P_PAF_INVITE_REQ || - act_frm->subtype == P2P_PAF_GON_REQ || - act_frm->subtype == P2P_PAF_GON_RSP) { -#ifdef WL_CFG80211_SYNC_GON - /* WAR: sometimes dongle does not keep the dwell time of 'actframe'. - *if is_waiting_more_time is set, it will check jiffies after sent af - */ - is_waiting_more_time = true; -#endif /* WL_CFG80211_SYNC_GON */ - - /* save the next pub af subtype to cancel the remained dwell time */ - if (act_frm->subtype == P2P_PAF_PROVDIS_RSP) - wl->next_af_subtype = P2P_PAF_GON_REQ; - else - wl->next_af_subtype = act_frm->subtype + 1; - - wl_set_drv_status(wl, WAITING_NEXT_ACT_FRM, dev); - wl->afx_hdl->peer_chan = WL_INVALID; - } else - wl->next_af_subtype = -1; - } - -#ifdef VSDB - /* if connecting, sleep for a while before sending af tx for VSDB */ - if (wl_get_drv_status(wl, CONNECTING, wl_to_prmry_ndev(wl))) { - msleep(50); - } -#endif - - /* if scanning, abort current scan. */ - if (wl_get_drv_status_all(wl, SCANNING)) { - /* wl_cfg80211_scan_abort(wl, dev); */ - wl_notify_escan_complete(wl, ndev, true, true); - } - - /* Set SENDING_ACT_FRM and destinatio address for sending af */ - wl_set_drv_status(wl, SENDING_ACT_FRM, dev); - memcpy(wl->afx_hdl->tx_dst_addr.octet, - af_params->action_frame.da.octet, - sizeof(wl->afx_hdl->tx_dst_addr.octet)); - - if (IS_P2P_SOCIAL(af_params->channel) && - (IS_P2P_PUB_ACT_REQ(act_frm, &act_frm->elts[0], action_frame->len) || - IS_GAS_REQ(sd_act_frm, action_frame->len)) && - wl_to_p2p_bss_saved_ie(wl, P2PAPI_BSSCFG_DEVICE).p2p_probe_req_ie_len) { - /* channel offload require P2P IE for Probe request - * otherwise, we will use wl_cfgp2p_tx_action_frame directly. - * channel offload for action request frame - */ - - /* channel offload for action request frame */ - ack = wl_cfg80211_send_at_common_channel(wl, dev, af_params); - } else { - ack = (wl_cfgp2p_tx_action_frame(wl, dev, af_params, bssidx)) ? false : true; - if (!ack) { - u32 max_retry = WL_CHANNEL_SYNC_RETRY; - - if (wl_to_p2p_bss_saved_ie(wl, P2PAPI_BSSCFG_DEVICE).p2p_probe_req_ie_len) { - /* if the NO ACK occurs, the peer device will be on - * listen channel of the peer - * So, we have to find the peer and send action frame on - * that channel. - */ - /* if public action response, the peer only wait for 100ms. - * do not sync channel - */ - if (act_frm && IS_P2P_SOCIAL(af_params->channel) && - !IS_P2P_PUB_ACT_RSP_SUBTYPE(act_frm->subtype)) { - ack = wl_cfg80211_send_at_common_channel(wl, dev, - af_params); - } else { - for (retry = 0; retry < max_retry; retry++) { - WL_AF_TX_KEEP_PRI_CONNECTION_VSDB(wl); - ack = (wl_cfgp2p_tx_action_frame(wl, dev, - af_params, bssidx)) ? false : true; - if (ack) - break; - } - } - } else { - for (retry = 0; retry < max_retry; retry++) { - WL_AF_TX_KEEP_PRI_CONNECTION_VSDB(wl); - ack = (wl_cfgp2p_tx_action_frame(wl, dev, - af_params, bssidx)) ? false : true; - if (ack) - break; - } - - } - - } - - } - - /* Clear SENDING_ACT_FRM after all sending af is done */ - wl_clr_drv_status(wl, SENDING_ACT_FRM, dev); - -#ifdef WL_CFG80211_SYNC_GON - /* WAR: sometimes dongle does not keep the dwell time of 'actframe'. - * if we coundn't get the next action response frame and dongle does not keep - * the dwell time, go to listen state again to get next action response frame. - */ - if (ack && is_waiting_more_time && - wl_get_drv_status_all(wl, WAITING_NEXT_ACT_FRM) && - wl->af_sent_channel == wl->afx_hdl->my_listen_chan) { - s32 extar_listen_time; - - extar_listen_time = af_params->dwell_time - - jiffies_to_msecs(jiffies - wl->af_tx_sent_jiffies); - - if (extar_listen_time > 50) { - wl_set_drv_status(wl, WAITING_NEXT_ACT_FRM_LISTEN, dev); - WL_DBG(("Wait more time! actual af time:%d," - "calculated extar listen:%d\n", - af_params->dwell_time, extar_listen_time)); - if (wl_cfgp2p_discover_listen(wl, wl->af_sent_channel, - extar_listen_time + 100) == BCME_OK) { - wait_for_completion_timeout(&wl->wait_next_af, - msecs_to_jiffies(extar_listen_time + 100 + 300)); - } - wl_clr_drv_status(wl, WAITING_NEXT_ACT_FRM_LISTEN, dev); - } - } -#endif /* WL_CFG80211_SYNC_GON */ - wl_clr_drv_status(wl, WAITING_NEXT_ACT_FRM, dev); - - WL_INFO(("-- sending Action Frame is %s, my listen chan: %d\n", - (ack) ? "Succeeded!!":"Failed!!", wl->afx_hdl->my_listen_chan)); + ack = wl_cfg80211_send_action_frame(wiphy, dev, ndev, af_params, + action_frame, action_frame->len, bssidx); cfg80211_mgmt_tx_status(ndev, *cookie, buf, len, ack, GFP_KERNEL); - if (ack && act_frm && act_frm->subtype == P2P_PAF_GON_CONF) { - wldev_iovar_setint(dev, "mpc", 1); - } + kfree(af_params); exit: return err; @@ -4782,6 +4816,8 @@ static s32 wl_cfg80211_bcn_set_params( } if (info->hidden_ssid) { + if ((err = wldev_iovar_setint(dev, "closednet", 1)) < 0) + WL_ERR(("failed to set hidden : %d\n", err)); WL_DBG(("hidden_ssid_enum_val: %d \n", info->hidden_ssid)); } @@ -5275,7 +5311,8 @@ wl_cfg80211_add_set_beacon(struct wiphy *wiphy, struct net_device *dev, } else { WL_DBG(("Applied Vndr IEs for Beacon \n")); } - if (wl_cfg80211_bcn_validate_sec(dev, &ies, dev_role, bssidx) < 0) + if (!wl_cfgp2p_bss_isup(dev, bssidx) && + (wl_cfg80211_bcn_validate_sec(dev, &ies, dev_role, bssidx) < 0)) { WL_ERR(("Beacon set security failed \n")); goto fail; @@ -5312,9 +5349,9 @@ wl_cfg80211_add_set_beacon(struct wiphy *wiphy, struct net_device *dev, } /* Enable Probe Req filter */ - if ((dev_role == NL80211_IFTYPE_P2P_GO) || - ((dev_role == NL80211_IFTYPE_AP) && (ies.wps_ie))) { - wl_validate_wps_ie((char *) ies.wps_ie, &pbc); + if (((dev_role == NL80211_IFTYPE_P2P_GO) || + (dev_role == NL80211_IFTYPE_AP)) && (ies.wps_ie != NULL)) { + wl_validate_wps_ie((char *) ies.wps_ie, ies.wps_ie_len, &pbc); if (pbc) wl_add_remove_eventmsg(dev, WLC_E_PROBREQ_MSG, true); } @@ -5487,7 +5524,7 @@ static s32 wl_inform_bss(struct wl_priv *wl) static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi) { - struct wiphy *wiphy = wiphy_from_scan(wl); + struct wiphy *wiphy = wl_to_wiphy(wl); struct ieee80211_mgmt *mgmt; struct ieee80211_channel *channel; struct ieee80211_supported_band *band; @@ -5859,7 +5896,7 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev, if (memcmp(curbssid, &e->addr, ETHER_ADDR_LEN) != 0) { WL_ERR(("BSSID of event is not the connected BSSID\n")); } -#endif +#endif /* ESCAN_RESULT_PATCH */ wl_clr_drv_status(wl, CONNECTED, ndev); if (! wl_get_drv_status(wl, DISCONNECTING, ndev)) { /* To make sure disconnect, explictly send dissassoc @@ -5882,8 +5919,8 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev, if ((memcmp(connect_req_bssid, broad_bssid, ETHER_ADDR_LEN) == 0) || (memcmp(&e->addr, broad_bssid, ETHER_ADDR_LEN) == 0) || (memcmp(&e->addr, connect_req_bssid, ETHER_ADDR_LEN) == 0)) - -#endif + /* In case this event comes while associating another AP */ +#endif /* ESCAN_RESULT_PATCH */ wl_bss_connect_done(wl, ndev, e, data, false); } wl_clr_drv_status(wl, DISCONNECTING, ndev); @@ -6172,7 +6209,7 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev, if (wl->scan_request) { wl_notify_escan_complete(wl, ndev, true, true); } -#endif +#endif /* ESCAN_RESULT_PATCH */ if (wl_get_drv_status(wl, CONNECTING, ndev)) { wl_clr_drv_status(wl, CONNECTING, ndev); if (completed) { @@ -6323,7 +6360,7 @@ wl_frame_get_mgmt(u16 fc, const struct ether_addr *da, } -static void +void wl_stop_wait_next_action_frame(struct wl_priv *wl, struct net_device *ndev) { if (wl_get_drv_status_all(wl, SENDING_ACT_FRM) && @@ -6991,7 +7028,7 @@ static s32 wl_notify_escan_complete(struct wl_priv *wl, dev = wl->scan_request->dev; } else { - WL_ERR(("wl->scan_request is NULL may be internal scan." + WL_DBG(("wl->scan_request is NULL may be internal scan." "doing scan_abort for ndev %p primary %p p2p_net %p", ndev, wl_to_prmry_ndev(wl), wl->p2p_net)); dev = ndev; @@ -7017,7 +7054,7 @@ static s32 wl_notify_escan_complete(struct wl_priv *wl, wl->bss_list = (wl_scan_results_t *)wl->escan_info.escan_buf; wl_inform_bss(wl); } -#endif +#endif /* ESCAN_RESULT_PATCH */ spin_lock_irqsave(&wl->cfgdrv_lock, flags); if (likely(wl->scan_request)) { cfg80211_scan_done(wl->scan_request, aborted); @@ -7400,7 +7437,7 @@ static s32 wl_notifier_change_state(struct wl_priv *wl, struct net_info *_net_in ((err = wldev_iovar_setint(iter->ndev, "roam_off", iter->roam_off)) == BCME_OK)) { iter->roam_off = WL_INVALID; - } else + } else if (err) WL_ERR((" failed to set roam_off : %d\n", err)); } } @@ -7671,14 +7708,15 @@ void wl_cfg80211_detach(void *para) wl_cfg80211_btcoex_deinit(wl); #endif -#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF) - wl_cfg80211_detach_p2p(); -#endif wl_setup_rfkill(wl, FALSE); if (wl->p2p_supported) { WL_ERR(("wl_cfgp2p_down() is not called yet\n")); wl_cfgp2p_down(wl); } + +#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF) + wl_cfg80211_detach_p2p(); +#endif wl_deinit_priv(wl); wlcfg_drv_priv = NULL; wl_cfg80211_clear_parent_dev(); diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.h b/drivers/net/wireless/bcmdhd/wl_cfg80211.h index dd975b1..38e52b2 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.h +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.h @@ -21,7 +21,7 @@ * 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_cfg80211.h 347625 2012-07-27 10:52:40Z $ + * $Id: wl_cfg80211.h 351262 2012-08-17 12:15:01Z $ */ #ifndef _wl_cfg80211_h_ @@ -52,6 +52,7 @@ struct wl_ibss; #define dtohchanspec(i) i #define WL_DBG_NONE 0 +#define WL_DBG_TRACE2 (1 << 5) #define WL_DBG_TRACE (1 << 4) #define WL_DBG_SCAN (1 << 3) #define WL_DBG_DBG (1 << 2) @@ -109,6 +110,16 @@ do { \ printk args; \ } \ } while (0) +#ifdef WL_TRACE2 +#undef WL_TRACE2 +#endif +#define WL_TRACE2(args) \ +do { \ + if (wl_dbg_level & WL_DBG_TRACE || wl_dbg_level & WL_DBG_TRACE2) { \ + printk(KERN_INFO "CFG80211-TRACE2) %s :", __func__); \ + printk args; \ + } \ +} while (0) #if (WL_DBG_LEVEL > 0) #define WL_DBG(args) \ do { \ @@ -141,7 +152,8 @@ do { \ #define WL_MIN_DWELL_TIME 100 #define WL_LONG_DWELL_TIME 1000 #define IFACE_MAX_CNT 2 -#define WL_SCAN_CONNECT_DWELL_TIME_MS 100 +#define WL_SCAN_CONNECT_DWELL_TIME_MS 150 +#define WL_AF_TX_MAX_RETRY 5 #define WL_SCAN_TIMER_INTERVAL_MS 8000 /* Scan timeout */ #define WL_CHANNEL_SYNC_RETRY 5 @@ -384,7 +396,7 @@ struct escan_info { u8 *escan_buf; #else u8 escan_buf[ESCAN_BUF_SIZE]; -#endif +#endif /* STATIC_WL_PRIV_STRUCT */ struct wiphy *wiphy; struct net_device *ndev; }; @@ -795,4 +807,5 @@ extern s32 wl_update_wiphybands(struct wl_priv *wl); extern s32 wl_cfg80211_if_is_group_owner(void); extern chanspec_t wl_ch_host_to_driver(u16 channel); extern s32 wl_add_remove_eventmsg(struct net_device *ndev, u16 event, bool add); +extern void wl_stop_wait_next_action_frame(struct wl_priv *wl, struct net_device *ndev); #endif /* _wl_cfg80211_h_ */ diff --git a/drivers/net/wireless/bcmdhd/wl_cfgp2p.c b/drivers/net/wireless/bcmdhd/wl_cfgp2p.c index 3884b11..3822dfa 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfgp2p.c +++ b/drivers/net/wireless/bcmdhd/wl_cfgp2p.c @@ -21,7 +21,7 @@ * 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_cfgp2p.c 347625 2012-07-27 10:52:40Z $ + * $Id: wl_cfgp2p.c 351262 2012-08-17 12:15:01Z $ * */ #include <typedefs.h> @@ -647,6 +647,8 @@ wl_cfgp2p_enable_discovery(struct wl_priv *wl, struct net_device *dev, const u8 *ie, u32 ie_len) { s32 ret = BCME_OK; + s32 bssidx = (wl_to_prmry_ndev(wl) == dev) ? + wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE) : wl_cfgp2p_find_idx(wl, dev); if (wl_get_p2p_status(wl, DISCOVERY_ON)) { CFGP2P_INFO((" DISCOVERY is already initialized, we have nothing to do\n")); goto set_ie; @@ -672,7 +674,7 @@ wl_cfgp2p_enable_discovery(struct wl_priv *wl, struct net_device *dev, } set_ie: ret = wl_cfgp2p_set_management_ie(wl, dev, - wl_cfgp2p_find_idx(wl, dev), + bssidx, VNDR_IE_PRBREQ_FLAG, ie, ie_len); if (unlikely(ret < 0)) { @@ -707,7 +709,9 @@ wl_cfgp2p_disable_discovery(struct wl_priv *wl) CFGP2P_ERR(("unable to set WL_P2P_DISC_ST_SCAN\n")); } - + /* Do a scan abort to stop the driver's scan engine in case it is still + * waiting out an action frame tx dwell time. + */ wl_clr_p2p_status(wl, DISCOVERY_ON); ret = wl_cfgp2p_deinit_discovery(wl); @@ -734,6 +738,7 @@ wl_cfgp2p_escan(struct wl_priv *wl, struct net_device *dev, u16 active, #define P2PAPI_SCAN_SOCIAL_DWELL_TIME_MS 40 #define P2PAPI_SCAN_HOME_TIME_MS 60 #define P2PAPI_SCAN_NPROBS_TIME_MS 30 +#define P2PAPI_SCAN_NPROBS_MIN_TIME_MS 20 #define P2PAPI_SCAN_AF_SEARCH_DWELL_TIME_MS 100 struct net_device *pri_dev = wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_PRIMARY); @@ -794,18 +799,30 @@ wl_cfgp2p_escan(struct wl_priv *wl, struct net_device *dev, u16 active, eparams->params.home_time = htod32(P2PAPI_SCAN_HOME_TIME_MS); - if (num_chans == SOCIAL_CHAN_CNT) + /* SOCIAL_CHAN_CNT + 1 takes care of the Progressive scan supported by + * the supplicant + */ + if ((num_chans == SOCIAL_CHAN_CNT) || (num_chans == SOCIAL_CHAN_CNT + 1)) eparams->params.active_time = htod32(P2PAPI_SCAN_SOCIAL_DWELL_TIME_MS); else if (num_chans == AF_PEER_SEARCH_CNT) eparams->params.active_time = htod32(P2PAPI_SCAN_AF_SEARCH_DWELL_TIME_MS); - else if (num_chans == 1) - eparams->params.active_time = htod32(WL_SCAN_CONNECT_DWELL_TIME_MS); else if (wl_get_drv_status_all(wl, CONNECTED)) eparams->params.active_time = -1; else eparams->params.active_time = htod32(P2PAPI_SCAN_DWELL_TIME_MS); eparams->params.nprobes = htod32((eparams->params.active_time / P2PAPI_SCAN_NPROBS_TIME_MS)); + + /* Override scan params to find a peer for a connection */ + if (num_chans == 1) { + eparams->params.active_time = htod32(WL_SCAN_CONNECT_DWELL_TIME_MS); + eparams->params.home_time = 0; + eparams->params.nprobes = eparams->params.active_time / + P2PAPI_SCAN_NPROBS_MIN_TIME_MS; + } + + if (eparams->params.nprobes <= 0) + eparams->params.nprobes = 1; CFGP2P_DBG(("nprobes # %d, active_time %d\n", eparams->params.nprobes, eparams->params.active_time)); eparams->params.passive_time = htod32(-1); @@ -902,59 +919,57 @@ wl_cfgp2p_parse_vndr_ies(u8 *parse, u32 len, { s32 err = BCME_OK; vndr_ie_t *vndrie; + bcm_tlv_t *ie; struct parsed_vndr_ie_info *parsed_info; u32 count = 0; s32 remained_len; - u8 *elt; - elt = parse; remained_len = (s32)len; memset(vndr_ies, 0, sizeof(*vndr_ies)); WL_INFO(("---> len %d\n", len)); + ie = (bcm_tlv_t *) parse; + if (!bcm_valid_tlv(ie, remained_len)) + ie = NULL; + while (ie) { + if (count >= MAX_VNDR_IE_NUMBER) + break; + if (ie->id == DOT11_MNG_VS_ID) { + vndrie = (vndr_ie_t *) ie; + /* len should be bigger than OUI length + one data length at least */ + if (vndrie->len < (VNDR_IE_MIN_LEN + 1)) { + CFGP2P_ERR(("%s: invalid vndr ie. length is too small %d\n", + __FUNCTION__, vndrie->len)); + goto end; + } + /* if wpa or wme ie, do not add ie */ + if (!bcmp(vndrie->oui, (u8*)WPA_OUI, WPA_OUI_LEN) && + ((vndrie->data[0] == WPA_OUI_TYPE) || + (vndrie->data[0] == WME_OUI_TYPE))) { + CFGP2P_DBG(("Found WPA/WME oui. Do not add it\n")); + goto end; + } - while (remained_len && count < MAX_VNDR_IE_NUMBER && - (vndrie = (vndr_ie_t *)bcm_parse_tlvs(elt, - remained_len, DOT11_MNG_VS_ID))) { - /* len should be bigger than OUI length + one data length at least */ - if (vndrie->len < (VNDR_IE_MIN_LEN + 1)) { - WL_ERR(("%s: invalid vndr ie. length is too small %d\n", - __FUNCTION__, vndrie->len)); - elt += (vndrie->len + TLV_HDR_LEN); - remained_len -= (vndrie->len + TLV_HDR_LEN); - continue; - } - - /* if wpa or wme ie, do not add ie */ - if (!bcmp(vndrie->oui, (u8*)WPA_OUI, WPA_OUI_LEN) && - ((vndrie->data[0] == WPA_OUI_TYPE) || - (vndrie->data[0] == WME_OUI_TYPE))) { - CFGP2P_DBG(("Found WPA/WME oui. Do not add it\n")); - elt += (vndrie->len + TLV_HDR_LEN); - remained_len -= (vndrie->len + TLV_HDR_LEN); - continue; - } - - parsed_info = &vndr_ies->ie_info[count++]; - - /* save vndr ie information */ - parsed_info->ie_ptr = (char *)vndrie; - parsed_info->ie_len = (vndrie->len + TLV_HDR_LEN); - memcpy(&parsed_info->vndrie, vndrie, sizeof(vndr_ie_t)); + parsed_info = &vndr_ies->ie_info[count++]; - vndr_ies->count = count; + /* save vndr ie information */ + parsed_info->ie_ptr = (char *)vndrie; + parsed_info->ie_len = (vndrie->len + TLV_HDR_LEN); + memcpy(&parsed_info->vndrie, vndrie, sizeof(vndr_ie_t)); - WL_INFO(("\t ** OUI %02x %02x %02x, type 0x%02x \n", - parsed_info->vndrie.oui[0], parsed_info->vndrie.oui[1], - parsed_info->vndrie.oui[2], parsed_info->vndrie.data[0])); + vndr_ies->count = count; - elt += (vndrie->len + TLV_HDR_LEN); - remained_len -= (vndrie->len + TLV_HDR_LEN); + CFGP2P_DBG(("\t ** OUI %02x %02x %02x, type 0x%02x \n", + parsed_info->vndrie.oui[0], parsed_info->vndrie.oui[1], + parsed_info->vndrie.oui[2], parsed_info->vndrie.data[0])); + } +end: + ie = bcm_next_tlv(ie, &remained_len); } - return err; } + /* Delete and Set a management vndr ie to firmware * Parameters: * @wl : wl_private data @@ -989,9 +1004,8 @@ wl_cfgp2p_set_management_ie(struct wl_priv *wl, struct net_device *ndev, s32 bss #define IE_TYPE_LEN(type, bsstype) (wl_to_p2p_bss_saved_ie(wl, bsstype).p2p_ ## type ## _ie_len) memset(g_mgmt_ie_buf, 0, sizeof(g_mgmt_ie_buf)); curr_ie_buf = g_mgmt_ie_buf; - if (p2p_is_on(wl) && bssidx != -1) { - if (bssidx == P2PAPI_BSSCFG_PRIMARY) - bssidx = wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE); + CFGP2P_DBG((" bssidx %d, pktflag : 0x%02X\n", bssidx, pktflag)); + if (wl->p2p != NULL) { switch (pktflag) { case VNDR_IE_PRBREQ_FLAG : mgmt_ie_buf = IE_TYPE(probe_req, bssidx); @@ -1043,7 +1057,7 @@ wl_cfgp2p_set_management_ie(struct wl_priv *wl, struct net_device *ndev, s32 bss return -1; } bssidx = 0; - } else if (bssidx == -1 && wl_get_mode_by_netdev(wl, ndev) == WL_MODE_BSS) { + } else if (wl_get_mode_by_netdev(wl, ndev) == WL_MODE_BSS) { switch (pktflag) { case VNDR_IE_PRBREQ_FLAG : mgmt_ie_buf = wl->sta_info->probe_req_ie; @@ -1376,7 +1390,12 @@ wl_cfgp2p_listen_complete(struct wl_priv *wl, struct net_device *ndev, const wl_event_msg_t *e, void *data) { s32 ret = BCME_OK; - struct net_device *netdev = wl_to_prmry_ndev(wl); + struct net_device *netdev; + if (wl->p2p_net == ndev) { + netdev = wl_to_prmry_ndev(wl); + } else { + netdev = ndev; + } CFGP2P_DBG((" Enter\n")); if (wl_get_p2p_status(wl, LISTEN_EXPIRED) == 0) { wl_set_p2p_status(wl, LISTEN_EXPIRED); @@ -1391,12 +1410,12 @@ wl_cfgp2p_listen_complete(struct wl_priv *wl, struct net_device *ndev, } #ifdef WL_CFG80211_SYNC_GON else if (wl_get_drv_status_all(wl, WAITING_NEXT_ACT_FRM_LISTEN)) { - wl_clr_drv_status(wl, WAITING_NEXT_ACT_FRM_LISTEN, ndev); + wl_clr_drv_status(wl, WAITING_NEXT_ACT_FRM_LISTEN, netdev); WL_DBG(("Listen DONE and wake up wait_next_af !!(%d)\n", jiffies_to_msecs(jiffies - wl->af_tx_sent_jiffies))); if (wl_get_drv_status_all(wl, WAITING_NEXT_ACT_FRM)) - wl_clr_drv_status(wl, WAITING_NEXT_ACT_FRM, ndev); + wl_clr_drv_status(wl, WAITING_NEXT_ACT_FRM, netdev); complete(&wl->wait_next_af); } @@ -1409,16 +1428,17 @@ wl_cfgp2p_listen_complete(struct wl_priv *wl, struct net_device *ndev, wl_get_drv_status_all(wl, FAKE_REMAINING_ON_CHANNEL)) { #endif /* WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */ WL_DBG(("Listen DONE for ramain on channel expired\n")); - wl_clr_drv_status(wl, REMAINING_ON_CHANNEL, ndev); + wl_clr_drv_status(wl, REMAINING_ON_CHANNEL, netdev); #ifdef WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST - wl_clr_drv_status(wl, FAKE_REMAINING_ON_CHANNEL, ndev); + wl_clr_drv_status(wl, FAKE_REMAINING_ON_CHANNEL, netdev); #endif /* WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */ if (ndev && (ndev->ieee80211_ptr != NULL)) { cfg80211_remain_on_channel_expired(ndev, wl->last_roc_id, &wl->remain_on_chan, wl->remain_on_chan_type, GFP_KERNEL); } } - if (wl_add_remove_eventmsg(netdev, WLC_E_P2P_PROBREQ_MSG, false) != BCME_OK) { + if (wl_add_remove_eventmsg(wl_to_prmry_ndev(wl), + WLC_E_P2P_PROBREQ_MSG, false) != BCME_OK) { CFGP2P_ERR((" failed to unset WLC_E_P2P_PROPREQ_MSG\n")); } } else @@ -1455,13 +1475,14 @@ wl_cfgp2p_cancel_listen(struct wl_priv *wl, struct net_device *ndev, /* Irrespective of whether timer is running or not, reset * the LISTEN state. */ - wl_cfgp2p_set_p2p_mode(wl, WL_P2P_DISC_ST_SCAN, 0, 0, - wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE)); if (timer_pending(&wl->p2p->listen_timer)) { del_timer_sync(&wl->p2p->listen_timer); if (notify) - cfg80211_remain_on_channel_expired(ndev, wl->last_roc_id, - &wl->remain_on_chan, wl->remain_on_chan_type, GFP_KERNEL); + if (ndev && ndev->ieee80211_ptr) { + cfg80211_remain_on_channel_expired(ndev, wl->last_roc_id, + &wl->remain_on_chan, wl->remain_on_chan_type, + GFP_KERNEL); + } } return 0; } @@ -1580,7 +1601,8 @@ wl_cfgp2p_action_tx_complete(struct wl_priv *wl, struct net_device *ndev, } else { wl_set_p2p_status(wl, ACTION_TX_NOACK); - CFGP2P_ERR(("WLC_E_ACTION_FRAME_COMPLETE : NO ACK\n")); + CFGP2P_INFO(("WLC_E_ACTION_FRAME_COMPLETE : NO ACK\n")); + wl_stop_wait_next_action_frame(wl, ndev); } } else { CFGP2P_INFO((" WLC_E_ACTION_FRAME_OFFCHAN_COMPLETE is received," diff --git a/drivers/net/wireless/bcmdhd/wldev_common.h b/drivers/net/wireless/bcmdhd/wldev_common.h index 49652af..f9bf425 100644 --- a/drivers/net/wireless/bcmdhd/wldev_common.h +++ b/drivers/net/wireless/bcmdhd/wldev_common.h @@ -85,8 +85,8 @@ s32 wldev_iovar_setint_bsscfg( extern void get_customized_country_code(char *country_iso_code, wl_country_t *cspec); extern void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec); -extern int wldev_set_country(struct net_device *dev, char *country_code); extern void dhd_bus_band_set(struct net_device *dev, uint band); +extern int wldev_set_country(struct net_device *dev, char *country_code); extern int net_os_wake_lock(struct net_device *dev); extern int net_os_wake_unlock(struct net_device *dev); extern int net_os_wake_lock_timeout(struct net_device *dev); |