aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcmdhd/dhd_linux.c
diff options
context:
space:
mode:
authorAndrew Dodd <atd7@cornell.edu>2013-02-16 17:00:58 -0500
committerAndrew Dodd <atd7@cornell.edu>2013-02-27 09:19:14 -0500
commitd4f19c013807861e52b7721ac4de5914fcfc12c1 (patch)
tree3d79b21e5446d94068afc673958f8230d9bbeafb /drivers/net/wireless/bcmdhd/dhd_linux.c
parent5843001eb8e58acecf32f794189193eb82d963b7 (diff)
downloadkernel_samsung_smdk4412-d4f19c013807861e52b7721ac4de5914fcfc12c1.zip
kernel_samsung_smdk4412-d4f19c013807861e52b7721ac4de5914fcfc12c1.tar.gz
kernel_samsung_smdk4412-d4f19c013807861e52b7721ac4de5914fcfc12c1.tar.bz2
bcmdhd: kang from d2
Change-Id: I16a99ec34895212fecbafa13fdb714158b476dad
Diffstat (limited to 'drivers/net/wireless/bcmdhd/dhd_linux.c')
-rw-r--r--drivers/net/wireless/bcmdhd/dhd_linux.c224
1 files changed, 143 insertions, 81 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c
index ea31b93..8702a44 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 358099 2012-09-21 04:38:52Z $
+ * $Id: dhd_linux.c 358016 2012-09-20 22:36:51Z $
*/
#include <typedefs.h>
@@ -602,8 +602,8 @@ extern int register_pm_notifier(struct notifier_block *nb);
extern int unregister_pm_notifier(struct notifier_block *nb);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */
-#ifdef PKT_FILTER_SUPPORT
void dhd_set_packet_filter(dhd_pub_t *dhd)
+#ifdef PKT_FILTER_SUPPORT
{
int i;
@@ -613,20 +613,23 @@ void dhd_set_packet_filter(dhd_pub_t *dhd)
dhd_pktfilter_offload_set(dhd, dhd->pktfilter[i]);
}
}
+#endif
}
void dhd_enable_packet_filter(int value, dhd_pub_t *dhd)
{
+#ifdef PKT_FILTER_SUPPORT
int i;
DHD_TRACE(("%s: enter, value = %d\n", __FUNCTION__, value));
/* 1 - Enable packet filter, only allow unicast packet to send up */
/* 0 - Disable packet filter */
- if (dhd_pkt_filter_enable) {
+ if (dhd_pkt_filter_enable && (!value ||
+ (dhd_support_sta_mode(dhd) && !dhd->dhcp_in_progress))) {
for (i = 0; i < dhd->pktfilter_count; i++) {
#ifdef PASS_ARP_PACKET
if (value && (i == dhd->pktfilter_count -1) &&
- !(dhd->op_mode & (P2P_GC_ENABLED | P2P_GO_ENABLED))) {
+ !(dhd->op_mode & (DHD_FLAG_P2P_GC_MODE | DHD_FLAG_P2P_GO_MODE))) {
DHD_TRACE_HW4(("Do not turn on ARP white list pkt filter:"
"val %d, cnt %d, op_mode 0x%x\n",
value, i, dhd->op_mode));
@@ -637,8 +640,8 @@ void dhd_enable_packet_filter(int value, dhd_pub_t *dhd)
value, dhd_master_mode);
}
}
-}
#endif /* PKT_FILTER_SUPPORT */
+}
static int dhd_set_suspend(int value, dhd_pub_t *dhd)
{
@@ -670,7 +673,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
dhd->early_suspended = 1;
#endif
/* Kernel suspended */
- DHD_ERROR(("%s: force extra Suspend setting \n", __FUNCTION__));
+ DHD_ERROR(("%s: force extra Suspend setting\n", __FUNCTION__));
#ifndef SUPPORT_PM2_ONLY
dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char *)&power_mode,
@@ -716,7 +719,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
dhd->early_suspended = 0;
#endif
/* Kernel resumed */
- DHD_TRACE(("%s: Remove extra suspend setting \n", __FUNCTION__));
+ DHD_ERROR(("%s: Remove extra suspend setting\n", __FUNCTION__));
#ifndef SUPPORT_PM2_ONLY
power_mode = PM_FAST;
@@ -770,7 +773,7 @@ static int dhd_suspend_resume_helper(struct dhd_info *dhd, int val, int force)
/* Set flag when early suspend was called */
dhdp->in_suspend = val;
if ((force || !dhdp->suspend_disable_flag) &&
- (dhd_check_ap_wfd_mode_set(dhdp) == FALSE))
+ dhd_support_sta_mode(dhdp))
{
ret = dhd_set_suspend(val, dhdp);
}
@@ -1047,7 +1050,7 @@ _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
#ifdef MCAST_LIST_ACCUMULATION
DHD_TRACE(("_dhd_set_multicast_list: cnt "
"%d " MACDBG "\n",
- cnt_iface[i], STR_TO_MACD(ha->addr)));
+ cnt_iface[i], MAC2STRDBG(ha->addr)));
cnt_iface[i]--;
#else
cnt--;
@@ -1534,7 +1537,7 @@ dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, void *pktbuf)
}
else
/* non-proptxstatus way */
- ret = dhd_bus_txdata(dhdp->bus, pktbuf);
+ ret = dhd_bus_txdata(dhdp->bus, pktbuf);
#else
ret = dhd_bus_txdata(dhdp->bus, pktbuf);
#endif /* PROP_TXSTATUS */
@@ -1757,11 +1760,11 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
/* Dropping packets before registering net device to avoid kernel panic */
-#ifdef BCMDHDUSB
+#ifndef PROP_TXSTATUS_VSDB
if (!ifp->net || ifp->net->reg_state != NETREG_REGISTERED) {
#else
if (!ifp->net || ifp->net->reg_state != NETREG_REGISTERED || !dhd->pub.up) {
-#endif /* BCMDHDUSB */
+#endif /* PROP_TXSTATUS_VSDB */
DHD_ERROR(("%s: net device is NOT registered yet. drop packet\n",
__FUNCTION__));
PKTFREE(dhdp->osh, pktbuf, TRUE);
@@ -1794,10 +1797,10 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
*/
((athost_wl_status_info_t*)dhdp->wlfc_state)->stats.wlfc_header_only_pkt++;
#ifdef CUSTOMER_HW4
- if (numpkt == 1 && pkt_free && (free_ptr == pktbuf)) {
-/* DHD_ERROR(("DHD TRACE2(FREE):%d %d %p\n",
- pkt_free, caller, free_ptr)); */
- }
+ /*if (numpkt == 1 && pkt_free && (free_ptr == pktbuf)) {
+ DHD_ERROR(("DHD TRACE2(FREE):%d %d %p\n",
+ pkt_free, caller, free_ptr));
+ }*/
#endif
PKTFREE(dhdp->osh, pktbuf, TRUE);
continue;
@@ -1845,7 +1848,7 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
}
} else if (dump_data[0] & 1) {
DHD_ERROR(("%s: MULTICAST: " MACDBG "\n",
- __FUNCTION__, STR_TO_MACD(dump_data)));
+ __FUNCTION__, MAC2STRDBG(dump_data)));
}
if (protocol == ETHER_TYPE_802_1X) {
@@ -2741,7 +2744,9 @@ dhd_stop(struct net_device *net)
#endif
#ifdef PROP_TXSTATUS
+ dhd_os_wlfc_block(&dhd->pub);
dhd_wlfc_cleanup(&dhd->pub);
+ dhd_os_wlfc_unblock(&dhd->pub);
#endif
/* Stop the protocol module */
@@ -2810,7 +2815,6 @@ dhd_open(struct net_device *net)
nvram_path[0] = '\0';
}
-
dhd->pub.dongle_trap_occured = 0;
dhd->pub.hang_was_sent = 0;
#if !defined(WL_CFG80211)
@@ -3166,6 +3170,11 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
#ifdef PROP_TXSTATUS
spin_lock_init(&dhd->wlfc_spinlock);
+#ifdef PROP_TXSTATUS_VSDB
+ dhd->pub.wlfc_enabled = FALSE;
+#else
+ dhd->pub.wlfc_enabled = TRUE;
+#endif /* PROP_TXSTATUS_VSDB */
#endif /* PROP_TXSTATUS */
/* Initialize other structure content */
@@ -3478,18 +3487,37 @@ dhd_bus_start(dhd_pub_t *dhdp)
return 0;
}
+bool dhd_is_concurrent_mode(dhd_pub_t *dhd)
+{
+ if (!dhd)
+ return FALSE;
+
+ if (dhd->op_mode & DHD_FLAG_CONCURR_MULTI_CHAN_MODE)
+ return TRUE;
+ else if ((dhd->op_mode & DHD_FLAG_CONCURR_SINGLE_CHAN_MODE) ==
+ DHD_FLAG_CONCURR_SINGLE_CHAN_MODE)
+ return TRUE;
+ else
+ return FALSE;
+}
+
#if !defined(AP) && defined(WLP2P)
-/* For Android ICS MR2 release, the concurrent mode is enabled by default and the firmware
+/* From Android JerryBean release, the concurrent mode is enabled by default and the firmware
* name would be fw_bcmdhd.bin. So we need to determine whether P2P is enabled in the STA
* firmware and accordingly enable concurrent mode (Apply P2P settings). SoftAP firmware
* would still be named as fw_bcmdhd_apsta.
*/
-int
+uint32
dhd_get_concurrent_capabilites(dhd_pub_t *dhd)
{
- int ret = 0;
+ int32 ret = 0;
char buf[WLC_IOCTL_SMLEN];
- bool vsdb_supported = false;
+ bool mchan_supported = FALSE;
+ /* if dhd->op_mode is already set for HOSTAP,
+ * that means we only will use the mode as it is
+ */
+ if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE)
+ return 0;
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),
@@ -3499,7 +3527,7 @@ dhd_get_concurrent_capabilites(dhd_pub_t *dhd)
return 0;
}
if (strstr(buf, "vsdb")) {
- vsdb_supported = true;
+ mchan_supported = TRUE;
}
if (strstr(buf, "p2p") == NULL) {
DHD_TRACE(("Chip does not support p2p\n"));
@@ -3516,14 +3544,19 @@ dhd_get_concurrent_capabilites(dhd_pub_t *dhd)
}
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;
+ /* By default, chip supports single chan concurrency,
+ * now lets check for mchan
+ */
+ ret = DHD_FLAG_CONCURR_SINGLE_CHAN_MODE;
+ if (mchan_supported)
+ ret |= DHD_FLAG_CONCURR_MULTI_CHAN_MODE;
+#if defined(WL_ENABLE_P2P_IF)
+ /* For customer_hw4, although ICS,
+ * we still support concurrent mode
+ */
+ return ret;
#else
- return 0;
+ return 0;
#endif
}
}
@@ -3556,7 +3589,7 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#if defined(ARP_OFFLOAD_SUPPORT)
int arpoe = 1;
#endif
- int scan_assoc_time = DHD_SCAN_ACTIVE_TIME;
+ int scan_assoc_time = DHD_SCAN_ASSOC_ACTIVE_TIME;
int scan_unassoc_time = DHD_SCAN_UNASSOC_ACTIVE_TIME;
int scan_passive_time = DHD_SCAN_PASSIVE_TIME;
char buf[WLC_IOCTL_SMLEN];
@@ -3564,12 +3597,12 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
uint32 listen_interval = LISTEN_INTERVAL; /* Default Listen Interval in Beacons */
#ifdef ROAM_ENABLE
uint roamvar = 0;
- int roam_trigger[2] = {-75, WLC_BAND_ALL};
+ int roam_trigger[2] = {CUSTOM_ROAM_TRIGGER_SETTING, WLC_BAND_ALL};
int roam_scan_period[2] = {10, WLC_BAND_ALL};
- int roam_delta[2] = {10, WLC_BAND_ALL};
#ifdef ROAM_AP_ENV_DETECTION
int roam_env_mode = AP_ENV_INDETERMINATE;
#endif /* ROAM_AP_ENV_DETECTION */
+ int roam_delta[2] = {CUSTOM_ROAM_DELTA_SETTING, WLC_BAND_ALL};
#ifdef FULL_ROAMING_SCAN_PERIOD_60_SEC
int roam_fullscan_period = 60;
#else /* FULL_ROAMING_SCAN_PERIOD_60_SEC */
@@ -3609,8 +3642,12 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
int interference_mode = 3;
#endif
#ifdef PROP_TXSTATUS
+#ifdef PROP_TXSTATUS_VSDB
dhd->wlfc_enabled = FALSE;
/* enable WLFC only if the firmware is VSDB */
+#else
+ dhd->wlfc_enabled = TRUE;
+#endif /* PROP_TXSTATUS_VSDB */
#endif /* PROP_TXSTATUS */
DHD_TRACE(("Enter %s\n", __FUNCTION__));
dhd->op_mode = 0;
@@ -3643,11 +3680,12 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#endif /* GET_CUSTOM_MAC_ENABLE */
- if ((!op_mode && strstr(fw_path, "_apsta") != NULL) || (op_mode == HOSTAPD_MASK)) {
+ if ((!op_mode && strstr(fw_path, "_apsta") != NULL) ||
+ (op_mode == DHD_FLAG_HOSTAP_MODE)) {
#ifdef SET_RANDOM_MAC_SOFTAP
uint rand_mac;
#endif
- op_mode = HOSTAPD_MASK;
+ dhd->op_mode = DHD_FLAG_HOSTAP_MODE;
#if defined(ARP_OFFLOAD_SUPPORT)
arpoe = 0;
#endif
@@ -3682,31 +3720,33 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
}
else {
- int concurrent_capab = 0;
- if ((!op_mode && strstr(fw_path, "_p2p") != NULL) || (op_mode == WFD_MASK)) {
+ uint32 concurrent_mode = 0;
+ if ((!op_mode && strstr(fw_path, "_p2p") != NULL) ||
+ (op_mode == DHD_FLAG_P2P_MODE)) {
#if defined(ARP_OFFLOAD_SUPPORT)
arpoe = 0;
#endif
#ifdef PKT_FILTER_SUPPORT
dhd_pkt_filter_enable = FALSE;
#endif
- op_mode = WFD_MASK;
+ dhd->op_mode = DHD_FLAG_P2P_MODE;
}
else
- op_mode = STA_MASK;
+ dhd->op_mode = DHD_FLAG_STA_MODE;
#if !defined(AP) && defined(WLP2P)
- 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;
+ if ((concurrent_mode = dhd_get_concurrent_capabilites(dhd))) {
+#if defined(ARP_OFFLOAD_SUPPORT)
+ arpoe = 1;
+#endif
+ dhd->op_mode |= concurrent_mode;
}
/* Check if we are enabling p2p */
- if (op_mode & WFD_MASK) {
+ if (dhd->op_mode & DHD_FLAG_P2P_MODE) {
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));
+ DHD_ERROR(("%s APSTA for P2P failed ret= %d\n", __FUNCTION__, ret));
}
memcpy(&p2p_ea, &dhd->mac, ETHER_ADDR_LEN);
@@ -3721,15 +3761,14 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
}
}
#else
- (void)concurrent_capab;
-#endif
+ (void)concurrent_mode;
+#endif
}
- dhd->op_mode = op_mode;
- DHD_ERROR(("Firmware up: op_mode=%d, "
+ DHD_ERROR(("Firmware up: op_mode=0x%04x, "
"Broadcom Dongle Host Driver mac="MACDBG"\n",
dhd->op_mode,
- STR_TO_MACD(dhd->mac.octet)));
+ MAC2STRDBG(dhd->mac.octet)));
/* Set Country code */
if (dhd->dhd_cspec.ccode[0] != 0) {
bcm_mkiovar("country", (char *)&dhd->dhd_cspec,
@@ -3749,12 +3788,18 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
#endif /* ROAM_ENABLE || DISABLE_BUILTIN_ROAM */
#ifdef ROAM_ENABLE
- dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_TRIGGER, roam_trigger, sizeof(roam_trigger), TRUE, 0);
- dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_SCAN_PERIOD, roam_scan_period,
- sizeof(roam_scan_period), TRUE, 0);
- dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_DELTA, roam_delta, sizeof(roam_delta), TRUE, 0);
+ if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_TRIGGER, roam_trigger,
+ sizeof(roam_trigger), TRUE, 0)) < 0)
+ DHD_ERROR(("%s: roam trigger set failed %d\n", __FUNCTION__, ret));
+ if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_SCAN_PERIOD, roam_scan_period,
+ sizeof(roam_scan_period), TRUE, 0)) < 0)
+ DHD_ERROR(("%s: roam scan period set failed %d\n", __FUNCTION__, ret));
+ if ((dhd_wl_ioctl_cmd(dhd, WLC_SET_ROAM_DELTA, roam_delta,
+ sizeof(roam_delta), TRUE, 0)) < 0)
+ DHD_ERROR(("%s: roam delta set failed %d\n", __FUNCTION__, ret));
bcm_mkiovar("fullroamperiod", (char *)&roam_fullscan_period, 4, iovbuf, sizeof(iovbuf));
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
+ if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0)
+ DHD_ERROR(("%s: roam fullscan period set failed %d\n", __FUNCTION__, ret));
#ifdef ROAM_AP_ENV_DETECTION
if (roam_trigger[0] == WL_AUTO_ROAM_TRIGGER) {
bcm_mkiovar("roam_env_detection", (char *)&roam_env_mode,
@@ -3783,9 +3828,11 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
bcm_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf, sizeof(iovbuf));
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
- DHD_INFO(("%s set glom=0x%X\n", __FUNCTION__, glom));
- bcm_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
+ if (glom != DEFAULT_GLOM_VALUE) {
+ DHD_INFO(("%s set glom=0x%X\n", __FUNCTION__, glom));
+ bcm_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
+ dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
+ }
/* Setup timeout if Beacons are lost and roam is off to report link down */
bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, sizeof(iovbuf));
@@ -3819,7 +3866,7 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#if defined(SOFTAP)
if (ap_fw_loaded == FALSE)
#endif
- if ((dhd->op_mode & HOSTAPD_MASK) != HOSTAPD_MASK) {
+ if (!(dhd->op_mode & DHD_FLAG_HOSTAP_MODE)) {
if ((res = dhd_keep_alive_onoff(dhd)) < 0)
DHD_ERROR(("%s set keeplive failed %d\n",
__FUNCTION__, res));
@@ -3874,7 +3921,7 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#endif /* BCMCCX */
#ifdef WL_CFG80211
setbit(eventmask, WLC_E_ESCAN_RESULT);
- if ((dhd->op_mode & WFD_MASK) == WFD_MASK) {
+ if (dhd->op_mode & DHD_FLAG_P2P_MODE) {
setbit(eventmask, WLC_E_ACTION_FRAME_RX);
setbit(eventmask, WLC_E_ACTION_FRAME_COMPLETE);
setbit(eventmask, WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE);
@@ -4158,7 +4205,7 @@ static int dhd_device_event(struct notifier_block *this,
}
#ifdef AOE_IP_ALIAS_SUPPORT
- if ((dhd_pub->op_mode & HOSTAPD_MASK) != HOSTAPD_MASK) {
+ if (!(dhd_pub->op_mode & DHD_FLAG_HOSTAP_MODE)) {
if (ifa->ifa_label[strlen(ifa->ifa_label)-2] == 0x3a) {
/* 0x3a = ':' */
DHD_ARPOE(("%s:add aliased IP to AOE hostip cache\n",
@@ -4176,20 +4223,21 @@ static int dhd_device_event(struct notifier_block *this,
__FUNCTION__, ifa->ifa_label, ifa->ifa_address));
dhd->pend_ipaddr = 0;
#ifdef AOE_IP_ALIAS_SUPPORT
- if ((dhd_pub->op_mode & HOSTAPD_MASK) != HOSTAPD_MASK) {
- if (!(ifa->ifa_label[strlen(ifa->ifa_label)-2] == 0x3a)) {
- /* 0x3a = ':' */
- DHD_ARPOE(("%s: primary interface is down, AOE clr all\n",
- __FUNCTION__));
- dhd_aoe_hostip_clr(&dhd->pub);
- dhd_aoe_arp_clr(&dhd->pub);
- } else
- aoe_update_host_ipv4_table(dhd_pub, ifa->ifa_address, FALSE);
- }
+ if (!(dhd_pub->op_mode & DHD_FLAG_HOSTAP_MODE)) {
+ if (!(ifa->ifa_label[strlen(ifa->ifa_label)-2] == 0x3a)) {
+ /* 0x3a = ':' */
+ DHD_ARPOE(("%s: primary interface is down,"
+ " AOE clr all\n", __FUNCTION__));
+ dhd_aoe_hostip_clr(&dhd->pub);
+ dhd_aoe_arp_clr(&dhd->pub);
+ } else
+ aoe_update_host_ipv4_table(dhd_pub,
+ ifa->ifa_address, FALSE);
+ }
#else
dhd_aoe_hostip_clr(&dhd->pub);
dhd_aoe_arp_clr(&dhd->pub);
-#endif
+#endif /* AOE_IP_ALIAS_SUPPORT */
break;
default:
@@ -4287,9 +4335,9 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
" MAC: "MACDBG"\n",
net->name,
#if defined(CUSTOMER_HW4)
- STR_TO_MACD(dhd->pub.mac.octet));
+ MAC2STRDBG(dhd->pub.mac.octet));
#else
- STR_TO_MACD(net->dev_addr));
+ MAC2STRDBG(net->dev_addr));
#endif /* CUSTOMER_HW4 */
#if defined(SOFTAP) && defined(CONFIG_WIRELESS_EXT) && !defined(WL_CFG80211)
@@ -5149,6 +5197,9 @@ int net_os_set_suspend(struct net_device *dev, int val, int force)
#else
ret = dhd_suspend_resume_helper(dhd, val, force);
#endif
+#ifdef WL_CFG80211
+ wl_cfg80211_update_power_mode(dev);
+#endif
}
return ret;
}
@@ -5813,23 +5864,34 @@ extern int dhd_wlfc_FIFOcreditmap_update(void* state, uint8* credits);
int dhd_wlfc_interface_event(struct dhd_info *dhd,
ewlfc_mac_entry_action_t action, uint8 ifid, uint8 iftype, uint8* ea)
{
- if (dhd->pub.wlfc_state == NULL)
- return BCME_OK;
+ int ret = BCME_OK;
- return dhd_wlfc_interface_entry_update(dhd->pub.wlfc_state, action, ifid, iftype, ea);
+ dhd_os_wlfc_block(&dhd->pub);
+ if (dhd->pub.wlfc_state != NULL)
+ ret = dhd_wlfc_interface_entry_update(dhd->pub.wlfc_state, action, ifid, iftype, ea);
+ dhd_os_wlfc_unblock(&dhd->pub);
+ return ret;
}
int dhd_wlfc_FIFOcreditmap_event(struct dhd_info *dhd, uint8* event_data)
{
- if (dhd->pub.wlfc_state == NULL)
- return BCME_OK;
+ int ret = BCME_OK;
- return dhd_wlfc_FIFOcreditmap_update(dhd->pub.wlfc_state, event_data);
+ dhd_os_wlfc_block(&dhd->pub);
+ if (dhd->pub.wlfc_state != NULL)
+ ret = dhd_wlfc_FIFOcreditmap_update(dhd->pub.wlfc_state, event_data);
+ dhd_os_wlfc_unblock(&dhd->pub);
+ return ret;
}
int dhd_wlfc_event(struct dhd_info *dhd)
{
- return dhd_wlfc_enable(&dhd->pub);
+ int ret;
+
+ dhd_os_wlfc_block(&dhd->pub);
+ ret = dhd_wlfc_enable(&dhd->pub);
+ dhd_os_wlfc_unblock(&dhd->pub);
+ return ret;
}
#endif /* PROP_TXSTATUS */