From 3b00e5ad54dab4d0c20eb76425b8098964ac7670 Mon Sep 17 00:00:00 2001 From: "jiamin.miao" Date: Mon, 24 Feb 2014 16:41:55 +0800 Subject: [PATCH] PD#86917:fix compile error if POWER_OFF_IN_SUSPEND not define --- broadcm_40181/dhd_config.h | 2 ++ broadcm_40181/dhd_linux.c | 4 +++- broadcm_40181/dhd_sdio.c | 1 + broadcm_40181/wl_cfg80211.c | 12 +++++++++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/broadcm_40181/dhd_config.h b/broadcm_40181/dhd_config.h index 6cbd3c2..dcd6797 100755 --- a/broadcm_40181/dhd_config.h +++ b/broadcm_40181/dhd_config.h @@ -16,7 +16,9 @@ #define FW_PATH_AUTO_SELECT 1 extern char firmware_path[MOD_PARAM_PATHLEN]; extern int disable_proptx; +#ifdef POWER_OFF_IN_SUSPEND extern bool wifi_ready; +#endif /* channel list */ typedef struct wl_channel_list { diff --git a/broadcm_40181/dhd_linux.c b/broadcm_40181/dhd_linux.c index 771ccf0..5fb46d6 100755 --- a/broadcm_40181/dhd_linux.c +++ b/broadcm_40181/dhd_linux.c @@ -4017,6 +4017,8 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0); #endif /* defined(AP) && !defined(WLP2P) */ dhd_conf_set_bw(dhd); + dhd_conf_force_wme(dhd); + dhd_conf_set_stbc(dhd); #if defined(SOFTAP) if (ap_fw_loaded == TRUE) { @@ -4703,7 +4705,6 @@ void dhd_detach(dhd_pub_t *dhdp) if (dhdp->prot) dhd_prot_detach(dhdp); } - dhd_conf_detach(dhdp); #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND) if (dhd->dhd_state & DHD_ATTACH_STATE_EARLYSUSPEND_DONE) { @@ -4795,6 +4796,7 @@ void dhd_detach(dhd_pub_t *dhdp) dhd_monitor_uninit(); } #endif + dhd_conf_detach(dhdp); #ifdef PNO_SUPPORT if (dhdp->pno_state) diff --git a/broadcm_40181/dhd_sdio.c b/broadcm_40181/dhd_sdio.c index 6fe6718..731346b 100755 --- a/broadcm_40181/dhd_sdio.c +++ b/broadcm_40181/dhd_sdio.c @@ -8460,6 +8460,7 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag) /* Re-init bus, enable F2 transfer */ bcmerror = dhd_bus_init((dhd_pub_t *) bus->dhd, FALSE); if (bcmerror == BCME_OK) { + bcmsdh_set_drvdata(dhdp); // terence 20131214: fix for null pointer issue #if defined(OOB_INTR_ONLY) /* make sure oob intr get registered */ if (!bcmsdh_is_oob_intr_registered()) { diff --git a/broadcm_40181/wl_cfg80211.c b/broadcm_40181/wl_cfg80211.c index 88f944d..bdd4a94 100755 --- a/broadcm_40181/wl_cfg80211.c +++ b/broadcm_40181/wl_cfg80211.c @@ -610,6 +610,7 @@ static void wl_wakelock_timeout(struct wl_priv *priv) } +#ifdef POWER_OFF_IN_SUSPEND #define RETURN_EIO_IF_NOT_UP(wlpriv) \ do { \ struct net_device *checkSysUpNDev = wl_to_prmry_ndev(wlpriv); \ @@ -623,7 +624,16 @@ do { \ } \ wl_wakelock_timeout(wlpriv); \ } while (0) - +#else +#define RETURN_EIO_IF_NOT_UP(wlpriv) \ +do { \ + struct net_device *checkSysUpNDev = wl_to_prmry_ndev(wlpriv); \ + if (unlikely(!wl_get_drv_status(wlpriv, READY, checkSysUpNDev))) { \ + WL_INFO(("device is not ready\n")); \ + return -EIO; \ + } \ +} while (0) +#endif #define IS_WPA_AKM(akm) ((akm) == RSN_AKM_NONE || \ (akm) == RSN_AKM_UNSPECIFIED || \ -- 2.20.1