Commit f10c5b0b authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: get rid on IS_CFG80211_FAVORITE macro

cfg80211 module is always favorite for the brcmfmac driver so the
macro is not needed to know the answer.
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f70a456a
...@@ -262,6 +262,10 @@ char nvram_path[MOD_PARAM_PATHLEN]; ...@@ -262,6 +262,10 @@ char nvram_path[MOD_PARAM_PATHLEN];
module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0); module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0);
module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0); module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
/* No firmware required */
bool dhd_no_fw_req;
module_param(dhd_no_fw_req, bool, 0);
/* Error bits */ /* Error bits */
module_param(dhd_msg_level, int, 0); module_param(dhd_msg_level, int, 0);
...@@ -339,10 +343,6 @@ module_param(dhd_idletime, int, 0); ...@@ -339,10 +343,6 @@ module_param(dhd_idletime, int, 0);
uint dhd_poll; uint dhd_poll;
module_param(dhd_poll, uint, 0); module_param(dhd_poll, uint, 0);
/* Use cfg80211 */
uint dhd_cfg80211 = true;
module_param(dhd_cfg80211, uint, 0);
/* Use interrupts */ /* Use interrupts */
uint dhd_intr = true; uint dhd_intr = true;
module_param(dhd_intr, uint, 0); module_param(dhd_intr, uint, 0);
...@@ -371,11 +371,6 @@ uint dhd_pktgen_len; ...@@ -371,11 +371,6 @@ uint dhd_pktgen_len;
module_param(dhd_pktgen_len, uint, 0); module_param(dhd_pktgen_len, uint, 0);
#endif #endif
#define FAVORITE_WIFI_CP (!!dhd_cfg80211)
#define IS_CFG80211_FAVORITE() FAVORITE_WIFI_CP
#define DBG_CFG80211_GET() ((dhd_cfg80211 & WL_DBG_MASK) >> 1)
#define NO_FW_REQ() (dhd_cfg80211 & 0x80)
/* Version string to report */ /* Version string to report */
#ifdef DHD_DEBUG #ifdef DHD_DEBUG
#define DHD_COMPILED "\nCompiled in " SRCBASE #define DHD_COMPILED "\nCompiled in " SRCBASE
...@@ -398,32 +393,6 @@ static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol); ...@@ -398,32 +393,6 @@ static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata, static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
wl_event_msg_t *event_ptr, void **data_ptr); wl_event_msg_t *event_ptr, void **data_ptr);
#if defined(CONFIG_PM_SLEEP)
static int dhd_sleep_pm_callback(struct notifier_block *nfb,
unsigned long action, void *ignored)
{
switch (action) {
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
atomic_set(&dhd_mmc_suspend, true);
return NOTIFY_OK;
case PM_POST_HIBERNATION:
case PM_POST_SUSPEND:
atomic_set(&dhd_mmc_suspend, false);
return NOTIFY_OK;
}
return 0;
}
static struct notifier_block dhd_sleep_pm_notifier = {
.notifier_call = dhd_sleep_pm_callback,
.priority = 0
};
extern int register_pm_notifier(struct notifier_block *nb);
extern int unregister_pm_notifier(struct notifier_block *nb);
#endif /* defined(CONFIG_PM_SLEEP) */
/* && defined(DHD_GPL) */
static void dhd_set_packet_filter(int value, dhd_pub_t *dhd) static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
{ {
#ifdef PKT_FILTER_SUPPORT #ifdef PKT_FILTER_SUPPORT
...@@ -1740,9 +1709,7 @@ static int dhd_stop(struct net_device *net) ...@@ -1740,9 +1709,7 @@ static int dhd_stop(struct net_device *net)
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net); dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
if (IS_CFG80211_FAVORITE()) { wl_cfg80211_down();
wl_cfg80211_down();
}
if (dhd->pub.up == 0) if (dhd->pub.up == 0)
return 0; return 0;
...@@ -1792,12 +1759,10 @@ static int dhd_open(struct net_device *net) ...@@ -1792,12 +1759,10 @@ static int dhd_open(struct net_device *net)
/* Allow transmit calls */ /* Allow transmit calls */
netif_start_queue(net); netif_start_queue(net);
dhd->pub.up = 1; dhd->pub.up = 1;
if (IS_CFG80211_FAVORITE()) { if (unlikely(wl_cfg80211_up())) {
if (unlikely(wl_cfg80211_up())) { DHD_ERROR(("%s: failed to bring up cfg80211\n",
DHD_ERROR(("%s: failed to bring up cfg80211\n", __func__));
__func__)); return -1;
return -1;
}
} }
return ret; return ret;
...@@ -1937,15 +1902,13 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen) ...@@ -1937,15 +1902,13 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
#endif /* defined(CONFIG_WIRELESS_EXT) */ #endif /* defined(CONFIG_WIRELESS_EXT) */
/* Attach and link in the cfg80211 */ /* Attach and link in the cfg80211 */
if (IS_CFG80211_FAVORITE()) { if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) { DHD_ERROR(("wl_cfg80211_attach failed\n"));
DHD_ERROR(("wl_cfg80211_attach failed\n")); goto fail;
goto fail; }
} if (!dhd_no_fw_req) {
if (!NO_FW_REQ()) { strcpy(fw_path, wl_cfg80211_get_fwname());
strcpy(fw_path, wl_cfg80211_get_fwname()); strcpy(nv_path, wl_cfg80211_get_nvramname());
strcpy(nv_path, wl_cfg80211_get_nvramname());
}
} }
/* Set up the watchdog timer */ /* Set up the watchdog timer */
...@@ -2011,8 +1974,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen) ...@@ -2011,8 +1974,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
#endif #endif
#if defined(CONFIG_PM_SLEEP) #if defined(CONFIG_PM_SLEEP)
atomic_set(&dhd_mmc_suspend, false); atomic_set(&dhd_mmc_suspend, false);
if (!IS_CFG80211_FAVORITE())
register_pm_notifier(&dhd_sleep_pm_notifier);
#endif /* defined(CONFIG_PM_SLEEP) */ #endif /* defined(CONFIG_PM_SLEEP) */
/* && defined(DHD_GPL) */ /* && defined(DHD_GPL) */
/* Init lock suspend to prevent kernel going to suspend */ /* Init lock suspend to prevent kernel going to suspend */
...@@ -2302,13 +2263,8 @@ void dhd_detach(dhd_pub_t *dhdp) ...@@ -2302,13 +2263,8 @@ void dhd_detach(dhd_pub_t *dhdp)
wl_iw_detach(); wl_iw_detach();
#endif /* (CONFIG_WIRELESS_EXT) */ #endif /* (CONFIG_WIRELESS_EXT) */
if (IS_CFG80211_FAVORITE()) wl_cfg80211_detach();
wl_cfg80211_detach();
#if defined(CONFIG_PM_SLEEP)
if (!IS_CFG80211_FAVORITE())
unregister_pm_notifier(&dhd_sleep_pm_notifier);
#endif /* defined(CONFIG_PM_SLEEP) */
/* && defined(DHD_GPL) */ /* && defined(DHD_GPL) */
free_netdev(ifp->net); free_netdev(ifp->net);
kfree(ifp); kfree(ifp);
...@@ -2509,7 +2465,7 @@ void *dhd_os_open_image(char *filename) ...@@ -2509,7 +2465,7 @@ void *dhd_os_open_image(char *filename)
{ {
struct file *fp; struct file *fp;
if (IS_CFG80211_FAVORITE() && !NO_FW_REQ()) if (!dhd_no_fw_req)
return wl_cfg80211_request_fw(filename); return wl_cfg80211_request_fw(filename);
fp = filp_open(filename, O_RDONLY, 0); fp = filp_open(filename, O_RDONLY, 0);
...@@ -2530,7 +2486,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image) ...@@ -2530,7 +2486,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image)
struct file *fp = (struct file *)image; struct file *fp = (struct file *)image;
int rdlen; int rdlen;
if (IS_CFG80211_FAVORITE() && !NO_FW_REQ()) if (!dhd_no_fw_req)
return wl_cfg80211_read_fw(buf, len); return wl_cfg80211_read_fw(buf, len);
if (!image) if (!image)
...@@ -2545,7 +2501,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image) ...@@ -2545,7 +2501,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image)
void dhd_os_close_image(void *image) void dhd_os_close_image(void *image)
{ {
if (IS_CFG80211_FAVORITE() && !NO_FW_REQ()) if (!dhd_no_fw_req)
return wl_cfg80211_release_fw(); return wl_cfg80211_release_fw();
if (image) if (image)
filp_close((struct file *)image, NULL); filp_close((struct file *)image, NULL);
...@@ -2587,26 +2543,10 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata, ...@@ -2587,26 +2543,10 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
if (bcmerror != 0) if (bcmerror != 0)
return bcmerror; return bcmerror;
#if defined(CONFIG_WIRELESS_EXT) ASSERT(dhd->iflist[*ifidx] != NULL);
if (!IS_CFG80211_FAVORITE()) { ASSERT(dhd->iflist[*ifidx]->net != NULL);
if ((dhd->iflist[*ifidx] == NULL) if (dhd->iflist[*ifidx]->net)
|| (dhd->iflist[*ifidx]->net == NULL)) { wl_cfg80211_event(dhd->iflist[*ifidx]->net, event, *data);
DHD_ERROR(("%s Exit null pointer\n", __func__));
return bcmerror;
}
if (dhd->iflist[*ifidx]->net)
wl_iw_event(dhd->iflist[*ifidx]->net, event, *data);
}
#endif /* defined(CONFIG_WIRELESS_EXT) */
if (IS_CFG80211_FAVORITE()) {
ASSERT(dhd->iflist[*ifidx] != NULL);
ASSERT(dhd->iflist[*ifidx]->net != NULL);
if (dhd->iflist[*ifidx]->net)
wl_cfg80211_event(dhd->iflist[*ifidx]->net, event,
*data);
}
return bcmerror; return bcmerror;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment