Skip to contentSkip to conversation

staging: brcm80211: more code cleanup and bug fixed

PATCH In review Franky Lin 9 participants 142 messages Jun 29, 2011 – Jul 6, 2011 Staging Page 2 of 3

lore
Share & tools
lore
author
#84 lore raw

PATCH 77/119 staging: brcm80211: move sdio related suspend/resume code to bus interface layer

In reply to Franky Lin

In fullmac some SDIO configurations should be done in suspend/resume routine. It was placed under pm ops in wl_cfg80211.c which is inappropriate. This patchs move them to sdio layer.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h      |    3 +
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |    8 ++++
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |    7 ---
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |   42 ++++++++++++++++++++
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |    7 ---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   |   14 +------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h   |    2 -
 7 files changed, 55 insertions(+), 28 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +3 -0
index 05600e0..f1d04e0 100644
@@ -111,4 +111,7 @@ extern int brcmf_sdioh_reset(struct sdioh_info *si);
 /* Helper function */
 void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
 
+/* Watchdog timer interface for pm ops */
+extern void brcmf_sdio_wdtmr_enable(bool enable);
+
 #endif				/* _sdio_api_h_ */
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +8 -0
index c4b74ab..d0be99f 100644
@@ -218,3 +218,11 @@ module_param(sd_msglevel, uint, 0);
 
 extern uint sd_f2_blocksize;
 module_param(sd_f2_blocksize, int, 0);
+
+void brcmf_sdio_wdtmr_enable(bool enable)
+{
+	if (enable)
+		brcmf_os_wd_timer(sdhcinfo->ch, brcmf_watchdog_ms);
+	else
+		brcmf_os_wd_timer(sdhcinfo->ch, 0);
+}
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -7
index c1de2cd..48527bb 100644
@@ -55,13 +55,6 @@ DHD_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
 int brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
 			     int regsize, u32 *data);
 
-void brcmf_sdioh_set_host_pm_flags(int flag)
-{
-	if (sdio_set_host_pm_flags(gInstance->func[1], flag))
-		printk(KERN_ERR "%s: Failed to set pm_flags 0x%08x\n",\
-			 __func__, (unsigned int)flag);
-}
-
 static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
 {
 	int err_ret;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +42 -0

53 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -7
index c3cbda6..6f351eb 100644
@@ -2382,13 +2382,6 @@ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
 	return pend;
 }
 
-void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick)
-{
-	dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev);
-
-	brcmf_os_wd_timer(&dhd->pub, wdtick);
-}
-
 #ifdef BCMDBG
 int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
 {
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +2 -12
index 1d80d75..a3c2e87 100644
@@ -36,8 +36,6 @@
 #include "dhd.h"
 #include "wl_cfg80211.h"
 
-void brcmf_sdioh_set_host_pm_flags(int flag);
-
 static struct sdio_func *cfg80211_sdio_func;
 static struct wl_dev *wl_cfg80211_dev;
 static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
@@ -2071,7 +2069,6 @@ done:
 static s32 wl_cfg80211_resume(struct wiphy *wiphy)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
-	struct net_device *ndev = wl_to_ndev(wl);
 
 	/*
 	 * Check for WL_STATUS_READY before any function call which
@@ -2084,11 +2081,8 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
 	atomic_set(&brcmf_mmc_suspend, false);
 #endif	/*  defined(CONFIG_PM_SLEEP) */
 
-	if (test_bit(WL_STATUS_READY, &wl->status)) {
-		/* Turn on Watchdog timer */
-		brcmf_netdev_os_wd_timer(ndev, brcmf_watchdog_ms);
+	if (test_bit(WL_STATUS_READY, &wl->status))
 		wl_invoke_iscan(wiphy_to_wl(wiphy));
-	}
 
 	WL_TRACE("Exit\n");
 	return 0;
@@ -2141,14 +2135,10 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
 	clear_bit(WL_STATUS_SCANNING, &wl->status);
 	clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
 
-	/* Inform SDIO stack not to switch off power to the chip */
-	brcmf_sdioh_set_host_pm_flags(MMC_PM_KEEP_POWER);
-
 	/* Turn off watchdog timer */
 	if (test_bit(WL_STATUS_READY, &wl->status)) {
-		WL_INFO("Terminate watchdog timer and enable MPC\n");
+		WL_INFO("Enable MPC\n");
 		wl_set_mpc(ndev, 1);
-		brcmf_netdev_os_wd_timer(ndev, 0);
 	}
 
 #if defined(CONFIG_PM_SLEEP)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +0 -2
index 6ad6b5b..bc7b4a3 100644
@@ -404,6 +404,4 @@ extern s8 *wl_cfg80211_get_fwname(void);	/* get firmware name for
 						 the dongle */
 extern s8 *wl_cfg80211_get_nvramname(void);	/* get nvram name for
 						 the dongle */
-extern void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick);
-
 #endif				/* _wl_cfg80211_h_ */
Signature · 1 line
1.7.1
author
#85 lore raw

PATCH 78/119 staging: brcm80211: move waitqueue code to dhd_sdio.c

In reply to Franky Lin

In fullmac waitqueue for tx control is used by bus interface layer only. So move the related code to dhd_sdio.c

---
 drivers/staging/brcm80211/brcmfmac/dhd.h       |    3 --
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   20 ------------------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c  |   26 ++++++++++++++++++++++-
 3 files changed, 24 insertions(+), 25 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -3
index 7e19d80..ffdee84 100644
@@ -963,9 +963,6 @@ extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
 extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
 extern int brcmf_bus_start(dhd_pub_t *dhdp);
 
-extern void brcmf_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
-extern void brcmf_wait_event_wakeup(dhd_pub_t *dhd);
-
 extern void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
 extern void brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg,
 					     int enable, int master_mode);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -20
index 6f351eb..6516cc6 100644
@@ -100,7 +100,6 @@ typedef struct dhd_info {
 	bool set_multicast;
 	bool set_macaddress;
 	u8 macvalue[ETH_ALEN];
-	wait_queue_head_t ctrl_wait;
 	atomic_t pend_8021x_cnt;
 
 #ifdef CONFIG_HAS_EARLYSUSPEND
@@ -1641,7 +1640,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	sema_init(&dhd->proto_sem, 1);
 	/* Initialize other structure content */
 	init_waitqueue_head(&dhd->ioctl_resp_wait);
-	init_waitqueue_head(&dhd->ctrl_wait);
 
 	/* Initialize the spinlocks */
 	spin_lock_init(&dhd->sdlock);
@@ -2255,24 +2253,6 @@ static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 	return bcmerror;
 }
 
-void brcmf_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
-{
-	struct dhd_info *dhdinfo = dhd->info;
-	brcmf_os_sdunlock(dhd);
-	wait_event_interruptible_timeout(dhdinfo->ctrl_wait,
-					 (*lockvar == false), HZ * 2);
-	brcmf_os_sdlock(dhd);
-	return;
-}
-
-void brcmf_wait_event_wakeup(dhd_pub_t *dhd)
-{
-	struct dhd_info *dhdinfo = dhd->info;
-	if (waitqueue_active(&dhdinfo->ctrl_wait))
-		wake_up_interruptible(&dhdinfo->ctrl_wait);
-	return;
-}
-
 int brcmf_netdev_reset(struct net_device *dev, u8 flag)
 {
 	dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +24 -2
index a97fd7c..ec2c744 100644
@@ -586,6 +586,7 @@ typedef struct dhd_bus {
 	bool ctrl_frame_stat;
 
 	spinlock_t txqlock;
+	wait_queue_head_t ctrl_wait;
 } dhd_bus_t;
 
 typedef volatile struct _sbconfig {
@@ -777,6 +778,8 @@ static void brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase);
 static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
 					u32 drivestrength);
 static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
+static void brcmf_sdbrcm_wait_for_event(dhd_pub_t *dhd, bool *lockvar);
+static void brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus);
 
 /* Packet free applicable unconditionally for sdio and sdspi.
  * Conditional if bufpool was present for gspi bus.
@@ -1501,7 +1504,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
 		bus->ctrl_frame_buf = frame;
 		bus->ctrl_frame_len = len;
 
-		brcmf_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
+		brcmf_sdbrcm_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
 
 		if (bus->ctrl_frame_stat == false) {
 			DHD_INFO(("%s: ctrl_frame_stat == false\n", __func__));
@@ -4577,7 +4580,7 @@ clkwait:
 
 		DHD_INFO(("Return_dpc value is : %d\n", ret));
 		bus->ctrl_frame_stat = false;
-		brcmf_wait_event_wakeup(bus->dhd);
+		brcmf_sdbrcm_wait_event_wakeup(bus);
 	}
 	/* Send queued frames (limit 1 if rx may still be pending) */
 	else if ((bus->clkstate == CLK_AVAIL) && !bus->fcstate &&
@@ -5213,6 +5216,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
 	}
 
 	spin_lock_init(&bus->txqlock);
+	init_waitqueue_head(&bus->ctrl_wait);
 
 	/* Attach to the dhd/OS/network interface */
 	bus->dhd = brcmf_attach(bus, SDPCM_RESERVE);
@@ -6317,3 +6321,21 @@ brcmf_sdbrcm_chip_detach(struct dhd_bus *bus)
 	kfree(bus->ci);
 	bus->ci = NULL;
 }
+
+static void
+brcmf_sdbrcm_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
+{
+	brcmf_os_sdunlock(dhd);
+	wait_event_interruptible_timeout(dhd->bus->ctrl_wait,
+					 (*lockvar == false), HZ * 2);
+	brcmf_os_sdlock(dhd);
+	return;
+}
+
+static void
+brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus)
+{
+	if (waitqueue_active(&bus->ctrl_wait))
+		wake_up_interruptible(&bus->ctrl_wait);
+	return;
+}
Signature · 1 line
1.7.1
author
#86 lore raw

PATCH 79/119 staging: brcm80211: move fullmac watchdog timer code to dhd_sdio.c

In reply to Franky Lin

The watchdog timer is used in bus interface layer in fullmac. Move related code to dhd_sdio.c for clean up.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    5 +-
 drivers/staging/brcm80211/brcmfmac/dhd.h          |    8 +-
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h      |    8 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c   |   16 --
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |  159 ------------------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |  184 ++++++++++++++++++++-
 6 files changed, 191 insertions(+), 189 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +3 -2
index d0be99f..ce8323c 100644
@@ -35,6 +35,7 @@ extern void brcmf_sdbrcm_isr(void *args);
 
 #include "dngl_stats.h"
 #include "dhd.h"
+#include "dhd_bus.h"
 
 /**
  * SDIO Host Controller info
@@ -222,7 +223,7 @@ module_param(sd_f2_blocksize, int, 0);
 void brcmf_sdio_wdtmr_enable(bool enable)
 {
 	if (enable)
-		brcmf_os_wd_timer(sdhcinfo->ch, brcmf_watchdog_ms);
+		brcmf_sdbrcm_wd_timer(sdhcinfo->ch, brcmf_watchdog_ms);
 	else
-		brcmf_os_wd_timer(sdhcinfo->ch, 0);
+		brcmf_sdbrcm_wd_timer(sdhcinfo->ch, 0);
 }
drivers/staging/brcm80211/brcmfmac/dhd.h +4 -4
index ffdee84..2c67df0 100644
@@ -773,9 +773,6 @@ extern atomic_t brcmf_mmc_suspend;
  * Insmod parameters for debug/test
  */
 
-/* Watchdog timer interval */
-extern uint brcmf_watchdog_ms;
-
 #if defined(BCMDBG)
 /* Console output poll interval */
 extern uint brcmf_console_ms;
@@ -818,6 +815,10 @@ extern uint brcmf_sdiod_drive_strength;
 /* Override to force tx queueing all the time */
 extern uint brcmf_force_tx_queueing;
 
+/* thread priority for watchdog and dpc */
+extern int brcmf_watchdog_prio;
+extern int brcmf_dpc_prio;
+
 #ifdef SDTEST
 /* Echo packet generator (SDIO), pkts/s */
 extern uint brcmf_pktgen;
@@ -923,7 +924,6 @@ extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
 extern void *brcmf_os_open_image(char *filename);
 extern int brcmf_os_get_image_block(char *buf, int len, void *image);
 extern void brcmf_os_close_image(void *image);
-extern void brcmf_os_wd_timer(void *bus, uint wdtick);
 extern void brcmf_os_sdlock(dhd_pub_t *pub);
 extern void brcmf_os_sdunlock(dhd_pub_t *pub);
 extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +5 -3
index 722dbb4..5bbe09d 100644
@@ -29,6 +29,9 @@
  * Exported from dhd bus module (dhd_usb, dhd_sdio)
  */
 
+/* Watchdog timer interval */
+extern uint brcmf_watchdog_ms;
+
 /* Indicate (dis)interest in finding dongles. */
 extern int dhd_bus_register(void);
 extern void dhd_bus_unregister(void);
@@ -55,9 +58,6 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
 extern int
 brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
 
-/* Watchdog timer function */
-extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhd);
-
 #ifdef BCMDBG
 /* Device console input function */
 extern int
@@ -91,4 +91,6 @@ extern void *dhd_bus_pub(struct dhd_bus *bus);
 extern void *dhd_bus_txq(struct dhd_bus *bus);
 extern uint dhd_bus_hdrlen(struct dhd_bus *bus);
 
+extern void brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick);
+
 #endif				/* _dhd_bus_h_ */
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -16
index 5207fa9..38a3502 100644
@@ -52,7 +52,6 @@ enum {
 	IOV_MSGLEVEL,
 	IOV_BCMERRORSTR,
 	IOV_BCMERROR,
-	IOV_WDTICK,
 	IOV_DUMP,
 #ifdef BCMDBG
 	IOV_CONS,
@@ -78,8 +77,6 @@ const struct brcmu_iovar brcmf_iovars[] = {
 	,
 	{"bcmerror", IOV_BCMERROR, 0, IOVT_INT8, 0}
 	,
-	{"wdtick", IOV_WDTICK, 0, IOVT_UINT32, 0}
-	,
 	{"dump", IOV_DUMP, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
 	,
 #ifdef BCMDBG
@@ -237,19 +234,6 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 		memcpy(arg, &int_val, val_size);
 		break;
 
-	case IOV_GVAL(IOV_WDTICK):
-		int_val = (s32) brcmf_watchdog_ms;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_WDTICK):
-		if (!dhd_pub->up) {
-			bcmerror = -ENOLINK;
-			break;
-		}
-		brcmf_os_wd_timer(dhd_pub, (uint) int_val);
-		break;
-
 	case IOV_GVAL(IOV_DUMP):
 		bcmerror = brcmf_c_dump(dhd_pub, arg, len);
 		break;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -159

238 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +179 -5

301 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#87 lore raw

PATCH 80/119 staging: brcm80211: move debug console related code to dhd_sdio.c

In reply to Franky Lin

Debug console functionality is provided by dhd_sdio.c. So the related variables and iovars should go there as well.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |    5 ---
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h    |    6 ----
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |   27 --------------------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |    6 ----
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |   31 ++++++++++++++++++++++-
 5 files changed, 30 insertions(+), 45 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -5
index 2c67df0..e7746f7 100644
@@ -773,11 +773,6 @@ extern atomic_t brcmf_mmc_suspend;
  * Insmod parameters for debug/test
  */
 
-#if defined(BCMDBG)
-/* Console output poll interval */
-extern uint brcmf_console_ms;
-#endif				/* defined(BCMDBG) */
-
 /* Use interrupts */
 extern uint brcmf_intr;
 
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +0 -6
index 5bbe09d..eab5cdd 100644
@@ -58,12 +58,6 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
 extern int
 brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
 
-#ifdef BCMDBG
-/* Device console input function */
-extern int
-brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
-#endif				/* BCMDBG */
-
 /* Deferred processing for the bus, return true requests reschedule */
 extern bool dhd_bus_dpc(struct dhd_bus *bus);
 extern void dhd_bus_isr(bool *InterruptRecognized,
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -27
index 38a3502..8a32e88 100644
@@ -53,10 +53,6 @@ enum {
 	IOV_BCMERRORSTR,
 	IOV_BCMERROR,
 	IOV_DUMP,
-#ifdef BCMDBG
-	IOV_CONS,
-	IOV_DCONSOLE_POLL,
-#endif
 	IOV_CLEARCOUNTS,
 	IOV_LOGDUMP,
 	IOV_LOGCAL,
@@ -79,12 +75,6 @@ const struct brcmu_iovar brcmf_iovars[] = {
 	,
 	{"dump", IOV_DUMP, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
 	,
-#ifdef BCMDBG
-	{"dconpoll", IOV_DCONSOLE_POLL, 0, IOVT_UINT32, 0}
-	,
-	{"cons", IOV_CONS, 0, IOVT_BUFFER, 0}
-	,
-#endif
 	{"clearcounts", IOV_CLEARCOUNTS, 0, IOVT_VOID, 0}
 	,
 	{"gpioob", IOV_GPIOOB, 0, IOVT_UINT32, 0}
@@ -238,23 +228,6 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 		bcmerror = brcmf_c_dump(dhd_pub, arg, len);
 		break;
 
-#ifdef BCMDBG
-	case IOV_GVAL(IOV_DCONSOLE_POLL):
-		int_val = (s32) brcmf_console_ms;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_DCONSOLE_POLL):
-		brcmf_console_ms = (uint) int_val;
-		break;
-
-	case IOV_SVAL(IOV_CONS):
-		if (len > 0)
-			bcmerror = brcmf_sdbrcm_bus_console_in(dhd_pub, arg,
-							       len - 1);
-		break;
-#endif
-
 	case IOV_SVAL(IOV_CLEARCOUNTS):
 		dhd_pub->tx_packets = dhd_pub->rx_packets = 0;
 		dhd_pub->tx_errors = dhd_pub->rx_errors = 0;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -6
index abd829d..8491b4e 100644
@@ -124,12 +124,6 @@ module_param(brcmf_msg_level, int, 0);
 uint brcmf_sysioc = true;
 module_param(brcmf_sysioc, uint, 0);
 
-#ifdef BCMDBG
-/* Console poll interval */
-uint brcmf_console_ms;
-module_param(brcmf_console_ms, uint, 0);
-#endif				/* BCMDBG */
-
 /* ARP offload agent mode : Enable ARP Host Auto-Reply
 and ARP Peer Auto-Reply */
 uint brcmf_arp_mode = 0xb;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +30 -1
index aeef2dc..b79e5cd 100644
@@ -659,6 +659,12 @@ module_param(brcmf_watchdog_prio, int, 0);
 uint brcmf_watchdog_ms = 10;
 module_param(brcmf_watchdog_ms, uint, 0);
 
+#ifdef BCMDBG
+/* Console poll interval */
+uint brcmf_console_ms;
+module_param(brcmf_console_ms, uint, 0);
+#endif		/* DHD_DEBUG */
+
 /* Tx/Rx bounds */
 uint brcmf_txbound;
 uint brcmf_rxbound;
@@ -757,6 +763,8 @@ static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start);
 #endif
 
 #ifdef BCMDBG
+static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
+				       uint msglen);
 static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size);
 static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus);
 #endif				/* BCMDBG  */
@@ -1665,6 +1673,8 @@ enum {
 	IOV_MEMSIZE,
 #ifdef BCMDBG
 	IOV_CHECKDIED,
+	IOV_CONS,
+	IOV_DCONSOLE_POLL,
 #endif
 	IOV_DOWNLOAD,
 	IOV_FORCEEVEN,
@@ -1710,6 +1720,10 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
 	{"devreset", IOV_DEVRESET, 0, IOVT_BOOL, 0},
 	{"wdtick", IOV_WDTICK, 0, IOVT_UINT32, 0},
 #ifdef BCMDBG
+	{"cons", IOV_CONS, 0, IOVT_BUFFER, 0}
+	,
+	{"dconpoll", IOV_DCONSOLE_POLL, 0, IOVT_UINT32, 0}
+	,
 	{"sdreg", IOV_SDREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
 	,
 	{"sbreg", IOV_SBREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
@@ -2559,6 +2573,21 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
 #endif				/* BCMDBG */
 
 #ifdef BCMDBG
+	case IOV_GVAL(IOV_DCONSOLE_POLL):
+		int_val = (s32) brcmf_console_ms;
+		memcpy(arg, &int_val, val_size);
+		break;
+
+	case IOV_SVAL(IOV_DCONSOLE_POLL):
+		brcmf_console_ms = (uint) int_val;
+		break;
+
+	case IOV_SVAL(IOV_CONS):
+		if (len > 0)
+			bcmerror = brcmf_sdbrcm_bus_console_in(bus->dhd,
+							       arg, len - 1);
+		break;
+
 	case IOV_GVAL(IOV_SDREG):
 		{
 			struct brcmf_sdreg *sd_ptr;
@@ -5100,7 +5129,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
 }
 
 #ifdef BCMDBG
-extern int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
+static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
 				       uint msglen)
 {
 	dhd_bus_t *bus = dhdp->bus;
Signature · 1 line
1.7.1
author
#88 lore raw

PATCH 81/119 staging: brcm80211: move dpc code to dhd_sdio.c

In reply to Franky Lin

Dpc thread handles data transaction which should be placed in bus interface layer. Move related code to dhd_sdio.c for clean up.

---
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h   |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |  113 ---------------------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c  |  128 +++++++++++++++++++++---
 3 files changed, 112 insertions(+), 131 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +0 -2
index eab5cdd..1038ddb 100644
@@ -58,8 +58,6 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
 extern int
 brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
 
-/* Deferred processing for the bus, return true requests reschedule */
-extern bool dhd_bus_dpc(struct dhd_bus *bus);
 extern void dhd_bus_isr(bool *InterruptRecognized,
 			bool *QueueMiniportHandleInterrupt, void *arg);
 
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -113

165 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +112 -16

203 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#89 lore raw

PATCH 82/119 staging: brcm80211: move sdio resource lock to dhd_sdio.c

In reply to Franky Lin

In fullmac the lock is for race condition for sdio interface. Move the code to dhd_sdio.c

---
 drivers/staging/brcm80211/brcmfmac/dhd.h       |    6 --
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   38 --------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c  |  109 +++++++++++++++---------
 3 files changed, 70 insertions(+), 83 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -6
index e7746f7..b11eeee 100644
@@ -810,10 +810,6 @@ extern uint brcmf_sdiod_drive_strength;
 /* Override to force tx queueing all the time */
 extern uint brcmf_force_tx_queueing;
 
-/* thread priority for watchdog and dpc */
-extern int brcmf_watchdog_prio;
-extern int brcmf_dpc_prio;
-
 #ifdef SDTEST
 /* Echo packet generator (SDIO), pkts/s */
 extern uint brcmf_pktgen;
@@ -919,8 +915,6 @@ extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
 extern void *brcmf_os_open_image(char *filename);
 extern int brcmf_os_get_image_block(char *buf, int len, void *image);
 extern void brcmf_os_close_image(void *image);
-extern void brcmf_os_sdlock(dhd_pub_t *pub);
-extern void brcmf_os_sdunlock(dhd_pub_t *pub);
 extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
 extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
 extern int brcmf_custom_get_mac_address(unsigned char *buf);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -38
index fac8302..2213e4e 100644
@@ -82,10 +82,6 @@ typedef struct dhd_info {
 
 	struct semaphore proto_sem;
 	wait_queue_head_t ioctl_resp_wait;
-	spinlock_t sdlock;
-	/* Thread based operation */
-	bool threads_only;
-	struct semaphore sdsem;
 
 	/* Thread to issue ioctl for multicast */
 	struct task_struct *sysioc_tsk;
@@ -1489,9 +1485,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	/* Initialize other structure content */
 	init_waitqueue_head(&dhd->ioctl_resp_wait);
 
-	/* Initialize the spinlocks */
-	spin_lock_init(&dhd->sdlock);
-
 	/* Link to info module */
 	dhd->pub.info = dhd;
 
@@ -1515,13 +1508,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 		strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
 	}
 
-	/* Initialize thread based operation and lock */
-	sema_init(&dhd->sdsem, 1);
-	if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0))
-		dhd->threads_only = true;
-	else
-		dhd->threads_only = false;
-
 	if (brcmf_sysioc) {
 		sema_init(&dhd->sysioc_sem, 0);
 		dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
@@ -1941,30 +1927,6 @@ void brcmf_os_close_image(void *image)
 		filp_close((struct file *)image, NULL);
 }
 
-void brcmf_os_sdlock(dhd_pub_t *pub)
-{
-	dhd_info_t *dhd;
-
-	dhd = (dhd_info_t *) (pub->info);
-
-	if (dhd->threads_only)
-		down(&dhd->sdsem);
-	else
-		spin_lock_bh(&dhd->sdlock);
-}
-
-void brcmf_os_sdunlock(dhd_pub_t *pub)
-{
-	dhd_info_t *dhd;
-
-	dhd = (dhd_info_t *) (pub->info);
-
-	if (dhd->threads_only)
-		up(&dhd->sdsem);
-	else
-		spin_unlock_bh(&dhd->sdlock);
-}
-
 static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 			    brcmf_event_msg_t *event, void **data)
 {
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +70 -39

305 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#90 lore raw

PATCH 83/119 staging: brcm80211: clean up firmware download code in fullmac

In reply to Franky Lin

In brcmfmac the firmware download related code scatter all around. And some old dead code which is not following the standard firmware routine is still present. This patch limits the firmware download related code only in dhd_sdio.c and removes the rest.

---
 drivers/staging/brcm80211/brcmfmac/bcmchip.h      |    3 +
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    2 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h |    2 +
 drivers/staging/brcm80211/brcmfmac/dhd.h          |    9 -
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h      |    8 -
 drivers/staging/brcm80211/brcmfmac/dhd_common.c   |   13 --
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |   84 +----------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |  180 ++++++++-------------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c  |  115 -------------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h  |   27 ---
 10 files changed, 77 insertions(+), 366 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmchip.h +3 -0
index 08729e1..d7d3afd 100644
@@ -25,5 +25,8 @@
 /* ARM Cortex M3 core, ID 0x82a */
 #define BCM4329_CORE_ARM_BASE		0x18002000
 #define BCM4329_RAMSIZE			0x48000
+/* firmware name */
+#define BCM4329_FW_NAME			"brcm/bcm4329-fullmac-4.bin"
+#define BCM4329_NV_NAME			"brcm/bcm4329-fullmac-4.txt"
 
 #endif				/* _bcmchip_h_ */
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -2
index 48527bb..764d839 100644
@@ -40,8 +40,6 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
 static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
 extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
 
-extern PBCMSDH_SDMMC_INSTANCE gInstance;
-
 uint sd_f2_blocksize = 512;	/* Default blocksize */
 
 uint sd_msglevel = 0x01;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +2 -0
index 1a6f68a..9c5eee0 100644
@@ -133,4 +133,6 @@ typedef struct _BCMSDH_SDMMC_INSTANCE {
 	u32 host_claimed;
 } BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE;
 
+extern PBCMSDH_SDMMC_INSTANCE gInstance;
+
 #endif				/* __BCMSDH_SDMMC_H__ */
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -9
index b11eeee..b2db6b9 100644
@@ -122,9 +122,6 @@
 #define WL_KF_RES_5	(1 << 5)	/* Reserved for backward compat */
 #define WL_IBSS_PEER_GROUP_KEY	(1 << 6)	/* Indicates a group key for a IBSS PEER */
 
-/* optionally set by a module_param_string() */
-#define MOD_PARAM_PATHLEN	2048
-
 /* For supporting multiple interfaces */
 #define DHD_MAX_IFS	16
 #define DHD_DEL_IF	-0xe
@@ -819,9 +816,6 @@ extern uint brcmf_pktgen_len;
 #define BRCMF_MAX_PKTGEN_LEN 1800
 #endif
 
-extern char brcmf_fw_path[MOD_PARAM_PATHLEN];
-extern char brcmf_nv_path[MOD_PARAM_PATHLEN];
-
 extern u32 g_assert_type;
 extern const bcmevent_name_t bcmevent_names[];
 extern const int bcmevent_names_size;
@@ -912,9 +906,6 @@ extern int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
 extern int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub);
 extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
 extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void *brcmf_os_open_image(char *filename);
-extern int brcmf_os_get_image_block(char *buf, int len, void *image);
-extern void brcmf_os_close_image(void *image);
 extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
 extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
 extern int brcmf_custom_get_mac_address(unsigned char *buf);
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +0 -8
index 1038ddb..c895b81 100644
@@ -36,10 +36,6 @@ extern uint brcmf_watchdog_ms;
 extern int dhd_bus_register(void);
 extern void dhd_bus_unregister(void);
 
-/* Download firmware image and nvram image */
-extern bool dhd_bus_download_firmware(struct dhd_bus *bus,
-				      char *fw_path, char *nv_path);
-
 /* Stop bus module: clear pending frames, disable data flow */
 extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
 
@@ -75,10 +71,6 @@ extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
 /* return the dongle chipid */
 extern uint dhd_bus_chip(struct dhd_bus *bus);
 
-/* Set user-specified nvram parameters. */
-extern void dhd_bus_set_nvram_params(struct dhd_bus *bus,
-				     const char *nvram_params);
-
 extern void *dhd_bus_pub(struct dhd_bus *bus);
 extern void *dhd_bus_txq(struct dhd_bus *bus);
 extern uint dhd_bus_hdrlen(struct dhd_bus *bus);
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -13
index 8a32e88..44b8a25 100644
@@ -33,8 +33,6 @@
 #define PKTFILTER_BUF_SIZE		2048
 
 int brcmf_msg_level;
-char brcmf_fw_path[MOD_PARAM_PATHLEN];
-char brcmf_nv_path[MOD_PARAM_PATHLEN];
 
 #define MSGTRACE_VERSION	1
 
@@ -111,17 +109,6 @@ void brcmf_c_init(void)
 	 * initializations.
 	 */
 	brcmf_msg_level = DHD_ERROR_VAL;
-#ifdef CONFIG_BCM4329_FW_PATH
-	strncpy(brcmf_fw_path, CONFIG_BCM4329_FW_PATH, MOD_PARAM_PATHLEN - 1);
-#else
-	brcmf_fw_path[0] = '\0';
-#endif
-#ifdef CONFIG_BCM4329_NVRAM_PATH
-	strncpy(brcmf_nv_path,
-		CONFIG_BCM4329_NVRAM_PATH, MOD_PARAM_PATHLEN - 1);
-#else
-	brcmf_nv_path[0] = '\0';
-#endif
 }
 
 static int brcmf_c_dump(dhd_pub_t *dhdp, char *buf, int buflen)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +2 -82

126 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +70 -110

317 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +0 -115

163 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +0 -27
index bc7b4a3..7848b3c 100644
@@ -116,7 +116,6 @@ do {								\
 #define WL_AP_MAX	256	/* virtually unlimitted as long
 				 * as kernel memory allows
 				 */
-#define WL_FILE_NAME_MAX		256
 
 #define WL_ROAM_TRIGGER_LEVEL		-75
 #define WL_ROAM_DELTA			20
@@ -161,12 +160,6 @@ enum wl_iscan_state {
 	WL_ISCAN_STATE_SCANING
 };
 
-/* fw downloading status */
-enum wl_fw_status {
-	WL_FW_LOADING_DONE,
-	WL_NVRAM_LOADING_DONE
-};
-
 /* beacon / probe_response */
 struct beacon_proberesp {
 	__le64 timestamp;
@@ -288,15 +281,6 @@ struct wl_connect_info {
 	s32 resp_ie_len;
 };
 
-/* firmware /nvram downloading controller */
-struct wl_fw_ctrl {
-	const struct firmware *fw_entry;
-	unsigned long status;
-	u32 ptr;
-	s8 fw_name[WL_FILE_NAME_MAX];
-	s8 nvram_name[WL_FILE_NAME_MAX];
-};
-
 /* assoc ie length */
 struct wl_assoc_ielen {
 	u32 req_len;
@@ -334,8 +318,6 @@ struct wl_priv {
 	struct wl_iscan_ctrl *iscan;	/* iscan controller */
 	struct wl_connect_info conn_info;	/* association information
 						 container */
-	struct wl_fw_ctrl *fw;	/* control firwmare / nvram paramter
-				 downloading */
 	struct wl_pmk_list *pmk_list;	/* wpa2 pmk list */
 	struct task_struct *event_tsk;	/* task of main event handler thread */
 	unsigned long status;		/* current dongle status */
@@ -395,13 +377,4 @@ extern s32 wl_cfg80211_up(void);	/* dongle up */
 extern s32 wl_cfg80211_down(void);	/* dongle down */
 extern void wl_cfg80211_dbg_level(u32 level);	/* set dongle
 							 debugging level */
-extern void *wl_cfg80211_request_fw(s8 *file_name);	/* request fw /nvram
-							 downloading */
-extern s32 wl_cfg80211_read_fw(s8 *buf, u32 size);	/* read fw
-								 image */
-extern void wl_cfg80211_release_fw(void);	/* release fw */
-extern s8 *wl_cfg80211_get_fwname(void);	/* get firmware name for
-						 the dongle */
-extern s8 *wl_cfg80211_get_nvramname(void);	/* get nvram name for
-						 the dongle */
 #endif				/* _wl_cfg80211_h_ */
Signature · 1 line
1.7.1
author
#91 lore raw

PATCH 84/119 staging: brcm80211: rename function variables

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The fullmac driver uses dhd as variable name for the driver instance in a number of functions. This has been changed to a more generic name as the dhd is not meaningful (broadcom internal name).

---
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |  172 +++---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |  713 ++++++++++++-----------
 2 files changed, 447 insertions(+), 438 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +86 -86
index 44b8a25..244ea72 100644
@@ -111,7 +111,7 @@ void brcmf_c_init(void)
 	brcmf_msg_level = DHD_ERROR_VAL;
 }
 
-static int brcmf_c_dump(dhd_pub_t *dhdp, char *buf, int buflen)
+static int brcmf_c_dump(dhd_pub_t *drvr, char *buf, int buflen)
 {
 	struct brcmu_strbuf b;
 	struct brcmu_strbuf *strbuf = &b;
@@ -122,54 +122,54 @@ static int brcmf_c_dump(dhd_pub_t *dhdp, char *buf, int buflen)
 	brcmu_bprintf(strbuf, "%s\n", brcmf_version);
 	brcmu_bprintf(strbuf, "\n");
 	brcmu_bprintf(strbuf, "pub.up %d pub.txoff %d pub.busstate %d\n",
-		    dhdp->up, dhdp->txoff, dhdp->busstate);
+		    drvr->up, drvr->txoff, drvr->busstate);
 	brcmu_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n",
-		    dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz);
+		    drvr->hdrlen, drvr->maxctl, drvr->rxsz);
 	brcmu_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %pM\n",
-		    dhdp->iswl, dhdp->drv_version, &dhdp->mac);
-	brcmu_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror,
-		    dhdp->tickcnt);
+		    drvr->iswl, drvr->drv_version, &drvr->mac);
+	brcmu_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", drvr->bcmerror,
+		    drvr->tickcnt);
 
 	brcmu_bprintf(strbuf, "dongle stats:\n");
 	brcmu_bprintf(strbuf,
 		    "tx_packets %ld tx_bytes %ld tx_errors %ld tx_dropped %ld\n",
-		    dhdp->dstats.tx_packets, dhdp->dstats.tx_bytes,
-		    dhdp->dstats.tx_errors, dhdp->dstats.tx_dropped);
+		    drvr->dstats.tx_packets, drvr->dstats.tx_bytes,
+		    drvr->dstats.tx_errors, drvr->dstats.tx_dropped);
 	brcmu_bprintf(strbuf,
 		    "rx_packets %ld rx_bytes %ld rx_errors %ld rx_dropped %ld\n",
-		    dhdp->dstats.rx_packets, dhdp->dstats.rx_bytes,
-		    dhdp->dstats.rx_errors, dhdp->dstats.rx_dropped);
-	brcmu_bprintf(strbuf, "multicast %ld\n", dhdp->dstats.multicast);
+		    drvr->dstats.rx_packets, drvr->dstats.rx_bytes,
+		    drvr->dstats.rx_errors, drvr->dstats.rx_dropped);
+	brcmu_bprintf(strbuf, "multicast %ld\n", drvr->dstats.multicast);
 
 	brcmu_bprintf(strbuf, "bus stats:\n");
 	brcmu_bprintf(strbuf, "tx_packets %ld tx_multicast %ld tx_errors %ld\n",
-		    dhdp->tx_packets, dhdp->tx_multicast, dhdp->tx_errors);
+		    drvr->tx_packets, drvr->tx_multicast, drvr->tx_errors);
 	brcmu_bprintf(strbuf, "tx_ctlpkts %ld tx_ctlerrs %ld\n",
-		    dhdp->tx_ctlpkts, dhdp->tx_ctlerrs);
+		    drvr->tx_ctlpkts, drvr->tx_ctlerrs);
 	brcmu_bprintf(strbuf, "rx_packets %ld rx_multicast %ld rx_errors %ld\n",
-		    dhdp->rx_packets, dhdp->rx_multicast, dhdp->rx_errors);
+		    drvr->rx_packets, drvr->rx_multicast, drvr->rx_errors);
 	brcmu_bprintf(strbuf,
 		    "rx_ctlpkts %ld rx_ctlerrs %ld rx_dropped %ld rx_flushed %ld\n",
-		    dhdp->rx_ctlpkts, dhdp->rx_ctlerrs, dhdp->rx_dropped,
-		    dhdp->rx_flushed);
+		    drvr->rx_ctlpkts, drvr->rx_ctlerrs, drvr->rx_dropped,
+		    drvr->rx_flushed);
 	brcmu_bprintf(strbuf,
 		    "rx_readahead_cnt %ld tx_realloc %ld fc_packets %ld\n",
-		    dhdp->rx_readahead_cnt, dhdp->tx_realloc, dhdp->fc_packets);
-	brcmu_bprintf(strbuf, "wd_dpc_sched %ld\n", dhdp->wd_dpc_sched);
+		    drvr->rx_readahead_cnt, drvr->tx_realloc, drvr->fc_packets);
+	brcmu_bprintf(strbuf, "wd_dpc_sched %ld\n", drvr->wd_dpc_sched);
 	brcmu_bprintf(strbuf, "\n");
 
 	/* Add any prot info */
-	brcmf_proto_dump(dhdp, strbuf);
+	brcmf_proto_dump(drvr, strbuf);
 	brcmu_bprintf(strbuf, "\n");
 
 	/* Add any bus info */
-	brcmf_sdbrcm_bus_dump(dhdp, strbuf);
+	brcmf_sdbrcm_bus_dump(drvr, strbuf);
 
 	return !strbuf->size ? -EOVERFLOW : 0;
 }
 
 static int
-brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
+brcmf_c_doiovar(dhd_pub_t *drvr, const struct brcmu_iovar *vi, u32 actionid,
 	    const char *name, void *params, int plen, void *arg, int len,
 	    int val_size)
 {
@@ -207,25 +207,25 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 		break;
 
 	case IOV_GVAL(IOV_BCMERROR):
-		int_val = (s32) dhd_pub->bcmerror;
+		int_val = (s32) drvr->bcmerror;
 		memcpy(arg, &int_val, val_size);
 		break;
 
 	case IOV_GVAL(IOV_DUMP):
-		bcmerror = brcmf_c_dump(dhd_pub, arg, len);
+		bcmerror = brcmf_c_dump(drvr, arg, len);
 		break;
 
 	case IOV_SVAL(IOV_CLEARCOUNTS):
-		dhd_pub->tx_packets = dhd_pub->rx_packets = 0;
-		dhd_pub->tx_errors = dhd_pub->rx_errors = 0;
-		dhd_pub->tx_ctlpkts = dhd_pub->rx_ctlpkts = 0;
-		dhd_pub->tx_ctlerrs = dhd_pub->rx_ctlerrs = 0;
-		dhd_pub->rx_dropped = 0;
-		dhd_pub->rx_readahead_cnt = 0;
-		dhd_pub->tx_realloc = 0;
-		dhd_pub->wd_dpc_sched = 0;
-		memset(&dhd_pub->dstats, 0, sizeof(dhd_pub->dstats));
-		dhd_bus_clearcounts(dhd_pub);
+		drvr->tx_packets = drvr->rx_packets = 0;
+		drvr->tx_errors = drvr->rx_errors = 0;
+		drvr->tx_ctlpkts = drvr->rx_ctlpkts = 0;
+		drvr->tx_ctlerrs = drvr->rx_ctlerrs = 0;
+		drvr->rx_dropped = 0;
+		drvr->rx_readahead_cnt = 0;
+		drvr->tx_realloc = 0;
+		drvr->wd_dpc_sched = 0;
+		memset(&drvr->dstats, 0, sizeof(drvr->dstats));
+		dhd_bus_clearcounts(drvr);
 		break;
 
 	case IOV_GVAL(IOV_IOCTLTIMEOUT):{
@@ -252,7 +252,7 @@ exit:
 	return bcmerror;
 }
 
-bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
+bool brcmf_c_prec_enq(dhd_pub_t *drvr, struct pktq *q, struct sk_buff *pkt,
 		  int prec)
 {
 	struct sk_buff *p;
@@ -281,7 +281,7 @@ bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
 	if (eprec >= 0) {
 		/* Detect queueing to unconfigured precedence */
 		ASSERT(!pktq_pempty(q, eprec));
-		discard_oldest = AC_BITMAP_TST(dhdp->wme_dp, eprec);
+		discard_oldest = AC_BITMAP_TST(drvr->wme_dp, eprec);
 		if (eprec == prec && !discard_oldest)
 			return false;	/* refuse newer (incoming) packet */
 		/* Evict packet according to discard policy */
@@ -307,7 +307,7 @@ bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
 }
 
 static int
-brcmf_c_iovar_op(dhd_pub_t *dhd_pub, const char *name,
+brcmf_c_iovar_op(dhd_pub_t *drvr, const char *name,
 	     void *params, int plen, void *arg, int len, bool set)
 {
 	int bcmerror = 0;
@@ -353,14 +353,14 @@ brcmf_c_iovar_op(dhd_pub_t *dhd_pub, const char *name,
 
 	actionid = set ? IOV_SVAL(vi->varid) : IOV_GVAL(vi->varid);
 	bcmerror =
-	    brcmf_c_doiovar(dhd_pub, vi, actionid, name, params, plen, arg, len,
+	    brcmf_c_doiovar(drvr, vi, actionid, name, params, plen, arg, len,
 			val_size);
 
 exit:
 	return bcmerror;
 }
 
-int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
+int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
 {
 	int bcmerror = 0;
 
@@ -404,23 +404,23 @@ int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
 
 			/* call with the appropriate arguments */
 			if (ioc->cmd == DHD_GET_VAR)
-				bcmerror = brcmf_c_iovar_op(dhd_pub, buf, arg,
+				bcmerror = brcmf_c_iovar_op(drvr, buf, arg,
 						arglen, buf, buflen, IOV_GET);
 			else
 				bcmerror =
-				    brcmf_c_iovar_op(dhd_pub, buf, NULL, 0, arg,
+				    brcmf_c_iovar_op(drvr, buf, NULL, 0, arg,
 						     arglen, IOV_SET);
 			if (bcmerror != -ENOTSUPP)
 				break;
 
 			/* not in generic table, try protocol module */
 			if (ioc->cmd == DHD_GET_VAR)
-				bcmerror = brcmf_proto_iovar_op(dhd_pub, buf,
+				bcmerror = brcmf_proto_iovar_op(drvr, buf,
 								arg, arglen,
 								buf, buflen,
 								IOV_GET);
 			else
-				bcmerror = brcmf_proto_iovar_op(dhd_pub, buf,
+				bcmerror = brcmf_proto_iovar_op(drvr, buf,
 								NULL, 0, arg,
 								arglen,
 								IOV_SET);
@@ -429,11 +429,11 @@ int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
 
 			/* if still not found, try bus module */
 			if (ioc->cmd == DHD_GET_VAR)
-				bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
+				bcmerror = brcmf_sdbrcm_bus_iovar_op(drvr,
 						buf, arg, arglen, buf, buflen,
 						IOV_GET);
 			else
-				bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
+				bcmerror = brcmf_sdbrcm_bus_iovar_op(drvr,
 						buf, NULL, 0, arg, arglen,
 						IOV_SET);
 
@@ -754,8 +754,8 @@ static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
 #endif				/* SHOW_EVENTS */
 
 int
-brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
-	      brcmf_event_msg_t *event, void **data_ptr)
+brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata,
+		   brcmf_event_msg_t *event, void **data_ptr)
 {
 	/* check whether packet is a BRCM event pkt */
 	brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata;
@@ -796,13 +796,13 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
 			if (ifevent->ifidx > 0 &&
 				 ifevent->ifidx < DHD_MAX_IFS) {
 				if (ifevent->action == BRCMF_E_IF_ADD)
-					brcmf_add_if(dhd, ifevent->ifidx,
+					brcmf_add_if(drvr_priv, ifevent->ifidx,
 						   NULL, event->ifname,
 						   pvt_data->eth.h_dest,
 						   ifevent->flags,
 						   ifevent->bssidx);
 				else
-					brcmf_del_if(dhd, ifevent->ifidx);
+					brcmf_del_if(drvr_priv, ifevent->ifidx);
 			} else {
 				DHD_ERROR(("%s: Invalid ifidx %d for %s\n",
 					   __func__, ifevent->ifidx,
@@ -810,9 +810,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
 			}
 		}
 		/* send up the if event: btamp user needs it */
-		*ifidx = brcmf_ifname2idx(dhd, event->ifname);
+		*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
 		/* push up to external supp/auth */
-		brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
+		brcmf_event(drvr_priv, (char *)pvt_data, evlen, *ifidx);
 		break;
 
 		/* These are what external supplicant/authenticator wants */
@@ -824,9 +824,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
 	default:
 		/* Fall through: this should get _everything_  */
 
-		*ifidx = brcmf_ifname2idx(dhd, event->ifname);
+		*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
 		/* push up to external supp/auth */
-		brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
+		brcmf_event(drvr_priv, (char *)pvt_data, evlen, *ifidx);
 		DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
 			   __func__, type, flags, status));
 
@@ -875,7 +875,7 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
 }
 
 void
-brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
+brcmf_c_pktfilter_offload_enable(dhd_pub_t *drvr, char *arg, int enable,
 			     int master_mode)
 {
 	char *argv[8];
@@ -923,7 +923,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
 	memcpy((char *)pkt_filterp, &enable_parm, sizeof(enable_parm));
 
 	/* Enable/disable the specified filter. */
-	rc = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, buf_len);
+	rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf, buf_len);
 	rc = rc >= 0 ? 0 : rc;
 	if (rc)
 		DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
@@ -935,7 +935,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
 	/* Contorl the master mode */
 	brcmu_mkiovar("pkt_filter_mode", (char *)&master_mode, 4, buf,
 		    sizeof(buf));
-	rc = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf,
+	rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf,
 				       sizeof(buf));
 	rc = rc >= 0 ? 0 : rc;
 	if (rc)
@@ -946,7 +946,7 @@ fail:
 	kfree(arg_org);
 }
 
-void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
+void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
 {
 	const char *str;
 	wl_pkt_filter_t pkt_filter;
@@ -1066,7 +1066,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
 	       &pkt_filter,
 	       WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);
 
-	rc = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, buf_len);
+	rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf, buf_len);
 	rc = rc >= 0 ? 0 : rc;
 
 	if (rc)
@@ -1082,13 +1082,13 @@ fail:
 	kfree(buf);
 }
 
-void brcmf_c_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
+void brcmf_c_arp_offload_set(dhd_pub_t *drvr, int arp_mode)
 {
 	char iovbuf[32];
 	int retcode;
 
 	brcmu_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf));
-	retcode = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+	retcode = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR,
 				   iovbuf, sizeof(iovbuf));
 	retcode = retcode >= 0 ? 0 : retcode;
 	if (retcode)
@@ -1099,13 +1099,13 @@ void brcmf_c_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
 			   __func__, arp_mode));
 }
 
-void brcmf_c_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
+void brcmf_c_arp_offload_enable(dhd_pub_t *drvr, int arp_enable)
 {
 	char iovbuf[32];
 	int retcode;
 
 	brcmu_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf));
-	retcode = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+	retcode = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR,
 				   iovbuf, sizeof(iovbuf));
 	retcode = retcode >= 0 ? 0 : retcode;
 	if (retcode)
@@ -1116,7 +1116,7 @@ void brcmf_c_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
 			   __func__, arp_enable));
 }
 
-int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
+int brcmf_c_preinit_ioctls(dhd_pub_t *drvr)
 {
 	char iovbuf[WL_EVENTING_MASK_LEN + 12];	/*  Room for
 				 "event_msgs" + '\0' + bitvec  */
@@ -1130,13 +1130,13 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	int scan_unassoc_time = 40;
 	int i;
 
-	brcmf_os_proto_block(dhd);
+	brcmf_os_proto_block(drvr);
 
 	/* Set Country code */
-	if (dhd->country_code[0] != 0) {
-		if (brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_COUNTRY,
-				     dhd->country_code,
-				     sizeof(dhd->country_code)) < 0) {
+	if (drvr->country_code[0] != 0) {
+		if (brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_COUNTRY,
+				     drvr->country_code,
+				     sizeof(drvr->country_code)) < 0) {
 			DHD_ERROR(("%s: country code setting failed\n",
 				   __func__));
 		}
@@ -1146,74 +1146,74 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	memset(buf, 0, sizeof(buf));
 	ptr = buf;
 	brcmu_mkiovar("ver", 0, 0, buf, sizeof(buf));
-	brcmf_proto_cdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
+	brcmf_proto_cdc_query_ioctl(drvr, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
 	strsep(&ptr, "\n");
 	/* Print fw version info */
 	DHD_ERROR(("Firmware version = %s\n", buf));
 
 	/* Set PowerSave mode */
-	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM, (char *)&power_mode,
+	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_PM, (char *)&power_mode,
 			 sizeof(power_mode));
 
 	/* Match Host and Dongle rx alignment */
 	brcmu_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
 		    sizeof(iovbuf));
-	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
 				  sizeof(iovbuf));
 
 	/* disable glom option per default */
 	brcmu_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
-	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
 				  sizeof(iovbuf));
 
 	/* Setup timeout if Beacons are lost and roam is off to report
 		 link down */
 	brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf,
 		    sizeof(iovbuf));
-	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
 				  sizeof(iovbuf));
 
 	/* Enable/Disable build-in roaming to allowed ext supplicant to take
 		 of romaing */
 	brcmu_mkiovar("roam_off", (char *)&brcmf_roam, 4,
 		      iovbuf, sizeof(iovbuf));
-	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
 				  sizeof(iovbuf));
 
 	/* Force STA UP */
 	if (brcmf_radio_up)
-		brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_UP, (char *)&up,
+		brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_UP, (char *)&up,
 					  sizeof(up));
 
 	/* Setup event_msgs */
-	brcmu_mkiovar("event_msgs", dhd->eventmask, WL_EVENTING_MASK_LEN,
+	brcmu_mkiovar("event_msgs", drvr->eventmask, WL_EVENTING_MASK_LEN,
 		      iovbuf, sizeof(iovbuf));
-	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
 				  sizeof(iovbuf));
 
-	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME,
+	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME,
 			 (char *)&scan_assoc_time, sizeof(scan_assoc_time));
-	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
+	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
 			 (char *)&scan_unassoc_time, sizeof(scan_unassoc_time));
 
 	/* Set and enable ARP offload feature */
 	if (brcmf_arp_enable)
-		brcmf_c_arp_offload_set(dhd, brcmf_arp_mode);
-	brcmf_c_arp_offload_enable(dhd, brcmf_arp_enable);
+		brcmf_c_arp_offload_set(drvr, brcmf_arp_mode);
+	brcmf_c_arp_offload_enable(drvr, brcmf_arp_enable);
 
 	/* Set up pkt filter */
 	if (brcmf_pkt_filter_enable) {
-		for (i = 0; i < dhd->pktfilter_count; i++) {
-			brcmf_c_pktfilter_offload_set(dhd,
-						  dhd->pktfilter[i]);
-			brcmf_c_pktfilter_offload_enable(dhd,
-			     dhd->pktfilter[i],
+		for (i = 0; i < drvr->pktfilter_count; i++) {
+			brcmf_c_pktfilter_offload_set(drvr,
+						  drvr->pktfilter[i]);
+			brcmf_c_pktfilter_offload_enable(drvr,
+			     drvr->pktfilter[i],
 			     brcmf_pkt_filter_init,
 			     brcmf_master_mode);
 		}
 	}
 
-	brcmf_os_proto_unblock(dhd);
+	brcmf_os_proto_unblock(drvr);
 
 	return 0;
 }
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +361 -352

1,652 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#92 lore raw

PATCH 85/119 staging: brcm80211: remove unused definitions from dhd.h

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Several defintions from dhd.h are not used in the fullmac driver and have been removed.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h |  112 ------------------------------
 1 files changed, 0 insertions(+), 112 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -112
index b2db6b9..2ebf015 100644
@@ -308,13 +308,6 @@ typedef struct brcmf_event {
 #define BRCMF_E_LINK_ASSOC_REC			3
 #define BRCMF_E_LINK_BSSCFG_DIS			4
 
-enum cust_gpio_modes {
-	WLAN_RESET_ON,
-	WLAN_RESET_OFF,
-	WLAN_POWER_ON,
-	WLAN_POWER_OFF
-};
-
 /* The level of bus communication with the dongle */
 enum dhd_bus_state {
 	DHD_BUS_DOWN,		/* Not ready for frame transfers */
@@ -448,20 +441,6 @@ typedef struct wl_scan_results {
 	wl_bss_info_t bss_info[1];
 } wl_scan_results_t;
 
-typedef struct wl_rateset_args {
-	u32 count;		/* # rates in this set */
-	u8 rates[WL_NUMRATES];	/* rates in 500kbps units w/hi bit set if basic */
-	u8 mcs[MCSSET_LEN];	/* supported mcs index bit map */
-} wl_rateset_args_t;
-
-/* u32 list */
-typedef struct wl_u32_list {
-	/* in - # of elements, out - # of entries */
-	u32 count;
-	/* variable length u32 list */
-	u32 element[1];
-} wl_u32_list_t;
-
 /* used for association with a specific BSSID and chanspec list */
 typedef struct wl_assoc_params {
 	u8 bssid[ETH_ALEN];	/* 00:00:00:00:00:00: broadcast scan */
@@ -472,9 +451,6 @@ typedef struct wl_assoc_params {
 } wl_assoc_params_t;
 #define WL_ASSOC_PARAMS_FIXED_SIZE	(sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
 
-/* used for reassociation/roam to a specific BSSID and channel */
-typedef wl_assoc_params_t wl_reassoc_params_t;
-
 /* used for join with or without a specific bssid and channel list */
 typedef struct wl_join_params {
 	wlc_ssid_t ssid;
@@ -496,94 +472,6 @@ typedef struct wl_iscan_results {
 #define WL_ISCAN_RESULTS_FIXED_SIZE \
 	(WL_SCAN_RESULTS_FIXED_SIZE + offsetof(wl_iscan_results_t, results))
 
-typedef struct {
-	u32 duration;	/* millisecs spent sampling this channel */
-	u32 congest_ibss;	/* millisecs in our bss (presumably this traffic will */
-	/*  move if cur bss moves channels) */
-	u32 congest_obss;	/* traffic not in our bss */
-	u32 interference;	/* millisecs detecting a non 802.11 interferer. */
-	u32 timestamp;	/* second timestamp */
-} cca_congest_t;
-
-typedef struct {
-	chanspec_t chanspec;	/* Which channel? */
-	u8 num_secs;		/* How many secs worth of data */
-	cca_congest_t secs[1];	/* Data */
-} cca_congest_channel_req_t;
-
-typedef struct wl_country {
-	char country_abbrev[WLC_CNTRY_BUF_SZ];	/* nul-terminated country code used in
-						 * the Country IE
-						 */
-	s32 rev;		/* revision specifier for ccode
-				 * on set, -1 indicates unspecified.
-				 * on get, rev >= 0
-				 */
-	char ccode[WLC_CNTRY_BUF_SZ];	/* nul-terminated built-in country code.
-					 * variable length, but fixed size in
-					 * struct allows simple allocation for
-					 * expected country strings <= 3 chars.
-					 */
-} wl_country_t;
-
-typedef struct wl_channels_in_country {
-	u32 buflen;
-	u32 band;
-	char country_abbrev[WLC_CNTRY_BUF_SZ];
-	u32 count;
-	u32 channel[1];
-} wl_channels_in_country_t;
-
-typedef struct wl_country_list {
-	u32 buflen;
-	u32 band_set;
-	u32 band;
-	u32 count;
-	char country_abbrev[1];
-} wl_country_list_t;
-
-typedef struct wl_rm_req_elt {
-	s8 type;
-	s8 flags;
-	chanspec_t chanspec;
-	u32 token;		/* token for this measurement */
-	u32 tsf_h;		/* TSF high 32-bits of Measurement start time */
-	u32 tsf_l;		/* TSF low 32-bits */
-	u32 dur;		/* TUs */
-} wl_rm_req_elt_t;
-
-typedef struct wl_rm_req {
-	u32 token;		/* overall measurement set token */
-	u32 count;		/* number of measurement requests */
-	void *cb;		/* completion callback function: may be NULL */
-	void *cb_arg;		/* arg to completion callback function */
-	wl_rm_req_elt_t req[1];	/* variable length block of requests */
-} wl_rm_req_t;
-
-typedef struct wl_rm_rep_elt {
-	s8 type;
-	s8 flags;
-	chanspec_t chanspec;
-	u32 token;		/* token for this measurement */
-	u32 tsf_h;		/* TSF high 32-bits of Measurement start time */
-	u32 tsf_l;		/* TSF low 32-bits */
-	u32 dur;		/* TUs */
-	u32 len;		/* byte length of data block */
-	u8 data[1];		/* variable length data block */
-} wl_rm_rep_elt_t;
-
-#define WL_RPI_REP_BIN_NUM 8
-typedef struct wl_rm_rpi_rep {
-	u8 rpi[WL_RPI_REP_BIN_NUM];
-	s8 rpi_max[WL_RPI_REP_BIN_NUM];
-} wl_rm_rpi_rep_t;
-
-typedef struct wl_rm_rep {
-	u32 token;		/* overall measurement set token */
-	u32 len;		/* length of measurement report block */
-	wl_rm_rep_elt_t rep[1];	/* variable length block of reports */
-} wl_rm_rep_t;
-
 typedef struct wl_wsec_key {
 	u32 index;		/* key index */
 	u32 len;		/* key length */
Signature · 1 line
1.7.1
author
#93 lore raw

PATCH 86/119 staging: brcm80211: rename structure definitions in dhd.h

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Structure definitions in dhd.h have been prefixed with brcmf_ for consistent naming in fullmac driver and typedef of these structures has been removed.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |  130 +++++++++++----------
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c     |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c  |   12 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |   22 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h   |    2 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |  103 +++++++++---------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |   14 +-
 7 files changed, 146 insertions(+), 139 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +68 -62
index 2ebf015..93e0164 100644
@@ -83,8 +83,9 @@
 #define	WLC_PHY_TYPE_LCN	8
 #define	WLC_PHY_TYPE_NULL	0xf
 
-#define WL_PKT_FILTER_FIXED_LEN		  offsetof(wl_pkt_filter_t, u)
-#define WL_PKT_FILTER_PATTERN_FIXED_LEN	  offsetof(wl_pkt_filter_pattern_t, mask_and_pattern)
+#define WL_PKT_FILTER_FIXED_LEN		  offsetof(struct brcmf_pkt_filter, u)
+#define WL_PKT_FILTER_PATTERN_FIXED_LEN	\
+	offsetof(struct brcmf_pkt_filter_pattern, mask_and_pattern)
 
 #define WL_EVENTING_MASK_LEN	16
 
@@ -94,9 +95,9 @@
 /* maximum channels returned by the get valid channels iovar */
 #define WL_NUMCHANNELS		64
 
-#define	WL_BSS_INFO_VERSION	108	/* current ver of wl_bss_info struct */
+#define	WL_BSS_INFO_VERSION	108 /* current ver of brcmf_bss_info struct */
 
-/* size of wl_scan_params not including variable length array */
+/* size of brcmf_scan_params not including variable length array */
 #define WL_SCAN_PARAMS_FIXED_SIZE 64
 
 /* masks for channel and ssid count */
@@ -109,7 +110,7 @@
 
 #define ISCAN_REQ_VERSION 1
 
-/* wl_iscan_results status values */
+/* brcmf_iscan_results status values */
 #define WL_SCAN_RESULTS_SUCCESS	0
 #define WL_SCAN_RESULTS_PARTIAL	1
 #define WL_SCAN_RESULTS_PENDING	2
@@ -319,7 +320,7 @@ enum dhd_bus_state {
  * start matching, the pattern to match, the size of the pattern, and a bitmask
  * that indicates which bits within the pattern should be matched.
  */
-typedef struct wl_pkt_filter_pattern {
+struct brcmf_pkt_filter_pattern {
 	u32 offset;		/* Offset within received packet to start pattern matching.
 				 * Offset '0' is the first byte of the ethernet header.
 				 */
@@ -327,29 +328,29 @@ typedef struct wl_pkt_filter_pattern {
 	u8 mask_and_pattern[1];	/* Variable length mask and pattern data.  mask starts
 					 * at offset 0.  Pattern immediately follows mask.
 					 */
-} wl_pkt_filter_pattern_t;
+};
 
 /* IOVAR "pkt_filter_add" parameter. Used to install packet filters. */
-typedef struct wl_pkt_filter {
+struct brcmf_pkt_filter {
 	u32 id;		/* Unique filter id, specified by app. */
 	u32 type;		/* Filter type (WL_PKT_FILTER_TYPE_xxx). */
 	u32 negate_match;	/* Negate the result of filter matches */
 	union {			/* Filter definitions */
-		wl_pkt_filter_pattern_t pattern;	/* Pattern matching filter */
+		struct brcmf_pkt_filter_pattern pattern; /* Filter pattern */
 	} u;
-} wl_pkt_filter_t;
+};
 
 /* IOVAR "pkt_filter_enable" parameter. */
-typedef struct wl_pkt_filter_enable {
+struct brcmf_pkt_filter_enable {
 	u32 id;		/* Unique filter id */
 	u32 enable;		/* Enable/disable bool */
-} wl_pkt_filter_enable_t;
+};
 
 /* BSS info structure
  * Applications MUST CHECK ie_offset field and length field to access IEs and
- * next bss_info structure in a vector (in wl_scan_results_t)
+ * next bss_info structure in a vector (in struct brcmf_scan_results)
  */
-typedef struct wl_bss_info {
+struct brcmf_bss_info {
 	u32 version;		/* version field */
 	u32 length;		/* byte length of data in this record,
 				 * starting at version and including IEs
@@ -382,15 +383,15 @@ typedef struct wl_bss_info {
 	s16 SNR;		/* average SNR of during frame reception */
 	/* Add new fields here */
 	/* variable length Information Elements */
-} wl_bss_info_t;
+};
 
-typedef struct wlc_ssid {
+struct brcmf_ssid {
 	u32 SSID_len;
 	unsigned char SSID[32];
-} wlc_ssid_t;
+};
 
-typedef struct wl_scan_params {
-	wlc_ssid_t ssid;	/* default: {0, ""} */
+struct brcmf_scan_params {
+	struct brcmf_ssid ssid;	/* default: {0, ""} */
 	u8 bssid[ETH_ALEN];	/* default: bcast */
 	s8 bss_type;		/* default: any,
 				 * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
@@ -408,71 +409,76 @@ typedef struct wl_scan_params {
 				 */
 	s32 channel_num;	/* count of channels and ssids that follow
 				 *
-				 * low half is count of channels in channel_list, 0
-				 * means default (use all available channels)
+				 * low half is count of channels in
+				 * channel_list, 0 means default (use all
+				 * available channels)
 				 *
-				 * high half is entries in wlc_ssid_t array that
-				 * follows channel_list, aligned for s32 (4 bytes)
-				 * meaning an odd channel count implies a 2-byte pad
-				 * between end of channel_list and first ssid
+				 * high half is entries in struct brcmf_ssid
+				 * array that follows channel_list, aligned for
+				 * s32 (4 bytes) meaning an odd channel count
+				 * implies a 2-byte pad between end of
+				 * channel_list and first ssid
 				 *
-				 * if ssid count is zero, single ssid in the fixed
-				 * parameter portion is assumed, otherwise ssid in
-				 * the fixed portion is ignored
+				 * if ssid count is zero, single ssid in the
+				 * fixed parameter portion is assumed, otherwise
+				 * ssid in the fixed portion is ignored
 				 */
 	u16 channel_list[1];	/* list of chanspecs */
-} wl_scan_params_t;
+};
 
 /* incremental scan struct */
-typedef struct wl_iscan_params {
+struct brcmf_iscan_params {
 	u32 version;
 	u16 action;
 	u16 scan_duration;
-	wl_scan_params_t params;
-} wl_iscan_params_t;
+	struct brcmf_scan_params params;
+};
 
-/* 3 fields + size of wl_scan_params, not including variable length array */
-#define WL_ISCAN_PARAMS_FIXED_SIZE (offsetof(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
+/* 3 fields + size of brcmf_scan_params, not including variable length array */
+#define BRCMF_ISCAN_PARAMS_FIXED_SIZE \
+	(offsetof(struct brcmf_iscan_params, params) + \
+	 sizeof(struct brcmf_ssid))
 
-typedef struct wl_scan_results {
+struct brcmf_scan_results {
 	u32 buflen;
 	u32 version;
 	u32 count;
-	wl_bss_info_t bss_info[1];
-} wl_scan_results_t;
+	struct brcmf_bss_info bss_info[1];
+};
 
 /* used for association with a specific BSSID and chanspec list */
-typedef struct wl_assoc_params {
+struct brcmf_assoc_params {
 	u8 bssid[ETH_ALEN];	/* 00:00:00:00:00:00: broadcast scan */
 	s32 chanspec_num;	/* 0: all available channels,
 				 * otherwise count of chanspecs in chanspec_list
 				 */
 	chanspec_t chanspec_list[1];	/* list of chanspecs */
-} wl_assoc_params_t;
-#define WL_ASSOC_PARAMS_FIXED_SIZE	(sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
+};
+#define WL_ASSOC_PARAMS_FIXED_SIZE \
+	(sizeof(struct brcmf_assoc_params) - sizeof(chanspec_t))
 
 /* used for join with or without a specific bssid and channel list */
-typedef struct wl_join_params {
-	wlc_ssid_t ssid;
-	wl_assoc_params_t params;	/* optional field, but it must include the fixed portion
-					 * of the wl_assoc_params_t struct when it does present.
-					 */
-} wl_join_params_t;
+struct brcmf_join_params {
+	struct brcmf_ssid ssid;
+	struct brcmf_assoc_params params;
+};
 
-/* size of wl_scan_results not including variable length array */
-#define WL_SCAN_RESULTS_FIXED_SIZE (sizeof(wl_scan_results_t) - sizeof(wl_bss_info_t))
+/* size of brcmf_scan_results not including variable length array */
+#define BRCMF_SCAN_RESULTS_FIXED_SIZE \
+	(sizeof(struct brcmf_scan_results) - sizeof(struct brcmf_bss_info))
 
 /* incremental scan results struct */
-typedef struct wl_iscan_results {
+struct brcmf_iscan_results {
 	u32 status;
-	wl_scan_results_t results;
-} wl_iscan_results_t;
+	struct brcmf_scan_results results;
+};
 
-/* size of wl_iscan_results not including variable length array */
-#define WL_ISCAN_RESULTS_FIXED_SIZE \
-	(WL_SCAN_RESULTS_FIXED_SIZE + offsetof(wl_iscan_results_t, results))
+/* size of brcmf_iscan_results not including variable length array */
+#define BRCMF_ISCAN_RESULTS_FIXED_SIZE \
+	(BRCMF_SCAN_RESULTS_FIXED_SIZE + \
+	 offsetof(struct brcmf_iscan_results, results))
 
-typedef struct wl_wsec_key {
+struct brcmf_wsec_key {
 	u32 index;		/* key index */
 	u32 len;		/* key length */
 	u8 data[WLAN_MAX_KEY_LEN];	/* key data */
@@ -490,30 +496,30 @@ typedef struct wl_wsec_key {
 	} rxiv;
 	u32 pad_5[2];
 	u8 ea[ETH_ALEN];	/* per station */
-} wl_wsec_key_t;
+};
 
 /* Used to get specific STA parameters */
-typedef struct {
+struct brcmf_scb_val {
 	u32 val;
 	u8 ea[ETH_ALEN];
-} scb_val_t;
+};
 
 /* channel encoding */
-typedef struct channel_info {
+struct brcmf_channel_info {
 	int hw_channel;
 	int target_channel;
 	int scan_channel;
-} channel_info_t;
+};
 
 /* Linux network driver ioctl encoding */
-typedef struct wl_ioctl {
+struct brcmf_ioctl {
 	uint cmd;		/* common ioctl definition */
 	void *buf;		/* pointer to user buffer */
 	uint len;		/* length of user buffer */
 	u8 set;		/* get or set request (optional) */
 	uint used;		/* bytes read or written (optional) */
 	uint needed;		/* bytes needed (optional) */
-} wl_ioctl_t;
+};
 
 /* Forward decls for struct dhd_pub (see below) */
 struct dhd_bus;		/* device bus info */
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -1
index 471869f..7efe69c 100644
@@ -275,7 +275,7 @@ done:
 
 extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
 int
-brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf,
+brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc, void *buf,
 		  int len)
 {
 	struct brcmf_proto *prot = dhd->prot;
drivers/staging/brcm80211/brcmfmac/dhd_common.c +6 -6
index 244ea72..84daa8e 100644
@@ -886,8 +886,8 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *drvr, char *arg, int enable,
 	char *arg_save = 0, *arg_org = 0;
 	int rc;
 	char buf[128];
-	wl_pkt_filter_enable_t enable_parm;
-	wl_pkt_filter_enable_t *pkt_filterp;
+	struct brcmf_pkt_filter_enable enable_parm;
+	struct brcmf_pkt_filter_enable *pkt_filterp;
 
 	arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
 	if (!arg_save) {
@@ -911,7 +911,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *drvr, char *arg, int enable,
 	buf[str_len] = '\0';
 	buf_len = str_len + 1;
 
-	pkt_filterp = (wl_pkt_filter_enable_t *) (buf + str_len + 1);
+	pkt_filterp = (struct brcmf_pkt_filter_enable *) (buf + str_len + 1);
 
 	/* Parse packet filter id. */
 	enable_parm.id = simple_strtoul(argv[i], NULL, 0);
@@ -949,8 +949,8 @@ fail:
 void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
 {
 	const char *str;
-	wl_pkt_filter_t pkt_filter;
-	wl_pkt_filter_t *pkt_filterp;
+	struct brcmf_pkt_filter pkt_filter;
+	struct brcmf_pkt_filter *pkt_filterp;
 	int buf_len;
 	int str_len;
 	int rc;
@@ -998,7 +998,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
 	buf[str_len] = '\0';
 	buf_len = str_len + 1;
 
-	pkt_filterp = (wl_pkt_filter_t *) (buf + str_len + 1);
+	pkt_filterp = (struct brcmf_pkt_filter *) (buf + str_len + 1);
 
 	/* Parse packet filter id. */
 	pkt_filter.id = simple_strtoul(argv[i], NULL, 0);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +11 -11
index 04b4511..6b2682f 100644
@@ -209,7 +209,7 @@ static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr)
 static int brcmf_set_suspend(int value, dhd_pub_t *drvr)
 {
 	int power_mode = PM_MAX;
-	/* wl_pkt_filter_enable_t       enable_parm; */
+	/* struct wl_pkt_filter_enable       enable_parm; */
 	char iovbuf[32];
 	int bcn_li_dtim = 3;
 
@@ -426,7 +426,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx)
 	struct netdev_hw_addr *ha;
 	u32 allmulti, cnt;
 
-	wl_ioctl_t ioc;
+	struct brcmf_ioctl ioc;
 	char *buf, *bufp;
 	uint buflen;
 	int ret;
@@ -539,7 +539,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx)
 static int _brcmf_set_mac_address(dhd_info_t *drvr_priv, int ifidx, u8 *addr)
 {
 	char buf[32];
-	wl_ioctl_t ioc;
+	struct brcmf_ioctl ioc;
 	int ret;
 
 	DHD_TRACE(("%s enter\n", __func__));
@@ -993,7 +993,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
 	 as a bitmap in toe_ol iovar */
 static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol)
 {
-	wl_ioctl_t ioc;
+	struct brcmf_ioctl ioc;
 	char buf[32];
 	int ret;
 
@@ -1027,7 +1027,7 @@ static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol)
 	 and set toe global enable iovar */
 static int brcmf_toe_set(dhd_info_t *drvr_priv, int ifidx, u32 toe_ol)
 {
-	wl_ioctl_t ioc;
+	struct brcmf_ioctl ioc;
 	char buf[32];
 	int toe, ret;
 
@@ -1220,7 +1220,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
 	memset(&ioc, 0, sizeof(ioc));
 
 	/* Copy the ioc control structure part of ioctl request */
-	if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) {
+	if (copy_from_user(&ioc, ifr->ifr_data, sizeof(struct brcmf_ioctl))) {
 		bcmerror = -EINVAL;
 		goto done;
 	}
@@ -1248,8 +1248,8 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
 	}
 
 	/* To differentiate between wl and dhd read 4 more byes */
-	if ((copy_from_user(&driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t),
-			    sizeof(uint)) != 0)) {
+	if ((copy_from_user(&driver, (char *)ifr->ifr_data +
+			    sizeof(struct brcmf_ioctl), sizeof(uint)) != 0)) {
 		bcmerror = -EINVAL;
 		goto done;
 	}
@@ -1292,8 +1292,8 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
 		brcmf_netdev_wait_pend8021x(net);
 
 	bcmerror =
-	    brcmf_proto_ioctl(&drvr_priv->pub, ifidx, (wl_ioctl_t *)&ioc, buf,
-			      buflen);
+	    brcmf_proto_ioctl(&drvr_priv->pub, ifidx, (struct brcmf_ioctl *)&ioc,
+			      buf, buflen);
 
 done:
 	if (!bcmerror && buf && ioc.buf) {
@@ -1604,7 +1604,7 @@ int brcmf_iovar(dhd_pub_t *drvr, int ifidx, char *name, char *cmd_buf,
 {
 	char buf[strlen(name) + 1 + cmd_len];
 	int len = sizeof(buf);
-	wl_ioctl_t ioc;
+	struct brcmf_ioctl ioc;
 	int ret;
 
 	len = brcmu_mkiovar(name, cmd_buf, cmd_len, buf, len);
drivers/staging/brcm80211/brcmfmac/dhd_proto.h +1 -1
index f8ca781..4ac2cd1 100644
@@ -52,7 +52,7 @@ extern void brcmf_proto_hdrpush(dhd_pub_t *, int ifidx, struct sk_buff *txp);
 extern int brcmf_proto_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
 
 /* Use protocol to issue ioctl to dongle */
-extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc,
+extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc,
 			  void *buf, int len);
 
 /* Check for and handle local prot-specific iovar commands */
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +52 -51

336 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +7 -7
index 7848b3c..3400cc9 100644
@@ -206,7 +206,7 @@ struct wl_cfg80211_bss_info {
 
 /* basic structure of scan request */
 struct wl_scan_req {
-	struct wlc_ssid ssid;
+	struct brcmf_ssid ssid;
 };
 
 /* basic structure of information element */
@@ -244,7 +244,7 @@ struct wl_ibss {
 /* dongle profile */
 struct wl_profile {
 	u32 mode;
-	struct wlc_ssid ssid;
+	struct brcmf_ssid ssid;
 	u8 bssid[ETH_ALEN];
 	u16 beacon_interval;
 	u8 dtim_period;
@@ -303,9 +303,9 @@ struct wl_priv {
 	struct list_head eq_list;	/* used for event queue */
 	spinlock_t eq_lock;	/* for event queue synchronization */
 	struct mutex usr_sync;	/* maily for dongle up/down synchronization */
-	struct wl_scan_results *bss_list;	/* bss_list holding scanned
+	struct brcmf_scan_results *bss_list;	/* bss_list holding scanned
 						 ap information */
-	struct wl_scan_results *scan_results;
+	struct brcmf_scan_results *scan_results;
 	struct wl_scan_req *scan_req_int;	/* scan request object for
 						 internal purpose */
 	struct wl_cfg80211_bss_info *bss_info;	/* bss information for
@@ -354,11 +354,11 @@ struct wl_priv {
 #define wl_to_iscan(w) (w->iscan)
 #define wl_to_conn(w) (&w->conn_info)
 
-static inline struct wl_bss_info *next_bss(struct wl_scan_results *list,
-					   struct wl_bss_info *bss)
+static inline struct brcmf_bss_info *next_bss(struct brcmf_scan_results *list,
+					   struct brcmf_bss_info *bss)
 {
 	return bss = bss ?
-		(struct wl_bss_info *)((unsigned long)bss +
+		(struct brcmf_bss_info *)((unsigned long)bss +
 				       le32_to_cpu(bss->length)) :
 		list->bss_info;
 }
Signature · 1 line
1.7.1
author
#94 lore raw

PATCH 87/119 staging: brcm80211: rename macro definitions in dhd.h

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The definitions in dhd.h have been renamed with consistent prefix BRCMF_.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   24 ++--
 drivers/staging/brcm80211/brcmfmac/dhd.h          |  120 ++++++++++----------
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c      |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c   |   34 +++---
 drivers/staging/brcm80211/brcmfmac/dhd_dbg.h      |   52 +++++-----
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |   46 ++++----
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   44 ++++----
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c  |   48 ++++----
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h  |    2 +-
 9 files changed, 187 insertions(+), 185 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +12 -12
index 764d839..167181d 100644
@@ -43,10 +43,10 @@ extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
 uint sd_f2_blocksize = 512;	/* Default blocksize */
 
 uint sd_msglevel = 0x01;
-DHD_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
-DHD_PM_RESUME_WAIT_INIT(sdioh_request_word_wait);
-DHD_PM_RESUME_WAIT_INIT(sdioh_request_packet_wait);
-DHD_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
+BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
+BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_word_wait);
+BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_packet_wait);
+BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
 
 #define DMA_ALIGN_MASK	0x03
 
@@ -534,8 +534,8 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 	sd_info(("%s: rw=%d, func=%d, addr=0x%05x\n", __func__, rw, func,
 		 regaddr));
 
-	DHD_PM_RESUME_WAIT(sdioh_request_byte_wait);
-	DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+	BRCMF_PM_RESUME_WAIT(sdioh_request_byte_wait);
+	BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
 	if (rw) {		/* CMD52 Write */
 		if (func == 0) {
 			/* Can only directly write to some F0 registers.
@@ -636,8 +636,8 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
 	sd_info(("%s: cmd_type=%d, rw=%d, func=%d, addr=0x%05x, nbytes=%d\n",
 		 __func__, cmd_type, rw, func, addr, nbytes));
 
-	DHD_PM_RESUME_WAIT(sdioh_request_word_wait);
-	DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+	BRCMF_PM_RESUME_WAIT(sdioh_request_word_wait);
+	BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
 	/* Claim host controller */
 	sdio_claim_host(gInstance->func[func]);
 
@@ -688,8 +688,8 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
 	sd_trace(("%s: Enter\n", __func__));
 
 	ASSERT(pkt);
-	DHD_PM_RESUME_WAIT(sdioh_request_packet_wait);
-	DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+	BRCMF_PM_RESUME_WAIT(sdioh_request_packet_wait);
+	BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
 
 	/* Claim host controller */
 	sdio_claim_host(gInstance->func[func]);
@@ -774,8 +774,8 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
 
 	sd_trace(("%s: Enter\n", __func__));
 
-	DHD_PM_RESUME_WAIT(sdioh_request_buffer_wait);
-	DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+	BRCMF_PM_RESUME_WAIT(sdioh_request_buffer_wait);
+	BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
 	/* Case 1: we don't have a packet. */
 	if (pkt == NULL) {
 		sd_data(("%s: Creating new %s Packet, len=%d\n",
drivers/staging/brcm80211/brcmfmac/dhd.h +60 -60

218 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -1
index 7efe69c..a336068 100644
@@ -406,7 +406,7 @@ int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
 	h = (struct brcmf_proto_bdc_header *)(pktbuf->data);
 
 	*ifidx = BDC_GET_IF_IDX(h);
-	if (*ifidx >= DHD_MAX_IFS) {
+	if (*ifidx >= BRCMF_MAX_IFS) {
 		DHD_ERROR(("%s: rx data ifnum out of range (%d)\n",
 			   __func__, *ifidx));
 		return -EBADE;
drivers/staging/brcm80211/brcmfmac/dhd_common.c +17 -17
index 84daa8e..9b0ad44 100644
@@ -71,7 +71,7 @@ const struct brcmu_iovar brcmf_iovars[] = {
 	,
 	{"bcmerror", IOV_BCMERROR, 0, IOVT_INT8, 0}
 	,
-	{"dump", IOV_DUMP, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
+	{"dump", IOV_DUMP, 0, IOVT_BUFFER, BRCMF_IOCTL_MAXLEN}
 	,
 	{"clearcounts", IOV_CLEARCOUNTS, 0, IOVT_VOID, 0}
 	,
@@ -108,7 +108,7 @@ void brcmf_c_init(void)
 	 * first time that the driver is initialized vs subsequent
 	 * initializations.
 	 */
-	brcmf_msg_level = DHD_ERROR_VAL;
+	brcmf_msg_level = BRCMF_ERROR_VAL;
 }
 
 static int brcmf_c_dump(dhd_pub_t *drvr, char *buf, int buflen)
@@ -370,22 +370,22 @@ int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
 		return -EINVAL;
 
 	switch (ioc->cmd) {
-	case DHD_GET_MAGIC:
+	case BRCMF_GET_MAGIC:
 		if (buflen < sizeof(int))
 			bcmerror = -EOVERFLOW;
 		else
-			*(int *)buf = DHD_IOCTL_MAGIC;
+			*(int *)buf = BRCMF_IOCTL_MAGIC;
 		break;
 
-	case DHD_GET_VERSION:
+	case BRCMF_GET_VERSION:
 		if (buflen < sizeof(int))
 			bcmerror = -EOVERFLOW;
 		else
-			*(int *)buf = DHD_IOCTL_VERSION;
+			*(int *)buf = BRCMF_IOCTL_VERSION;
 		break;
 
-	case DHD_GET_VAR:
-	case DHD_SET_VAR:{
+	case BRCMF_GET_VAR:
+	case BRCMF_SET_VAR:{
 			char *arg;
 			uint arglen;
 
@@ -403,7 +403,7 @@ int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
 			arg++, arglen--;
 
 			/* call with the appropriate arguments */
-			if (ioc->cmd == DHD_GET_VAR)
+			if (ioc->cmd == BRCMF_GET_VAR)
 				bcmerror = brcmf_c_iovar_op(drvr, buf, arg,
 						arglen, buf, buflen, IOV_GET);
 			else
@@ -414,7 +414,7 @@ int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
 				break;
 
 			/* not in generic table, try protocol module */
-			if (ioc->cmd == DHD_GET_VAR)
+			if (ioc->cmd == BRCMF_GET_VAR)
 				bcmerror = brcmf_proto_iovar_op(drvr, buf,
 								arg, arglen,
 								buf, buflen,
@@ -428,7 +428,7 @@ int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
 				break;
 
 			/* if still not found, try bus module */
-			if (ioc->cmd == DHD_GET_VAR)
+			if (ioc->cmd == BRCMF_GET_VAR)
 				bcmerror = brcmf_sdbrcm_bus_iovar_op(drvr,
 						buf, arg, arglen, buf, buflen,
 						IOV_GET);
@@ -794,7 +794,7 @@ brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata,
 			DHD_TRACE(("%s: if event\n", __func__));
 
 			if (ifevent->ifidx > 0 &&
-				 ifevent->ifidx < DHD_MAX_IFS) {
+				 ifevent->ifidx < BRCMF_MAX_IFS) {
 				if (ifevent->action == BRCMF_E_IF_ADD)
 					brcmf_add_if(drvr_priv, ifevent->ifidx,
 						   NULL, event->ifname,
@@ -1054,8 +1054,8 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
 	}
 
 	pkt_filter.u.pattern.size_bytes = mask_size;
-	buf_len += WL_PKT_FILTER_FIXED_LEN;
-	buf_len += (WL_PKT_FILTER_PATTERN_FIXED_LEN + 2 * mask_size);
+	buf_len += BRCMF_PKT_FILTER_FIXED_LEN;
+	buf_len += (BRCMF_PKT_FILTER_PATTERN_FIXED_LEN + 2 * mask_size);
 
 	/* Keep-alive attributes are set in local
 	 * variable (keep_alive_pkt), and
@@ -1064,7 +1064,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
 	 */
 	memcpy((char *)pkt_filterp,
 	       &pkt_filter,
-	       WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);
+	       BRCMF_PKT_FILTER_FIXED_LEN + BRCMF_PKT_FILTER_PATTERN_FIXED_LEN);
 
 	rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf, buf_len);
 	rc = rc >= 0 ? 0 : rc;
@@ -1118,7 +1118,7 @@ void brcmf_c_arp_offload_enable(dhd_pub_t *drvr, int arp_enable)
 
 int brcmf_c_preinit_ioctls(dhd_pub_t *drvr)
 {
-	char iovbuf[WL_EVENTING_MASK_LEN + 12];	/*  Room for
+	char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];	/*  Room for
 				 "event_msgs" + '\0' + bitvec  */
 	uint up = 0;
 	char buf[128], *ptr;
@@ -1186,7 +1186,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *drvr)
 					  sizeof(up));
 
 	/* Setup event_msgs */
-	brcmu_mkiovar("event_msgs", drvr->eventmask, WL_EVENTING_MASK_LEN,
+	brcmu_mkiovar("event_msgs", drvr->eventmask, BRCMF_EVENTING_MASK_LEN,
 		      iovbuf, sizeof(iovbuf));
 	brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
 				  sizeof(iovbuf));
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h +26 -26

72 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_linux.c +23 -23

172 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +23 -21

166 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +24 -24

149 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +1 -1
index 3400cc9..e6df203 100644
@@ -112,7 +112,7 @@ do {								\
 				 * to reduce iteration
 				 */
 #define WL_ISCAN_TIMER_INTERVAL_MS	3000
-#define WL_SCAN_ERSULTS_LAST	(WL_SCAN_RESULTS_NO_MEM+1)
+#define WL_SCAN_ERSULTS_LAST	(BRCMF_SCAN_RESULTS_NO_MEM+1)
 #define WL_AP_MAX	256	/* virtually unlimitted as long
 				 * as kernel memory allows
 				 */
Signature · 1 line
1.7.1
author
#95 lore raw

PATCH 88/119 staging: brcm80211: remove unused macro definitions from dhd.h

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Several unused macro definitions have been removed.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -12
index 9b1a7f4..77b381c 100644
@@ -624,13 +624,8 @@ extern atomic_t brcmf_mmc_suspend;
 		} \
 	}	while (0)
 #define BRCMF_PM_RESUME_WAIT(a)	_BRCMF_PM_RESUME_WAIT(a, 30)
-#define DHD_PM_RESUME_WAIT_FOREVER(a)	_BRCMF_PM_RESUME_WAIT(a, ~0)
 #define BRCMF_PM_RESUME_RETURN_ERROR(a)	\
 	do { if (atomic_read(&brcmf_mmc_suspend)) return a; } while (0)
-#define DHD_PM_RESUME_RETURN	do { \
-	if (atomic_read(&brcmf_mmc_suspend)) \
-		return; \
-	} while (0)
 
 #define BRCMF_SPINWAIT_SLEEP_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
 #define BRCMF_SPINWAIT_SLEEP(a, exp, us) do { \
@@ -645,9 +640,7 @@ extern atomic_t brcmf_mmc_suspend;
 
 #define BRCMF_PM_RESUME_WAIT_INIT(a)
 #define BRCMF_PM_RESUME_WAIT(a)
-#define DHD_PM_RESUME_WAIT_FOREVER(a)
 #define BRCMF_PM_RESUME_RETURN_ERROR(a)
-#define DHD_PM_RESUME_RETURN
 
 #define BRCMF_SPINWAIT_SLEEP_INIT(a)
 #define BRCMF_SPINWAIT_SLEEP(a, exp, us)  do { \
@@ -865,9 +858,7 @@ typedef struct dhd_ioctl {
 
 /* bump this number if you change the ioctl interface */
 #define BRCMF_IOCTL_VERSION	1
-
 #define	BRCMF_IOCTL_MAXLEN	8192	/* max length ioctl buffer required */
-#define	DHD_IOCTL_SMLEN	256	/* "small" length ioctl buffer required */
 
 /* common ioctl definitions */
 #define BRCMF_GET_MAGIC				0
@@ -885,7 +876,6 @@ typedef struct dhd_ioctl {
 #define BRCMF_HDRS_VAL	0x0040
 #define BRCMF_BYTES_VAL	0x0080
 #define BRCMF_INTR_VAL	0x0100
-#define DHD_LOG_VAL	0x0200
 #define BRCMF_GLOM_VAL	0x0400
 #define BRCMF_EVENT_VAL	0x0800
 #define BRCMF_BTA_VAL	0x1000
@@ -926,7 +916,5 @@ typedef struct brcmf_pktgen {
 	 when idle */
 #define BRCMF_IDLE_ACTIVE	0	/* Do not request any SD clock change
 				 when idle */
-#define DHD_IDLE_STOP   (-1)	/* Request SD clock be stopped
-				 (and use SD1 mode) */
 
 #endif				/* _dhd_h_ */
Signature · 1 line
1.7.1
author
#96 lore raw

PATCH 89/119 staging: brcm80211: structure renaming in dhd.h

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

structure have been renamed for consistency and the structure typedefs have been removed.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |   16 ++++++++--------
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |    6 ++++--
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |    6 +++---
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h  |    6 +++---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |    2 +-
 5 files changed, 19 insertions(+), 17 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +8 -8
index 77b381c..d69cee1 100644
@@ -595,19 +595,19 @@ typedef struct dhd_pub {
 
 } dhd_pub_t;
 
-typedef struct dhd_if_event {
+struct brcmf_if_event {
 	u8 ifidx;
 	u8 action;
 	u8 flags;
 	u8 bssidx;
-} dhd_if_event_t;
+};
 
-typedef struct {
+struct brcmf_timeout {
 	u32 limit;		/* Expiration time (usec) */
 	u32 increment;	/* Current expiration increment (usec) */
 	u32 elapsed;		/* Current elapsed time (usec) */
 	u32 tick;		/* O/S tick time (usec) */
-} dhd_timeout_t;
+};
 
 typedef struct {
 	uint event;
@@ -803,8 +803,8 @@ extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
 extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
 #endif				/* BCMDBG */
 
-extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
-extern int brcmf_timeout_expired(dhd_timeout_t *tmo);
+extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
+extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
 
 extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name);
 extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
@@ -843,7 +843,7 @@ extern void osl_assert(char *exp, char *file, int line);
 #endif  /* defined(BCMDBG) */
 
 /* Linux network driver ioctl encoding */
-typedef struct dhd_ioctl {
+struct brcmf_c_ioctl {
 	uint cmd;		/* common ioctl definition */
 	void *buf;		/* pointer to user buffer */
 	uint len;		/* length of user buffer */
@@ -851,7 +851,7 @@ typedef struct dhd_ioctl {
 	uint used;		/* bytes read or written (optional) */
 	uint needed;		/* bytes needed (optional) */
 	uint driver;		/* to identify target driver */
-} dhd_ioctl_t;
+};
 
 /* per-driver magic numbers */
 #define BRCMF_IOCTL_MAGIC		0x00444944
drivers/staging/brcm80211/brcmfmac/dhd_common.c +4 -2
index 9b0ad44..de07526 100644
@@ -360,7 +360,8 @@ exit:
 	return bcmerror;
 }
 
-int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
+int brcmf_c_ioctl(dhd_pub_t *drvr, struct brcmf_c_ioctl *ioc, void *buf,
+		  uint buflen)
 {
 	int bcmerror = 0;
 
@@ -790,7 +791,8 @@ brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata,
 	switch (type) {
 	case BRCMF_E_IF:
 		{
-			dhd_if_event_t *ifevent = (dhd_if_event_t *) event_data;
+			struct brcmf_if_event *ifevent =
+					(struct brcmf_if_event *) event_data;
 			DHD_TRACE(("%s: if event\n", __func__));
 
 			if (ifevent->ifidx > 0 &&
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +3 -3
index 2135a64..2705ec0 100644
@@ -320,7 +320,7 @@ static void brcmf_late_resume(struct early_suspend *h)
  *              fatal();
  */
 
-void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec)
+void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec)
 {
 	tmo->limit = usec;
 	tmo->increment = 0;
@@ -328,7 +328,7 @@ void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec)
 	tmo->tick = 1000000 / HZ;
 }
 
-int brcmf_timeout_expired(dhd_timeout_t *tmo)
+int brcmf_timeout_expired(struct brcmf_timeout *tmo)
 {
 	/* Does nothing the first call */
 	if (tmo->increment == 0) {
@@ -1197,7 +1197,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
 				    int cmd)
 {
 	dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
-	dhd_ioctl_t ioc;
+	struct brcmf_c_ioctl ioc;
 	int bcmerror = 0;
 	int buflen = 0;
 	void *buf = NULL;
drivers/staging/brcm80211/brcmfmac/dhd_proto.h +3 -3
index 4ac2cd1..c78ae94 100644
@@ -53,7 +53,7 @@ extern int brcmf_proto_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
 
 /* Use protocol to issue ioctl to dongle */
 extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc,
-			  void *buf, int len);
+			     void *buf, int len);
 
 /* Check for and handle local prot-specific iovar commands */
 extern int brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
@@ -66,8 +66,8 @@ extern void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
 /* Update local copy of dongle statistics */
 extern void brcmf_proto_dstats(dhd_pub_t *dhdp);
 
-extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
-		     uint buflen);
+extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, struct brcmf_c_ioctl *ioc,
+			 void *buf, uint buflen);
 
 extern int brcmf_c_preinit_ioctls(dhd_pub_t *dhd);
 
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -1
index 8607972..ab96d37 100644
@@ -3130,7 +3130,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
 int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
 {
 	dhd_bus_t *bus = dhdp->bus;
-	dhd_timeout_t tmo;
+	struct brcmf_timeout tmo;
 	uint retries = 0;
 	u8 ready, enable;
 	int err, ret = 0;
Signature · 1 line
1.7.1
author
#97 lore raw

PATCH 90/119 staging: brcm80211: rename structure definitions in dhd_linux.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

renamed structures to consitent naming convention and removed the structure type definitions.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |   20 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |    4 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |  140 +++++++++++-----------
 3 files changed, 82 insertions(+), 82 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +10 -10
index d69cee1..196b372 100644
@@ -524,14 +524,14 @@ struct brcmf_ioctl {
 /* Forward decls for struct dhd_pub (see below) */
 struct dhd_bus;		/* device bus info */
 struct brcmf_proto;	/* device communication protocol info */
-struct dhd_info;	/* device driver info */
+struct brcmf_info;	/* device driver info */
 
 /* Common structure for module and instance linkage */
 typedef struct dhd_pub {
 	/* Linkage ponters */
 	struct dhd_bus *bus;
 	struct brcmf_proto *prot;
-	struct dhd_info *info;
+	struct brcmf_info *info;
 
 	/* Internal dhd items */
 	bool up;		/* Driver up/down (to OS) */
@@ -806,22 +806,22 @@ extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
 extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
 extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
 
-extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name);
-extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
+extern int brcmf_ifname2idx(struct brcmf_info *dhd, char *name);
+extern int brcmf_c_host_event(struct brcmf_info *dhd, int *idx, void *pktdata,
 			 brcmf_event_msg_t *, void **data_ptr);
 
 extern void brcmf_c_init(void);
 
-extern int brcmf_add_if(struct dhd_info *dhd, int ifidx, void *handle,
+extern int brcmf_add_if(struct brcmf_info *dhd, int ifidx, void *handle,
 		      char *name, u8 *mac_addr, u32 flags, u8 bssidx);
-extern void brcmf_del_if(struct dhd_info *dhd, int ifidx);
+extern void brcmf_del_if(struct brcmf_info *dhd, int ifidx);
 
-extern void brcmf_vif_add(struct dhd_info *dhd, int ifidx, char *name);
-extern void brcmf_vif_del(struct dhd_info *dhd, int ifidx);
+extern void brcmf_vif_add(struct brcmf_info *dhd, int ifidx, char *name);
+extern void brcmf_vif_del(struct brcmf_info *dhd, int ifidx);
 
-extern void brcmf_event(struct dhd_info *dhd, char *evpkt, int evlen,
+extern void brcmf_event(struct brcmf_info *dhd, char *evpkt, int evlen,
 			int ifidx);
-extern void brcmf_vif_sendup(struct dhd_info *dhd, int ifidx,
+extern void brcmf_vif_sendup(struct brcmf_info *dhd, int ifidx,
 			     unsigned char *cp, int len);
 
 /* Send packet to dongle via data channel */
drivers/staging/brcm80211/brcmfmac/dhd_common.c +2 -2
index de07526..5c3a5cf 100644
@@ -755,8 +755,8 @@ static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
 #endif				/* SHOW_EVENTS */
 
 int
-brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata,
-		   brcmf_event_msg_t *event, void **data_ptr)
+brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
+	      brcmf_event_msg_t *event, void **data_ptr)
 {
 	/* check whether packet is a BRCM event pkt */
 	brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +70 -70

487 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#98 lore raw

PATCH 91/119 staging: brcm80211: rename struct dhd_pub to struct brcmf_pub

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The structure dhd_pub has been renamed to have more consistent naming in the fullmac driver. This also remove the type definition for this structure.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |   71 ++++++++++++-----------
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h    |    9 ++-
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c    |   34 ++++++-----
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |   26 ++++----
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |   41 +++++++------
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h  |   35 ++++++-----
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |   32 ++++++-----
 7 files changed, 129 insertions(+), 119 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +36 -35
index 196b372..d063afb 100644
@@ -521,13 +521,13 @@ struct brcmf_ioctl {
 	uint needed;		/* bytes needed (optional) */
 };
 
-/* Forward decls for struct dhd_pub (see below) */
+/* Forward decls for struct brcmf_pub (see below) */
 struct dhd_bus;		/* device bus info */
 struct brcmf_proto;	/* device communication protocol info */
 struct brcmf_info;	/* device driver info */
 
 /* Common structure for module and instance linkage */
-typedef struct dhd_pub {
+struct brcmf_pub {
 	/* Linkage ponters */
 	struct dhd_bus *bus;
 	struct brcmf_proto *prot;
@@ -593,7 +593,7 @@ typedef struct dhd_pub {
 	u8 country_code[WLC_CNTRY_BUF_SZ];
 	char eventmask[BRCMF_EVENTING_MASK_LEN];
 
-} dhd_pub_t;
+};
 
 struct brcmf_if_event {
 	u8 ifidx;
@@ -708,27 +708,27 @@ extern const bcmevent_name_t bcmevent_names[];
 extern const int bcmevent_names_size;
 
 
-static inline void MUTEX_LOCK_INIT(dhd_pub_t *dhdp)
+static inline void MUTEX_LOCK_INIT(struct brcmf_pub *dhdp)
 {
 }
 
-static inline void MUTEX_LOCK(dhd_pub_t *dhdp)
+static inline void MUTEX_LOCK(struct brcmf_pub *dhdp)
 {
 }
 
-static inline void MUTEX_UNLOCK(dhd_pub_t *dhdp)
+static inline void MUTEX_UNLOCK(struct brcmf_pub *dhdp)
 {
 }
 
-static inline void MUTEX_LOCK_SOFTAP_SET_INIT(dhd_pub_t *dhdp)
+static inline void MUTEX_LOCK_SOFTAP_SET_INIT(struct brcmf_pub *dhdp)
 {
 }
 
-static inline void MUTEX_LOCK_SOFTAP_SET(dhd_pub_t *dhdp)
+static inline void MUTEX_LOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
 {
 }
 
-static inline void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t *dhdp)
+static inline void MUTEX_UNLOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
 {
 }
 
@@ -749,58 +749,58 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
  */
 
 /* Indication from bus module regarding presence/insertion of dongle.
- * Return dhd_pub_t pointer, used as handle to OS module in later calls.
+ * Return struct brcmf_pub pointer, used as handle to OS module in later calls.
  * Returned structure should have bus and prot pointers filled in.
  * bus_hdrlen specifies required headroom for bus module header.
  */
-extern dhd_pub_t *brcmf_attach(struct dhd_bus *bus,
+extern struct brcmf_pub *brcmf_attach(struct dhd_bus *bus,
 				uint bus_hdrlen);
-extern int brcmf_net_attach(dhd_pub_t *dhdp, int idx);
+extern int brcmf_net_attach(struct brcmf_pub *dhdp, int idx);
 extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
 
 /* Indication from bus module regarding removal/absence of dongle */
-extern void brcmf_detach(dhd_pub_t *dhdp);
+extern void brcmf_detach(struct brcmf_pub *dhdp);
 
 /* Indication from bus module to change flow-control state */
-extern void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);
+extern void brcmf_txflowcontrol(struct brcmf_pub *dhdp, int ifidx, bool on);
 
-extern bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q,
+extern bool brcmf_c_prec_enq(struct brcmf_pub *dhdp, struct pktq *q,
 			 struct sk_buff *pkt, int prec);
 
 /* Receive frame for delivery to OS.  Callee disposes of rxp. */
-extern void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx,
+extern void brcmf_rx_frame(struct brcmf_pub *dhdp, int ifidx,
 			 struct sk_buff *rxp, int numpkt);
 
 /* Return pointer to interface name */
-extern char *brcmf_ifname(dhd_pub_t *dhdp, int idx);
+extern char *brcmf_ifname(struct brcmf_pub *dhdp, int idx);
 
 /* Request scheduling of the bus dpc */
-extern void brcmf_sched_dpc(dhd_pub_t *dhdp);
+extern void brcmf_sched_dpc(struct brcmf_pub *dhdp);
 
 /* Notify tx completion */
-extern void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp,
+extern void brcmf_txcomplete(struct brcmf_pub *dhdp, struct sk_buff *txp,
 			     bool success);
 
 /* Query ioctl */
-extern int brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
-				       void *buf, uint len);
+extern int brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx,
+				       uint cmd, void *buf, uint len);
 
 /* OS independent layer functions */
-extern int brcmf_os_proto_block(dhd_pub_t *pub);
-extern int brcmf_os_proto_unblock(dhd_pub_t *pub);
-extern int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
+extern int brcmf_os_proto_block(struct brcmf_pub *pub);
+extern int brcmf_os_proto_unblock(struct brcmf_pub *pub);
+extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *pub, uint *condition,
 				  bool *pending);
-extern int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub);
+extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *pub);
 extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
 extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
+extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *pub);
 extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
 extern int brcmf_custom_get_mac_address(unsigned char *buf);
-extern void brcmf_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
-extern void brcmf_os_sdlock_eventq(dhd_pub_t *pub);
-extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
+extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *pub);
+extern void brcmf_os_sdlock_eventq(struct brcmf_pub *pub);
+extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *pub);
 #ifdef BCMDBG
-extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
+extern int brcmf_write_to_file(struct brcmf_pub *dhd, u8 *buf, int size);
 #endif				/* BCMDBG */
 
 extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
@@ -825,13 +825,14 @@ extern void brcmf_vif_sendup(struct brcmf_info *dhd, int ifidx,
 			     unsigned char *cp, int len);
 
 /* Send packet to dongle via data channel */
-extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
+extern int brcmf_sendpkt(struct brcmf_pub *dhdp, int ifidx,\
+			 struct sk_buff *pkt);
 
-extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
-extern int brcmf_bus_start(dhd_pub_t *dhdp);
+extern int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag);
+extern int brcmf_bus_start(struct brcmf_pub *dhdp);
 
-extern void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
-extern void brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg,
+extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *dhd, char *arg);
+extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *dhd, char *arg,
 					     int enable, int master_mode);
 
 #ifdef BCMDBG
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +5 -4
index c895b81..95fcef4 100644
@@ -40,7 +40,7 @@ extern void dhd_bus_unregister(void);
 extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
 
 /* Initialize bus module: prepare for communication w/dongle */
-extern int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
+extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex);
 
 /* Send a data frame to the dongle.  Callee disposes of txp. */
 extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
@@ -58,15 +58,16 @@ extern void dhd_bus_isr(bool *InterruptRecognized,
 			bool *QueueMiniportHandleInterrupt, void *arg);
 
 /* Check for and handle local prot-specific iovar commands */
-extern int brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
+extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
 			    void *params, int plen, void *arg, int len,
 			    bool set);
 
 /* Add bus dump output to a buffer */
-extern void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
+extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp,
+				  struct brcmu_strbuf *strbuf);
 
 /* Clear any bus counters */
-extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
+extern void dhd_bus_clearcounts(struct brcmf_pub *dhdp);
 
 /* return the dongle chipid */
 extern uint dhd_bus_chip(struct dhd_bus *bus);
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +18 -16
index a336068..15c2904 100644
@@ -100,7 +100,7 @@ struct brcmf_proto {
 	unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
 };
 
-static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
+static int brcmf_proto_cdc_msg(struct brcmf_pub *dhd)
 {
 	struct brcmf_proto *prot = dhd->prot;
 	int len = le32_to_cpu(prot->msg.len) +
@@ -120,7 +120,7 @@ static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
 				      len);
 }
 
-static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
+static int brcmf_proto_cdc_cmplt(struct brcmf_pub *dhd, u32 id, u32 len)
 {
 	int ret;
 	struct brcmf_proto *prot = dhd->prot;
@@ -139,8 +139,8 @@ static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
 }
 
 int
-brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
-			    uint len)
+brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
+			    void *buf, uint len)
 {
 	struct brcmf_proto *prot = dhd->prot;
 	struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
@@ -221,7 +221,7 @@ done:
 	return ret;
 }
 
-int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
 			      void *buf, uint len)
 {
 	struct brcmf_proto *prot = dhd->prot;
@@ -275,8 +275,8 @@ done:
 
 extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
 int
-brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc, void *buf,
-		  int len)
+brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx, struct brcmf_ioctl *ioc,
+		  void *buf, int len)
 {
 	struct brcmf_proto *prot = dhd->prot;
 	int ret = -1;
@@ -356,18 +356,19 @@ done:
 	skb->ip_summed is overloaded */
 
 int
-brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
+brcmf_proto_iovar_op(struct brcmf_pub *dhdp, const char *name,
 		  void *params, int plen, void *arg, int len, bool set)
 {
 	return -ENOTSUPP;
 }
 
-void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
+void brcmf_proto_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
 {
 	brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
 }
 
-void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
+void brcmf_proto_hdrpush(struct brcmf_pub *dhd, int ifidx,
+			 struct sk_buff *pktbuf)
 {
 	struct brcmf_proto_bdc_header *h;
 
@@ -389,7 +390,8 @@ void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
 	BDC_SET_IF_IDX(h, ifidx);
 }
 
-int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
+int brcmf_proto_hdrpull(struct brcmf_pub *dhd, int *ifidx,
+			struct sk_buff *pktbuf)
 {
 	struct brcmf_proto_bdc_header *h;
 
@@ -433,7 +435,7 @@ int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
 	return 0;
 }
 
-int brcmf_proto_attach(dhd_pub_t *dhd)
+int brcmf_proto_attach(struct brcmf_pub *dhd)
 {
 	struct brcmf_proto *cdc;
 
@@ -461,13 +463,13 @@ fail:
 }
 
 /* ~NOTE~ What if another thread is waiting on the semaphore?  Holding it? */
-void brcmf_proto_detach(dhd_pub_t *dhd)
+void brcmf_proto_detach(struct brcmf_pub *dhd)
 {
 	kfree(dhd->prot);
 	dhd->prot = NULL;
 }
 
-void brcmf_proto_dstats(dhd_pub_t *dhd)
+void brcmf_proto_dstats(struct brcmf_pub *dhd)
 {
 	/* No stats from dongle added yet, copy bus stats */
 	dhd->dstats.tx_packets = dhd->tx_packets;
@@ -479,7 +481,7 @@ void brcmf_proto_dstats(dhd_pub_t *dhd)
 	return;
 }
 
-int brcmf_proto_init(dhd_pub_t *dhd)
+int brcmf_proto_init(struct brcmf_pub *dhd)
 {
 	int ret = 0;
 	char buf[128];
@@ -508,7 +510,7 @@ int brcmf_proto_init(dhd_pub_t *dhd)
 	return ret;
 }
 
-void brcmf_proto_stop(dhd_pub_t *dhd)
+void brcmf_proto_stop(struct brcmf_pub *dhd)
 {
 	/* Nothing to do for CDC */
 }
drivers/staging/brcm80211/brcmfmac/dhd_common.c +13 -13
index 5c3a5cf..fc361d1 100644
@@ -111,7 +111,7 @@ void brcmf_c_init(void)
 	brcmf_msg_level = BRCMF_ERROR_VAL;
 }
 
-static int brcmf_c_dump(dhd_pub_t *drvr, char *buf, int buflen)
+static int brcmf_c_dump(struct brcmf_pub *drvr, char *buf, int buflen)
 {
 	struct brcmu_strbuf b;
 	struct brcmu_strbuf *strbuf = &b;
@@ -169,9 +169,9 @@ static int brcmf_c_dump(dhd_pub_t *drvr, char *buf, int buflen)
 }
 
 static int
-brcmf_c_doiovar(dhd_pub_t *drvr, const struct brcmu_iovar *vi, u32 actionid,
-	    const char *name, void *params, int plen, void *arg, int len,
-	    int val_size)
+brcmf_c_doiovar(struct brcmf_pub *drvr, const struct brcmu_iovar *vi,
+		u32 actionid, const char *name, void *params, int plen,
+		void *arg, int len, int val_size)
 {
 	int bcmerror = 0;
 	s32 int_val = 0;
@@ -252,8 +252,8 @@ exit:
 	return bcmerror;
 }
 
-bool brcmf_c_prec_enq(dhd_pub_t *drvr, struct pktq *q, struct sk_buff *pkt,
-		  int prec)
+bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
+		      struct sk_buff *pkt, int prec)
 {
 	struct sk_buff *p;
 	int eprec = -1;		/* precedence to evict from */
@@ -307,7 +307,7 @@ bool brcmf_c_prec_enq(dhd_pub_t *drvr, struct pktq *q, struct sk_buff *pkt,
 }
 
 static int
-brcmf_c_iovar_op(dhd_pub_t *drvr, const char *name,
+brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,
 	     void *params, int plen, void *arg, int len, bool set)
 {
 	int bcmerror = 0;
@@ -360,7 +360,7 @@ exit:
 	return bcmerror;
 }
 
-int brcmf_c_ioctl(dhd_pub_t *drvr, struct brcmf_c_ioctl *ioc, void *buf,
+int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc, void *buf,
 		  uint buflen)
 {
 	int bcmerror = 0;
@@ -877,7 +877,7 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
 }
 
 void
-brcmf_c_pktfilter_offload_enable(dhd_pub_t *drvr, char *arg, int enable,
+brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
 			     int master_mode)
 {
 	char *argv[8];
@@ -948,7 +948,7 @@ fail:
 	kfree(arg_org);
 }
 
-void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
+void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
 {
 	const char *str;
 	struct brcmf_pkt_filter pkt_filter;
@@ -1084,7 +1084,7 @@ fail:
 	kfree(buf);
 }
 
-void brcmf_c_arp_offload_set(dhd_pub_t *drvr, int arp_mode)
+void brcmf_c_arp_offload_set(struct brcmf_pub *drvr, int arp_mode)
 {
 	char iovbuf[32];
 	int retcode;
@@ -1101,7 +1101,7 @@ void brcmf_c_arp_offload_set(dhd_pub_t *drvr, int arp_mode)
 			   __func__, arp_mode));
 }
 
-void brcmf_c_arp_offload_enable(dhd_pub_t *drvr, int arp_enable)
+void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable)
 {
 	char iovbuf[32];
 	int retcode;
@@ -1118,7 +1118,7 @@ void brcmf_c_arp_offload_enable(dhd_pub_t *drvr, int arp_enable)
 			   __func__, arp_enable));
 }
 
-int brcmf_c_preinit_ioctls(dhd_pub_t *drvr)
+int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
 {
 	char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];	/*  Room for
 				 "event_msgs" + '\0' + bitvec  */
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +21 -20

161 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_proto.h +19 -16
index c78ae94..afec597 100644
@@ -30,48 +30,51 @@
  */
 
 /* Linkage, sets prot link and updates hdrlen in pub */
-extern int brcmf_proto_attach(dhd_pub_t *dhdp);
+extern int brcmf_proto_attach(struct brcmf_pub *dhdp);
 
 /* Unlink, frees allocated protocol memory (including dhd_prot) */
-extern void brcmf_proto_detach(dhd_pub_t *dhdp);
+extern void brcmf_proto_detach(struct brcmf_pub *dhdp);
 
 /* Initialize protocol: sync w/dongle state.
  * Sets dongle media info (iswl, drv_version, mac address).
  */
-extern int brcmf_proto_init(dhd_pub_t *dhdp);
+extern int brcmf_proto_init(struct brcmf_pub *dhdp);
 
 /* Stop protocol: sync w/dongle state. */
-extern void brcmf_proto_stop(dhd_pub_t *dhdp);
+extern void brcmf_proto_stop(struct brcmf_pub *dhdp);
 
 /* Add any protocol-specific data header.
  * Caller must reserve prot_hdrlen prepend space.
  */
-extern void brcmf_proto_hdrpush(dhd_pub_t *, int ifidx, struct sk_buff *txp);
+extern void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx,
+				struct sk_buff *txp);
 
 /* Remove any protocol-specific data header. */
-extern int brcmf_proto_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
+extern int brcmf_proto_hdrpull(struct brcmf_pub *, int *ifidx,
+			       struct sk_buff *rxp);
 
 /* Use protocol to issue ioctl to dongle */
-extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc,
-			     void *buf, int len);
+extern int brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx,
+			     struct brcmf_ioctl *ioc, void *buf, int len);
 
 /* Check for and handle local prot-specific iovar commands */
-extern int brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
-			     void *params, int plen, void *arg, int len,
-			     bool set);
+extern int brcmf_proto_iovar_op(struct brcmf_pub *dhdp, const char *name,
+				void *params, int plen, void *arg, int len,
+				bool set);
 
 /* Add prot dump output to a buffer */
-extern void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
+extern void brcmf_proto_dump(struct brcmf_pub *dhdp,
+			     struct brcmu_strbuf *strbuf);
 
 /* Update local copy of dongle statistics */
-extern void brcmf_proto_dstats(dhd_pub_t *dhdp);
+extern void brcmf_proto_dstats(struct brcmf_pub *dhdp);
 
-extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, struct brcmf_c_ioctl *ioc,
+extern int brcmf_c_ioctl(struct brcmf_pub *dhd_pub, struct brcmf_c_ioctl *ioc,
 			 void *buf, uint buflen);
 
-extern int brcmf_c_preinit_ioctls(dhd_pub_t *dhd);
+extern int brcmf_c_preinit_ioctls(struct brcmf_pub *dhd);
 
-extern int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+extern int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
 				     void *buf, uint len);
 
 #endif				/* _dhd_proto_h_ */
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +17 -15
index ab96d37..da5a2ff 100644
@@ -23,6 +23,7 @@
 #include <linux/sched.h>
 #include <linux/mmc/sdio.h>
 #include <linux/mmc/sdio_func.h>
+#include <linux/semaphore.h>
 #include <linux/firmware.h>
 #include <asm/unaligned.h>
 #include <defs.h>
@@ -455,7 +456,7 @@ struct chip_info {
 
 /* Private data for SDIO bus interaction */
 typedef struct dhd_bus {
-	dhd_pub_t *dhd;
+	struct brcmf_pub *dhd;
 
 	struct brcmf_sdio *sdh;	/* Handle for BCMSDH calls */
 	struct chip_info *ci;	/* Chip info struct */
@@ -782,8 +783,8 @@ static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start);
 #endif
 
 #ifdef BCMDBG
-static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
-				       uint msglen);
+static int brcmf_sdbrcm_bus_console_in(struct brcmf_pub *drvr,
+				       unsigned char *msg, uint msglen);
 static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size);
 static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus);
 #endif				/* BCMDBG  */
@@ -1425,7 +1426,7 @@ static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
 	uint datalen;
 	u8 tx_prec_map;
 
-	dhd_pub_t *dhd = bus->dhd;
+	struct brcmf_pub *dhd = bus->dhd;
 	struct sdpcmd_regs *regs = bus->regs;
 
 	DHD_TRACE(("%s: Enter\n", __func__));
@@ -1792,7 +1793,7 @@ dhd_dump_pct(struct brcmu_strbuf *strbuf, char *desc, uint num, uint div)
 	}
 }
 
-void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
+void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
 {
 	dhd_bus_t *bus = dhdp->bus;
 
@@ -1893,7 +1894,7 @@ void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
 		    bus->sleeping);
 }
 
-void dhd_bus_clearcounts(dhd_pub_t *dhdp)
+void dhd_bus_clearcounts(struct brcmf_pub *dhdp)
 {
 	dhd_bus_t *bus = (dhd_bus_t *) dhdp->bus;
 
@@ -2802,7 +2803,7 @@ exit:
 	brcmf_sdbrcm_sdunlock(bus);
 
 	if (actionid == IOV_SVAL(IOV_DEVRESET) && bool_val == false)
-		brcmf_c_preinit_ioctls((dhd_pub_t *) bus->dhd);
+		brcmf_c_preinit_ioctls((struct brcmf_pub *) bus->dhd);
 
 	return bcmerror;
 }
@@ -2948,7 +2949,7 @@ fail:
 }
 
 int
-brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
+brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
 			  void *params, int plen, void *arg, int len, bool set)
 {
 	dhd_bus_t *bus = dhdp->bus;
@@ -3127,7 +3128,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
 #endif		/* defined(OOB_INTR_ONLY) */
 }
 
-int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
+int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
 {
 	dhd_bus_t *bus = dhdp->bus;
 	struct brcmf_timeout tmo;
@@ -5059,7 +5060,7 @@ brcmf_sdbrcm_checkdied(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
 }
 #endif				/* SDTEST */
 
-extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
+extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *dhdp)
 {
 	dhd_bus_t *bus;
 
@@ -5157,10 +5158,10 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
 }
 
 #ifdef BCMDBG
-static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
-				       uint msglen)
+static int brcmf_sdbrcm_bus_console_in(struct brcmf_pub *drvr,
+				       unsigned char *msg, uint msglen)
 {
-	dhd_bus_t *bus = dhdp->bus;
+	dhd_bus_t *bus = drvr->bus;
 	u32 addr, val;
 	int rv;
 	struct sk_buff *pkt;
@@ -5973,7 +5974,7 @@ uint dhd_bus_hdrlen(struct dhd_bus *bus)
 	return SDPCM_HDRLEN;
 }
 
-int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
+int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
 {
 	int bcmerror = 0;
 	dhd_bus_t *bus;
@@ -6017,7 +6018,8 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
 				if (brcmf_sdbrcm_probe_init(bus, bus->sdh)) {
 					/* Re-init bus, enable F2 transfer */
 					brcmf_sdbrcm_bus_init(
-						(dhd_pub_t *) bus->dhd, false);
+						(struct brcmf_pub *) bus->dhd,
+						false);
 
 					bus->dhd->dongle_reset = false;
 					bus->dhd->up = true;
Signature · 1 line
1.7.1
author
#99 lore raw

PATCH 92/119 staging: brmc80211: cleaned up sdio related error codes

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Replaced Broadcom proprietary error codes with Linux native ones.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h      |    4 --
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |   52 +++++++------------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |   43 ++++++++--------
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    5 +-
 4 files changed, 44 insertions(+), 60 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +0 -4
index f1d04e0..9359bba 100644
@@ -19,10 +19,6 @@
 
 #include "sdio_host.h"
 
-#define SDIOH_API_RC_SUCCESS                          (0x00)
-#define SDIOH_API_RC_FAIL	                      (0x01)
-#define SDIOH_API_SUCCESS(status) (status == 0)
-
 #define SDIOH_READ              0	/* Read request */
 #define SDIOH_WRITE             1	/* Write request */
 
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +19 -33

172 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +22 -21

172 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +3 -2
index 39b0cbe..f10cddd 100644
@@ -20,6 +20,7 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/sdio_ids.h>
+#include <linux/errno.h>
 #include <net/cfg80211.h>
 
 #include <defs.h>
@@ -227,7 +228,7 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
 	if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
 		sd_err(("%s: no handler registered, will not enable\n",
 			__func__));
-		return SDIOH_API_RC_FAIL;
+		return -EINVAL;
 	}
 
 	/* Ensure atomicity for enable/disable calls */
@@ -241,7 +242,7 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
 
 	spin_unlock_irqrestore(&sdos->lock, flags);
 
-	return SDIOH_API_RC_SUCCESS;
+	return 0;
 }
 
 /*
Signature · 1 line
1.7.1
author
#100 lore raw

PATCH 93/119 staging: brcm80211: removed global function declarations from .c files

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Function declarations were moved to .h files.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |    6 ------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |    9 +++------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h  |   10 +++++-----
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    8 --------
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c       |    1 -
 drivers/staging/brcm80211/brcmfmac/sdio_host.h     |    9 +++++++++
 6 files changed, 17 insertions(+), 26 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -6
index ce8323c..1198ee6 100644
@@ -31,8 +31,6 @@
 #include <brcmu_wifi.h>
 #include "sdio_host.h"
 
-extern void brcmf_sdbrcm_isr(void *args);
-
 #include "dngl_stats.h"
 #include "dhd.h"
 #include "dhd_bus.h"
@@ -195,8 +193,6 @@ int brcmf_sdio_remove(struct device *dev)
 	return 0;
 }
 
-extern int brcmf_sdio_function_init(void);
-
 int brcmf_sdio_register(struct brcmf_sdioh_driver *driver)
 {
 	drvinfo = *driver;
@@ -205,8 +201,6 @@ int brcmf_sdio_register(struct brcmf_sdioh_driver *driver)
 	return brcmf_sdio_function_init();
 }
 
-extern void brcmf_sdio_function_cleanup(void);
-
 void brcmf_sdio_unregister(void)
 {
 	brcmf_sdio_function_cleanup();
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +3 -6
index 0413a59..b7726f2 100644
@@ -33,13 +33,9 @@
 #include "dhd.h"
 #include "bcmsdh_sdmmc.h"
 
-extern int brcmf_sdio_function_init(void);
-extern void brcmf_sdio_function_cleanup(void);
-
 static void brcmf_sdioh_irqhandler(struct sdio_func *func);
 static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
 static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
-extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
 
 uint sd_f2_blocksize = 512;	/* Default blocksize */
 
@@ -51,8 +47,9 @@ BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
 
 #define DMA_ALIGN_MASK	0x03
 
-int brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
-			     int regsize, u32 *data);
+static int
+brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
+			 int regsize, u32 *data);
 
 static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
 {
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +5 -5
index 9c5eee0..a0f985c 100644
@@ -61,10 +61,6 @@
 #define sd_ctrl(x)
 #endif
 
-/* Allocate/init/free per-OS private data */
-extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
-extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
-
 #define BLOCK_SIZE_64 64
 #define BLOCK_SIZE_512 512
 #define BLOCK_SIZE_4318 64
@@ -108,6 +104,10 @@ struct sdioh_info {
 /* Global message bits */
 extern uint sd_msglevel;
 
+/* Allocate/init/free per-OS private data */
+extern int  brcmf_sdioh_osinit(struct sdioh_info *sd);
+extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
+
 /* OS-independent interrupt handler */
 extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
 
@@ -124,7 +124,7 @@ extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
 extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
 
 /* Interrupt (de)registration routines */
-extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
+extern int  brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
 extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
 
 typedef struct _BCMSDH_SDMMC_INSTANCE {
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +0 -8
index f10cddd..e5c3b25 100644
@@ -56,12 +56,6 @@
 #include "dhd_dbg.h"
 #include "wl_cfg80211.h"
 
-extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
-extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
-
-int brcmf_sdio_function_init(void);
-void brcmf_sdio_function_cleanup(void);
-
 /* module param defaults */
 static int clockoverride;
 
@@ -73,8 +67,6 @@ PBCMSDH_SDMMC_INSTANCE gInstance;
 /* Maximum number of bcmsdh_sdmmc devices supported by driver */
 #define BCMSDH_SDMMC_MAX_DEVICES 1
 
-extern int brcmf_sdio_probe(struct device *dev);
-extern int brcmf_sdio_remove(struct device *dev);
 struct device sdmmc_dev;
 
 static int brcmf_ops_sdio_probe(struct sdio_func *func,
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +0 -1
index 15c2904..e28b727 100644
@@ -273,7 +273,6 @@ done:
 	return ret;
 }
 
-extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
 int
 brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx, struct brcmf_ioctl *ioc,
 		  void *buf, int len)
drivers/staging/brcm80211/brcmfmac/sdio_host.h +9 -0
index 6938abc..85e3d6a 100644
@@ -209,11 +209,20 @@ struct brcmf_sdioh_driver {
 	void (*detach) (void *ch);
 };
 
+struct sdioh_info;
+
 /* platform specific/high level functions */
+extern int brcmf_sdio_function_init(void);
 extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver);
 extern void brcmf_sdio_unregister(void);
 extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
 extern void brcmf_sdio_device_remove(void *sdh);
+extern void brcmf_sdio_function_cleanup(void);
+
+extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
+extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
+extern int brcmf_sdio_probe(struct device *dev);
+extern int brcmf_sdio_remove(struct device *dev);
 
 /* Function to pass device-status bits to DHD. */
 extern u32 brcmf_sdcard_get_dstatus(void *sdh);
Signature · 1 line
1.7.1
author
#101 lore raw

PATCH 94/119 staging: brcm80211: removed last occurrences of bcmsdh/BCMSDH

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. This was a Broadcom specific acronym.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |  282 ++++++++++----------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |   14 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |   35 ++--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h  |   16 +-
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |   27 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |   34 ++--
 drivers/staging/brcm80211/brcmfmac/sdio_host.h     |   47 ++--
 7 files changed, 225 insertions(+), 230 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +141 -141
index d785b05..5eb95b2 100644
@@ -13,7 +13,7 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
-/* ****************** BCMSDH Interface Functions *************************** */
+/* ****************** SDIOCARD Interface Functions ***************************/
 
 #include <linux/types.h>
 #include <linux/netdevice.h>
@@ -31,7 +31,7 @@
 #include "dhd.h"
 
 #define SDIOH_API_ACCESS_RETRY_LIMIT	2
-const uint bcmsdh_msglevel = BCMSDH_ERROR_VAL;
+const uint brcmf_sdio_msglevel = BRCMF_SD_ERROR_VAL;
 
 struct brcmf_sdio {
 	bool init_success;	/* underlying driver successfully attached */
@@ -42,49 +42,49 @@ struct brcmf_sdio {
 	u32 sbwad;		/* Save backplane window address */
 };
 /* local copy of bcm sd handler */
-struct brcmf_sdio *l_bcmsdh;
+static struct brcmf_sdio *l_card;
 
 struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
 {
-	struct brcmf_sdio *bcmsdh;
+	struct brcmf_sdio *card;
 
-	bcmsdh = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
-	if (bcmsdh == NULL) {
-		BCMSDH_ERROR(("bcmsdh_attach: out of memory"));
+	card = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
+	if (card == NULL) {
+		BRCMF_SD_ERROR(("sdcard_attach: out of memory"));
 		return NULL;
 	}
 
 	/* save the handler locally */
-	l_bcmsdh = bcmsdh;
+	l_card = card;
 
-	bcmsdh->sdioh = brcmf_sdioh_attach(cfghdl, irq);
-	if (!bcmsdh->sdioh) {
-		brcmf_sdcard_detach(bcmsdh);
+	card->sdioh = brcmf_sdioh_attach(cfghdl, irq);
+	if (!card->sdioh) {
+		brcmf_sdcard_detach(card);
 		return NULL;
 	}
 
-	bcmsdh->init_success = true;
+	card->init_success = true;
 
 	*regsva = (u32 *) SI_ENUM_BASE;
 
 	/* Report the BAR, to fix if needed */
-	bcmsdh->sbwad = SI_ENUM_BASE;
-	return bcmsdh;
+	card->sbwad = SI_ENUM_BASE;
+	return card;
 }
 
 int brcmf_sdcard_detach(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
-	if (bcmsdh != NULL) {
-		if (bcmsdh->sdioh) {
-			brcmf_sdioh_detach(bcmsdh->sdioh);
-			bcmsdh->sdioh = NULL;
+	if (card != NULL) {
+		if (card->sdioh) {
+			brcmf_sdioh_detach(card->sdioh);
+			card->sdioh = NULL;
 		}
-		kfree(bcmsdh);
+		kfree(card);
 	}
 
-	l_bcmsdh = NULL;
+	l_card = NULL;
 	return 0;
 }
 
@@ -92,19 +92,19 @@ int
 brcmf_sdcard_iovar_op(void *sdh, const char *name,
 		void *params, int plen, void *arg, int len, bool set)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	return brcmf_sdioh_iovar_op(bcmsdh->sdioh, name, params, plen, arg,
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+	return brcmf_sdioh_iovar_op(card->sdioh, name, params, plen, arg,
 				    len, set);
 }
 
 bool brcmf_sdcard_intr_query(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	int status;
 	bool on;
 
-	ASSERT(bcmsdh);
-	status = brcmf_sdioh_interrupt_query(bcmsdh->sdioh, &on);
+	ASSERT(card);
+	status = brcmf_sdioh_interrupt_query(card->sdioh, &on);
 	if (status == 0)
 		return false;
 	else
@@ -113,47 +113,47 @@ bool brcmf_sdcard_intr_query(void *sdh)
 
 int brcmf_sdcard_intr_enable(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	ASSERT(bcmsdh);
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+	ASSERT(card);
 
-	return brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
+	return brcmf_sdioh_interrupt_set(card->sdioh, true);
 }
 
 int brcmf_sdcard_intr_disable(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	ASSERT(bcmsdh);
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+	ASSERT(card);
 
-	return brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
+	return brcmf_sdioh_interrupt_set(card->sdioh, false);
 }
 
-int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
+int brcmf_sdcard_intr_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	ASSERT(bcmsdh);
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+	ASSERT(card);
 
-	return brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
+	return brcmf_sdioh_interrupt_register(card->sdioh, fn, argh);
 }
 
 int brcmf_sdcard_intr_dereg(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	ASSERT(bcmsdh);
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+	ASSERT(card);
 
-	return brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
+	return brcmf_sdioh_interrupt_deregister(card->sdioh);
 }
 
 #if defined(BCMDBG)
 bool brcmf_sdcard_intr_pending(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
 	ASSERT(sdh);
-	return brcmf_sdioh_interrupt_pending(bcmsdh->sdioh);
+	return brcmf_sdioh_interrupt_pending(card->sdioh);
 }
 #endif
 
-int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
+int brcmf_sdcard_devremove_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh)
 {
 	ASSERT(sdh);
 
@@ -163,17 +163,17 @@ int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
 
 u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	int status;
 #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
 	s32 retry = 0;
 #endif
 	u8 data = 0;
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card->init_success);
 
 #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
 	do {
@@ -181,7 +181,7 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
 			udelay(1000);
 #endif
 		status =
-		    brcmf_sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
+		    brcmf_sdioh_cfg_read(card->sdioh, fnc_num, addr,
 				   (u8 *) &data);
 #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
 	} while (status != 0
@@ -190,7 +190,7 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
 	if (err)
 		*err = status;
 
-	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
+	BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
 		     __func__, fnc_num, addr, data));
 
 	return data;
@@ -199,16 +199,16 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
 void
 brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	int status;
 #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
 	s32 retry = 0;
 #endif
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card->init_success);
 
 #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
 	do {
@@ -216,7 +216,7 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
 			udelay(1000);
 #endif
 		status =
-		    brcmf_sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
+		    brcmf_sdioh_cfg_write(card->sdioh, fnc_num, addr,
 				    (u8 *) &data);
 #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
 	} while (status != 0
@@ -225,28 +225,28 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
 	if (err)
 		*err = status;
 
-	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
+	BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
 		     __func__, fnc_num, addr, data));
 }
 
 u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	int status;
 	u32 data = 0;
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card->init_success);
 
-	status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+	status = brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
 		SDIOH_READ, fnc_num, addr, &data, 4);
 
 	if (err)
 		*err = status;
 
-	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
+	BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
 		     __func__, fnc_num, addr, data));
 
 	return data;
@@ -256,28 +256,28 @@ void
 brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
 		      int *err)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	int status;
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card->init_success);
 
 	status =
-	    brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+	    brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
 			       SDIOH_WRITE, fnc_num, addr, &data, 4);
 
 	if (err)
 		*err = status;
 
-	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
+	BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
 		     __func__, fnc_num, addr, data));
 }
 
 int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	int status;
 
 	u8 *tmp_buf, *tmp_ptr;
@@ -285,21 +285,21 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
 	bool ascii = func & ~0xf;
 	func &= 0x7;
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card->init_success);
 	ASSERT(cis);
 	ASSERT(length <= SBSDIO_CIS_SIZE_LIMIT);
 
-	status = brcmf_sdioh_cis_read(bcmsdh->sdioh, func, cis, length);
+	status = brcmf_sdioh_cis_read(card->sdioh, func, cis, length);
 
 	if (ascii) {
 		/* Move binary bits to tmp and format them
 			 into the provided buffer. */
 		tmp_buf = kmalloc(length, GFP_ATOMIC);
 		if (tmp_buf == NULL) {
-			BCMSDH_ERROR(("%s: out of memory\n", __func__));
+			BRCMF_SD_ERROR(("%s: out of memory\n", __func__));
 			return -ENOMEM;
 		}
 		memcpy(tmp_buf, cis, length);
@@ -318,16 +318,16 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
 static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
 {
 	int err = 0;
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+	brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
 			 (address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
 	if (!err)
-		brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1,
+		brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
 				       SBSDIO_FUNC1_SBADDRMID,
 				       (address >> 16) & SBSDIO_SBADDRMID_MASK,
 				       &err);
 	if (!err)
-		brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1,
+		brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
 				       SBSDIO_FUNC1_SBADDRHIGH,
 				       (address >> 24) & SBSDIO_SBADDRHIGH_MASK,
 				       &err);
@@ -337,35 +337,35 @@ static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
 
 u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	int status;
 	u32 word = 0;
 	uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
 
-	BCMSDH_INFO(("%s:fun = 1, addr = 0x%x, ", __func__, addr));
+	BRCMF_SD_INFO(("%s:fun = 1, addr = 0x%x, ", __func__, addr));
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card->init_success);
 
-	if (bar0 != bcmsdh->sbwad) {
-		if (brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0))
+	if (bar0 != card->sbwad) {
+		if (brcmf_sdcard_set_sbaddr_window(card, bar0))
 			return 0xFFFFFFFF;
 
-		bcmsdh->sbwad = bar0;
+		card->sbwad = bar0;
 	}
 
 	addr &= SBSDIO_SB_OFT_ADDR_MASK;
 	if (size == 4)
 		addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
 
-	status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+	status = brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
 				    SDIOH_READ, SDIO_FUNC_1, addr, &word, size);
 
-	bcmsdh->regfail = (status != 0);
+	card->regfail = (status != 0);
 
-	BCMSDH_INFO(("u32data = 0x%x\n", word));
+	BRCMF_SD_INFO(("u32data = 0x%x\n", word));
 
 	/* if ok, return appropriately masked word */
 	if (status == 0) {
@@ -377,52 +377,52 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
 		case sizeof(u32):
 			return word;
 		default:
-			bcmsdh->regfail = true;
+			card->regfail = true;
 
 		}
 	}
 
 	/* otherwise, bad sdio access or invalid size */
-	BCMSDH_ERROR(("%s: error reading addr 0x%04x size %d\n", __func__,
+	BRCMF_SD_ERROR(("%s: error reading addr 0x%04x size %d\n", __func__,
 		      addr, size));
 	return 0xFFFFFFFF;
 }
 
 u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	int status;
 	uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
 	int err = 0;
 
-	BCMSDH_INFO(("%s:fun = 1, addr = 0x%x, uint%ddata = 0x%x\n",
+	BRCMF_SD_INFO(("%s:fun = 1, addr = 0x%x, uint%ddata = 0x%x\n",
 		     __func__, addr, size * 8, data));
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card->init_success);
 
-	if (bar0 != bcmsdh->sbwad) {
-		err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
+	if (bar0 != card->sbwad) {
+		err = brcmf_sdcard_set_sbaddr_window(card, bar0);
 		if (err)
 			return err;
 
-		bcmsdh->sbwad = bar0;
+		card->sbwad = bar0;
 	}
 
 	addr &= SBSDIO_SB_OFT_ADDR_MASK;
 	if (size == 4)
 		addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
 	status =
-	    brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+	    brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
 			       SDIOH_WRITE, SDIO_FUNC_1, addr, &data, size);
-	bcmsdh->regfail = (status != 0);
+	card->regfail = (status != 0);
 
 	if (status == 0)
 		return 0;
 
-	BCMSDH_ERROR(("%s: error writing 0x%08x to addr 0x%04x size %d\n",
+	BRCMF_SD_ERROR(("%s: error writing 0x%08x to addr 0x%04x size %d\n",
 		      __func__, data, addr, size));
 	return 0xFFFFFFFF;
 }
@@ -433,9 +433,9 @@ bool brcmf_sdcard_regfail(void *sdh)
 }
 
 int
-brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
+brcmf_sdcard_recv_buf(struct brcmf_sdio *card, u32 addr, uint fn, uint flags,
 		u8 *buf, uint nbytes, struct sk_buff *pkt,
-		bcmsdh_cmplt_fn_t complete, void *handle)
+		brcmf_sdio_cmplt_fn_t complete, void *handle)
 {
 	int status;
 	uint incr_fix;
@@ -443,10 +443,10 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
 	uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
 	int err = 0;
 
-	ASSERT(bcmsdh);
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card);
+	ASSERT(card->init_success);
 
-	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
+	BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
 		     __func__, fn, addr, nbytes));
 
 	/* Async not implemented yet */
@@ -454,12 +454,12 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
 	if (flags & SDIO_REQ_ASYNC)
 		return -ENOTSUPP;
 
-	if (bar0 != bcmsdh->sbwad) {
-		err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
+	if (bar0 != card->sbwad) {
+		err = brcmf_sdcard_set_sbaddr_window(card, bar0);
 		if (err)
 			return err;
 
-		bcmsdh->sbwad = bar0;
+		card->sbwad = bar0;
 	}
 
 	addr &= SBSDIO_SB_OFT_ADDR_MASK;
@@ -469,7 +469,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
 	if (width == 4)
 		addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
 
-	status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+	status = brcmf_sdioh_request_buffer(card->sdioh, SDIOH_DATA_PIO,
 		incr_fix, SDIOH_READ, fn, addr, width, nbytes, buf, pkt);
 
 	return status;
@@ -478,18 +478,18 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
 int
 brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
 		u8 *buf, uint nbytes, void *pkt,
-		bcmsdh_cmplt_fn_t complete, void *handle)
+		brcmf_sdio_cmplt_fn_t complete, void *handle)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 	uint incr_fix;
 	uint width;
 	uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
 	int err = 0;
 
-	ASSERT(bcmsdh);
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card);
+	ASSERT(card->init_success);
 
-	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
+	BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
 		     __func__, fn, addr, nbytes));
 
 	/* Async not implemented yet */
@@ -497,12 +497,12 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
 	if (flags & SDIO_REQ_ASYNC)
 		return -ENOTSUPP;
 
-	if (bar0 != bcmsdh->sbwad) {
-		err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
+	if (bar0 != card->sbwad) {
+		err = brcmf_sdcard_set_sbaddr_window(card, bar0);
 		if (err)
 			return err;
 
-		bcmsdh->sbwad = bar0;
+		card->sbwad = bar0;
 	}
 
 	addr &= SBSDIO_SB_OFT_ADDR_MASK;
@@ -512,69 +512,69 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
 	if (width == 4)
 		addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
 
-	return brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+	return brcmf_sdioh_request_buffer(card->sdioh, SDIOH_DATA_PIO,
 		incr_fix, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt);
 }
 
 int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
-	ASSERT(bcmsdh);
-	ASSERT(bcmsdh->init_success);
+	ASSERT(card);
+	ASSERT(card->init_success);
 	ASSERT((addr & SBSDIO_SBWINDOW_MASK) == 0);
 
 	addr &= SBSDIO_SB_OFT_ADDR_MASK;
 	addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
 
-	return brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+	return brcmf_sdioh_request_buffer(card->sdioh, SDIOH_DATA_PIO,
 		SDIOH_DATA_INC, (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
 		addr, 4, nbytes, buf, NULL);
 }
 
 int brcmf_sdcard_abort(void *sdh, uint fn)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
-	return brcmf_sdioh_abort(bcmsdh->sdioh, fn);
+	return brcmf_sdioh_abort(card->sdioh, fn);
 }
 
 int brcmf_sdcard_start(void *sdh, int stage)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
-	return brcmf_sdioh_start(bcmsdh->sdioh, stage);
+	return brcmf_sdioh_start(card->sdioh, stage);
 }
 
 int brcmf_sdcard_stop(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
-	return brcmf_sdioh_stop(bcmsdh->sdioh);
+	return brcmf_sdioh_stop(card->sdioh);
 }
 
 int brcmf_sdcard_query_device(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	bcmsdh->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
-	return bcmsdh->vendevid;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+	card->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
+	return card->vendevid;
 }
 
 uint brcmf_sdcard_query_iofnum(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	return brcmf_sdioh_query_iofnum(bcmsdh->sdioh);
+	return brcmf_sdioh_query_iofnum(card->sdioh);
 }
 
 int brcmf_sdcard_reset(struct brcmf_sdio *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
-	return brcmf_sdioh_reset(bcmsdh->sdioh);
+	return brcmf_sdioh_reset(card->sdioh);
 }
 
 void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh)
@@ -591,12 +591,12 @@ u32 brcmf_sdcard_get_dstatus(void *sdh)
 
 u32 brcmf_sdcard_cur_sbwad(void *sdh)
 {
-	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+	struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
 
-	if (!bcmsdh)
-		bcmsdh = l_bcmsdh;
+	if (!card)
+		card = l_card;
 
-	return bcmsdh->sbwad;
+	return card->sbwad;
 }
 
 void brcmf_sdcard_chipinfo(void *sdh, u32 chip, u32 chiprev)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +7 -7
index 1198ee6..a3cf05f 100644
@@ -38,8 +38,8 @@
 /**
  * SDIO Host Controller info
  */
-struct bcmsdh_hc {
-	struct bcmsdh_hc *next;
+struct sdio_hc {
+	struct sdio_hc *next;
 	struct device *dev;	/* platform device handle */
 	void *regs;		/* SDIO Host Controller address */
 	struct brcmf_sdio *sdh;	/* SDIO Host Controller handle */
@@ -49,7 +49,7 @@ struct bcmsdh_hc {
 					as edge and etc */
 	bool oob_irq_registered;
 };
-static struct bcmsdh_hc *sdhcinfo;
+static struct sdio_hc *sdhcinfo;
 
 /* driver info, initialized when brcmf_sdio_register is called */
 static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
@@ -111,7 +111,7 @@ EXPORT_SYMBOL(brcmf_sdio_remove);
 
 int brcmf_sdio_probe(struct device *dev)
 {
-	struct bcmsdh_hc *sdhc = NULL;
+	struct sdio_hc *sdhc = NULL;
 	unsigned long regs = 0;
 	struct brcmf_sdio *sdh = NULL;
 	int irq = 0;
@@ -119,7 +119,7 @@ int brcmf_sdio_probe(struct device *dev)
 	unsigned long irq_flags = 0;
 
 	/* allocate SDIO Host Controller state info */
-	sdhc = kzalloc(sizeof(struct bcmsdh_hc), GFP_ATOMIC);
+	sdhc = kzalloc(sizeof(struct sdio_hc), GFP_ATOMIC);
 	if (!sdhc) {
 		SDLX_MSG(("%s: out of memory\n", __func__));
 		goto err;
@@ -128,7 +128,7 @@ int brcmf_sdio_probe(struct device *dev)
 
 	sdh = brcmf_sdcard_attach((void *)0, (void **)&regs, irq);
 	if (!sdh) {
-		SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
+		SDLX_MSG(("%s: attach failed\n", __func__));
 		goto err;
 	}
 
@@ -166,7 +166,7 @@ err:
 
 int brcmf_sdio_remove(struct device *dev)
 {
-	struct bcmsdh_hc *sdhc, *prev;
+	struct sdio_hc *sdhc, *prev;
 
 	sdhc = sdhcinfo;
 	drvinfo.detach(sdhc->ch);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +19 -16
index b7726f2..d0e9b3d 100644
@@ -27,7 +27,7 @@
 #include <brcmu_utils.h>
 #include <brcmu_wifi.h>
 #include "sdio_host.h"
-#include "bcmsdbus.h"		/* bcmsdh to/from specific controller APIs */
+#include "bcmsdbus.h"
 #include "sdiovar.h"		/* ioctl/iovars */
 #include "dngl_stats.h"
 #include "dhd.h"
@@ -83,8 +83,8 @@ static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
 	err_ret = sdio_enable_func(gInstance->func[1]);
 	sdio_release_host(gInstance->func[1]);
 	if (err_ret) {
-		sd_err(("bcmsdh_sdmmc: Failed to enable F1 Err: 0x%08x",
-			err_ret));
+		sd_err(("brcmf_sdioh_enablefuncs: Failed to enable F1 "
+			"Err: 0x%08x", err_ret));
 	}
 
 	return false;
@@ -128,7 +128,7 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
 	sd->client_block_size[1] = 64;
 	err_ret = sdio_set_block_size(gInstance->func[1], 64);
 	if (err_ret)
-		sd_err(("bcmsdh_sdmmc: Failed to set F1 blocksize\n"));
+		sd_err(("brcmf_sdioh_attach: Failed to set F1 blocksize\n"));
 
 	/* Release host controller F1 */
 	sdio_release_host(gInstance->func[1]);
@@ -141,8 +141,8 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
 		err_ret =
 		    sdio_set_block_size(gInstance->func[2], sd_f2_blocksize);
 		if (err_ret)
-			sd_err(("bcmsdh_sdmmc: Failed to set F2 blocksize "
-				"to %d\n", sd_f2_blocksize));
+			sd_err(("brcmf_sdioh_attach: Failed to set F2 blocksize"
+				" to %d\n", sd_f2_blocksize));
 
 		/* Release host controller F2 */
 		sdio_release_host(gInstance->func[2]);
@@ -549,7 +549,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 						    sdio_enable_func
 						    (gInstance->func[2]);
 						if (err_ret)
-							sd_err(("bcmsdh_sdmmc: enable F2 failed:%d",
+							sd_err(("request_byte: "
+								"enable F2 "
+								"failed:%d",
 								 err_ret));
 					} else {
 						/* Disable Function 2 */
@@ -557,7 +559,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 						    sdio_disable_func
 						    (gInstance->func[2]);
 						if (err_ret)
-							sd_err(("bcmsdh_sdmmc: Disab F2 failed:%d",
+							sd_err(("request_byte: "
+								"Disab F2 "
+								"failed:%d",
 								 err_ret));
 					}
 					sdio_release_host(gInstance->func[2]);
@@ -577,7 +581,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 				sdio_release_host(gInstance->func[func]);
 			}
 			else if (regaddr < 0xF0) {
-				sd_err(("bcmsdh_sdmmc: F0 Wr:0x%02x: write "
+				sd_err(("brcmf: F0 Wr:0x%02x: write "
 					"disallowed\n", regaddr));
 			} else {
 				/* Claim host controller, perform F0 write,
@@ -613,7 +617,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 	}
 
 	if (err_ret)
-		sd_err(("bcmsdh_sdmmc: Failed to %s byte F%d:@0x%05x=%02x, "
+		sd_err(("brcmf: Failed to %s byte F%d:@0x%05x=%02x, "
 			"Err: %d\n", rw ? "Write" : "Read", func, regaddr,
 			*byte, err_ret));
 
@@ -666,7 +670,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
 	sdio_release_host(gInstance->func[func]);
 
 	if (err_ret) {
-		sd_err(("bcmsdh_sdmmc: Failed to %s word, Err: 0x%08x",
+		sd_err(("brcmf: Failed to %s word, Err: 0x%08x",
 			rw ? "Write" : "Read", err_ret));
 	}
 
@@ -896,12 +900,11 @@ brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
 	return SUCCESS;
 }
 
-/* bcmsdh_sdmmc interrupt handler */
 static void brcmf_sdioh_irqhandler(struct sdio_func *func)
 {
 	struct sdioh_info *sd;
 
-	sd_trace(("bcmsdh_sdmmc: ***IRQHandler\n"));
+	sd_trace(("brcmf: ***IRQHandler\n"));
 	sd = gInstance->sd;
 
 	ASSERT(sd != NULL);
@@ -913,7 +916,7 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
 		ASSERT(sd->intr_handler_arg);
 		(sd->intr_handler) (sd->intr_handler_arg);
 	} else {
-		sd_err(("bcmsdh_sdmmc: ***IRQHandler\n"));
+		sd_err(("brcmf: ***IRQHandler\n"));
 
 		sd_err(("%s: Not ready for intr: enabled %d, handler %p\n",
 			__func__, sd->client_intr_enabled, sd->intr_handler));
@@ -922,12 +925,12 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
 	sdio_claim_host(gInstance->func[0]);
 }
 
-/* bcmsdh_sdmmc interrupt handler for F2 (dummy handler) */
+/* interrupt handler for F2 (dummy handler) */
 static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
 {
 	struct sdioh_info *sd;
 
-	sd_trace(("bcmsdh_sdmmc: ***IRQHandlerF2\n"));
+	sd_trace(("brcmf: ***IRQHandlerF2\n"));
 
 	sd = gInstance->sd;
 
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +4 -12
index a0f985c..5eb4c65 100644
@@ -15,7 +15,7 @@
  */
 
 /*
- * BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
+ * BRCMF SDIO Function Driver for the native SDIO/MMC driver in the Linux Kernel
  */
 
 #ifndef __BCMSDH_SDMMC_H__
@@ -97,10 +97,6 @@ struct sdioh_info {
 	/*	SDDMA_DESCRIPTOR	SGList[32]; *//* Scatter/Gather DMA List */
 };
 
-/************************************************************
- * Internal interfaces: per-port references into bcmsdh_sdmmc.c
- */
-
 /* Global message bits */
 extern uint sd_msglevel;
 
@@ -115,10 +111,6 @@ extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
 extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
 extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
 
-/**************************************************************
- * Internal interfaces: bcmsdh_sdmmc.c references to per-port code
- */
-
 /* Register mapping routines */
 extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
 extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
@@ -127,12 +119,12 @@ extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
 extern int  brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
 extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
 
-typedef struct _BCMSDH_SDMMC_INSTANCE {
+struct brcmf_sdmmc_instance {
 	struct sdioh_info *sd;
 	struct sdio_func *func[SDIOD_MAX_IOFUNCS];
 	u32 host_claimed;
-} BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE;
+};
 
-extern PBCMSDH_SDMMC_INSTANCE gInstance;
+extern struct brcmf_sdmmc_instance *gInstance;
 
 #endif				/* __BCMSDH_SDMMC_H__ */
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +12 -15
index e5c3b25..9d00c49 100644
@@ -27,7 +27,7 @@
 #include <brcmu_utils.h>
 #include <brcmu_wifi.h>
 #include "sdio_host.h"
-#include "bcmsdbus.h"		/* bcmsdh to/from specific controller APIs */
+#include "bcmsdbus.h"
 #include "sdiovar.h"		/* to get msglevel bit values */
 #include "dngl_stats.h"
 #include "dhd.h"
@@ -62,10 +62,7 @@ static int clockoverride;
 module_param(clockoverride, int, 0644);
 MODULE_PARM_DESC(clockoverride, "SDIO card clock override");
 
-PBCMSDH_SDMMC_INSTANCE gInstance;
-
-/* Maximum number of bcmsdh_sdmmc devices supported by driver */
-#define BCMSDH_SDMMC_MAX_DEVICES 1
+struct brcmf_sdmmc_instance *gInstance;
 
 struct device sdmmc_dev;
 
@@ -74,8 +71,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
 {
 	int ret = 0;
 	static struct sdio_func sdio_func_0;
-	sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__));
-	sd_trace(("sdio_bcmsdh: func->class=%x\n", func->class));
+	sd_trace(("sdio_probe: %s Enter\n", __func__));
+	sd_trace(("sdio_probe: func->class=%x\n", func->class));
 	sd_trace(("sdio_vendor: 0x%04x\n", func->vendor));
 	sd_trace(("sdio_device: 0x%04x\n", func->device));
 	sd_trace(("Function#: 0x%04x\n", func->num));
@@ -117,7 +114,7 @@ static void brcmf_ops_sdio_remove(struct sdio_func *func)
 }
 
 /* devices we support, null terminated */
-static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
+static const struct sdio_device_id brcmf_sdmmc_ids[] = {
 	{SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_DEFAULT)},
 	{SDIO_DEVICE
 	 (SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)},
@@ -127,7 +124,7 @@ static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
 	{ /* end: all zeroes */ },
 };
 
-MODULE_DEVICE_TABLE(sdio, bcmsdh_sdmmc_ids);
+MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
 
 #ifdef CONFIG_PM
 static int brcmf_sdio_suspend(struct device *dev)
@@ -166,11 +163,11 @@ static const struct dev_pm_ops brcmf_sdio_pm_ops = {
 };
 #endif		/* CONFIG_PM */
 
-static struct sdio_driver bcmsdh_sdmmc_driver = {
+static struct sdio_driver brcmf_sdmmc_driver = {
 	.probe = brcmf_ops_sdio_probe,
 	.remove = brcmf_ops_sdio_remove,
 	.name = "brcmfmac",
-	.id_table = bcmsdh_sdmmc_ids,
+	.id_table = brcmf_sdmmc_ids,
 #ifdef CONFIG_PM
 	.drv = {
 		.pm = &brcmf_sdio_pm_ops,
@@ -243,14 +240,14 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
 int brcmf_sdio_function_init(void)
 {
 	int error = 0;
-	sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__));
+	sd_trace(("brcmf_sdio_function_init: %s Enter\n", __func__));
 
-	gInstance = kzalloc(sizeof(BCMSDH_SDMMC_INSTANCE), GFP_KERNEL);
+	gInstance = kzalloc(sizeof(struct brcmf_sdmmc_instance), GFP_KERNEL);
 	if (!gInstance)
 		return -ENOMEM;
 
 	memset(&sdmmc_dev, 0, sizeof(sdmmc_dev));
-	error = sdio_register_driver(&bcmsdh_sdmmc_driver);
+	error = sdio_register_driver(&brcmf_sdmmc_driver);
 
 	return error;
 }
@@ -263,7 +260,7 @@ void brcmf_sdio_function_cleanup(void)
 {
 	sd_trace(("%s Enter\n", __func__));
 
-	sdio_unregister_driver(&bcmsdh_sdmmc_driver);
+	sdio_unregister_driver(&brcmf_sdmmc_driver);
 
 	kfree(gInstance);
 }
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +16 -18
index da5a2ff..6c7407a 100644
@@ -458,7 +458,7 @@ struct chip_info {
 typedef struct dhd_bus {
 	struct brcmf_pub *dhd;
 
-	struct brcmf_sdio *sdh;	/* Handle for BCMSDH calls */
+	struct brcmf_sdio *sdh;	/* Handle for sdio card calls */
 	struct chip_info *ci;	/* Chip info struct */
 	char *vars;		/* Variables (from CIS and/or other) */
 	uint varsz;		/* Size of variables buffer */
@@ -529,7 +529,7 @@ typedef struct dhd_bus {
 	s32 idletime;		/* Control for activity timeout */
 	s32 idlecount;	/* Activity timeout counter */
 	s32 idleclock;	/* How to set bus driver when idle */
-	s32 sd_rxchain;	/* If bcmsdh api accepts PKT chains */
+	s32 sd_rxchain;
 	bool use_rxchain;	/* If dhd should use PKT chains */
 	bool sleeping;		/* Is SDIO bus sleeping? */
 	bool rxflow_mode;	/* Rx flow control mode */
@@ -805,8 +805,8 @@ static uint brcmf_process_nvram_vars(char *varbuf, uint len);
 static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size);
 static int brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
 			       uint flags, u8 *buf, uint nbytes,
-			       struct sk_buff *pkt, bcmsdh_cmplt_fn_t complete,
-			       void *handle);
+			       struct sk_buff *pkt,
+			       brcmf_sdio_cmplt_fn_t complete, void *handle);
 
 static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh);
 static int  _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
@@ -3210,8 +3210,6 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
 		/* Set bus state according to enable result */
 		dhdp->busstate = DHD_BUS_DATA;
 
-		/* bcmsdh_intr_unmask(bus->sdh); */
-
 		bus->intdis = false;
 		if (bus->intr) {
 			DHD_INTR(("%s: enable SDIO device interrupts\n",
@@ -3844,7 +3842,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 	u16 rdlen;		/* Total number of bytes to read */
 	u8 rxseq;		/* Next sequence number to expect */
 	uint rxleft = 0;	/* Remaining number of frames allowed */
-	int sdret;		/* Return code from bcmsdh calls */
+	int sdret;		/* Return code from calls */
 	u8 txmax;		/* Maximum tx sequence offered */
 	bool len_consistent;	/* Result of comparing readahead len and
 					 len from hw-hdr */
@@ -4857,7 +4855,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
 		/* Allocate an appropriate-sized packet */
 		len = bus->pktgen_len;
 		pkt = brcmu_pkt_buf_get_skb(
-			(len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN),
+			len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN,
 			true);
 		if (!pkt) {
 			DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n",
@@ -5268,7 +5266,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
 	/* We make assumptions about address window mappings */
 	ASSERT((unsigned long)regsva == SI_ENUM_BASE);
 
-	/* BCMSDH passes venid and devid based on CIS parsing -- but
+	/* SDIO car passes venid and devid based on CIS parsing -- but
 	 * low-power start
 	 * means early parse could fail, so here we should get either an ID
 	 * we recognize OR (-1) indicating we must request power first.
@@ -5402,7 +5400,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
 	brcmf_sdcard_intr_disable(sdh);
 	ret = brcmf_sdcard_intr_reg(sdh, brcmf_sdbrcm_isr, bus);
 	if (ret != 0) {
-		DHD_ERROR(("%s: FAILED: bcmsdh_intr_reg returned %d\n",
+		DHD_ERROR(("%s: FAILED: sdcard_intr_reg returned %d\n",
 			   __func__, ret));
 		goto fail;
 	}
@@ -5510,7 +5508,8 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
 	brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
 
 	/* Locate an appropriately-aligned portion of hdrbuf */
-	bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0], BRCMF_SDALIGN);
+	bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0],
+				    BRCMF_SDALIGN);
 
 	/* Set the poll and/or interrupt flags */
 	bus->intr = (bool) brcmf_intr;
@@ -5553,9 +5552,8 @@ static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh)
 
 	/* Align the buffer */
 	if ((unsigned long)bus->databuf % BRCMF_SDALIGN)
-		bus->dataptr =
-		    bus->databuf + (BRCMF_SDALIGN -
-				    ((unsigned long)bus->databuf % BRCMF_SDALIGN));
+		bus->dataptr = bus->databuf + (BRCMF_SDALIGN -
+			       ((unsigned long)bus->databuf % BRCMF_SDALIGN));
 	else
 		bus->dataptr = bus->databuf;
 
@@ -5612,7 +5610,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
 			    false) != 0) {
 		bus->sd_rxchain = false;
 	} else {
-		DHD_INFO(("%s: bus module (through bcmsdh API) %s chaining\n",
+		DHD_INFO(("%s: bus module (through sdiocard API) %s chaining\n",
 			  __func__,
 			  (bus->sd_rxchain ? "supports" : "does not support")));
 	}
@@ -5773,8 +5771,8 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus)
 		goto err;
 	}
 	if ((u32)(unsigned long)memblock % BRCMF_SDALIGN)
-		memptr +=
-		    (BRCMF_SDALIGN - ((u32)(unsigned long)memblock % BRCMF_SDALIGN));
+		memptr += (BRCMF_SDALIGN -
+			   ((u32)(unsigned long)memblock % BRCMF_SDALIGN));
 
 	/* Download image */
 	while ((len =
@@ -5946,7 +5944,7 @@ err:
 static int
 brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags,
 		    u8 *buf, uint nbytes, struct sk_buff *pkt,
-		    bcmsdh_cmplt_fn_t complete, void *handle)
+		    brcmf_sdio_cmplt_fn_t complete, void *handle)
 {
 	return brcmf_sdcard_send_buf
 		(bus->sdh, addr, fn, flags, buf, nbytes, pkt, complete,
drivers/staging/brcm80211/brcmfmac/sdio_host.h +26 -21

94 lines not on this page · raw message

Signature · 1 line
1.7.1
#102 lore raw

Re: [PATCH 094/119] staging: brcm80211: removed last occurrences of bcmsdh/BCMSDH

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, · line 554

Quoted 8 lines · Franky Lin
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +3 -1
@@ -549,7 +549,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 						    sdio_enable_func
 						    (gInstance->func[2]);
 						if (err_ret)
-							sd_err(("bcmsdh_sdmmc: enable F2 failed:%d",
+							sd_err(("request_byte: "
+								"enable F2 "
+								"failed:%d",

^^^
Newline needed here.

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, · line 564

Quoted 11 lines
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +3 -1
 								 err_ret));
 					} else {
 						/* Disable Function 2 */
@@ -557,7 +559,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 						    sdio_disable_func
 						    (gInstance->func[2]);
 						if (err_ret)
-							sd_err(("bcmsdh_sdmmc: Disab F2 failed:%d",
+							sd_err(("request_byte: "
+								"Disab F2 "
+								"failed:%d",
                                                                         ^^^
	Same.

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, · line 567

Quoted 3 lines
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -0
 								 err_ret));
 					}
 					sdio_release_host(gInstance->func[2]);

regards,
dan carpenter

#103 lore raw

Re: [PATCH 094/119] staging: brcm80211: removed last occurrences of bcmsdh/BCMSDH

Quoted 26 lines · Dan Carpenter

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, · line 554

Quoted 8 lines · Franky Lin
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +3 -1
@@ -549,7 +549,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
  						    sdio_enable_func
  						    (gInstance->func[2]);
  						if (err_ret)
-							sd_err(("bcmsdh_sdmmc: enable F2 failed:%d",
+							sd_err(("request_byte: "
+								"enable F2 "
+								"failed:%d",

^^^
Newline needed here.

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, · line 564

Quoted 11 lines
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +3 -1
  								err_ret));
  					} else {
  						/* Disable Function 2 */
@@ -557,7 +559,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
  						    sdio_disable_func
  						    (gInstance->func[2]);
  						if (err_ret)
-							sd_err(("bcmsdh_sdmmc: Disab F2 failed:%d",
+							sd_err(("request_byte: "
+								"Disab F2 "
+								"failed:%d",
                                                                          ^^^
	Same.
Quoted 5 lines

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func, · line 567

Quoted 3 lines
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -0
  								err_ret));
  					}
  					sdio_release_host(gInstance->func[2]);

regards,
dan carpenter

Hi Dan,

First of all, thanks for milling through this list of patches. As you can see the code before the patch was also missing the \n character. I looked in the brcmfmac code and there are several other sd_*() macros missing it. So I will fix all with a separate patch.

Gr. AvS

Signature · 2 lines
Almost nobody dances sober, unless they happen to be insane.
-- H.P. Lovecraft --
author
#104 lore raw

PATCH 95/119 staging: brcm80211: sdh related code cleanup

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Gave struct brcmf_sdio the more applicable name 'brcmf_sdio_card'. Enforced stronger type checking by replacing void *sdh by struct brcmf_sdio_card *.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h     |    2 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |  141 +++----
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |   20 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |  423 +++++++++++----------
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |  101 +++--
 5 files changed, 345 insertions(+), 342 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +1 -1
index 9359bba..ee01e48 100644
@@ -105,7 +105,7 @@ extern int brcmf_sdioh_stop(struct sdioh_info *si);
 extern int brcmf_sdioh_reset(struct sdioh_info *si);
 
 /* Helper function */
-void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
+void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
 
 /* Watchdog timer interface for pm ops */
 extern void brcmf_sdio_wdtmr_enable(bool enable);
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +60 -81

348 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +10 -10
index a3cf05f..fe875e8 100644
@@ -42,7 +42,7 @@ struct sdio_hc {
 	struct sdio_hc *next;
 	struct device *dev;	/* platform device handle */
 	void *regs;		/* SDIO Host Controller address */
-	struct brcmf_sdio *sdh;	/* SDIO Host Controller handle */
+	struct brcmf_sdio_card *card;
 	void *ch;
 	unsigned int oob_irq;
 	unsigned long oob_flags;	/* OOB Host specifiction
@@ -113,7 +113,7 @@ int brcmf_sdio_probe(struct device *dev)
 {
 	struct sdio_hc *sdhc = NULL;
 	unsigned long regs = 0;
-	struct brcmf_sdio *sdh = NULL;
+	struct brcmf_sdio_card *card = NULL;
 	int irq = 0;
 	u32 vendevid;
 	unsigned long irq_flags = 0;
@@ -126,13 +126,13 @@ int brcmf_sdio_probe(struct device *dev)
 	}
 	sdhc->dev = (void *)dev;
 
-	sdh = brcmf_sdcard_attach((void *)0, (void **)&regs, irq);
-	if (!sdh) {
+	card = brcmf_sdcard_attach((void *)0, (void **)&regs, irq);
+	if (!card) {
 		SDLX_MSG(("%s: attach failed\n", __func__));
 		goto err;
 	}
 
-	sdhc->sdh = sdh;
+	sdhc->card = card;
 	sdhc->oob_irq = irq;
 	sdhc->oob_flags = irq_flags;
 	sdhc->oob_irq_registered = false;	/* to make sure.. */
@@ -141,11 +141,11 @@ int brcmf_sdio_probe(struct device *dev)
 	sdhc->next = sdhcinfo;
 	sdhcinfo = sdhc;
 	/* Read the vendor/device ID from the CIS */
-	vendevid = brcmf_sdcard_query_device(sdh);
+	vendevid = brcmf_sdcard_query_device(card);
 
 	/* try to attach to the target device */
 	sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
-				  0, 0, 0, 0, (void *)regs, sdh);
+				  0, 0, 0, 0, (void *)regs, card);
 	if (!sdhc->ch) {
 		SDLX_MSG(("%s: device attach failed\n", __func__));
 		goto err;
@@ -156,8 +156,8 @@ int brcmf_sdio_probe(struct device *dev)
 	/* error handling */
 err:
 	if (sdhc) {
-		if (sdhc->sdh)
-			brcmf_sdcard_detach(sdhc->sdh);
+		if (sdhc->card)
+			brcmf_sdcard_detach(sdhc->card);
 		kfree(sdhc);
 	}
 
@@ -170,7 +170,7 @@ int brcmf_sdio_remove(struct device *dev)
 
 	sdhc = sdhcinfo;
 	drvinfo.detach(sdhc->ch);
-	brcmf_sdcard_detach(sdhc->sdh);
+	brcmf_sdcard_detach(sdhc->card);
 	/* find the SDIO Host Controller state for this pdev
 		 and take it out from the list */
 	for (sdhc = sdhcinfo, prev = NULL; sdhc; sdhc = sdhc->next) {
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +216 -207

1,296 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sdio_host.h +58 -43

199 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#105 lore raw

PATCH 96/119 staging: brcm80211: removed brcmf_sdioh_interrupt_pending()

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. This function always returned 0.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h     |    4 ----
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |    8 --------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    7 -------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |    3 +--
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |    5 -----
 5 files changed, 1 insertions(+), 26 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +0 -4
index ee01e48..656caeb 100644
@@ -53,10 +53,6 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
 extern int
 brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
 
-#if defined(BCMDBG)
-extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *si);
-#endif
-
 extern int brcmf_sdioh_claim_host_and_lock(struct sdioh_info *si);
 extern int brcmf_sdioh_release_host_and_unlock(struct sdioh_info *si);
 
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +0 -8
index 4c7e4a9..132b18f 100644
@@ -138,14 +138,6 @@ int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card)
 	return brcmf_sdioh_interrupt_deregister(card->sdioh);
 }
 
-#if defined(BCMDBG)
-bool brcmf_sdcard_intr_pending(struct brcmf_sdio_card *card)
-{
-	ASSERT(card);
-	return brcmf_sdioh_interrupt_pending(card->sdioh);
-}
-#endif
-
 int brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
 			       brcmf_sdiocard_cb_fn_t fn,
 			       void *argh)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -7
index d0e9b3d..092d044 100644
@@ -244,13 +244,6 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
 	return 0;
 }
 
-#if defined(BCMDBG)
-extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *sd)
-{
-	return 0;
-}
-#endif
-
 uint brcmf_sdioh_query_iofnum(struct sdioh_info *sd)
 {
 	return sd->num_funcs;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -2
index 3ed9e12..e43c53a 100644
@@ -1889,8 +1889,7 @@ void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
 #endif				/* SDTEST */
 #ifdef BCMDBG
 	brcmu_bprintf(strbuf, "dpc_sched %d host interrupt%spending\n",
-		    bus->dpc_sched,
-		    (brcmf_sdcard_intr_pending(bus->card) ? " " : " not "));
+		      bus->dpc_sched, " not ");
 	brcmu_bprintf(strbuf, "blocksize %d roundup %d\n", bus->blocksize,
 		    bus->roundup);
 #endif				/* BCMDBG */
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -5
index 5c5bbca..f05067a 100644
@@ -93,11 +93,6 @@ brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card, brcmf_sdiocard_cb_fn_t fn,
 
 extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
 
-#if defined(BCMDBG)
-/* Query pending interrupt status from the host controller */
-extern bool brcmf_sdcard_intr_pending(struct brcmf_sdio_card *card);
-#endif
-
 /* Register a callback to be called on device removal.
  * No-op in the case of non-removable/hardwired devices.
  */
Signature · 1 line
1.7.1
author
#106 lore raw

PATCH 97/119 staging: brcm80211: removed brcmf_sdioh_reset()

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. This function did not perform a reset, hence it was removed.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h     |    3 ---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |    5 -----
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    8 --------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |    2 --
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |    3 ---
 5 files changed, 0 insertions(+), 21 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +0 -3
index 656caeb..eb08152 100644
@@ -97,9 +97,6 @@ extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
 extern int brcmf_sdioh_start(struct sdioh_info *si, int stage);
 extern int brcmf_sdioh_stop(struct sdioh_info *si);
 
-/* Reset and re-initialize the device */
-extern int brcmf_sdioh_reset(struct sdioh_info *si);
-
 /* Helper function */
 void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
 
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +0 -5
index 132b18f..11abd55 100644
@@ -545,11 +545,6 @@ uint brcmf_sdcard_query_iofnum(struct brcmf_sdio_card *card)
 	return brcmf_sdioh_query_iofnum(card->sdioh);
 }
 
-int brcmf_sdcard_reset(struct brcmf_sdio_card *card)
-{
-	return brcmf_sdioh_reset(card->sdioh);
-}
-
 void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card)
 {
 	ASSERT(card);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -8
index 092d044..0f0dc42 100644
@@ -846,14 +846,6 @@ extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func)
 	return 0;
 }
 
-/* Reset and re-initialize the device */
-int brcmf_sdioh_reset(struct sdioh_info *si)
-{
-	sd_trace(("%s: Enter\n", __func__));
-	sd_trace(("%s: Exit\n", __func__));
-	return 0;
-}
-
 /* Disable device interrupt */
 void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd)
 {
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -2
index e43c53a..4b0352f 100644
@@ -6013,8 +6013,6 @@ int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
 
 		if (bus->dhd->dongle_reset) {
 			/* Turn on WLAN */
-			/* Reset SD client */
-			brcmf_sdcard_reset(bus->card);
 
 			/* Attempt to re-attach & download */
 			if (brcmf_sdbrcm_probe_attach(bus, bus->card,
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -3
index f05067a..df4063c 100644
@@ -207,9 +207,6 @@ extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
 				 void *params, int plen, void *arg, int len,
 				 bool set);
 
-/* Reset and reinitialize the device */
-extern int brcmf_sdcard_reset(struct brcmf_sdio_card *card);
-
 /* helper functions */
 
 extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
Signature · 1 line
1.7.1
author
#107 lore raw

PATCH 98/119 staging: brcm80211: removed brcmf_sdioh_start() and brcmf_sdioh_stop()

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. These functions were empty.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h     |    4 ----
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |   10 ----------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   10 ----------
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |    6 ------
 4 files changed, 0 insertions(+), 30 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +0 -4
index eb08152..761ec20 100644
@@ -93,10 +93,6 @@ extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
 /* Issue abort to the specified function and clear controller as needed */
 extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
 
-/* Start and Stop SDIO without re-enumerating the SD card. */
-extern int brcmf_sdioh_start(struct sdioh_info *si, int stage);
-extern int brcmf_sdioh_stop(struct sdioh_info *si);
-
 /* Helper function */
 void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
 
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +0 -10
index 11abd55..09bad40 100644
@@ -521,16 +521,6 @@ int brcmf_sdcard_abort(struct brcmf_sdio_card *card, uint fn)
 	return brcmf_sdioh_abort(card->sdioh, fn);
 }
 
-int brcmf_sdcard_start(struct brcmf_sdio_card *card, int stage)
-{
-	return brcmf_sdioh_start(card->sdioh, stage);
-}
-
-int brcmf_sdcard_stop(struct brcmf_sdio_card *card)
-{
-	return brcmf_sdioh_stop(card->sdioh);
-}
-
 int brcmf_sdcard_query_device(struct brcmf_sdio_card *card)
 {
 	card->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -10
index 0f0dc42..7da200f 100644
@@ -921,13 +921,3 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
 
 	ASSERT(sd != NULL);
 }
-
-int brcmf_sdioh_start(struct sdioh_info *si, int stage)
-{
-	return 0;
-}
-
-int brcmf_sdioh_stop(struct sdioh_info *si)
-{
-	return 0;
-}
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -6
index df4063c..712d0df 100644
@@ -190,12 +190,6 @@ extern int brcmf_sdcard_rwdata(struct brcmf_sdio_card *card, uint rw, u32 addr,
 /* Issue an abort to the specified function */
 extern int brcmf_sdcard_abort(struct brcmf_sdio_card *card, uint fn);
 
-/* Start SDIO Host Controller communication */
-extern int brcmf_sdcard_start(struct brcmf_sdio_card *card, int stage);
-
-/* Stop SDIO Host Controller communication */
-extern int brcmf_sdcard_stop(struct brcmf_sdio_card *card);
-
 /* Returns the "Device ID" of target device on the SDIO bus. */
 extern int brcmf_sdcard_query_device(struct brcmf_sdio_card *card);
 
Signature · 1 line
1.7.1
author
#108 lore raw

PATCH 99/119 staging: brcm80211: removed file sdiovar.h

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Contents merged into other files.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h      |    6 +++
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |    1 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h  |   10 +++++
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    1 -
 drivers/staging/brcm80211/brcmfmac/sdiovar.h       |   38 --------------------
 6 files changed, 16 insertions(+), 41 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/sdiovar.h
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +6 -0
index 761ec20..3ba3c3f 100644
@@ -32,6 +32,12 @@
 #define SDIOH_DATA_PIO          0	/* PIO mode */
 #define SDIOH_DATA_DMA          1	/* DMA mode */
 
+struct brcmf_sdreg {
+	int func;
+	int offset;
+	int value;
+};
+
 /* callback function, taking one arg */
 typedef void (*sdioh_cb_fn_t) (void *);
 
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -1
index 7da200f..7bc9d02 100644
@@ -28,7 +28,6 @@
 #include <brcmu_wifi.h>
 #include "sdio_host.h"
 #include "bcmsdbus.h"
-#include "sdiovar.h"		/* ioctl/iovars */
 #include "dngl_stats.h"
 #include "dhd.h"
 #include "bcmsdh_sdmmc.h"
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +10 -0
index 5eb4c65..962fa4b 100644
@@ -21,6 +21,16 @@
 #ifndef __BCMSDH_SDMMC_H__
 #define __BCMSDH_SDMMC_H__
 
+/* Common msglevel constants */
+#define SDH_ERROR_VAL		0x0001	/* Error */
+#define SDH_TRACE_VAL		0x0002	/* Trace */
+#define SDH_INFO_VAL		0x0004	/* Info */
+#define SDH_DEBUG_VAL		0x0008	/* Debug */
+#define SDH_DATA_VAL		0x0010	/* Data */
+#define SDH_CTRL_VAL		0x0020	/* Control Regs */
+#define SDH_LOG_VAL		0x0040	/* Enable bcmlog */
+#define SDH_DMA_VAL		0x0080	/* DMA */
+
 #ifdef BCMDBG
 #define sd_err(x)	\
 	do { \
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +0 -1
index 9d00c49..b8ab242 100644
@@ -28,7 +28,6 @@
 #include <brcmu_wifi.h>
 #include "sdio_host.h"
 #include "bcmsdbus.h"
-#include "sdiovar.h"		/* to get msglevel bit values */
 #include "dngl_stats.h"
 #include "dhd.h"
 
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -1
index 4b0352f..6a53ac8 100644
@@ -176,7 +176,6 @@ struct rte_console {
 #include "dhd_bus.h"
 #include "dhd_proto.h"
 #include "dhd_dbg.h"
-#include <sdiovar.h>
 #include <bcmchip.h>
 
 #ifndef DHDSDIO_MEM_DUMP_FNAME
drivers/staging/brcm80211/brcmfmac/sdiovar.h deleted +0 -38
deleted file mode 100644
index 35e913b..0000000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _sdiovar_h_
-#define _sdiovar_h_
-
-struct brcmf_sdreg {
-	int func;
-	int offset;
-	int value;
-};
-
-/* Common msglevel constants */
-#define SDH_ERROR_VAL		0x0001	/* Error */
-#define SDH_TRACE_VAL		0x0002	/* Trace */
-#define SDH_INFO_VAL		0x0004	/* Info */
-#define SDH_DEBUG_VAL		0x0008	/* Debug */
-#define SDH_DATA_VAL		0x0010	/* Data */
-#define SDH_CTRL_VAL		0x0020	/* Control Regs */
-#define SDH_LOG_VAL		0x0040	/* Enable bcmlog */
-#define SDH_DMA_VAL		0x0080	/* DMA */
-
-#define NUM_PREV_TRANSACTIONS	16
-
-#endif				/* _sdiovar_h_ */
Signature · 1 line
1.7.1
author
#109 lore raw

PATCH 100/119 staging: brcm80211: further cleaned fullmac header files

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Deleted unused definitions. Moved locally used definitions to .c files. Moved definitions from bcmsdh_sdmmc.h to bcmsdbus.h.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h      |  109 +++++++++++++++-
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |   22 +++
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |    2 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |   11 ++-
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h  |  140 --------------------
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |   90 +++++++++++++-
 drivers/staging/brcm80211/brcmfmac/sbsdio.h        |   96 -------------
 drivers/staging/brcm80211/brcmfmac/sdio_host.h     |   24 ----
 9 files changed, 228 insertions(+), 268 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +106 -3
index 3ba3c3f..3dff170 100644
@@ -32,6 +32,60 @@
 #define SDIOH_DATA_PIO          0	/* PIO mode */
 #define SDIOH_DATA_DMA          1	/* DMA mode */
 
+/* internal return code */
+#define SUCCESS	0
+#define ERROR	1
+
+/* Common msglevel constants */
+#define SDH_ERROR_VAL		0x0001	/* Error */
+#define SDH_TRACE_VAL		0x0002	/* Trace */
+#define SDH_INFO_VAL		0x0004	/* Info */
+#define SDH_DEBUG_VAL		0x0008	/* Debug */
+#define SDH_DATA_VAL		0x0010	/* Data */
+#define SDH_CTRL_VAL		0x0020	/* Control Regs */
+#define SDH_LOG_VAL		0x0040	/* Enable bcmlog */
+#define SDH_DMA_VAL		0x0080	/* DMA */
+
+#ifdef BCMDBG
+#define sd_err(x)	\
+	do { \
+		if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) \
+			printk x; \
+	} while (0)
+#define sd_trace(x)	\
+	do { \
+		if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) \
+			printk x; \
+	} while (0)
+#define sd_info(x)	\
+	do { \
+		if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) \
+			printk x; \
+	} while (0)
+#define sd_debug(x)	\
+	do { \
+		if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) \
+			printk x; \
+	} while (0)
+#define sd_data(x)	\
+	do { \
+		if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) \
+			printk x; \
+	} while (0)
+#define sd_ctrl(x)	\
+	do { \
+		if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) \
+			printk x; \
+	} while (0)
+#else
+#define sd_err(x)
+#define sd_trace(x)
+#define sd_info(x)
+#define sd_debug(x)
+#define sd_data(x)
+#define sd_ctrl(x)
+#endif
+
 struct brcmf_sdreg {
 	int func;
 	int offset;
@@ -41,6 +95,54 @@ struct brcmf_sdreg {
 /* callback function, taking one arg */
 typedef void (*sdioh_cb_fn_t) (void *);
 
+struct sdioh_info {
+	struct osl_info *osh;		/* osh handler */
+	bool client_intr_enabled;	/* interrupt connnected flag */
+	bool intr_handler_valid;	/* client driver interrupt handler valid */
+	sdioh_cb_fn_t intr_handler;	/* registered interrupt handler */
+	void *intr_handler_arg;	/* argument to call interrupt handler */
+	u16 intmask;		/* Current active interrupts */
+	void *sdos_info;	/* Pointer to per-OS private data */
+
+	uint irq;		/* Client irq */
+	int intrcount;		/* Client interrupts */
+	bool sd_blockmode;	/* sd_blockmode == false => 64 Byte Cmd 53s. */
+	/*  Must be on for sd_multiblock to be effective */
+	bool use_client_ints;	/* If this is false, make sure to restore */
+	int client_block_size[SDIOD_MAX_IOFUNCS];	/* Blocksize */
+	u8 num_funcs;	/* Supported funcs on client */
+	u32 com_cis_ptr;
+	u32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
+	uint max_dma_len;
+	uint max_dma_descriptors;	/* DMA Descriptors supported by this controller. */
+	/*	SDDMA_DESCRIPTOR	SGList[32]; *//* Scatter/Gather DMA List */
+};
+
+struct brcmf_sdmmc_instance {
+	struct sdioh_info *sd;
+	struct sdio_func *func[SDIOD_MAX_IOFUNCS];
+	u32 host_claimed;
+};
+
+/* Allocate/init/free per-OS private data */
+extern int  brcmf_sdioh_osinit(struct sdioh_info *sd);
+extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
+
+/* OS-independent interrupt handler */
+extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
+
+/* Core interrupt enable/disable of device interrupts */
+extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
+extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
+
+/* Register mapping routines */
+extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
+extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
+
+/* Interrupt (de)registration routines */
+extern int  brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
+extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
+
 /* attach, return handler on success, NULL if failed.
  *  The handler shall be provided by all subsequent calls. No local cache
  *  cfghdl points to the starting address of pci device mapped memory
@@ -59,9 +161,6 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
 extern int
 brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
 
-extern int brcmf_sdioh_claim_host_and_lock(struct sdioh_info *si);
-extern int brcmf_sdioh_release_host_and_unlock(struct sdioh_info *si);
-
 /* read or write one byte using cmd52 */
 extern int
 brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
@@ -105,4 +204,8 @@ void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
 /* Watchdog timer interface for pm ops */
 extern void brcmf_sdio_wdtmr_enable(bool enable);
 
+extern uint sd_msglevel;	/* Debug message level */
+
+extern struct brcmf_sdmmc_instance *gInstance;
+
 #endif				/* _sdio_api_h_ */
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +22 -0
index 09bad40..fd36679 100644
@@ -31,6 +31,28 @@
 #include "dhd.h"
 
 #define SDIOH_API_ACCESS_RETRY_LIMIT	2
+
+#define BRCMF_SD_ERROR_VAL	0x0001	/* Error */
+#define BRCMF_SD_INFO_VAL		0x0002	/* Info */
+
+#ifdef BCMDBG
+#define BRCMF_SD_ERROR(x) \
+	do { \
+		if ((brcmf_sdio_msglevel & BRCMF_SD_ERROR_VAL) && \
+		    net_ratelimit()) \
+			printk x; \
+	} while (0)
+#define BRCMF_SD_INFO(x)	\
+	do { \
+		if ((brcmf_sdio_msglevel & BRCMF_SD_INFO_VAL) && \
+		    net_ratelimit()) \
+			printk x; \
+	} while (0)
+#else				/* BCMDBG */
+#define BRCMF_SD_ERROR(x)
+#define BRCMF_SD_INFO(x)
+#endif				/* BCMDBG */
+
 const uint brcmf_sdio_msglevel = BRCMF_SD_ERROR_VAL;
 
 struct brcmf_sdio_card {
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +1 -1
index fe875e8..56e2435 100644
@@ -34,6 +34,7 @@
 #include "dngl_stats.h"
 #include "dhd.h"
 #include "dhd_bus.h"
+#include "bcmsdbus.h"
 
 /**
  * SDIO Host Controller info
@@ -208,7 +209,6 @@ void brcmf_sdio_unregister(void)
 
 /* Module parameters specific to each host-controller driver */
 
-extern uint sd_msglevel;	/* Debug message level */
 module_param(sd_msglevel, uint, 0);
 
 extern uint sd_f2_blocksize;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +10 -1
index 7bc9d02..4f4ec47 100644
@@ -30,7 +30,16 @@
 #include "bcmsdbus.h"
 #include "dngl_stats.h"
 #include "dhd.h"
-#include "bcmsdh_sdmmc.h"
+
+#define BLOCK_SIZE_64 64
+#define BLOCK_SIZE_512 512
+#define BLOCK_SIZE_4318 64
+#define BLOCK_SIZE_4328 512
+
+/* private bus modes */
+#define SDIOH_MODE_SD4		2
+
+#define CLIENT_INTR		0x100	/* Get rid of this! */
 
 static void brcmf_sdioh_irqhandler(struct sdio_func *func);
 static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h deleted +0 -140

140 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +0 -2
index b8ab242..0a632f5 100644
@@ -50,8 +50,6 @@
 #define SDIO_DEVICE_ID_BROADCOM_4319	0x4319
 #endif		/* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */
 
-#include <bcmsdh_sdmmc.h>
-
 #include "dhd_dbg.h"
 #include "wl_cfg80211.h"
 
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +89 -1

102 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sbsdio.h +0 -96

100 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -24
index 712d0df..02c820b 100644
@@ -18,28 +18,8 @@
 #define	_BRCM_SDH_H_
 
 #include <linux/skbuff.h>
-#define BRCMF_SD_ERROR_VAL	0x0001	/* Error */
-#define BRCMF_SD_INFO_VAL		0x0002	/* Info */
 extern const uint brcmf_sdio_msglevel;
 
-#ifdef BCMDBG
-#define BRCMF_SD_ERROR(x) \
-	do { \
-		if ((brcmf_sdio_msglevel & BRCMF_SD_ERROR_VAL) && \
-		    net_ratelimit()) \
-			printk x; \
-	} while (0)
-#define BRCMF_SD_INFO(x)	\
-	do { \
-		if ((brcmf_sdio_msglevel & BRCMF_SD_INFO_VAL) && \
-		    net_ratelimit()) \
-			printk x; \
-	} while (0)
-#else				/* BCMDBG */
-#define BRCMF_SD_ERROR(x)
-#define BRCMF_SD_INFO(x)
-#endif				/* BCMDBG */
-
 #define SDIO_FUNC_0		0
 #define SDIO_FUNC_1		1
 #define SDIO_FUNC_2		2
@@ -221,11 +201,7 @@ extern int brcmf_sdio_function_init(void);
 extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver);
 extern void brcmf_sdio_unregister(void);
 extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
-extern void brcmf_sdio_device_remove(void *card);
 extern void brcmf_sdio_function_cleanup(void);
-
-extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
-extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
 extern int brcmf_sdio_probe(struct device *dev);
 extern int brcmf_sdio_remove(struct device *dev);
 
Signature · 1 line
1.7.1
author
#110 lore raw

PATCH 101/119 staging: brcm80211: removed last global function declaration in .c file

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup.

---
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +0 -1
index 0a632f5..cdaa042 100644
@@ -252,7 +252,6 @@ int brcmf_sdio_function_init(void)
 /*
  * module cleanup
 */
-extern int brcmf_sdio_remove(struct device *dev);
 void brcmf_sdio_function_cleanup(void)
 {
 	sd_trace(("%s Enter\n", __func__));
Signature · 1 line
1.7.1
author
#111 lore raw

PATCH 102/119 staging: brcm80211: rename function variables

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

This commit gets rid of variables whose name is a broadcom specific acronym and not very meaningful.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h      |   79 ++++----
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h  |    8 +-
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c  |  115 +++++-----
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |  294 ++++++++++++-------------
 4 files changed, 246 insertions(+), 250 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +40 -39
index d063afb..9f627e5 100644
@@ -708,27 +708,27 @@ extern const bcmevent_name_t bcmevent_names[];
 extern const int bcmevent_names_size;
 
 
-static inline void MUTEX_LOCK_INIT(struct brcmf_pub *dhdp)
+static inline void MUTEX_LOCK_INIT(struct brcmf_pub *drvr)
 {
 }
 
-static inline void MUTEX_LOCK(struct brcmf_pub *dhdp)
+static inline void MUTEX_LOCK(struct brcmf_pub *drvr)
 {
 }
 
-static inline void MUTEX_UNLOCK(struct brcmf_pub *dhdp)
+static inline void MUTEX_UNLOCK(struct brcmf_pub *drvr)
 {
 }
 
-static inline void MUTEX_LOCK_SOFTAP_SET_INIT(struct brcmf_pub *dhdp)
+static inline void MUTEX_LOCK_SOFTAP_SET_INIT(struct brcmf_pub *drvr)
 {
 }
 
-static inline void MUTEX_LOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
+static inline void MUTEX_LOCK_SOFTAP_SET(struct brcmf_pub *drvr)
 {
 }
 
-static inline void MUTEX_UNLOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
+static inline void MUTEX_UNLOCK_SOFTAP_SET(struct brcmf_pub *drvr)
 {
 }
 
@@ -754,85 +754,86 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
  * bus_hdrlen specifies required headroom for bus module header.
  */
 extern struct brcmf_pub *brcmf_attach(struct dhd_bus *bus,
-				uint bus_hdrlen);
-extern int brcmf_net_attach(struct brcmf_pub *dhdp, int idx);
+				      uint bus_hdrlen);
+extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
 extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
 
 /* Indication from bus module regarding removal/absence of dongle */
-extern void brcmf_detach(struct brcmf_pub *dhdp);
+extern void brcmf_detach(struct brcmf_pub *drvr);
 
 /* Indication from bus module to change flow-control state */
-extern void brcmf_txflowcontrol(struct brcmf_pub *dhdp, int ifidx, bool on);
+extern void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool on);
 
-extern bool brcmf_c_prec_enq(struct brcmf_pub *dhdp, struct pktq *q,
+extern bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
 			 struct sk_buff *pkt, int prec);
 
 /* Receive frame for delivery to OS.  Callee disposes of rxp. */
-extern void brcmf_rx_frame(struct brcmf_pub *dhdp, int ifidx,
+extern void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx,
 			 struct sk_buff *rxp, int numpkt);
 
 /* Return pointer to interface name */
-extern char *brcmf_ifname(struct brcmf_pub *dhdp, int idx);
+extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
 
 /* Request scheduling of the bus dpc */
-extern void brcmf_sched_dpc(struct brcmf_pub *dhdp);
+extern void brcmf_sched_dpc(struct brcmf_pub *drvr);
 
 /* Notify tx completion */
-extern void brcmf_txcomplete(struct brcmf_pub *dhdp, struct sk_buff *txp,
+extern void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp,
 			     bool success);
 
 /* Query ioctl */
-extern int brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx,
+extern int brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx,
 				       uint cmd, void *buf, uint len);
 
 /* OS independent layer functions */
-extern int brcmf_os_proto_block(struct brcmf_pub *pub);
-extern int brcmf_os_proto_unblock(struct brcmf_pub *pub);
-extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *pub, uint *condition,
+extern int brcmf_os_proto_block(struct brcmf_pub *drvr);
+extern int brcmf_os_proto_unblock(struct brcmf_pub *drvr);
+extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *drvr, uint *condition,
 				  bool *pending);
-extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *pub);
+extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *drvr);
 extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
 extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *pub);
+extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *drvr);
 extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
 extern int brcmf_custom_get_mac_address(unsigned char *buf);
-extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *pub);
-extern void brcmf_os_sdlock_eventq(struct brcmf_pub *pub);
-extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *pub);
+extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *drvr);
+extern void brcmf_os_sdlock_eventq(struct brcmf_pub *drvr);
+extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *drvr);
 #ifdef BCMDBG
-extern int brcmf_write_to_file(struct brcmf_pub *dhd, u8 *buf, int size);
+extern int brcmf_write_to_file(struct brcmf_pub *drvr, u8 *buf, int size);
 #endif				/* BCMDBG */
 
 extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
 extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
 
-extern int brcmf_ifname2idx(struct brcmf_info *dhd, char *name);
-extern int brcmf_c_host_event(struct brcmf_info *dhd, int *idx, void *pktdata,
-			 brcmf_event_msg_t *, void **data_ptr);
+extern int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name);
+extern int brcmf_c_host_event(struct brcmf_info *drvr_priv, int *idx,
+			      void *pktdata, brcmf_event_msg_t *,
+			      void **data_ptr);
 
 extern void brcmf_c_init(void);
 
-extern int brcmf_add_if(struct brcmf_info *dhd, int ifidx, void *handle,
+extern int brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle,
 		      char *name, u8 *mac_addr, u32 flags, u8 bssidx);
-extern void brcmf_del_if(struct brcmf_info *dhd, int ifidx);
+extern void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx);
 
-extern void brcmf_vif_add(struct brcmf_info *dhd, int ifidx, char *name);
-extern void brcmf_vif_del(struct brcmf_info *dhd, int ifidx);
+extern void brcmf_vif_add(struct brcmf_info *drvr_priv, int ifidx, char *name);
+extern void brcmf_vif_del(struct brcmf_info *drvr_priv, int ifidx);
 
-extern void brcmf_event(struct brcmf_info *dhd, char *evpkt, int evlen,
+extern void brcmf_event(struct brcmf_info *drvr_priv, char *evpkt, int evlen,
 			int ifidx);
-extern void brcmf_vif_sendup(struct brcmf_info *dhd, int ifidx,
+extern void brcmf_vif_sendup(struct brcmf_info *drvr_priv, int ifidx,
 			     unsigned char *cp, int len);
 
 /* Send packet to dongle via data channel */
-extern int brcmf_sendpkt(struct brcmf_pub *dhdp, int ifidx,\
+extern int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx,\
 			 struct sk_buff *pkt);
 
-extern int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag);
-extern int brcmf_bus_start(struct brcmf_pub *dhdp);
+extern int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag);
+extern int brcmf_bus_start(struct brcmf_pub *drvr);
 
-extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *dhd, char *arg);
-extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *dhd, char *arg,
+extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg);
+extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg,
 					     int enable, int master_mode);
 
 #ifdef BCMDBG
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +4 -4
index 95fcef4..096d73c 100644
@@ -40,7 +40,7 @@ extern void dhd_bus_unregister(void);
 extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
 
 /* Initialize bus module: prepare for communication w/dongle */
-extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex);
+extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex);
 
 /* Send a data frame to the dongle.  Callee disposes of txp. */
 extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
@@ -58,16 +58,16 @@ extern void dhd_bus_isr(bool *InterruptRecognized,
 			bool *QueueMiniportHandleInterrupt, void *arg);
 
 /* Check for and handle local prot-specific iovar commands */
-extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
+extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
 			    void *params, int plen, void *arg, int len,
 			    bool set);
 
 /* Add bus dump output to a buffer */
-extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp,
+extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr,
 				  struct brcmu_strbuf *strbuf);
 
 /* Clear any bus counters */
-extern void dhd_bus_clearcounts(struct brcmf_pub *dhdp);
+extern void dhd_bus_clearcounts(struct brcmf_pub *drvr);
 
 /* return the dongle chipid */
 extern uint dhd_bus_chip(struct dhd_bus *bus);
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +58 -57

315 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +144 -150

913 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#112 lore raw

PATCH 103/119 staging: brcm80211: remove unused macros from dhd_dbg.h

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

cleanup of some unused macros.

---
 drivers/staging/brcm80211/brcmfmac/dhd_dbg.h |   26 +-------------------------
 1 files changed, 1 insertions(+), 25 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h +1 -25
index 678a7e2..4733de7 100644
@@ -42,24 +42,12 @@
 					printk args; } while (0)
 #define DHD_EVENT(args)		do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
 					printk args; } while (0)
-#define DHD_BTA(args)		do {if (brcmf_msg_level & BRCMF_BTA_VAL) \
-					printk args; } while (0)
-#define DHD_ISCAN(args)		do {if (brcmf_msg_level & BRCMF_ISCAN_VAL) \
-					printk args; } while (0)
 
-#define DHD_ERROR_ON()		(brcmf_msg_level & BRCMF_ERROR_VAL)
-#define DHD_TRACE_ON()		(brcmf_msg_level & BRCMF_TRACE_VAL)
-#define DHD_INFO_ON()		(brcmf_msg_level & BRCMF_INFO_VAL)
 #define DHD_DATA_ON()		(brcmf_msg_level & BRCMF_DATA_VAL)
 #define DHD_CTL_ON()		(brcmf_msg_level & BRCMF_CTL_VAL)
-#define DHD_TIMER_ON()		(brcmf_msg_level & BRCMF_TIMER_VAL)
 #define DHD_HDRS_ON()		(brcmf_msg_level & BRCMF_HDRS_VAL)
 #define DHD_BYTES_ON()		(brcmf_msg_level & BRCMF_BYTES_VAL)
-#define DHD_INTR_ON()		(brcmf_msg_level & BRCMF_INTR_VAL)
 #define DHD_GLOM_ON()		(brcmf_msg_level & BRCMF_GLOM_VAL)
-#define DHD_EVENT_ON()		(brcmf_msg_level & BRCMF_EVENT_VAL)
-#define DHD_BTA_ON()		(brcmf_msg_level & BRCMF_BTA_VAL)
-#define DHD_ISCAN_ON()		(brcmf_msg_level & BRCMF_ISCAN_VAL)
 
 #else	/* (defined BCMDBG) || (defined BCMDBG) */
 
@@ -74,27 +62,15 @@
 #define DHD_INTR(args)
 #define DHD_GLOM(args)
 #define DHD_EVENT(args)
-#define DHD_BTA(args)
-#define DHD_ISCAN(args)
 
-#define DHD_ERROR_ON()		0
-#define DHD_TRACE_ON()		0
-#define DHD_INFO_ON()		0
 #define DHD_DATA_ON()		0
 #define DHD_CTL_ON()		0
-#define DHD_TIMER_ON()		0
 #define DHD_HDRS_ON()		0
 #define DHD_BYTES_ON()		0
-#define DHD_INTR_ON()		0
 #define DHD_GLOM_ON()		0
-#define DHD_EVENT_ON()		0
-#define DHD_BTA_ON()		0
-#define DHD_ISCAN_ON()		0
-#endif				/* defined(BCMDBG) */
 
-#define DHD_LOG(args)
+#endif				/* defined(BCMDBG) */
 
-#define DHD_NONE(args)
 extern int brcmf_msg_level;
 
 #endif				/* _dhd_dbg_ */
Signature · 1 line
1.7.1
author
#113 lore raw

PATCH 104/119 staging: brcm80211: rename dhd_bus structure and functions

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The header file dhd_bus.h contains several function prototypes starting with dhd_bus_ and using parameter with struct dhd_bus. These function and structure have been renamed to brcmf_bus.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |    6 +-
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h    |   24 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |    6 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |  212 +++++++++++-----------
 5 files changed, 125 insertions(+), 125 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +3 -3
index 9f627e5..f76a3dd 100644
@@ -522,14 +522,14 @@ struct brcmf_ioctl {
 };
 
 /* Forward decls for struct brcmf_pub (see below) */
-struct dhd_bus;		/* device bus info */
+struct brcmf_bus;		/* device bus info */
 struct brcmf_proto;	/* device communication protocol info */
 struct brcmf_info;	/* device driver info */
 
 /* Common structure for module and instance linkage */
 struct brcmf_pub {
 	/* Linkage ponters */
-	struct dhd_bus *bus;
+	struct brcmf_bus *bus;
 	struct brcmf_proto *prot;
 	struct brcmf_info *info;
 
@@ -753,7 +753,7 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
  * Returned structure should have bus and prot pointers filled in.
  * bus_hdrlen specifies required headroom for bus module header.
  */
-extern struct brcmf_pub *brcmf_attach(struct dhd_bus *bus,
+extern struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus,
 				      uint bus_hdrlen);
 extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
 extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +12 -12
index 096d73c..50da972 100644
@@ -33,26 +33,26 @@
 extern uint brcmf_watchdog_ms;
 
 /* Indicate (dis)interest in finding dongles. */
-extern int dhd_bus_register(void);
-extern void dhd_bus_unregister(void);
+extern int brcmf_bus_register(void);
+extern void brcmf_bus_unregister(void);
 
 /* Stop bus module: clear pending frames, disable data flow */
-extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
+extern void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex);
 
 /* Initialize bus module: prepare for communication w/dongle */
 extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex);
 
 /* Send a data frame to the dongle.  Callee disposes of txp. */
-extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
+extern int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *txp);
 
 /* Send/receive a control message to/from the dongle.
  * Expects caller to enforce a single outstanding transaction.
  */
 extern int
-brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
+brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen);
 
 extern int
-brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
+brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen);
 
 extern void dhd_bus_isr(bool *InterruptRecognized,
 			bool *QueueMiniportHandleInterrupt, void *arg);
@@ -67,15 +67,15 @@ extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr,
 				  struct brcmu_strbuf *strbuf);
 
 /* Clear any bus counters */
-extern void dhd_bus_clearcounts(struct brcmf_pub *drvr);
+extern void brcmf_bus_clearcounts(struct brcmf_pub *drvr);
 
 /* return the dongle chipid */
-extern uint dhd_bus_chip(struct dhd_bus *bus);
+extern uint brcmf_bus_chip(struct brcmf_bus *bus);
 
-extern void *dhd_bus_pub(struct dhd_bus *bus);
-extern void *dhd_bus_txq(struct dhd_bus *bus);
-extern uint dhd_bus_hdrlen(struct dhd_bus *bus);
+extern void *brcmf_bus_drvr(struct brcmf_bus *bus);
+extern void *brcmf_bus_txq(struct brcmf_bus *bus);
+extern uint brcmf_bus_hdrlen(struct brcmf_bus *bus);
 
-extern void brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick);
+extern void brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick);
 
 #endif				/* _dhd_bus_h_ */
drivers/staging/brcm80211/brcmfmac/dhd_common.c +1 -1
index fc361d1..14dc98d 100644
@@ -225,7 +225,7 @@ brcmf_c_doiovar(struct brcmf_pub *drvr, const struct brcmu_iovar *vi,
 		drvr->tx_realloc = 0;
 		drvr->wd_dpc_sched = 0;
 		memset(&drvr->dstats, 0, sizeof(drvr->dstats));
-		dhd_bus_clearcounts(drvr);
+		brcmf_bus_clearcounts(drvr);
 		break;
 
 	case IOV_GVAL(IOV_IOCTLTIMEOUT):{
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +3 -3
index 29ed98a..aa2f81f 100644
@@ -1426,7 +1426,7 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
 	up(&drvr_priv->sysioc_sem);
 }
 
-struct brcmf_pub *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
+struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
 {
 	struct brcmf_info *drvr_priv = NULL;
 	struct net_device *net;
@@ -1761,7 +1761,7 @@ static void __exit brcmf_module_cleanup(void)
 {
 	DHD_TRACE(("%s: Enter\n", __func__));
 
-	dhd_bus_unregister();
+	brcmf_bus_unregister();
 }
 
 static int __init brcmf_module_init(void)
@@ -1770,7 +1770,7 @@ static int __init brcmf_module_init(void)
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
-	error = dhd_bus_register();
+	error = brcmf_bus_register();
 
 	if (error) {
 		DHD_ERROR(("%s: dhd_bus_register failed\n", __func__));
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +106 -106

711 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#114 lore raw

PATCH 105/119 staging: brcm80211: rename static functions in wl_cfg80211.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The static functions in wl_cfg80211.c starting with wl_ prefix have been renamed starting with brcmf_ prefix to be consistent.

---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |  920 +++++++++++-----------
 1 files changed, 460 insertions(+), 460 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +460 -460
index 2555838..b0ac780 100644
@@ -44,162 +44,162 @@ u32 brcmf_dbg_level = WL_DBG_ERR;
 /*
 ** cfg80211_ops api/callback list
 */
-static s32 wl_cfg80211_change_iface(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_change_iface(struct wiphy *wiphy,
 				      struct net_device *ndev,
 				      enum nl80211_iftype type, u32 *flags,
 				      struct vif_params *params);
-static s32 __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+static s32 __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 				struct cfg80211_scan_request *request,
 				struct cfg80211_ssid *this_ssid);
-static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+static s32 brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 			      struct cfg80211_scan_request *request);
-static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
-static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
+static s32 brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 				   struct cfg80211_ibss_params *params);
-static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy,
 				    struct net_device *dev);
-static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_get_station(struct wiphy *wiphy,
 				     struct net_device *dev, u8 *mac,
 				     struct station_info *sinfo);
-static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy,
 					struct net_device *dev, bool enabled,
 					s32 timeout);
-static s32 wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
 					  struct net_device *dev,
 					  const u8 *addr,
 					  const struct cfg80211_bitrate_mask
 					  *mask);
-static int wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
+static int brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 			       struct cfg80211_connect_params *sme);
-static s32 wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
 				    u16 reason_code);
-static s32 wl_cfg80211_set_tx_power(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
 				      enum nl80211_tx_power_setting type,
 				      s32 dbm);
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
-static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
+static s32 brcmf_cfg80211_config_default_key(struct wiphy *wiphy,
 					  struct net_device *dev, u8 key_idx,
 					  bool unicast, bool multicast);
-static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 				 u8 key_idx, bool pairwise, const u8 *mac_addr,
 				 struct key_params *params);
-static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
 				 u8 key_idx, bool pairwise, const u8 *mac_addr);
-static s32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
 				 u8 key_idx, bool pairwise, const u8 *mac_addr,
 				 void *cookie, void (*callback) (void *cookie,
 								 struct
 								 key_params *
 								 params));
-static s32 wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
 						 struct net_device *dev,
 						 u8 key_idx);
-static s32 wl_cfg80211_resume(struct wiphy *wiphy);
-static s32 wl_cfg80211_suspend(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_resume(struct wiphy *wiphy);
+static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
 				 struct cfg80211_wowlan *wow);
-static s32 wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
 				   struct cfg80211_pmksa *pmksa);
-static s32 wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
 				   struct cfg80211_pmksa *pmksa);
-static s32 wl_cfg80211_flush_pmksa(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy,
 				     struct net_device *dev);
 /*
 ** event & event Q handlers for cfg80211 interfaces
 */
-static s32 wl_create_event_handler(struct wl_priv *wl);
-static void wl_destroy_event_handler(struct wl_priv *wl);
-static s32 wl_event_handler(void *data);
-static void wl_init_eq(struct wl_priv *wl);
-static void wl_flush_eq(struct wl_priv *wl);
-static void wl_lock_eq(struct wl_priv *wl);
-static void wl_unlock_eq(struct wl_priv *wl);
-static void wl_init_eq_lock(struct wl_priv *wl);
-static void wl_init_eloop_handler(struct wl_event_loop *el);
-static struct wl_event_q *wl_deq_event(struct wl_priv *wl);
-static s32 wl_enq_event(struct wl_priv *wl, u32 type,
+static s32 brcmf_create_event_handler(struct wl_priv *wl);
+static void brcmf_destroy_event_handler(struct wl_priv *wl);
+static s32 brcmf_event_handler(void *data);
+static void brcmf_init_eq(struct wl_priv *wl);
+static void brcmf_flush_eq(struct wl_priv *wl);
+static void brcmf_lock_eq(struct wl_priv *wl);
+static void brcmf_unlock_eq(struct wl_priv *wl);
+static void brcmf_init_eq_lock(struct wl_priv *wl);
+static void brcmf_init_eloop_handler(struct wl_event_loop *el);
+static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl);
+static s32 brcmf_enq_event(struct wl_priv *wl, u32 type,
 			  const brcmf_event_msg_t *msg, void *data);
-static void wl_put_event(struct wl_event_q *e);
-static void wl_wakeup_event(struct wl_priv *wl);
-static s32 wl_notify_connect_status(struct wl_priv *wl,
+static void brcmf_put_event(struct wl_event_q *e);
+static void brcmf_wakeup_event(struct wl_priv *wl);
+static s32 brcmf_notify_connect_status(struct wl_priv *wl,
 				      struct net_device *ndev,
 				      const brcmf_event_msg_t *e, void *data);
-static s32 wl_notify_roaming_status(struct wl_priv *wl,
+static s32 brcmf_notify_roaming_status(struct wl_priv *wl,
 				      struct net_device *ndev,
 				      const brcmf_event_msg_t *e, void *data);
-static s32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 				   const brcmf_event_msg_t *e, void *data);
-static s32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
 				 const brcmf_event_msg_t *e, void *data,
 				bool completed);
-static s32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
 				 const brcmf_event_msg_t *e, void *data);
-static s32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
 				  const brcmf_event_msg_t *e, void *data);
 
 /*
 ** register/deregister sdio function
 */
 struct sdio_func *wl_cfg80211_get_sdio_func(void);
-static void wl_clear_sdio_func(void);
+static void brcmf_clear_sdio_func(void);
 
 /*
 ** ioctl utilites
 */
-static s32 wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
+static s32 brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
 			       s32 buf_len);
-static __used s32 wl_dev_bufvar_set(struct net_device *dev, s8 *name,
+static __used s32 brcmf_dev_bufvar_set(struct net_device *dev, s8 *name,
 				      s8 *buf, s32 len);
-static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val);
-static s32 wl_dev_intvar_get(struct net_device *dev, s8 *name,
+static s32 brcmf_dev_intvar_set(struct net_device *dev, s8 *name, s32 val);
+static s32 brcmf_dev_intvar_get(struct net_device *dev, s8 *name,
 			       s32 *retval);
-static s32 wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg,
+static s32 brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg,
 			  u32 len);
 
 /*
 ** cfg80211 set_wiphy_params utilities
 */
-static s32 wl_set_frag(struct net_device *dev, u32 frag_threshold);
-static s32 wl_set_rts(struct net_device *dev, u32 frag_threshold);
-static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l);
+static s32 brcmf_set_frag(struct net_device *dev, u32 frag_threshold);
+static s32 brcmf_set_rts(struct net_device *dev, u32 frag_threshold);
+static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l);
 
 /*
 ** wl profile utilities
 */
-static s32 wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e,
+static s32 brcmf_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e,
 			    void *data, s32 item);
-static void *wl_read_prof(struct wl_priv *wl, s32 item);
-static void wl_init_prof(struct wl_profile *prof);
+static void *brcmf_read_prof(struct wl_priv *wl, s32 item);
+static void brcmf_init_prof(struct wl_profile *prof);
 
 /*
 ** cfg80211 connect utilites
 */
-static s32 wl_set_wpa_version(struct net_device *dev,
+static s32 brcmf_set_wpa_version(struct net_device *dev,
 			struct cfg80211_connect_params *sme);
-static s32 wl_set_auth_type(struct net_device *dev,
+static s32 brcmf_set_auth_type(struct net_device *dev,
 			struct cfg80211_connect_params *sme);
-static s32 wl_set_set_cipher(struct net_device *dev,
+static s32 brcmf_set_set_cipher(struct net_device *dev,
 			struct cfg80211_connect_params *sme);
-static s32 wl_set_key_mgmt(struct net_device *dev,
+static s32 brcmf_set_key_mgmt(struct net_device *dev,
 			struct cfg80211_connect_params *sme);
-static s32 wl_set_set_sharedkey(struct net_device *dev,
+static s32 brcmf_set_set_sharedkey(struct net_device *dev,
 			struct cfg80211_connect_params *sme);
-static s32 wl_get_assoc_ies(struct wl_priv *wl);
-static void wl_clear_assoc_ies(struct wl_priv *wl);
-static void wl_ch_to_chanspec(int ch,
+static s32 brcmf_get_assoc_ies(struct wl_priv *wl);
+static void brcmf_clear_assoc_ies(struct wl_priv *wl);
+static void brcmf_ch_to_chanspec(int ch,
 	struct brcmf_join_params *join_params, size_t *join_params_size);
 
 /*
 ** information element utilities
 */
-static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
-static s32 wl_mode_to_nl80211_iftype(s32 mode);
-static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
+static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
+static s32 brcmf_mode_to_nl80211_iftype(s32 mode);
+static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
 			struct device *dev);
-static void wl_free_wdev(struct wl_priv *wl);
-static s32 wl_inform_bss(struct wl_priv *wl);
-static s32 wl_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi);
-static s32 wl_update_bss_info(struct wl_priv *wl);
-static s32 wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
+static void brcmf_free_wdev(struct wl_priv *wl);
+static s32 brcmf_inform_bss(struct wl_priv *wl);
+static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi);
+static s32 brcmf_update_bss_info(struct wl_priv *wl);
+static s32 brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
 			u8 key_idx, const u8 *mac_addr,
 			struct key_params *params);
 
@@ -212,94 +212,94 @@ static void swap_key_to_BE(struct brcmf_wsec_key *key);
 /*
 ** wl_priv memory init/deinit utilities
 */
-static s32 wl_init_priv_mem(struct wl_priv *wl);
-static void wl_deinit_priv_mem(struct wl_priv *wl);
+static s32 brcmf_init_priv_mem(struct wl_priv *wl);
+static void brcmf_deinit_priv_mem(struct wl_priv *wl);
 
-static void wl_delay(u32 ms);
+static void brcmf_delay(u32 ms);
 
 /*
 ** store/restore cfg80211 instance data
 */
-static void wl_set_drvdata(struct wl_dev *dev, void *data);
-static void *wl_get_drvdata(struct wl_dev *dev);
+static void brcmf_set_drvdata(struct wl_dev *dev, void *data);
+static void *brcmf_get_drvdata(struct wl_dev *dev);
 
 /*
 ** ibss mode utilities
 */
-static bool wl_is_ibssmode(struct wl_priv *wl);
+static bool brcmf_is_ibssmode(struct wl_priv *wl);
 
 /*
 ** dongle up/down , default configuration utilities
 */
-static bool wl_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e);
-static bool wl_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e);
-static bool wl_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e);
-static void wl_link_down(struct wl_priv *wl);
-static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype);
-static s32 __wl_cfg80211_up(struct wl_priv *wl);
-static s32 __wl_cfg80211_down(struct wl_priv *wl);
-static s32 wl_dongle_probecap(struct wl_priv *wl);
-static void wl_init_conf(struct wl_conf *conf);
+static bool brcmf_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static bool brcmf_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static bool brcmf_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static void brcmf_link_down(struct wl_priv *wl);
+static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype);
+static s32 __brcmf_cfg80211_up(struct wl_priv *wl);
+static s32 __brcmf_cfg80211_down(struct wl_priv *wl);
+static s32 brcmf_dongle_probecap(struct wl_priv *wl);
+static void brcmf_init_conf(struct wl_conf *conf);
 
 /*
 ** dongle configuration utilities
 */
-static s32 wl_dongle_eventmsg(struct net_device *ndev);
-static s32 wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
+static s32 brcmf_dongle_eventmsg(struct net_device *ndev);
+static s32 brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
 				s32 scan_unassoc_time, s32 scan_passive_time);
-static s32 wl_config_dongle(struct wl_priv *wl, bool need_lock);
-static s32 wl_dongle_roam(struct net_device *ndev, u32 roamvar,
+static s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock);
+static s32 brcmf_dongle_roam(struct net_device *ndev, u32 roamvar,
 			    u32 bcn_timeout);
 
 /*
 ** iscan handler
 */
-static void wl_iscan_timer(unsigned long data);
-static void wl_term_iscan(struct wl_priv *wl);
-static s32 wl_init_iscan(struct wl_priv *wl);
-static s32 wl_iscan_thread(void *data);
-static s32 wl_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
+static void brcmf_iscan_timer(unsigned long data);
+static void brcmf_term_iscan(struct wl_priv *wl);
+static s32 brcmf_init_iscan(struct wl_priv *wl);
+static s32 brcmf_iscan_thread(void *data);
+static s32 brcmf_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
 				 void *param, s32 paramlen, void *bufptr,
 				 s32 buflen);
-static s32 wl_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
+static s32 brcmf_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
 				 void *param, s32 paramlen, void *bufptr,
 				 s32 buflen);
-static s32 wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid,
+static s32 brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid,
 			  u16 action);
-static s32 wl_do_iscan(struct wl_priv *wl);
-static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan);
-static s32 wl_invoke_iscan(struct wl_priv *wl);
-static s32 wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
+static s32 brcmf_do_iscan(struct wl_priv *wl);
+static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan);
+static s32 brcmf_invoke_iscan(struct wl_priv *wl);
+static s32 brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
 				  struct brcmf_scan_results **bss_list);
-static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted);
-static void wl_init_iscan_eloop(struct wl_iscan_eloop *el);
-static s32 wl_iscan_done(struct wl_priv *wl);
-static s32 wl_iscan_pending(struct wl_priv *wl);
-static s32 wl_iscan_inprogress(struct wl_priv *wl);
-static s32 wl_iscan_aborted(struct wl_priv *wl);
+static void brcmf_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted);
+static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el);
+static s32 brcmf_iscan_done(struct wl_priv *wl);
+static s32 brcmf_iscan_pending(struct wl_priv *wl);
+static s32 brcmf_iscan_inprogress(struct wl_priv *wl);
+static s32 brcmf_iscan_aborted(struct wl_priv *wl);
 
 /*
 * find most significant bit set
 */
-static __used u32 wl_find_msb(u16 bit16);
+static __used u32 brcmf_find_msb(u16 bit16);
 
 /*
 * update pmklist to dongle
 */
-static __used s32 wl_update_pmklist(struct net_device *dev,
+static __used s32 brcmf_update_pmklist(struct net_device *dev,
 				      struct wl_pmk_list *pmk_list, s32 err);
 
-static void wl_set_mpc(struct net_device *ndev, int mpc);
+static void brcmf_set_mpc(struct net_device *ndev, int mpc);
 
 /*
 * debufs support
 */
-static int wl_debugfs_add_netdev_params(struct wl_priv *wl);
-static void wl_debugfs_remove_netdev(struct wl_priv *wl);
+static int brcmf_debugfs_add_netdev_params(struct wl_priv *wl);
+static void brcmf_debugfs_remove_netdev(struct wl_priv *wl);
 
 #define WL_PRIV_GET()							\
 	({								\
-	struct wl_iface *ci = wl_get_drvdata(wl_cfg80211_dev);		\
+	struct wl_iface *ci = brcmf_get_drvdata(wl_cfg80211_dev);		\
 	if (unlikely(!ci)) {						\
 		WL_ERR("wl_cfg80211_dev is unavailable\n");		\
 		BUG();							\
@@ -515,7 +515,7 @@ static void swap_key_to_BE(struct brcmf_wsec_key *key)
 }
 
 static s32
-wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
+brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
 {
 	struct ifreq ifr;
 	struct brcmf_ioctl ioc;
@@ -538,7 +538,7 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
 }
 
 static s32
-wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
+brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
 			 enum nl80211_iftype type, u32 *flags,
 			 struct vif_params *params)
 {
@@ -570,7 +570,7 @@ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
 	}
 
 	infra = cpu_to_le32(infra);
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_INFRA error (%d)\n", err);
 		err = -EAGAIN;
@@ -610,7 +610,7 @@ static void wl_iscan_prep(struct brcmf_scan_params *params,
 }
 
 static s32
-wl_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
+brcmf_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
 		    s32 paramlen, void *bufptr, s32 buflen)
 {
 	s32 iolen;
@@ -618,11 +618,11 @@ wl_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
 	iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
 	BUG_ON(!iolen);
 
-	return wl_dev_ioctl(dev, BRCMF_C_SET_VAR, bufptr, iolen);
+	return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, bufptr, iolen);
 }
 
 static s32
-wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
+brcmf_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
 		    s32 paramlen, void *bufptr, s32 buflen)
 {
 	s32 iolen;
@@ -630,11 +630,11 @@ wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
 	iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
 	BUG_ON(!iolen);
 
-	return wl_dev_ioctl(dev, BRCMF_C_GET_VAR, bufptr, buflen);
+	return brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, bufptr, buflen);
 }
 
 static s32
-wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
+brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
 {
 	s32 params_size = (BRCMF_SCAN_PARAMS_FIXED_SIZE +
 				offsetof(struct brcmf_iscan_params, params));
@@ -655,7 +655,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
 	params->scan_duration = cpu_to_le16(0);
 
 	/* params_size += offsetof(struct brcmf_iscan_params, params); */
-	err = wl_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
+	err = brcmf_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
 				iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN);
 	if (unlikely(err)) {
 		if (err == -EBUSY) {
@@ -668,7 +668,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
 	return err;
 }
 
-static s32 wl_do_iscan(struct wl_priv *wl)
+static s32 brcmf_do_iscan(struct wl_priv *wl)
 {
 	struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
 	struct net_device *ndev = wl_to_ndev(wl);
@@ -682,15 +682,15 @@ static s32 wl_do_iscan(struct wl_priv *wl)
 	iscan->state = WL_ISCAN_STATE_SCANING;
 
 	passive_scan = wl->active_scan ? 0 : 1;
-	err = wl_dev_ioctl(wl_to_ndev(wl), BRCMF_C_SET_PASSIVE_SCAN,
+	err = brcmf_dev_ioctl(wl_to_ndev(wl), BRCMF_C_SET_PASSIVE_SCAN,
 			&passive_scan, sizeof(passive_scan));
 	if (unlikely(err)) {
 		WL_ERR("error (%d)\n", err);
 		return err;
 	}
-	wl_set_mpc(ndev, 0);
+	brcmf_set_mpc(ndev, 0);
 	wl->iscan_kickstart = true;
-	wl_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START);
+	brcmf_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START);
 	mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
 	iscan->timer_on = 1;
 
@@ -698,7 +698,7 @@ static s32 wl_do_iscan(struct wl_priv *wl)
 }
 
 static s32
-__wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+__brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 		   struct cfg80211_scan_request *request,
 		   struct cfg80211_ssid *this_ssid)
 {
@@ -741,7 +741,7 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 	wl->scan_request = request;
 	set_bit(WL_STATUS_SCANNING, &wl->status);
 	if (iscan_req) {
-		err = wl_do_iscan(wl);
+		err = brcmf_do_iscan(wl);
 		if (likely(!err))
 			return err;
 		else
@@ -761,14 +761,14 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 		}
 
 		passive_scan = wl->active_scan ? 0 : 1;
-		err = wl_dev_ioctl(ndev, BRCMF_C_SET_PASSIVE_SCAN,
+		err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_PASSIVE_SCAN,
 				&passive_scan, sizeof(passive_scan));
 		if (unlikely(err)) {
 			WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
 			goto scan_out;
 		}
-		wl_set_mpc(ndev, 0);
-		err = wl_dev_ioctl(ndev, BRCMF_C_SCAN, &sr->ssid,
+		brcmf_set_mpc(ndev, 0);
+		err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN, &sr->ssid,
 				sizeof(sr->ssid));
 		if (err) {
 			if (err == -EBUSY) {
@@ -777,7 +777,7 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 			} else {
 				WL_ERR("WLC_SCAN error (%d)\n", err);
 			}
-			wl_set_mpc(ndev, 1);
+			brcmf_set_mpc(ndev, 1);
 			goto scan_out;
 		}
 	}
@@ -791,7 +791,7 @@ scan_out:
 }
 
 static s32
-wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 		 struct cfg80211_scan_request *request)
 {
 	s32 err = 0;
@@ -800,7 +800,7 @@ wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 
 	CHECK_SYS_UP();
 
-	err = __wl_cfg80211_scan(wiphy, ndev, request, NULL);
+	err = __brcmf_cfg80211_scan(wiphy, ndev, request, NULL);
 	if (unlikely(err))
 		WL_ERR("scan error (%d)\n", err);
 
@@ -808,7 +808,7 @@ wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 	return err;
 }
 
-static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
+static s32 brcmf_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
 {
 	s8 buf[BRCMF_C_IOCTL_SMLEN];
 	u32 len;
@@ -819,7 +819,7 @@ static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
 			    sizeof(buf));
 	BUG_ON(!len);
 
-	err = wl_dev_ioctl(dev, BRCMF_C_SET_VAR, buf, len);
+	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, buf, len);
 	if (unlikely(err))
 		WL_ERR("error (%d)\n", err);
 
@@ -827,7 +827,7 @@ static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
 }
 
 static s32
-wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
+brcmf_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
 {
 	union {
 		s8 buf[BRCMF_C_IOCTL_SMLEN];
@@ -841,7 +841,7 @@ wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
 	    brcmu_mkiovar(name, (char *)(&data_null), 0, (char *)(&var),
 			sizeof(var.buf));
 	BUG_ON(!len);
-	err = wl_dev_ioctl(dev, BRCMF_C_GET_VAR, &var, len);
+	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, &var, len);
 	if (unlikely(err))
 		WL_ERR("error (%d)\n", err);
 
@@ -850,35 +850,35 @@ wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
 	return err;
 }
 
-static s32 wl_set_rts(struct net_device *dev, u32 rts_threshold)
+static s32 brcmf_set_rts(struct net_device *dev, u32 rts_threshold)
 {
 	s32 err = 0;
 
-	err = wl_dev_intvar_set(dev, "rtsthresh", rts_threshold);
+	err = brcmf_dev_intvar_set(dev, "rtsthresh", rts_threshold);
 	if (unlikely(err))
 		WL_ERR("Error (%d)\n", err);
 
 	return err;
 }
 
-static s32 wl_set_frag(struct net_device *dev, u32 frag_threshold)
+static s32 brcmf_set_frag(struct net_device *dev, u32 frag_threshold)
 {
 	s32 err = 0;
 
-	err = wl_dev_intvar_set(dev, "fragthresh", frag_threshold);
+	err = brcmf_dev_intvar_set(dev, "fragthresh", frag_threshold);
 	if (unlikely(err))
 		WL_ERR("Error (%d)\n", err);
 
 	return err;
 }
 
-static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l)
+static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l)
 {
 	s32 err = 0;
 	u32 cmd = (l ? WLC_SET_LRL : WLC_SET_SRL);
 
 	retry = cpu_to_le32(retry);
-	err = wl_dev_ioctl(dev, cmd, &retry, sizeof(retry));
+	err = brcmf_dev_ioctl(dev, cmd, &retry, sizeof(retry));
 	if (unlikely(err)) {
 		WL_ERR("cmd (%d) , error (%d)\n", cmd, err);
 		return err;
@@ -886,7 +886,7 @@ static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l)
 	return err;
 }
 
-static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
+static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
 	struct net_device *ndev = wl_to_ndev(wl);
@@ -898,28 +898,28 @@ static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
 	if (changed & WIPHY_PARAM_RTS_THRESHOLD &&
 	    (wl->conf->rts_threshold != wiphy->rts_threshold)) {
 		wl->conf->rts_threshold = wiphy->rts_threshold;
-		err = wl_set_rts(ndev, wl->conf->rts_threshold);
+		err = brcmf_set_rts(ndev, wl->conf->rts_threshold);
 		if (!err)
 			goto done;
 	}
 	if (changed & WIPHY_PARAM_FRAG_THRESHOLD &&
 	    (wl->conf->frag_threshold != wiphy->frag_threshold)) {
 		wl->conf->frag_threshold = wiphy->frag_threshold;
-		err = wl_set_frag(ndev, wl->conf->frag_threshold);
+		err = brcmf_set_frag(ndev, wl->conf->frag_threshold);
 		if (!err)
 			goto done;
 	}
 	if (changed & WIPHY_PARAM_RETRY_LONG
 	    && (wl->conf->retry_long != wiphy->retry_long)) {
 		wl->conf->retry_long = wiphy->retry_long;
-		err = wl_set_retry(ndev, wl->conf->retry_long, true);
+		err = brcmf_set_retry(ndev, wl->conf->retry_long, true);
 		if (!err)
 			goto done;
 	}
 	if (changed & WIPHY_PARAM_RETRY_SHORT
 	    && (wl->conf->retry_short != wiphy->retry_short)) {
 		wl->conf->retry_short = wiphy->retry_short;
-		err = wl_set_retry(ndev, wl->conf->retry_short, false);
+		err = brcmf_set_retry(ndev, wl->conf->retry_short, false);
 		if (!err)
 			goto done;
 	}
@@ -930,7 +930,7 @@ done:
 }
 
 static s32
-wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 		      struct cfg80211_ibss_params *params)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -993,7 +993,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 	if (params->privacy)
 		wsec |= WEP_ENABLED;
 
-	err = wl_dev_intvar_set(dev, "wsec", wsec);
+	err = brcmf_dev_intvar_set(dev, "wsec", wsec);
 	if (unlikely(err)) {
 		WL_ERR("wsec failed (%d)\n", err);
 		goto done;
@@ -1005,7 +1005,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 	else
 		bcnprd = cpu_to_le32(100);
 
-	err = wl_dev_ioctl(dev, WLC_SET_BCNPRD, &bcnprd, sizeof(bcnprd));
+	err = brcmf_dev_ioctl(dev, WLC_SET_BCNPRD, &bcnprd, sizeof(bcnprd));
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err);
 		goto done;
@@ -1020,7 +1020,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 	memcpy(join_params.ssid.SSID, params->ssid, join_params.ssid.SSID_len);
 	join_params.ssid.SSID_len = cpu_to_le32(join_params.ssid.SSID_len);
 	join_params_size = sizeof(join_params.ssid);
-	wl_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
+	brcmf_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
 
 	/* BSSID */
 	if (params->bssid) {
@@ -1030,7 +1030,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 	} else {
 		memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN);
 	}
-	wl_update_prof(wl, NULL, &join_params.params.bssid, WL_PROF_BSSID);
+	brcmf_update_prof(wl, NULL, &join_params.params.bssid, WL_PROF_BSSID);
 
 	/* Channel */
 	if (params->channel) {
@@ -1041,13 +1041,13 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 				params->channel->center_freq);
 		if (params->channel_fixed) {
 			/* adding chanspec */
-			wl_ch_to_chanspec(wl->channel,
+			brcmf_ch_to_chanspec(wl->channel,
 				&join_params, &join_params_size);
 		}
 
 		/* set channel for starter */
 		target_channel = cpu_to_le32(wl->channel);
-		err = wl_dev_ioctl(dev, WLC_SET_CHANNEL,
+		err = brcmf_dev_ioctl(dev, WLC_SET_CHANNEL,
 			&target_channel, sizeof(target_channel));
 		if (unlikely(err)) {
 			WL_ERR("WLC_SET_CHANNEL failed (%d)\n", err);
@@ -1059,7 +1059,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 	wl->ibss_starter = false;
 
 
-	err = wl_dev_ioctl(dev, BRCMF_C_SET_SSID,
+	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
 			   &join_params, join_params_size);
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_SSID failed (%d)\n", err);
@@ -1073,7 +1073,7 @@ done:
 	return err;
 }
 
-static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
+static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
 	s32 err = 0;
@@ -1081,7 +1081,7 @@ static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
 	WL_TRACE("Enter\n");
 	CHECK_SYS_UP();
 
-	wl_link_down(wl);
+	brcmf_link_down(wl);
 
 	WL_TRACE("Exit\n");
 
@@ -1089,7 +1089,7 @@ static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
 }
 
 static s32
-wl_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
 {
 	struct wl_priv *wl = ndev_to_wl(dev);
 	struct wl_security *sec;
@@ -1103,18 +1103,18 @@ wl_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
 	else
 		val = WPA_AUTH_DISABLED;
 	WL_CONN("setting wpa_auth to 0x%0x\n", val);
-	err = wl_dev_intvar_set(dev, "wpa_auth", val);
+	err = brcmf_dev_intvar_set(dev, "wpa_auth", val);
 	if (unlikely(err)) {
 		WL_ERR("set wpa_auth failed (%d)\n", err);
 		return err;
 	}
-	sec = wl_read_prof(wl, WL_PROF_SEC);
+	sec = brcmf_read_prof(wl, WL_PROF_SEC);
 	sec->wpa_versions = sme->crypto.wpa_versions;
 	return err;
 }
 
 static s32
-wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
 {
 	struct wl_priv *wl = ndev_to_wl(dev);
 	struct wl_security *sec;
@@ -1142,18 +1142,18 @@ wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
 		break;
 	}
 
-	err = wl_dev_intvar_set(dev, "auth", val);
+	err = brcmf_dev_intvar_set(dev, "auth", val);
 	if (unlikely(err)) {
 		WL_ERR("set auth failed (%d)\n", err);
 		return err;
 	}
-	sec = wl_read_prof(wl, WL_PROF_SEC);
+	sec = brcmf_read_prof(wl, WL_PROF_SEC);
 	sec->auth_type = sme->auth_type;
 	return err;
 }
 
 static s32
-wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
 {
 	struct wl_priv *wl = ndev_to_wl(dev);
 	struct wl_security *sec;
@@ -1205,13 +1205,13 @@ wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
 	}
 
 	WL_CONN("pval (%d) gval (%d)\n", pval, gval);
-	err = wl_dev_intvar_set(dev, "wsec", pval | gval);
+	err = brcmf_dev_intvar_set(dev, "wsec", pval | gval);
 	if (unlikely(err)) {
 		WL_ERR("error (%d)\n", err);
 		return err;
 	}
 
-	sec = wl_read_prof(wl, WL_PROF_SEC);
+	sec = brcmf_read_prof(wl, WL_PROF_SEC);
 	sec->cipher_pairwise = sme->crypto.ciphers_pairwise[0];
 	sec->cipher_group = sme->crypto.cipher_group;
 
@@ -1219,7 +1219,7 @@ wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
 }
 
 static s32
-wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
 {
 	struct wl_priv *wl = ndev_to_wl(dev);
 	struct wl_security *sec;
@@ -1227,7 +1227,7 @@ wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
 	s32 err = 0;
 
 	if (sme->crypto.n_akm_suites) {
-		err = wl_dev_intvar_get(dev, "wpa_auth", &val);
+		err = brcmf_dev_intvar_get(dev, "wpa_auth", &val);
 		if (unlikely(err)) {
 			WL_ERR("could not get wpa_auth (%d)\n", err);
 			return err;
@@ -1261,20 +1261,20 @@ wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
 		}
 
 		WL_CONN("setting wpa_auth to %d\n", val);
-		err = wl_dev_intvar_set(dev, "wpa_auth", val);
+		err = brcmf_dev_intvar_set(dev, "wpa_auth", val);
 		if (unlikely(err)) {
 			WL_ERR("could not set wpa_auth (%d)\n", err);
 			return err;
 		}
 	}
-	sec = wl_read_prof(wl, WL_PROF_SEC);
+	sec = brcmf_read_prof(wl, WL_PROF_SEC);
 	sec->wpa_auth = sme->crypto.akm_suites[0];
 
 	return err;
 }
 
 static s32
-wl_set_set_sharedkey(struct net_device *dev,
+brcmf_set_set_sharedkey(struct net_device *dev,
 		     struct cfg80211_connect_params *sme)
 {
 	struct wl_priv *wl = ndev_to_wl(dev);
@@ -1285,7 +1285,7 @@ wl_set_set_sharedkey(struct net_device *dev,
 
 	WL_CONN("key len (%d)\n", sme->key_len);
 	if (sme->key_len) {
-		sec = wl_read_prof(wl, WL_PROF_SEC);
+		sec = brcmf_read_prof(wl, WL_PROF_SEC);
 		WL_CONN("wpa_versions 0x%x cipher_pairwise 0x%x\n",
 		       sec->wpa_versions, sec->cipher_pairwise);
 		if (!
@@ -1319,7 +1319,7 @@ wl_set_set_sharedkey(struct net_device *dev,
 			       key.len, key.index, key.algo);
 			WL_CONN("key \"%s\"\n", key.data);
 			swap_key_from_BE(&key);
-			err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key,
+			err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key,
 					sizeof(key));
 			if (unlikely(err)) {
 				WL_ERR("WLC_SET_KEY error (%d)\n", err);
@@ -1328,7 +1328,7 @@ wl_set_set_sharedkey(struct net_device *dev,
 			if (sec->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) {
 				WL_CONN("set auth_type to shared key\n");
 				val = 1;	/* shared key */
-				err = wl_dev_intvar_set(dev, "auth", val);
+				err = brcmf_dev_intvar_set(dev, "auth", val);
 				if (unlikely(err)) {
 					WL_ERR("set auth failed (%d)\n", err);
 					return err;
@@ -1340,7 +1340,7 @@ wl_set_set_sharedkey(struct net_device *dev,
 }
 
 static s32
-wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 		    struct cfg80211_connect_params *sme)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -1370,37 +1370,37 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 
 	WL_INFO("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len);
 
-	err = wl_set_wpa_version(dev, sme);
+	err = brcmf_set_wpa_version(dev, sme);
 	if (err) {
 		WL_ERR("wl_set_wpa_version failed (%d)\n", err);
 		goto done;
 	}
 
-	err = wl_set_auth_type(dev, sme);
+	err = brcmf_set_auth_type(dev, sme);
 	if (err) {
 		WL_ERR("wl_set_auth_type failed (%d)\n", err);
 		goto done;
 	}
 
-	err = wl_set_set_cipher(dev, sme);
+	err = brcmf_set_set_cipher(dev, sme);
 	if (err) {
 		WL_ERR("wl_set_set_cipher failed (%d)\n", err);
 		goto done;
 	}
 
-	err = wl_set_key_mgmt(dev, sme);
+	err = brcmf_set_key_mgmt(dev, sme);
 	if (err) {
 		WL_ERR("wl_set_key_mgmt failed (%d)\n", err);
 		goto done;
 	}
 
-	err = wl_set_set_sharedkey(dev, sme);
+	err = brcmf_set_set_sharedkey(dev, sme);
 	if (err) {
 		WL_ERR("wl_set_set_sharedkey failed (%d)\n", err);
 		goto done;
 	}
 
-	wl_update_prof(wl, NULL, sme->bssid, WL_PROF_BSSID);
+	brcmf_update_prof(wl, NULL, sme->bssid, WL_PROF_BSSID);
 	/*
 	 **  Join with specific BSSID and cached SSID
 	 **  If SSID is zero join based on BSSID only
@@ -1411,7 +1411,7 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 	join_params.ssid.SSID_len = min(sizeof(join_params.ssid.SSID), sme->ssid_len);
 	memcpy(&join_params.ssid.SSID, sme->ssid, join_params.ssid.SSID_len);
 	join_params.ssid.SSID_len = cpu_to_le32(join_params.ssid.SSID_len);
-	wl_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
+	brcmf_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
 
 	if (sme->bssid)
 		memcpy(join_params.params.bssid, sme->bssid, ETH_ALEN);
@@ -1423,8 +1423,8 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 		       join_params.ssid.SSID, join_params.ssid.SSID_len);
 	}
 
-	wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
-	err = wl_dev_ioctl(dev, BRCMF_C_SET_SSID,
+	brcmf_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
+	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
 			   &join_params, join_params_size);
 	if (err)
 		WL_ERR("WLC_SET_SSID failed (%d)\n", err);
@@ -1437,7 +1437,7 @@ done:
 }
 
 static s32
-wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
 		       u16 reason_code)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -1450,9 +1450,9 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
 	clear_bit(WL_STATUS_CONNECTED, &wl->status);
 
 	scbval.val = reason_code;
-	memcpy(&scbval.ea, wl_read_prof(wl, WL_PROF_BSSID), ETH_ALEN);
+	memcpy(&scbval.ea, brcmf_read_prof(wl, WL_PROF_BSSID), ETH_ALEN);
 	scbval.val = cpu_to_le32(scbval.val);
-	err = wl_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
+	err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
 			sizeof(struct brcmf_scb_val));
 	if (unlikely(err))
 		WL_ERR("error (%d)\n", err);
@@ -1464,7 +1464,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
 }
 
 static s32
-wl_cfg80211_set_tx_power(struct wiphy *wiphy,
+brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
 			 enum nl80211_tx_power_setting type, s32 dbm)
 {
 
@@ -1498,7 +1498,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
 	/* Make sure radio is off or on as far as software is concerned */
 	disable = WL_RADIO_SW_DISABLE << 16;
 	disable = cpu_to_le32(disable);
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_RADIO, &disable, sizeof(disable));
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_RADIO, &disable, sizeof(disable));
 	if (unlikely(err))
 		WL_ERR("WLC_SET_RADIO error (%d)\n", err);
 
@@ -1506,7 +1506,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
 		txpwrmw = 0xffff;
 	else
 		txpwrmw = (u16) dbm;
-	err = wl_dev_intvar_set(ndev, "qtxpower",
+	err = brcmf_dev_intvar_set(ndev, "qtxpower",
 			(s32) (brcmu_mw_to_qdbm(txpwrmw)));
 	if (unlikely(err))
 		WL_ERR("qtxpower error (%d)\n", err);
@@ -1517,7 +1517,7 @@ done:
 	return err;
 }
 
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
+static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
 	struct net_device *ndev = wl_to_ndev(wl);
@@ -1528,7 +1528,7 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
 	WL_TRACE("Enter\n");
 	CHECK_SYS_UP();
 
-	err = wl_dev_intvar_get(ndev, "qtxpower", &txpwrdbm);
+	err = brcmf_dev_intvar_get(ndev, "qtxpower", &txpwrdbm);
 	if (unlikely(err)) {
 		WL_ERR("error (%d)\n", err);
 		goto done;
@@ -1543,7 +1543,7 @@ done:
 }
 
 static s32
-wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
 			       u8 key_idx, bool unicast, bool multicast)
 {
 	u32 index;
@@ -1554,7 +1554,7 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
 	WL_CONN("key index (%d)\n", key_idx);
 	CHECK_SYS_UP();
 
-	err = wl_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
+	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
 	if (unlikely(err)) {
 		WL_ERR("WLC_GET_WSEC error (%d)\n", err);
 		goto done;
@@ -1565,7 +1565,7 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
 		/* Just select a new current key */
 		index = (u32) key_idx;
 		index = cpu_to_le32(index);
-		err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY_PRIMARY, &index,
+		err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY_PRIMARY, &index,
 				sizeof(index));
 		if (unlikely(err))
 			WL_ERR("error (%d)\n", err);
@@ -1576,7 +1576,7 @@ done:
 }
 
 static s32
-wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
+brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
 	      u8 key_idx, const u8 *mac_addr, struct key_params *params)
 {
 	struct brcmf_wsec_key key;
@@ -1593,7 +1593,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
 	if (key.len == 0) {
 		/* key delete */
 		swap_key_from_BE(&key);
-		err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
+		err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
 		if (unlikely(err)) {
 			WL_ERR("key delete error (%d)\n", err);
 			return err;
@@ -1653,7 +1653,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
 		swap_key_from_BE(&key);
 
 		brcmf_netdev_wait_pend8021x(dev);
-		err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
+		err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
 		if (unlikely(err)) {
 			WL_ERR("WLC_SET_KEY error (%d)\n", err);
 			return err;
@@ -1663,7 +1663,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
 }
 
 static s32
-wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 		    u8 key_idx, bool pairwise, const u8 *mac_addr,
 		    struct key_params *params)
 {
@@ -1679,7 +1679,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 
 	if (mac_addr) {
 		WL_TRACE("Exit");
-		return wl_add_keyext(wiphy, dev, key_idx, mac_addr, params);
+		return brcmf_add_keyext(wiphy, dev, key_idx, mac_addr, params);
 	}
 	memset(&key, 0, sizeof(key));
 
@@ -1726,21 +1726,21 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 
 	/* Set the new key/index */
 	swap_key_from_BE(&key);
-	err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
+	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_KEY error (%d)\n", err);
 		goto done;
 	}
 
 	val = WEP_ENABLED;
-	err = wl_dev_intvar_get(dev, "wsec", &wsec);
+	err = brcmf_dev_intvar_get(dev, "wsec", &wsec);
 	if (unlikely(err)) {
 		WL_ERR("get wsec error (%d)\n", err);
 		goto done;
 	}
 	wsec &= ~(WEP_ENABLED);
 	wsec |= val;
-	err = wl_dev_intvar_set(dev, "wsec", wsec);
+	err = brcmf_dev_intvar_set(dev, "wsec", wsec);
 	if (unlikely(err)) {
 		WL_ERR("set wsec error (%d)\n", err);
 		goto done;
@@ -1748,7 +1748,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 
 	val = 1;		/* assume shared key. otherwise 0 */
 	val = cpu_to_le32(val);
-	err = wl_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
+	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
 	if (unlikely(err))
 		WL_ERR("WLC_SET_AUTH error (%d)\n", err);
 done:
@@ -1757,7 +1757,7 @@ done:
 }
 
 static s32
-wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
 		    u8 key_idx, bool pairwise, const u8 *mac_addr)
 {
 	struct brcmf_wsec_key key;
@@ -1776,7 +1776,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
 	WL_CONN("key index (%d)\n", key_idx);
 	/* Set the new key/index */
 	swap_key_from_BE(&key);
-	err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
+	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
 	if (unlikely(err)) {
 		if (err == -EINVAL) {
 			if (key.index >= DOT11_MAX_DEFAULT_KEYS)
@@ -1791,7 +1791,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
 	}
 
 	val = 0;
-	err = wl_dev_intvar_get(dev, "wsec", &wsec);
+	err = brcmf_dev_intvar_get(dev, "wsec", &wsec);
 	if (unlikely(err)) {
 		WL_ERR("get wsec error (%d)\n", err);
 		/* Ignore this error, may happen during DISASSOC */
@@ -1800,7 +1800,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
 	}
 	wsec &= ~(WEP_ENABLED);
 	wsec |= val;
-	err = wl_dev_intvar_set(dev, "wsec", wsec);
+	err = brcmf_dev_intvar_set(dev, "wsec", wsec);
 	if (unlikely(err)) {
 		WL_ERR("set wsec error (%d)\n", err);
 		/* Ignore this error, may happen during DISASSOC */
@@ -1810,7 +1810,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
 
 	val = 0;		/* assume open key. otherwise 1 */
 	val = cpu_to_le32(val);
-	err = wl_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
+	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_AUTH error (%d)\n", err);
 		/* Ignore this error, may happen during DISASSOC */
@@ -1822,7 +1822,7 @@ done:
 }
 
 static s32
-wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
 		    u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
 		    void (*callback) (void *cookie, struct key_params * params))
 {
@@ -1844,7 +1844,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
 	params.key_len = (u8) min_t(u8, WLAN_MAX_KEY_LEN, key.len);
 	memcpy(params.key, key.data, params.key_len);
 
-	err = wl_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
+	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
 	if (unlikely(err)) {
 		WL_ERR("WLC_GET_WSEC error (%d)\n", err);
 		/* Ignore this error, may happen during DISASSOC */
@@ -1854,7 +1854,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
 	wsec = le32_to_cpu(wsec);
 	switch (wsec) {
 	case WEP_ENABLED:
-		sec = wl_read_prof(wl, WL_PROF_SEC);
+		sec = brcmf_read_prof(wl, WL_PROF_SEC);
 		if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) {
 			params.cipher = WLAN_CIPHER_SUITE_WEP40;
 			WL_CONN("WLAN_CIPHER_SUITE_WEP40\n");
@@ -1884,7 +1884,7 @@ done:
 }
 
 static s32
-wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
+brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
 				    struct net_device *dev, u8 key_idx)
 {
 	WL_INFO("Not supported\n");
@@ -1894,7 +1894,7 @@ wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
 }
 
 static s32
-wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 			u8 *mac, struct station_info *sinfo)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -1902,7 +1902,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 	int rssi;
 	s32 rate;
 	s32 err = 0;
-	u8 *bssid = wl_read_prof(wl, WL_PROF_BSSID);
+	u8 *bssid = brcmf_read_prof(wl, WL_PROF_BSSID);
 
 	WL_TRACE("Enter\n");
 	CHECK_SYS_UP();
@@ -1919,7 +1919,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 	}
 
 	/* Report the current tx rate */
-	err = wl_dev_ioctl(dev, BRCMF_C_GET_RATE, &rate, sizeof(rate));
+	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RATE, &rate, sizeof(rate));
 	if (err) {
 		WL_ERR("Could not get rate (%d)\n", err);
 	} else {
@@ -1931,7 +1931,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 
 	if (test_bit(WL_STATUS_CONNECTED, &wl->status)) {
 		scb_val.val = 0;
-		err = wl_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
+		err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
 				sizeof(struct brcmf_scb_val));
 		if (unlikely(err)) {
 			WL_ERR("Could not get rssi (%d)\n", err);
@@ -1948,7 +1948,7 @@ done:
 }
 
 static s32
-wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
 			   bool enabled, s32 timeout)
 {
 	s32 pm;
@@ -1961,7 +1961,7 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
 	pm = cpu_to_le32(pm);
 	WL_INFO("power save %s\n", (pm ? "enabled" : "disabled"));
 
-	err = wl_dev_ioctl(dev, BRCMF_C_SET_PM, &pm, sizeof(pm));
+	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_PM, &pm, sizeof(pm));
 	if (unlikely(err)) {
 		if (err == -ENODEV)
 			WL_ERR("net_device is not ready yet\n");
@@ -1972,7 +1972,7 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
 	return err;
 }
 
-static __used u32 wl_find_msb(u16 bit16)
+static __used u32 brcmf_find_msb(u16 bit16)
 {
 	u32 ret = 0;
 
@@ -2000,7 +2000,7 @@ static __used u32 wl_find_msb(u16 bit16)
 }
 
 static s32
-wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
 			     const u8 *addr,
 			     const struct cfg80211_bitrate_mask *mask)
 {
@@ -2017,7 +2017,7 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
 
 	/* addr param is always NULL. ignore it */
 	/* Get current rateset */
-	err = wl_dev_ioctl(dev, WLC_GET_CURR_RATESET, &rateset,
+	err = brcmf_dev_ioctl(dev, WLC_GET_CURR_RATESET, &rateset,
 			sizeof(rateset));
 	if (unlikely(err)) {
 		WL_ERR("could not get current rateset (%d)\n", err);
@@ -2026,9 +2026,9 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
 
 	rateset.count = le32_to_cpu(rateset.count);
 
-	legacy = wl_find_msb(mask->control[IEEE80211_BAND_2GHZ].legacy);
+	legacy = brcmf_find_msb(mask->control[IEEE80211_BAND_2GHZ].legacy);
 	if (!legacy)
-		legacy = wl_find_msb(mask->control[IEEE80211_BAND_5GHZ].legacy);
+		legacy = brcmf_find_msb(mask->control[IEEE80211_BAND_5GHZ].legacy);
 
 	val = wl_g_rates[legacy - 1].bitrate * 100000;
 
@@ -2046,8 +2046,8 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
 	 *      Set rate override,
 	 *      Since the is a/b/g-blind, both a/bg_rate are enforced.
 	 */
-	err_bg = wl_dev_intvar_set(dev, "bg_rate", rate);
-	err_a = wl_dev_intvar_set(dev, "a_rate", rate);
+	err_bg = brcmf_dev_intvar_set(dev, "bg_rate", rate);
+	err_a = brcmf_dev_intvar_set(dev, "a_rate", rate);
 	if (unlikely(err_bg && err_a)) {
 		WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a);
 		err = err_bg | err_a;
@@ -2058,7 +2058,7 @@ done:
 	return err;
 }
 
-static s32 wl_cfg80211_resume(struct wiphy *wiphy)
+static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
 
@@ -2074,13 +2074,13 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
 #endif	/*  defined(CONFIG_PM_SLEEP) */
 
 	if (test_bit(WL_STATUS_READY, &wl->status))
-		wl_invoke_iscan(wiphy_to_wl(wiphy));
+		brcmf_invoke_iscan(wiphy_to_wl(wiphy));
 
 	WL_TRACE("Exit\n");
 	return 0;
 }
 
-static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
+static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
 	struct net_device *ndev = wl_to_ndev(wl);
@@ -2102,7 +2102,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
 	     test_bit(WL_STATUS_READY, &wl->status)) {
 		WL_INFO("Disassociating from AP"
 			" while entering suspend state\n");
-		wl_link_down(wl);
+		brcmf_link_down(wl);
 
 		/*
 		 * Make sure WPA_Supplicant receives all the event
@@ -2110,13 +2110,13 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
 		 * the state fw and WPA_Supplicant state consistent
 		 */
 		rtnl_unlock();
-		wl_delay(500);
+		brcmf_delay(500);
 		rtnl_lock();
 	}
 
 	set_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
 	if (test_bit(WL_STATUS_READY, &wl->status))
-		wl_term_iscan(wl);
+		brcmf_term_iscan(wl);
 
 	if (wl->scan_request) {
 		/* Indidate scan abort to cfg80211 layer */
@@ -2130,7 +2130,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
 	/* Turn off watchdog timer */
 	if (test_bit(WL_STATUS_READY, &wl->status)) {
 		WL_INFO("Enable MPC\n");
-		wl_set_mpc(ndev, 1);
+		brcmf_set_mpc(ndev, 1);
 	}
 
 #if defined(CONFIG_PM_SLEEP)
@@ -2143,7 +2143,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
 }
 
 static __used s32
-wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
+brcmf_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
 		  s32 err)
 {
 	int i, j;
@@ -2157,14 +2157,14 @@ wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
 	}
 
 	if (likely(!err))
-		wl_dev_bufvar_set(dev, "pmkid_info", (char *)pmk_list,
+		brcmf_dev_bufvar_set(dev, "pmkid_info", (char *)pmk_list,
 					sizeof(*pmk_list));
 
 	return err;
 }
 
 static s32
-wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
 		      struct cfg80211_pmksa *pmksa)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -2195,14 +2195,14 @@ wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
 		       wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].
 		       PMKID[i]);
 
-	err = wl_update_pmklist(dev, wl->pmk_list, err);
+	err = brcmf_update_pmklist(dev, wl->pmk_list, err);
 
 	WL_TRACE("Exit\n");
 	return err;
 }
 
 static s32
-wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
 		      struct cfg80211_pmksa *pmksa)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -2241,7 +2241,7 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
 	} else
 		err = -EINVAL;
 
-	err = wl_update_pmklist(dev, wl->pmk_list, err);
+	err = brcmf_update_pmklist(dev, wl->pmk_list, err);
 
 	WL_TRACE("Exit\n");
 	return err;
@@ -2249,7 +2249,7 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
 }
 
 static s32
-wl_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
+brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
 {
 	struct wl_priv *wl = wiphy_to_wl(wiphy);
 	s32 err = 0;
@@ -2258,7 +2258,7 @@ wl_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
 	CHECK_SYS_UP();
 
 	memset(wl->pmk_list, 0, sizeof(*wl->pmk_list));
-	err = wl_update_pmklist(dev, wl->pmk_list, err);
+	err = brcmf_update_pmklist(dev, wl->pmk_list, err);
 
 	WL_TRACE("Exit\n");
 	return err;
@@ -2266,31 +2266,31 @@ wl_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
 }
 
 static struct cfg80211_ops wl_cfg80211_ops = {
-	.change_virtual_intf = wl_cfg80211_change_iface,
-	.scan = wl_cfg80211_scan,
-	.set_wiphy_params = wl_cfg80211_set_wiphy_params,
-	.join_ibss = wl_cfg80211_join_ibss,
-	.leave_ibss = wl_cfg80211_leave_ibss,
-	.get_station = wl_cfg80211_get_station,
-	.set_tx_power = wl_cfg80211_set_tx_power,
-	.get_tx_power = wl_cfg80211_get_tx_power,
-	.add_key = wl_cfg80211_add_key,
-	.del_key = wl_cfg80211_del_key,
-	.get_key = wl_cfg80211_get_key,
-	.set_default_key = wl_cfg80211_config_default_key,
-	.set_default_mgmt_key = wl_cfg80211_config_default_mgmt_key,
-	.set_power_mgmt = wl_cfg80211_set_power_mgmt,
-	.set_bitrate_mask = wl_cfg80211_set_bitrate_mask,
-	.connect = wl_cfg80211_connect,
-	.disconnect = wl_cfg80211_disconnect,
-	.suspend = wl_cfg80211_suspend,
-	.resume = wl_cfg80211_resume,
-	.set_pmksa = wl_cfg80211_set_pmksa,
-	.del_pmksa = wl_cfg80211_del_pmksa,
-	.flush_pmksa = wl_cfg80211_flush_pmksa
+	.change_virtual_intf = brcmf_cfg80211_change_iface,
+	.scan = brcmf_cfg80211_scan,
+	.set_wiphy_params = brcmf_cfg80211_set_wiphy_params,
+	.join_ibss = brcmf_cfg80211_join_ibss,
+	.leave_ibss = brcmf_cfg80211_leave_ibss,
+	.get_station = brcmf_cfg80211_get_station,
+	.set_tx_power = brcmf_cfg80211_set_tx_power,
+	.get_tx_power = brcmf_cfg80211_get_tx_power,
+	.add_key = brcmf_cfg80211_add_key,
+	.del_key = brcmf_cfg80211_del_key,
+	.get_key = brcmf_cfg80211_get_key,
+	.set_default_key = brcmf_cfg80211_config_default_key,
+	.set_default_mgmt_key = brcmf_cfg80211_config_default_mgmt_key,
+	.set_power_mgmt = brcmf_cfg80211_set_power_mgmt,
+	.set_bitrate_mask = brcmf_cfg80211_set_bitrate_mask,
+	.connect = brcmf_cfg80211_connect,
+	.disconnect = brcmf_cfg80211_disconnect,
+	.suspend = brcmf_cfg80211_suspend,
+	.resume = brcmf_cfg80211_resume,
+	.set_pmksa = brcmf_cfg80211_set_pmksa,
+	.del_pmksa = brcmf_cfg80211_del_pmksa,
+	.flush_pmksa = brcmf_cfg80211_flush_pmksa
 };
 
-static s32 wl_mode_to_nl80211_iftype(s32 mode)
+static s32 brcmf_mode_to_nl80211_iftype(s32 mode)
 {
 	s32 err = 0;
 
@@ -2306,7 +2306,7 @@ static s32 wl_mode_to_nl80211_iftype(s32 mode)
 	return err;
 }
 
-static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
+static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
 					  struct device *dev)
 {
 	struct wireless_dev *wdev;
@@ -2364,7 +2364,7 @@ wiphy_new_out:
 	return ERR_PTR(err);
 }
 
-static void wl_free_wdev(struct wl_priv *wl)
+static void brcmf_free_wdev(struct wl_priv *wl)
 {
 	struct wireless_dev *wdev = wl_to_wdev(wl);
 
@@ -2378,7 +2378,7 @@ static void wl_free_wdev(struct wl_priv *wl)
 	wl_to_wdev(wl) = NULL;
 }
 
-static s32 wl_inform_bss(struct wl_priv *wl)
+static s32 brcmf_inform_bss(struct wl_priv *wl)
 {
 	struct brcmf_scan_results *bss_list;
 	struct brcmf_bss_info *bi = NULL;	/* must be initialized */
@@ -2394,7 +2394,7 @@ static s32 wl_inform_bss(struct wl_priv *wl)
 	WL_SCAN("scanned AP count (%d)\n", bss_list->count);
 	bi = next_bss(bss_list, bi);
 	for_each_bss(bss_list, bi, i) {
-		err = wl_inform_single_bss(wl, bi);
+		err = brcmf_inform_single_bss(wl, bi);
 		if (unlikely(err))
 			break;
 	}
@@ -2402,7 +2402,7 @@ static s32 wl_inform_bss(struct wl_priv *wl)
 }
 
 
-static s32 wl_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi)
+static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi)
 {
 	struct wiphy *wiphy = wl_to_wiphy(wl);
 	struct ieee80211_channel *notify_channel;
@@ -2491,7 +2491,7 @@ wl_inform_ibss(struct wl_priv *wl, struct net_device *dev, const u8 *bssid)
 
 	*(u32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);
 
-	err = wl_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
+	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
 	if (unlikely(err)) {
 		WL_ERR("WLC_GET_BSS_INFO failed: %d\n", err);
 		goto CleanUp;
@@ -2536,7 +2536,7 @@ CleanUp:
 	return err;
 }
 
-static bool wl_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
 {
 	u32 event = be32_to_cpu(e->event_type);
 	u32 status = be32_to_cpu(e->status);
@@ -2550,7 +2550,7 @@ static bool wl_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
 	return false;
 }
 
-static bool wl_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
 {
 	u32 event = be32_to_cpu(e->event_type);
 	u16 flags = be16_to_cpu(e->flags);
@@ -2562,7 +2562,7 @@ static bool wl_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
 	return false;
 }
 
-static bool wl_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
 {
 	u32 event = be32_to_cpu(e->event_type);
 	u32 status = be32_to_cpu(e->status);
@@ -2583,51 +2583,51 @@ static bool wl_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
 }
 
 static s32
-wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
 			 const brcmf_event_msg_t *e, void *data)
 {
 	s32 err = 0;
 
-	if (wl_is_linkup(wl, e)) {
+	if (brcmf_is_linkup(wl, e)) {
 		WL_CONN("Linkup\n");
-		if (wl_is_ibssmode(wl)) {
-			wl_update_prof(wl, NULL, (void *)e->addr,
+		if (brcmf_is_ibssmode(wl)) {
+			brcmf_update_prof(wl, NULL, (void *)e->addr,
 				WL_PROF_BSSID);
 			wl_inform_ibss(wl, ndev, e->addr);
 			cfg80211_ibss_joined(ndev, e->addr, GFP_KERNEL);
 			clear_bit(WL_STATUS_CONNECTING, &wl->status);
 			set_bit(WL_STATUS_CONNECTED, &wl->status);
 		} else
-			wl_bss_connect_done(wl, ndev, e, data, true);
-	} else if (wl_is_linkdown(wl, e)) {
+			brcmf_bss_connect_done(wl, ndev, e, data, true);
+	} else if (brcmf_is_linkdown(wl, e)) {
 		WL_CONN("Linkdown\n");
-		if (wl_is_ibssmode(wl)) {
+		if (brcmf_is_ibssmode(wl)) {
 			clear_bit(WL_STATUS_CONNECTING, &wl->status);
 			if (test_and_clear_bit(WL_STATUS_CONNECTED,
 				&wl->status))
-				wl_link_down(wl);
+				brcmf_link_down(wl);
 		} else {
-			wl_bss_connect_done(wl, ndev, e, data, false);
+			brcmf_bss_connect_done(wl, ndev, e, data, false);
 			if (test_and_clear_bit(WL_STATUS_CONNECTED,
 				&wl->status)) {
 				cfg80211_disconnected(ndev, 0, NULL, 0,
 					GFP_KERNEL);
-				wl_link_down(wl);
+				brcmf_link_down(wl);
 			}
 		}
-		wl_init_prof(wl->profile);
-	} else if (wl_is_nonetwork(wl, e)) {
-		if (wl_is_ibssmode(wl))
+		brcmf_init_prof(wl->profile);
+	} else if (brcmf_is_nonetwork(wl, e)) {
+		if (brcmf_is_ibssmode(wl))
 			clear_bit(WL_STATUS_CONNECTING, &wl->status);
 		else
-			wl_bss_connect_done(wl, ndev, e, data, false);
+			brcmf_bss_connect_done(wl, ndev, e, data, false);
 	}
 
 	return err;
 }
 
 static s32
-wl_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
 			 const brcmf_event_msg_t *e, void *data)
 {
 	s32 err = 0;
@@ -2636,16 +2636,16 @@ wl_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
 
 	if (event == BRCMF_E_ROAM && status == BRCMF_E_STATUS_SUCCESS) {
 		if (test_bit(WL_STATUS_CONNECTED, &wl->status))
-			wl_bss_roaming_done(wl, ndev, e, data);
+			brcmf_bss_roaming_done(wl, ndev, e, data);
 		else
-			wl_bss_connect_done(wl, ndev, e, data, true);
+			brcmf_bss_connect_done(wl, ndev, e, data, true);
 	}
 
 	return err;
 }
 
 static __used s32
-wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
+brcmf_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
 {
 	struct wl_priv *wl = ndev_to_wl(dev);
 	u32 buflen;
@@ -2653,11 +2653,11 @@ wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
 	buflen = brcmu_mkiovar(name, buf, len, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
 	BUG_ON(!buflen);
 
-	return wl_dev_ioctl(dev, BRCMF_C_SET_VAR, wl->ioctl_buf, buflen);
+	return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, wl->ioctl_buf, buflen);
 }
 
 static s32
-wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
+brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
 		  s32 buf_len)
 {
 	struct wl_priv *wl = ndev_to_wl(dev);
@@ -2666,7 +2666,7 @@ wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
 
 	len = brcmu_mkiovar(name, NULL, 0, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
 	BUG_ON(!len);
-	err = wl_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)wl->ioctl_buf,
+	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)wl->ioctl_buf,
 			WL_IOCTL_LEN_MAX);
 	if (unlikely(err)) {
 		WL_ERR("error (%d)\n", err);
@@ -2677,7 +2677,7 @@ wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
 	return err;
 }
 
-static s32 wl_get_assoc_ies(struct wl_priv *wl)
+static s32 brcmf_get_assoc_ies(struct wl_priv *wl)
 {
 	struct net_device *ndev = wl_to_ndev(wl);
 	struct wl_assoc_ielen *assoc_info;
@@ -2686,9 +2686,9 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
 	u32 resp_len;
 	s32 err = 0;
 
-	wl_clear_assoc_ies(wl);
+	brcmf_clear_assoc_ies(wl);
 
-	err = wl_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf,
+	err = brcmf_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf,
 				WL_ASSOC_INFO_MAX);
 	if (unlikely(err)) {
 		WL_ERR("could not get assoc info (%d)\n", err);
@@ -2698,7 +2698,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
 	req_len = assoc_info->req_len;
 	resp_len = assoc_info->resp_len;
 	if (req_len) {
-		err = wl_dev_bufvar_get(ndev, "assoc_req_ies", wl->extra_buf,
+		err = brcmf_dev_bufvar_get(ndev, "assoc_req_ies", wl->extra_buf,
 					WL_ASSOC_INFO_MAX);
 		if (unlikely(err)) {
 			WL_ERR("could not get assoc req (%d)\n", err);
@@ -2712,7 +2712,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
 		conn_info->req_ie = NULL;
 	}
 	if (resp_len) {
-		err = wl_dev_bufvar_get(ndev, "assoc_resp_ies", wl->extra_buf,
+		err = brcmf_dev_bufvar_get(ndev, "assoc_resp_ies", wl->extra_buf,
 					WL_ASSOC_INFO_MAX);
 		if (unlikely(err)) {
 			WL_ERR("could not get assoc resp (%d)\n", err);
@@ -2731,7 +2731,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
 	return err;
 }
 
-static void wl_clear_assoc_ies(struct wl_priv *wl)
+static void brcmf_clear_assoc_ies(struct wl_priv *wl)
 {
 	struct wl_connect_info *conn_info = wl_to_conn(wl);
 
@@ -2744,7 +2744,7 @@ static void wl_clear_assoc_ies(struct wl_priv *wl)
 }
 
 
-static void wl_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
+static void brcmf_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
 	size_t *join_params_size)
 {
 	chanspec_t chanspec = 0;
@@ -2778,7 +2778,7 @@ static void wl_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
 	}
 }
 
-static s32 wl_update_bss_info(struct wl_priv *wl)
+static s32 brcmf_update_bss_info(struct wl_priv *wl)
 {
 	struct brcmf_bss_info *bi;
 	struct brcmf_ssid *ssid;
@@ -2790,13 +2790,13 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
 	s32 err = 0;
 
 	WL_TRACE("Enter\n");
-	if (wl_is_ibssmode(wl))
+	if (brcmf_is_ibssmode(wl))
 		return err;
 
-	ssid = (struct brcmf_ssid *)wl_read_prof(wl, WL_PROF_SSID);
+	ssid = (struct brcmf_ssid *)brcmf_read_prof(wl, WL_PROF_SSID);
 
 	*(u32 *)wl->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
-	err = wl_dev_ioctl(wl_to_ndev(wl), BRCMF_C_GET_BSS_INFO,
+	err = brcmf_dev_ioctl(wl_to_ndev(wl), BRCMF_C_GET_BSS_INFO,
 			wl->extra_buf, WL_EXTRA_BUF_MAX);
 	if (unlikely(err)) {
 		WL_ERR("Could not get bss info %d\n", err);
@@ -2804,7 +2804,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
 	}
 
 	bi = (struct brcmf_bss_info *)(wl->extra_buf + 4);
-	err = wl_inform_single_bss(wl, bi);
+	err = brcmf_inform_single_bss(wl, bi);
 	if (unlikely(err))
 		goto update_bss_info_out;
 
@@ -2822,7 +2822,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
 		* so we speficially query dtim information to dongle.
 		*/
 		u32 var;
-		err = wl_dev_intvar_get(wl_to_ndev(wl), "dtim_assoc", &var);
+		err = brcmf_dev_intvar_get(wl_to_ndev(wl), "dtim_assoc", &var);
 		if (unlikely(err)) {
 			WL_ERR("wl dtim_assoc failed (%d)\n", err);
 			goto update_bss_info_out;
@@ -2830,8 +2830,8 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
 		dtim_period = (u8)var;
 	}
 
-	wl_update_prof(wl, NULL, &beacon_interval, WL_PROF_BEACONINT);
-	wl_update_prof(wl, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
+	brcmf_update_prof(wl, NULL, &beacon_interval, WL_PROF_BEACONINT);
+	brcmf_update_prof(wl, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
 
 update_bss_info_out:
 	WL_TRACE("Exit");
@@ -2839,7 +2839,7 @@ update_bss_info_out:
 }
 
 static s32
-wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
 		    const brcmf_event_msg_t *e, void *data)
 {
 	struct wl_connect_info *conn_info = wl_to_conn(wl);
@@ -2847,12 +2847,12 @@ wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
 
 	WL_TRACE("Enter\n");
 
-	wl_get_assoc_ies(wl);
-	wl_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
-	wl_update_bss_info(wl);
+	brcmf_get_assoc_ies(wl);
+	brcmf_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
+	brcmf_update_bss_info(wl);
 
 	cfg80211_roamed(ndev, NULL,
-			(u8 *)wl_read_prof(wl, WL_PROF_BSSID),
+			(u8 *)brcmf_read_prof(wl, WL_PROF_BSSID),
 			conn_info->req_ie, conn_info->req_ie_len,
 			conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
 	WL_CONN("Report roaming result\n");
@@ -2863,7 +2863,7 @@ wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
 }
 
 static s32
-wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
+brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
 		    const brcmf_event_msg_t *e, void *data, bool completed)
 {
 	struct wl_connect_info *conn_info = wl_to_conn(wl);
@@ -2873,12 +2873,12 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
 
 	if (test_and_clear_bit(WL_STATUS_CONNECTING, &wl->status)) {
 		if (completed) {
-			wl_get_assoc_ies(wl);
-			wl_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
-			wl_update_bss_info(wl);
+			brcmf_get_assoc_ies(wl);
+			brcmf_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
+			brcmf_update_bss_info(wl);
 		}
 		cfg80211_connect_result(ndev,
-					(u8 *)wl_read_prof(wl, WL_PROF_BSSID),
+					(u8 *)brcmf_read_prof(wl, WL_PROF_BSSID),
 					conn_info->req_ie,
 					conn_info->req_ie_len,
 					conn_info->resp_ie,
@@ -2895,7 +2895,7 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
 }
 
 static s32
-wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
 		     const brcmf_event_msg_t *e, void *data)
 {
 	u16 flags = be16_to_cpu(e->flags);
@@ -2915,7 +2915,7 @@ wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
 }
 
 static s32
-wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 		      const brcmf_event_msg_t *e, void *data)
 {
 	struct brcmf_channel_info channel_inform;
@@ -2928,7 +2928,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 
 	if (wl->iscan_on && wl->iscan_kickstart) {
 		WL_TRACE("Exit\n");
-		return wl_wakeup_iscan(wl_to_iscan(wl));
+		return brcmf_wakeup_iscan(wl_to_iscan(wl));
 	}
 
 	if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) {
@@ -2938,7 +2938,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 		goto scan_done_out;
 	}
 
-	err = wl_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_inform,
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_inform,
 			sizeof(channel_inform));
 	if (unlikely(err)) {
 		WL_ERR("scan busy (%d)\n", err);
@@ -2956,7 +2956,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 	memset(bss_list, 0, len);
 	bss_list->buflen = cpu_to_le32(len);
 
-	err = wl_dev_ioctl(ndev, BRCMF_C_SCAN_RESULTS, bss_list, len);
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN_RESULTS, bss_list, len);
 	if (unlikely(err)) {
 		WL_ERR("%s Scan_results error (%d)\n", ndev->name, err);
 		err = -EINVAL;
@@ -2967,7 +2967,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 	bss_list->version = le32_to_cpu(bss_list->version);
 	bss_list->count = le32_to_cpu(bss_list->count);
 
-	err = wl_inform_bss(wl);
+	err = brcmf_inform_bss(wl);
 	if (err) {
 		scan_abort = true;
 		goto scan_done_out;
@@ -2977,7 +2977,7 @@ scan_done_out:
 	if (wl->scan_request) {
 		WL_SCAN("calling cfg80211_scan_done\n");
 		cfg80211_scan_done(wl->scan_request, scan_abort);
-		wl_set_mpc(ndev, 1);
+		brcmf_set_mpc(ndev, 1);
 		wl->scan_request = NULL;
 	}
 
@@ -2986,7 +2986,7 @@ scan_done_out:
 	return err;
 }
 
-static void wl_init_conf(struct wl_conf *conf)
+static void brcmf_init_conf(struct wl_conf *conf)
 {
 	conf->mode = (u32)-1;
 	conf->frag_threshold = (u32)-1;
@@ -2996,22 +2996,22 @@ static void wl_init_conf(struct wl_conf *conf)
 	conf->tx_power = -1;
 }
 
-static void wl_init_prof(struct wl_profile *prof)
+static void brcmf_init_prof(struct wl_profile *prof)
 {
 	memset(prof, 0, sizeof(*prof));
 }
 
-static void wl_init_eloop_handler(struct wl_event_loop *el)
+static void brcmf_init_eloop_handler(struct wl_event_loop *el)
 {
 	memset(el, 0, sizeof(*el));
-	el->handler[BRCMF_E_SCAN_COMPLETE] = wl_notify_scan_status;
-	el->handler[BRCMF_E_LINK] = wl_notify_connect_status;
-	el->handler[BRCMF_E_ROAM] = wl_notify_roaming_status;
-	el->handler[BRCMF_E_MIC_ERROR] = wl_notify_mic_status;
-	el->handler[BRCMF_E_SET_SSID] = wl_notify_connect_status;
+	el->handler[BRCMF_E_SCAN_COMPLETE] = brcmf_notify_scan_status;
+	el->handler[BRCMF_E_LINK] = brcmf_notify_connect_status;
+	el->handler[BRCMF_E_ROAM] = brcmf_notify_roaming_status;
+	el->handler[BRCMF_E_MIC_ERROR] = brcmf_notify_mic_status;
+	el->handler[BRCMF_E_SET_SSID] = brcmf_notify_connect_status;
 }
 
-static s32 wl_init_priv_mem(struct wl_priv *wl)
+static s32 brcmf_init_priv_mem(struct wl_priv *wl)
 {
 	wl->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
 	if (unlikely(!wl->scan_results)) {
@@ -3062,12 +3062,12 @@ static s32 wl_init_priv_mem(struct wl_priv *wl)
 	return 0;
 
 init_priv_mem_out:
-	wl_deinit_priv_mem(wl);
+	brcmf_deinit_priv_mem(wl);
 
 	return -ENOMEM;
 }
 
-static void wl_deinit_priv_mem(struct wl_priv *wl)
+static void brcmf_deinit_priv_mem(struct wl_priv *wl)
 {
 	kfree(wl->scan_results);
 	wl->scan_results = NULL;
@@ -3089,10 +3089,10 @@ static void wl_deinit_priv_mem(struct wl_priv *wl)
 	wl->pmk_list = NULL;
 }
 
-static s32 wl_create_event_handler(struct wl_priv *wl)
+static s32 brcmf_create_event_handler(struct wl_priv *wl)
 {
 	sema_init(&wl->event_sync, 0);
-	wl->event_tsk = kthread_run(wl_event_handler, wl, "wl_event_handler");
+	wl->event_tsk = kthread_run(brcmf_event_handler, wl, "wl_event_handler");
 	if (IS_ERR(wl->event_tsk)) {
 		wl->event_tsk = NULL;
 		WL_ERR("failed to create event thread\n");
@@ -3101,7 +3101,7 @@ static s32 wl_create_event_handler(struct wl_priv *wl)
 	return 0;
 }
 
-static void wl_destroy_event_handler(struct wl_priv *wl)
+static void brcmf_destroy_event_handler(struct wl_priv *wl)
 {
 	if (wl->event_tsk) {
 		send_sig(SIGTERM, wl->event_tsk, 1);
@@ -3110,7 +3110,7 @@ static void wl_destroy_event_handler(struct wl_priv *wl)
 	}
 }
 
-static void wl_term_iscan(struct wl_priv *wl)
+static void brcmf_term_iscan(struct wl_priv *wl)
 {
 	struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
 
@@ -3122,7 +3122,7 @@ static void wl_term_iscan(struct wl_priv *wl)
 	}
 }
 
-static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
+static void brcmf_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
 {
 	struct wl_priv *wl = iscan_to_wl(iscan);
 	struct net_device *ndev = wl_to_ndev(wl);
@@ -3135,13 +3135,13 @@ static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
 		WL_SCAN("ISCAN Completed scan: %s\n",
 				aborted ? "Aborted" : "Done");
 		cfg80211_scan_done(wl->scan_request, aborted);
-		wl_set_mpc(ndev, 1);
+		brcmf_set_mpc(ndev, 1);
 		wl->scan_request = NULL;
 	}
 	wl->iscan_kickstart = false;
 }
 
-static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan)
+static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan)
 {
 	if (likely(iscan->state != WL_ISCAN_STATE_IDLE)) {
 		WL_SCAN("wake up iscan\n");
@@ -3153,7 +3153,7 @@ static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan)
 }
 
 static s32
-wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
+brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
 		     struct brcmf_scan_results **bss_list)
 {
 	struct brcmf_iscan_results list;
@@ -3170,7 +3170,7 @@ wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
 
 	memset(&list, 0, sizeof(list));
 	list.results.buflen = cpu_to_le32(WL_ISCAN_BUF_MAX);
-	err = wl_dev_iovar_getbuf(iscan->dev, "iscanresults", &list,
+	err = brcmf_dev_iovar_getbuf(iscan->dev, "iscanresults", &list,
 				BRCMF_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf,
 				WL_ISCAN_BUF_MAX);
 	if (unlikely(err)) {
@@ -3188,21 +3188,21 @@ wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
 	return err;
 }
 
-static s32 wl_iscan_done(struct wl_priv *wl)
+static s32 brcmf_iscan_done(struct wl_priv *wl)
 {
 	struct wl_iscan_ctrl *iscan = wl->iscan;
 	s32 err = 0;
 
 	iscan->state = WL_ISCAN_STATE_IDLE;
 	rtnl_lock();
-	wl_inform_bss(wl);
-	wl_notify_iscan_complete(iscan, false);
+	brcmf_inform_bss(wl);
+	brcmf_notify_iscan_complete(iscan, false);
 	rtnl_unlock();
 
 	return err;
 }
 
-static s32 wl_iscan_pending(struct wl_priv *wl)
+static s32 brcmf_iscan_pending(struct wl_priv *wl)
 {
 	struct wl_iscan_ctrl *iscan = wl->iscan;
 	s32 err = 0;
@@ -3214,14 +3214,14 @@ static s32 wl_iscan_pending(struct wl_priv *wl)
 	return err;
 }
 
-static s32 wl_iscan_inprogress(struct wl_priv *wl)
+static s32 brcmf_iscan_inprogress(struct wl_priv *wl)
 {
 	struct wl_iscan_ctrl *iscan = wl->iscan;
 	s32 err = 0;
 
 	rtnl_lock();
-	wl_inform_bss(wl);
-	wl_run_iscan(iscan, NULL, BRCMF_SCAN_ACTION_CONTINUE);
+	brcmf_inform_bss(wl);
+	brcmf_run_iscan(iscan, NULL, BRCMF_SCAN_ACTION_CONTINUE);
 	rtnl_unlock();
 	/* Reschedule the timer */
 	mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
@@ -3230,20 +3230,20 @@ static s32 wl_iscan_inprogress(struct wl_priv *wl)
 	return err;
 }
 
-static s32 wl_iscan_aborted(struct wl_priv *wl)
+static s32 brcmf_iscan_aborted(struct wl_priv *wl)
 {
 	struct wl_iscan_ctrl *iscan = wl->iscan;
 	s32 err = 0;
 
 	iscan->state = WL_ISCAN_STATE_IDLE;
 	rtnl_lock();
-	wl_notify_iscan_complete(iscan, true);
+	brcmf_notify_iscan_complete(iscan, true);
 	rtnl_unlock();
 
 	return err;
 }
 
-static s32 wl_iscan_thread(void *data)
+static s32 brcmf_iscan_thread(void *data)
 {
 	struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
 	struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
@@ -3263,7 +3263,7 @@ static s32 wl_iscan_thread(void *data)
 			iscan->timer_on = 0;
 		}
 		rtnl_lock();
-		err = wl_get_iscan_results(iscan, &status, &wl->bss_list);
+		err = brcmf_get_iscan_results(iscan, &status, &wl->bss_list);
 		if (unlikely(err)) {
 			status = BRCMF_SCAN_RESULTS_ABORTED;
 			WL_ERR("Abort iscan\n");
@@ -3280,18 +3280,18 @@ static s32 wl_iscan_thread(void *data)
 	return 0;
 }
 
-static void wl_iscan_timer(unsigned long data)
+static void brcmf_iscan_timer(unsigned long data)
 {
 	struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
 
 	if (iscan) {
 		iscan->timer_on = 0;
 		WL_SCAN("timer expired\n");
-		wl_wakeup_iscan(iscan);
+		brcmf_wakeup_iscan(iscan);
 	}
 }
 
-static s32 wl_invoke_iscan(struct wl_priv *wl)
+static s32 brcmf_invoke_iscan(struct wl_priv *wl)
 {
 	struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
 	int err = 0;
@@ -3299,7 +3299,7 @@ static s32 wl_invoke_iscan(struct wl_priv *wl)
 	if (wl->iscan_on && !iscan->tsk) {
 		iscan->state = WL_ISCAN_STATE_IDLE;
 		sema_init(&iscan->sync, 0);
-		iscan->tsk = kthread_run(wl_iscan_thread, iscan, "wl_iscan");
+		iscan->tsk = kthread_run(brcmf_iscan_thread, iscan, "wl_iscan");
 		if (IS_ERR(iscan->tsk)) {
 			WL_ERR("Could not create iscan thread\n");
 			iscan->tsk = NULL;
@@ -3310,17 +3310,17 @@ static s32 wl_invoke_iscan(struct wl_priv *wl)
 	return err;
 }
 
-static void wl_init_iscan_eloop(struct wl_iscan_eloop *el)
+static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el)
 {
 	memset(el, 0, sizeof(*el));
-	el->handler[BRCMF_SCAN_RESULTS_SUCCESS] = wl_iscan_done;
-	el->handler[BRCMF_SCAN_RESULTS_PARTIAL] = wl_iscan_inprogress;
-	el->handler[BRCMF_SCAN_RESULTS_PENDING] = wl_iscan_pending;
-	el->handler[BRCMF_SCAN_RESULTS_ABORTED] = wl_iscan_aborted;
-	el->handler[BRCMF_SCAN_RESULTS_NO_MEM] = wl_iscan_aborted;
+	el->handler[BRCMF_SCAN_RESULTS_SUCCESS] = brcmf_iscan_done;
+	el->handler[BRCMF_SCAN_RESULTS_PARTIAL] = brcmf_iscan_inprogress;
+	el->handler[BRCMF_SCAN_RESULTS_PENDING] = brcmf_iscan_pending;
+	el->handler[BRCMF_SCAN_RESULTS_ABORTED] = brcmf_iscan_aborted;
+	el->handler[BRCMF_SCAN_RESULTS_NO_MEM] = brcmf_iscan_aborted;
 }
 
-static s32 wl_init_iscan(struct wl_priv *wl)
+static s32 brcmf_init_iscan(struct wl_priv *wl)
 {
 	struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
 	int err = 0;
@@ -3328,13 +3328,13 @@ static s32 wl_init_iscan(struct wl_priv *wl)
 	if (wl->iscan_on) {
 		iscan->dev = wl_to_ndev(wl);
 		iscan->state = WL_ISCAN_STATE_IDLE;
-		wl_init_iscan_eloop(&iscan->el);
+		brcmf_init_iscan_eloop(&iscan->el);
 		iscan->timer_ms = WL_ISCAN_TIMER_INTERVAL_MS;
 		init_timer(&iscan->timer);
 		iscan->timer.data = (unsigned long) iscan;
-		iscan->timer.function = wl_iscan_timer;
+		iscan->timer.function = brcmf_iscan_timer;
 		sema_init(&iscan->sync, 0);
-		iscan->tsk = kthread_run(wl_iscan_thread, iscan, "wl_iscan");
+		iscan->tsk = kthread_run(brcmf_iscan_thread, iscan, "wl_iscan");
 		if (IS_ERR(iscan->tsk)) {
 			WL_ERR("Could not create iscan thread\n");
 			iscan->tsk = NULL;
@@ -3362,32 +3362,32 @@ static s32 wl_init_priv(struct wl_priv *wl)
 	wl->active_scan = true;	/* we do active scan for
 				 specific scan per default */
 	wl->dongle_up = false;	/* dongle is not up yet */
-	wl_init_eq(wl);
-	err = wl_init_priv_mem(wl);
+	brcmf_init_eq(wl);
+	err = brcmf_init_priv_mem(wl);
 	if (unlikely(err))
 		return err;
-	if (unlikely(wl_create_event_handler(wl)))
+	if (unlikely(brcmf_create_event_handler(wl)))
 		return -ENOMEM;
-	wl_init_eloop_handler(&wl->el);
+	brcmf_init_eloop_handler(&wl->el);
 	mutex_init(&wl->usr_sync);
-	err = wl_init_iscan(wl);
+	err = brcmf_init_iscan(wl);
 	if (unlikely(err))
 		return err;
-	wl_init_conf(wl->conf);
-	wl_init_prof(wl->profile);
-	wl_link_down(wl);
+	brcmf_init_conf(wl->conf);
+	brcmf_init_prof(wl->profile);
+	brcmf_link_down(wl);
 
 	return err;
 }
 
 static void wl_deinit_priv(struct wl_priv *wl)
 {
-	wl_destroy_event_handler(wl);
+	brcmf_destroy_event_handler(wl);
 	wl->dongle_up = false;	/* dongle down */
-	wl_flush_eq(wl);
-	wl_link_down(wl);
-	wl_term_iscan(wl);
-	wl_deinit_priv_mem(wl);
+	brcmf_flush_eq(wl);
+	brcmf_link_down(wl);
+	brcmf_term_iscan(wl);
+	brcmf_deinit_priv_mem(wl);
 }
 
 s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
@@ -3407,11 +3407,11 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
 		return -ENOMEM;
 	}
 	WL_INFO("func %p\n", wl_cfg80211_get_sdio_func());
-	wdev = wl_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev);
+	wdev = brcmf_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev);
 	if (IS_ERR(wdev))
 		return -ENOMEM;
 
-	wdev->iftype = wl_mode_to_nl80211_iftype(WL_MODE_BSS);
+	wdev->iftype = brcmf_mode_to_nl80211_iftype(WL_MODE_BSS);
 	wl = wdev_to_wl(wdev);
 	wl->wdev = wdev;
 	wl->pub = data;
@@ -3425,12 +3425,12 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
 		WL_ERR("Failed to init iwm_priv (%d)\n", err);
 		goto cfg80211_attach_out;
 	}
-	wl_set_drvdata(wl_cfg80211_dev, ci);
+	brcmf_set_drvdata(wl_cfg80211_dev, ci);
 
 	return err;
 
 cfg80211_attach_out:
-	wl_free_wdev(wl);
+	brcmf_free_wdev(wl);
 	return err;
 }
 
@@ -3441,19 +3441,19 @@ void wl_cfg80211_detach(void)
 	wl = WL_PRIV_GET();
 
 	wl_deinit_priv(wl);
-	wl_free_wdev(wl);
-	wl_set_drvdata(wl_cfg80211_dev, NULL);
+	brcmf_free_wdev(wl);
+	brcmf_set_drvdata(wl_cfg80211_dev, NULL);
 	kfree(wl_cfg80211_dev);
 	wl_cfg80211_dev = NULL;
-	wl_clear_sdio_func();
+	brcmf_clear_sdio_func();
 }
 
-static void wl_wakeup_event(struct wl_priv *wl)
+static void brcmf_wakeup_event(struct wl_priv *wl)
 {
 	up(&wl->event_sync);
 }
 
-static s32 wl_event_handler(void *data)
+static s32 brcmf_event_handler(void *data)
 {
 	struct wl_priv *wl = (struct wl_priv *)data;
 	struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
@@ -3464,7 +3464,7 @@ static s32 wl_event_handler(void *data)
 	while (likely(!down_interruptible(&wl->event_sync))) {
 		if (kthread_should_stop())
 			break;
-		e = wl_deq_event(wl);
+		e = brcmf_deq_event(wl);
 		if (unlikely(!e)) {
 			WL_ERR("event queue empty...\n");
 			BUG();
@@ -3476,7 +3476,7 @@ static s32 wl_event_handler(void *data)
 		} else {
 			WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
 		}
-		wl_put_event(e);
+		brcmf_put_event(e);
 	}
 	WL_INFO("was terminated\n");
 	return 0;
@@ -3489,43 +3489,43 @@ wl_cfg80211_event(struct net_device *ndev,
 	u32 event_type = be32_to_cpu(e->event_type);
 	struct wl_priv *wl = ndev_to_wl(ndev);
 
-	if (likely(!wl_enq_event(wl, event_type, e, data)))
-		wl_wakeup_event(wl);
+	if (likely(!brcmf_enq_event(wl, event_type, e, data)))
+		brcmf_wakeup_event(wl);
 }
 
-static void wl_init_eq(struct wl_priv *wl)
+static void brcmf_init_eq(struct wl_priv *wl)
 {
-	wl_init_eq_lock(wl);
+	brcmf_init_eq_lock(wl);
 	INIT_LIST_HEAD(&wl->eq_list);
 }
 
-static void wl_flush_eq(struct wl_priv *wl)
+static void brcmf_flush_eq(struct wl_priv *wl)
 {
 	struct wl_event_q *e;
 
-	wl_lock_eq(wl);
+	brcmf_lock_eq(wl);
 	while (!list_empty(&wl->eq_list)) {
 		e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
 		list_del(&e->eq_list);
 		kfree(e);
 	}
-	wl_unlock_eq(wl);
+	brcmf_unlock_eq(wl);
 }
 
 /*
 * retrieve first queued event from head
 */
 
-static struct wl_event_q *wl_deq_event(struct wl_priv *wl)
+static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl)
 {
 	struct wl_event_q *e = NULL;
 
-	wl_lock_eq(wl);
+	brcmf_lock_eq(wl);
 	if (likely(!list_empty(&wl->eq_list))) {
 		e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
 		list_del(&e->eq_list);
 	}
-	wl_unlock_eq(wl);
+	brcmf_unlock_eq(wl);
 
 	return e;
 }
@@ -3535,7 +3535,7 @@ static struct wl_event_q *wl_deq_event(struct wl_priv *wl)
 */
 
 static s32
-wl_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
+brcmf_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
 	     void *data)
 {
 	struct wl_event_q *e;
@@ -3551,14 +3551,14 @@ wl_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
 	memcpy(&e->emsg, msg, sizeof(brcmf_event_msg_t));
 	if (data) {
 	}
-	wl_lock_eq(wl);
+	brcmf_lock_eq(wl);
 	list_add_tail(&e->eq_list, &wl->eq_list);
-	wl_unlock_eq(wl);
+	brcmf_unlock_eq(wl);
 
 	return err;
 }
 
-static void wl_put_event(struct wl_event_q *e)
+static void brcmf_put_event(struct wl_event_q *e)
 {
 	kfree(e);
 }
@@ -3568,7 +3568,7 @@ void wl_cfg80211_sdio_func(void *func)
 	cfg80211_sdio_func = (struct sdio_func *)func;
 }
 
-static void wl_clear_sdio_func(void)
+static void brcmf_clear_sdio_func(void)
 {
 	cfg80211_sdio_func = NULL;
 }
@@ -3578,7 +3578,7 @@ struct sdio_func *wl_cfg80211_get_sdio_func(void)
 	return cfg80211_sdio_func;
 }
 
-static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
+static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype)
 {
 	s32 infra = 0;
 	s32 err = 0;
@@ -3602,7 +3602,7 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
 		return err;
 	}
 	infra = cpu_to_le32(infra);
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_INFRA error (%d)\n", err);
 		return err;
@@ -3611,7 +3611,7 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
 	return 0;
 }
 
-static s32 wl_dongle_eventmsg(struct net_device *ndev)
+static s32 brcmf_dongle_eventmsg(struct net_device *ndev)
 {
 	/* Room for "event_msgs" + '\0' + bitvec */
 	s8 iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
@@ -3623,7 +3623,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
 	/* Setup event_msgs */
 	brcmu_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, iovbuf,
 		    sizeof(iovbuf));
-	err = wl_dev_ioctl(ndev, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
 	if (unlikely(err)) {
 		WL_ERR("Get event_msgs error (%d)\n", err);
 		goto dongle_eventmsg_out;
@@ -3652,7 +3652,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
 
 	brcmu_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, iovbuf,
 		    sizeof(iovbuf));
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
 	if (unlikely(err)) {
 		WL_ERR("Set event_msgs error (%d)\n", err);
 		goto dongle_eventmsg_out;
@@ -3664,7 +3664,7 @@ dongle_eventmsg_out:
 }
 
 static s32
-wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
+brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
 {
 	s8 iovbuf[32];
 	s32 roamtrigger[2];
@@ -3678,7 +3678,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
 	if (roamvar) {
 		brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout,
 			sizeof(bcn_timeout), iovbuf, sizeof(iovbuf));
-		err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR,
+		err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR,
 				   iovbuf, sizeof(iovbuf));
 		if (unlikely(err)) {
 			WL_ERR("bcn_timeout error (%d)\n", err);
@@ -3693,7 +3693,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
 	WL_INFO("Internal Roaming = %s\n", roamvar ? "Off" : "On");
 	brcmu_mkiovar("roam_off", (char *)&roamvar,
 				sizeof(roamvar), iovbuf, sizeof(iovbuf));
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
 	if (unlikely(err)) {
 		WL_ERR("roam_off error (%d)\n", err);
 		goto dongle_rom_out;
@@ -3701,7 +3701,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
 
 	roamtrigger[0] = WL_ROAM_TRIGGER_LEVEL;
 	roamtrigger[1] = WLC_BAND_ALL;
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_ROAM_TRIGGER,
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_ROAM_TRIGGER,
 			(void *)roamtrigger, sizeof(roamtrigger));
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_ROAM_TRIGGER error (%d)\n", err);
@@ -3710,7 +3710,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
 
 	roam_delta[0] = WL_ROAM_DELTA;
 	roam_delta[1] = WLC_BAND_ALL;
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_ROAM_DELTA,
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_ROAM_DELTA,
 				(void *)roam_delta, sizeof(roam_delta));
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_ROAM_DELTA error (%d)\n", err);
@@ -3722,12 +3722,12 @@ dongle_rom_out:
 }
 
 static s32
-wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
+brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
 		s32 scan_unassoc_time, s32 scan_passive_time)
 {
 	s32 err = 0;
 
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_CHANNEL_TIME,
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_SCAN_CHANNEL_TIME,
 			   &scan_assoc_time, sizeof(scan_assoc_time));
 	if (err) {
 		if (err == -EOPNOTSUPP)
@@ -3736,7 +3736,7 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
 			WL_ERR("Scan assoc time error (%d)\n", err);
 		goto dongle_scantime_out;
 	}
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_UNASSOC_TIME,
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_SCAN_UNASSOC_TIME,
 			   &scan_unassoc_time, sizeof(scan_unassoc_time));
 	if (err) {
 		if (err == -EOPNOTSUPP)
@@ -3746,7 +3746,7 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
 		goto dongle_scantime_out;
 	}
 
-	err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_PASSIVE_TIME,
+	err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_SCAN_PASSIVE_TIME,
 			   &scan_passive_time, sizeof(scan_passive_time));
 	if (err) {
 		if (err == -EOPNOTSUPP)
@@ -3760,7 +3760,7 @@ dongle_scantime_out:
 	return err;
 }
 
-s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
+s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock)
 {
 	struct net_device *ndev;
 	struct wireless_dev *wdev;
@@ -3774,19 +3774,19 @@ s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
 	if (need_lock)
 		rtnl_lock();
 
-	wl_dongle_scantime(ndev, WL_SCAN_CHANNEL_TIME,
+	brcmf_dongle_scantime(ndev, WL_SCAN_CHANNEL_TIME,
 			WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME);
 
-	err = wl_dongle_eventmsg(ndev);
+	err = brcmf_dongle_eventmsg(ndev);
 	if (unlikely(err))
 		goto default_conf_out;
-	err = wl_dongle_roam(ndev, (wl->roam_on ? 0 : 1), WL_BEACON_TIMEOUT);
+	err = brcmf_dongle_roam(ndev, (wl->roam_on ? 0 : 1), WL_BEACON_TIMEOUT);
 	if (unlikely(err))
 		goto default_conf_out;
-	err = wl_dongle_mode(ndev, wdev->iftype);
+	err = brcmf_dongle_mode(ndev, wdev->iftype);
 	if (unlikely(err && err != -EINPROGRESS))
 		goto default_conf_out;
-	err = wl_dongle_probecap(wl);
+	err = brcmf_dongle_probecap(wl);
 	if (unlikely(err))
 		goto default_conf_out;
 
@@ -3809,7 +3809,7 @@ static s32 wl_update_wiphybands(struct wl_priv *wl)
 	s8 phy;
 	s32 err = 0;
 
-	err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list,
+	err = brcmf_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list,
 			sizeof(phy_list));
 	if (unlikely(err)) {
 		WL_ERR("error (%d)\n", err);
@@ -3826,24 +3826,24 @@ static s32 wl_update_wiphybands(struct wl_priv *wl)
 	return err;
 }
 
-static s32 __wl_cfg80211_up(struct wl_priv *wl)
+static s32 __brcmf_cfg80211_up(struct wl_priv *wl)
 {
 	s32 err = 0;
 
 	set_bit(WL_STATUS_READY, &wl->status);
 
-	wl_debugfs_add_netdev_params(wl);
+	brcmf_debugfs_add_netdev_params(wl);
 
-	err = wl_config_dongle(wl, false);
+	err = brcmf_config_dongle(wl, false);
 	if (unlikely(err))
 		return err;
 
-	wl_invoke_iscan(wl);
+	brcmf_invoke_iscan(wl);
 
 	return err;
 }
 
-static s32 __wl_cfg80211_down(struct wl_priv *wl)
+static s32 __brcmf_cfg80211_down(struct wl_priv *wl)
 {
 	/*
 	 * While going down, if associated with AP disassociate
@@ -3853,19 +3853,19 @@ static s32 __wl_cfg80211_down(struct wl_priv *wl)
 	     test_bit(WL_STATUS_CONNECTING, &wl->status)) &&
 	     test_bit(WL_STATUS_READY, &wl->status)) {
 		WL_INFO("Disassociating from AP");
-		wl_link_down(wl);
+		brcmf_link_down(wl);
 
 		/* Make sure WPA_Supplicant receives all the event
 		   generated due to DISASSOC call to the fw to keep
 		   the state fw and WPA_Supplicant state consistent
 		 */
 		rtnl_unlock();
-		wl_delay(500);
+		brcmf_delay(500);
 		rtnl_lock();
 	}
 
 	set_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
-	wl_term_iscan(wl);
+	brcmf_term_iscan(wl);
 	if (wl->scan_request) {
 		cfg80211_scan_done(wl->scan_request, true);
 		/* May need to perform this to cover rmmod */
@@ -3876,7 +3876,7 @@ static s32 __wl_cfg80211_down(struct wl_priv *wl)
 	clear_bit(WL_STATUS_SCANNING, &wl->status);
 	clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
 
-	wl_debugfs_remove_netdev(wl);
+	brcmf_debugfs_remove_netdev(wl);
 
 	return 0;
 }
@@ -3888,7 +3888,7 @@ s32 wl_cfg80211_up(void)
 
 	wl = WL_PRIV_GET();
 	mutex_lock(&wl->usr_sync);
-	err = __wl_cfg80211_up(wl);
+	err = __brcmf_cfg80211_up(wl);
 	mutex_unlock(&wl->usr_sync);
 
 	return err;
@@ -3901,18 +3901,18 @@ s32 wl_cfg80211_down(void)
 
 	wl = WL_PRIV_GET();
 	mutex_lock(&wl->usr_sync);
-	err = __wl_cfg80211_down(wl);
+	err = __brcmf_cfg80211_down(wl);
 	mutex_unlock(&wl->usr_sync);
 
 	return err;
 }
 
-static s32 wl_dongle_probecap(struct wl_priv *wl)
+static s32 brcmf_dongle_probecap(struct wl_priv *wl)
 {
 	return wl_update_wiphybands(wl);
 }
 
-static void *wl_read_prof(struct wl_priv *wl, s32 item)
+static void *brcmf_read_prof(struct wl_priv *wl, s32 item)
 {
 	switch (item) {
 	case WL_PROF_SEC:
@@ -3927,7 +3927,7 @@ static void *wl_read_prof(struct wl_priv *wl, s32 item)
 }
 
 static s32
-wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
+brcmf_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
 	       s32 item)
 {
 	s32 err = 0;
@@ -3965,12 +3965,12 @@ wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
 	return err;
 }
 
-static bool wl_is_ibssmode(struct wl_priv *wl)
+static bool brcmf_is_ibssmode(struct wl_priv *wl)
 {
 	return wl->conf->mode == WL_MODE_IBSS;
 }
 
-static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
+static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
 {
 	struct wl_ie *ie = wl_to_ie(wl);
 	s32 err = 0;
@@ -3987,7 +3987,7 @@ static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
 	return err;
 }
 
-static void wl_link_down(struct wl_priv *wl)
+static void brcmf_link_down(struct wl_priv *wl)
 {
 	struct net_device *dev = NULL;
 	s32 err = 0;
@@ -3997,7 +3997,7 @@ static void wl_link_down(struct wl_priv *wl)
 	if (wl->link_up) {
 		dev = wl_to_ndev(wl);
 		WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
-		err = wl_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
+		err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
 		if (unlikely(err))
 			WL_ERR("WLC_DISASSOC failed (%d)\n", err);
 		wl->link_up = false;
@@ -4005,22 +4005,22 @@ static void wl_link_down(struct wl_priv *wl)
 	WL_TRACE("Exit\n");
 }
 
-static void wl_lock_eq(struct wl_priv *wl)
+static void brcmf_lock_eq(struct wl_priv *wl)
 {
 	spin_lock_irq(&wl->eq_lock);
 }
 
-static void wl_unlock_eq(struct wl_priv *wl)
+static void brcmf_unlock_eq(struct wl_priv *wl)
 {
 	spin_unlock_irq(&wl->eq_lock);
 }
 
-static void wl_init_eq_lock(struct wl_priv *wl)
+static void brcmf_init_eq_lock(struct wl_priv *wl)
 {
 	spin_lock_init(&wl->eq_lock);
 }
 
-static void wl_delay(u32 ms)
+static void brcmf_delay(u32 ms)
 {
 	if (ms < 1000 / HZ) {
 		cond_resched();
@@ -4030,12 +4030,12 @@ static void wl_delay(u32 ms)
 	}
 }
 
-static void wl_set_drvdata(struct wl_dev *dev, void *data)
+static void brcmf_set_drvdata(struct wl_dev *dev, void *data)
 {
 	dev->driver_data = data;
 }
 
-static void *wl_get_drvdata(struct wl_dev *dev)
+static void *brcmf_get_drvdata(struct wl_dev *dev)
 {
 	void *data = NULL;
 
@@ -4044,13 +4044,13 @@ static void *wl_get_drvdata(struct wl_dev *dev)
 	return data;
 }
 
-static void wl_set_mpc(struct net_device *ndev, int mpc)
+static void brcmf_set_mpc(struct net_device *ndev, int mpc)
 {
 	s32 err = 0;
 	struct wl_priv *wl = ndev_to_wl(ndev);
 
 	if (test_bit(WL_STATUS_READY, &wl->status)) {
-		err = wl_dev_intvar_set(ndev, "mpc", mpc);
+		err = brcmf_dev_intvar_set(ndev, "mpc", mpc);
 		if (unlikely(err)) {
 			WL_ERR("fail to set mpc\n");
 			return;
@@ -4059,7 +4059,7 @@ static void wl_set_mpc(struct net_device *ndev, int mpc)
 	}
 }
 
-static int wl_debugfs_add_netdev_params(struct wl_priv *wl)
+static int brcmf_debugfs_add_netdev_params(struct wl_priv *wl)
 {
 	char buf[10+IFNAMSIZ];
 	struct dentry *fd;
@@ -4086,7 +4086,7 @@ err_out:
 	return err;
 }
 
-static void wl_debugfs_remove_netdev(struct wl_priv *wl)
+static void brcmf_debugfs_remove_netdev(struct wl_priv *wl)
 {
 	debugfs_remove_recursive(wl->debugfsdir);
 	wl->debugfsdir = NULL;
Signature · 1 line
1.7.1
author
#115 lore raw

PATCH 106/119 staging: brcm80211: removed last typedefs from fullmac

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h     |   12 ++--
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |   14 +++--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd.h          |   22 ++++----
 drivers/staging/brcm80211/brcmfmac/dhd_common.c   |   12 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |    7 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   20 ++++---
 drivers/staging/brcm80211/brcmfmac/dngl_stats.h   |    4 +-
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |   18 +++---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c  |   65 +++++++++++----------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h  |    7 +-
 11 files changed, 97 insertions(+), 86 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +6 -6
index 3dff170..3a09aa3 100644
@@ -92,14 +92,11 @@ struct brcmf_sdreg {
 	int value;
 };
 
-/* callback function, taking one arg */
-typedef void (*sdioh_cb_fn_t) (void *);
-
 struct sdioh_info {
 	struct osl_info *osh;		/* osh handler */
 	bool client_intr_enabled;	/* interrupt connnected flag */
 	bool intr_handler_valid;	/* client driver interrupt handler valid */
-	sdioh_cb_fn_t intr_handler;	/* registered interrupt handler */
+	void (*intr_handler)(void *);	/* registered interrupt handler */
 	void *intr_handler_arg;	/* argument to call interrupt handler */
 	u16 intmask;		/* Current active interrupts */
 	void *sdos_info;	/* Pointer to per-OS private data */
@@ -149,8 +146,11 @@ extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
  */
 extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
 extern int brcmf_sdioh_detach(struct sdioh_info *si);
-extern int brcmf_sdioh_interrupt_register(struct sdioh_info *si,
-					     sdioh_cb_fn_t fn, void *argh);
+
+extern int
+brcmf_sdioh_interrupt_register(struct sdioh_info *si,
+			       void (*sdioh_cb_fn)(void *), void *argh);
+
 extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
 
 /* query whether SD interrupt is enabled or not */
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +8 -6
index fd36679..ae83403 100644
@@ -145,8 +145,7 @@ int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card)
 }
 
 int brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card,
-			  brcmf_sdiocard_cb_fn_t fn,
-			  void *argh)
+			  void (*fn)(void *), void *argh)
 {
 	ASSERT(card);
 
@@ -161,8 +160,7 @@ int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card)
 }
 
 int brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
-			       brcmf_sdiocard_cb_fn_t fn,
-			       void *argh)
+			       void (*fn)(void *), void *argh)
 {
 	ASSERT(card);
 
@@ -443,7 +441,9 @@ int
 brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
 		      uint flags,
 		      u8 *buf, uint nbytes, struct sk_buff *pkt,
-		      brcmf_sdio_cmplt_fn_t complete, void *handle)
+		      void (*complete)(void *handle, int status,
+				       bool sync_waiting),
+		      void *handle)
 {
 	int status;
 	uint incr_fix;
@@ -486,7 +486,9 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
 int
 brcmf_sdcard_send_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
 		      uint flags, u8 *buf, uint nbytes, void *pkt,
-		      brcmf_sdio_cmplt_fn_t complete, void *handle)
+		      void (*complete)(void *handle, int status,
+				       bool sync_waiting),
+		      void *handle)
 {
 	uint incr_fix;
 	uint width;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +1 -1
index 4f4ec47..2be9b08 100644
@@ -188,7 +188,7 @@ extern int brcmf_sdioh_detach(struct sdioh_info *sd)
 
 /* Configure callback to client when we receive client interrupt */
 extern int
-brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
+brcmf_sdioh_interrupt_register(struct sdioh_info *sd, void (*fn)(void *),
 			       void *argh)
 {
 	sd_trace(("%s: Entering\n", __func__));
drivers/staging/brcm80211/brcmfmac/dhd.h +11 -11
index f76a3dd..a67d1ed 100644
@@ -135,7 +135,7 @@
 #define BRCMF_EVENT_MSG_FLUSHTXQ	0x02
 #define BRCMF_EVENT_MSG_GROUP		0x04
 
-typedef struct brcmf_event_msg {
+struct brcmf_event_msg {
 	u16 version;
 	u16 flags;
 	u32 event_type;
@@ -145,7 +145,7 @@ typedef struct brcmf_event_msg {
 	u32 datalen;
 	u8 addr[ETH_ALEN];
 	char ifname[IFNAMSIZ];
-} __packed brcmf_event_msg_t;
+} __packed;
 
 struct brcm_ethhdr {
 	u16 subtype;
@@ -155,11 +155,11 @@ struct brcm_ethhdr {
 	u16 usr_subtype;
 } __packed;
 
-typedef struct brcmf_event {
+struct brcmf_event {
 	struct ethhdr eth;
 	struct brcm_ethhdr hdr;
 	struct brcmf_event_msg msg;
-} __packed brcmf_event_t;
+} __packed;
 
 #define BRCMF_E_SET_SSID			0
 #define BRCMF_E_JOIN				1
@@ -547,7 +547,7 @@ struct brcmf_pub {
 	bool iswl;		/* Dongle-resident driver is wl */
 	unsigned long drv_version;	/* Version of dongle-resident driver */
 	u8 mac[ETH_ALEN];			/* MAC address obtained from dongle */
-	dngl_stats_t dstats;		/* Stats for dongle-based data */
+	struct dngl_stats dstats;	/* Stats for dongle-based data */
 
 	/* Additional stats for the bus level */
 	unsigned long tx_packets;	/* Data packets sent to dongle */
@@ -609,10 +609,10 @@ struct brcmf_timeout {
 	u32 tick;		/* O/S tick time (usec) */
 };
 
-typedef struct {
+struct bcmevent_name {
 	uint event;
 	const char *name;
-} bcmevent_name_t;
+};
 
 #if defined(CONFIG_PM_SLEEP)
 extern atomic_t brcmf_mmc_suspend;
@@ -704,7 +704,7 @@ extern uint brcmf_pktgen_len;
 #endif
 
 extern u32 g_assert_type;
-extern const bcmevent_name_t bcmevent_names[];
+extern const struct bcmevent_name bcmevent_names[];
 extern const int bcmevent_names_size;
 
 
@@ -808,7 +808,7 @@ extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
 
 extern int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name);
 extern int brcmf_c_host_event(struct brcmf_info *drvr_priv, int *idx,
-			      void *pktdata, brcmf_event_msg_t *,
+			      void *pktdata, struct brcmf_event_msg *,
 			      void **data_ptr);
 
 extern void brcmf_c_init(void);
@@ -885,7 +885,7 @@ struct brcmf_c_ioctl {
 
 #ifdef SDTEST
 /* For pktgen iovar */
-typedef struct brcmf_pktgen {
+struct brcmf_pktgen {
 	uint version;		/* To allow structure change tracking */
 	uint freq;		/* Max ticks between tx/rx attempts */
 	uint count;		/* Test packets to send/rcv each attempt */
@@ -898,7 +898,7 @@ typedef struct brcmf_pktgen {
 	uint numfail;		/* Count of test send failures */
 	uint mode;		/* Test mode (type of test packets) */
 	uint stop;		/* Stop after this many tx failures */
-} brcmf_pktgen_t;
+};
 
 /* Version in case structure changes */
 #define BRCMF_PKTGEN_VERSION	2
drivers/staging/brcm80211/brcmfmac/dhd_common.c +7 -5
index 14dc98d..ddc2085 100644
@@ -449,7 +449,8 @@ int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc, void *buf,
 }
 
 #ifdef SHOW_EVENTS
-static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
+static void
+brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
 {
 	uint i, status, reason;
 	bool group = false, flush_txq = false, link = false;
@@ -756,10 +757,10 @@ static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
 
 int
 brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
-	      brcmf_event_msg_t *event, void **data_ptr)
+		   struct brcmf_event_msg *event, void **data_ptr)
 {
 	/* check whether packet is a BRCM event pkt */
-	brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata;
+	struct brcmf_event *pvt_data = (struct brcmf_event *) pktdata;
 	char *event_data;
 	u32 type, status;
 	u16 flags;
@@ -781,12 +782,13 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
 	event_data = *data_ptr;
 
 	/* memcpy since BRCM event pkt may be unaligned. */
-	memcpy(event, &pvt_data->msg, sizeof(brcmf_event_msg_t));
+	memcpy(event, &pvt_data->msg, sizeof(struct brcmf_event_msg));
 
 	type = get_unaligned_be32(&event->event_type);
 	flags = get_unaligned_be16(&event->flags);
 	status = get_unaligned_be32(&event->status);
-	evlen = get_unaligned_be32(&event->datalen) + sizeof(brcmf_event_t);
+	evlen = get_unaligned_be32(&event->datalen) +
+		sizeof(struct brcmf_event);
 
 	switch (type) {
 	case BRCMF_E_IF:
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +4 -3
index aa2f81f..fc9abba 100644
@@ -185,7 +185,8 @@ module_param(brcmf_pktgen_len, uint, 0);
 static int brcmf_toe_get(struct brcmf_info *drvr_priv, int idx, u32 *toe_ol);
 static int brcmf_toe_set(struct brcmf_info *drvr_priv, int idx, u32 toe_ol);
 static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
-			     brcmf_event_msg_t *event_ptr, void **data_ptr);
+			    struct brcmf_event_msg *event_ptr,
+			    void **data_ptr);
 
 static void brcmf_set_packet_filter(int value, struct brcmf_pub *drvr)
 {
@@ -858,7 +859,7 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
 	struct sk_buff *pnext, *save_pktbuf;
 	int i;
 	struct brcmf_if *ifp;
-	brcmf_event_msg_t event;
+	struct brcmf_event_msg event;
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -1858,7 +1859,7 @@ int brcmf_os_ioctl_resp_wake(struct brcmf_pub *drvr)
 }
 
 static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
-			    brcmf_event_msg_t *event, void **data)
+			    struct brcmf_event_msg *event, void **data)
 {
 	int bcmerror = 0;
 
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +12 -8
index ba3ea59..3cbfacb 100644
@@ -410,7 +410,7 @@ BRCMF_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
 #define CORE_BUS_REG(base, field) \
 		(base + offsetof(struct sdpcmd_regs, field))
 #define CORE_SB(base, field) \
-		(base + SBCONFIGOFF + offsetof(sbconfig_t, field))
+		(base + SBCONFIGOFF + offsetof(struct sbconfig, field))
 
 /* core registers */
 struct sdpcmd_regs {
@@ -697,7 +697,7 @@ struct brcmf_bus {
 	u32 fw_ptr;
 };
 
-typedef volatile struct _sbconfig {
+struct sbconfig {
 	u32 PAD[2];
 	u32 sbipsflag;	/* initiator port ocp slave flag */
 	u32 PAD[3];
@@ -735,7 +735,7 @@ typedef volatile struct _sbconfig {
 	u32 PAD[3];
 	u32 sbidlow;		/* identification */
 	u32 sbidhigh;	/* identification */
-} sbconfig_t;
+};
 
 /* clkstate */
 #define CLK_NONE	0
@@ -893,7 +893,9 @@ static void brcmf_sdbrcm_setmemsize(struct brcmf_bus *bus, int mem_size);
 static int brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn,
 			       uint flags, u8 *buf, uint nbytes,
 			       struct sk_buff *pkt,
-			       brcmf_sdio_cmplt_fn_t complete, void *handle);
+			       void (*complete)(void *handle, int status,
+						      bool sync_waiting),
+			       void *handle);
 
 static bool brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus, void *card);
 static int  _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus);
@@ -1865,7 +1867,7 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
 #ifdef SDTEST
 	{"extloop", IOV_EXTLOOP, 0, IOVT_BOOL, 0}
 	,
-	{"pktgen", IOV_PKTGEN, 0, IOVT_BUFFER, sizeof(brcmf_pktgen_t)}
+	{"pktgen", IOV_PKTGEN, 0, IOVT_BUFFER, sizeof(struct brcmf_pktgen)}
 	,
 #endif				/* SDTEST */
 
@@ -2001,7 +2003,7 @@ void brcmf_bus_clearcounts(struct brcmf_pub *drvr)
 #ifdef SDTEST
 static int brcmf_sdbrcm_pktgen_get(struct brcmf_bus *bus, u8 *arg)
 {
-	brcmf_pktgen_t pktgen;
+	struct brcmf_pktgen pktgen;
 
 	pktgen.version = BRCMF_PKTGEN_VERSION;
 	pktgen.freq = bus->pktgen_freq;
@@ -2023,7 +2025,7 @@ static int brcmf_sdbrcm_pktgen_get(struct brcmf_bus *bus, u8 *arg)
 
 static int brcmf_sdbrcm_pktgen_set(struct brcmf_bus *bus, u8 *arg)
 {
-	brcmf_pktgen_t pktgen;
+	struct brcmf_pktgen pktgen;
 	uint oldcnt, oldmode;
 
 	memcpy(&pktgen, arg, sizeof(pktgen));
@@ -6035,7 +6037,9 @@ err:
 static int
 brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn, uint flags,
 		    u8 *buf, uint nbytes, struct sk_buff *pkt,
-		    brcmf_sdio_cmplt_fn_t complete, void *handle)
+		    void (*complete)(void *handle, int status,
+				     bool sync_waiting),
+		    void *handle)
 {
 	return brcmf_sdcard_send_buf
 		(bus->card, addr, fn, flags, buf, nbytes, pkt, complete,
drivers/staging/brcm80211/brcmfmac/dngl_stats.h +2 -2
index 699cbff..53a50f6 100644
@@ -17,7 +17,7 @@
 #ifndef _dngl_stats_h_
 #define _dngl_stats_h_
 
-typedef struct {
+struct dngl_stats {
 	unsigned long rx_packets;	/* total packets received */
 	unsigned long tx_packets;	/* total packets transmitted */
 	unsigned long rx_bytes;	/* total bytes received */
@@ -27,6 +27,6 @@ typedef struct {
 	unsigned long rx_dropped;	/* packets dropped by dongle */
 	unsigned long tx_dropped;	/* packets dropped by dongle */
 	unsigned long multicast;	/* multicast packets received */
-} dngl_stats_t;
+};
 
 #endif				/* _dngl_stats_h_ */
drivers/staging/brcm80211/brcmfmac/sdio_host.h +9 -9
index 02c820b..5d2178d 100644
@@ -43,7 +43,6 @@ extern const uint brcmf_sdio_msglevel;
 
 /* forward declarations */
 struct brcmf_sdio_card;
-typedef void (*brcmf_sdiocard_cb_fn_t) (void *);
 
 /* Attach and build an interface to the underlying SD host driver.
  *  - Allocates resources (structs, arrays, mem, OS handles, etc) needed by
@@ -68,8 +67,8 @@ extern int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card);
 
 /* Register/deregister device interrupt handler. */
 extern int
-brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card, brcmf_sdiocard_cb_fn_t fn,
-		      void *argh);
+brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card,
+		      void (*fn)(void *), void *argh);
 
 extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
 
@@ -78,8 +77,7 @@ extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
  */
 extern int
 brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
-			   brcmf_sdiocard_cb_fn_t fn,
-			   void *argh);
+			   void (*fn)(void *), void *argh);
 
 /* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
  *   fn:   function number
@@ -138,16 +136,18 @@ extern bool brcmf_sdcard_regfail(struct brcmf_sdio_card *card);
  * Returns 0 or error code.
  * NOTE: Async operation is not currently supported.
  */
-typedef void (*brcmf_sdio_cmplt_fn_t)
-		(void *handle, int status, bool sync_waiting);
 extern int
 brcmf_sdcard_send_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
 		      uint flags, u8 *buf, uint nbytes, void *pkt,
-		      brcmf_sdio_cmplt_fn_t complete, void *handle);
+		      void (*complete)(void *handle, int status,
+				       bool sync_waiting),
+		      void *handle);
 extern int
 brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
 		      uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
-		      brcmf_sdio_cmplt_fn_t complete, void *handle);
+		      void (*complete)(void *handle, int status,
+				       bool sync_waiting),
+		      void *handle);
 
 /* Flags bits */
 #define SDIO_REQ_4BYTE	0x1	/* Four-byte target (backplane) width (vs. two-byte) */
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +33 -32

167 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +4 -3
index e6df203..af62cee 100644
@@ -183,7 +183,8 @@ struct wl_conf {
 struct wl_event_loop {
 	s32(*handler[BRCMF_E_LAST]) (struct wl_priv *wl,
 				     struct net_device *ndev,
-				     const brcmf_event_msg_t *e, void *data);
+				     const struct brcmf_event_msg *e,
+				     void *data);
 };
 
 /* representing interface of cfg80211 plane */
@@ -219,7 +220,7 @@ struct wl_ie {
 struct wl_event_q {
 	struct list_head eq_list;
 	u32 etype;
-	brcmf_event_msg_t emsg;
+	struct brcmf_event_msg emsg;
 	s8 edata[1];
 };
 
@@ -370,7 +371,7 @@ extern s32 wl_cfg80211_attach(struct net_device *ndev, void *data);
 extern void wl_cfg80211_detach(void);
 /* event handler from dongle */
 extern void wl_cfg80211_event(struct net_device *ndev,
-			      const brcmf_event_msg_t *e, void *data);
+			      const struct brcmf_event_msg *e, void *data);
 extern void wl_cfg80211_sdio_func(void *func);	/* set sdio function info */
 extern struct sdio_func *wl_cfg80211_get_sdio_func(void);	/* set sdio function info */
 extern s32 wl_cfg80211_up(void);	/* dongle up */
Signature · 1 line
1.7.1
author
#116 lore raw

PATCH 107/119 staging: brcm80211: removed unused code and definitions from fullmac

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h     |   21 ----
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |   47 ---------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |   45 --------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   13 ---
 drivers/staging/brcm80211/brcmfmac/dhd.h          |   17 ---
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h      |   10 --
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c      |   10 --
 drivers/staging/brcm80211/brcmfmac/dhd_common.c   |   18 ----
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |  113 ---------------------
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h    |    5 -
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   23 ----
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |   23 ----
 12 files changed, 0 insertions(+), 345 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +0 -21
index 3a09aa3..c4c6e54 100644
@@ -125,21 +125,10 @@ struct brcmf_sdmmc_instance {
 extern int  brcmf_sdioh_osinit(struct sdioh_info *sd);
 extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
 
-/* OS-independent interrupt handler */
-extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
-
 /* Core interrupt enable/disable of device interrupts */
 extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
 extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
 
-/* Register mapping routines */
-extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
-extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
-
-/* Interrupt (de)registration routines */
-extern int  brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
-extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
-
 /* attach, return handler on success, NULL if failed.
  *  The handler shall be provided by all subsequent calls. No local cache
  *  cfghdl points to the starting address of pci device mapped memory
@@ -153,10 +142,6 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *si,
 
 extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
 
-/* query whether SD interrupt is enabled or not */
-extern int
-brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
-
 /* enable or disable SD interrupt */
 extern int
 brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
@@ -188,9 +173,6 @@ brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
 extern int
 brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
 
-/* query number of io functions */
-extern uint brcmf_sdioh_query_iofnum(struct sdioh_info *si);
-
 /* handle iovars */
 extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
 			  void *params, int plen, void *arg, int len, bool set);
@@ -198,9 +180,6 @@ extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
 /* Issue abort to the specified function and clear controller as needed */
 extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
 
-/* Helper function */
-void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
-
 /* Watchdog timer interface for pm ops */
 extern void brcmf_sdio_wdtmr_enable(bool enable);
 
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +0 -47

68 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -45

51 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -13
index 2be9b08..1b55e56 100644
@@ -244,19 +244,6 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
 	return 0;
 }
 
-extern int
-brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
-{
-	sd_trace(("%s: Entering\n", __func__));
-	*onoff = sd->client_intr_enabled;
-	return 0;
-}
-
-uint brcmf_sdioh_query_iofnum(struct sdioh_info *sd)
-{
-	return sd->num_funcs;
-}
-
 /* IOVar table */
 enum {
 	IOV_MSGLEVEL = 1,
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -17
index a67d1ed..1540804 100644
@@ -774,9 +774,6 @@ extern void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx,
 /* Return pointer to interface name */
 extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
 
-/* Request scheduling of the bus dpc */
-extern void brcmf_sched_dpc(struct brcmf_pub *drvr);
-
 /* Notify tx completion */
 extern void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp,
 			     bool success);
@@ -793,12 +790,6 @@ extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *drvr, uint *condition,
 extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *drvr);
 extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
 extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *drvr);
-extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
-extern int brcmf_custom_get_mac_address(unsigned char *buf);
-extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *drvr);
-extern void brcmf_os_sdlock_eventq(struct brcmf_pub *drvr);
-extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *drvr);
 #ifdef BCMDBG
 extern int brcmf_write_to_file(struct brcmf_pub *drvr, u8 *buf, int size);
 #endif				/* BCMDBG */
@@ -817,14 +808,6 @@ extern int brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle,
 		      char *name, u8 *mac_addr, u32 flags, u8 bssidx);
 extern void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx);
 
-extern void brcmf_vif_add(struct brcmf_info *drvr_priv, int ifidx, char *name);
-extern void brcmf_vif_del(struct brcmf_info *drvr_priv, int ifidx);
-
-extern void brcmf_event(struct brcmf_info *drvr_priv, char *evpkt, int evlen,
-			int ifidx);
-extern void brcmf_vif_sendup(struct brcmf_info *drvr_priv, int ifidx,
-			     unsigned char *cp, int len);
-
 /* Send packet to dongle via data channel */
 extern int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx,\
 			 struct sk_buff *pkt);
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +0 -10
index 50da972..a60aa41 100644
@@ -54,9 +54,6 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen);
 extern int
 brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen);
 
-extern void dhd_bus_isr(bool *InterruptRecognized,
-			bool *QueueMiniportHandleInterrupt, void *arg);
-
 /* Check for and handle local prot-specific iovar commands */
 extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
 			    void *params, int plen, void *arg, int len,
@@ -69,13 +66,6 @@ extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr,
 /* Clear any bus counters */
 extern void brcmf_bus_clearcounts(struct brcmf_pub *drvr);
 
-/* return the dongle chipid */
-extern uint brcmf_bus_chip(struct brcmf_bus *bus);
-
-extern void *brcmf_bus_drvr(struct brcmf_bus *bus);
-extern void *brcmf_bus_txq(struct brcmf_bus *bus);
-extern uint brcmf_bus_hdrlen(struct brcmf_bus *bus);
-
 extern void brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick);
 
 #endif				/* _dhd_bus_h_ */
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +0 -10
index d07860b..a1902f2 100644
@@ -352,16 +352,6 @@ done:
 		(((struct sk_buff *)(skb))->ip_summed = \
 		((x) ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE))
 
-/* PKTSETSUMNEEDED and PKTSUMGOOD are not possible because
-	skb->ip_summed is overloaded */
-
-int
-brcmf_proto_iovar_op(struct brcmf_pub *drvr, const char *name,
-		  void *params, int plen, void *arg, int len, bool set)
-{
-	return -ENOTSUPP;
-}
-
 void brcmf_proto_dump(struct brcmf_pub *drvr, struct brcmu_strbuf *strbuf)
 {
 	brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", drvr->prot->reqid);
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -18
index ddc2085..ec6093e 100644
@@ -414,20 +414,6 @@ int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc, void *buf,
 			if (bcmerror != -ENOTSUPP)
 				break;
 
-			/* not in generic table, try protocol module */
-			if (ioc->cmd == BRCMF_GET_VAR)
-				bcmerror = brcmf_proto_iovar_op(drvr, buf,
-								arg, arglen,
-								buf, buflen,
-								IOV_GET);
-			else
-				bcmerror = brcmf_proto_iovar_op(drvr, buf,
-								NULL, 0, arg,
-								arglen,
-								IOV_SET);
-			if (bcmerror != -ENOTSUPP)
-				break;
-
 			/* if still not found, try bus module */
 			if (ioc->cmd == BRCMF_GET_VAR)
 				bcmerror = brcmf_sdbrcm_bus_iovar_op(drvr,
@@ -815,8 +801,6 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
 		}
 		/* send up the if event: btamp user needs it */
 		*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
-		/* push up to external supp/auth */
-		brcmf_event(drvr_priv, (char *)pvt_data, evlen, *ifidx);
 		break;
 
 		/* These are what external supplicant/authenticator wants */
@@ -829,8 +813,6 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
 		/* Fall through: this should get _everything_  */
 
 		*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
-		/* push up to external supp/auth */
-		brcmf_event(drvr_priv, (char *)pvt_data, evlen, *ifidx);
 		DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
 			   __func__, type, flags, status));
 
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -113

137 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_proto.h +0 -5
index afec597..0a76216 100644
@@ -57,11 +57,6 @@ extern int brcmf_proto_hdrpull(struct brcmf_pub *, int *ifidx,
 extern int brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx,
 			     struct brcmf_ioctl *ioc, void *buf, int len);
 
-/* Check for and handle local prot-specific iovar commands */
-extern int brcmf_proto_iovar_op(struct brcmf_pub *dhdp, const char *name,
-				void *params, int plen, void *arg, int len,
-				bool set);
-
 /* Add prot dump output to a buffer */
 extern void brcmf_proto_dump(struct brcmf_pub *dhdp,
 			     struct brcmu_strbuf *strbuf);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -23
index 3cbfacb..25c5e90 100644
@@ -5565,8 +5565,6 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
 		goto fail;
 	}
 
-	brcmf_sdcard_chipinfo(card, bus->ci->chip, bus->ci->chiprev);
-
 	if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) {
 		DHD_ERROR(("%s: unsupported chip: 0x%04x\n",
 			   __func__, bus->ci->chip));
@@ -6046,27 +6044,6 @@ brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn, uint flags,
 		 handle);
 }
 
-uint brcmf_bus_chip(struct brcmf_bus *bus)
-{
-	ASSERT(bus->ci != NULL);
-	return bus->ci->chip;
-}
-
-void *brcmf_bus_drvr(struct brcmf_bus *bus)
-{
-	return bus->drvr;
-}
-
-void *brcmf_bus_txq(struct brcmf_bus *bus)
-{
-	return &bus->txq;
-}
-
-uint brcmf_bus_hdrlen(struct brcmf_bus *bus)
-{
-	return SDPCM_HDRLEN;
-}
-
 int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
 {
 	int bcmerror = 0;
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -23
index 5d2178d..68a2a64 100644
@@ -58,9 +58,6 @@ extern struct brcmf_sdio_card *brcmf_sdcard_attach(void *cfghdl, void **regsva,
 /* Detach - freeup resources allocated in attach */
 extern int brcmf_sdcard_detach(struct brcmf_sdio_card *card);
 
-/* Query if SD device interrupts are enabled */
-extern bool brcmf_sdcard_intr_query(struct brcmf_sdio_card *card);
-
 /* Enable/disable SD interrupt */
 extern int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card);
 extern int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card);
@@ -72,13 +69,6 @@ brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card,
 
 extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
 
-/* Register a callback to be called on device removal.
- * No-op in the case of non-removable/hardwired devices.
- */
-extern int
-brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
-			   void (*fn)(void *), void *argh);
-
 /* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
  *   fn:   function number
  *   addr: unmodified SDIO-space address
@@ -173,9 +163,6 @@ extern int brcmf_sdcard_abort(struct brcmf_sdio_card *card, uint fn);
 /* Returns the "Device ID" of target device on the SDIO bus. */
 extern int brcmf_sdcard_query_device(struct brcmf_sdio_card *card);
 
-/* Returns the number of IO functions reported by the device */
-extern uint brcmf_sdcard_query_iofnum(struct brcmf_sdio_card *card);
-
 /* Miscellaneous knob tweaker. */
 extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
 				 void *params, int plen, void *arg, int len,
@@ -183,8 +170,6 @@ extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
 
 /* helper functions */
 
-extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
-
 /* callback functions */
 struct brcmf_sdioh_driver {
 	/* attach to device */
@@ -200,19 +185,11 @@ struct sdioh_info;
 extern int brcmf_sdio_function_init(void);
 extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver);
 extern void brcmf_sdio_unregister(void);
-extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
 extern void brcmf_sdio_function_cleanup(void);
 extern int brcmf_sdio_probe(struct device *dev);
 extern int brcmf_sdio_remove(struct device *dev);
 
-/* Function to pass device-status bits to DHD. */
-extern u32 brcmf_sdcard_get_dstatus(struct brcmf_sdio_card *card);
-
 /* Function to return current window addr */
 extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_card *card);
 
-/* Function to pass chipid and rev to lower layers for controlling pr's */
-extern void brcmf_sdcard_chipinfo(struct brcmf_sdio_card *card, u32 chip,
-				  u32 chiprev);
-
 #endif				/* _BRCM_SDH_H_ */
Signature · 1 line
1.7.1
author
#117 lore raw

PATCH 108/119 staging: brcm80211: fullmac register access macro's take u32 instead of pointers

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Fullmac contains macro's that access registers on the 32 bits backplane bus. These registers should not be declared as pointers since pointers can be 64 bits. The following patch series gets rid of these pointers and ultimately of all compiler warning when compiling for amd64.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   77 ++++++++++++-------------
 1 files changed, 38 insertions(+), 39 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +38 -39
index 25c5e90..5a15002 100644
@@ -37,38 +37,36 @@
 /* register access macros */
 #ifndef __BIG_ENDIAN
 #ifndef __mips__
-#define R_REG(r) \
-	brcmf_sdcard_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
+#define R_REG(r, typ) \
+	brcmf_sdcard_reg_read(NULL, (r), sizeof(typ))
 #else				/* __mips__ */
-#define R_REG(r) \
+#define R_REG(r, typ) \
 	({ \
 		__typeof(*(r)) __osl_v; \
 		__asm__ __volatile__("sync"); \
-		__osl_v = brcmf_sdcard_reg_read(NULL, (unsigned long)(r),\
-					  sizeof(*(r))); \
+		__osl_v = brcmf_sdcard_reg_read(NULL, (r),\
+					  sizeof(typ)); \
 		__asm__ __volatile__("sync"); \
 		__osl_v; \
 	})
 #endif				/* __mips__ */
 
-#define W_REG(r, v) do { \
-		brcmf_sdcard_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), \
-				       (v)); \
+#define W_REG(r, v, typ) do { \
+		brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), (v)); \
 	} while (0)
 #else				/* __BIG_ENDIAN */
-#define R_REG(r) \
-	brcmf_sdcard_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
-#define W_REG(r, v) do { \
-		brcmf_sdcard_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), \
-				       (v)); \
+#define R_REG(r, typ) \
+	brcmf_sdcard_reg_read(NULL, (r), sizeof(typ))
+#define W_REG(r, v, typ) do { \
+		brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), (v)); \
 	} while (0)
 #endif				/* __BIG_ENDIAN */
 
-#define AND_REG(r, v)	W_REG((r), R_REG(r) & (v))
-#define OR_REG(r, v)	W_REG((r), R_REG(r) | (v))
+#define AND_REG(r, v, typ)	W_REG((r), R_REG(r, typ) & (v), typ)
+#define OR_REG(r, v, typ)	W_REG((r), R_REG(r, typ) | (v), typ)
 
-#define SET_REG(r, mask, val) \
-		W_REG((r), ((R_REG(r) & ~(mask)) | (val)))
+#define SET_REG(r, mask, val, typ) \
+		W_REG((r), ((R_REG(r) & ~(mask)) | (val)), typ)
 
 #ifdef BCMDBG
 
@@ -826,11 +824,11 @@ static bool brcmf_readahead;
 
 /* Macros to get register read/write status */
 /* NOTE: these assume a local dhdsdio_bus_t *bus! */
-#define R_SDREG(regvar, regaddr, retryvar) \
+#define R_SDREG(regvar, regaddr, retryvar, typ) \
 do { \
 	retryvar = 0; \
 	do { \
-		regvar = R_REG(regaddr); \
+		regvar = R_REG((u32)(regaddr), typ); \
 	} while (brcmf_sdcard_regfail(bus->card) && \
 		 (++retryvar <= retry_limit)); \
 	if (retryvar) { \
@@ -843,11 +841,11 @@ do { \
 	} \
 } while (0)
 
-#define W_SDREG(regval, regaddr, retryvar) \
+#define W_SDREG(regval, regaddr, retryvar, typ) \
 do { \
 	retryvar = 0; \
 	do { \
-		W_REG(regaddr, regval); \
+		W_REG((u32)(regaddr), regval, typ); \
 	} while (brcmf_sdcard_regfail(bus->card) && \
 		 (++retryvar <= retry_limit)); \
 	if (retryvar) { \
@@ -994,7 +992,8 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
 		if (pendok && ((bus->ci->buscoretype == PCMCIA_CORE_ID)
 			       && (bus->ci->buscorerev == 9))) {
 			u32 dummy, retries;
-			R_SDREG(dummy, &bus->regs->clockctlstatus, retries);
+			R_SDREG(dummy, &bus->regs->clockctlstatus, retries,
+				u32);
 		}
 
 		/* Check current status */
@@ -1191,7 +1190,7 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
 		brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
 
 		/* Tell device to start using OOB wakeup */
-		W_SDREG(SMB_USE_OOB, &regs->tosbmailbox, retries);
+		W_SDREG(SMB_USE_OOB, &regs->tosbmailbox, retries, u32);
 		if (retries > retry_limit)
 			DHD_ERROR(("CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n"));
 
@@ -1230,9 +1229,9 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
 		brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
 
 		/* Send misc interrupt to indicate OOB not needed */
-		W_SDREG(0, &regs->tosbmailboxdata, retries);
+		W_SDREG(0, &regs->tosbmailboxdata, retries, u32);
 		if (retries <= retry_limit)
-			W_SDREG(SMB_DEV_INT, &regs->tosbmailbox, retries);
+			W_SDREG(SMB_DEV_INT, &regs->tosbmailbox, retries, u32);
 
 		if (retries > retry_limit)
 			DHD_ERROR(("CANNOT SIGNAL CHIP TO CLEAR OOB!!\n"));
@@ -1554,7 +1553,7 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
 		/* In poll mode, need to check for other events */
 		if (!bus->intr && cnt) {
 			/* Check device status, signal pending interrupt */
-			R_SDREG(intstatus, &regs->intstatus, retries);
+			R_SDREG(intstatus, &regs->intstatus, retries, u32);
 			bus->f2txdata++;
 			if (brcmf_sdcard_regfail(bus->card))
 				break;
@@ -3029,7 +3028,7 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
 			bcmerror = 0;
 		}
 
-		W_SDREG(0xFFFFFFFF, &bus->regs->intstatus, retries);
+		W_SDREG(0xFFFFFFFF, &bus->regs->intstatus, retries, u32);
 
 		brcmf_sdbrcm_chip_resetcore(bus->card, bus->ci->armcorebase);
 
@@ -3162,7 +3161,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
 		tasklet_kill(&bus->tasklet);
 
 	/* Disable and clear interrupts at the chip level also */
-	W_SDREG(0, &bus->regs->hostintmask, retries);
+	W_SDREG(0, &bus->regs->hostintmask, retries, u32);
 	local_hostintmask = bus->hostintmask;
 	bus->hostintmask = 0;
 
@@ -3189,7 +3188,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
 			 SDIO_FUNC_ENABLE_1, NULL);
 
 	/* Clear any pending interrupts now that F2 is disabled */
-	W_SDREG(local_hostintmask, &bus->regs->intstatus, retries);
+	W_SDREG(local_hostintmask, &bus->regs->intstatus, retries, u32);
 
 	/* Turn off the backplane clock (only) */
 	brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
@@ -3268,7 +3267,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
 
 	/* Enable function 2 (frame transfers) */
 	W_SDREG((SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT),
-		&bus->regs->tosbmailboxdata, retries);
+		&bus->regs->tosbmailboxdata, retries, u32);
 	enable = (SDIO_FUNC_ENABLE_1 | SDIO_FUNC_ENABLE_2);
 
 	brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
@@ -3291,7 +3290,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
 		bus->hostintmask = HOSTINTMASK;
 		W_SDREG(bus->hostintmask,
 			(unsigned int *)CORE_BUS_REG(bus->ci->buscorebase,
-			hostintmask), retries);
+			hostintmask), retries, u32);
 
 		brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_WATERMARK,
 				 (u8) watermark, &err);
@@ -3395,7 +3394,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
 
 	if (rtx) {
 		bus->rxrtx++;
-		W_SDREG(SMB_NAK, &regs->tosbmailbox, retries);
+		W_SDREG(SMB_NAK, &regs->tosbmailbox, retries, u32);
 		bus->f1regdata++;
 		if (retries <= retry_limit)
 			bus->rxskip = true;
@@ -4525,9 +4524,9 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
 	DHD_TRACE(("%s: Enter\n", __func__));
 
 	/* Read mailbox data and ack that we did so */
-	R_SDREG(hmb_data, &regs->tohostmailboxdata, retries);
+	R_SDREG(hmb_data, &regs->tohostmailboxdata, retries, u32);
 	if (retries <= retry_limit)
-		W_SDREG(SMB_INT_ACK, &regs->tosbmailbox, retries);
+		W_SDREG(SMB_INT_ACK, &regs->tosbmailbox, retries, u32);
 	bus->f1regdata += 2;
 
 	/* Dongle recomposed rx frames, accept them again */
@@ -4669,14 +4668,14 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
 	/* Pending interrupt indicates new device status */
 	if (bus->ipend) {
 		bus->ipend = false;
-		R_SDREG(newstatus, &regs->intstatus, retries);
+		R_SDREG(newstatus, &regs->intstatus, retries, u32);
 		bus->f1regdata++;
 		if (brcmf_sdcard_regfail(bus->card))
 			newstatus = 0;
 		newstatus &= bus->hostintmask;
 		bus->fcstate = !!(newstatus & I_HMB_FC_STATE);
 		if (newstatus) {
-			W_SDREG(newstatus, &regs->intstatus, retries);
+			W_SDREG(newstatus, &regs->intstatus, retries, u32);
 			bus->f1regdata++;
 		}
 	}
@@ -4691,8 +4690,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
 	 */
 	if (intstatus & I_HMB_FC_CHANGE) {
 		intstatus &= ~I_HMB_FC_CHANGE;
-		W_SDREG(I_HMB_FC_CHANGE, &regs->intstatus, retries);
-		R_SDREG(newstatus, &regs->intstatus, retries);
+		W_SDREG(I_HMB_FC_CHANGE, &regs->intstatus, retries, u32);
+		R_SDREG(newstatus, &regs->intstatus, retries, u32);
 		bus->f1regdata += 2;
 		bus->fcstate =
 		    !!(newstatus & (I_HMB_FC_STATE | I_HMB_FC_CHANGE));
@@ -5594,7 +5593,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
 	bus->regs = (void *)bus->ci->buscorebase;
 
 	/* Set core control so an SDIO reset does a backplane reset */
-	OR_REG(&bus->regs->corecontrol, CC_BPRESEN);
+	OR_REG((u32)&bus->regs->corecontrol, CC_BPRESEN, u32);
 
 	brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
 
Signature · 1 line
1.7.1
author
#118 lore raw

PATCH 109/119 staging: brcm80211: replaced macro R_SDREG by function r_sdreg()

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Leads to more readable code and better type checking.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   68 ++++++++++++++----------
 1 files changed, 40 insertions(+), 28 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +40 -28
index 5a15002..13a319d 100644
@@ -403,7 +403,10 @@ struct rte_console {
 
 BRCMF_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
 
-/* Core reg address translation */
+/*
+ * Core reg address translation.
+ * Both macro's returns a 32 bits byte address on the backplane bus.
+ */
 #define CORE_CC_REG(base, field)	(base + offsetof(chipcregs_t, field))
 #define CORE_BUS_REG(base, field) \
 		(base + offsetof(struct sdpcmd_regs, field))
@@ -530,7 +533,7 @@ struct chip_info {
 	u32 cccorebase;
 	u32 ccrev;
 	u32 cccaps;
-	u32 buscorebase;
+	u32 buscorebase; /* 32 bits backplane bus address */
 	u32 buscorerev;
 	u32 buscoretype;
 	u32 ramcorebase;
@@ -549,7 +552,8 @@ struct brcmf_bus {
 	uint varsz;		/* Size of variables buffer */
 	u32 sbaddr;		/* Current SB window pointer (-1, invalid) */
 
-	struct sdpcmd_regs *regs;	/* SDIO core */
+	/* SDIO core, 32 bit address on the backplane bus: */
+	struct sdpcmd_regs *regs;
 	uint sdpcmrev;		/* SDIO core revision */
 	uint armrev;		/* CPU core revision */
 	uint ramrev;		/* SOCRAM core revision */
@@ -822,24 +826,26 @@ static bool brcmf_readahead;
 	(((u8)(bus->tx_max - bus->tx_seq) != 0) && \
 	(((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0))
 
-/* Macros to get register read/write status */
-/* NOTE: these assume a local dhdsdio_bus_t *bus! */
-#define R_SDREG(regvar, regaddr, retryvar, typ) \
-do { \
-	retryvar = 0; \
-	do { \
-		regvar = R_REG((u32)(regaddr), typ); \
-	} while (brcmf_sdcard_regfail(bus->card) && \
-		 (++retryvar <= retry_limit)); \
-	if (retryvar) { \
-		bus->regfails += (retryvar-1); \
-		if (retryvar > retry_limit) { \
-			DHD_ERROR(("%s: FAILED" #regvar "READ, LINE %d\n", \
-			__func__, __LINE__)); \
-			regvar = 0; \
-		} \
-	} \
-} while (0)
+/*
+ * Reads a register in the SDIO hardware block. This block occupies a series of
+ * adresses on the 32 bit backplane bus.
+ */
+static void
+r_sdreg32(struct brcmf_bus *bus, u32 *regvar, u32 reg_offset, u32 *retryvar)
+{
+	*retryvar = 0;
+	do {
+		*regvar = R_REG(bus->ci->buscorebase + reg_offset, u32);
+	} while (brcmf_sdcard_regfail(bus->card) &&
+		 (++(*retryvar) <= retry_limit));
+	if (*retryvar) {
+		bus->regfails += (*retryvar-1);
+		if (*retryvar > retry_limit) {
+			DHD_ERROR(("FAILED READ %Xh\n", reg_offset));
+			*regvar = 0;
+		}
+	}
+}
 
 #define W_SDREG(regval, regaddr, retryvar, typ) \
 do { \
@@ -992,8 +998,9 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
 		if (pendok && ((bus->ci->buscoretype == PCMCIA_CORE_ID)
 			       && (bus->ci->buscorerev == 9))) {
 			u32 dummy, retries;
-			R_SDREG(dummy, &bus->regs->clockctlstatus, retries,
-				u32);
+			r_sdreg32(bus, &dummy,
+				  offsetof(struct sdpcmd_regs, clockctlstatus),
+				  &retries);
 		}
 
 		/* Check current status */
@@ -1521,7 +1528,6 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
 	u8 tx_prec_map;
 
 	struct brcmf_pub *drvr = bus->drvr;
-	struct sdpcmd_regs *regs = bus->regs;
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -1553,7 +1559,9 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
 		/* In poll mode, need to check for other events */
 		if (!bus->intr && cnt) {
 			/* Check device status, signal pending interrupt */
-			R_SDREG(intstatus, &regs->intstatus, retries, u32);
+			r_sdreg32(bus, &intstatus,
+				  offsetof(struct sdpcmd_regs, intstatus),
+				  &retries);
 			bus->f2txdata++;
 			if (brcmf_sdcard_regfail(bus->card))
 				break;
@@ -4524,7 +4532,9 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
 	DHD_TRACE(("%s: Enter\n", __func__));
 
 	/* Read mailbox data and ack that we did so */
-	R_SDREG(hmb_data, &regs->tohostmailboxdata, retries, u32);
+	r_sdreg32(bus, &hmb_data,
+		  offsetof(struct sdpcmd_regs, tohostmailboxdata), &retries);
+
 	if (retries <= retry_limit)
 		W_SDREG(SMB_INT_ACK, &regs->tosbmailbox, retries, u32);
 	bus->f1regdata += 2;
@@ -4668,7 +4678,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
 	/* Pending interrupt indicates new device status */
 	if (bus->ipend) {
 		bus->ipend = false;
-		R_SDREG(newstatus, &regs->intstatus, retries, u32);
+		r_sdreg32(bus, &newstatus,
+			  offsetof(struct sdpcmd_regs, intstatus), &retries);
 		bus->f1regdata++;
 		if (brcmf_sdcard_regfail(bus->card))
 			newstatus = 0;
@@ -4691,7 +4702,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
 	if (intstatus & I_HMB_FC_CHANGE) {
 		intstatus &= ~I_HMB_FC_CHANGE;
 		W_SDREG(I_HMB_FC_CHANGE, &regs->intstatus, retries, u32);
-		R_SDREG(newstatus, &regs->intstatus, retries, u32);
+		r_sdreg32(bus, &newstatus,
+			  offsetof(struct sdpcmd_regs, intstatus), &retries);
 		bus->f1regdata += 2;
 		bus->fcstate =
 		    !!(newstatus & (I_HMB_FC_STATE | I_HMB_FC_CHANGE));
Signature · 1 line
1.7.1
author
#119 lore raw

PATCH 110/119 staging: brcm80211: replaced macro W_SDREG by function w_sdreg()

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Leads to more readable code and better type checking.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   74 ++++++++++++++-----------
 1 files changed, 41 insertions(+), 33 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +41 -33
index 13a319d..9ac256e 100644
@@ -847,20 +847,20 @@ r_sdreg32(struct brcmf_bus *bus, u32 *regvar, u32 reg_offset, u32 *retryvar)
 	}
 }
 
-#define W_SDREG(regval, regaddr, retryvar, typ) \
-do { \
-	retryvar = 0; \
-	do { \
-		W_REG((u32)(regaddr), regval, typ); \
-	} while (brcmf_sdcard_regfail(bus->card) && \
-		 (++retryvar <= retry_limit)); \
-	if (retryvar) { \
-		bus->regfails += (retryvar-1); \
-		if (retryvar > retry_limit) \
-			DHD_ERROR(("%s: FAILED REGISTER WRITE, LINE %d\n", \
-			__func__, __LINE__)); \
-	} \
-} while (0)
+static void
+w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar)
+{
+	*retryvar = 0;
+	do {
+		W_REG(bus->ci->buscorebase + reg_offset, regval, u32);
+	} while (brcmf_sdcard_regfail(bus->card) &&
+		 (++(*retryvar) <= retry_limit));
+	if (*retryvar) {
+		bus->regfails += (*retryvar-1);
+		if (*retryvar > retry_limit)
+			DHD_ERROR(("FAILED REGISTER WRITE %Xh\n", reg_offset));
+	}
+}
 
 #define DHD_BUS			SDIO_BUS
 
@@ -1173,7 +1173,6 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
 int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
 {
 	struct brcmf_sdio_card *card = bus->card;
-	struct sdpcmd_regs *regs = bus->regs;
 	uint retries = 0;
 
 	DHD_INFO(("brcmf_sdbrcm_bussleep: request %s (currently %s)\n",
@@ -1197,7 +1196,8 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
 		brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
 
 		/* Tell device to start using OOB wakeup */
-		W_SDREG(SMB_USE_OOB, &regs->tosbmailbox, retries, u32);
+		w_sdreg32(bus, SMB_USE_OOB,
+			  offsetof(struct sdpcmd_regs, tosbmailbox), &retries);
 		if (retries > retry_limit)
 			DHD_ERROR(("CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n"));
 
@@ -1236,9 +1236,12 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
 		brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
 
 		/* Send misc interrupt to indicate OOB not needed */
-		W_SDREG(0, &regs->tosbmailboxdata, retries, u32);
+		w_sdreg32(bus, 0, offsetof(struct sdpcmd_regs, tosbmailboxdata),
+			  &retries);
 		if (retries <= retry_limit)
-			W_SDREG(SMB_DEV_INT, &regs->tosbmailbox, retries, u32);
+			w_sdreg32(bus, SMB_DEV_INT,
+				  offsetof(struct sdpcmd_regs, tosbmailbox),
+				  &retries);
 
 		if (retries > retry_limit)
 			DHD_ERROR(("CANNOT SIGNAL CHIP TO CLEAR OOB!!\n"));
@@ -3036,7 +3039,8 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
 			bcmerror = 0;
 		}
 
-		W_SDREG(0xFFFFFFFF, &bus->regs->intstatus, retries, u32);
+		w_sdreg32(bus, 0xFFFFFFFF,
+			  offsetof(struct sdpcmd_regs, intstatus), &retries);
 
 		brcmf_sdbrcm_chip_resetcore(bus->card, bus->ci->armcorebase);
 
@@ -3169,7 +3173,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
 		tasklet_kill(&bus->tasklet);
 
 	/* Disable and clear interrupts at the chip level also */
-	W_SDREG(0, &bus->regs->hostintmask, retries, u32);
+	w_sdreg32(bus, 0, offsetof(struct sdpcmd_regs, hostintmask), &retries);
 	local_hostintmask = bus->hostintmask;
 	bus->hostintmask = 0;
 
@@ -3196,7 +3200,8 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
 			 SDIO_FUNC_ENABLE_1, NULL);
 
 	/* Clear any pending interrupts now that F2 is disabled */
-	W_SDREG(local_hostintmask, &bus->regs->intstatus, retries, u32);
+	w_sdreg32(bus, local_hostintmask,
+		  offsetof(struct sdpcmd_regs, intstatus), &retries);
 
 	/* Turn off the backplane clock (only) */
 	brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
@@ -3274,8 +3279,8 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
 	}
 
 	/* Enable function 2 (frame transfers) */
-	W_SDREG((SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT),
-		&bus->regs->tosbmailboxdata, retries, u32);
+	w_sdreg32(bus, SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT,
+		  offsetof(struct sdpcmd_regs, tosbmailboxdata), &retries);
 	enable = (SDIO_FUNC_ENABLE_1 | SDIO_FUNC_ENABLE_2);
 
 	brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
@@ -3296,9 +3301,8 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
 	if (ready == enable) {
 		/* Set up the interrupt mask and enable interrupts */
 		bus->hostintmask = HOSTINTMASK;
-		W_SDREG(bus->hostintmask,
-			(unsigned int *)CORE_BUS_REG(bus->ci->buscorebase,
-			hostintmask), retries, u32);
+		w_sdreg32(bus, bus->hostintmask,
+			  offsetof(struct sdpcmd_regs, hostintmask), &retries);
 
 		brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_WATERMARK,
 				 (u8) watermark, &err);
@@ -3356,7 +3360,6 @@ exit:
 static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
 {
 	struct brcmf_sdio_card *card = bus->card;
-	struct sdpcmd_regs *regs = bus->regs;
 	uint retries = 0;
 	u16 lastrbc;
 	u8 hi, lo;
@@ -3402,7 +3405,9 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
 
 	if (rtx) {
 		bus->rxrtx++;
-		W_SDREG(SMB_NAK, &regs->tosbmailbox, retries, u32);
+		w_sdreg32(bus, SMB_NAK,
+			  offsetof(struct sdpcmd_regs, tosbmailbox), &retries);
+
 		bus->f1regdata++;
 		if (retries <= retry_limit)
 			bus->rxskip = true;
@@ -4523,7 +4528,6 @@ deliver:
 
 static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
 {
-	struct sdpcmd_regs *regs = bus->regs;
 	u32 intstatus = 0;
 	u32 hmb_data;
 	u8 fcbits;
@@ -4536,7 +4540,8 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
 		  offsetof(struct sdpcmd_regs, tohostmailboxdata), &retries);
 
 	if (retries <= retry_limit)
-		W_SDREG(SMB_INT_ACK, &regs->tosbmailbox, retries, u32);
+		w_sdreg32(bus, SMB_INT_ACK,
+			  offsetof(struct sdpcmd_regs, tosbmailbox), &retries);
 	bus->f1regdata += 2;
 
 	/* Dongle recomposed rx frames, accept them again */
@@ -4600,7 +4605,6 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
 static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
 {
 	struct brcmf_sdio_card *card = bus->card;
-	struct sdpcmd_regs *regs = bus->regs;
 	u32 intstatus, newstatus = 0;
 	uint retries = 0;
 	uint rxlimit = brcmf_rxbound;	/* Rx frames to read before resched */
@@ -4686,7 +4690,9 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
 		newstatus &= bus->hostintmask;
 		bus->fcstate = !!(newstatus & I_HMB_FC_STATE);
 		if (newstatus) {
-			W_SDREG(newstatus, &regs->intstatus, retries, u32);
+			w_sdreg32(bus, newstatus,
+				  offsetof(struct sdpcmd_regs, intstatus),
+				  &retries);
 			bus->f1regdata++;
 		}
 	}
@@ -4701,7 +4707,9 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
 	 */
 	if (intstatus & I_HMB_FC_CHANGE) {
 		intstatus &= ~I_HMB_FC_CHANGE;
-		W_SDREG(I_HMB_FC_CHANGE, &regs->intstatus, retries, u32);
+		w_sdreg32(bus, I_HMB_FC_CHANGE,
+			  offsetof(struct sdpcmd_regs, intstatus), &retries);
+
 		r_sdreg32(bus, &newstatus,
 			  offsetof(struct sdpcmd_regs, intstatus), &retries);
 		bus->f1regdata += 2;
Signature · 1 line
1.7.1
author
#120 lore raw

PATCH 111/119 staging: brcm80211: got rid of redundant member 'regs' of struct dhd_bus

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Decreases amd64 compiler warnings.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +5 -7
index 9ac256e..9bc47a4 100644
@@ -552,8 +552,6 @@ struct brcmf_bus {
 	uint varsz;		/* Size of variables buffer */
 	u32 sbaddr;		/* Current SB window pointer (-1, invalid) */
 
-	/* SDIO core, 32 bit address on the backplane bus: */
-	struct sdpcmd_regs *regs;
 	uint sdpcmrev;		/* SDIO core revision */
 	uint armrev;		/* CPU core revision */
 	uint ramrev;		/* SOCRAM core revision */
@@ -2725,7 +2723,7 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
 
 			sd_ptr = (struct brcmf_sdreg *) params;
 
-			addr = (unsigned long)bus->regs + sd_ptr->offset;
+			addr = bus->ci->buscorebase + sd_ptr->offset;
 			size = sd_ptr->func;
 			int_val = (s32) brcmf_sdcard_reg_read(bus->card, addr,
 							      size);
@@ -2742,7 +2740,7 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
 
 			sd_ptr = (struct brcmf_sdreg *) params;
 
-			addr = (unsigned long)bus->regs + sd_ptr->offset;
+			addr = bus->ci->buscorebase + sd_ptr->offset;
 			size = sd_ptr->func;
 			brcmf_sdcard_reg_write(bus->card, addr, size,
 					       sd_ptr->value);
@@ -5610,10 +5608,10 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
 			   bus->ramsize, bus->orig_ramsize));
 	}
 
-	bus->regs = (void *)bus->ci->buscorebase;
-
 	/* Set core control so an SDIO reset does a backplane reset */
-	OR_REG((u32)&bus->regs->corecontrol, CC_BPRESEN, u32);
+	OR_REG(bus->ci->buscorebase + offsetof(struct sdpcmd_regs,
+						       corecontrol),
+	       CC_BPRESEN, u32);
 
 	brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
 
Signature · 1 line
1.7.1
author
#121 lore raw

PATCH 112/119 staging: brcm80211: removed last amd64 compiler warnings

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Warnings were due to pointer declarations being used for an address that does not reside on the CPU bus.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |    4 ++--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    6 +++---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    4 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   20 ++++++++++----------
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |    6 +++---
 5 files changed, 20 insertions(+), 20 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +2 -2
index 84d1bcd..cecb291 100644
@@ -67,7 +67,7 @@ struct brcmf_sdio_card {
 static struct brcmf_sdio_card *l_card;
 
 struct brcmf_sdio_card*
-brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
+brcmf_sdcard_attach(void *cfghdl, u32 *regsva, uint irq)
 {
 	struct brcmf_sdio_card *card;
 
@@ -88,7 +88,7 @@ brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
 
 	card->init_success = true;
 
-	*regsva = (u32 *) SI_ENUM_BASE;
+	*regsva = SI_ENUM_BASE;
 
 	/* Report the BAR, to fix if needed */
 	card->sbwad = SI_ENUM_BASE;
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +3 -3
index 45fb76e..ec7d79d 100644
@@ -68,7 +68,7 @@ EXPORT_SYMBOL(brcmf_sdio_remove);
 int brcmf_sdio_probe(struct device *dev)
 {
 	struct sdio_hc *sdhc = NULL;
-	unsigned long regs = 0;
+	u32 regs = 0;
 	struct brcmf_sdio_card *card = NULL;
 	int irq = 0;
 	u32 vendevid;
@@ -82,7 +82,7 @@ int brcmf_sdio_probe(struct device *dev)
 	}
 	sdhc->dev = (void *)dev;
 
-	card = brcmf_sdcard_attach((void *)0, (void **)&regs, irq);
+	card = brcmf_sdcard_attach((void *)0, &regs, irq);
 	if (!card) {
 		SDLX_MSG(("%s: attach failed\n", __func__));
 		goto err;
@@ -101,7 +101,7 @@ int brcmf_sdio_probe(struct device *dev)
 
 	/* try to attach to the target device */
 	sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
-				  0, 0, 0, 0, (void *)regs, card);
+				  0, 0, 0, 0, regs, card);
 	if (!sdhc->ch) {
 		SDLX_MSG(("%s: device attach failed\n", __func__));
 		goto err;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +2 -2
index 1b55e56..4c0a031 100644
@@ -694,7 +694,7 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
 		 * is supposed to give
 		 * us something we can work with.
 		 */
-		ASSERT(((u32) (pkt->data) & DMA_ALIGN_MASK) == 0);
+		ASSERT(((ulong) (pkt->data) & DMA_ALIGN_MASK) == 0);
 
 		if ((write) && (!fifo)) {
 			err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
@@ -789,7 +789,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
 			memcpy(buffer, mypkt->data, buflen_u);
 
 		brcmu_pkt_buf_free_skb(mypkt);
-	} else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
+	} else if (((ulong) (pkt->data) & DMA_ALIGN_MASK) != 0) {
 		/* Case 2: We have a packet, but it is unaligned. */
 
 		/* In this case, we cannot have a chain. */
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +10 -10
index 9bc47a4..cdc57f9 100644
@@ -884,7 +884,7 @@ static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus);
 static void brcmf_sdbrcm_disconnect(void *ptr);
 static bool brcmf_sdbrcm_chipmatch(u16 chipid);
 static bool brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card,
-				 void *regsva, u16 devid);
+				      u32 regsva, u16 devid);
 static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus, void *card);
 static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card);
 static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus);
@@ -908,7 +908,7 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus);
 static void
 brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase);
 
-static int brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, void *regs);
+static int brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs);
 
 static void
 brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio_card *card, u32 corebase);
@@ -5343,7 +5343,7 @@ static bool brcmf_sdbrcm_chipmatch(u16 chipid)
 }
 
 static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
-			   u16 slot, u16 func, uint bustype, void *regsva,
+			   u16 slot, u16 func, uint bustype, u32 regsva,
 			   void *card)
 {
 	int ret;
@@ -5374,7 +5374,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
 	DHD_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));
 
 	/* We make assumptions about address window mappings */
-	ASSERT((unsigned long)regsva == SI_ENUM_BASE);
+	ASSERT(regsva == SI_ENUM_BASE);
 
 	/* SDIO car passes venid and devid based on CIS parsing -- but
 	 * low-power start
@@ -5540,7 +5540,7 @@ fail:
 }
 
 static bool
-brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
+brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,
 			  u16 devid)
 {
 	u8 clkctl = 0;
@@ -6097,8 +6097,8 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
 
 			/* Attempt to re-attach & download */
 			if (brcmf_sdbrcm_probe_attach(bus, bus->card,
-						 (u32 *) SI_ENUM_BASE,
-						 bus->cl_devid)) {
+						      SI_ENUM_BASE,
+						      bus->cl_devid)) {
 				/* Attempt to download binary to the dongle */
 				if (brcmf_sdbrcm_probe_init(bus, bus->card)) {
 					/* Re-init bus, enable F2 transfer */
@@ -6126,7 +6126,7 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
 
 static int
 brcmf_sdbrcm_chip_recognition(struct brcmf_sdio_card *card,
-			      struct chip_info *ci, void *regs)
+			      struct chip_info *ci, u32 regs)
 {
 	u32 regdata;
 
@@ -6136,7 +6136,7 @@ brcmf_sdbrcm_chip_recognition(struct brcmf_sdio_card *card,
 	 * For different chiptypes or old sdio hosts w/o chipcommon,
 	 * other ways of recognition should be added here.
 	 */
-	ci->cccorebase = (u32)regs;
+	ci->cccorebase = regs;
 	regdata = brcmf_sdcard_reg_read(card,
 				CORE_CC_REG(ci->cccorebase, chipid), 4);
 	ci->chip = regdata & CID_ID_MASK;
@@ -6263,7 +6263,7 @@ brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase)
 }
 
 static int
-brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, void *regs)
+brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
 {
 	struct chip_info *ci;
 	int err;
drivers/staging/brcm80211/brcmfmac/sdio_host.h +3 -3
index 68a2a64..9b3c149 100644
@@ -52,8 +52,8 @@ struct brcmf_sdio_card;
  *    implementation may maintain a single "default" handle (e.g. the first or
  *    most recent one) to enable single-instance implementations to pass NULL.
  */
-extern struct brcmf_sdio_card *brcmf_sdcard_attach(void *cfghdl, void **regsva,
-					  uint irq);
+extern struct brcmf_sdio_card*
+brcmf_sdcard_attach(void *cfghdl, u32 *regsva, uint irq);
 
 /* Detach - freeup resources allocated in attach */
 extern int brcmf_sdcard_detach(struct brcmf_sdio_card *card);
@@ -174,7 +174,7 @@ extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
 struct brcmf_sdioh_driver {
 	/* attach to device */
 	void *(*attach) (u16 vend_id, u16 dev_id, u16 bus, u16 slot,
-			 u16 func, uint bustype, void *regsva, void *param);
+			 u16 func, uint bustype, u32 regsva, void *param);
 	/* detach from device */
 	void (*detach) (void *ch);
 };
Signature · 1 line
1.7.1
author
#122 lore raw

PATCH 113/119 staging: brcm80211: W_REG macro cleanup in fullmac SDIO

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. W_REG was defined the same for both big and little endian systems. Replaced W_REG on two spots with its expansion.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +5 -13
index cdc57f9..ba57481 100644
@@ -51,22 +51,13 @@
 	})
 #endif				/* __mips__ */
 
-#define W_REG(r, v, typ) do { \
-		brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), (v)); \
-	} while (0)
 #else				/* __BIG_ENDIAN */
 #define R_REG(r, typ) \
 	brcmf_sdcard_reg_read(NULL, (r), sizeof(typ))
-#define W_REG(r, v, typ) do { \
-		brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), (v)); \
-	} while (0)
 #endif				/* __BIG_ENDIAN */
 
-#define AND_REG(r, v, typ)	W_REG((r), R_REG(r, typ) & (v), typ)
-#define OR_REG(r, v, typ)	W_REG((r), R_REG(r, typ) | (v), typ)
-
-#define SET_REG(r, mask, val, typ) \
-		W_REG((r), ((R_REG(r) & ~(mask)) | (val)), typ)
+#define OR_REG(r, v, typ) \
+	brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), R_REG(r, typ) | (v))
 
 #ifdef BCMDBG
 
@@ -609,7 +600,7 @@ struct brcmf_bus {
 	uint console_addr;	/* Console address from shared struct */
 #endif				/* BCMDBG */
 
-	uint regfails;		/* Count of R_REG/W_REG failures */
+	uint regfails;		/* Count of R_REG failures */
 
 	uint clkstate;		/* State of sd and backplane clock(s) */
 	bool activity;		/* Activity flag for clock down */
@@ -850,7 +841,8 @@ w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar)
 {
 	*retryvar = 0;
 	do {
-		W_REG(bus->ci->buscorebase + reg_offset, regval, u32);
+		brcmf_sdcard_reg_write(NULL, bus->ci->buscorebase + reg_offset,
+				       sizeof(u32), regval);
 	} while (brcmf_sdcard_regfail(bus->card) &&
 		 (++(*retryvar) <= retry_limit));
 	if (*retryvar) {
Signature · 1 line
1.7.1
author
#123 lore raw

PATCH 114/119 staging: brcm80211: removed unused definitions from dhd_sdio.c

In reply to Franky Lin

From: Roland Vossen <[email protected]>

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   25 ++-----------------------
 1 files changed, 2 insertions(+), 23 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +2 -23
index ba57481..5e079b0 100644
@@ -65,11 +65,6 @@
 
 /* Trap types defined by ARM (see arminc.h) */
 
-/* Trap locations in lo memory */
-#define	TRAP_STRIDE	4
-#define FIRST_TRAP	TR_RST
-#define LAST_TRAP	(TR_FIQ * TRAP_STRIDE)
-
 #if defined(__ARM_ARCH_4T__)
 #define	MAX_TRAP_TYPE	(TR_FIQ + 1)
 #elif defined(__ARM_ARCH_7M__)
@@ -114,8 +109,6 @@ struct brcmf_trap {
 
 #define CBUF_LEN	(128)
 
-#define LOG_BUF_LEN	1024
-
 struct rte_log {
 	u32 buf;		/* Can't be pointer on (64-bit) hosts */
 	uint buf_size;
@@ -166,10 +159,6 @@ struct rte_console {
 #include "dhd_dbg.h"
 #include <bcmchip.h>
 
-#ifndef DHDSDIO_MEM_DUMP_FNAME
-#define DHDSDIO_MEM_DUMP_FNAME         "mem_dump"
-#endif
-
 #define TXQLEN		2048	/* bulk tx queue length */
 #define TXHI		(TXQLEN - 256)	/* turn on flow control above TXHI */
 #define TXLOW		(TXHI - 256)	/* turn off flow control below TXLOW */
@@ -344,7 +333,6 @@ struct rte_console {
 /* Value for ChipClockCSR during initial setup */
 #define DHD_INIT_CLKCTL1	(SBSDIO_FORCE_HW_CLKREQ_OFF |	\
 					SBSDIO_ALP_AVAIL_REQ)
-#define DHD_INIT_CLKCTL2	(SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_FORCE_ALP)
 
 /* Flags for SDH calls */
 #define F2SYNC	(SDIO_REQ_4BYTE | SDIO_REQ_FIXED)
@@ -541,11 +529,7 @@ struct brcmf_bus {
 	struct chip_info *ci;	/* Chip info struct */
 	char *vars;		/* Variables (from CIS and/or other) */
 	uint varsz;		/* Size of variables buffer */
-	u32 sbaddr;		/* Current SB window pointer (-1, invalid) */
 
-	uint sdpcmrev;		/* SDIO core revision */
-	uint armrev;		/* CPU core revision */
-	uint ramrev;		/* SOCRAM core revision */
 	u32 ramsize;		/* Size of RAM in SOCRAM (bytes) */
 	u32 orig_ramsize;	/* Size of RAM in SOCRAM (bytes) */
 
@@ -612,8 +596,6 @@ struct brcmf_bus {
 	bool sleeping;		/* Is SDIO bus sleeping? */
 	bool rxflow_mode;	/* Rx flow control mode */
 	bool rxflow;		/* Is rx flow control on */
-	uint prev_rxlim_hit;	/* Is prev rx limit exceeded
-					 (per dpc schedule) */
 	bool alp_only;		/* Don't use HT clock (ALP only) */
 /* Field to decide if rx of control frames happen in rxbuf or lb-pool */
 	bool usebufpool;
@@ -782,8 +764,6 @@ static bool retrydata;
 static const uint watermark = 8;
 static const uint firstread = BRCMF_FIRSTREAD;
 
-#define HDATLEN (firstread - (SDPCM_HDRLEN))
-
 /* Retry count for register access failures */
 static const uint retry_limit = 2;
 
@@ -5584,8 +5564,8 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,
 
 	/* Get info on the ARM and SOCRAM cores... */
 	if (!DHD_NOPMU(bus)) {
-		bus->armrev = SBCOREREV(brcmf_sdcard_reg_read(bus->card,
-			CORE_SB(bus->ci->armcorebase, sbidhigh), 4));
+		brcmf_sdcard_reg_read(bus->card,
+			  CORE_SB(bus->ci->armcorebase, sbidhigh), 4);
 		bus->orig_ramsize = bus->ci->ramsize;
 		if (!(bus->orig_ramsize)) {
 			DHD_ERROR(("%s: failed to find SOCRAM memory!\n",
@@ -5680,7 +5660,6 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card)
 	bus->drvr->busstate = DHD_BUS_DOWN;
 	bus->sleeping = false;
 	bus->rxflow = false;
-	bus->prev_rxlim_hit = 0;
 
 	/* Done with backplane-dependent accesses, can drop clock... */
 	brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0,
Signature · 1 line
1.7.1
author
#124 lore raw

PATCH 115/119 staging: brcm80211: rename structures and variables in wl_cfg80211.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Making an effort getting rid of the wl_ prefix from the fullmac source files.

---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 1246 +++++++++++----------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |  103 +--
 2 files changed, 695 insertions(+), 654 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +653 -593
index 85ff00b..5c858c5 100644
@@ -36,7 +36,7 @@
 #include "wl_cfg80211.h"
 
 static struct sdio_func *cfg80211_sdio_func;
-static struct wl_dev *wl_cfg80211_dev;
+static struct brcmf_cfg80211_dev *cfg80211_dev;
 static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
 
 u32 brcmf_dbg_level = WL_DBG_ERR;
@@ -45,34 +45,35 @@ u32 brcmf_dbg_level = WL_DBG_ERR;
 ** cfg80211_ops api/callback list
 */
 static s32 brcmf_cfg80211_change_iface(struct wiphy *wiphy,
-				      struct net_device *ndev,
-				      enum nl80211_iftype type, u32 *flags,
-				      struct vif_params *params);
+				       struct net_device *ndev,
+				       enum nl80211_iftype type, u32 *flags,
+				       struct vif_params *params);
 static s32 __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
-				struct cfg80211_scan_request *request,
-				struct cfg80211_ssid *this_ssid);
+				 struct cfg80211_scan_request *request,
+				 struct cfg80211_ssid *this_ssid);
 static s32 brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
-			      struct cfg80211_scan_request *request);
+			       struct cfg80211_scan_request *request);
 static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
 static s32 brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
-				   struct cfg80211_ibss_params *params);
+				    struct cfg80211_ibss_params *params);
 static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy,
-				    struct net_device *dev);
+				     struct net_device *dev);
 static s32 brcmf_cfg80211_get_station(struct wiphy *wiphy,
-				     struct net_device *dev, u8 *mac,
-				     struct station_info *sinfo);
+				      struct net_device *dev, u8 *mac,
+				      struct station_info *sinfo);
 static s32 brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy,
-					struct net_device *dev, bool enabled,
-					s32 timeout);
+					 struct net_device *dev, bool enabled,
+					 s32 timeout);
 static s32 brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
-					  struct net_device *dev,
-					  const u8 *addr,
-					  const struct cfg80211_bitrate_mask
-					  *mask);
+					   struct net_device *dev,
+					   const u8 *addr,
+					   const struct cfg80211_bitrate_mask
+					   *mask);
 static int brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
-			       struct cfg80211_connect_params *sme);
-static s32 brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
-				    u16 reason_code);
+				  struct cfg80211_connect_params *sme);
+static s32 brcmf_cfg80211_disconnect(struct wiphy *wiphy,
+				     struct net_device *dev,
+				     u16 reason_code);
 static s32 brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
 				      enum nl80211_tx_power_setting type,
 				      s32 dbm);
@@ -106,40 +107,47 @@ static s32 brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy,
 /*
 ** event & event Q handlers for cfg80211 interfaces
 */
-static s32 brcmf_create_event_handler(struct wl_priv *wl);
-static void brcmf_destroy_event_handler(struct wl_priv *wl);
+static s32 brcmf_create_event_handler(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_destroy_event_handler(struct brcmf_cfg80211_priv *cfg_priv);
 static s32 brcmf_event_handler(void *data);
-static void brcmf_init_eq(struct wl_priv *wl);
-static void brcmf_flush_eq(struct wl_priv *wl);
-static void brcmf_lock_eq(struct wl_priv *wl);
-static void brcmf_unlock_eq(struct wl_priv *wl);
-static void brcmf_init_eq_lock(struct wl_priv *wl);
-static void brcmf_init_eloop_handler(struct wl_event_loop *el);
-static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl);
-static s32 brcmf_enq_event(struct wl_priv *wl, u32 type,
-			   const struct brcmf_event_msg *msg, void *data);
-static void brcmf_put_event(struct wl_event_q *e);
-static void brcmf_wakeup_event(struct wl_priv *wl);
-static s32 brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
+static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_flush_eq(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_lock_eq(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_unlock_eq(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_init_eq_lock(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_init_eloop_handler(struct brcmf_cfg80211_event_loop *el);
+static struct brcmf_cfg80211_event_q *
+brcmf_deq_event(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 type,
+			  const struct brcmf_event_msg *msg, void *data);
+static void brcmf_put_event(struct brcmf_cfg80211_event_q *e);
+static void brcmf_wakeup_event(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_notify_connect_status(struct brcmf_cfg80211_priv *cfg_priv,
+				       struct net_device *ndev,
+				       const struct brcmf_event_msg *e,
+				       void *data);
+static s32 brcmf_notify_roaming_status(struct brcmf_cfg80211_priv *cfg_priv,
+				       struct net_device *ndev,
 				       const struct brcmf_event_msg *e,
 				       void *data);
-static s32 brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
+				    struct net_device *ndev,
 				    const struct brcmf_event_msg *e,
 				    void *data);
-static s32 brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
-				    const struct brcmf_event_msg *e, void *data);
-static s32 brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_bss_connect_done(struct brcmf_cfg80211_priv *cfg_priv,
+				  struct net_device *ndev,
 				  const struct brcmf_event_msg *e, void *data,
 				  bool completed);
-static s32 brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_bss_roaming_done(struct brcmf_cfg80211_priv *cfg_priv,
+				  struct net_device *ndev,
 				  const struct brcmf_event_msg *e, void *data);
-static s32 brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_notify_mic_status(struct brcmf_cfg80211_priv *cfg_priv,
+				   struct net_device *ndev,
 				   const struct brcmf_event_msg *e, void *data);
 
 /*
 ** register/deregister sdio function
 */
-struct sdio_func *wl_cfg80211_get_sdio_func(void);
 static void brcmf_clear_sdio_func(void);
 
 /*
@@ -165,10 +173,11 @@ static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l);
 /*
 ** wl profile utilities
 */
-static s32 brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e,
+static s32 brcmf_update_prof(struct brcmf_cfg80211_priv *cfg_priv,
+			     const struct brcmf_event_msg *e,
 			     void *data, s32 item);
-static void *brcmf_read_prof(struct wl_priv *wl, s32 item);
-static void brcmf_init_prof(struct wl_profile *prof);
+static void *brcmf_read_prof(struct brcmf_cfg80211_priv *cfg_priv, s32 item);
+static void brcmf_init_prof(struct brcmf_cfg80211_profile *prof);
 
 /*
 ** cfg80211 connect utilites
@@ -183,22 +192,24 @@ static s32 brcmf_set_key_mgmt(struct net_device *dev,
 			struct cfg80211_connect_params *sme);
 static s32 brcmf_set_set_sharedkey(struct net_device *dev,
 			struct cfg80211_connect_params *sme);
-static s32 brcmf_get_assoc_ies(struct wl_priv *wl);
-static void brcmf_clear_assoc_ies(struct wl_priv *wl);
+static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_clear_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv);
 static void brcmf_ch_to_chanspec(int ch,
 	struct brcmf_join_params *join_params, size_t *join_params_size);
 
 /*
 ** information element utilities
 */
-static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
+static __used s32 brcmf_add_ie(struct brcmf_cfg80211_priv *cfg_priv,
+			       u8 t, u8 l, u8 *v);
 static s32 brcmf_mode_to_nl80211_iftype(s32 mode);
 static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
 			struct device *dev);
-static void brcmf_free_wdev(struct wl_priv *wl);
-static s32 brcmf_inform_bss(struct wl_priv *wl);
-static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi);
-static s32 brcmf_update_bss_info(struct wl_priv *wl);
+static void brcmf_free_wdev(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
+				   struct brcmf_bss_info *bi);
+static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv);
 static s32 brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
 			u8 key_idx, const u8 *mac_addr,
 			struct key_params *params);
@@ -210,45 +221,48 @@ static void swap_key_from_BE(struct brcmf_wsec_key *key);
 static void swap_key_to_BE(struct brcmf_wsec_key *key);
 
 /*
-** wl_priv memory init/deinit utilities
+** brcmf_cfg80211_priv memory init/deinit utilities
 */
-static s32 brcmf_init_priv_mem(struct wl_priv *wl);
-static void brcmf_deinit_priv_mem(struct wl_priv *wl);
+static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv);
 
 static void brcmf_delay(u32 ms);
 
 /*
 ** store/restore cfg80211 instance data
 */
-static void brcmf_set_drvdata(struct wl_dev *dev, void *data);
-static void *brcmf_get_drvdata(struct wl_dev *dev);
+static void brcmf_set_drvdata(struct brcmf_cfg80211_dev *dev, void *data);
+static void *brcmf_get_drvdata(struct brcmf_cfg80211_dev *dev);
 
 /*
 ** ibss mode utilities
 */
-static bool brcmf_is_ibssmode(struct wl_priv *wl);
+static bool brcmf_is_ibssmode(struct brcmf_cfg80211_priv *cfg_priv);
 
 /*
 ** dongle up/down , default configuration utilities
 */
-static bool brcmf_is_linkdown(struct wl_priv *wl, const struct brcmf_event_msg *e);
-static bool brcmf_is_linkup(struct wl_priv *wl, const struct brcmf_event_msg *e);
-static bool brcmf_is_nonetwork(struct wl_priv *wl,
+static bool brcmf_is_linkdown(struct brcmf_cfg80211_priv *cfg_priv,
+			      const struct brcmf_event_msg *e);
+static bool brcmf_is_linkup(struct brcmf_cfg80211_priv *cfg_priv,
+			    const struct brcmf_event_msg *e);
+static bool brcmf_is_nonetwork(struct brcmf_cfg80211_priv *cfg_priv,
 			       const struct brcmf_event_msg *e);
-static void brcmf_link_down(struct wl_priv *wl);
+static void brcmf_link_down(struct brcmf_cfg80211_priv *cfg_priv);
 static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype);
-static s32 __brcmf_cfg80211_up(struct wl_priv *wl);
-static s32 __brcmf_cfg80211_down(struct wl_priv *wl);
-static s32 brcmf_dongle_probecap(struct wl_priv *wl);
-static void brcmf_init_conf(struct wl_conf *conf);
+static s32 __brcmf_cfg80211_up(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 __brcmf_cfg80211_down(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_dongle_probecap(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_init_conf(struct brcmf_cfg80211_conf *conf);
 
 /*
 ** dongle configuration utilities
 */
 static s32 brcmf_dongle_eventmsg(struct net_device *ndev);
 static s32 brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
-				s32 scan_unassoc_time, s32 scan_passive_time);
-static s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock);
+				 s32 scan_unassoc_time, s32 scan_passive_time);
+static s32 brcmf_config_dongle(struct brcmf_cfg80211_priv *cfg_priv,
+			       bool need_lock);
 static s32 brcmf_dongle_roam(struct net_device *ndev, u32 roamvar,
 			    u32 bcn_timeout);
 
@@ -256,8 +270,8 @@ static s32 brcmf_dongle_roam(struct net_device *ndev, u32 roamvar,
 ** iscan handler
 */
 static void brcmf_iscan_timer(unsigned long data);
-static void brcmf_term_iscan(struct wl_priv *wl);
-static s32 brcmf_init_iscan(struct wl_priv *wl);
+static void brcmf_term_iscan(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv);
 static s32 brcmf_iscan_thread(void *data);
 static s32 brcmf_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
 				 void *param, s32 paramlen, void *bufptr,
@@ -265,19 +279,21 @@ static s32 brcmf_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
 static s32 brcmf_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
 				 void *param, s32 paramlen, void *bufptr,
 				 s32 buflen);
-static s32 brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid,
-			  u16 action);
-static s32 brcmf_do_iscan(struct wl_priv *wl);
-static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan);
-static s32 brcmf_invoke_iscan(struct wl_priv *wl);
-static s32 brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
-				  struct brcmf_scan_results **bss_list);
-static void brcmf_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted);
-static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el);
-static s32 brcmf_iscan_done(struct wl_priv *wl);
-static s32 brcmf_iscan_pending(struct wl_priv *wl);
-static s32 brcmf_iscan_inprogress(struct wl_priv *wl);
-static s32 brcmf_iscan_aborted(struct wl_priv *wl);
+static s32 brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
+			   struct brcmf_ssid *ssid, u16 action);
+static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_wakeup_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan);
+static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan,
+				   u32 *status,
+				   struct brcmf_scan_results **bss_list);
+static void brcmf_notify_iscan_complete(struct brcmf_cfg80211_iscan_ctrl *iscan,
+					bool aborted);
+static void brcmf_init_iscan_eloop(struct brcmf_cfg80211_iscan_eloop *el);
+static s32 brcmf_iscan_done(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_iscan_pending(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_iscan_inprogress(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_iscan_aborted(struct brcmf_cfg80211_priv *cfg_priv);
 
 /*
 * find most significant bit set
@@ -288,19 +304,21 @@ static __used u32 brcmf_find_msb(u16 bit16);
 * update pmklist to dongle
 */
 static __used s32 brcmf_update_pmklist(struct net_device *dev,
-				      struct wl_pmk_list *pmk_list, s32 err);
+				       struct brcmf_cfg80211_pmk_list *pmk_list,
+				       s32 err);
 
 static void brcmf_set_mpc(struct net_device *ndev, int mpc);
 
 /*
 * debufs support
 */
-static int brcmf_debugfs_add_netdev_params(struct wl_priv *wl);
-static void brcmf_debugfs_remove_netdev(struct wl_priv *wl);
+static int
+brcmf_debugfs_add_netdev_params(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_debugfs_remove_netdev(struct brcmf_cfg80211_priv *cfg_priv);
 
 #define WL_PRIV_GET()							\
 	({								\
-	struct wl_iface *ci = brcmf_get_drvdata(wl_cfg80211_dev);		\
+	struct brcmf_cfg80211_iface *ci = brcmf_get_drvdata(cfg80211_dev); \
 	if (unlikely(!ci)) {						\
 		WL_ERR("wl_cfg80211_dev is unavailable\n");		\
 		BUG();							\
@@ -310,10 +328,10 @@ static void brcmf_debugfs_remove_netdev(struct wl_priv *wl);
 
 #define CHECK_SYS_UP()							\
 do {									\
-	struct wl_priv *wl = wiphy_to_wl(wiphy);			\
-	if (unlikely(!test_bit(WL_STATUS_READY, &wl->status))) {	\
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);	\
+	if (unlikely(!test_bit(WL_STATUS_READY, &cfg_priv->status))) {	\
 		WL_INFO("device is not ready : status (%d)\n",		\
-			(int)wl->status);				\
+			(int)cfg_priv->status);				\
 		return -EIO;						\
 	}								\
 } while (0)
@@ -543,7 +561,7 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
 			 enum nl80211_iftype type, u32 *flags,
 			 struct vif_params *params)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 	struct wireless_dev *wdev;
 	s32 infra = 0;
 	s32 err = 0;
@@ -558,11 +576,11 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
 		       type);
 		return -EOPNOTSUPP;
 	case NL80211_IFTYPE_ADHOC:
-		wl->conf->mode = WL_MODE_IBSS;
+		cfg_priv->conf->mode = WL_MODE_IBSS;
 		infra = 0;
 		break;
 	case NL80211_IFTYPE_STATION:
-		wl->conf->mode = WL_MODE_BSS;
+		cfg_priv->conf->mode = WL_MODE_BSS;
 		infra = 1;
 		break;
 	default:
@@ -581,7 +599,7 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
 	}
 
 	WL_INFO("IF Type = %s\n",
-		(wl->conf->mode == WL_MODE_IBSS) ? "Adhoc" : "Infra");
+		(cfg_priv->conf->mode == WL_MODE_IBSS) ? "Adhoc" : "Infra");
 
 done:
 	WL_TRACE("Exit\n");
@@ -635,7 +653,8 @@ brcmf_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
 }
 
 static s32
-brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
+brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
+		struct brcmf_ssid *ssid, u16 action)
 {
 	s32 params_size = (BRCMF_SCAN_PARAMS_FIXED_SIZE +
 				offsetof(struct brcmf_iscan_params, params));
@@ -669,10 +688,10 @@ brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action
 	return err;
 }
 
-static s32 brcmf_do_iscan(struct wl_priv *wl)
+static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
-	struct net_device *ndev = wl_to_ndev(wl);
+	struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
+	struct net_device *ndev = wl_to_ndev(cfg_priv);
 	struct brcmf_ssid ssid;
 	s32 passive_scan;
 	s32 err = 0;
@@ -682,15 +701,15 @@ static s32 brcmf_do_iscan(struct wl_priv *wl)
 
 	iscan->state = WL_ISCAN_STATE_SCANING;
 
-	passive_scan = wl->active_scan ? 0 : 1;
-	err = brcmf_dev_ioctl(wl_to_ndev(wl), BRCMF_C_SET_PASSIVE_SCAN,
+	passive_scan = cfg_priv->active_scan ? 0 : 1;
+	err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), BRCMF_C_SET_PASSIVE_SCAN,
 			&passive_scan, sizeof(passive_scan));
 	if (unlikely(err)) {
 		WL_ERR("error (%d)\n", err);
 		return err;
 	}
 	brcmf_set_mpc(ndev, 0);
-	wl->iscan_kickstart = true;
+	cfg_priv->iscan_kickstart = true;
 	brcmf_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START);
 	mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
 	iscan->timer_on = 1;
@@ -703,26 +722,26 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 		   struct cfg80211_scan_request *request,
 		   struct cfg80211_ssid *this_ssid)
 {
-	struct wl_priv *wl = ndev_to_wl(ndev);
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
 	struct cfg80211_ssid *ssids;
-	struct wl_scan_req *sr = wl_to_sr(wl);
+	struct brcmf_cfg80211_scan_req *sr = wl_to_sr(cfg_priv);
 	s32 passive_scan;
 	bool iscan_req;
 	bool spec_scan;
 	s32 err = 0;
 
-	if (unlikely(test_bit(WL_STATUS_SCANNING, &wl->status))) {
-		WL_ERR("Scanning already : status (%d)\n", (int)wl->status);
+	if (unlikely(test_bit(WL_STATUS_SCANNING, &cfg_priv->status))) {
+		WL_ERR("Scanning already : status (%lu)\n", cfg_priv->status);
 		return -EAGAIN;
 	}
-	if (unlikely(test_bit(WL_STATUS_SCAN_ABORTING, &wl->status))) {
-		WL_ERR("Scanning being aborted : status (%d)\n",
-		       (int)wl->status);
+	if (unlikely(test_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status))) {
+		WL_ERR("Scanning being aborted : status (%lu)\n",
+		       cfg_priv->status);
 		return -EAGAIN;
 	}
-	if (test_bit(WL_STATUS_CONNECTING, &wl->status)) {
-		WL_ERR("Connecting : status (%d)\n",
-		       (int)wl->status);
+	if (test_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) {
+		WL_ERR("Connecting : status (%lu)\n",
+		       cfg_priv->status);
 		return -EAGAIN;
 	}
 
@@ -731,7 +750,7 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 	if (request) {
 		/* scan bss */
 		ssids = request->ssids;
-		if (wl->iscan_on && (!ssids || !ssids->ssid_len))
+		if (cfg_priv->iscan_on && (!ssids || !ssids->ssid_len))
 			iscan_req = true;
 	} else {
 		/* scan in ibss */
@@ -739,10 +758,10 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 		ssids = this_ssid;
 	}
 
-	wl->scan_request = request;
-	set_bit(WL_STATUS_SCANNING, &wl->status);
+	cfg_priv->scan_request = request;
+	set_bit(WL_STATUS_SCANNING, &cfg_priv->status);
 	if (iscan_req) {
-		err = brcmf_do_iscan(wl);
+		err = brcmf_do_iscan(cfg_priv);
 		if (likely(!err))
 			return err;
 		else
@@ -761,7 +780,7 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 			WL_SCAN("Broadcast scan\n");
 		}
 
-		passive_scan = wl->active_scan ? 0 : 1;
+		passive_scan = cfg_priv->active_scan ? 0 : 1;
 		err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_PASSIVE_SCAN,
 				&passive_scan, sizeof(passive_scan));
 		if (unlikely(err)) {
@@ -786,8 +805,8 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
 	return 0;
 
 scan_out:
-	clear_bit(WL_STATUS_SCANNING, &wl->status);
-	wl->scan_request = NULL;
+	clear_bit(WL_STATUS_SCANNING, &cfg_priv->status);
+	cfg_priv->scan_request = NULL;
 	return err;
 }
 
@@ -889,38 +908,38 @@ static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l)
 
 static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
-	struct net_device *ndev = wl_to_ndev(wl);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+	struct net_device *ndev = wl_to_ndev(cfg_priv);
 	s32 err = 0;
 
 	WL_TRACE("Enter\n");
 	CHECK_SYS_UP();
 
 	if (changed & WIPHY_PARAM_RTS_THRESHOLD &&
-	    (wl->conf->rts_threshold != wiphy->rts_threshold)) {
-		wl->conf->rts_threshold = wiphy->rts_threshold;
-		err = brcmf_set_rts(ndev, wl->conf->rts_threshold);
+	    (cfg_priv->conf->rts_threshold != wiphy->rts_threshold)) {
+		cfg_priv->conf->rts_threshold = wiphy->rts_threshold;
+		err = brcmf_set_rts(ndev, cfg_priv->conf->rts_threshold);
 		if (!err)
 			goto done;
 	}
 	if (changed & WIPHY_PARAM_FRAG_THRESHOLD &&
-	    (wl->conf->frag_threshold != wiphy->frag_threshold)) {
-		wl->conf->frag_threshold = wiphy->frag_threshold;
-		err = brcmf_set_frag(ndev, wl->conf->frag_threshold);
+	    (cfg_priv->conf->frag_threshold != wiphy->frag_threshold)) {
+		cfg_priv->conf->frag_threshold = wiphy->frag_threshold;
+		err = brcmf_set_frag(ndev, cfg_priv->conf->frag_threshold);
 		if (!err)
 			goto done;
 	}
 	if (changed & WIPHY_PARAM_RETRY_LONG
-	    && (wl->conf->retry_long != wiphy->retry_long)) {
-		wl->conf->retry_long = wiphy->retry_long;
-		err = brcmf_set_retry(ndev, wl->conf->retry_long, true);
+	    && (cfg_priv->conf->retry_long != wiphy->retry_long)) {
+		cfg_priv->conf->retry_long = wiphy->retry_long;
+		err = brcmf_set_retry(ndev, cfg_priv->conf->retry_long, true);
 		if (!err)
 			goto done;
 	}
 	if (changed & WIPHY_PARAM_RETRY_SHORT
-	    && (wl->conf->retry_short != wiphy->retry_short)) {
-		wl->conf->retry_short = wiphy->retry_short;
-		err = brcmf_set_retry(ndev, wl->conf->retry_short, false);
+	    && (cfg_priv->conf->retry_short != wiphy->retry_short)) {
+		cfg_priv->conf->retry_short = wiphy->retry_short;
+		err = brcmf_set_retry(ndev, cfg_priv->conf->retry_short, false);
 		if (!err)
 			goto done;
 	}
@@ -934,7 +953,7 @@ static s32
 brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 		      struct cfg80211_ibss_params *params)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 	struct brcmf_join_params join_params;
 	size_t join_params_size = 0;
 	s32 err = 0;
@@ -951,7 +970,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 		return -EOPNOTSUPP;
 	}
 
-	set_bit(WL_STATUS_CONNECTING, &wl->status);
+	set_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
 
 	if (params->bssid)
 		WL_CONN("BSSID: %02X %02X %02X %02X %02X %02X\n",
@@ -1021,7 +1040,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 	memcpy(join_params.ssid.SSID, params->ssid, join_params.ssid.SSID_len);
 	join_params.ssid.SSID_len = cpu_to_le32(join_params.ssid.SSID_len);
 	join_params_size = sizeof(join_params.ssid);
-	brcmf_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
+	brcmf_update_prof(cfg_priv, NULL, &join_params.ssid, WL_PROF_SSID);
 
 	/* BSSID */
 	if (params->bssid) {
@@ -1031,23 +1050,24 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 	} else {
 		memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN);
 	}
-	brcmf_update_prof(wl, NULL, &join_params.params.bssid, WL_PROF_BSSID);
+	brcmf_update_prof(cfg_priv, NULL,
+			  &join_params.params.bssid, WL_PROF_BSSID);
 
 	/* Channel */
 	if (params->channel) {
 		u32 target_channel;
 
-		wl->channel =
+		cfg_priv->channel =
 			ieee80211_frequency_to_channel(
 				params->channel->center_freq);
 		if (params->channel_fixed) {
 			/* adding chanspec */
-			brcmf_ch_to_chanspec(wl->channel,
+			brcmf_ch_to_chanspec(cfg_priv->channel,
 				&join_params, &join_params_size);
 		}
 
 		/* set channel for starter */
-		target_channel = cpu_to_le32(wl->channel);
+		target_channel = cpu_to_le32(cfg_priv->channel);
 		err = brcmf_dev_ioctl(dev, WLC_SET_CHANNEL,
 			&target_channel, sizeof(target_channel));
 		if (unlikely(err)) {
@@ -1055,9 +1075,9 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 			goto done;
 		}
 	} else
-		wl->channel = 0;
+		cfg_priv->channel = 0;
 
-	wl->ibss_starter = false;
+	cfg_priv->ibss_starter = false;
 
 
 	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
@@ -1069,20 +1089,20 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 
 done:
 	if (err)
-		clear_bit(WL_STATUS_CONNECTING, &wl->status);
+		clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
 	WL_TRACE("Exit\n");
 	return err;
 }
 
 static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 	s32 err = 0;
 
 	WL_TRACE("Enter\n");
 	CHECK_SYS_UP();
 
-	brcmf_link_down(wl);
+	brcmf_link_down(cfg_priv);
 
 	WL_TRACE("Exit\n");
 
@@ -1092,8 +1112,8 @@ static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev
 static s32
 brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
 {
-	struct wl_priv *wl = ndev_to_wl(dev);
-	struct wl_security *sec;
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+	struct brcmf_cfg80211_security *sec;
 	s32 val = 0;
 	s32 err = 0;
 
@@ -1109,7 +1129,7 @@ brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sm
 		WL_ERR("set wpa_auth failed (%d)\n", err);
 		return err;
 	}
-	sec = brcmf_read_prof(wl, WL_PROF_SEC);
+	sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
 	sec->wpa_versions = sme->crypto.wpa_versions;
 	return err;
 }
@@ -1117,8 +1137,8 @@ brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sm
 static s32
 brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
 {
-	struct wl_priv *wl = ndev_to_wl(dev);
-	struct wl_security *sec;
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+	struct brcmf_cfg80211_security *sec;
 	s32 val = 0;
 	s32 err = 0;
 
@@ -1148,7 +1168,7 @@ brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
 		WL_ERR("set auth failed (%d)\n", err);
 		return err;
 	}
-	sec = brcmf_read_prof(wl, WL_PROF_SEC);
+	sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
 	sec->auth_type = sme->auth_type;
 	return err;
 }
@@ -1156,8 +1176,8 @@ brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
 static s32
 brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
 {
-	struct wl_priv *wl = ndev_to_wl(dev);
-	struct wl_security *sec;
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+	struct brcmf_cfg80211_security *sec;
 	s32 pval = 0;
 	s32 gval = 0;
 	s32 err = 0;
@@ -1212,7 +1232,7 @@ brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme
 		return err;
 	}
 
-	sec = brcmf_read_prof(wl, WL_PROF_SEC);
+	sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
 	sec->cipher_pairwise = sme->crypto.ciphers_pairwise[0];
 	sec->cipher_group = sme->crypto.cipher_group;
 
@@ -1222,8 +1242,8 @@ brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme
 static s32
 brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
 {
-	struct wl_priv *wl = ndev_to_wl(dev);
-	struct wl_security *sec;
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+	struct brcmf_cfg80211_security *sec;
 	s32 val = 0;
 	s32 err = 0;
 
@@ -1268,7 +1288,7 @@ brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
 			return err;
 		}
 	}
-	sec = brcmf_read_prof(wl, WL_PROF_SEC);
+	sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
 	sec->wpa_auth = sme->crypto.akm_suites[0];
 
 	return err;
@@ -1278,15 +1298,15 @@ static s32
 brcmf_set_set_sharedkey(struct net_device *dev,
 		     struct cfg80211_connect_params *sme)
 {
-	struct wl_priv *wl = ndev_to_wl(dev);
-	struct wl_security *sec;
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+	struct brcmf_cfg80211_security *sec;
 	struct brcmf_wsec_key key;
 	s32 val;
 	s32 err = 0;
 
 	WL_CONN("key len (%d)\n", sme->key_len);
 	if (sme->key_len) {
-		sec = brcmf_read_prof(wl, WL_PROF_SEC);
+		sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
 		WL_CONN("wpa_versions 0x%x cipher_pairwise 0x%x\n",
 		       sec->wpa_versions, sec->cipher_pairwise);
 		if (!
@@ -1344,7 +1364,7 @@ static s32
 brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 		    struct cfg80211_connect_params *sme)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 	struct ieee80211_channel *chan = sme->channel;
 	struct brcmf_join_params join_params;
 	size_t join_params_size;
@@ -1359,15 +1379,15 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 		return -EOPNOTSUPP;
 	}
 
-	set_bit(WL_STATUS_CONNECTING, &wl->status);
+	set_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
 
 	if (chan) {
-		wl->channel =
+		cfg_priv->channel =
 			ieee80211_frequency_to_channel(chan->center_freq);
 		WL_CONN("channel (%d), center_req (%d)\n",
-			wl->channel, chan->center_freq);
+				cfg_priv->channel, chan->center_freq);
 	} else
-		wl->channel = 0;
+		cfg_priv->channel = 0;
 
 	WL_INFO("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len);
 
@@ -1401,7 +1421,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 		goto done;
 	}
 
-	brcmf_update_prof(wl, NULL, sme->bssid, WL_PROF_BSSID);
+	brcmf_update_prof(cfg_priv, NULL, sme->bssid, WL_PROF_BSSID);
 	/*
 	 **  Join with specific BSSID and cached SSID
 	 **  If SSID is zero join based on BSSID only
@@ -1412,7 +1432,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 	join_params.ssid.SSID_len = min(sizeof(join_params.ssid.SSID), sme->ssid_len);
 	memcpy(&join_params.ssid.SSID, sme->ssid, join_params.ssid.SSID_len);
 	join_params.ssid.SSID_len = cpu_to_le32(join_params.ssid.SSID_len);
-	brcmf_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
+	brcmf_update_prof(cfg_priv, NULL, &join_params.ssid, WL_PROF_SSID);
 
 	if (sme->bssid)
 		memcpy(join_params.params.bssid, sme->bssid, ETH_ALEN);
@@ -1424,7 +1444,8 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 		       join_params.ssid.SSID, join_params.ssid.SSID_len);
 	}
 
-	brcmf_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
+	brcmf_ch_to_chanspec(cfg_priv->channel,
+			     &join_params, &join_params_size);
 	err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
 			   &join_params, join_params_size);
 	if (err)
@@ -1432,7 +1453,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 
 done:
 	if (err)
-		clear_bit(WL_STATUS_CONNECTING, &wl->status);
+		clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
 	WL_TRACE("Exit\n");
 	return err;
 }
@@ -1441,24 +1462,24 @@ static s32
 brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
 		       u16 reason_code)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 	struct brcmf_scb_val scbval;
 	s32 err = 0;
 
 	WL_TRACE("Enter. Reason code = %d\n", reason_code);
 	CHECK_SYS_UP();
 
-	clear_bit(WL_STATUS_CONNECTED, &wl->status);
+	clear_bit(WL_STATUS_CONNECTED, &cfg_priv->status);
 
 	scbval.val = reason_code;
-	memcpy(&scbval.ea, brcmf_read_prof(wl, WL_PROF_BSSID), ETH_ALEN);
+	memcpy(&scbval.ea, brcmf_read_prof(cfg_priv, WL_PROF_BSSID), ETH_ALEN);
 	scbval.val = cpu_to_le32(scbval.val);
 	err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
 			sizeof(struct brcmf_scb_val));
 	if (unlikely(err))
 		WL_ERR("error (%d)\n", err);
 
-	wl->link_up = false;
+	cfg_priv->link_up = false;
 
 	WL_TRACE("Exit\n");
 	return err;
@@ -1469,8 +1490,8 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
 			 enum nl80211_tx_power_setting type, s32 dbm)
 {
 
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
-	struct net_device *ndev = wl_to_ndev(wl);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+	struct net_device *ndev = wl_to_ndev(cfg_priv);
 	u16 txpwrmw;
 	s32 err = 0;
 	s32 disable = 0;
@@ -1511,7 +1532,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
 			(s32) (brcmu_mw_to_qdbm(txpwrmw)));
 	if (unlikely(err))
 		WL_ERR("qtxpower error (%d)\n", err);
-	wl->conf->tx_power = dbm;
+	cfg_priv->conf->tx_power = dbm;
 
 done:
 	WL_TRACE("Exit\n");
@@ -1520,8 +1541,8 @@ done:
 
 static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
-	struct net_device *ndev = wl_to_ndev(wl);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+	struct net_device *ndev = wl_to_ndev(cfg_priv);
 	s32 txpwrdbm;
 	u8 result;
 	s32 err = 0;
@@ -1829,8 +1850,8 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
 {
 	struct key_params params;
 	struct brcmf_wsec_key key;
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
-	struct wl_security *sec;
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_security *sec;
 	s32 wsec;
 	s32 err = 0;
 
@@ -1855,7 +1876,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
 	wsec = le32_to_cpu(wsec);
 	switch (wsec) {
 	case WEP_ENABLED:
-		sec = brcmf_read_prof(wl, WL_PROF_SEC);
+		sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
 		if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) {
 			params.cipher = WLAN_CIPHER_SUITE_WEP40;
 			WL_CONN("WLAN_CIPHER_SUITE_WEP40\n");
@@ -1898,12 +1919,12 @@ static s32
 brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 			u8 *mac, struct station_info *sinfo)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 	struct brcmf_scb_val scb_val;
 	int rssi;
 	s32 rate;
 	s32 err = 0;
-	u8 *bssid = brcmf_read_prof(wl, WL_PROF_BSSID);
+	u8 *bssid = brcmf_read_prof(cfg_priv, WL_PROF_BSSID);
 
 	WL_TRACE("Enter\n");
 	CHECK_SYS_UP();
@@ -1930,7 +1951,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 		WL_CONN("Rate %d Mbps\n", rate / 2);
 	}
 
-	if (test_bit(WL_STATUS_CONNECTED, &wl->status)) {
+	if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) {
 		scb_val.val = 0;
 		err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
 				sizeof(struct brcmf_scb_val));
@@ -2061,7 +2082,7 @@ done:
 
 static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 
 	/*
 	 * Check for WL_STATUS_READY before any function call which
@@ -2074,17 +2095,18 @@ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
 	atomic_set(&brcmf_mmc_suspend, false);
 #endif	/*  defined(CONFIG_PM_SLEEP) */
 
-	if (test_bit(WL_STATUS_READY, &wl->status))
+	if (test_bit(WL_STATUS_READY, &cfg_priv->status))
 		brcmf_invoke_iscan(wiphy_to_wl(wiphy));
 
 	WL_TRACE("Exit\n");
 	return 0;
 }
 
-static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
+static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
+				  struct cfg80211_wowlan *wow)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
-	struct net_device *ndev = wl_to_ndev(wl);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+	struct net_device *ndev = wl_to_ndev(cfg_priv);
 
 	WL_TRACE("Enter\n");
 
@@ -2098,12 +2120,12 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *w
 	 * While going to suspend if associated with AP disassociate
 	 * from AP to save power while system is in suspended state
 	 */
-	if ((test_bit(WL_STATUS_CONNECTED, &wl->status) ||
-	     test_bit(WL_STATUS_CONNECTING, &wl->status)) &&
-	     test_bit(WL_STATUS_READY, &wl->status)) {
+	if ((test_bit(WL_STATUS_CONNECTED, &cfg_priv->status) ||
+	     test_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) &&
+	     test_bit(WL_STATUS_READY, &cfg_priv->status)) {
 		WL_INFO("Disassociating from AP"
 			" while entering suspend state\n");
-		brcmf_link_down(wl);
+		brcmf_link_down(cfg_priv);
 
 		/*
 		 * Make sure WPA_Supplicant receives all the event
@@ -2115,21 +2137,21 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *w
 		rtnl_lock();
 	}
 
-	set_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
-	if (test_bit(WL_STATUS_READY, &wl->status))
-		brcmf_term_iscan(wl);
+	set_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status);
+	if (test_bit(WL_STATUS_READY, &cfg_priv->status))
+		brcmf_term_iscan(cfg_priv);
 
-	if (wl->scan_request) {
+	if (cfg_priv->scan_request) {
 		/* Indidate scan abort to cfg80211 layer */
 		WL_INFO("Terminating scan in progress\n");
-		cfg80211_scan_done(wl->scan_request, true);
-		wl->scan_request = NULL;
+		cfg80211_scan_done(cfg_priv->scan_request, true);
+		cfg_priv->scan_request = NULL;
 	}
-	clear_bit(WL_STATUS_SCANNING, &wl->status);
-	clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
+	clear_bit(WL_STATUS_SCANNING, &cfg_priv->status);
+	clear_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status);
 
 	/* Turn off watchdog timer */
-	if (test_bit(WL_STATUS_READY, &wl->status)) {
+	if (test_bit(WL_STATUS_READY, &cfg_priv->status)) {
 		WL_INFO("Enable MPC\n");
 		brcmf_set_mpc(ndev, 1);
 	}
@@ -2144,8 +2166,8 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *w
 }
 
 static __used s32
-brcmf_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
-		  s32 err)
+brcmf_update_pmklist(struct net_device *dev,
+		     struct brcmf_cfg80211_pmk_list *pmk_list, s32 err)
 {
 	int i, j;
 
@@ -2166,37 +2188,33 @@ brcmf_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
 
 static s32
 brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
-		      struct cfg80211_pmksa *pmksa)
+			 struct cfg80211_pmksa *pmksa)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+	struct _pmkid_list *pmkids = &cfg_priv->pmk_list->pmkids;
 	s32 err = 0;
 	int i;
 
 	WL_TRACE("Enter\n");
 	CHECK_SYS_UP();
 
-	for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
-		if (!memcmp(pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID,
-			    ETH_ALEN))
+	for (i = 0; i < pmkids->npmkid; i++)
+		if (!memcmp(pmksa->bssid, pmkids->pmkid[i].BSSID, ETH_ALEN))
 			break;
 	if (i < WL_NUM_PMKIDS_MAX) {
-		memcpy(&wl->pmk_list->pmkids.pmkid[i].BSSID, pmksa->bssid,
-		       ETH_ALEN);
-		memcpy(&wl->pmk_list->pmkids.pmkid[i].PMKID, pmksa->pmkid,
-		       WLAN_PMKID_LEN);
-		if (i == wl->pmk_list->pmkids.npmkid)
-			wl->pmk_list->pmkids.npmkid++;
+		memcpy(pmkids->pmkid[i].BSSID, pmksa->bssid, ETH_ALEN);
+		memcpy(pmkids->pmkid[i].PMKID, pmksa->pmkid, WLAN_PMKID_LEN);
+		if (i == pmkids->npmkid)
+			pmkids->npmkid++;
 	} else
 		err = -EINVAL;
 
 	WL_CONN("set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n",
-	       &wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].BSSID);
+		pmkids->pmkid[pmkids->npmkid].BSSID);
 	for (i = 0; i < WLAN_PMKID_LEN; i++)
-		WL_CONN("%02x\n",
-		       wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].
-		       PMKID[i]);
+		WL_CONN("%02x\n", pmkids->pmkid[pmkids->npmkid].PMKID[i]);
 
-	err = brcmf_update_pmklist(dev, wl->pmk_list, err);
+	err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
 
 	WL_TRACE("Exit\n");
 	return err;
@@ -2206,7 +2224,7 @@ static s32
 brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
 		      struct cfg80211_pmksa *pmksa)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 	struct _pmkid_list pmkid;
 	s32 err = 0;
 	int i;
@@ -2221,28 +2239,29 @@ brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
 	for (i = 0; i < WLAN_PMKID_LEN; i++)
 		WL_CONN("%02x\n", pmkid.pmkid[0].PMKID[i]);
 
-	for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
+	for (i = 0; i < cfg_priv->pmk_list->pmkids.npmkid; i++)
 		if (!memcmp
-		    (pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID,
+		    (pmksa->bssid, &cfg_priv->pmk_list->pmkids.pmkid[i].BSSID,
 		     ETH_ALEN))
 			break;
 
-	if ((wl->pmk_list->pmkids.npmkid > 0)
-	    && (i < wl->pmk_list->pmkids.npmkid)) {
-		memset(&wl->pmk_list->pmkids.pmkid[i], 0, sizeof(pmkid_t));
-		for (; i < (wl->pmk_list->pmkids.npmkid - 1); i++) {
-			memcpy(&wl->pmk_list->pmkids.pmkid[i].BSSID,
-			       &wl->pmk_list->pmkids.pmkid[i + 1].BSSID,
+	if ((cfg_priv->pmk_list->pmkids.npmkid > 0)
+	    && (i < cfg_priv->pmk_list->pmkids.npmkid)) {
+		memset(&cfg_priv->pmk_list->pmkids.pmkid[i], 0,
+		       sizeof(pmkid_t));
+		for (; i < (cfg_priv->pmk_list->pmkids.npmkid - 1); i++) {
+			memcpy(&cfg_priv->pmk_list->pmkids.pmkid[i].BSSID,
+			       &cfg_priv->pmk_list->pmkids.pmkid[i + 1].BSSID,
 			       ETH_ALEN);
-			memcpy(&wl->pmk_list->pmkids.pmkid[i].PMKID,
-			       &wl->pmk_list->pmkids.pmkid[i + 1].PMKID,
+			memcpy(&cfg_priv->pmk_list->pmkids.pmkid[i].PMKID,
+			       &cfg_priv->pmk_list->pmkids.pmkid[i + 1].PMKID,
 			       WLAN_PMKID_LEN);
 		}
-		wl->pmk_list->pmkids.npmkid--;
+		cfg_priv->pmk_list->pmkids.npmkid--;
 	} else
 		err = -EINVAL;
 
-	err = brcmf_update_pmklist(dev, wl->pmk_list, err);
+	err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
 
 	WL_TRACE("Exit\n");
 	return err;
@@ -2252,14 +2271,14 @@ brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
 static s32
 brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
 {
-	struct wl_priv *wl = wiphy_to_wl(wiphy);
+	struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
 	s32 err = 0;
 
 	WL_TRACE("Enter\n");
 	CHECK_SYS_UP();
 
-	memset(wl->pmk_list, 0, sizeof(*wl->pmk_list));
-	err = brcmf_update_pmklist(dev, wl->pmk_list, err);
+	memset(cfg_priv->pmk_list, 0, sizeof(*cfg_priv->pmk_list));
+	err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
 
 	WL_TRACE("Exit\n");
 	return err;
@@ -2319,7 +2338,8 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
 		return ERR_PTR(-ENOMEM);
 	}
 	wdev->wiphy =
-	    wiphy_new(&wl_cfg80211_ops, sizeof(struct wl_priv) + sizeof_iface);
+	    wiphy_new(&wl_cfg80211_ops,
+		      sizeof(struct brcmf_cfg80211_priv) + sizeof_iface);
 	if (unlikely(!wdev->wiphy)) {
 		WL_ERR("Couldn not allocate wiphy device\n");
 		err = -ENOMEM;
@@ -2365,9 +2385,9 @@ wiphy_new_out:
 	return ERR_PTR(err);
 }
 
-static void brcmf_free_wdev(struct wl_priv *wl)
+static void brcmf_free_wdev(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wireless_dev *wdev = wl_to_wdev(wl);
+	struct wireless_dev *wdev = wl_to_wdev(cfg_priv);
 
 	if (unlikely(!wdev)) {
 		WL_ERR("wdev is invalid\n");
@@ -2376,17 +2396,17 @@ static void brcmf_free_wdev(struct wl_priv *wl)
 	wiphy_unregister(wdev->wiphy);
 	wiphy_free(wdev->wiphy);
 	kfree(wdev);
-	wl_to_wdev(wl) = NULL;
+	wl_to_wdev(cfg_priv) = NULL;
 }
 
-static s32 brcmf_inform_bss(struct wl_priv *wl)
+static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	struct brcmf_scan_results *bss_list;
 	struct brcmf_bss_info *bi = NULL;	/* must be initialized */
 	s32 err = 0;
 	int i;
 
-	bss_list = wl->bss_list;
+	bss_list = cfg_priv->bss_list;
 	if (unlikely(bss_list->version != BRCMF_BSS_INFO_VERSION)) {
 		WL_ERR("Version %d != WL_BSS_INFO_VERSION\n",
 		       bss_list->version);
@@ -2395,7 +2415,7 @@ static s32 brcmf_inform_bss(struct wl_priv *wl)
 	WL_SCAN("scanned AP count (%d)\n", bss_list->count);
 	bi = next_bss(bss_list, bi);
 	for_each_bss(bss_list, bi, i) {
-		err = brcmf_inform_single_bss(wl, bi);
+		err = brcmf_inform_single_bss(cfg_priv, bi);
 		if (unlikely(err))
 			break;
 	}
@@ -2403,9 +2423,10 @@ static s32 brcmf_inform_bss(struct wl_priv *wl)
 }
 
 
-static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi)
+static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
+				   struct brcmf_bss_info *bi)
 {
-	struct wiphy *wiphy = wl_to_wiphy(wl);
+	struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
 	struct ieee80211_channel *notify_channel;
 	struct cfg80211_bss *bss;
 	struct ieee80211_supported_band *band;
@@ -2463,10 +2484,10 @@ static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi
 	return err;
 }
 
-static s32
-wl_inform_ibss(struct wl_priv *wl, struct net_device *dev, const u8 *bssid)
+static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
+			  struct net_device *dev, const u8 *bssid)
 {
-	struct wiphy *wiphy = wl_to_wiphy(wl);
+	struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
 	struct ieee80211_channel *notify_channel;
 	struct brcmf_bss_info *bi = NULL;
 	struct ieee80211_supported_band *band;
@@ -2537,21 +2558,23 @@ CleanUp:
 	return err;
 }
 
-static bool brcmf_is_linkup(struct wl_priv *wl, const struct brcmf_event_msg *e)
+static bool brcmf_is_linkup(struct brcmf_cfg80211_priv *cfg_priv,
+			    const struct brcmf_event_msg *e)
 {
 	u32 event = be32_to_cpu(e->event_type);
 	u32 status = be32_to_cpu(e->status);
 
 	if (event == BRCMF_E_SET_SSID && status == BRCMF_E_STATUS_SUCCESS) {
 		WL_CONN("Processing set ssid\n");
-		wl->link_up = true;
+		cfg_priv->link_up = true;
 		return true;
 	}
 
 	return false;
 }
 
-static bool brcmf_is_linkdown(struct wl_priv *wl, const struct brcmf_event_msg *e)
+static bool brcmf_is_linkdown(struct brcmf_cfg80211_priv *cfg_priv,
+			      const struct brcmf_event_msg *e)
 {
 	u32 event = be32_to_cpu(e->event_type);
 	u16 flags = be16_to_cpu(e->flags);
@@ -2563,7 +2586,8 @@ static bool brcmf_is_linkdown(struct wl_priv *wl, const struct brcmf_event_msg *
 	return false;
 }
 
-static bool brcmf_is_nonetwork(struct wl_priv *wl, const struct brcmf_event_msg *e)
+static bool brcmf_is_nonetwork(struct brcmf_cfg80211_priv *cfg_priv,
+			       const struct brcmf_event_msg *e)
 {
 	u32 event = be32_to_cpu(e->event_type);
 	u32 status = be32_to_cpu(e->status);
@@ -2584,51 +2608,53 @@ static bool brcmf_is_nonetwork(struct wl_priv *wl, const struct brcmf_event_msg
 }
 
 static s32
-brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_connect_status(struct brcmf_cfg80211_priv *cfg_priv,
+			    struct net_device *ndev,
 			    const struct brcmf_event_msg *e, void *data)
 {
 	s32 err = 0;
 
-	if (brcmf_is_linkup(wl, e)) {
+	if (brcmf_is_linkup(cfg_priv, e)) {
 		WL_CONN("Linkup\n");
-		if (brcmf_is_ibssmode(wl)) {
-			brcmf_update_prof(wl, NULL, (void *)e->addr,
+		if (brcmf_is_ibssmode(cfg_priv)) {
+			brcmf_update_prof(cfg_priv, NULL, (void *)e->addr,
 				WL_PROF_BSSID);
-			wl_inform_ibss(wl, ndev, e->addr);
+			wl_inform_ibss(cfg_priv, ndev, e->addr);
 			cfg80211_ibss_joined(ndev, e->addr, GFP_KERNEL);
-			clear_bit(WL_STATUS_CONNECTING, &wl->status);
-			set_bit(WL_STATUS_CONNECTED, &wl->status);
+			clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
+			set_bit(WL_STATUS_CONNECTED, &cfg_priv->status);
 		} else
-			brcmf_bss_connect_done(wl, ndev, e, data, true);
-	} else if (brcmf_is_linkdown(wl, e)) {
+			brcmf_bss_connect_done(cfg_priv, ndev, e, data, true);
+	} else if (brcmf_is_linkdown(cfg_priv, e)) {
 		WL_CONN("Linkdown\n");
-		if (brcmf_is_ibssmode(wl)) {
-			clear_bit(WL_STATUS_CONNECTING, &wl->status);
+		if (brcmf_is_ibssmode(cfg_priv)) {
+			clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
 			if (test_and_clear_bit(WL_STATUS_CONNECTED,
-				&wl->status))
-				brcmf_link_down(wl);
+				&cfg_priv->status))
+				brcmf_link_down(cfg_priv);
 		} else {
-			brcmf_bss_connect_done(wl, ndev, e, data, false);
+			brcmf_bss_connect_done(cfg_priv, ndev, e, data, false);
 			if (test_and_clear_bit(WL_STATUS_CONNECTED,
-				&wl->status)) {
+				&cfg_priv->status)) {
 				cfg80211_disconnected(ndev, 0, NULL, 0,
 					GFP_KERNEL);
-				brcmf_link_down(wl);
+				brcmf_link_down(cfg_priv);
 			}
 		}
-		brcmf_init_prof(wl->profile);
-	} else if (brcmf_is_nonetwork(wl, e)) {
-		if (brcmf_is_ibssmode(wl))
-			clear_bit(WL_STATUS_CONNECTING, &wl->status);
+		brcmf_init_prof(cfg_priv->profile);
+	} else if (brcmf_is_nonetwork(cfg_priv, e)) {
+		if (brcmf_is_ibssmode(cfg_priv))
+			clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
 		else
-			brcmf_bss_connect_done(wl, ndev, e, data, false);
+			brcmf_bss_connect_done(cfg_priv, ndev, e, data, false);
 	}
 
 	return err;
 }
 
 static s32
-brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_roaming_status(struct brcmf_cfg80211_priv *cfg_priv,
+			    struct net_device *ndev,
 			    const struct brcmf_event_msg *e, void *data)
 {
 	s32 err = 0;
@@ -2636,10 +2662,10 @@ brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
 	u32 status = be32_to_cpu(e->status);
 
 	if (event == BRCMF_E_ROAM && status == BRCMF_E_STATUS_SUCCESS) {
-		if (test_bit(WL_STATUS_CONNECTED, &wl->status))
-			brcmf_bss_roaming_done(wl, ndev, e, data);
+		if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status))
+			brcmf_bss_roaming_done(cfg_priv, ndev, e, data);
 		else
-			brcmf_bss_connect_done(wl, ndev, e, data, true);
+			brcmf_bss_connect_done(cfg_priv, ndev, e, data, true);
 	}
 
 	return err;
@@ -2648,80 +2674,87 @@ brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
 static __used s32
 brcmf_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
 {
-	struct wl_priv *wl = ndev_to_wl(dev);
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
 	u32 buflen;
 
-	buflen = brcmu_mkiovar(name, buf, len, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
+	buflen = brcmu_mkiovar(name, buf, len, cfg_priv->ioctl_buf,
+			       WL_IOCTL_LEN_MAX);
 	BUG_ON(!buflen);
 
-	return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, wl->ioctl_buf, buflen);
+	return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, cfg_priv->ioctl_buf,
+			       buflen);
 }
 
 static s32
 brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
 		  s32 buf_len)
 {
-	struct wl_priv *wl = ndev_to_wl(dev);
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
 	u32 len;
 	s32 err = 0;
 
-	len = brcmu_mkiovar(name, NULL, 0, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
+	len = brcmu_mkiovar(name, NULL, 0, cfg_priv->ioctl_buf,
+			    WL_IOCTL_LEN_MAX);
 	BUG_ON(!len);
-	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)wl->ioctl_buf,
+	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)cfg_priv->ioctl_buf,
 			WL_IOCTL_LEN_MAX);
 	if (unlikely(err)) {
 		WL_ERR("error (%d)\n", err);
 		return err;
 	}
-	memcpy(buf, wl->ioctl_buf, buf_len);
+	memcpy(buf, cfg_priv->ioctl_buf, buf_len);
 
 	return err;
 }
 
-static s32 brcmf_get_assoc_ies(struct wl_priv *wl)
+static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct net_device *ndev = wl_to_ndev(wl);
-	struct wl_assoc_ielen *assoc_info;
-	struct wl_connect_info *conn_info = wl_to_conn(wl);
+	struct net_device *ndev = wl_to_ndev(cfg_priv);
+	struct brcmf_cfg80211_assoc_ielen *assoc_info;
+	struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
 	u32 req_len;
 	u32 resp_len;
 	s32 err = 0;
 
-	brcmf_clear_assoc_ies(wl);
+	brcmf_clear_assoc_ies(cfg_priv);
 
-	err = brcmf_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf,
+	err = brcmf_dev_bufvar_get(ndev, "assoc_info", cfg_priv->extra_buf,
 				WL_ASSOC_INFO_MAX);
 	if (unlikely(err)) {
 		WL_ERR("could not get assoc info (%d)\n", err);
 		return err;
 	}
-	assoc_info = (struct wl_assoc_ielen *)wl->extra_buf;
+	assoc_info = (struct brcmf_cfg80211_assoc_ielen *)cfg_priv->extra_buf;
 	req_len = assoc_info->req_len;
 	resp_len = assoc_info->resp_len;
 	if (req_len) {
-		err = brcmf_dev_bufvar_get(ndev, "assoc_req_ies", wl->extra_buf,
-					WL_ASSOC_INFO_MAX);
+		err = brcmf_dev_bufvar_get(ndev, "assoc_req_ies",
+					   cfg_priv->extra_buf,
+					   WL_ASSOC_INFO_MAX);
 		if (unlikely(err)) {
 			WL_ERR("could not get assoc req (%d)\n", err);
 			return err;
 		}
 		conn_info->req_ie_len = req_len;
 		conn_info->req_ie =
-		    kmemdup(wl->extra_buf, conn_info->req_ie_len, GFP_KERNEL);
+		    kmemdup(cfg_priv->extra_buf, conn_info->req_ie_len,
+			    GFP_KERNEL);
 	} else {
 		conn_info->req_ie_len = 0;
 		conn_info->req_ie = NULL;
 	}
 	if (resp_len) {
-		err = brcmf_dev_bufvar_get(ndev, "assoc_resp_ies", wl->extra_buf,
-					WL_ASSOC_INFO_MAX);
+		err = brcmf_dev_bufvar_get(ndev, "assoc_resp_ies",
+					   cfg_priv->extra_buf,
+					   WL_ASSOC_INFO_MAX);
 		if (unlikely(err)) {
 			WL_ERR("could not get assoc resp (%d)\n", err);
 			return err;
 		}
 		conn_info->resp_ie_len = resp_len;
 		conn_info->resp_ie =
-		    kmemdup(wl->extra_buf, conn_info->resp_ie_len, GFP_KERNEL);
+		    kmemdup(cfg_priv->extra_buf, conn_info->resp_ie_len,
+			    GFP_KERNEL);
 	} else {
 		conn_info->resp_ie_len = 0;
 		conn_info->resp_ie = NULL;
@@ -2732,9 +2765,9 @@ static s32 brcmf_get_assoc_ies(struct wl_priv *wl)
 	return err;
 }
 
-static void brcmf_clear_assoc_ies(struct wl_priv *wl)
+static void brcmf_clear_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_connect_info *conn_info = wl_to_conn(wl);
+	struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
 
 	kfree(conn_info->req_ie);
 	conn_info->req_ie = NULL;
@@ -2779,7 +2812,7 @@ static void brcmf_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
 	}
 }
 
-static s32 brcmf_update_bss_info(struct wl_priv *wl)
+static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	struct brcmf_bss_info *bi;
 	struct brcmf_ssid *ssid;
@@ -2791,21 +2824,21 @@ static s32 brcmf_update_bss_info(struct wl_priv *wl)
 	s32 err = 0;
 
 	WL_TRACE("Enter\n");
-	if (brcmf_is_ibssmode(wl))
+	if (brcmf_is_ibssmode(cfg_priv))
 		return err;
 
-	ssid = (struct brcmf_ssid *)brcmf_read_prof(wl, WL_PROF_SSID);
+	ssid = (struct brcmf_ssid *)brcmf_read_prof(cfg_priv, WL_PROF_SSID);
 
-	*(u32 *)wl->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
-	err = brcmf_dev_ioctl(wl_to_ndev(wl), BRCMF_C_GET_BSS_INFO,
-			wl->extra_buf, WL_EXTRA_BUF_MAX);
+	*(u32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
+	err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
+			cfg_priv->extra_buf, WL_EXTRA_BUF_MAX);
 	if (unlikely(err)) {
 		WL_ERR("Could not get bss info %d\n", err);
 		goto update_bss_info_out;
 	}
 
-	bi = (struct brcmf_bss_info *)(wl->extra_buf + 4);
-	err = brcmf_inform_single_bss(wl, bi);
+	bi = (struct brcmf_bss_info *)(cfg_priv->extra_buf + 4);
+	err = brcmf_inform_single_bss(cfg_priv, bi);
 	if (unlikely(err))
 		goto update_bss_info_out;
 
@@ -2823,7 +2856,8 @@ static s32 brcmf_update_bss_info(struct wl_priv *wl)
 		* so we speficially query dtim information to dongle.
 		*/
 		u32 var;
-		err = brcmf_dev_intvar_get(wl_to_ndev(wl), "dtim_assoc", &var);
+		err = brcmf_dev_intvar_get(wl_to_ndev(cfg_priv),
+					   "dtim_assoc", &var);
 		if (unlikely(err)) {
 			WL_ERR("wl dtim_assoc failed (%d)\n", err);
 			goto update_bss_info_out;
@@ -2831,8 +2865,8 @@ static s32 brcmf_update_bss_info(struct wl_priv *wl)
 		dtim_period = (u8)var;
 	}
 
-	brcmf_update_prof(wl, NULL, &beacon_interval, WL_PROF_BEACONINT);
-	brcmf_update_prof(wl, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
+	brcmf_update_prof(cfg_priv, NULL, &beacon_interval, WL_PROF_BEACONINT);
+	brcmf_update_prof(cfg_priv, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
 
 update_bss_info_out:
 	WL_TRACE("Exit");
@@ -2840,54 +2874,59 @@ update_bss_info_out:
 }
 
 static s32
-brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+brcmf_bss_roaming_done(struct brcmf_cfg80211_priv *cfg_priv,
+		       struct net_device *ndev,
 		       const struct brcmf_event_msg *e, void *data)
 {
-	struct wl_connect_info *conn_info = wl_to_conn(wl);
+	struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
 	s32 err = 0;
 
 	WL_TRACE("Enter\n");
 
-	brcmf_get_assoc_ies(wl);
-	brcmf_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
-	brcmf_update_bss_info(wl);
+	brcmf_get_assoc_ies(cfg_priv);
+	brcmf_update_prof(cfg_priv, NULL, &e->addr, WL_PROF_BSSID);
+	brcmf_update_bss_info(cfg_priv);
 
 	cfg80211_roamed(ndev, NULL,
-			(u8 *)brcmf_read_prof(wl, WL_PROF_BSSID),
+			(u8 *)brcmf_read_prof(cfg_priv, WL_PROF_BSSID),
 			conn_info->req_ie, conn_info->req_ie_len,
 			conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
 	WL_CONN("Report roaming result\n");
 
-	set_bit(WL_STATUS_CONNECTED, &wl->status);
+	set_bit(WL_STATUS_CONNECTED, &cfg_priv->status);
 	WL_TRACE("Exit\n");
 	return err;
 }
 
 static s32
-brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
-		       const struct brcmf_event_msg *e, void *data, bool completed)
+brcmf_bss_connect_done(struct brcmf_cfg80211_priv *cfg_priv,
+		       struct net_device *ndev, const struct brcmf_event_msg *e,
+		       void *data, bool completed)
 {
-	struct wl_connect_info *conn_info = wl_to_conn(wl);
+	struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
 	s32 err = 0;
 
 	WL_TRACE("Enter\n");
 
-	if (test_and_clear_bit(WL_STATUS_CONNECTING, &wl->status)) {
+	if (test_and_clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) {
 		if (completed) {
-			brcmf_get_assoc_ies(wl);
-			brcmf_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
-			brcmf_update_bss_info(wl);
+			brcmf_get_assoc_ies(cfg_priv);
+			brcmf_update_prof(cfg_priv, NULL, &e->addr,
+					  WL_PROF_BSSID);
+			brcmf_update_bss_info(cfg_priv);
 		}
 		cfg80211_connect_result(ndev,
-					(u8 *)brcmf_read_prof(wl, WL_PROF_BSSID),
+					(u8 *)brcmf_read_prof(cfg_priv,
+							      WL_PROF_BSSID),
 					conn_info->req_ie,
 					conn_info->req_ie_len,
 					conn_info->resp_ie,
 					conn_info->resp_ie_len,
-					completed ? WLAN_STATUS_SUCCESS : WLAN_STATUS_AUTH_TIMEOUT,
+					completed ? WLAN_STATUS_SUCCESS :
+						    WLAN_STATUS_AUTH_TIMEOUT,
 					GFP_KERNEL);
 		if (completed)
-			set_bit(WL_STATUS_CONNECTED, &wl->status);
+			set_bit(WL_STATUS_CONNECTED, &cfg_priv->status);
 		WL_CONN("Report connect result - connection %s\n",
 				completed ? "succeeded" : "failed");
 	}
@@ -2896,7 +2935,8 @@ brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
 }
 
 static s32
-brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_mic_status(struct brcmf_cfg80211_priv *cfg_priv,
+			struct net_device *ndev,
 			const struct brcmf_event_msg *e, void *data)
 {
 	u16 flags = be16_to_cpu(e->flags);
@@ -2916,7 +2956,8 @@ brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
 }
 
 static s32
-brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
+			 struct net_device *ndev,
 			 const struct brcmf_event_msg *e, void *data)
 {
 	struct brcmf_channel_info channel_inform;
@@ -2927,12 +2968,13 @@ brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 
 	WL_TRACE("Enter\n");
 
-	if (wl->iscan_on && wl->iscan_kickstart) {
+	if (cfg_priv->iscan_on && cfg_priv->iscan_kickstart) {
 		WL_TRACE("Exit\n");
-		return brcmf_wakeup_iscan(wl_to_iscan(wl));
+		return brcmf_wakeup_iscan(wl_to_iscan(cfg_priv));
 	}
 
-	if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) {
+	if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
+					 &cfg_priv->status))) {
 		WL_ERR("Scan complete while device not scanning\n");
 		scan_abort = true;
 		err = -EINVAL;
@@ -2952,8 +2994,8 @@ brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 		WL_CONN("channel_inform.scan_channel (%d)\n",
 		       channel_inform.scan_channel);
 	}
-	wl->bss_list = wl->scan_results;
-	bss_list = wl->bss_list;
+	cfg_priv->bss_list = cfg_priv->scan_results;
+	bss_list = cfg_priv->bss_list;
 	memset(bss_list, 0, len);
 	bss_list->buflen = cpu_to_le32(len);
 
@@ -2968,18 +3010,18 @@ brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
 	bss_list->version = le32_to_cpu(bss_list->version);
 	bss_list->count = le32_to_cpu(bss_list->count);
 
-	err = brcmf_inform_bss(wl);
+	err = brcmf_inform_bss(cfg_priv);
 	if (err) {
 		scan_abort = true;
 		goto scan_done_out;
 	}
 
 scan_done_out:
-	if (wl->scan_request) {
+	if (cfg_priv->scan_request) {
 		WL_SCAN("calling cfg80211_scan_done\n");
-		cfg80211_scan_done(wl->scan_request, scan_abort);
+		cfg80211_scan_done(cfg_priv->scan_request, scan_abort);
 		brcmf_set_mpc(ndev, 1);
-		wl->scan_request = NULL;
+		cfg_priv->scan_request = NULL;
 	}
 
 	WL_TRACE("Exit\n");
@@ -2987,7 +3029,7 @@ scan_done_out:
 	return err;
 }
 
-static void brcmf_init_conf(struct wl_conf *conf)
+static void brcmf_init_conf(struct brcmf_cfg80211_conf *conf)
 {
 	conf->mode = (u32)-1;
 	conf->frag_threshold = (u32)-1;
@@ -2997,12 +3039,12 @@ static void brcmf_init_conf(struct wl_conf *conf)
 	conf->tx_power = -1;
 }
 
-static void brcmf_init_prof(struct wl_profile *prof)
+static void brcmf_init_prof(struct brcmf_cfg80211_profile *prof)
 {
 	memset(prof, 0, sizeof(*prof));
 }
 
-static void brcmf_init_eloop_handler(struct wl_event_loop *el)
+static void brcmf_init_eloop_handler(struct brcmf_cfg80211_event_loop *el)
 {
 	memset(el, 0, sizeof(*el));
 	el->handler[BRCMF_E_SCAN_COMPLETE] = brcmf_notify_scan_status;
@@ -3012,50 +3054,51 @@ static void brcmf_init_eloop_handler(struct wl_event_loop *el)
 	el->handler[BRCMF_E_SET_SSID] = brcmf_notify_connect_status;
 }
 
-static s32 brcmf_init_priv_mem(struct wl_priv *wl)
+static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	wl->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
-	if (unlikely(!wl->scan_results)) {
+	cfg_priv->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
+	if (unlikely(!cfg_priv->scan_results)) {
 		WL_ERR("Scan results alloc failed\n");
 		goto init_priv_mem_out;
 	}
-	wl->conf = kzalloc(sizeof(*wl->conf), GFP_KERNEL);
-	if (unlikely(!wl->conf)) {
+	cfg_priv->conf = kzalloc(sizeof(*cfg_priv->conf), GFP_KERNEL);
+	if (unlikely(!cfg_priv->conf)) {
 		WL_ERR("wl_conf alloc failed\n");
 		goto init_priv_mem_out;
 	}
-	wl->profile = kzalloc(sizeof(*wl->profile), GFP_KERNEL);
-	if (unlikely(!wl->profile)) {
+	cfg_priv->profile = kzalloc(sizeof(*cfg_priv->profile), GFP_KERNEL);
+	if (unlikely(!cfg_priv->profile)) {
 		WL_ERR("wl_profile alloc failed\n");
 		goto init_priv_mem_out;
 	}
-	wl->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
-	if (unlikely(!wl->bss_info)) {
+	cfg_priv->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
+	if (unlikely(!cfg_priv->bss_info)) {
 		WL_ERR("Bss information alloc failed\n");
 		goto init_priv_mem_out;
 	}
-	wl->scan_req_int = kzalloc(sizeof(*wl->scan_req_int), GFP_KERNEL);
-	if (unlikely(!wl->scan_req_int)) {
+	cfg_priv->scan_req_int = kzalloc(sizeof(*cfg_priv->scan_req_int),
+					 GFP_KERNEL);
+	if (unlikely(!cfg_priv->scan_req_int)) {
 		WL_ERR("Scan req alloc failed\n");
 		goto init_priv_mem_out;
 	}
-	wl->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL);
-	if (unlikely(!wl->ioctl_buf)) {
+	cfg_priv->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL);
+	if (unlikely(!cfg_priv->ioctl_buf)) {
 		WL_ERR("Ioctl buf alloc failed\n");
 		goto init_priv_mem_out;
 	}
-	wl->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
-	if (unlikely(!wl->extra_buf)) {
+	cfg_priv->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
+	if (unlikely(!cfg_priv->extra_buf)) {
 		WL_ERR("Extra buf alloc failed\n");
 		goto init_priv_mem_out;
 	}
-	wl->iscan = kzalloc(sizeof(*wl->iscan), GFP_KERNEL);
-	if (unlikely(!wl->iscan)) {
+	cfg_priv->iscan = kzalloc(sizeof(*cfg_priv->iscan), GFP_KERNEL);
+	if (unlikely(!cfg_priv->iscan)) {
 		WL_ERR("Iscan buf alloc failed\n");
 		goto init_priv_mem_out;
 	}
-	wl->pmk_list = kzalloc(sizeof(*wl->pmk_list), GFP_KERNEL);
-	if (unlikely(!wl->pmk_list)) {
+	cfg_priv->pmk_list = kzalloc(sizeof(*cfg_priv->pmk_list), GFP_KERNEL);
+	if (unlikely(!cfg_priv->pmk_list)) {
 		WL_ERR("pmk list alloc failed\n");
 		goto init_priv_mem_out;
 	}
@@ -3063,59 +3106,60 @@ static s32 brcmf_init_priv_mem(struct wl_priv *wl)
 	return 0;
 
 init_priv_mem_out:
-	brcmf_deinit_priv_mem(wl);
+	brcmf_deinit_priv_mem(cfg_priv);
 
 	return -ENOMEM;
 }
 
-static void brcmf_deinit_priv_mem(struct wl_priv *wl)
-{
-	kfree(wl->scan_results);
-	wl->scan_results = NULL;
-	kfree(wl->bss_info);
-	wl->bss_info = NULL;
-	kfree(wl->conf);
-	wl->conf = NULL;
-	kfree(wl->profile);
-	wl->profile = NULL;
-	kfree(wl->scan_req_int);
-	wl->scan_req_int = NULL;
-	kfree(wl->ioctl_buf);
-	wl->ioctl_buf = NULL;
-	kfree(wl->extra_buf);
-	wl->extra_buf = NULL;
-	kfree(wl->iscan);
-	wl->iscan = NULL;
-	kfree(wl->pmk_list);
-	wl->pmk_list = NULL;
-}
-
-static s32 brcmf_create_event_handler(struct wl_priv *wl)
-{
-	sema_init(&wl->event_sync, 0);
-	wl->event_tsk = kthread_run(brcmf_event_handler, wl, "wl_event_handler");
-	if (IS_ERR(wl->event_tsk)) {
-		wl->event_tsk = NULL;
+static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
+{
+	kfree(cfg_priv->scan_results);
+	cfg_priv->scan_results = NULL;
+	kfree(cfg_priv->bss_info);
+	cfg_priv->bss_info = NULL;
+	kfree(cfg_priv->conf);
+	cfg_priv->conf = NULL;
+	kfree(cfg_priv->profile);
+	cfg_priv->profile = NULL;
+	kfree(cfg_priv->scan_req_int);
+	cfg_priv->scan_req_int = NULL;
+	kfree(cfg_priv->ioctl_buf);
+	cfg_priv->ioctl_buf = NULL;
+	kfree(cfg_priv->extra_buf);
+	cfg_priv->extra_buf = NULL;
+	kfree(cfg_priv->iscan);
+	cfg_priv->iscan = NULL;
+	kfree(cfg_priv->pmk_list);
+	cfg_priv->pmk_list = NULL;
+}
+
+static s32 brcmf_create_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
+{
+	sema_init(&cfg_priv->event_sync, 0);
+	cfg_priv->event_tsk = kthread_run(brcmf_event_handler, cfg_priv,
+					  "wl_event_handler");
+	if (IS_ERR(cfg_priv->event_tsk)) {
+		cfg_priv->event_tsk = NULL;
 		WL_ERR("failed to create event thread\n");
 		return -ENOMEM;
 	}
 	return 0;
 }
 
-static void brcmf_destroy_event_handler(struct wl_priv *wl)
+static void brcmf_destroy_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	if (wl->event_tsk) {
-		send_sig(SIGTERM, wl->event_tsk, 1);
-		kthread_stop(wl->event_tsk);
-		wl->event_tsk = NULL;
+	if (cfg_priv->event_tsk) {
+		send_sig(SIGTERM, cfg_priv->event_tsk, 1);
+		kthread_stop(cfg_priv->event_tsk);
+		cfg_priv->event_tsk = NULL;
 	}
 }
 
-static void brcmf_term_iscan(struct wl_priv *wl)
+static void brcmf_term_iscan(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
+	struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
 
-	if (wl->iscan_on && iscan->tsk) {
+	if (cfg_priv->iscan_on && iscan->tsk) {
 		iscan->state = WL_ISCAN_STATE_IDLE;
 		send_sig(SIGTERM, iscan->tsk, 1);
 		kthread_stop(iscan->tsk);
@@ -3123,26 +3167,28 @@ static void brcmf_term_iscan(struct wl_priv *wl)
 	}
 }
 
-static void brcmf_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
+static void brcmf_notify_iscan_complete(struct brcmf_cfg80211_iscan_ctrl *iscan,
+					bool aborted)
 {
-	struct wl_priv *wl = iscan_to_wl(iscan);
-	struct net_device *ndev = wl_to_ndev(wl);
+	struct brcmf_cfg80211_priv *cfg_priv = iscan_to_wl(iscan);
+	struct net_device *ndev = wl_to_ndev(cfg_priv);
 
-	if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) {
+	if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
+					 &cfg_priv->status))) {
 		WL_ERR("Scan complete while device not scanning\n");
 		return;
 	}
-	if (likely(wl->scan_request)) {
+	if (likely(cfg_priv->scan_request)) {
 		WL_SCAN("ISCAN Completed scan: %s\n",
 				aborted ? "Aborted" : "Done");
-		cfg80211_scan_done(wl->scan_request, aborted);
+		cfg80211_scan_done(cfg_priv->scan_request, aborted);
 		brcmf_set_mpc(ndev, 1);
-		wl->scan_request = NULL;
+		cfg_priv->scan_request = NULL;
 	}
-	wl->iscan_kickstart = false;
+	cfg_priv->iscan_kickstart = false;
 }
 
-static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan)
+static s32 brcmf_wakeup_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan)
 {
 	if (likely(iscan->state != WL_ISCAN_STATE_IDLE)) {
 		WL_SCAN("wake up iscan\n");
@@ -3154,7 +3200,7 @@ static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan)
 }
 
 static s32
-brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
+brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan, u32 *status,
 		     struct brcmf_scan_results **bss_list)
 {
 	struct brcmf_iscan_results list;
@@ -3189,23 +3235,23 @@ brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
 	return err;
 }
 
-static s32 brcmf_iscan_done(struct wl_priv *wl)
+static s32 brcmf_iscan_done(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_iscan_ctrl *iscan = wl->iscan;
+	struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_priv->iscan;
 	s32 err = 0;
 
 	iscan->state = WL_ISCAN_STATE_IDLE;
 	rtnl_lock();
-	brcmf_inform_bss(wl);
+	brcmf_inform_bss(cfg_priv);
 	brcmf_notify_iscan_complete(iscan, false);
 	rtnl_unlock();
 
 	return err;
 }
 
-static s32 brcmf_iscan_pending(struct wl_priv *wl)
+static s32 brcmf_iscan_pending(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_iscan_ctrl *iscan = wl->iscan;
+	struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_priv->iscan;
 	s32 err = 0;
 
 	/* Reschedule the timer */
@@ -3215,13 +3261,13 @@ static s32 brcmf_iscan_pending(struct wl_priv *wl)
 	return err;
 }
 
-static s32 brcmf_iscan_inprogress(struct wl_priv *wl)
+static s32 brcmf_iscan_inprogress(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_iscan_ctrl *iscan = wl->iscan;
+	struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_priv->iscan;
 	s32 err = 0;
 
 	rtnl_lock();
-	brcmf_inform_bss(wl);
+	brcmf_inform_bss(cfg_priv);
 	brcmf_run_iscan(iscan, NULL, BRCMF_SCAN_ACTION_CONTINUE);
 	rtnl_unlock();
 	/* Reschedule the timer */
@@ -3231,9 +3277,9 @@ static s32 brcmf_iscan_inprogress(struct wl_priv *wl)
 	return err;
 }
 
-static s32 brcmf_iscan_aborted(struct wl_priv *wl)
+static s32 brcmf_iscan_aborted(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_iscan_ctrl *iscan = wl->iscan;
+	struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_priv->iscan;
 	s32 err = 0;
 
 	iscan->state = WL_ISCAN_STATE_IDLE;
@@ -3247,9 +3293,10 @@ static s32 brcmf_iscan_aborted(struct wl_priv *wl)
 static s32 brcmf_iscan_thread(void *data)
 {
 	struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
-	struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
-	struct wl_priv *wl = iscan_to_wl(iscan);
-	struct wl_iscan_eloop *el = &iscan->el;
+	struct brcmf_cfg80211_iscan_ctrl *iscan =
+			(struct brcmf_cfg80211_iscan_ctrl *)data;
+	struct brcmf_cfg80211_priv *cfg_priv = iscan_to_wl(iscan);
+	struct brcmf_cfg80211_iscan_eloop *el = &iscan->el;
 	u32 status;
 	int err = 0;
 
@@ -3264,13 +3311,14 @@ static s32 brcmf_iscan_thread(void *data)
 			iscan->timer_on = 0;
 		}
 		rtnl_lock();
-		err = brcmf_get_iscan_results(iscan, &status, &wl->bss_list);
+		err = brcmf_get_iscan_results(iscan, &status,
+					      &cfg_priv->bss_list);
 		if (unlikely(err)) {
 			status = BRCMF_SCAN_RESULTS_ABORTED;
 			WL_ERR("Abort iscan\n");
 		}
 		rtnl_unlock();
-		el->handler[status] (wl);
+		el->handler[status](cfg_priv);
 	}
 	if (iscan->timer_on) {
 		del_timer_sync(&iscan->timer);
@@ -3283,7 +3331,8 @@ static s32 brcmf_iscan_thread(void *data)
 
 static void brcmf_iscan_timer(unsigned long data)
 {
-	struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
+	struct brcmf_cfg80211_iscan_ctrl *iscan =
+			(struct brcmf_cfg80211_iscan_ctrl *)data;
 
 	if (iscan) {
 		iscan->timer_on = 0;
@@ -3292,12 +3341,12 @@ static void brcmf_iscan_timer(unsigned long data)
 	}
 }
 
-static s32 brcmf_invoke_iscan(struct wl_priv *wl)
+static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
+	struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
 	int err = 0;
 
-	if (wl->iscan_on && !iscan->tsk) {
+	if (cfg_priv->iscan_on && !iscan->tsk) {
 		iscan->state = WL_ISCAN_STATE_IDLE;
 		sema_init(&iscan->sync, 0);
 		iscan->tsk = kthread_run(brcmf_iscan_thread, iscan, "wl_iscan");
@@ -3311,7 +3360,7 @@ static s32 brcmf_invoke_iscan(struct wl_priv *wl)
 	return err;
 }
 
-static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el)
+static void brcmf_init_iscan_eloop(struct brcmf_cfg80211_iscan_eloop *el)
 {
 	memset(el, 0, sizeof(*el));
 	el->handler[BRCMF_SCAN_RESULTS_SUCCESS] = brcmf_iscan_done;
@@ -3321,13 +3370,13 @@ static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el)
 	el->handler[BRCMF_SCAN_RESULTS_NO_MEM] = brcmf_iscan_aborted;
 }
 
-static s32 brcmf_init_iscan(struct wl_priv *wl)
+static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
+	struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
 	int err = 0;
 
-	if (wl->iscan_on) {
-		iscan->dev = wl_to_ndev(wl);
+	if (cfg_priv->iscan_on) {
+		iscan->dev = wl_to_ndev(cfg_priv);
 		iscan->state = WL_ISCAN_STATE_IDLE;
 		brcmf_init_iscan_eloop(&iscan->el);
 		iscan->timer_ms = WL_ISCAN_TIMER_INTERVAL_MS;
@@ -3341,139 +3390,142 @@ static s32 brcmf_init_iscan(struct wl_priv *wl)
 			iscan->tsk = NULL;
 			return -ENOMEM;
 		}
-		iscan->data = wl;
+		iscan->data = cfg_priv;
 	}
 
 	return err;
 }
 
-static s32 wl_init_priv(struct wl_priv *wl)
+static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wiphy *wiphy = wl_to_wiphy(wl);
+	struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
 	s32 err = 0;
 
-	wl->scan_request = NULL;
-	wl->pwr_save = !!(wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT);
-	wl->iscan_on = true;	/* iscan on & off switch.
+	cfg_priv->scan_request = NULL;
+	cfg_priv->pwr_save = !!(wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT);
+	cfg_priv->iscan_on = true;	/* iscan on & off switch.
 				 we enable iscan per default */
-	wl->roam_on = false;	/* roam on & off switch.
+	cfg_priv->roam_on = false;	/* roam on & off switch.
 				 we enable roam per default */
 
-	wl->iscan_kickstart = false;
-	wl->active_scan = true;	/* we do active scan for
+	cfg_priv->iscan_kickstart = false;
+	cfg_priv->active_scan = true;	/* we do active scan for
 				 specific scan per default */
-	wl->dongle_up = false;	/* dongle is not up yet */
-	brcmf_init_eq(wl);
-	err = brcmf_init_priv_mem(wl);
+	cfg_priv->dongle_up = false;	/* dongle is not up yet */
+	brcmf_init_eq(cfg_priv);
+	err = brcmf_init_priv_mem(cfg_priv);
 	if (unlikely(err))
 		return err;
-	if (unlikely(brcmf_create_event_handler(wl)))
+	if (unlikely(brcmf_create_event_handler(cfg_priv)))
 		return -ENOMEM;
-	brcmf_init_eloop_handler(&wl->el);
-	mutex_init(&wl->usr_sync);
-	err = brcmf_init_iscan(wl);
+	brcmf_init_eloop_handler(&cfg_priv->el);
+	mutex_init(&cfg_priv->usr_sync);
+	err = brcmf_init_iscan(cfg_priv);
 	if (unlikely(err))
 		return err;
-	brcmf_init_conf(wl->conf);
-	brcmf_init_prof(wl->profile);
-	brcmf_link_down(wl);
+	brcmf_init_conf(cfg_priv->conf);
+	brcmf_init_prof(cfg_priv->profile);
+	brcmf_link_down(cfg_priv);
 
 	return err;
 }
 
-static void wl_deinit_priv(struct wl_priv *wl)
+static void wl_deinit_priv(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	brcmf_destroy_event_handler(wl);
-	wl->dongle_up = false;	/* dongle down */
-	brcmf_flush_eq(wl);
-	brcmf_link_down(wl);
-	brcmf_term_iscan(wl);
-	brcmf_deinit_priv_mem(wl);
+	brcmf_destroy_event_handler(cfg_priv);
+	cfg_priv->dongle_up = false;	/* dongle down */
+	brcmf_flush_eq(cfg_priv);
+	brcmf_link_down(cfg_priv);
+	brcmf_term_iscan(cfg_priv);
+	brcmf_deinit_priv_mem(cfg_priv);
 }
 
 s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
 {
 	struct wireless_dev *wdev;
-	struct wl_priv *wl;
-	struct wl_iface *ci;
+	struct brcmf_cfg80211_priv *cfg_priv;
+	struct brcmf_cfg80211_iface *ci;
 	s32 err = 0;
 
 	if (unlikely(!ndev)) {
 		WL_ERR("ndev is invalid\n");
 		return -ENODEV;
 	}
-	wl_cfg80211_dev = kzalloc(sizeof(struct wl_dev), GFP_KERNEL);
-	if (unlikely(!wl_cfg80211_dev)) {
+	cfg80211_dev = kzalloc(sizeof(struct brcmf_cfg80211_dev), GFP_KERNEL);
+	if (unlikely(!cfg80211_dev)) {
 		WL_ERR("wl_cfg80211_dev is invalid\n");
 		return -ENOMEM;
 	}
 	WL_INFO("func %p\n", wl_cfg80211_get_sdio_func());
-	wdev = brcmf_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev);
+	wdev = brcmf_alloc_wdev(sizeof(struct brcmf_cfg80211_iface),
+				&wl_cfg80211_get_sdio_func()->dev);
 	if (IS_ERR(wdev))
 		return -ENOMEM;
 
 	wdev->iftype = brcmf_mode_to_nl80211_iftype(WL_MODE_BSS);
-	wl = wdev_to_wl(wdev);
-	wl->wdev = wdev;
-	wl->pub = data;
-	ci = (struct wl_iface *)wl_to_ci(wl);
-	ci->wl = wl;
+	cfg_priv = wdev_to_wl(wdev);
+	cfg_priv->wdev = wdev;
+	cfg_priv->pub = data;
+	ci = (struct brcmf_cfg80211_iface *)wl_to_ci(cfg_priv);
+	ci->cfg_priv = cfg_priv;
 	ndev->ieee80211_ptr = wdev;
 	SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
 	wdev->netdev = ndev;
-	err = wl_init_priv(wl);
+	err = wl_init_priv(cfg_priv);
 	if (unlikely(err)) {
 		WL_ERR("Failed to init iwm_priv (%d)\n", err);
 		goto cfg80211_attach_out;
 	}
-	brcmf_set_drvdata(wl_cfg80211_dev, ci);
+	brcmf_set_drvdata(cfg80211_dev, ci);
 
 	return err;
 
 cfg80211_attach_out:
-	brcmf_free_wdev(wl);
+	brcmf_free_wdev(cfg_priv);
 	return err;
 }
 
 void wl_cfg80211_detach(void)
 {
-	struct wl_priv *wl;
+	struct brcmf_cfg80211_priv *cfg_priv;
 
-	wl = WL_PRIV_GET();
+	cfg_priv = WL_PRIV_GET();
 
-	wl_deinit_priv(wl);
-	brcmf_free_wdev(wl);
-	brcmf_set_drvdata(wl_cfg80211_dev, NULL);
-	kfree(wl_cfg80211_dev);
-	wl_cfg80211_dev = NULL;
+	wl_deinit_priv(cfg_priv);
+	brcmf_free_wdev(cfg_priv);
+	brcmf_set_drvdata(cfg80211_dev, NULL);
+	kfree(cfg80211_dev);
+	cfg80211_dev = NULL;
 	brcmf_clear_sdio_func();
 }
 
-static void brcmf_wakeup_event(struct wl_priv *wl)
+static void brcmf_wakeup_event(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	up(&wl->event_sync);
+	up(&cfg_priv->event_sync);
 }
 
 static s32 brcmf_event_handler(void *data)
 {
-	struct wl_priv *wl = (struct wl_priv *)data;
+	struct brcmf_cfg80211_priv *cfg_priv =
+			(struct brcmf_cfg80211_priv *)data;
 	struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
-	struct wl_event_q *e;
+	struct brcmf_cfg80211_event_q *e;
 
 	sched_setscheduler(current, SCHED_FIFO, &param);
 	allow_signal(SIGTERM);
-	while (likely(!down_interruptible(&wl->event_sync))) {
+	while (likely(!down_interruptible(&cfg_priv->event_sync))) {
 		if (kthread_should_stop())
 			break;
-		e = brcmf_deq_event(wl);
+		e = brcmf_deq_event(cfg_priv);
 		if (unlikely(!e)) {
 			WL_ERR("event queue empty...\n");
 			BUG();
 		}
 		WL_INFO("event type (%d)\n", e->etype);
-		if (wl->el.handler[e->etype]) {
-			wl->el.handler[e->etype] (wl, wl_to_ndev(wl), &e->emsg,
-						  e->edata);
+		if (cfg_priv->el.handler[e->etype]) {
+			cfg_priv->el.handler[e->etype](cfg_priv,
+						       wl_to_ndev(cfg_priv),
+						       &e->emsg, e->edata);
 		} else {
 			WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
 		}
@@ -3488,45 +3540,48 @@ wl_cfg80211_event(struct net_device *ndev,
 		  const struct brcmf_event_msg *e, void *data)
 {
 	u32 event_type = be32_to_cpu(e->event_type);
-	struct wl_priv *wl = ndev_to_wl(ndev);
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
 
-	if (likely(!brcmf_enq_event(wl, event_type, e, data)))
-		brcmf_wakeup_event(wl);
+	if (likely(!brcmf_enq_event(cfg_priv, event_type, e, data)))
+		brcmf_wakeup_event(cfg_priv);
 }
 
-static void brcmf_init_eq(struct wl_priv *wl)
+static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	brcmf_init_eq_lock(wl);
-	INIT_LIST_HEAD(&wl->eq_list);
+	brcmf_init_eq_lock(cfg_priv);
+	INIT_LIST_HEAD(&cfg_priv->eq_list);
 }
 
-static void brcmf_flush_eq(struct wl_priv *wl)
+static void brcmf_flush_eq(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_event_q *e;
+	struct brcmf_cfg80211_event_q *e;
 
-	brcmf_lock_eq(wl);
-	while (!list_empty(&wl->eq_list)) {
-		e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
+	brcmf_lock_eq(cfg_priv);
+	while (!list_empty(&cfg_priv->eq_list)) {
+		e = list_first_entry(&cfg_priv->eq_list,
+				     struct brcmf_cfg80211_event_q, eq_list);
 		list_del(&e->eq_list);
 		kfree(e);
 	}
-	brcmf_unlock_eq(wl);
+	brcmf_unlock_eq(cfg_priv);
 }
 
 /*
 * retrieve first queued event from head
 */
 
-static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl)
+static struct brcmf_cfg80211_event_q *brcmf_deq_event(
+	struct brcmf_cfg80211_priv *cfg_priv)
 {
-	struct wl_event_q *e = NULL;
+	struct brcmf_cfg80211_event_q *e = NULL;
 
-	brcmf_lock_eq(wl);
-	if (likely(!list_empty(&wl->eq_list))) {
-		e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
+	brcmf_lock_eq(cfg_priv);
+	if (likely(!list_empty(&cfg_priv->eq_list))) {
+		e = list_first_entry(&cfg_priv->eq_list,
+				     struct brcmf_cfg80211_event_q, eq_list);
 		list_del(&e->eq_list);
 	}
-	brcmf_unlock_eq(wl);
+	brcmf_unlock_eq(cfg_priv);
 
 	return e;
 }
@@ -3536,13 +3591,13 @@ static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl)
 */
 
 static s32
-brcmf_enq_event(struct wl_priv *wl, u32 event, const struct brcmf_event_msg *msg,
-		void *data)
+brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
+		const struct brcmf_event_msg *msg, void *data)
 {
-	struct wl_event_q *e;
+	struct brcmf_cfg80211_event_q *e;
 	s32 err = 0;
 
-	e = kzalloc(sizeof(struct wl_event_q), GFP_KERNEL);
+	e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_KERNEL);
 	if (unlikely(!e)) {
 		WL_ERR("event alloc failed\n");
 		return -ENOMEM;
@@ -3552,14 +3607,14 @@ brcmf_enq_event(struct wl_priv *wl, u32 event, const struct brcmf_event_msg *msg
 	memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));
 	if (data) {
 	}
-	brcmf_lock_eq(wl);
-	list_add_tail(&e->eq_list, &wl->eq_list);
-	brcmf_unlock_eq(wl);
+	brcmf_lock_eq(cfg_priv);
+	list_add_tail(&e->eq_list, &cfg_priv->eq_list);
+	brcmf_unlock_eq(cfg_priv);
 
 	return err;
 }
 
-static void brcmf_put_event(struct wl_event_q *e)
+static void brcmf_put_event(struct brcmf_cfg80211_event_q *e)
 {
 	kfree(e);
 }
@@ -3761,16 +3816,16 @@ dongle_scantime_out:
 	return err;
 }
 
-s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock)
+s32 brcmf_config_dongle(struct brcmf_cfg80211_priv *cfg_priv, bool need_lock)
 {
 	struct net_device *ndev;
 	struct wireless_dev *wdev;
 	s32 err = 0;
 
-	if (wl->dongle_up)
+	if (cfg_priv->dongle_up)
 		return err;
 
-	ndev = wl_to_ndev(wl);
+	ndev = wl_to_ndev(cfg_priv);
 	wdev = ndev->ieee80211_ptr;
 	if (need_lock)
 		rtnl_lock();
@@ -3781,13 +3836,14 @@ s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock)
 	err = brcmf_dongle_eventmsg(ndev);
 	if (unlikely(err))
 		goto default_conf_out;
-	err = brcmf_dongle_roam(ndev, (wl->roam_on ? 0 : 1), WL_BEACON_TIMEOUT);
+	err = brcmf_dongle_roam(ndev, (cfg_priv->roam_on ? 0 : 1),
+				WL_BEACON_TIMEOUT);
 	if (unlikely(err))
 		goto default_conf_out;
 	err = brcmf_dongle_mode(ndev, wdev->iftype);
 	if (unlikely(err && err != -EINPROGRESS))
 		goto default_conf_out;
-	err = brcmf_dongle_probecap(wl);
+	err = brcmf_dongle_probecap(cfg_priv);
 	if (unlikely(err))
 		goto default_conf_out;
 
@@ -3797,20 +3853,20 @@ default_conf_out:
 	if (need_lock)
 		rtnl_unlock();
 
-	wl->dongle_up = true;
+	cfg_priv->dongle_up = true;
 
 	return err;
 
 }
 
-static s32 wl_update_wiphybands(struct wl_priv *wl)
+static s32 wl_update_wiphybands(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	struct wiphy *wiphy;
 	s32 phy_list;
 	s8 phy;
 	s32 err = 0;
 
-	err = brcmf_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list,
+	err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), WLC_GET_PHYLIST, &phy_list,
 			sizeof(phy_list));
 	if (unlikely(err)) {
 		WL_ERR("error (%d)\n", err);
@@ -3820,41 +3876,41 @@ static s32 wl_update_wiphybands(struct wl_priv *wl)
 	phy = ((char *)&phy_list)[1];
 	WL_INFO("%c phy\n", phy);
 	if (phy == 'n' || phy == 'a') {
-		wiphy = wl_to_wiphy(wl);
+		wiphy = wl_to_wiphy(cfg_priv);
 		wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
 	}
 
 	return err;
 }
 
-static s32 __brcmf_cfg80211_up(struct wl_priv *wl)
+static s32 __brcmf_cfg80211_up(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	s32 err = 0;
 
-	set_bit(WL_STATUS_READY, &wl->status);
+	set_bit(WL_STATUS_READY, &cfg_priv->status);
 
-	brcmf_debugfs_add_netdev_params(wl);
+	brcmf_debugfs_add_netdev_params(cfg_priv);
 
-	err = brcmf_config_dongle(wl, false);
+	err = brcmf_config_dongle(cfg_priv, false);
 	if (unlikely(err))
 		return err;
 
-	brcmf_invoke_iscan(wl);
+	brcmf_invoke_iscan(cfg_priv);
 
 	return err;
 }
 
-static s32 __brcmf_cfg80211_down(struct wl_priv *wl)
+static s32 __brcmf_cfg80211_down(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	/*
 	 * While going down, if associated with AP disassociate
 	 * from AP to save power
 	 */
-	if ((test_bit(WL_STATUS_CONNECTED, &wl->status) ||
-	     test_bit(WL_STATUS_CONNECTING, &wl->status)) &&
-	     test_bit(WL_STATUS_READY, &wl->status)) {
+	if ((test_bit(WL_STATUS_CONNECTED, &cfg_priv->status) ||
+	     test_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) &&
+	     test_bit(WL_STATUS_READY, &cfg_priv->status)) {
 		WL_INFO("Disassociating from AP");
-		brcmf_link_down(wl);
+		brcmf_link_down(cfg_priv);
 
 		/* Make sure WPA_Supplicant receives all the event
 		   generated due to DISASSOC call to the fw to keep
@@ -3865,71 +3921,71 @@ static s32 __brcmf_cfg80211_down(struct wl_priv *wl)
 		rtnl_lock();
 	}
 
-	set_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
-	brcmf_term_iscan(wl);
-	if (wl->scan_request) {
-		cfg80211_scan_done(wl->scan_request, true);
+	set_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status);
+	brcmf_term_iscan(cfg_priv);
+	if (cfg_priv->scan_request) {
+		cfg80211_scan_done(cfg_priv->scan_request, true);
 		/* May need to perform this to cover rmmod */
 		/* wl_set_mpc(wl_to_ndev(wl), 1); */
-		wl->scan_request = NULL;
+		cfg_priv->scan_request = NULL;
 	}
-	clear_bit(WL_STATUS_READY, &wl->status);
-	clear_bit(WL_STATUS_SCANNING, &wl->status);
-	clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
+	clear_bit(WL_STATUS_READY, &cfg_priv->status);
+	clear_bit(WL_STATUS_SCANNING, &cfg_priv->status);
+	clear_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status);
 
-	brcmf_debugfs_remove_netdev(wl);
+	brcmf_debugfs_remove_netdev(cfg_priv);
 
 	return 0;
 }
 
 s32 wl_cfg80211_up(void)
 {
-	struct wl_priv *wl;
+	struct brcmf_cfg80211_priv *cfg_priv;
 	s32 err = 0;
 
-	wl = WL_PRIV_GET();
-	mutex_lock(&wl->usr_sync);
-	err = __brcmf_cfg80211_up(wl);
-	mutex_unlock(&wl->usr_sync);
+	cfg_priv = WL_PRIV_GET();
+	mutex_lock(&cfg_priv->usr_sync);
+	err = __brcmf_cfg80211_up(cfg_priv);
+	mutex_unlock(&cfg_priv->usr_sync);
 
 	return err;
 }
 
 s32 wl_cfg80211_down(void)
 {
-	struct wl_priv *wl;
+	struct brcmf_cfg80211_priv *cfg_priv;
 	s32 err = 0;
 
-	wl = WL_PRIV_GET();
-	mutex_lock(&wl->usr_sync);
-	err = __brcmf_cfg80211_down(wl);
-	mutex_unlock(&wl->usr_sync);
+	cfg_priv = WL_PRIV_GET();
+	mutex_lock(&cfg_priv->usr_sync);
+	err = __brcmf_cfg80211_down(cfg_priv);
+	mutex_unlock(&cfg_priv->usr_sync);
 
 	return err;
 }
 
-static s32 brcmf_dongle_probecap(struct wl_priv *wl)
+static s32 brcmf_dongle_probecap(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	return wl_update_wiphybands(wl);
+	return wl_update_wiphybands(cfg_priv);
 }
 
-static void *brcmf_read_prof(struct wl_priv *wl, s32 item)
+static void *brcmf_read_prof(struct brcmf_cfg80211_priv *cfg_priv, s32 item)
 {
 	switch (item) {
 	case WL_PROF_SEC:
-		return &wl->profile->sec;
+		return &cfg_priv->profile->sec;
 	case WL_PROF_BSSID:
-		return &wl->profile->bssid;
+		return &cfg_priv->profile->bssid;
 	case WL_PROF_SSID:
-		return &wl->profile->ssid;
+		return &cfg_priv->profile->ssid;
 	}
 	WL_ERR("invalid item (%d)\n", item);
 	return NULL;
 }
 
 static s32
-brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e, void *data,
-		  s32 item)
+brcmf_update_prof(struct brcmf_cfg80211_priv *cfg_priv,
+		  const struct brcmf_event_msg *e, void *data, s32 item)
 {
 	s32 err = 0;
 	struct brcmf_ssid *ssid;
@@ -3937,25 +3993,27 @@ brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e, void *dat
 	switch (item) {
 	case WL_PROF_SSID:
 		ssid = (struct brcmf_ssid *) data;
-		memset(wl->profile->ssid.SSID, 0,
-		       sizeof(wl->profile->ssid.SSID));
-		memcpy(wl->profile->ssid.SSID, ssid->SSID, ssid->SSID_len);
-		wl->profile->ssid.SSID_len = ssid->SSID_len;
+		memset(cfg_priv->profile->ssid.SSID, 0,
+		       sizeof(cfg_priv->profile->ssid.SSID));
+		memcpy(cfg_priv->profile->ssid.SSID,
+		       ssid->SSID, ssid->SSID_len);
+		cfg_priv->profile->ssid.SSID_len = ssid->SSID_len;
 		break;
 	case WL_PROF_BSSID:
 		if (data)
-			memcpy(wl->profile->bssid, data, ETH_ALEN);
+			memcpy(cfg_priv->profile->bssid, data, ETH_ALEN);
 		else
-			memset(wl->profile->bssid, 0, ETH_ALEN);
+			memset(cfg_priv->profile->bssid, 0, ETH_ALEN);
 		break;
 	case WL_PROF_SEC:
-		memcpy(&wl->profile->sec, data, sizeof(wl->profile->sec));
+		memcpy(&cfg_priv->profile->sec, data,
+		       sizeof(cfg_priv->profile->sec));
 		break;
 	case WL_PROF_BEACONINT:
-		wl->profile->beacon_interval = *(u16 *)data;
+		cfg_priv->profile->beacon_interval = *(u16 *)data;
 		break;
 	case WL_PROF_DTIMPERIOD:
-		wl->profile->dtim_period = *(u8 *)data;
+		cfg_priv->profile->dtim_period = *(u8 *)data;
 		break;
 	default:
 		WL_ERR("unsupported item (%d)\n", item);
@@ -3966,14 +4024,15 @@ brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e, void *dat
 	return err;
 }
 
-static bool brcmf_is_ibssmode(struct wl_priv *wl)
+static bool brcmf_is_ibssmode(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	return wl->conf->mode == WL_MODE_IBSS;
+	return cfg_priv->conf->mode == WL_MODE_IBSS;
 }
 
-static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
+static __used s32 brcmf_add_ie(struct brcmf_cfg80211_priv *cfg_priv,
+			       u8 t, u8 l, u8 *v)
 {
-	struct wl_ie *ie = wl_to_ie(wl);
+	struct brcmf_cfg80211_ie *ie = wl_to_ie(cfg_priv);
 	s32 err = 0;
 
 	if (unlikely(ie->offset + l + 2 > WL_TLV_INFO_MAX)) {
@@ -3988,37 +4047,37 @@ static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
 	return err;
 }
 
-static void brcmf_link_down(struct wl_priv *wl)
+static void brcmf_link_down(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	struct net_device *dev = NULL;
 	s32 err = 0;
 
 	WL_TRACE("Enter\n");
 
-	if (wl->link_up) {
-		dev = wl_to_ndev(wl);
+	if (cfg_priv->link_up) {
+		dev = wl_to_ndev(cfg_priv);
 		WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
 		err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
 		if (unlikely(err))
 			WL_ERR("WLC_DISASSOC failed (%d)\n", err);
-		wl->link_up = false;
+		cfg_priv->link_up = false;
 	}
 	WL_TRACE("Exit\n");
 }
 
-static void brcmf_lock_eq(struct wl_priv *wl)
+static void brcmf_lock_eq(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	spin_lock_irq(&wl->eq_lock);
+	spin_lock_irq(&cfg_priv->eq_lock);
 }
 
-static void brcmf_unlock_eq(struct wl_priv *wl)
+static void brcmf_unlock_eq(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	spin_unlock_irq(&wl->eq_lock);
+	spin_unlock_irq(&cfg_priv->eq_lock);
 }
 
-static void brcmf_init_eq_lock(struct wl_priv *wl)
+static void brcmf_init_eq_lock(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	spin_lock_init(&wl->eq_lock);
+	spin_lock_init(&cfg_priv->eq_lock);
 }
 
 static void brcmf_delay(u32 ms)
@@ -4031,12 +4090,12 @@ static void brcmf_delay(u32 ms)
 	}
 }
 
-static void brcmf_set_drvdata(struct wl_dev *dev, void *data)
+static void brcmf_set_drvdata(struct brcmf_cfg80211_dev *dev, void *data)
 {
 	dev->driver_data = data;
 }
 
-static void *brcmf_get_drvdata(struct wl_dev *dev)
+static void *brcmf_get_drvdata(struct brcmf_cfg80211_dev *dev)
 {
 	void *data = NULL;
 
@@ -4048,9 +4107,9 @@ static void *brcmf_get_drvdata(struct wl_dev *dev)
 static void brcmf_set_mpc(struct net_device *ndev, int mpc)
 {
 	s32 err = 0;
-	struct wl_priv *wl = ndev_to_wl(ndev);
+	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
 
-	if (test_bit(WL_STATUS_READY, &wl->status)) {
+	if (test_bit(WL_STATUS_READY, &cfg_priv->status)) {
 		err = brcmf_dev_intvar_set(ndev, "mpc", mpc);
 		if (unlikely(err)) {
 			WL_ERR("fail to set mpc\n");
@@ -4060,24 +4119,25 @@ static void brcmf_set_mpc(struct net_device *ndev, int mpc)
 	}
 }
 
-static int brcmf_debugfs_add_netdev_params(struct wl_priv *wl)
+static int brcmf_debugfs_add_netdev_params(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	char buf[10+IFNAMSIZ];
 	struct dentry *fd;
 	s32 err = 0;
 
-	sprintf(buf, "netdev:%s", wl_to_ndev(wl)->name);
-	wl->debugfsdir = debugfs_create_dir(buf, wl_to_wiphy(wl)->debugfsdir);
+	sprintf(buf, "netdev:%s", wl_to_ndev(cfg_priv)->name);
+	cfg_priv->debugfsdir = debugfs_create_dir(buf,
+					wl_to_wiphy(cfg_priv)->debugfsdir);
 
-	fd = debugfs_create_u16("beacon_int", S_IRUGO, wl->debugfsdir,
-		(u16 *)&wl->profile->beacon_interval);
+	fd = debugfs_create_u16("beacon_int", S_IRUGO, cfg_priv->debugfsdir,
+		(u16 *)&cfg_priv->profile->beacon_interval);
 	if (!fd) {
 		err = -ENOMEM;
 		goto err_out;
 	}
 
-	fd = debugfs_create_u8("dtim_period", S_IRUGO, wl->debugfsdir,
-		(u8 *)&wl->profile->dtim_period);
+	fd = debugfs_create_u8("dtim_period", S_IRUGO, cfg_priv->debugfsdir,
+		(u8 *)&cfg_priv->profile->dtim_period);
 	if (!fd) {
 		err = -ENOMEM;
 		goto err_out;
@@ -4087,8 +4147,8 @@ err_out:
 	return err;
 }
 
-static void brcmf_debugfs_remove_netdev(struct wl_priv *wl)
+static void brcmf_debugfs_remove_netdev(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	debugfs_remove_recursive(wl->debugfsdir);
-	wl->debugfsdir = NULL;
+	debugfs_remove_recursive(cfg_priv->debugfsdir);
+	cfg_priv->debugfsdir = NULL;
 }
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +42 -61

239 lines not on this page · raw message

Signature · 1 line
1.7.1