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 1 of 3

lore
Share & tools
lore

Franky Lin

author
#0 lore raw

cover staging: brcm80211: more code cleanup and bug fixed

Most of these patches are brcmfmac cleanup.

Arend van Spriel (67):
staging: brcm80211: fix checkpatch errors in types.h
staging: brcm80211: remove flash related code from
initvars_srom_pci()
staging: brcm80211: minor cleanup in initvars_srom_pci()
staging: brcm80211: make use of linux error codes in srom.c
staging: brcm80211: remove code for unsupported chipsets from
brcmsmac
staging: brcm80211: remove unsupported chipset code from brcmsmac phy
staging: brcm80211: remove otp power control functions
staging: brcm80211: remove code from pmu.c related to unsupported
chipsets
staging: brcm80211: remove unused macro definitions from pmu.c
staging: brcm80211: remove chip simulation specific code
staging: brcm80211: remove macro FOREACH_AS_STA
staging: brcm80211: change FOREACH_BSS macro to remove checkpatch
error
staging: brcm80211: remove macro definition DRV_MODULE_NAME
staging: brcm80211: get rid on IS_CFG80211_FAVORITE macro
staging: brcm80211: move assert function to dhd_linux.c
staging: brcm80211: correct bcmsdh_recv_buf() calls
staging: brcm80211: remove wireless extensions support from brcmfmac
staging: brcm80211: remove dhd_set_timer function prototype
staging: brcm80211: remove unused globals from dhd_common.c
staging: brcm80211: remove extern function prototypes from c files
staging: brcm80211: rename functions and variables in dhd_common.c
staging: brcm80211: rename ioctl command codes in dhd.h
staging: brcm80211: remove unused definitions from dhd.h
staging: brcm80211: replace macro BCM_MSG_IFNAME_MAX with IFNAMSIZ
staging: brcm80211: rename event handling definition
staging: brcm80211: rename module parameters
staging: brcm80211: remove unnecessary abstraction for scheduler
staging: brcm80211: rename fullmac functions
staging: brcm80211: remove unused prototypes from dhd.h
staging: brcm80211: rename fullmac protocol related functions
staging: brcm80211: get rid of PKT[TO/FROM]NATIVE macros
staging: brcm80211: rename dhd_prot and get rid of dhd_prot_t typedef
staging: brcm80211: remove conditional SIMPLE_ISCAN code
staging: brcm80211: rename netdevice related functions in fullmac
staging: brcm80211: rename static functions in dhd_linux.c
staging: brcm80211: rename more brcmfmac module parameters
staging: brcm80211: further renaming in fullmac sources
staging: brcm80211: remove ARP_OFFLOAD_SUPPORT macro definition
staging: brcm80211: remove PKT_FILTER_SUPPORT macro definition
staging: brcm80211: remove BCMLXSDMMC macro definition
staging: brcm80211: always enable code for PLATFORM_BUS functionality
staging: brcm80211: remove DHD_SCHED macro definition
staging: brcm80211: remove EMBEDDED_PLATFORM macro definition
staging: brcm80211: remove MMC_SDIO_ABORT macro definition
staging: brcm80211: remove TOE macro definition
staging: brcm80211: define SHOW_EVENTS macro only for debugging
staging: brcm80211: replace DHD_DEBUG macro with BCMDBG
staging: brcm80211: remove unnecessary macro defintions
staging: brcm80211: remove custom gpio support code
staging: brcm80211: remove conditional code fragments from brcmfmac
staging: brcm80211: rename EPI_VERSION_STR macro
staging: brcm80211: use linux native ethertype iso ETH_P_BRCM
staging: brcm80211: rename function variables
staging: brcm80211: remove unused definitions from dhd.h
staging: brcm80211: rename structure definitions in dhd.h
staging: brcm80211: rename macro definitions in dhd.h
staging: brcm80211: remove unused macro definitions from dhd.h
staging: brcm80211: structure renaming in dhd.h
staging: brcm80211: rename structure definitions in dhd_linux.c
staging: brcm80211: rename struct dhd_pub to struct brcmf_pub
staging: brcm80211: rename function variables
staging: brcm80211: remove unused macros from dhd_dbg.h
staging: brcm80211: rename dhd_bus structure and functions
staging: brcm80211: rename static functions in wl_cfg80211.c
staging: brcm80211: rename structures and variables in wl_cfg80211.c
staging: brcm80211: rename pointer conversion macros in wl_cfg80211.h
staging: brcm80211: rename external function in wl_cfg80211.c

Franky Lin (11):
staging: brcm80211: remove unused sdtxlock from fullmac
staging: brcm80211: remove empty sdrxqlock from fullmac
staging: brcm80211: move sdtxqlock codes to dhd_sdio.c
staging: brcm80211: remove unused files from fullmac
staging: brcm80211: move sdio related suspend/resume code to bus
interface layer
staging: brcm80211: move waitqueue code to dhd_sdio.c
staging: brcm80211: move fullmac watchdog timer code to dhd_sdio.c
staging: brcm80211: move debug console related code to dhd_sdio.c
staging: brcm80211: move dpc code to dhd_sdio.c
staging: brcm80211: move sdio resource lock to dhd_sdio.c
staging: brcm80211: clean up firmware download code in fullmac

Henry Ptasinski (9):
staging: brcm80211: removed unneeded 'if' statement
staging: brcm80211: delete empty brcmfmac/README file
staging: brcm80211: run scripts/cleanfile to remove whitespace errors
staging: brcm80211: cleanup whitespace errors
staging: brcm80211: add missing KERN_ facility level to printk()
staging: brcm80211: flatten wlc_phy_shared_detach()
staging: brcm80211: remove unnecessary null check
staging: brcm80211: reorg brcms_c_validboardtype for clarity
staging: brcm80211: updated TODO file

Roland Vossen (31):
staging: brcm80211: parsed ADDBA response ack window parameter
staging: brcm80211: taking max AMPDU length advertized by peer into
account
staging: brcm80211: corrected tx status feedback for non AMPDU
packets
staging: brcm80211: Changed comments
staging: brcm80211: replaced prefix of SDIO related functions
staging: brcm80211: removed BDC defines
staging: brcm80211: replaced typedef sdioh_info_t by struct
sdioh_info
staging: brcm80211: replaced typedef bcmsdh_info_t by struct
brcmf_sdio
staging: brcm80211: replaced typedef by struct for several sdio types
staging: brcm80211: replaced typedef SDIOH_API_RC by int
staging: brcm80211: replaced more sdio related typedefs by structs
staging: brmc80211: cleaned up sdio related error codes
staging: brcm80211: removed global function declarations from .c
files
staging: brcm80211: removed last occurrences of bcmsdh/BCMSDH
staging: brcm80211: sdh related code cleanup
staging: brcm80211: removed brcmf_sdioh_interrupt_pending()
staging: brcm80211: removed brcmf_sdioh_reset()
staging: brcm80211: removed brcmf_sdioh_start() and
brcmf_sdioh_stop()
staging: brcm80211: removed file sdiovar.h
staging: brcm80211: further cleaned fullmac header files
staging: brcm80211: removed last global function declaration in .c
file
staging: brcm80211: removed last typedefs from fullmac
staging: brcm80211: removed unused code and definitions from fullmac
staging: brcm80211: fullmac register access macro's take u32 instead
of pointers
staging: brcm80211: replaced macro R_SDREG by function r_sdreg()
staging: brcm80211: replaced macro W_SDREG by function w_sdreg()
staging: brcm80211: got rid of redundant member 'regs' of struct
dhd_bus
staging: brcm80211: removed last amd64 compiler warnings
staging: brcm80211: W_REG macro cleanup in fullmac SDIO
staging: brcm80211: removed unused definitions from dhd_sdio.c
staging: brcm80211: fix for reported log spam problem

Sukesh Srikakula (1):
staging:brcm80211:brcmfmac: CONNECTING status bit is set at
appropriate location

 drivers/staging/brcm80211/Makefile                 |    2 +-
 drivers/staging/brcm80211/TODO                     |   12 +-
 drivers/staging/brcm80211/brcmfmac/Makefile        |   23 +-
 drivers/staging/brcm80211/brcmfmac/README          |    2 -
 drivers/staging/brcm80211/brcmfmac/aiutils.c       |    1 -
 drivers/staging/brcm80211/brcmfmac/bcmchip.h       |    3 +
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h      |  181 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |  489 ++--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |  273 +--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |  441 +--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h  |  132 -
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |  130 +-
 drivers/staging/brcm80211/brcmfmac/dhd.h           | 1057 +++----
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h       |   61 +-
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c       |  225 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c    | 1237 ++-----
 .../staging/brcm80211/brcmfmac/dhd_custom_gpio.c   |  158 -
 drivers/staging/brcm80211/brcmfmac/dhd_dbg.h       |   66 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     | 2048 +++--------
 .../staging/brcm80211/brcmfmac/dhd_linux_sched.c   |   25 -
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h     |   48 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      | 2821 ++++++++-------
 drivers/staging/brcm80211/brcmfmac/dngl_stats.h    |    4 +-
 drivers/staging/brcm80211/brcmfmac/pcicfg.h        |   50 -
 drivers/staging/brcm80211/brcmfmac/sbsdio.h        |   98 +-
 drivers/staging/brcm80211/brcmfmac/sdio_host.h     |  165 +-
 drivers/staging/brcm80211/brcmfmac/sdiovar.h       |   38 -
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   | 2374 ++++++-------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h   |  193 +-
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         | 3711 --------------------
 drivers/staging/brcm80211/brcmfmac/wl_iw.h         |  138 -
 drivers/staging/brcm80211/brcmsmac/aiutils.c       |   66 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.h       |    4 -
 drivers/staging/brcm80211/brcmsmac/ampdu.c         |   78 +-
 drivers/staging/brcm80211/brcmsmac/bmac.c          |   44 +-
 drivers/staging/brcm80211/brcmsmac/d11.h           |   30 +-
 drivers/staging/brcm80211/brcmsmac/dma.c           |    2 +-
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c   |   24 +-
 drivers/staging/brcm80211/brcmsmac/main.c          |   90 +-
 drivers/staging/brcm80211/brcmsmac/nicpci.c        |   49 +-
 drivers/staging/brcm80211/brcmsmac/otp.c           |   19 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c   |   59 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h   |    7 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_int.h   |   14 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c   |   28 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_n.c     |  167 +-
 drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h  |   14 +-
 .../staging/brcm80211/brcmsmac/phy/phytbl_lcn.c    |   18 +-
 drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c  |   28 +-
 drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h  |   10 +-
 drivers/staging/brcm80211/brcmsmac/phy_shim.h      |    4 +-
 drivers/staging/brcm80211/brcmsmac/pmu.c           | 1925 +----------
 drivers/staging/brcm80211/brcmsmac/pmu.h           |    3 -
 drivers/staging/brcm80211/brcmsmac/pub.h           |    2 +
 drivers/staging/brcm80211/brcmsmac/rate.h          |    6 +-
 drivers/staging/brcm80211/brcmsmac/scb.h           |    7 +-
 drivers/staging/brcm80211/brcmsmac/srom.c          |  160 +-
 drivers/staging/brcm80211/brcmsmac/types.h         |   32 +-
 drivers/staging/brcm80211/brcmutil/utils.c         |    4 +-
 drivers/staging/brcm80211/brcmutil/wifi.c          |    1 -
 drivers/staging/brcm80211/include/brcmu_utils.h    |    6 +-
 drivers/staging/brcm80211/include/soc.h            |    2 +-
 62 files changed, 5110 insertions(+), 13999 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/README
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/aiutils.c
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/pcicfg.h
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/sdiovar.h
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/wl_iw.c
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/wl_iw.h
author
#1 lore raw

PATCH 1/119 staging: brcm80211: fix checkpatch errors in types.h

From: Arend van Spriel <[email protected]>

The file types.h contains several occurrences of the checkpatch error "(foo*)" should be "(foo *)". This has been fixed in this patch.

---
 drivers/staging/brcm80211/brcmsmac/types.h |   30 ++++++++++++++--------------
 1 files changed, 15 insertions(+), 15 deletions(-)
drivers/staging/brcm80211/brcmsmac/types.h +15 -15
index 163973d..af1514e 100644
@@ -257,9 +257,9 @@ do {						\
 #define R_REG(r) \
 	({\
 		sizeof(*(r)) == sizeof(u8) ? \
-		readb((volatile u8*)(r)) : \
-		sizeof(*(r)) == sizeof(u16) ? readw((volatile u16*)(r)) : \
-		readl((volatile u32*)(r)); \
+		readb((u8 *)(r)) : \
+		sizeof(*(r)) == sizeof(u16) ? readw((u16 *)(r)) : \
+		readl((u32 *)(r)); \
 	})
 #else				/* __mips__ */
 #define R_REG(r) \
@@ -268,14 +268,14 @@ do {						\
 		__asm__ __volatile__("sync"); \
 		switch (sizeof(*(r))) { \
 		case sizeof(u8): \
-			__osl_v = readb((volatile u8*)(r)); \
+			__osl_v = readb((u8 *)(r)); \
 			break; \
 		case sizeof(u16): \
-			__osl_v = readw((volatile u16*)(r)); \
+			__osl_v = readw((u16 *)(r)); \
 			break; \
 		case sizeof(u32): \
 			__osl_v = \
-			readl((volatile u32*)(r)); \
+			readl((u32 *)(r)); \
 			break; \
 		} \
 		__asm__ __volatile__("sync"); \
@@ -286,11 +286,11 @@ do {						\
 #define W_REG(r, v) do { \
 		switch (sizeof(*(r))) { \
 		case sizeof(u8): \
-			writeb((u8)(v), (volatile u8*)(r)); break; \
+			writeb((u8)(v), (u8 *)(r)); break; \
 		case sizeof(u16): \
-			writew((u16)(v), (volatile u16*)(r)); break; \
+			writew((u16)(v), (u16 *)(r)); break; \
 		case sizeof(u32): \
-			writel((u32)(v), (volatile u32*)(r)); break; \
+			writel((u32)(v), (u32 *)(r)); break; \
 		}; \
 	} while (0)
 #else				/* __BIG_ENDIAN */
@@ -300,14 +300,14 @@ do {						\
 		switch (sizeof(*(r))) { \
 		case sizeof(u8): \
 			__osl_v = \
-			readb((volatile u8*)((r)^3)); \
+			readb((u8 *)((r)^3)); \
 			break; \
 		case sizeof(u16): \
 			__osl_v = \
-			readw((volatile u16*)((r)^2)); \
+			readw((u16 *)((r)^2)); \
 			break; \
 		case sizeof(u32): \
-			__osl_v = readl((volatile u32*)(r)); \
+			__osl_v = readl((u32 *)(r)); \
 			break; \
 		} \
 		__osl_v; \
@@ -317,13 +317,13 @@ do {						\
 		switch (sizeof(*(r))) { \
 		case sizeof(u8):	\
 			writeb((u8)(v), \
-			(volatile u8*)((r)^3)); break; \
+			(u8 *)((r)^3)); break; \
 		case sizeof(u16):	\
 			writew((u16)(v), \
-			(volatile u16*)((r)^2)); break; \
+			(u16 *)((r)^2)); break; \
 		case sizeof(u32):	\
 			writel((u32)(v), \
-			(volatile u32*)(r)); break; \
+			(u32 *)(r)); break; \
 		} \
 	} while (0)
 #endif				/* __BIG_ENDIAN */
Signature · 1 line
1.7.1
author
#2 lore raw

PATCH 2/119 staging:brcm80211:brcmfmac: CONNECTING status bit is set at appropriate location

In reply to Franky Lin

From: Sukesh Srikakula <[email protected]>

'WL_STATUS_CONNECTING' status bit is set at appropriate step in bss/ibss connect requests.

---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |   48 ++++++++++++++--------
 1 files changed, 31 insertions(+), 17 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +31 -17
index afafa57..52c1782 100644
@@ -975,6 +975,8 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 		return -EOPNOTSUPP;
 	}
 
+	set_bit(WL_STATUS_CONNECTING, &wl->status);
+
 	if (params->bssid)
 		WL_CONN("BSSID: %02X %02X %02X %02X %02X %02X\n",
 		params->bssid[0], params->bssid[1], params->bssid[2],
@@ -1088,9 +1090,9 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 		goto done;
 	}
 
-	set_bit(WL_STATUS_CONNECTING, &wl->status);
-
 done:
+	if (err)
+		clear_bit(WL_STATUS_CONNECTING, &wl->status);
 	WL_TRACE("Exit\n");
 	return err;
 }
@@ -1380,6 +1382,8 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 		return -EOPNOTSUPP;
 	}
 
+	set_bit(WL_STATUS_CONNECTING, &wl->status);
+
 	if (chan) {
 		wl->channel =
 			ieee80211_frequency_to_channel(chan->center_freq);
@@ -1391,24 +1395,34 @@ 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);
-	if (unlikely(err))
-		return err;
+	if (err) {
+		WL_ERR("wl_set_wpa_version failed (%d)\n", err);
+		goto done;
+	}
 
 	err = wl_set_auth_type(dev, sme);
-	if (unlikely(err))
-		return err;
+	if (err) {
+		WL_ERR("wl_set_auth_type failed (%d)\n", err);
+		goto done;
+	}
 
 	err = wl_set_set_cipher(dev, sme);
-	if (unlikely(err))
-		return err;
+	if (err) {
+		WL_ERR("wl_set_set_cipher failed (%d)\n", err);
+		goto done;
+	}
 
 	err = wl_set_key_mgmt(dev, sme);
-	if (unlikely(err))
-		return err;
+	if (err) {
+		WL_ERR("wl_set_key_mgmt failed (%d)\n", err);
+		goto done;
+	}
 
 	err = wl_set_set_sharedkey(dev, sme);
-	if (unlikely(err))
-		return err;
+	if (err) {
+		WL_ERR("wl_set_set_sharedkey failed (%d)\n", err);
+		goto done;
+	}
 
 	wl_update_prof(wl, NULL, sme->bssid, WL_PROF_BSSID);
 	/*
@@ -1435,12 +1449,12 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 
 	wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
 	err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
-	if (unlikely(err)) {
-		WL_ERR("error (%d)\n", err);
-		return err;
-	}
-	set_bit(WL_STATUS_CONNECTING, &wl->status);
+	if (err)
+		WL_ERR("WLC_SET_SSID failed (%d)\n", err);
 
+done:
+	if (err)
+		clear_bit(WL_STATUS_CONNECTING, &wl->status);
 	WL_TRACE("Exit\n");
 	return err;
 }
Signature · 1 line
1.7.1
author
#3 lore raw

PATCH 3/119 staging: brcm80211: remove flash related code from initvars_srom_pci()

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The function initvars_srom_pci() has fallback to obtain drivers settings from flash when no srom device is present. However, this driver does not support flash so the fallback code can be removed.

---
 drivers/staging/brcm80211/brcmsmac/srom.c |   67 ++++++++---------------------
 1 files changed, 18 insertions(+), 49 deletions(-)
drivers/staging/brcm80211/brcmsmac/srom.c +18 -49
index 1117f91..5b5306a 100644
@@ -1212,14 +1212,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 	u32 sr;
 	varbuf_t b;
 	char *vp, *base = NULL;
-	bool flash = false;
 	int err = 0;
 
 	/*
-	 * Apply CRC over SROM content regardless SROM is present or not,
-	 * and use variable <devpath>sromrev's existence in flash to decide
-	 * if we should return an error when CRC fails or read SROM variables
-	 * from flash.
+	 * Apply CRC over SROM content regardless SROM is present or not.
 	 */
 	srom = kmalloc(SROM_MAX, GFP_ATOMIC);
 	if (!srom)
@@ -1265,60 +1261,33 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 		err = 1;
 #endif
 
-	/*
-	 * We want internal/wltest driver to come up with default
-	 * sromvars so we can program a blank SPROM/OTP.
-	 */
-	if (err) {
-		char *value;
-		u32 val;
-		val = 0;
-
-		value = ai_getdevpathvar(sih, "sromrev");
-		if (value) {
-			sromrev = (u8) simple_strtoul(value, NULL, 0);
-			flash = true;
-			goto varscont;
-		}
+	if (!err) {
+		/* Bitmask for the sromrev */
+		sr = 1 << sromrev;
 
-		value = ai_getnvramflvar(sih, "sromrev");
-		if (value) {
-			err = 0;
+		/* srom version check: Current valid versions: 1, 2, 3, 4, 5, 8, 9 */
+		if ((sr & 0x33e) == 0) {
+			err = -2;
 			goto errout;
 		}
 
-		{
-			err = -1;
+		base = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
+		if (!base) {
+			err = -2;
 			goto errout;
 		}
-	}
-
- varscont:
-	/* Bitmask for the sromrev */
-	sr = 1 << sromrev;
 
-	/* srom version check: Current valid versions: 1, 2, 3, 4, 5, 8, 9 */
-	if ((sr & 0x33e) == 0) {
-		err = -2;
-		goto errout;
-	}
-
-	base = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
-	if (!base) {
-		err = -2;
-		goto errout;
-	}
+		varbuf_init(&b, base, MAXSZ_NVRAM_VARS);
 
-	varbuf_init(&b, base, MAXSZ_NVRAM_VARS);
+		/* parse SROM into name=value pairs. */
+		_initvars_srom_pci(sromrev, srom, 0, &b);
 
-	/* parse SROM into name=value pairs. */
-	_initvars_srom_pci(sromrev, srom, 0, &b);
+		/* final nullbyte terminator */
+		vp = b.buf;
+		*vp++ = '\0';
 
-	/* final nullbyte terminator */
-	vp = b.buf;
-	*vp++ = '\0';
-
-	err = initvars_table(base, vp, vars, count);
+		err = initvars_table(base, vp, vars, count);
+	}
 
 errout:
 	if (base)
Signature · 1 line
1.7.1
author
#4 lore raw

PATCH 4/119 staging: brcm80211: minor cleanup in initvars_srom_pci()

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The error handling code labelled with errout: did a conditional kfree(). The last error jump to the label is upon failure of the kmalloc() for which the conditional kfree() is done. Therefor, the kfree is moved before the error label and done unconditionally.

---
 drivers/staging/brcm80211/brcmsmac/srom.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmsmac/srom.c +1 -3
index 5b5306a..31aa84d 100644
@@ -1287,12 +1287,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 		*vp++ = '\0';
 
 		err = initvars_table(base, vp, vars, count);
+		kfree(base);
 	}
 
 errout:
-	if (base)
-		kfree(base);
-
 	kfree(srom);
 	return err;
 }
Signature · 1 line
1.7.1
author
#5 lore raw

PATCH 5/119 staging: brcm80211: make use of linux error codes in srom.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The source file srom.c used meaningless non-zero numbers to return upon error conditions. These have been replaced by linux error codes.

---
 drivers/staging/brcm80211/brcmsmac/srom.c |   36 +++++++++++++----------------
 1 files changed, 16 insertions(+), 20 deletions(-)
drivers/staging/brcm80211/brcmsmac/srom.c +16 -20
index 31aa84d..34c19ef 100644
@@ -870,7 +870,7 @@ int srom_var_init(struct si_pub *sih, uint bustype, void *curmap,
 	if (curmap != NULL && bustype == PCI_BUS)
 		return initvars_srom_pci(sih, curmap, vars, count);
 
-	return -1;
+	return -EINVAL;
 }
 
 /* In chips with chipcommon rev 32 and later, the srom is in chipcommon,
@@ -935,7 +935,7 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
 		if (sih->ccrev > 31 && ISSIM_ENAB(sih)) {
 			/* use indirect since direct is too slow on QT */
 			if ((sih->cccaps & CC_CAP_SROM) == 0)
-				return 1;
+				return -ENODEV;
 
 			ccregs = (void *)((u8 *) sprom - CC_SROM_OTP);
 			buf[i] =
@@ -953,7 +953,7 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
 
 	/* bypass crc checking for simulation to allow srom hack */
 	if (ISSIM_ENAB(sih))
-		return err;
+		return 0;
 
 	if (check_crc) {
 
@@ -962,7 +962,7 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
 			 * is blank, regardless of the rest of the content, so declare
 			 * it bad.
 			 */
-			return 1;
+			return -ENODATA;
 		}
 
 		/* fixup the endianness so crc8 will pass */
@@ -970,7 +970,7 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
 		if (brcmu_crc8((u8 *) buf, nwords * 2, CRC8_INIT_VALUE) !=
 		    CRC8_GOOD_VALUE) {
 			/* DBG only pci always read srom4 first, then srom8/9 */
-			err = 1;
+			err = -EIO;
 		}
 		/* now correct the endianness of the byte array */
 		ltoh16_buf(buf, nwords * 2);
@@ -987,7 +987,7 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz)
 
 	otp = kzalloc(OTP_SZ_MAX, GFP_ATOMIC);
 	if (otp == NULL) {
-		return -EBADE;
+		return -ENOMEM;
 	}
 
 	err = otp_read_region(sih, OTP_HW_RGN, (u16 *) otp, &sz);
@@ -1002,14 +1002,14 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz)
 		 * is blank, regardless of the rest of the content, so declare
 		 * it bad.
 		 */
-		return 1;
+		return -ENODATA;
 	}
 
 	/* fixup the endianness so crc8 will pass */
 	htol16_buf(buf, bufsz);
 	if (brcmu_crc8((u8 *) buf, SROM4_WORDS * 2, CRC8_INIT_VALUE) !=
 	    CRC8_GOOD_VALUE) {
-		err = 1;
+		err = -EIO;
 	}
 	/* now correct the endianness of the byte array */
 	ltoh16_buf(buf, bufsz);
@@ -1219,13 +1219,12 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 	 */
 	srom = kmalloc(SROM_MAX, GFP_ATOMIC);
 	if (!srom)
-		return -2;
+		return -ENOMEM;
 
 	sromwindow = (u16 *) SROM_OFFSET(sih);
 	if (ai_is_sprom_available(sih)) {
-		err =
-		    sprom_read_pci(sih, sromwindow, 0, srom, SROM_WORDS,
-				   true);
+		err = sprom_read_pci(sih, sromwindow, 0, srom, SROM_WORDS,
+				     true);
 
 		if ((srom[SROM4_SIGN] == SROM4_SIGNATURE) ||
 		    (((sih->buscoretype == PCIE_CORE_ID)
@@ -1233,9 +1232,8 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 		     || ((sih->buscoretype == PCI_CORE_ID)
 			 && (sih->buscorerev >= 0xe)))) {
 			/* sromrev >= 4, read more */
-			err =
-			    sprom_read_pci(sih, sromwindow, 0, srom,
-					   SROM4_WORDS, true);
+			err = sprom_read_pci(sih, sromwindow, 0, srom,
+					     SROM4_WORDS, true);
 			sromrev = srom[SROM4_CRCREV] & 0xff;
 		} else if (err == 0) {
 			/* srom is good and is rev < 4 */
@@ -1253,12 +1251,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 		if (err == 0)
 			/* OTP only contain SROM rev8/rev9 for now */
 			sromrev = srom[SROM4_CRCREV] & 0xff;
-		else
-			err = 1;
 	}
 #else
 	else
-		err = 1;
+		err = -ENODEV;
 #endif
 
 	if (!err) {
@@ -1267,13 +1263,13 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 
 		/* srom version check: Current valid versions: 1, 2, 3, 4, 5, 8, 9 */
 		if ((sr & 0x33e) == 0) {
-			err = -2;
+			err = -EINVAL;
 			goto errout;
 		}
 
 		base = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
 		if (!base) {
-			err = -2;
+			err = -ENOMEM;
 			goto errout;
 		}
 
Signature · 1 line
1.7.1
author
#6 lore raw

PATCH 6/119 staging: brcm80211: remove unused sdtxlock from fullmac

In reply to Franky Lin

Unused sdtx lock functions are removed from dhd_linux.c

---
 drivers/staging/brcm80211/brcmfmac/dhd.h       |    2 --
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   10 ----------
 2 files changed, 0 insertions(+), 12 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
index 1fc5202..4d92d69 100644
@@ -988,8 +988,6 @@ extern int write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
 #if defined(OOB_INTR_ONLY)
 extern int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr);
 #endif				/* defined(OOB_INTR_ONLY) */
-extern void dhd_os_sdtxlock(dhd_pub_t *pub);
-extern void dhd_os_sdtxunlock(dhd_pub_t *pub);
 
 int setScheduler(struct task_struct *p, int policy, struct sched_param *param);
 
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -10
index 9c9b8ba..d7f7449 100644
@@ -2603,16 +2603,6 @@ void dhd_os_sdunlock_rxq(dhd_pub_t *pub)
 {
 }
 
-void dhd_os_sdtxlock(dhd_pub_t *pub)
-{
-	dhd_os_sdlock(pub);
-}
-
-void dhd_os_sdtxunlock(dhd_pub_t *pub)
-{
-	dhd_os_sdunlock(pub);
-}
-
 static int
 dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 		  wl_event_msg_t *event, void **data)
Signature · 1 line
1.7.1
author
#7 lore raw

PATCH 7/119 staging: brcm80211: remove empty sdrxqlock from fullmac

In reply to Franky Lin

Remove empty lock functions for sdio rx queue

---
 drivers/staging/brcm80211/brcmfmac/dhd.h       |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |    8 ------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c  |   28 ------------------------
 3 files changed, 0 insertions(+), 38 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
index 4d92d69..01bacdb 100644
@@ -974,8 +974,6 @@ extern void dhd_os_sdlock(dhd_pub_t *pub);
 extern void dhd_os_sdunlock(dhd_pub_t *pub);
 extern void dhd_os_sdlock_txq(dhd_pub_t *pub);
 extern void dhd_os_sdunlock_txq(dhd_pub_t *pub);
-extern void dhd_os_sdlock_rxq(dhd_pub_t *pub);
-extern void dhd_os_sdunlock_rxq(dhd_pub_t *pub);
 extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t *pub);
 extern void dhd_customer_gpio_wlan_ctrl(int onoff);
 extern int dhd_custom_get_mac_address(unsigned char *buf);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -8
index d7f7449..4811d7a 100644
@@ -2595,14 +2595,6 @@ void dhd_os_sdunlock_txq(dhd_pub_t *pub)
 	spin_unlock_bh(&dhd->txqlock);
 }
 
-void dhd_os_sdlock_rxq(dhd_pub_t *pub)
-{
-}
-
-void dhd_os_sdunlock_rxq(dhd_pub_t *pub)
-{
-}
-
 static int
 dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 		  wl_event_msg_t *event, void **data)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -28
index a803848..dcfebac 100644
@@ -796,10 +796,8 @@ static void dhdsdio_chip_detach(struct dhd_bus *bus);
  */
 static void dhdsdio_pktfree2(dhd_bus_t *bus, struct sk_buff *pkt)
 {
-	dhd_os_sdlock_rxq(bus->dhd);
 	if ((bus->bus != SPI_BUS) || bus->usebufpool)
 		brcmu_pkt_buf_free_skb(pkt);
-	dhd_os_sdunlock_rxq(bus->dhd);
 }
 
 static void dhd_dongle_setmemsize(struct dhd_bus *bus, int mem_size)
@@ -3379,8 +3377,6 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
 
 	/* If there's a descriptor, generate the packet chain */
 	if (bus->glomd) {
-		dhd_os_sdlock_rxq(bus->dhd);
-
 		pfirst = plast = pnext = NULL;
 		dlen = (u16) (bus->glomd->len);
 		dptr = bus->glomd->data;
@@ -3464,8 +3460,6 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
 		brcmu_pkt_buf_free_skb(bus->glomd);
 		bus->glomd = NULL;
 		bus->nextlen = 0;
-
-		dhd_os_sdunlock_rxq(bus->dhd);
 	}
 
 	/* Ok -- either we just generated a packet chain,
@@ -3525,9 +3519,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
 			} else {
 				bus->glomerr = 0;
 				dhdsdio_rxfail(bus, true, false);
-				dhd_os_sdlock_rxq(bus->dhd);
 				brcmu_pkt_buf_free_skb(bus->glom);
-				dhd_os_sdunlock_rxq(bus->dhd);
 				bus->rxglomfail++;
 				bus->glom = NULL;
 			}
@@ -3658,9 +3650,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
 			} else {
 				bus->glomerr = 0;
 				dhdsdio_rxfail(bus, true, false);
-				dhd_os_sdlock_rxq(bus->dhd);
 				brcmu_pkt_buf_free_skb(bus->glom);
-				dhd_os_sdunlock_rxq(bus->dhd);
 				bus->rxglomfail++;
 				bus->glom = NULL;
 			}
@@ -3673,7 +3663,6 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
 		bus->glom = NULL;
 		plast = NULL;
 
-		dhd_os_sdlock_rxq(bus->dhd);
 		for (num = 0; pfirst; rxseq++, pfirst = pnext) {
 			pnext = pfirst->next;
 			pfirst->next = NULL;
@@ -3752,7 +3741,6 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
 			}
 #endif				/* DHD_DEBUG */
 		}
-		dhd_os_sdunlock_rxq(bus->dhd);
 		if (num) {
 			dhd_os_sdunlock(bus->dhd);
 			dhd_rx_frame(bus->dhd, ifidx, save_pfirst, num);
@@ -3860,7 +3848,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 			 * or non-data frame.
 			 */
 			/* Allocate a packet buffer */
-			dhd_os_sdlock_rxq(bus->dhd);
 			pkt = brcmu_pkt_buf_get_skb(rdlen + DHD_SDALIGN);
 			if (!pkt) {
 				if (bus->bus == SPI_BUS) {
@@ -3894,7 +3881,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 							rdlen, sdret));
 						/* dhd.rx_ctlerrs is higher */
 						bus->rxc_errors++;
-						dhd_os_sdunlock_rxq(bus->dhd);
 						dhdsdio_rxfail(bus, true,
 						       (bus->bus ==
 							SPI_BUS) ? false
@@ -3910,9 +3896,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 						   " len %d rdlen %d expected"
 						   " rxseq %d\n", __func__,
 						   len, rdlen, rxseq));
-					/* Just go try again w/normal
-					header read */
-					dhd_os_sdunlock_rxq(bus->dhd);
 					continue;
 				}
 			} else {
@@ -3936,7 +3919,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 						__func__, rdlen, sdret));
 					brcmu_pkt_buf_free_skb(pkt);
 					bus->dhd->rx_errors++;
-					dhd_os_sdunlock_rxq(bus->dhd);
 					/* Force retry w/normal header read.
 					 * Don't attempt NAK for
 					 * gSPI
@@ -3948,7 +3930,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 					continue;
 				}
 			}
-			dhd_os_sdunlock_rxq(bus->dhd);
 
 			/* Now check the header */
 			memcpy(bus->rxhdr, rxbuf, SDPCM_HDRLEN);
@@ -4246,18 +4227,15 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 			continue;
 		}
 
-		dhd_os_sdlock_rxq(bus->dhd);
 		pkt = brcmu_pkt_buf_get_skb(rdlen + firstread + DHD_SDALIGN);
 		if (!pkt) {
 			/* Give up on data, request rtx of events */
 			DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed: rdlen %d"
 				   " chan %d\n", __func__, rdlen, chan));
 			bus->dhd->rx_dropped++;
-			dhd_os_sdunlock_rxq(bus->dhd);
 			dhdsdio_rxfail(bus, false, RETRYCHAN(chan));
 			continue;
 		}
-		dhd_os_sdunlock_rxq(bus->dhd);
 
 		ASSERT(!(pkt->prev));
 
@@ -4281,9 +4259,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 					SDPCM_DATA_CHANNEL)
 				       ? "data" : "test")),
 				   sdret));
-			dhd_os_sdlock_rxq(bus->dhd);
 			brcmu_pkt_buf_free_skb(pkt);
-			dhd_os_sdunlock_rxq(bus->dhd);
 			bus->dhd->rx_errors++;
 			dhdsdio_rxfail(bus, true, RETRYCHAN(chan));
 			continue;
@@ -4340,15 +4316,11 @@ deliver:
 #endif				/* SDTEST */
 
 		if (pkt->len == 0) {
-			dhd_os_sdlock_rxq(bus->dhd);
 			brcmu_pkt_buf_free_skb(pkt);
-			dhd_os_sdunlock_rxq(bus->dhd);
 			continue;
 		} else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
 			DHD_ERROR(("%s: rx protocol error\n", __func__));
-			dhd_os_sdlock_rxq(bus->dhd);
 			brcmu_pkt_buf_free_skb(pkt);
-			dhd_os_sdunlock_rxq(bus->dhd);
 			bus->dhd->rx_errors++;
 			continue;
 		}
Signature · 1 line
1.7.1
author
#8 lore raw

PATCH 8/119 staging: brcm80211: move sdtxqlock codes to dhd_sdio.c

In reply to Franky Lin

Move sdio specific tx queue lock codes to dhd_sdio.c for fullmac

---
 drivers/staging/brcm80211/brcmfmac/dhd.h       |    2 --
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   18 ------------------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c  |   14 +++++++++-----
 3 files changed, 9 insertions(+), 25 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
index 01bacdb..a4dcaf8 100644
@@ -972,8 +972,6 @@ extern void dhd_os_close_image(void *image);
 extern void dhd_os_wd_timer(void *bus, uint wdtick);
 extern void dhd_os_sdlock(dhd_pub_t *pub);
 extern void dhd_os_sdunlock(dhd_pub_t *pub);
-extern void dhd_os_sdlock_txq(dhd_pub_t *pub);
-extern void dhd_os_sdunlock_txq(dhd_pub_t *pub);
 extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t *pub);
 extern void dhd_customer_gpio_wlan_ctrl(int onoff);
 extern int dhd_custom_get_mac_address(unsigned char *buf);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -18
index 4811d7a..dfbbda7 100644
@@ -232,7 +232,6 @@ typedef struct dhd_info {
 	bool wd_timer_valid;
 	struct tasklet_struct tasklet;
 	spinlock_t sdlock;
-	spinlock_t txqlock;
 	/* Thread based operation */
 	bool threads_only;
 	struct semaphore sdsem;
@@ -1918,7 +1917,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
 
 	/* Initialize the spinlocks */
 	spin_lock_init(&dhd->sdlock);
-	spin_lock_init(&dhd->txqlock);
 
 	/* Link to info module */
 	dhd->pub.info = dhd;
@@ -2579,22 +2577,6 @@ void dhd_os_sdunlock(dhd_pub_t *pub)
 		spin_unlock_bh(&dhd->sdlock);
 }
 
-void dhd_os_sdlock_txq(dhd_pub_t *pub)
-{
-	dhd_info_t *dhd;
-
-	dhd = (dhd_info_t *) (pub->info);
-	spin_lock_bh(&dhd->txqlock);
-}
-
-void dhd_os_sdunlock_txq(dhd_pub_t *pub)
-{
-	dhd_info_t *dhd;
-
-	dhd = (dhd_info_t *) (pub->info);
-	spin_unlock_bh(&dhd->txqlock);
-}
-
 static int
 dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 		  wl_event_msg_t *event, void **data)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +9 -5
index dcfebac..48550f3 100644
@@ -592,6 +592,8 @@ typedef struct dhd_bus {
 	u8 *ctrl_frame_buf;
 	u32 ctrl_frame_len;
 	bool ctrl_frame_stat;
+
+	spinlock_t txqlock;
 } dhd_bus_t;
 
 typedef volatile struct _sbconfig {
@@ -1370,7 +1372,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
 		bus->fcqueued++;
 
 		/* Priority based enq */
-		dhd_os_sdlock_txq(bus->dhd);
+		spin_lock_bh(&bus->txqlock);
 		if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
 			skb_pull(pkt, SDPCM_HDRLEN);
 			dhd_txcomplete(bus->dhd, pkt, false);
@@ -1380,7 +1382,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
 		} else {
 			ret = 0;
 		}
-		dhd_os_sdunlock_txq(bus->dhd);
+		spin_unlock_bh(&bus->txqlock);
 
 		if (pktq_len(&bus->txq) >= TXHI)
 			dhd_txflowcontrol(bus->dhd, 0, ON);
@@ -1446,13 +1448,13 @@ static uint dhdsdio_sendfromq(dhd_bus_t *bus, uint maxframes)
 
 	/* Send frames until the limit or some other event */
 	for (cnt = 0; (cnt < maxframes) && DATAOK(bus); cnt++) {
-		dhd_os_sdlock_txq(bus->dhd);
+		spin_lock_bh(&bus->txqlock);
 		pkt = brcmu_pktq_mdeq(&bus->txq, tx_prec_map, &prec_out);
 		if (pkt == NULL) {
-			dhd_os_sdunlock_txq(bus->dhd);
+			spin_unlock_bh(&bus->txqlock);
 			break;
 		}
-		dhd_os_sdunlock_txq(bus->dhd);
+		spin_unlock_bh(&bus->txqlock);
 		datalen = pkt->len - SDPCM_HDRLEN;
 
 #ifndef SDTEST
@@ -5264,6 +5266,8 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
 		goto fail;
 	}
 
+	spin_lock_init(&bus->txqlock);
+
 	/* Attach to the dhd/OS/network interface */
 	bus->dhd = dhd_attach(bus, SDPCM_RESERVE);
 	if (!bus->dhd) {
Signature · 1 line
1.7.1
author
#9 lore raw

PATCH 9/119 staging: brcm80211: remove unused files from fullmac

In reply to Franky Lin

aiutils.c and pcicfg.h are no longer needed by fullmac

---
 drivers/staging/brcm80211/brcmfmac/aiutils.c |    1 -
 drivers/staging/brcm80211/brcmfmac/pcicfg.h  |   50 --------------------------
 2 files changed, 0 insertions(+), 51 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/aiutils.c
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/pcicfg.h
drivers/staging/brcm80211/brcmfmac/aiutils.c deleted +0 -1
deleted file mode 100644
index e648086..0000000
@@ -1 +0,0 @@
-#include "../util/aiutils.c"
drivers/staging/brcm80211/brcmfmac/pcicfg.h deleted +0 -50

50 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#10 lore raw

PATCH 10/119 staging: brcm80211: remove code for unsupported chipsets from brcmsmac

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The brcmsmac driver code contains code fragments for chipsets that are not supported. These have been removed from the brcmsmac source files.

---
 drivers/staging/brcm80211/brcmsmac/aiutils.c |   52 +-------------------------
 drivers/staging/brcm80211/brcmsmac/bmac.c    |    6 +--
 drivers/staging/brcm80211/brcmsmac/main.c    |   10 +----
 3 files changed, 4 insertions(+), 64 deletions(-)
drivers/staging/brcm80211/brcmsmac/aiutils.c +1 -51
index 82809cb..d41104f 100644
@@ -1157,25 +1157,6 @@ static si_info_t *ai_doattach(si_info_t *sii,
 		goto exit;
 	}
 
-	/* assume current core is CC */
-	if ((sii->pub.ccrev == 0x25)
-	    &&
-	    ((sih->chip == BCM43236_CHIP_ID
-	      || sih->chip == BCM43235_CHIP_ID
-	      || sih->chip == BCM43238_CHIP_ID)
-	     && (sii->pub.chiprev <= 2))) {
-
-		if ((cc->chipstatus & CST43236_BP_CLK) != 0) {
-			uint clkdiv;
-			clkdiv = R_REG(&cc->clkdiv);
-			/* otp_clk_div is even number, 120/14 < 9mhz */
-			clkdiv = (clkdiv & ~CLKD_OTP) | (14 << CLKD_OTP_SHIFT);
-			W_REG(&cc->clkdiv, clkdiv);
-			SI_ERROR(("%s: set clkdiv to %x\n", __func__, clkdiv));
-		}
-		udelay(10);
-	}
-
 	/* Init nvram from sprom/otp if they exist */
 	if (srom_var_init
 	    (&sii->pub, bustype, regs, vars, varsz)) {
@@ -1215,8 +1196,7 @@ static si_info_t *ai_doattach(si_info_t *sii,
 		pcicore_attach(sii->pch, pvars, SI_DOATTACH);
 	}
 
-	if ((sih->chip == BCM43224_CHIP_ID) ||
-	    (sih->chip == BCM43421_CHIP_ID)) {
+	if (sih->chip == BCM43224_CHIP_ID) {
 		/*
 		 * enable 12 mA drive strenth for 43224 and
 		 * set chipControl register bit 15
@@ -1247,11 +1227,6 @@ static si_info_t *ai_doattach(si_info_t *sii,
 				   CCTRL_4313_12MA_LED_DRIVE);
 	}
 
-	if (sih->chip == BCM4331_CHIP_ID) {
-		/* Enable Ext PA lines depending on chip package option */
-		ai_chipcontrl_epa4331(sih, true);
-	}
-
 	return sii;
  exit:
 	if (sih->bustype == PCI_BUS) {
@@ -2283,18 +2258,8 @@ bool ai_is_sprom_available(struct si_pub *sih)
 	}
 
 	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		return (sih->chipst & CST4329_SPROM_SEL) != 0;
-	case BCM4319_CHIP_ID:
-		return (sih->chipst & CST4319_SPROM_SEL) != 0;
-	case BCM4336_CHIP_ID:
-		return (sih->chipst & CST4336_SPROM_PRESENT) != 0;
-	case BCM4330_CHIP_ID:
-		return (sih->chipst & CST4330_SPROM_PRESENT) != 0;
 	case BCM4313_CHIP_ID:
 		return (sih->chipst & CST4313_SPROM_PRESENT) != 0;
-	case BCM4331_CHIP_ID:
-		return (sih->chipst & CST4331_SPROM_PRESENT) != 0;
 	default:
 		return true;
 	}
@@ -2303,26 +2268,11 @@ bool ai_is_sprom_available(struct si_pub *sih)
 bool ai_is_otp_disabled(struct si_pub *sih)
 {
 	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		return (sih->chipst & CST4329_SPROM_OTP_SEL_MASK) ==
-		    CST4329_OTP_PWRDN;
-	case BCM4319_CHIP_ID:
-		return (sih->chipst & CST4319_SPROM_OTP_SEL_MASK) ==
-		    CST4319_OTP_PWRDN;
-	case BCM4336_CHIP_ID:
-		return (sih->chipst & CST4336_OTP_PRESENT) == 0;
-	case BCM4330_CHIP_ID:
-		return (sih->chipst & CST4330_OTP_PRESENT) == 0;
 	case BCM4313_CHIP_ID:
 		return (sih->chipst & CST4313_OTP_PRESENT) == 0;
 		/* These chips always have their OTP on */
 	case BCM43224_CHIP_ID:
 	case BCM43225_CHIP_ID:
-	case BCM43421_CHIP_ID:
-	case BCM43235_CHIP_ID:
-	case BCM43236_CHIP_ID:
-	case BCM43238_CHIP_ID:
-	case BCM4331_CHIP_ID:
 	default:
 		return false;
 	}
drivers/staging/brcm80211/brcmsmac/bmac.c +2 -4
index f8878c7..735230f 100644
@@ -1980,8 +1980,7 @@ bool brcms_b_radio_read_hwdisabled(struct brcms_c_hw_info *wlc_hw)
 
 		/* AI chip doesn't restore bar0win2 on hibernation/resume, need sw fixup */
 		if ((wlc_hw->sih->chip == BCM43224_CHIP_ID) ||
-		    (wlc_hw->sih->chip == BCM43225_CHIP_ID) ||
-		    (wlc_hw->sih->chip == BCM43421_CHIP_ID))
+		    (wlc_hw->sih->chip == BCM43225_CHIP_ID))
 			wlc_hw->regs =
 			    (d11regs_t *) ai_setcore(wlc_hw->sih, D11_CORE_ID,
 						     0);
@@ -2022,8 +2021,7 @@ void brcms_b_hw_up(struct brcms_c_hw_info *wlc_hw)
 
 		/* AI chip doesn't restore bar0win2 on hibernation/resume, need sw fixup */
 		if ((wlc_hw->sih->chip == BCM43224_CHIP_ID) ||
-		    (wlc_hw->sih->chip == BCM43225_CHIP_ID) ||
-		    (wlc_hw->sih->chip == BCM43421_CHIP_ID))
+		    (wlc_hw->sih->chip == BCM43225_CHIP_ID))
 			wlc_hw->regs =
 			    (d11regs_t *) ai_setcore(wlc_hw->sih, D11_CORE_ID,
 						     0);
drivers/staging/brcm80211/brcmsmac/main.c +1 -9
index 611873c..ca9f195 100644
@@ -1586,15 +1586,7 @@ void *brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
 
 	/* initialize radio_mpc_disable according to wlc->mpc */
 	brcms_c_radio_mpc_upd(wlc);
-
-	if ((wlc->pub->sih->chip) == BCM43235_CHIP_ID) {
-		if ((getintvar(wlc->pub->vars, "aa2g") == 7) ||
-		    (getintvar(wlc->pub->vars, "aa5g") == 7)) {
-			brcms_b_antsel_set(wlc->hw, 1);
-		}
-	} else {
-		brcms_b_antsel_set(wlc->hw, wlc->asi->antsel_avail);
-	}
+	brcms_b_antsel_set(wlc->hw, wlc->asi->antsel_avail);
 
 	if (perr)
 		*perr = 0;
Signature · 1 line
1.7.1
author
#11 lore raw

PATCH 11/119 staging: brcm80211: remove unsupported chipset code from brcmsmac phy

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

the phy sources contained some code fragments for chipsets that are not supported by this driver, which have been removed.

---
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c |   14 +--
 drivers/staging/brcm80211/brcmsmac/phy/phy_n.c   |  160 ++++++----------------
 2 files changed, 44 insertions(+), 130 deletions(-)
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c +5 -9
index 79008a9..dd56f10 100644
@@ -981,9 +981,8 @@ wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
 	pi->tbl_data_hi = tblDataHi;
 	pi->tbl_data_lo = tblDataLo;
 
-	if ((pi->sh->chip == BCM43224_CHIP_ID ||
-	     pi->sh->chip == BCM43421_CHIP_ID) &&
-	    (pi->sh->chiprev == 1)) {
+	if (pi->sh->chip == BCM43224_CHIP_ID &&
+	    pi->sh->chiprev == 1) {
 		pi->tbl_addr = tblAddr;
 		pi->tbl_save_id = tbl_id;
 		pi->tbl_save_offset = tbl_offset;
@@ -992,8 +991,7 @@ wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
 
 void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val)
 {
-	if ((pi->sh->chip == BCM43224_CHIP_ID ||
-	     pi->sh->chip == BCM43421_CHIP_ID) &&
+	if ((pi->sh->chip == BCM43224_CHIP_ID) &&
 	    (pi->sh->chiprev == 1) &&
 	    (pi->tbl_save_id == NPHY_TBL_ID_ANTSWCTRLLUT)) {
 		read_phy_reg(pi, pi->tbl_data_lo);
@@ -1029,8 +1027,7 @@ wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
 
 	for (idx = 0; idx < ptbl_info->tbl_len; idx++) {
 
-		if ((pi->sh->chip == BCM43224_CHIP_ID ||
-		     pi->sh->chip == BCM43421_CHIP_ID) &&
+		if ((pi->sh->chip == BCM43224_CHIP_ID) &&
 		    (pi->sh->chiprev == 1) &&
 		    (tbl_id == NPHY_TBL_ID_ANTSWCTRLLUT)) {
 			read_phy_reg(pi, tblDataLo);
@@ -1070,8 +1067,7 @@ wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
 
 	for (idx = 0; idx < ptbl_info->tbl_len; idx++) {
 
-		if ((pi->sh->chip == BCM43224_CHIP_ID ||
-		     pi->sh->chip == BCM43421_CHIP_ID) &&
+		if ((pi->sh->chip == BCM43224_CHIP_ID) &&
 		    (pi->sh->chiprev == 1)) {
 			(void)read_phy_reg(pi, tblDataLo);
 
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c +39 -121

245 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#12 lore raw

PATCH 12/119 staging: brcm80211: remove otp power control functions

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

For the devices supported by brcmsmac driver the OTP device is always powered. Functions for reading power status and changing it are not needed.

---
 drivers/staging/brcm80211/brcmsmac/aiutils.c |   14 --------------
 drivers/staging/brcm80211/brcmsmac/aiutils.h |    2 --
 drivers/staging/brcm80211/brcmsmac/otp.c     |   15 ++-------------
 3 files changed, 2 insertions(+), 29 deletions(-)
drivers/staging/brcm80211/brcmsmac/aiutils.c +0 -14
index d41104f..2018664 100644
@@ -2277,17 +2277,3 @@ bool ai_is_otp_disabled(struct si_pub *sih)
 		return false;
 	}
 }
-
-bool ai_is_otp_powered(struct si_pub *sih)
-{
-	if (PMUCTL_ENAB(sih))
-		return si_pmu_is_otp_powered(sih);
-	return true;
-}
-
-void ai_otp_power(struct si_pub *sih, bool on)
-{
-	if (PMUCTL_ENAB(sih))
-		si_pmu_otp_power(sih, on);
-	udelay(1000);
-}
drivers/staging/brcm80211/brcmsmac/aiutils.h +0 -2
index 66d9471..965eb94 100644
@@ -558,8 +558,6 @@ extern u32 ai_gpiocontrol(struct si_pub *sih, u32 mask, u32 val,
 
 /* OTP status */
 extern bool ai_is_otp_disabled(struct si_pub *sih);
-extern bool ai_is_otp_powered(struct si_pub *sih);
-extern void ai_otp_power(struct si_pub *sih, bool on);
 
 /* SPROM availability */
 extern bool ai_is_sprom_available(struct si_pub *sih);
drivers/staging/brcm80211/brcmsmac/otp.c +2 -13
index 2cda60f..4e19b35 100644
@@ -310,10 +310,7 @@ static void *ipxotp_init(struct si_pub *sih)
 	if (ai_is_otp_disabled(sih))
 		return NULL;
 
-	/* Make sure OTP is powered up */
-	if (!ai_is_otp_powered(sih))
-		return NULL;
-
+	/* OTP is always powered */
 	oi = &otpinfo;
 
 	/* Check for otp size */
@@ -518,15 +515,10 @@ void *otp_init(struct si_pub *sih)
 int
 otp_read_region(struct si_pub *sih, int region, u16 *data,
 				 uint *wlen) {
-	bool wasup = false;
 	void *oh;
 	int err = 0;
 
-	wasup = ai_is_otp_powered(sih);
-	if (!wasup)
-		ai_otp_power(sih, true);
-
-	if (!ai_is_otp_powered(sih) || ai_is_otp_disabled(sih)) {
+	if (ai_is_otp_disabled(sih)) {
 		err = -EPERM;
 		goto out;
 	}
@@ -540,9 +532,6 @@ otp_read_region(struct si_pub *sih, int region, u16 *data,
 	err = (((otpinfo_t *) oh)->fn->read_region) (oh, region, data, wlen);
 
  out:
-	if (!wasup)
-		ai_otp_power(sih, false);
-
 	return err;
 }
 
Signature · 1 line
1.7.1
author
#13 lore raw

PATCH 13/119 staging: brcm80211: remove code from pmu.c related to unsupported chipsets

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The pmu source file contains several code fragments for chipsets that are not supported by this driver. These have been removed.

---
 drivers/staging/brcm80211/brcmsmac/pmu.c | 1424 ------------------------------
 drivers/staging/brcm80211/brcmsmac/pmu.h |    3 -
 2 files changed, 0 insertions(+), 1427 deletions(-)
drivers/staging/brcm80211/brcmsmac/pmu.c +0 -1424
index 0b7ab82..d7ca7ed 100644
@@ -596,432 +596,11 @@
 /* PMU resource up transition time in ILP cycles */
 #define PMURES_UP_TRANSITION	2
 
-/* Setup resource up/down timers */
-typedef struct {
-	u8 resnum;
-	u16 updown;
-} pmu_res_updown_t;
-
-/* Change resource dependancies masks */
-typedef struct {
-	u32 res_mask;	/* resources (chip specific) */
-	s8 action;		/* action */
-	u32 depend_mask;	/* changes to the dependancies mask */
-	/* action is taken when filter is NULL or return true: */
-	 bool(*filter) (struct si_pub *sih);
-} pmu_res_depend_t;
-
-/* setup pll and query clock speed */
-typedef struct {
-	u16 fref;
-	u8 xf;
-	u8 p1div;
-	u8 p2div;
-	u8 ndiv_int;
-	u32 ndiv_frac;
-} pmu1_xtaltab0_t;
-
-/*
- * prototypes used in resource tables
- */
-static bool si_pmu_res_depfltr_bb(struct si_pub *sih);
-static bool si_pmu_res_depfltr_ncb(struct si_pub *sih);
-static bool si_pmu_res_depfltr_paldo(struct si_pub *sih);
-static bool si_pmu_res_depfltr_npaldo(struct si_pub *sih);
-
-static const pmu_res_updown_t bcm4328a0_res_updown[] = {
-	{
-	RES4328_EXT_SWITCHER_PWM, 0x0101}, {
-	RES4328_BB_SWITCHER_PWM, 0x1f01}, {
-	RES4328_BB_SWITCHER_BURST, 0x010f}, {
-	RES4328_BB_EXT_SWITCHER_BURST, 0x0101}, {
-	RES4328_ILP_REQUEST, 0x0202}, {
-	RES4328_RADIO_SWITCHER_PWM, 0x0f01}, {
-	RES4328_RADIO_SWITCHER_BURST, 0x0f01}, {
-	RES4328_ROM_SWITCH, 0x0101}, {
-	RES4328_PA_REF_LDO, 0x0f01}, {
-	RES4328_RADIO_LDO, 0x0f01}, {
-	RES4328_AFE_LDO, 0x0f01}, {
-	RES4328_PLL_LDO, 0x0f01}, {
-	RES4328_BG_FILTBYP, 0x0101}, {
-	RES4328_TX_FILTBYP, 0x0101}, {
-	RES4328_RX_FILTBYP, 0x0101}, {
-	RES4328_XTAL_PU, 0x0101}, {
-	RES4328_XTAL_EN, 0xa001}, {
-	RES4328_BB_PLL_FILTBYP, 0x0101}, {
-	RES4328_RF_PLL_FILTBYP, 0x0101}, {
-	RES4328_BB_PLL_PU, 0x0701}
-};
-
-static const pmu_res_depend_t bcm4328a0_res_depend[] = {
-	/* Adjust ILP request resource not to force ext/BB switchers into burst mode */
-	{
-	PMURES_BIT(RES4328_ILP_REQUEST),
-		    RES_DEPEND_SET,
-		    PMURES_BIT(RES4328_EXT_SWITCHER_PWM) |
-		    PMURES_BIT(RES4328_BB_SWITCHER_PWM), NULL}
-};
-
-static const pmu_res_updown_t bcm4325a0_res_updown_qt[] = {
-	{
-	RES4325_HT_AVAIL, 0x0300}, {
-	RES4325_BBPLL_PWRSW_PU, 0x0101}, {
-	RES4325_RFPLL_PWRSW_PU, 0x0101}, {
-	RES4325_ALP_AVAIL, 0x0100}, {
-	RES4325_XTAL_PU, 0x1000}, {
-	RES4325_LNLDO1_PU, 0x0800}, {
-	RES4325_CLDO_CBUCK_PWM, 0x0101}, {
-	RES4325_CBUCK_PWM, 0x0803}
-};
-
-static const pmu_res_updown_t bcm4325a0_res_updown[] = {
-	{
-	RES4325_XTAL_PU, 0x1501}
-};
-
-static const pmu_res_depend_t bcm4325a0_res_depend[] = {
-	/* Adjust OTP PU resource dependencies - remove BB BURST */
-	{
-	PMURES_BIT(RES4325_OTP_PU),
-		    RES_DEPEND_REMOVE,
-		    PMURES_BIT(RES4325_BUCK_BOOST_BURST), NULL},
-	    /* Adjust ALP/HT Avail resource dependencies - bring up BB along if it is used. */
-	{
-	PMURES_BIT(RES4325_ALP_AVAIL) | PMURES_BIT(RES4325_HT_AVAIL),
-		    RES_DEPEND_ADD,
-		    PMURES_BIT(RES4325_BUCK_BOOST_BURST) |
-		    PMURES_BIT(RES4325_BUCK_BOOST_PWM), si_pmu_res_depfltr_bb},
-	    /* Adjust HT Avail resource dependencies - bring up RF switches along with HT. */
-	{
-	PMURES_BIT(RES4325_HT_AVAIL),
-		    RES_DEPEND_ADD,
-		    PMURES_BIT(RES4325_RX_PWRSW_PU) |
-		    PMURES_BIT(RES4325_TX_PWRSW_PU) |
-		    PMURES_BIT(RES4325_LOGEN_PWRSW_PU) |
-		    PMURES_BIT(RES4325_AFE_PWRSW_PU), NULL},
-	    /* Adjust ALL resource dependencies - remove CBUCK dependancies if it is not used. */
-	{
-	PMURES_BIT(RES4325_ILP_REQUEST) |
-		    PMURES_BIT(RES4325_ABUCK_BURST) |
-		    PMURES_BIT(RES4325_ABUCK_PWM) |
-		    PMURES_BIT(RES4325_LNLDO1_PU) |
-		    PMURES_BIT(RES4325C1_LNLDO2_PU) |
-		    PMURES_BIT(RES4325_XTAL_PU) |
-		    PMURES_BIT(RES4325_ALP_AVAIL) |
-		    PMURES_BIT(RES4325_RX_PWRSW_PU) |
-		    PMURES_BIT(RES4325_TX_PWRSW_PU) |
-		    PMURES_BIT(RES4325_RFPLL_PWRSW_PU) |
-		    PMURES_BIT(RES4325_LOGEN_PWRSW_PU) |
-		    PMURES_BIT(RES4325_AFE_PWRSW_PU) |
-		    PMURES_BIT(RES4325_BBPLL_PWRSW_PU) |
-		    PMURES_BIT(RES4325_HT_AVAIL), RES_DEPEND_REMOVE,
-		    PMURES_BIT(RES4325B0_CBUCK_LPOM) |
-		    PMURES_BIT(RES4325B0_CBUCK_BURST) |
-		    PMURES_BIT(RES4325B0_CBUCK_PWM), si_pmu_res_depfltr_ncb}
-};
-
-static const pmu_res_updown_t bcm4315a0_res_updown_qt[] = {
-	{
-	RES4315_HT_AVAIL, 0x0101}, {
-	RES4315_XTAL_PU, 0x0100}, {
-	RES4315_LNLDO1_PU, 0x0100}, {
-	RES4315_PALDO_PU, 0x0100}, {
-	RES4315_CLDO_PU, 0x0100}, {
-	RES4315_CBUCK_PWM, 0x0100}, {
-	RES4315_CBUCK_BURST, 0x0100}, {
-	RES4315_CBUCK_LPOM, 0x0100}
-};
-
-static const pmu_res_updown_t bcm4315a0_res_updown[] = {
-	{
-	RES4315_XTAL_PU, 0x2501}
-};
-
-static const pmu_res_depend_t bcm4315a0_res_depend[] = {
-	/* Adjust OTP PU resource dependencies - not need PALDO unless write */
-	{
-	PMURES_BIT(RES4315_OTP_PU),
-		    RES_DEPEND_REMOVE,
-		    PMURES_BIT(RES4315_PALDO_PU), si_pmu_res_depfltr_npaldo},
-	    /* Adjust ALP/HT Avail resource dependencies - bring up PALDO along if it is used. */
-	{
-	PMURES_BIT(RES4315_ALP_AVAIL) | PMURES_BIT(RES4315_HT_AVAIL),
-		    RES_DEPEND_ADD,
-		    PMURES_BIT(RES4315_PALDO_PU), si_pmu_res_depfltr_paldo},
-	    /* Adjust HT Avail resource dependencies - bring up RF switches along with HT. */
-	{
-	PMURES_BIT(RES4315_HT_AVAIL),
-		    RES_DEPEND_ADD,
-		    PMURES_BIT(RES4315_RX_PWRSW_PU) |
-		    PMURES_BIT(RES4315_TX_PWRSW_PU) |
-		    PMURES_BIT(RES4315_LOGEN_PWRSW_PU) |
-		    PMURES_BIT(RES4315_AFE_PWRSW_PU), NULL},
-	    /* Adjust ALL resource dependencies - remove CBUCK dependancies if it is not used. */
-	{
-	PMURES_BIT(RES4315_CLDO_PU) | PMURES_BIT(RES4315_ILP_REQUEST) |
-		    PMURES_BIT(RES4315_LNLDO1_PU) |
-		    PMURES_BIT(RES4315_OTP_PU) |
-		    PMURES_BIT(RES4315_LNLDO2_PU) |
-		    PMURES_BIT(RES4315_XTAL_PU) |
-		    PMURES_BIT(RES4315_ALP_AVAIL) |
-		    PMURES_BIT(RES4315_RX_PWRSW_PU) |
-		    PMURES_BIT(RES4315_TX_PWRSW_PU) |
-		    PMURES_BIT(RES4315_RFPLL_PWRSW_PU) |
-		    PMURES_BIT(RES4315_LOGEN_PWRSW_PU) |
-		    PMURES_BIT(RES4315_AFE_PWRSW_PU) |
-		    PMURES_BIT(RES4315_BBPLL_PWRSW_PU) |
-		    PMURES_BIT(RES4315_HT_AVAIL), RES_DEPEND_REMOVE,
-		    PMURES_BIT(RES4315_CBUCK_LPOM) |
-		    PMURES_BIT(RES4315_CBUCK_BURST) |
-		    PMURES_BIT(RES4315_CBUCK_PWM), si_pmu_res_depfltr_ncb}
-};
-
-	/* 4329 specific. needs to come back this issue later */
-static const pmu_res_updown_t bcm4329_res_updown[] = {
-	{
-	RES4329_XTAL_PU, 0x1501}
-};
-
-static const pmu_res_depend_t bcm4329_res_depend[] = {
-	/* Adjust HT Avail resource dependencies */
-	{
-	PMURES_BIT(RES4329_HT_AVAIL),
-		    RES_DEPEND_ADD,
-		    PMURES_BIT(RES4329_CBUCK_LPOM) |
-		    PMURES_BIT(RES4329_CBUCK_BURST) |
-		    PMURES_BIT(RES4329_CBUCK_PWM) |
-		    PMURES_BIT(RES4329_CLDO_PU) |
-		    PMURES_BIT(RES4329_PALDO_PU) |
-		    PMURES_BIT(RES4329_LNLDO1_PU) |
-		    PMURES_BIT(RES4329_XTAL_PU) |
-		    PMURES_BIT(RES4329_ALP_AVAIL) |
-		    PMURES_BIT(RES4329_RX_PWRSW_PU) |
-		    PMURES_BIT(RES4329_TX_PWRSW_PU) |
-		    PMURES_BIT(RES4329_RFPLL_PWRSW_PU) |
-		    PMURES_BIT(RES4329_LOGEN_PWRSW_PU) |
-		    PMURES_BIT(RES4329_AFE_PWRSW_PU) |
-		    PMURES_BIT(RES4329_BBPLL_PWRSW_PU), NULL}
-};
-
-static const pmu_res_updown_t bcm4319a0_res_updown_qt[] = {
-	{
-	RES4319_HT_AVAIL, 0x0101}, {
-	RES4319_XTAL_PU, 0x0100}, {
-	RES4319_LNLDO1_PU, 0x0100}, {
-	RES4319_PALDO_PU, 0x0100}, {
-	RES4319_CLDO_PU, 0x0100}, {
-	RES4319_CBUCK_PWM, 0x0100}, {
-	RES4319_CBUCK_BURST, 0x0100}, {
-	RES4319_CBUCK_LPOM, 0x0100}
-};
-
-static const pmu_res_updown_t bcm4319a0_res_updown[] = {
-	{
-	RES4319_XTAL_PU, 0x3f01}
-};
-
-static const pmu_res_depend_t bcm4319a0_res_depend[] = {
-	/* Adjust OTP PU resource dependencies - not need PALDO unless write */
-	{
-	PMURES_BIT(RES4319_OTP_PU),
-		    RES_DEPEND_REMOVE,
-		    PMURES_BIT(RES4319_PALDO_PU), si_pmu_res_depfltr_npaldo},
-	    /* Adjust HT Avail resource dependencies - bring up PALDO along if it is used. */
-	{
-	PMURES_BIT(RES4319_HT_AVAIL),
-		    RES_DEPEND_ADD,
-		    PMURES_BIT(RES4319_PALDO_PU), si_pmu_res_depfltr_paldo},
-	    /* Adjust HT Avail resource dependencies - bring up RF switches along with HT. */
-	{
-	PMURES_BIT(RES4319_HT_AVAIL),
-		    RES_DEPEND_ADD,
-		    PMURES_BIT(RES4319_RX_PWRSW_PU) |
-		    PMURES_BIT(RES4319_TX_PWRSW_PU) |
-		    PMURES_BIT(RES4319_RFPLL_PWRSW_PU) |
-		    PMURES_BIT(RES4319_LOGEN_PWRSW_PU) |
-		    PMURES_BIT(RES4319_AFE_PWRSW_PU), NULL}
-};
-
-static const pmu_res_updown_t bcm4336a0_res_updown_qt[] = {
-	{
-	RES4336_HT_AVAIL, 0x0101}, {
-	RES4336_XTAL_PU, 0x0100}, {
-	RES4336_CLDO_PU, 0x0100}, {
-	RES4336_CBUCK_PWM, 0x0100}, {
-	RES4336_CBUCK_BURST, 0x0100}, {
-	RES4336_CBUCK_LPOM, 0x0100}
-};
-
-static const pmu_res_updown_t bcm4336a0_res_updown[] = {
-	{
-	RES4336_HT_AVAIL, 0x0D01}
-};
-
-static const pmu_res_depend_t bcm4336a0_res_depend[] = {
-	/* Just a dummy entry for now */
-	{
-	PMURES_BIT(RES4336_RSVD), RES_DEPEND_ADD, 0, NULL}
-};
-
-static const pmu_res_updown_t bcm4330a0_res_updown_qt[] = {
-	{
-	RES4330_HT_AVAIL, 0x0101}, {
-	RES4330_XTAL_PU, 0x0100}, {
-	RES4330_CLDO_PU, 0x0100}, {
-	RES4330_CBUCK_PWM, 0x0100}, {
-	RES4330_CBUCK_BURST, 0x0100}, {
-	RES4330_CBUCK_LPOM, 0x0100}
-};
-
-static const pmu_res_updown_t bcm4330a0_res_updown[] = {
-	{
-	RES4330_HT_AVAIL, 0x0e02}
-};
-
-static const pmu_res_depend_t bcm4330a0_res_depend[] = {
-	/* Just a dummy entry for now */
-	{
-	PMURES_BIT(RES4330_HT_AVAIL), RES_DEPEND_ADD, 0, NULL}
-};
-
-/* the following table is based on 1440Mhz fvco */
-static const pmu1_xtaltab0_t pmu1_xtaltab0_1440[] = {
-	{
-	12000, 1, 1, 1, 0x78, 0x0}, {
-	13000, 2, 1, 1, 0x6E, 0xC4EC4E}, {
-	14400, 3, 1, 1, 0x64, 0x0}, {
-	15360, 4, 1, 1, 0x5D, 0xC00000}, {
-	16200, 5, 1, 1, 0x58, 0xE38E38}, {
-	16800, 6, 1, 1, 0x55, 0xB6DB6D}, {
-	19200, 7, 1, 1, 0x4B, 0}, {
-	19800, 8, 1, 1, 0x48, 0xBA2E8B}, {
-	20000, 9, 1, 1, 0x48, 0x0}, {
-	25000, 10, 1, 1, 0x39, 0x999999}, {
-	26000, 11, 1, 1, 0x37, 0x627627}, {
-	30000, 12, 1, 1, 0x30, 0x0}, {
-	37400, 13, 2, 1, 0x4D, 0x15E76}, {
-	38400, 13, 2, 1, 0x4B, 0x0}, {
-	40000, 14, 2, 1, 0x48, 0x0}, {
-	48000, 15, 2, 1, 0x3c, 0x0}, {
-	0, 0, 0, 0, 0, 0}
-};
-
-static const pmu1_xtaltab0_t pmu1_xtaltab0_960[] = {
-	{
-	12000, 1, 1, 1, 0x50, 0x0}, {
-	13000, 2, 1, 1, 0x49, 0xD89D89}, {
-	14400, 3, 1, 1, 0x42, 0xAAAAAA}, {
-	15360, 4, 1, 1, 0x3E, 0x800000}, {
-	16200, 5, 1, 1, 0x39, 0x425ED0}, {
-	16800, 6, 1, 1, 0x39, 0x249249}, {
-	19200, 7, 1, 1, 0x32, 0x0}, {
-	19800, 8, 1, 1, 0x30, 0x7C1F07}, {
-	20000, 9, 1, 1, 0x30, 0x0}, {
-	25000, 10, 1, 1, 0x26, 0x666666}, {
-	26000, 11, 1, 1, 0x24, 0xEC4EC4}, {
-	30000, 12, 1, 1, 0x20, 0x0}, {
-	37400, 13, 2, 1, 0x33, 0x563EF9}, {
-	38400, 14, 2, 1, 0x32, 0x0}, {
-	40000, 15, 2, 1, 0x30, 0x0}, {
-	48000, 16, 2, 1, 0x28, 0x0}, {
-	0, 0, 0, 0, 0, 0}
-};
-
-static const pmu1_xtaltab0_t pmu1_xtaltab0_880_4329[] = {
-	{
-	12000, 1, 3, 22, 0x9, 0xFFFFEF}, {
-	13000, 2, 1, 6, 0xb, 0x483483}, {
-	14400, 3, 1, 10, 0xa, 0x1C71C7}, {
-	15360, 4, 1, 5, 0xb, 0x755555}, {
-	16200, 5, 1, 10, 0x5, 0x6E9E06}, {
-	16800, 6, 1, 10, 0x5, 0x3Cf3Cf}, {
-	19200, 7, 1, 4, 0xb, 0x755555}, {
-	19800, 8, 1, 11, 0x4, 0xA57EB}, {
-	20000, 9, 1, 11, 0x4, 0x0}, {
-	24000, 10, 3, 11, 0xa, 0x0}, {
-	25000, 11, 5, 16, 0xb, 0x0}, {
-	26000, 12, 1, 1, 0x21, 0xD89D89}, {
-	30000, 13, 3, 8, 0xb, 0x0}, {
-	37400, 14, 3, 1, 0x46, 0x969696}, {
-	38400, 15, 1, 1, 0x16, 0xEAAAAA}, {
-	40000, 16, 1, 2, 0xb, 0}, {
-	0, 0, 0, 0, 0, 0}
-};
-
-/* the following table is based on 880Mhz fvco */
-static const pmu1_xtaltab0_t pmu1_xtaltab0_880[] = {
-	{
-	12000, 1, 3, 22, 0x9, 0xFFFFEF}, {
-	13000, 2, 1, 6, 0xb, 0x483483}, {
-	14400, 3, 1, 10, 0xa, 0x1C71C7}, {
-	15360, 4, 1, 5, 0xb, 0x755555}, {
-	16200, 5, 1, 10, 0x5, 0x6E9E06}, {
-	16800, 6, 1, 10, 0x5, 0x3Cf3Cf}, {
-	19200, 7, 1, 4, 0xb, 0x755555}, {
-	19800, 8, 1, 11, 0x4, 0xA57EB}, {
-	20000, 9, 1, 11, 0x4, 0x0}, {
-	24000, 10, 3, 11, 0xa, 0x0}, {
-	25000, 11, 5, 16, 0xb, 0x0}, {
-	26000, 12, 1, 2, 0x10, 0xEC4EC4}, {
-	30000, 13, 3, 8, 0xb, 0x0}, {
-	33600, 14, 1, 2, 0xd, 0x186186}, {
-	38400, 15, 1, 2, 0xb, 0x755555}, {
-	40000, 16, 1, 2, 0xb, 0}, {
-	0, 0, 0, 0, 0, 0}
-};
-
-/* true if the power topology uses the buck boost to provide 3.3V to VDDIO_RF and WLAN PA */
-static bool si_pmu_res_depfltr_bb(struct si_pub *sih)
-{
-	return (sih->boardflags & BFL_BUCKBOOST) != 0;
-}
-
-/* true if the power topology doesn't use the cbuck. Key on chiprev also if the chip is BCM4325. */
-static bool si_pmu_res_depfltr_ncb(struct si_pub *sih)
-{
-
-	return (sih->boardflags & BFL_NOCBUCK) != 0;
-}
-
-/* true if the power topology uses the PALDO */
-static bool si_pmu_res_depfltr_paldo(struct si_pub *sih)
-{
-	return (sih->boardflags & BFL_PALDO) != 0;
-}
-
-/* true if the power topology doesn't use the PALDO */
-static bool si_pmu_res_depfltr_npaldo(struct si_pub *sih)
-{
-	return (sih->boardflags & BFL_PALDO) == 0;
-}
-
-/* Return dependancies (direct or all/indirect) for the given resources */
-static u32
-si_pmu_res_deps(struct si_pub *sih, chipcregs_t *cc, u32 rsrcs,
-		bool all)
-{
-	u32 deps = 0;
-	u32 i;
-
-	for (i = 0; i <= PMURES_MAX_RESNUM; i++) {
-		if (!(rsrcs & PMURES_BIT(i)))
-			continue;
-		W_REG(&cc->res_table_sel, i);
-		deps |= R_REG(&cc->res_dep_mask);
-	}
-
-	return !all ? deps : (deps
-			      ? (deps |
-				 si_pmu_res_deps(sih, cc, deps,
-						 true)) : 0);
-}
-
 /* Determine min/max rsrc masks. Value 0 leaves hardware at default. */
 static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax)
 {
 	u32 min_mask = 0, max_mask = 0;
 	uint rsrcs;
-	char *val;
 
 	/* # resources */
 	rsrcs = (sih->pmucaps & PCAP_RC_MASK) >> PCAP_RC_SHIFT;
@@ -1030,52 +609,9 @@ static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax)
 	switch (sih->chip) {
 	case BCM43224_CHIP_ID:
 	case BCM43225_CHIP_ID:
-	case BCM43421_CHIP_ID:
-	case BCM43235_CHIP_ID:
-	case BCM43236_CHIP_ID:
-	case BCM43238_CHIP_ID:
-	case BCM4331_CHIP_ID:
-	case BCM6362_CHIP_ID:
 		/* ??? */
 		break;
 
-	case BCM4329_CHIP_ID:
-		/* 4329 spedific issue. Needs to come back this issue later */
-		/* Down to save the power. */
-		min_mask =
-		    PMURES_BIT(RES4329_CBUCK_LPOM) |
-		    PMURES_BIT(RES4329_CLDO_PU);
-		/* Allow (but don't require) PLL to turn on */
-		max_mask = 0x3ff63e;
-		break;
-	case BCM4319_CHIP_ID:
-		/* We only need a few resources to be kept on all the time */
-		min_mask = PMURES_BIT(RES4319_CBUCK_LPOM) |
-		    PMURES_BIT(RES4319_CLDO_PU);
-
-		/* Allow everything else to be turned on upon requests */
-		max_mask = ~(~0 << rsrcs);
-		break;
-	case BCM4336_CHIP_ID:
-		/* Down to save the power. */
-		min_mask =
-		    PMURES_BIT(RES4336_CBUCK_LPOM) | PMURES_BIT(RES4336_CLDO_PU)
-		    | PMURES_BIT(RES4336_LDO3P3_PU) | PMURES_BIT(RES4336_OTP_PU)
-		    | PMURES_BIT(RES4336_DIS_INT_RESET_PD);
-		/* Allow (but don't require) PLL to turn on */
-		max_mask = 0x1ffffff;
-		break;
-
-	case BCM4330_CHIP_ID:
-		/* Down to save the power. */
-		min_mask =
-		    PMURES_BIT(RES4330_CBUCK_LPOM) | PMURES_BIT(RES4330_CLDO_PU)
-		    | PMURES_BIT(RES4330_DIS_INT_RESET_PD) |
-		    PMURES_BIT(RES4330_LDO3P3_PU) | PMURES_BIT(RES4330_OTP_PU);
-		/* Allow (but don't require) PLL to turn on */
-		max_mask = 0xfffffff;
-		break;
-
 	case BCM4313_CHIP_ID:
 		min_mask = PMURES_BIT(RES4313_BB_PU_RSRC) |
 		    PMURES_BIT(RES4313_XTAL_PU_RSRC) |
@@ -1087,122 +623,18 @@ static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax)
 		break;
 	}
 
-	/* Apply nvram override to min mask */
-	val = getvar(NULL, "rmin");
-	if (val != NULL) {
-		min_mask = (u32) simple_strtoul(val, NULL, 0);
-	}
-	/* Apply nvram override to max mask */
-	val = getvar(NULL, "rmax");
-	if (val != NULL) {
-		max_mask = (u32) simple_strtoul(val, NULL, 0);
-	}
-
 	*pmin = min_mask;
 	*pmax = max_mask;
 }
 
-/* Return up time in ILP cycles for the given resource. */
-static uint
-si_pmu_res_uptime(struct si_pub *sih, chipcregs_t *cc, u8 rsrc) {
-	u32 deps;
-	uint up, i, dup, dmax;
-	u32 min_mask = 0, max_mask = 0;
-
-	/* uptime of resource 'rsrc' */
-	W_REG(&cc->res_table_sel, rsrc);
-	up = (R_REG(&cc->res_updn_timer) >> 8) & 0xff;
-
-	/* direct dependancies of resource 'rsrc' */
-	deps = si_pmu_res_deps(sih, cc, PMURES_BIT(rsrc), false);
-	for (i = 0; i <= PMURES_MAX_RESNUM; i++) {
-		if (!(deps & PMURES_BIT(i)))
-			continue;
-		deps &= ~si_pmu_res_deps(sih, cc, PMURES_BIT(i), true);
-	}
-	si_pmu_res_masks(sih, &min_mask, &max_mask);
-	deps &= ~min_mask;
-
-	/* max uptime of direct dependancies */
-	dmax = 0;
-	for (i = 0; i <= PMURES_MAX_RESNUM; i++) {
-		if (!(deps & PMURES_BIT(i)))
-			continue;
-		dup = si_pmu_res_uptime(sih, cc, (u8) i);
-		if (dmax < dup)
-			dmax = dup;
-	}
-
-	return up + dmax + PMURES_UP_TRANSITION;
-}
-
 static void
 si_pmu_spuravoid_pllupdate(struct si_pub *sih, chipcregs_t *cc, u8 spuravoid)
 {
 	u32 tmp = 0;
-	u8 phypll_offset = 0;
-	u8 bcm5357_bcm43236_p1div[] = { 0x1, 0x5, 0x5 };
-	u8 bcm5357_bcm43236_ndiv[] = { 0x30, 0xf6, 0xfc };
 
 	switch (sih->chip) {
-	case BCM5357_CHIP_ID:
-	case BCM43235_CHIP_ID:
-	case BCM43236_CHIP_ID:
-	case BCM43238_CHIP_ID:
-
-		/*
-		 * BCM5357 needs to touch PLL1_PLLCTL[02],
-		 * so offset PLL0_PLLCTL[02] by 6
-		 */
-		phypll_offset = (sih->chip == BCM5357_CHIP_ID) ? 6 : 0;
-
-		/* RMW only the P1 divider */
-		W_REG(&cc->pllcontrol_addr,
-		      PMU1_PLL0_PLLCTL0 + phypll_offset);
-		tmp = R_REG(&cc->pllcontrol_data);
-		tmp &= (~(PMU1_PLL0_PC0_P1DIV_MASK));
-		tmp |=
-		    (bcm5357_bcm43236_p1div[spuravoid] <<
-		     PMU1_PLL0_PC0_P1DIV_SHIFT);
-		W_REG(&cc->pllcontrol_data, tmp);
-
-		/* RMW only the int feedback divider */
-		W_REG(&cc->pllcontrol_addr,
-		      PMU1_PLL0_PLLCTL2 + phypll_offset);
-		tmp = R_REG(&cc->pllcontrol_data);
-		tmp &= ~(PMU1_PLL0_PC2_NDIV_INT_MASK);
-		tmp |=
-		    (bcm5357_bcm43236_ndiv[spuravoid]) <<
-		    PMU1_PLL0_PC2_NDIV_INT_SHIFT;
-		W_REG(&cc->pllcontrol_data, tmp);
-
-		tmp = 1 << 10;
-		break;
-
-	case BCM4331_CHIP_ID:
-		if (spuravoid == 2) {
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
-			W_REG(&cc->pllcontrol_data, 0x11500014);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-			W_REG(&cc->pllcontrol_data, 0x0FC00a08);
-		} else if (spuravoid == 1) {
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
-			W_REG(&cc->pllcontrol_data, 0x11500014);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-			W_REG(&cc->pllcontrol_data, 0x0F600a08);
-		} else {
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
-			W_REG(&cc->pllcontrol_data, 0x11100014);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-			W_REG(&cc->pllcontrol_data, 0x03000a08);
-		}
-		tmp = 1 << 10;
-		break;
-
 	case BCM43224_CHIP_ID:
 	case BCM43225_CHIP_ID:
-	case BCM43421_CHIP_ID:
-	case BCM6362_CHIP_ID:
 		if (spuravoid == 1) {
 			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
 			W_REG(&cc->pllcontrol_data, 0x11500010);
@@ -1249,84 +681,6 @@ si_pmu_spuravoid_pllupdate(struct si_pub *sih, chipcregs_t *cc, u8 spuravoid)
 		tmp = 1 << 10;
 		break;
 
-	case BCM4716_CHIP_ID:
-	case BCM4748_CHIP_ID:
-	case BCM47162_CHIP_ID:
-		if (spuravoid == 1) {
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
-			W_REG(&cc->pllcontrol_data, 0x11500060);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
-			W_REG(&cc->pllcontrol_data, 0x080C0C06);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-			W_REG(&cc->pllcontrol_data, 0x0F600000);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL3);
-			W_REG(&cc->pllcontrol_data, 0x00000000);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
-			W_REG(&cc->pllcontrol_data, 0x2001E924);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
-			W_REG(&cc->pllcontrol_data, 0x88888815);
-		} else {
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
-			W_REG(&cc->pllcontrol_data, 0x11100060);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
-			W_REG(&cc->pllcontrol_data, 0x080c0c06);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-			W_REG(&cc->pllcontrol_data, 0x03000000);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL3);
-			W_REG(&cc->pllcontrol_data, 0x00000000);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
-			W_REG(&cc->pllcontrol_data, 0x200005c0);
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
-			W_REG(&cc->pllcontrol_data, 0x88888815);
-		}
-
-		tmp = 3 << 9;
-		break;
-
-	case BCM4319_CHIP_ID:
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
-		W_REG(&cc->pllcontrol_data, 0x11100070);
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
-		W_REG(&cc->pllcontrol_data, 0x1014140a);
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
-		W_REG(&cc->pllcontrol_data, 0x88888854);
-
-		if (spuravoid == 1) {
-			/* spur_avoid ON, so enable 41/82/164Mhz clock mode */
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-			W_REG(&cc->pllcontrol_data, 0x05201828);
-		} else {
-			/* enable 40/80/160Mhz clock mode */
-			W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-			W_REG(&cc->pllcontrol_data, 0x05001828);
-		}
-		break;
-	case BCM4336_CHIP_ID:
-		/* Looks like these are only for default xtal freq 26MHz */
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
-		W_REG(&cc->pllcontrol_data, 0x02100020);
-
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
-		W_REG(&cc->pllcontrol_data, 0x0C0C0C0C);
-
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-		W_REG(&cc->pllcontrol_data, 0x01240C0C);
-
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
-		W_REG(&cc->pllcontrol_data, 0x202C2820);
-
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
-		W_REG(&cc->pllcontrol_data, 0x88888825);
-
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL3);
-		if (spuravoid == 1)
-			W_REG(&cc->pllcontrol_data, 0x00EC4EC4);
-		else
-			W_REG(&cc->pllcontrol_data, 0x00762762);
-
-		tmp = PCTL_PLL_PLLCTL_UPD;
-		break;
-
 	default:
 		/* bail out */
 		return;
@@ -1336,346 +690,6 @@ si_pmu_spuravoid_pllupdate(struct si_pub *sih, chipcregs_t *cc, u8 spuravoid)
 	W_REG(&cc->pmucontrol, tmp);
 }
 
-/* select default xtal frequency for each chip */
-static const pmu1_xtaltab0_t *si_pmu1_xtaldef0(struct si_pub *sih)
-{
-	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		/* Default to 38400Khz */
-		return &pmu1_xtaltab0_880_4329[PMU1_XTALTAB0_880_38400K];
-	case BCM4319_CHIP_ID:
-		/* Default to 30000Khz */
-		return &pmu1_xtaltab0_1440[PMU1_XTALTAB0_1440_30000K];
-	case BCM4336_CHIP_ID:
-		/* Default to 26000Khz */
-		return &pmu1_xtaltab0_960[PMU1_XTALTAB0_960_26000K];
-	case BCM4330_CHIP_ID:
-		/* Default to 37400Khz */
-		if (CST4330_CHIPMODE_SDIOD(sih->chipst))
-			return &pmu1_xtaltab0_960[PMU1_XTALTAB0_960_37400K];
-		else
-			return &pmu1_xtaltab0_1440[PMU1_XTALTAB0_1440_37400K];
-	default:
-		break;
-	}
-	return NULL;
-}
-
-/* select xtal table for each chip */
-static const pmu1_xtaltab0_t *si_pmu1_xtaltab0(struct si_pub *sih)
-{
-	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		return pmu1_xtaltab0_880_4329;
-	case BCM4319_CHIP_ID:
-		return pmu1_xtaltab0_1440;
-	case BCM4336_CHIP_ID:
-		return pmu1_xtaltab0_960;
-	case BCM4330_CHIP_ID:
-		if (CST4330_CHIPMODE_SDIOD(sih->chipst))
-			return pmu1_xtaltab0_960;
-		else
-			return pmu1_xtaltab0_1440;
-	default:
-		break;
-	}
-	return NULL;
-}
-
-/* query alp/xtal clock frequency */
-static u32
-si_pmu1_alpclk0(struct si_pub *sih, chipcregs_t *cc)
-{
-	const pmu1_xtaltab0_t *xt;
-	u32 xf;
-
-	/* Find the frequency in the table */
-	xf = (R_REG(&cc->pmucontrol) & PCTL_XTALFREQ_MASK) >>
-	    PCTL_XTALFREQ_SHIFT;
-	for (xt = si_pmu1_xtaltab0(sih); xt != NULL && xt->fref != 0; xt++)
-		if (xt->xf == xf)
-			break;
-	/* Could not find it so assign a default value */
-	if (xt == NULL || xt->fref == 0)
-		xt = si_pmu1_xtaldef0(sih);
-	return xt->fref * 1000;
-}
-
-/* select default pll fvco for each chip */
-static u32 si_pmu1_pllfvco0(struct si_pub *sih)
-{
-	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		return FVCO_880;
-	case BCM4319_CHIP_ID:
-		return FVCO_1440;
-	case BCM4336_CHIP_ID:
-		return FVCO_960;
-	case BCM4330_CHIP_ID:
-		if (CST4330_CHIPMODE_SDIOD(sih->chipst))
-			return FVCO_960;
-		else
-			return FVCO_1440;
-	default:
-		break;
-	}
-	return 0;
-}
-
-static void si_pmu_set_4330_plldivs(struct si_pub *sih)
-{
-	u32 FVCO = si_pmu1_pllfvco0(sih) / 1000;
-	u32 m1div, m2div, m3div, m4div, m5div, m6div;
-	u32 pllc1, pllc2;
-
-	m2div = m3div = m4div = m6div = FVCO / 80;
-	m5div = FVCO / 160;
-
-	if (CST4330_CHIPMODE_SDIOD(sih->chipst))
-		m1div = FVCO / 80;
-	else
-		m1div = FVCO / 90;
-	pllc1 =
-	    (m1div << PMU1_PLL0_PC1_M1DIV_SHIFT) | (m2div <<
-						    PMU1_PLL0_PC1_M2DIV_SHIFT) |
-	    (m3div << PMU1_PLL0_PC1_M3DIV_SHIFT) | (m4div <<
-						    PMU1_PLL0_PC1_M4DIV_SHIFT);
-	si_pmu_pllcontrol(sih, PMU1_PLL0_PLLCTL1, ~0, pllc1);
-
-	pllc2 = si_pmu_pllcontrol(sih, PMU1_PLL0_PLLCTL1, 0, 0);
-	pllc2 &= ~(PMU1_PLL0_PC2_M5DIV_MASK | PMU1_PLL0_PC2_M6DIV_MASK);
-	pllc2 |=
-	    ((m5div << PMU1_PLL0_PC2_M5DIV_SHIFT) |
-	     (m6div << PMU1_PLL0_PC2_M6DIV_SHIFT));
-	si_pmu_pllcontrol(sih, PMU1_PLL0_PLLCTL2, ~0, pllc2);
-}
-
-/* Set up PLL registers in the PMU as per the crystal speed.
- * XtalFreq field in pmucontrol register being 0 indicates the PLL
- * is not programmed and the h/w default is assumed to work, in which
- * case the xtal frequency is unknown to the s/w so we need to call
- * si_pmu1_xtaldef0() wherever it is needed to return a default value.
- */
-static void si_pmu1_pllinit0(struct si_pub *sih, chipcregs_t *cc, u32 xtal)
-{
-	const pmu1_xtaltab0_t *xt;
-	u32 tmp;
-	u32 buf_strength = 0;
-	u8 ndiv_mode = 1;
-
-	/* Use h/w default PLL config */
-	if (xtal == 0) {
-		return;
-	}
-
-	/* Find the frequency in the table */
-	for (xt = si_pmu1_xtaltab0(sih); xt != NULL && xt->fref != 0; xt++)
-		if (xt->fref == xtal)
-			break;
-
-	/* Check current PLL state, bail out if it has been programmed or
-	 * we don't know how to program it.
-	 */
-	if (xt == NULL || xt->fref == 0) {
-		return;
-	}
-	/* for 4319 bootloader already programs the PLL but bootloader does not
-	 * program the PLL4 and PLL5. So Skip this check for 4319
-	 */
-	if ((((R_REG(&cc->pmucontrol) & PCTL_XTALFREQ_MASK) >>
-	      PCTL_XTALFREQ_SHIFT) == xt->xf) &&
-	    !((sih->chip == BCM4319_CHIP_ID)
-	      || (sih->chip == BCM4330_CHIP_ID)))
-		return;
-
-	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		/* Change the BBPLL drive strength to 8 for all channels */
-		buf_strength = 0x888888;
-		AND_REG(&cc->min_res_mask,
-			~(PMURES_BIT(RES4329_BBPLL_PWRSW_PU) |
-			  PMURES_BIT(RES4329_HT_AVAIL)));
-		AND_REG(&cc->max_res_mask,
-			~(PMURES_BIT(RES4329_BBPLL_PWRSW_PU) |
-			  PMURES_BIT(RES4329_HT_AVAIL)));
-		SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
-			 PMU_MAX_TRANSITION_DLY);
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
-		if (xt->fref == 38400)
-			tmp = 0x200024C0;
-		else if (xt->fref == 37400)
-			tmp = 0x20004500;
-		else if (xt->fref == 26000)
-			tmp = 0x200024C0;
-		else
-			tmp = 0x200005C0;	/* Chip Dflt Settings */
-		W_REG(&cc->pllcontrol_data, tmp);
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
-		tmp =
-		    R_REG(&cc->pllcontrol_data) & PMU1_PLL0_PC5_CLK_DRV_MASK;
-		if ((xt->fref == 38400) || (xt->fref == 37400)
-		    || (xt->fref == 26000))
-			tmp |= 0x15;
-		else
-			tmp |= 0x25;	/* Chip Dflt Settings */
-		W_REG(&cc->pllcontrol_data, tmp);
-		break;
-
-	case BCM4319_CHIP_ID:
-		/* Change the BBPLL drive strength to 2 for all channels */
-		buf_strength = 0x222222;
-
-		/* Make sure the PLL is off */
-		/* WAR65104: Disable the HT_AVAIL resource first and then
-		 * after a delay (more than downtime for HT_AVAIL) remove the
-		 * BBPLL resource; backplane clock moves to ALP from HT.
-		 */
-		AND_REG(&cc->min_res_mask,
-			~(PMURES_BIT(RES4319_HT_AVAIL)));
-		AND_REG(&cc->max_res_mask,
-			~(PMURES_BIT(RES4319_HT_AVAIL)));
-
-		udelay(100);
-		AND_REG(&cc->min_res_mask,
-			~(PMURES_BIT(RES4319_BBPLL_PWRSW_PU)));
-		AND_REG(&cc->max_res_mask,
-			~(PMURES_BIT(RES4319_BBPLL_PWRSW_PU)));
-
-		udelay(100);
-		SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
-			 PMU_MAX_TRANSITION_DLY);
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
-		tmp = 0x200005c0;
-		W_REG(&cc->pllcontrol_data, tmp);
-		break;
-
-	case BCM4336_CHIP_ID:
-		AND_REG(&cc->min_res_mask,
-			~(PMURES_BIT(RES4336_HT_AVAIL) |
-			  PMURES_BIT(RES4336_MACPHY_CLKAVAIL)));
-		AND_REG(&cc->max_res_mask,
-			~(PMURES_BIT(RES4336_HT_AVAIL) |
-			  PMURES_BIT(RES4336_MACPHY_CLKAVAIL)));
-		udelay(100);
-		SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
-			 PMU_MAX_TRANSITION_DLY);
-		break;
-
-	case BCM4330_CHIP_ID:
-		AND_REG(&cc->min_res_mask,
-			~(PMURES_BIT(RES4330_HT_AVAIL) |
-			  PMURES_BIT(RES4330_MACPHY_CLKAVAIL)));
-		AND_REG(&cc->max_res_mask,
-			~(PMURES_BIT(RES4330_HT_AVAIL) |
-			  PMURES_BIT(RES4330_MACPHY_CLKAVAIL)));
-		udelay(100);
-		SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
-			 PMU_MAX_TRANSITION_DLY);
-		break;
-
-	default:
-		break;
-	}
-
-	/* Write p1div and p2div to pllcontrol[0] */
-	W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
-	tmp = R_REG(&cc->pllcontrol_data) &
-	    ~(PMU1_PLL0_PC0_P1DIV_MASK | PMU1_PLL0_PC0_P2DIV_MASK);
-	tmp |=
-	    ((xt->
-	      p1div << PMU1_PLL0_PC0_P1DIV_SHIFT) & PMU1_PLL0_PC0_P1DIV_MASK) |
-	    ((xt->
-	      p2div << PMU1_PLL0_PC0_P2DIV_SHIFT) & PMU1_PLL0_PC0_P2DIV_MASK);
-	W_REG(&cc->pllcontrol_data, tmp);
-
-	if ((sih->chip == BCM4330_CHIP_ID))
-		si_pmu_set_4330_plldivs(sih);
-
-	if ((sih->chip == BCM4329_CHIP_ID)
-	    && (sih->chiprev == 0)) {
-
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
-		tmp = R_REG(&cc->pllcontrol_data);
-		tmp = tmp & (~DOT11MAC_880MHZ_CLK_DIVISOR_MASK);
-		tmp = tmp | DOT11MAC_880MHZ_CLK_DIVISOR_VAL;
-		W_REG(&cc->pllcontrol_data, tmp);
-	}
-	if ((sih->chip == BCM4319_CHIP_ID) ||
-	    (sih->chip == BCM4336_CHIP_ID) ||
-	    (sih->chip == BCM4330_CHIP_ID))
-		ndiv_mode = PMU1_PLL0_PC2_NDIV_MODE_MFB;
-	else
-		ndiv_mode = PMU1_PLL0_PC2_NDIV_MODE_MASH;
-
-	/* Write ndiv_int and ndiv_mode to pllcontrol[2] */
-	W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
-	tmp = R_REG(&cc->pllcontrol_data) &
-	    ~(PMU1_PLL0_PC2_NDIV_INT_MASK | PMU1_PLL0_PC2_NDIV_MODE_MASK);
-	tmp |=
-	    ((xt->
-	      ndiv_int << PMU1_PLL0_PC2_NDIV_INT_SHIFT) &
-	     PMU1_PLL0_PC2_NDIV_INT_MASK) | ((ndiv_mode <<
-					      PMU1_PLL0_PC2_NDIV_MODE_SHIFT) &
-					     PMU1_PLL0_PC2_NDIV_MODE_MASK);
-	W_REG(&cc->pllcontrol_data, tmp);
-
-	/* Write ndiv_frac to pllcontrol[3] */
-	W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL3);
-	tmp = R_REG(&cc->pllcontrol_data) & ~PMU1_PLL0_PC3_NDIV_FRAC_MASK;
-	tmp |= ((xt->ndiv_frac << PMU1_PLL0_PC3_NDIV_FRAC_SHIFT) &
-		PMU1_PLL0_PC3_NDIV_FRAC_MASK);
-	W_REG(&cc->pllcontrol_data, tmp);
-
-	/* Write clock driving strength to pllcontrol[5] */
-	if (buf_strength) {
-		W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
-		tmp =
-		    R_REG(&cc->pllcontrol_data) & ~PMU1_PLL0_PC5_CLK_DRV_MASK;
-		tmp |= (buf_strength << PMU1_PLL0_PC5_CLK_DRV_SHIFT);
-		W_REG(&cc->pllcontrol_data, tmp);
-	}
-
-	/* to operate the 4319 usb in 24MHz/48MHz; chipcontrol[2][84:83] needs
-	 * to be updated.
-	 */
-	if ((sih->chip == BCM4319_CHIP_ID)
-	    && (xt->fref != XTAL_FREQ_30000MHZ)) {
-		W_REG(&cc->chipcontrol_addr, PMU1_PLL0_CHIPCTL2);
-		tmp =
-		    R_REG(&cc->chipcontrol_data) & ~CCTL_4319USB_XTAL_SEL_MASK;
-		if (xt->fref == XTAL_FREQ_24000MHZ) {
-			tmp |=
-			    (CCTL_4319USB_24MHZ_PLL_SEL <<
-			     CCTL_4319USB_XTAL_SEL_SHIFT);
-		} else if (xt->fref == XTAL_FREQ_48000MHZ) {
-			tmp |=
-			    (CCTL_4319USB_48MHZ_PLL_SEL <<
-			     CCTL_4319USB_XTAL_SEL_SHIFT);
-		}
-		W_REG(&cc->chipcontrol_data, tmp);
-	}
-
-	/* Flush deferred pll control registers writes */
-	if (sih->pmurev >= 2)
-		OR_REG(&cc->pmucontrol, PCTL_PLL_PLLCTL_UPD);
-
-	/* Write XtalFreq. Set the divisor also. */
-	tmp = R_REG(&cc->pmucontrol) &
-	    ~(PCTL_ILP_DIV_MASK | PCTL_XTALFREQ_MASK);
-	tmp |= (((((xt->fref + 127) / 128) - 1) << PCTL_ILP_DIV_SHIFT) &
-		PCTL_ILP_DIV_MASK) |
-	    ((xt->xf << PCTL_XTALFREQ_SHIFT) & PCTL_XTALFREQ_MASK);
-
-	if ((sih->chip == BCM4329_CHIP_ID)
-	    && sih->chiprev == 0) {
-		/* clear the htstretch before clearing HTReqEn */
-		AND_REG(&cc->clkstretch, ~CSTRETCH_HT);
-		tmp &= ~PCTL_HT_REQ_EN;
-	}
-
-	W_REG(&cc->pmucontrol, tmp);
-}
-
 u32 si_pmu_ilp_clock(struct si_pub *sih)
 {
 	static u32 ilpcycles_per_sec;
@@ -1698,65 +712,9 @@ u32 si_pmu_ilp_clock(struct si_pub *sih)
 	return ilpcycles_per_sec;
 }
 
-void si_pmu_set_ldo_voltage(struct si_pub *sih, u8 ldo, u8 voltage)
-{
-	u8 sr_cntl_shift = 0, rc_shift = 0, shift = 0, mask = 0;
-	u8 addr = 0;
-
-	switch (sih->chip) {
-	case BCM4336_CHIP_ID:
-		switch (ldo) {
-		case SET_LDO_VOLTAGE_CLDO_PWM:
-			addr = 4;
-			rc_shift = 1;
-			mask = 0xf;
-			break;
-		case SET_LDO_VOLTAGE_CLDO_BURST:
-			addr = 4;
-			rc_shift = 5;
-			mask = 0xf;
-			break;
-		case SET_LDO_VOLTAGE_LNLDO1:
-			addr = 4;
-			rc_shift = 17;
-			mask = 0xf;
-			break;
-		default:
-			return;
-		}
-		break;
-	case BCM4330_CHIP_ID:
-		switch (ldo) {
-		case SET_LDO_VOLTAGE_CBUCK_PWM:
-			addr = 3;
-			rc_shift = 0;
-			mask = 0x1f;
-			break;
-		default:
-			return;
-		}
-		break;
-	default:
-		return;
-	}
-
-	shift = sr_cntl_shift + rc_shift;
-
-	ai_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, regcontrol_addr),
-		   ~0, addr);
-	ai_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, regcontrol_data),
-		   mask << shift, (voltage & mask) << shift);
-}
-
 u16 si_pmu_fast_pwrup_delay(struct si_pub *sih)
 {
 	uint delay = PMU_MAX_TRANSITION_DLY;
-	chipcregs_t *cc;
-	uint origidx;
-#ifdef BCMDBG
-	char chn[8];
-	chn[0] = 0;		/* to suppress compile error */
-#endif
 
 	/* Remember original core before switch to chipc */
 	origidx = ai_coreidx(sih);
@@ -1765,54 +723,9 @@ u16 si_pmu_fast_pwrup_delay(struct si_pub *sih)
 	switch (sih->chip) {
 	case BCM43224_CHIP_ID:
 	case BCM43225_CHIP_ID:
-	case BCM43421_CHIP_ID:
-	case BCM43235_CHIP_ID:
-	case BCM43236_CHIP_ID:
-	case BCM43238_CHIP_ID:
-	case BCM4331_CHIP_ID:
-	case BCM6362_CHIP_ID:
 	case BCM4313_CHIP_ID:
 		delay = ISSIM_ENAB(sih) ? 70 : 3700;
 		break;
-	case BCM4329_CHIP_ID:
-		if (ISSIM_ENAB(sih))
-			delay = 70;
-		else {
-			u32 ilp = si_pmu_ilp_clock(sih);
-			delay =
-			    (si_pmu_res_uptime(sih, cc, RES4329_HT_AVAIL) +
-			     D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp -
-							      1) / ilp);
-			delay = (11 * delay) / 10;
-		}
-		break;
-	case BCM4319_CHIP_ID:
-		delay = ISSIM_ENAB(sih) ? 70 : 3700;
-		break;
-	case BCM4336_CHIP_ID:
-		if (ISSIM_ENAB(sih))
-			delay = 70;
-		else {
-			u32 ilp = si_pmu_ilp_clock(sih);
-			delay =
-			    (si_pmu_res_uptime(sih, cc, RES4336_HT_AVAIL) +
-			     D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp -
-							      1) / ilp);
-			delay = (11 * delay) / 10;
-		}
-		break;
-	case BCM4330_CHIP_ID:
-		if (ISSIM_ENAB(sih))
-			delay = 70;
-		else {
-			u32 ilp = si_pmu_ilp_clock(sih);
-			delay =
-			    (si_pmu_res_uptime(sih, cc, RES4330_HT_AVAIL) +
-			     D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp -
-							      1) / ilp);
-			delay = (11 * delay) / 10;
-		}
-		break;
 	default:
 		break;
 	}
@@ -1872,52 +785,23 @@ void si_pmu_pllupd(struct si_pub *sih)
 /* query alp/xtal clock frequency */
 u32 si_pmu_alp_clock(struct si_pub *sih)
 {
-	chipcregs_t *cc;
-	uint origidx;
 	u32 clock = ALP_CLOCK;
 
 	/* bail out with default */
 	if (!PMUCTL_ENAB(sih))
 		return clock;
 
-	/* Remember original core before switch to chipc */
-	origidx = ai_coreidx(sih);
-	cc = ai_setcoreidx(sih, SI_CC_IDX);
-
 	switch (sih->chip) {
 	case BCM43224_CHIP_ID:
 	case BCM43225_CHIP_ID:
-	case BCM43421_CHIP_ID:
-	case BCM43235_CHIP_ID:
-	case BCM43236_CHIP_ID:
-	case BCM43238_CHIP_ID:
-	case BCM4331_CHIP_ID:
-	case BCM6362_CHIP_ID:
-	case BCM4716_CHIP_ID:
-	case BCM4748_CHIP_ID:
-	case BCM47162_CHIP_ID:
 	case BCM4313_CHIP_ID:
-	case BCM5357_CHIP_ID:
 		/* always 20Mhz */
 		clock = 20000 * 1000;
 		break;
-	case BCM4329_CHIP_ID:
-	case BCM4319_CHIP_ID:
-	case BCM4336_CHIP_ID:
-	case BCM4330_CHIP_ID:
-
-		clock = si_pmu1_alpclk0(sih, cc);
-		break;
-	case BCM5356_CHIP_ID:
-		/* always 25Mhz */
-		clock = 25000 * 1000;
-		break;
 	default:
 		break;
 	}
 
-	/* Return to original core */
-	ai_setcoreidx(sih, origidx);
 	return clock;
 }
 
@@ -1925,32 +809,14 @@ void si_pmu_spuravoid(struct si_pub *sih, u8 spuravoid)
 {
 	chipcregs_t *cc;
 	uint origidx, intr_val;
-	u32 tmp = 0;
 
 	/* Remember original core before switch to chipc */
 	cc = (chipcregs_t *) ai_switch_core(sih, CC_CORE_ID, &origidx,
 					    &intr_val);
 
-	/* force the HT off  */
-	if (sih->chip == BCM4336_CHIP_ID) {
-		tmp = R_REG(&cc->max_res_mask);
-		tmp &= ~RES4336_HT_AVAIL;
-		W_REG(&cc->max_res_mask, tmp);
-		/* wait for the ht to really go away */
-		SPINWAIT(((R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL) == 0),
-			 10000);
-	}
-
 	/* update the pll changes */
 	si_pmu_spuravoid_pllupdate(sih, cc, spuravoid);
 
-	/* enable HT back on  */
-	if (sih->chip == BCM4336_CHIP_ID) {
-		tmp = R_REG(&cc->max_res_mask);
-		tmp |= RES4336_HT_AVAIL;
-		W_REG(&cc->max_res_mask, tmp);
-	}
-
 	/* Return to original core */
 	ai_restore_core(sih, origidx, intr_val);
 }
@@ -1970,15 +836,6 @@ void si_pmu_init(struct si_pub *sih)
 	else if (sih->pmurev >= 2)
 		OR_REG(&cc->pmucontrol, PCTL_NOILP_ON_WAIT);
 
-	if ((sih->chip == BCM4329_CHIP_ID) && (sih->chiprev == 2)) {
-		/* Fix for 4329b0 bad LPOM state. */
-		W_REG(&cc->regcontrol_addr, 2);
-		OR_REG(&cc->regcontrol_data, 0x100);
-
-		W_REG(&cc->regcontrol_addr, 3);
-		OR_REG(&cc->regcontrol_data, 0x4);
-	}
-
 	/* Return to original core */
 	ai_setcoreidx(sih, origidx);
 }
@@ -2001,26 +858,6 @@ void si_pmu_chip_init(struct si_pub *sih)
 /* initialize PMU switch/regulators */
 void si_pmu_swreg_init(struct si_pub *sih)
 {
-	switch (sih->chip) {
-	case BCM4336_CHIP_ID:
-		/* Reduce CLDO PWM output voltage to 1.2V */
-		si_pmu_set_ldo_voltage(sih, SET_LDO_VOLTAGE_CLDO_PWM, 0xe);
-		/* Reduce CLDO BURST output voltage to 1.2V */
-		si_pmu_set_ldo_voltage(sih, SET_LDO_VOLTAGE_CLDO_BURST,
-				       0xe);
-		/* Reduce LNLDO1 output voltage to 1.2V */
-		si_pmu_set_ldo_voltage(sih, SET_LDO_VOLTAGE_LNLDO1, 0xe);
-		if (sih->chiprev == 0)
-			si_pmu_regcontrol(sih, 2, 0x400000, 0x400000);
-		break;
-
-	case BCM4330_CHIP_ID:
-		/* CBUCK Voltage is 1.8 by default and set that to 1.5 */
-		si_pmu_set_ldo_voltage(sih, SET_LDO_VOLTAGE_CBUCK_PWM, 0);
-		break;
-	default:
-		break;
-	}
 }
 
 /* initialize PLL */
@@ -2034,27 +871,11 @@ void si_pmu_pll_init(struct si_pub *sih, uint xtalfreq)
 	cc = ai_setcoreidx(sih, SI_CC_IDX);
 
 	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		if (xtalfreq == 0)
-			xtalfreq = 38400;
-		si_pmu1_pllinit0(sih, cc, xtalfreq);
-		break;
 	case BCM4313_CHIP_ID:
 	case BCM43224_CHIP_ID:
 	case BCM43225_CHIP_ID:
-	case BCM43421_CHIP_ID:
-	case BCM43235_CHIP_ID:
-	case BCM43236_CHIP_ID:
-	case BCM43238_CHIP_ID:
-	case BCM4331_CHIP_ID:
-	case BCM6362_CHIP_ID:
 		/* ??? */
 		break;
-	case BCM4319_CHIP_ID:
-	case BCM4336_CHIP_ID:
-	case BCM4330_CHIP_ID:
-		si_pmu1_pllinit0(sih, cc, xtalfreq);
-		break;
 	default:
 		break;
 	}
@@ -2068,151 +889,12 @@ void si_pmu_res_init(struct si_pub *sih)
 {
 	chipcregs_t *cc;
 	uint origidx;
-	const pmu_res_updown_t *pmu_res_updown_table = NULL;
-	uint pmu_res_updown_table_sz = 0;
-	const pmu_res_depend_t *pmu_res_depend_table = NULL;
-	uint pmu_res_depend_table_sz = 0;
 	u32 min_mask = 0, max_mask = 0;
-	char name[8], *val;
-	uint i, rsrcs;
 
 	/* Remember original core before switch to chipc */
 	origidx = ai_coreidx(sih);
 	cc = ai_setcoreidx(sih, SI_CC_IDX);
 
-	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		/* Optimize resources up/down timers */
-		if (ISSIM_ENAB(sih)) {
-			pmu_res_updown_table = NULL;
-			pmu_res_updown_table_sz = 0;
-		} else {
-			pmu_res_updown_table = bcm4329_res_updown;
-			pmu_res_updown_table_sz =
-				ARRAY_SIZE(bcm4329_res_updown);
-		}
-		/* Optimize resources dependencies */
-		pmu_res_depend_table = bcm4329_res_depend;
-		pmu_res_depend_table_sz = ARRAY_SIZE(bcm4329_res_depend);
-		break;
-
-	case BCM4319_CHIP_ID:
-		/* Optimize resources up/down timers */
-		if (ISSIM_ENAB(sih)) {
-			pmu_res_updown_table = bcm4319a0_res_updown_qt;
-			pmu_res_updown_table_sz =
-			    ARRAY_SIZE(bcm4319a0_res_updown_qt);
-		} else {
-			pmu_res_updown_table = bcm4319a0_res_updown;
-			pmu_res_updown_table_sz =
-			    ARRAY_SIZE(bcm4319a0_res_updown);
-		}
-		/* Optimize resources dependancies masks */
-		pmu_res_depend_table = bcm4319a0_res_depend;
-		pmu_res_depend_table_sz = ARRAY_SIZE(bcm4319a0_res_depend);
-		break;
-
-	case BCM4336_CHIP_ID:
-		/* Optimize resources up/down timers */
-		if (ISSIM_ENAB(sih)) {
-			pmu_res_updown_table = bcm4336a0_res_updown_qt;
-			pmu_res_updown_table_sz =
-			    ARRAY_SIZE(bcm4336a0_res_updown_qt);
-		} else {
-			pmu_res_updown_table = bcm4336a0_res_updown;
-			pmu_res_updown_table_sz =
-			    ARRAY_SIZE(bcm4336a0_res_updown);
-		}
-		/* Optimize resources dependancies masks */
-		pmu_res_depend_table = bcm4336a0_res_depend;
-		pmu_res_depend_table_sz = ARRAY_SIZE(bcm4336a0_res_depend);
-		break;
-
-	case BCM4330_CHIP_ID:
-		/* Optimize resources up/down timers */
-		if (ISSIM_ENAB(sih)) {
-			pmu_res_updown_table = bcm4330a0_res_updown_qt;
-			pmu_res_updown_table_sz =
-			    ARRAY_SIZE(bcm4330a0_res_updown_qt);
-		} else {
-			pmu_res_updown_table = bcm4330a0_res_updown;
-			pmu_res_updown_table_sz =
-			    ARRAY_SIZE(bcm4330a0_res_updown);
-		}
-		/* Optimize resources dependancies masks */
-		pmu_res_depend_table = bcm4330a0_res_depend;
-		pmu_res_depend_table_sz = ARRAY_SIZE(bcm4330a0_res_depend);
-		break;
-
-	default:
-		break;
-	}
-
-	/* # resources */
-	rsrcs = (sih->pmucaps & PCAP_RC_MASK) >> PCAP_RC_SHIFT;
-
-	/* Program up/down timers */
-	while (pmu_res_updown_table_sz--) {
-		W_REG(&cc->res_table_sel,
-		      pmu_res_updown_table[pmu_res_updown_table_sz].resnum);
-		W_REG(&cc->res_updn_timer,
-		      pmu_res_updown_table[pmu_res_updown_table_sz].updown);
-	}
-	/* Apply nvram overrides to up/down timers */
-	for (i = 0; i < rsrcs; i++) {
-		snprintf(name, sizeof(name), "r%dt", i);
-		val = getvar(NULL, name);
-		if (val == NULL)
-			continue;
-		W_REG(&cc->res_table_sel, (u32) i);
-		W_REG(&cc->res_updn_timer,
-		      (u32) simple_strtoul(val, NULL, 0));
-	}
-
-	/* Program resource dependencies table */
-	while (pmu_res_depend_table_sz--) {
-		if (pmu_res_depend_table[pmu_res_depend_table_sz].filter != NULL
-		    && !(pmu_res_depend_table[pmu_res_depend_table_sz].
-			 filter) (sih))
-			continue;
-		for (i = 0; i < rsrcs; i++) {
-			if ((pmu_res_depend_table[pmu_res_depend_table_sz].
-			     res_mask & PMURES_BIT(i)) == 0)
-				continue;
-			W_REG(&cc->res_table_sel, i);
-			switch (pmu_res_depend_table[pmu_res_depend_table_sz].
-				action) {
-			case RES_DEPEND_SET:
-				W_REG(&cc->res_dep_mask,
-				      pmu_res_depend_table
-				      [pmu_res_depend_table_sz].depend_mask);
-				break;
-			case RES_DEPEND_ADD:
-				OR_REG(&cc->res_dep_mask,
-				       pmu_res_depend_table
-				       [pmu_res_depend_table_sz].depend_mask);
-				break;
-			case RES_DEPEND_REMOVE:
-				AND_REG(&cc->res_dep_mask,
-					~pmu_res_depend_table
-					[pmu_res_depend_table_sz].depend_mask);
-				break;
-			default:
-				break;
-			}
-		}
-	}
-	/* Apply nvram overrides to dependancies masks */
-	for (i = 0; i < rsrcs; i++) {
-		snprintf(name, sizeof(name), "r%dd", i);
-		val = getvar(NULL, name);
-		if (val == NULL)
-			continue;
-		W_REG(&cc->res_table_sel, (u32) i);
-		W_REG(&cc->res_dep_mask,
-		      (u32) simple_strtoul(val, NULL, 0));
-	}
-
 	/* Determine min/max rsrc masks */
 	si_pmu_res_masks(sih, &min_mask, &max_mask);
 
@@ -2287,109 +969,3 @@ u32 si_pmu_measure_alpclk(struct si_pub *sih)
 
 	return alp_khz;
 }
-
-bool si_pmu_is_otp_powered(struct si_pub *sih)
-{
-	uint idx;
-	chipcregs_t *cc;
-	bool st;
-
-	/* Remember original core before switch to chipc */
-	idx = ai_coreidx(sih);
-	cc = ai_setcoreidx(sih, SI_CC_IDX);
-
-	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		st = (R_REG(&cc->res_state) & PMURES_BIT(RES4329_OTP_PU))
-		    != 0;
-		break;
-	case BCM4319_CHIP_ID:
-		st = (R_REG(&cc->res_state) & PMURES_BIT(RES4319_OTP_PU))
-		    != 0;
-		break;
-	case BCM4336_CHIP_ID:
-		st = (R_REG(&cc->res_state) & PMURES_BIT(RES4336_OTP_PU))
-		    != 0;
-		break;
-	case BCM4330_CHIP_ID:
-		st = (R_REG(&cc->res_state) & PMURES_BIT(RES4330_OTP_PU))
-		    != 0;
-		break;
-
-		/* These chip doesn't use PMU bit to power up/down OTP. OTP always on.
-		 * Use OTP_INIT command to reset/refresh state.
-		 */
-	case BCM43224_CHIP_ID:
-	case BCM43225_CHIP_ID:
-	case BCM43421_CHIP_ID:
-	case BCM43236_CHIP_ID:
-	case BCM43235_CHIP_ID:
-	case BCM43238_CHIP_ID:
-		st = true;
-		break;
-	default:
-		st = true;
-		break;
-	}
-
-	/* Return to original core */
-	ai_setcoreidx(sih, idx);
-	return st;
-}
-
-/* power up/down OTP through PMU resources */
-void si_pmu_otp_power(struct si_pub *sih, bool on)
-{
-	chipcregs_t *cc;
-	uint origidx;
-	u32 rsrcs = 0;	/* rsrcs to turn on/off OTP power */
-
-	/* Don't do anything if OTP is disabled */
-	if (ai_is_otp_disabled(sih))
-		return;
-
-	/* Remember original core before switch to chipc */
-	origidx = ai_coreidx(sih);
-	cc = ai_setcoreidx(sih, SI_CC_IDX);
-
-	switch (sih->chip) {
-	case BCM4329_CHIP_ID:
-		rsrcs = PMURES_BIT(RES4329_OTP_PU);
-		break;
-	case BCM4319_CHIP_ID:
-		rsrcs = PMURES_BIT(RES4319_OTP_PU);
-		break;
-	case BCM4336_CHIP_ID:
-		rsrcs = PMURES_BIT(RES4336_OTP_PU);
-		break;
-	case BCM4330_CHIP_ID:
-		rsrcs = PMURES_BIT(RES4330_OTP_PU);
-		break;
-	default:
-		break;
-	}
-
-	if (rsrcs != 0) {
-		u32 otps;
-
-		/* Figure out the dependancies (exclude min_res_mask) */
-		u32 deps = si_pmu_res_deps(sih, cc, rsrcs, true);
-		u32 min_mask = 0, max_mask = 0;
-		si_pmu_res_masks(sih, &min_mask, &max_mask);
-		deps &= ~min_mask;
-		/* Turn on/off the power */
-		if (on) {
-			OR_REG(&cc->min_res_mask, (rsrcs | deps));
-			SPINWAIT(!(R_REG(&cc->res_state) & rsrcs),
-				 PMU_MAX_TRANSITION_DLY);
-		} else {
-			AND_REG(&cc->min_res_mask, ~(rsrcs | deps));
-		}
-
-		SPINWAIT((((otps = R_REG(&cc->otpstatus)) & OTPS_READY) !=
-			  (on ? OTPS_READY : 0)), 100);
-	}
-
-	/* Return to original core */
-	ai_setcoreidx(sih, origidx);
-}
drivers/staging/brcm80211/brcmsmac/pmu.h +0 -3
index 9a98890..0c7e48c 100644
@@ -33,7 +33,6 @@
 #define SET_LDO_VOLTAGE_LNLDO1	9
 #define SET_LDO_VOLTAGE_LNLDO2_SEL	10
 
-extern void si_pmu_set_ldo_voltage(struct si_pub *sih, u8 ldo, u8 voltage);
 extern u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
 extern void si_pmu_sprom_enable(struct si_pub *sih, bool enable);
 extern u32 si_pmu_chipcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val);
@@ -49,7 +48,5 @@ extern void si_pmu_pll_init(struct si_pub *sih, u32 xtalfreq);
 extern void si_pmu_res_init(struct si_pub *sih);
 extern void si_pmu_swreg_init(struct si_pub *sih);
 extern u32 si_pmu_measure_alpclk(struct si_pub *sih);
-extern bool si_pmu_is_otp_powered(struct si_pub *sih);
-extern void si_pmu_otp_power(struct si_pub *sih, bool on);
 
 #endif /* _BRCM_PMU_H_ */
Signature · 1 line
1.7.1
author
#14 lore raw

PATCH 14/119 staging: brcm80211: remove unused macro definitions from pmu.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The source file pmu.c contained a large number of definitions that are no longer needed and have been removed.

---
 drivers/staging/brcm80211/brcmsmac/pmu.c |  491 ------------------------------
 1 files changed, 0 insertions(+), 491 deletions(-)
drivers/staging/brcm80211/brcmsmac/pmu.c +0 -491
index d7ca7ed..6508243 100644
@@ -25,11 +25,6 @@
 #include "pmu.h"
 
 /*
- * d11 slow to fast clock transition time in slow clock cycles
- */
-#define D11SCC_SLOW2FAST_TRANSITION	2
-
-/*
  * external LPO crystal frequency
  */
 #define EXT_ILP_HZ 32768
@@ -41,93 +36,6 @@
  */
 #define ILP_CALC_DUR	10
 
-/*
- * FVCO frequency
- */
-#define FVCO_880	880000	/* 880MHz */
-#define FVCO_1760	1760000	/* 1760MHz */
-#define FVCO_1440	1440000	/* 1440MHz */
-#define FVCO_960	960000	/* 960MHz */
-
-/*
- * PMU crystal table indices for 1440MHz fvco
- */
-#define PMU1_XTALTAB0_1440_12000K	0
-#define PMU1_XTALTAB0_1440_13000K	1
-#define PMU1_XTALTAB0_1440_14400K	2
-#define PMU1_XTALTAB0_1440_15360K	3
-#define PMU1_XTALTAB0_1440_16200K	4
-#define PMU1_XTALTAB0_1440_16800K	5
-#define PMU1_XTALTAB0_1440_19200K	6
-#define PMU1_XTALTAB0_1440_19800K	7
-#define PMU1_XTALTAB0_1440_20000K	8
-#define PMU1_XTALTAB0_1440_25000K	9
-#define PMU1_XTALTAB0_1440_26000K	10
-#define PMU1_XTALTAB0_1440_30000K	11
-#define PMU1_XTALTAB0_1440_37400K	12
-#define PMU1_XTALTAB0_1440_38400K	13
-#define PMU1_XTALTAB0_1440_40000K	14
-#define PMU1_XTALTAB0_1440_48000K	15
-
-/*
- * PMU crystal table indices for 960MHz fvco
- */
-#define PMU1_XTALTAB0_960_12000K	0
-#define PMU1_XTALTAB0_960_13000K	1
-#define PMU1_XTALTAB0_960_14400K	2
-#define PMU1_XTALTAB0_960_15360K	3
-#define PMU1_XTALTAB0_960_16200K	4
-#define PMU1_XTALTAB0_960_16800K	5
-#define PMU1_XTALTAB0_960_19200K	6
-#define PMU1_XTALTAB0_960_19800K	7
-#define PMU1_XTALTAB0_960_20000K	8
-#define PMU1_XTALTAB0_960_25000K	9
-#define PMU1_XTALTAB0_960_26000K	10
-#define PMU1_XTALTAB0_960_30000K	11
-#define PMU1_XTALTAB0_960_37400K	12
-#define PMU1_XTALTAB0_960_38400K	13
-#define PMU1_XTALTAB0_960_40000K	14
-#define PMU1_XTALTAB0_960_48000K	15
-
-/*
- * PMU crystal table indices for 880MHz fvco
- */
-#define PMU1_XTALTAB0_880_12000K	0
-#define PMU1_XTALTAB0_880_13000K	1
-#define PMU1_XTALTAB0_880_14400K	2
-#define PMU1_XTALTAB0_880_15360K	3
-#define PMU1_XTALTAB0_880_16200K	4
-#define PMU1_XTALTAB0_880_16800K	5
-#define PMU1_XTALTAB0_880_19200K	6
-#define PMU1_XTALTAB0_880_19800K	7
-#define PMU1_XTALTAB0_880_20000K	8
-#define PMU1_XTALTAB0_880_24000K	9
-#define PMU1_XTALTAB0_880_25000K	10
-#define PMU1_XTALTAB0_880_26000K	11
-#define PMU1_XTALTAB0_880_30000K	12
-#define PMU1_XTALTAB0_880_37400K	13
-#define PMU1_XTALTAB0_880_38400K	14
-#define PMU1_XTALTAB0_880_40000K	15
-
-/*
- * crystal frequency values
- */
-#define XTAL_FREQ_24000MHZ		24000
-#define XTAL_FREQ_30000MHZ		30000
-#define XTAL_FREQ_37400MHZ		37400
-#define XTAL_FREQ_48000MHZ		48000
-
-/*
- * Resource dependancies mask change action
- *
- * @RES_DEPEND_SET: Override the dependancies mask
- * @RES_DEPEND_ADD: Add to the  dependancies mask
- * @RES_DEPEND_REMOVE: Remove from the dependancies mask
- */
-#define RES_DEPEND_SET		0
-#define RES_DEPEND_ADD		1
-#define RES_DEPEND_REMOVE	-1
-
 /* Fields in pmucontrol */
 #define	PCTL_ILP_DIV_MASK	0xffff0000
 #define	PCTL_ILP_DIV_SHIFT	16
@@ -140,24 +48,12 @@
 #define	PCTL_ILP_DIV_EN		0x00000002
 #define	PCTL_LPO_SEL		0x00000001
 
-/* Fields in clkstretch */
-#define CSTRETCH_HT		0xffff0000
-#define CSTRETCH_ALP		0x0000ffff
-
-/* d11 slow to fast clock transition time in slow clock cycles */
-#define D11SCC_SLOW2FAST_TRANSITION	2
-
 /* ILP clock */
 #define	ILP_CLOCK		32000
 
 /* ALP clock on pre-PMU chips */
 #define	ALP_CLOCK		20000000
 
-/* HT clock */
-#define	HT_CLOCK		80000000
-
-#define OTPS_READY		0x00001000
-
 /* pmustatus */
 #define PST_EXTLPOAVAIL	0x0100
 #define PST_WDRESET	0x0080
@@ -170,411 +66,27 @@
 #define	PST_HTAVAIL	0x0004
 #define	PST_RESINIT	0x0003
 
-/* PMU Resource Request Timer registers */
-/* This is based on PmuRev0 */
-#define	PRRT_TIME_MASK	0x03ff
-#define	PRRT_INTEN	0x0400
-#define	PRRT_REQ_ACTIVE	0x0800
-#define	PRRT_ALP_REQ	0x1000
-#define	PRRT_HT_REQ	0x2000
-
 /* PMU resource bit position */
 #define PMURES_BIT(bit)	(1 << (bit))
 
-/* PMU resource number limit */
-#define PMURES_MAX_RESNUM	30
-
-/* PMU chip control0 register */
-#define	PMU_CHIPCTL0		0
-
-/* PMU chip control1 register */
-#define	PMU_CHIPCTL1			1
-#define	PMU_CC1_RXC_DLL_BYPASS		0x00010000
-
-#define PMU_CC1_IF_TYPE_MASK   		0x00000030
-#define PMU_CC1_IF_TYPE_RMII    	0x00000000
-#define PMU_CC1_IF_TYPE_MII     	0x00000010
-#define PMU_CC1_IF_TYPE_RGMII   	0x00000020
-
-#define PMU_CC1_SW_TYPE_MASK    	0x000000c0
-#define PMU_CC1_SW_TYPE_EPHY    	0x00000000
-#define PMU_CC1_SW_TYPE_EPHYMII 	0x00000040
-#define PMU_CC1_SW_TYPE_EPHYRMII	0x00000080
-#define PMU_CC1_SW_TYPE_RGMII   	0x000000c0
-
 /* PMU corerev and chip specific PLL controls.
  * PMU<rev>_PLL<num>_XX where <rev> is PMU corerev and <num> is an arbitrary number
  * to differentiate different PLLs controlled by the same PMU rev.
  */
 /* pllcontrol registers */
-/* PDIV, div_phy, div_arm, div_adc, dith_sel, ioff, kpd_scale, lsb_sel, mash_sel, lf_c & lf_r */
-#define	PMU0_PLL0_PLLCTL0		0
-#define	PMU0_PLL0_PC0_PDIV_MASK		1
-#define	PMU0_PLL0_PC0_PDIV_FREQ		25000
-#define PMU0_PLL0_PC0_DIV_ARM_MASK	0x00000038
-#define PMU0_PLL0_PC0_DIV_ARM_SHIFT	3
-#define PMU0_PLL0_PC0_DIV_ARM_BASE	8
-
-/* PC0_DIV_ARM for PLLOUT_ARM */
-#define PMU0_PLL0_PC0_DIV_ARM_110MHZ	0
-#define PMU0_PLL0_PC0_DIV_ARM_97_7MHZ	1
-#define PMU0_PLL0_PC0_DIV_ARM_88MHZ	2
-#define PMU0_PLL0_PC0_DIV_ARM_80MHZ	3	/* Default */
-#define PMU0_PLL0_PC0_DIV_ARM_73_3MHZ	4
-#define PMU0_PLL0_PC0_DIV_ARM_67_7MHZ	5
-#define PMU0_PLL0_PC0_DIV_ARM_62_9MHZ	6
-#define PMU0_PLL0_PC0_DIV_ARM_58_6MHZ	7
-
-/* Wildcard base, stop_mod, en_lf_tp, en_cal & lf_r2 */
-#define	PMU0_PLL0_PLLCTL1		1
-#define	PMU0_PLL0_PC1_WILD_INT_MASK	0xf0000000
-#define	PMU0_PLL0_PC1_WILD_INT_SHIFT	28
-#define	PMU0_PLL0_PC1_WILD_FRAC_MASK	0x0fffff00
-#define	PMU0_PLL0_PC1_WILD_FRAC_SHIFT	8
-#define	PMU0_PLL0_PC1_STOP_MOD		0x00000040
-
-/* Wildcard base, vco_calvar, vco_swc, vco_var_selref, vso_ical & vco_sel_avdd */
-#define	PMU0_PLL0_PLLCTL2		2
-#define	PMU0_PLL0_PC2_WILD_INT_MASK	0xf
-#define	PMU0_PLL0_PC2_WILD_INT_SHIFT	4
-
-/* pllcontrol registers */
 /* ndiv_pwrdn, pwrdn_ch<x>, refcomp_pwrdn, dly_ch<x>, p1div, p2div, _bypass_sdmod */
 #define PMU1_PLL0_PLLCTL0		0
-#define PMU1_PLL0_PC0_P1DIV_MASK	0x00f00000
-#define PMU1_PLL0_PC0_P1DIV_SHIFT	20
-#define PMU1_PLL0_PC0_P2DIV_MASK	0x0f000000
-#define PMU1_PLL0_PC0_P2DIV_SHIFT	24
-
-/* m<x>div */
 #define PMU1_PLL0_PLLCTL1		1
-#define PMU1_PLL0_PC1_M1DIV_MASK	0x000000ff
-#define PMU1_PLL0_PC1_M1DIV_SHIFT	0
-#define PMU1_PLL0_PC1_M2DIV_MASK	0x0000ff00
-#define PMU1_PLL0_PC1_M2DIV_SHIFT	8
-#define PMU1_PLL0_PC1_M3DIV_MASK	0x00ff0000
-#define PMU1_PLL0_PC1_M3DIV_SHIFT	16
-#define PMU1_PLL0_PC1_M4DIV_MASK	0xff000000
-#define PMU1_PLL0_PC1_M4DIV_SHIFT	24
-
-#define PMU1_PLL0_CHIPCTL0		0
-#define PMU1_PLL0_CHIPCTL1		1
-#define PMU1_PLL0_CHIPCTL2		2
-
-#define DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT 8
-#define DOT11MAC_880MHZ_CLK_DIVISOR_MASK (0xFF << DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT)
-#define DOT11MAC_880MHZ_CLK_DIVISOR_VAL  (0xE << DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT)
-
-/* m<x>div, ndiv_dither_mfb, ndiv_mode, ndiv_int */
 #define PMU1_PLL0_PLLCTL2		2
-#define PMU1_PLL0_PC2_M5DIV_MASK	0x000000ff
-#define PMU1_PLL0_PC2_M5DIV_SHIFT	0
-#define PMU1_PLL0_PC2_M6DIV_MASK	0x0000ff00
-#define PMU1_PLL0_PC2_M6DIV_SHIFT	8
-#define PMU1_PLL0_PC2_NDIV_MODE_MASK	0x000e0000
-#define PMU1_PLL0_PC2_NDIV_MODE_SHIFT	17
-#define PMU1_PLL0_PC2_NDIV_MODE_MASH	1
-#define PMU1_PLL0_PC2_NDIV_MODE_MFB	2	/* recommended for 4319 */
-#define PMU1_PLL0_PC2_NDIV_INT_MASK	0x1ff00000
-#define PMU1_PLL0_PC2_NDIV_INT_SHIFT	20
-
-/* ndiv_frac */
 #define PMU1_PLL0_PLLCTL3		3
-#define PMU1_PLL0_PC3_NDIV_FRAC_MASK	0x00ffffff
-#define PMU1_PLL0_PC3_NDIV_FRAC_SHIFT	0
-
-/* pll_ctrl */
 #define PMU1_PLL0_PLLCTL4		4
-
-/* pll_ctrl, vco_rng, clkdrive_ch<x> */
 #define PMU1_PLL0_PLLCTL5		5
-#define PMU1_PLL0_PC5_CLK_DRV_MASK 0xffffff00
-#define PMU1_PLL0_PC5_CLK_DRV_SHIFT 8
-
-/* PMU rev 2 control words */
-#define PMU2_PHY_PLL_PLLCTL		4
-#define PMU2_SI_PLL_PLLCTL		10
-
-/* PMU rev 2 */
-/* pllcontrol registers */
-/* ndiv_pwrdn, pwrdn_ch<x>, refcomp_pwrdn, dly_ch<x>, p1div, p2div, _bypass_sdmod */
-#define PMU2_PLL_PLLCTL0		0
-#define PMU2_PLL_PC0_P1DIV_MASK 	0x00f00000
-#define PMU2_PLL_PC0_P1DIV_SHIFT	20
-#define PMU2_PLL_PC0_P2DIV_MASK 	0x0f000000
-#define PMU2_PLL_PC0_P2DIV_SHIFT	24
-
-/* m<x>div */
-#define PMU2_PLL_PLLCTL1		1
-#define PMU2_PLL_PC1_M1DIV_MASK 	0x000000ff
-#define PMU2_PLL_PC1_M1DIV_SHIFT	0
-#define PMU2_PLL_PC1_M2DIV_MASK 	0x0000ff00
-#define PMU2_PLL_PC1_M2DIV_SHIFT	8
-#define PMU2_PLL_PC1_M3DIV_MASK 	0x00ff0000
-#define PMU2_PLL_PC1_M3DIV_SHIFT	16
-#define PMU2_PLL_PC1_M4DIV_MASK 	0xff000000
-#define PMU2_PLL_PC1_M4DIV_SHIFT	24
-
-/* m<x>div, ndiv_dither_mfb, ndiv_mode, ndiv_int */
-#define PMU2_PLL_PLLCTL2		2
-#define PMU2_PLL_PC2_M5DIV_MASK 	0x000000ff
-#define PMU2_PLL_PC2_M5DIV_SHIFT	0
-#define PMU2_PLL_PC2_M6DIV_MASK 	0x0000ff00
-#define PMU2_PLL_PC2_M6DIV_SHIFT	8
-#define PMU2_PLL_PC2_NDIV_MODE_MASK	0x000e0000
-#define PMU2_PLL_PC2_NDIV_MODE_SHIFT	17
-#define PMU2_PLL_PC2_NDIV_INT_MASK	0x1ff00000
-#define PMU2_PLL_PC2_NDIV_INT_SHIFT	20
-
-/* ndiv_frac */
-#define PMU2_PLL_PLLCTL3		3
-#define PMU2_PLL_PC3_NDIV_FRAC_MASK	0x00ffffff
-#define PMU2_PLL_PC3_NDIV_FRAC_SHIFT	0
-
-/* pll_ctrl */
-#define PMU2_PLL_PLLCTL4		4
-
-/* pll_ctrl, vco_rng, clkdrive_ch<x> */
-#define PMU2_PLL_PLLCTL5		5
-#define PMU2_PLL_PC5_CLKDRIVE_CH1_MASK	0x00000f00
-#define PMU2_PLL_PC5_CLKDRIVE_CH1_SHIFT	8
-#define PMU2_PLL_PC5_CLKDRIVE_CH2_MASK	0x0000f000
-#define PMU2_PLL_PC5_CLKDRIVE_CH2_SHIFT	12
-#define PMU2_PLL_PC5_CLKDRIVE_CH3_MASK	0x000f0000
-#define PMU2_PLL_PC5_CLKDRIVE_CH3_SHIFT	16
-#define PMU2_PLL_PC5_CLKDRIVE_CH4_MASK	0x00f00000
-#define PMU2_PLL_PC5_CLKDRIVE_CH4_SHIFT	20
-#define PMU2_PLL_PC5_CLKDRIVE_CH5_MASK	0x0f000000
-#define PMU2_PLL_PC5_CLKDRIVE_CH5_SHIFT	24
-#define PMU2_PLL_PC5_CLKDRIVE_CH6_MASK	0xf0000000
-#define PMU2_PLL_PC5_CLKDRIVE_CH6_SHIFT	28
-
-/* PMU rev 5 (& 6) */
-#define	PMU5_PLL_P1P2_OFF		0
-#define	PMU5_PLL_P1_MASK		0x0f000000
-#define	PMU5_PLL_P1_SHIFT		24
-#define	PMU5_PLL_P2_MASK		0x00f00000
-#define	PMU5_PLL_P2_SHIFT		20
-#define	PMU5_PLL_M14_OFF		1
-#define	PMU5_PLL_MDIV_MASK		0x000000ff
-#define	PMU5_PLL_MDIV_WIDTH		8
-#define	PMU5_PLL_NM5_OFF		2
-#define	PMU5_PLL_NDIV_MASK		0xfff00000
-#define	PMU5_PLL_NDIV_SHIFT		20
-#define	PMU5_PLL_NDIV_MODE_MASK		0x000e0000
-#define	PMU5_PLL_NDIV_MODE_SHIFT	17
-#define	PMU5_PLL_FMAB_OFF		3
-#define	PMU5_PLL_MRAT_MASK		0xf0000000
-#define	PMU5_PLL_MRAT_SHIFT		28
-#define	PMU5_PLL_ABRAT_MASK		0x08000000
-#define	PMU5_PLL_ABRAT_SHIFT		27
-#define	PMU5_PLL_FDIV_MASK		0x07ffffff
-#define	PMU5_PLL_PLLCTL_OFF		4
-#define	PMU5_PLL_PCHI_OFF		5
-#define	PMU5_PLL_PCHI_MASK		0x0000003f
 
 /* pmu XtalFreqRatio */
 #define	PMU_XTALFREQ_REG_ILPCTR_MASK	0x00001FFF
 #define	PMU_XTALFREQ_REG_MEASURE_MASK	0x80000000
 #define	PMU_XTALFREQ_REG_MEASURE_SHIFT	31
 
-/* Divider allocation in 4716/47162/5356/5357 */
-#define	PMU5_MAINPLL_CPU		1
-#define	PMU5_MAINPLL_MEM		2
-#define	PMU5_MAINPLL_SI			3
-
-#define PMU7_PLL_PLLCTL7                7
-#define PMU7_PLL_PLLCTL8                8
-#define PMU7_PLL_PLLCTL11		11
-
-/* PLL usage in 4716/47162 */
-#define	PMU4716_MAINPLL_PLL0		12
-
-/* PLL usage in 5356/5357 */
-#define	PMU5356_MAINPLL_PLL0		0
-#define	PMU5357_MAINPLL_PLL0		0
-
-/* 4328 resources */
-#define RES4328_EXT_SWITCHER_PWM	0	/* 0x00001 */
-#define RES4328_BB_SWITCHER_PWM		1	/* 0x00002 */
-#define RES4328_BB_SWITCHER_BURST	2	/* 0x00004 */
-#define RES4328_BB_EXT_SWITCHER_BURST	3	/* 0x00008 */
-#define RES4328_ILP_REQUEST		4	/* 0x00010 */
-#define RES4328_RADIO_SWITCHER_PWM	5	/* 0x00020 */
-#define RES4328_RADIO_SWITCHER_BURST	6	/* 0x00040 */
-#define RES4328_ROM_SWITCH		7	/* 0x00080 */
-#define RES4328_PA_REF_LDO		8	/* 0x00100 */
-#define RES4328_RADIO_LDO		9	/* 0x00200 */
-#define RES4328_AFE_LDO			10	/* 0x00400 */
-#define RES4328_PLL_LDO			11	/* 0x00800 */
-#define RES4328_BG_FILTBYP		12	/* 0x01000 */
-#define RES4328_TX_FILTBYP		13	/* 0x02000 */
-#define RES4328_RX_FILTBYP		14	/* 0x04000 */
-#define RES4328_XTAL_PU			15	/* 0x08000 */
-#define RES4328_XTAL_EN			16	/* 0x10000 */
-#define RES4328_BB_PLL_FILTBYP		17	/* 0x20000 */
-#define RES4328_RF_PLL_FILTBYP		18	/* 0x40000 */
-#define RES4328_BB_PLL_PU		19	/* 0x80000 */
-
-/* 4325 A0/A1 resources */
-#define RES4325_BUCK_BOOST_BURST	0	/* 0x00000001 */
-#define RES4325_CBUCK_BURST		1	/* 0x00000002 */
-#define RES4325_CBUCK_PWM		2	/* 0x00000004 */
-#define RES4325_CLDO_CBUCK_BURST	3	/* 0x00000008 */
-#define RES4325_CLDO_CBUCK_PWM		4	/* 0x00000010 */
-#define RES4325_BUCK_BOOST_PWM		5	/* 0x00000020 */
-#define RES4325_ILP_REQUEST		6	/* 0x00000040 */
-#define RES4325_ABUCK_BURST		7	/* 0x00000080 */
-#define RES4325_ABUCK_PWM		8	/* 0x00000100 */
-#define RES4325_LNLDO1_PU		9	/* 0x00000200 */
-#define RES4325_OTP_PU			10	/* 0x00000400 */
-#define RES4325_LNLDO3_PU		11	/* 0x00000800 */
-#define RES4325_LNLDO4_PU		12	/* 0x00001000 */
-#define RES4325_XTAL_PU			13	/* 0x00002000 */
-#define RES4325_ALP_AVAIL		14	/* 0x00004000 */
-#define RES4325_RX_PWRSW_PU		15	/* 0x00008000 */
-#define RES4325_TX_PWRSW_PU		16	/* 0x00010000 */
-#define RES4325_RFPLL_PWRSW_PU		17	/* 0x00020000 */
-#define RES4325_LOGEN_PWRSW_PU		18	/* 0x00040000 */
-#define RES4325_AFE_PWRSW_PU		19	/* 0x00080000 */
-#define RES4325_BBPLL_PWRSW_PU		20	/* 0x00100000 */
-#define RES4325_HT_AVAIL		21	/* 0x00200000 */
-
-/* 4325 B0/C0 resources */
-#define RES4325B0_CBUCK_LPOM		1	/* 0x00000002 */
-#define RES4325B0_CBUCK_BURST		2	/* 0x00000004 */
-#define RES4325B0_CBUCK_PWM		3	/* 0x00000008 */
-#define RES4325B0_CLDO_PU		4	/* 0x00000010 */
-
-/* 4325 C1 resources */
-#define RES4325C1_LNLDO2_PU		12	/* 0x00001000 */
-
-#define RES4329_RESERVED0		0	/* 0x00000001 */
-#define RES4329_CBUCK_LPOM		1	/* 0x00000002 */
-#define RES4329_CBUCK_BURST		2	/* 0x00000004 */
-#define RES4329_CBUCK_PWM		3	/* 0x00000008 */
-#define RES4329_CLDO_PU			4	/* 0x00000010 */
-#define RES4329_PALDO_PU		5	/* 0x00000020 */
-#define RES4329_ILP_REQUEST		6	/* 0x00000040 */
-#define RES4329_RESERVED7		7	/* 0x00000080 */
-#define RES4329_RESERVED8		8	/* 0x00000100 */
-#define RES4329_LNLDO1_PU		9	/* 0x00000200 */
-#define RES4329_OTP_PU			10	/* 0x00000400 */
-#define RES4329_RESERVED11		11	/* 0x00000800 */
-#define RES4329_LNLDO2_PU		12	/* 0x00001000 */
-#define RES4329_XTAL_PU			13	/* 0x00002000 */
-#define RES4329_ALP_AVAIL		14	/* 0x00004000 */
-#define RES4329_RX_PWRSW_PU		15	/* 0x00008000 */
-#define RES4329_TX_PWRSW_PU		16	/* 0x00010000 */
-#define RES4329_RFPLL_PWRSW_PU		17	/* 0x00020000 */
-#define RES4329_LOGEN_PWRSW_PU		18	/* 0x00040000 */
-#define RES4329_AFE_PWRSW_PU		19	/* 0x00080000 */
-#define RES4329_BBPLL_PWRSW_PU		20	/* 0x00100000 */
-#define RES4329_HT_AVAIL		21	/* 0x00200000 */
-
-/* 4315 resources */
-#define RES4315_CBUCK_LPOM		1	/* 0x00000002 */
-#define RES4315_CBUCK_BURST		2	/* 0x00000004 */
-#define RES4315_CBUCK_PWM		3	/* 0x00000008 */
-#define RES4315_CLDO_PU			4	/* 0x00000010 */
-#define RES4315_PALDO_PU		5	/* 0x00000020 */
-#define RES4315_ILP_REQUEST		6	/* 0x00000040 */
-#define RES4315_LNLDO1_PU		9	/* 0x00000200 */
-#define RES4315_OTP_PU			10	/* 0x00000400 */
-#define RES4315_LNLDO2_PU		12	/* 0x00001000 */
-#define RES4315_XTAL_PU			13	/* 0x00002000 */
-#define RES4315_ALP_AVAIL		14	/* 0x00004000 */
-#define RES4315_RX_PWRSW_PU		15	/* 0x00008000 */
-#define RES4315_TX_PWRSW_PU		16	/* 0x00010000 */
-#define RES4315_RFPLL_PWRSW_PU		17	/* 0x00020000 */
-#define RES4315_LOGEN_PWRSW_PU		18	/* 0x00040000 */
-#define RES4315_AFE_PWRSW_PU		19	/* 0x00080000 */
-#define RES4315_BBPLL_PWRSW_PU		20	/* 0x00100000 */
-#define RES4315_HT_AVAIL		21	/* 0x00200000 */
-
-/* 4319 resources */
-#define RES4319_CBUCK_LPOM		1	/* 0x00000002 */
-#define RES4319_CBUCK_BURST		2	/* 0x00000004 */
-#define RES4319_CBUCK_PWM		3	/* 0x00000008 */
-#define RES4319_CLDO_PU			4	/* 0x00000010 */
-#define RES4319_PALDO_PU		5	/* 0x00000020 */
-#define RES4319_ILP_REQUEST		6	/* 0x00000040 */
-#define RES4319_LNLDO1_PU		9	/* 0x00000200 */
-#define RES4319_OTP_PU			10	/* 0x00000400 */
-#define RES4319_LNLDO2_PU		12	/* 0x00001000 */
-#define RES4319_XTAL_PU			13	/* 0x00002000 */
-#define RES4319_ALP_AVAIL		14	/* 0x00004000 */
-#define RES4319_RX_PWRSW_PU		15	/* 0x00008000 */
-#define RES4319_TX_PWRSW_PU		16	/* 0x00010000 */
-#define RES4319_RFPLL_PWRSW_PU		17	/* 0x00020000 */
-#define RES4319_LOGEN_PWRSW_PU		18	/* 0x00040000 */
-#define RES4319_AFE_PWRSW_PU		19	/* 0x00080000 */
-#define RES4319_BBPLL_PWRSW_PU		20	/* 0x00100000 */
-#define RES4319_HT_AVAIL		21	/* 0x00200000 */
-
-#define CCTL_4319USB_XTAL_SEL_MASK	0x00180000
-#define CCTL_4319USB_XTAL_SEL_SHIFT	19
-#define CCTL_4319USB_48MHZ_PLL_SEL	1
-#define CCTL_4319USB_24MHZ_PLL_SEL	2
-
-/* PMU resources for 4336 */
-#define	RES4336_CBUCK_LPOM		0
-#define	RES4336_CBUCK_BURST		1
-#define	RES4336_CBUCK_LP_PWM		2
-#define	RES4336_CBUCK_PWM		3
-#define	RES4336_CLDO_PU			4
-#define	RES4336_DIS_INT_RESET_PD	5
-#define	RES4336_ILP_REQUEST		6
-#define	RES4336_LNLDO_PU		7
-#define	RES4336_LDO3P3_PU		8
-#define	RES4336_OTP_PU			9
-#define	RES4336_XTAL_PU			10
-#define	RES4336_ALP_AVAIL		11
-#define	RES4336_RADIO_PU		12
-#define	RES4336_BG_PU			13
-#define	RES4336_VREG1p4_PU_PU		14
-#define	RES4336_AFE_PWRSW_PU		15
-#define	RES4336_RX_PWRSW_PU		16
-#define	RES4336_TX_PWRSW_PU		17
-#define	RES4336_BB_PWRSW_PU		18
-#define	RES4336_SYNTH_PWRSW_PU		19
-#define	RES4336_MISC_PWRSW_PU		20
-#define	RES4336_LOGEN_PWRSW_PU		21
-#define	RES4336_BBPLL_PWRSW_PU		22
-#define	RES4336_MACPHY_CLKAVAIL		23
-#define	RES4336_HT_AVAIL		24
-#define	RES4336_RSVD			25
-
-/* 4330 resources */
-#define	RES4330_CBUCK_LPOM		0
-#define	RES4330_CBUCK_BURST		1
-#define	RES4330_CBUCK_LP_PWM		2
-#define	RES4330_CBUCK_PWM		3
-#define	RES4330_CLDO_PU			4
-#define	RES4330_DIS_INT_RESET_PD	5
-#define	RES4330_ILP_REQUEST		6
-#define	RES4330_LNLDO_PU		7
-#define	RES4330_LDO3P3_PU		8
-#define	RES4330_OTP_PU			9
-#define	RES4330_XTAL_PU			10
-#define	RES4330_ALP_AVAIL		11
-#define	RES4330_RADIO_PU		12
-#define	RES4330_BG_PU			13
-#define	RES4330_VREG1p4_PU_PU		14
-#define	RES4330_AFE_PWRSW_PU		15
-#define	RES4330_RX_PWRSW_PU		16
-#define	RES4330_TX_PWRSW_PU		17
-#define	RES4330_BB_PWRSW_PU		18
-#define	RES4330_SYNTH_PWRSW_PU		19
-#define	RES4330_MISC_PWRSW_PU		20
-#define	RES4330_LOGEN_PWRSW_PU		21
-#define	RES4330_BBPLL_PWRSW_PU		22
-#define	RES4330_MACPHY_CLKAVAIL		23
-#define	RES4330_HT_AVAIL		24
-#define	RES4330_5gRX_PWRSW_PU		25
-#define	RES4330_5gTX_PWRSW_PU		26
-#define	RES4330_5g_LOGEN_PWRSW_PU	27
-
 /* 4313 resources */
 #define	RES4313_BB_PU_RSRC		0
 #define	RES4313_ILP_REQ_RSRC		1
@@ -593,9 +105,6 @@
 #define	RES4313_HT_AVAIL_RSRC		14
 #define	RES4313_MACPHY_CLK_AVAIL_RSRC	15
 
-/* PMU resource up transition time in ILP cycles */
-#define PMURES_UP_TRANSITION	2
-
 /* Determine min/max rsrc masks. Value 0 leaves hardware at default. */
 static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax)
 {
Signature · 1 line
1.7.1
author
#15 lore raw

PATCH 15/119 staging: brcm80211: remove chip simulation specific code

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The driver contained several code paths specific to running the driver against a simulated chip. This is not needed and removed.

---
 drivers/staging/brcm80211/brcmsmac/aiutils.h     |    2 -
 drivers/staging/brcm80211/brcmsmac/main.c        |    6 +--
 drivers/staging/brcm80211/brcmsmac/nicpci.c      |   39 ++++++--------
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c |   38 +++++---------
 drivers/staging/brcm80211/brcmsmac/phy/phy_n.c   |    4 +-
 drivers/staging/brcm80211/brcmsmac/pmu.c         |   10 +---
 drivers/staging/brcm80211/brcmsmac/srom.c        |   61 +---------------------
 7 files changed, 37 insertions(+), 123 deletions(-)
drivers/staging/brcm80211/brcmsmac/aiutils.h +0 -2
index 965eb94..b00780d 100644
@@ -409,8 +409,6 @@ struct si_pub {
 #define SI_PCIDOWN	2
 #define SI_PCIUP	3
 
-#define	ISSIM_ENAB(sih)	0
-
 /* PMU clock/power control */
 #if defined(BCMPMUCTL)
 #define PMUCTL_ENAB(sih)	(BCMPMUCTL)
drivers/staging/brcm80211/brcmsmac/main.c +2 -4
index ca9f195..093f3bf 100644
@@ -5480,10 +5480,8 @@ static void brcms_c_bss_default_init(struct brcms_c_info *wlc)
 
 	/* init default and target BSS with some sane initial values */
 	memset((char *)(bi), 0, sizeof(wlc_bss_info_t));
-	bi->beacon_period = ISSIM_ENAB(wlc->pub->sih) ? BEACON_INTERVAL_DEF_QT :
-	    BEACON_INTERVAL_DEFAULT;
-	bi->dtim_period = ISSIM_ENAB(wlc->pub->sih) ? DTIM_INTERVAL_DEF_QT :
-	    DTIM_INTERVAL_DEFAULT;
+	bi->beacon_period = BEACON_INTERVAL_DEFAULT;
+	bi->dtim_period = DTIM_INTERVAL_DEFAULT;
 
 	/* fill the default channel as the first valid channel
 	 * starting from the 2G channels
drivers/staging/brcm80211/brcmsmac/nicpci.c +14 -19
index 5a19182..70d4173 100644
@@ -596,28 +596,23 @@ static void pcie_war_aspm_clkreq(pcicore_info_t *pi)
 		return;
 
 	/* bypass this on QT or VSIM */
-	if (!ISSIM_ENAB(sih)) {
-
-		reg16 = &pcieregs->sprom[SRSH_ASPM_OFFSET];
-		val16 = R_REG(reg16);
+	reg16 = &pcieregs->sprom[SRSH_ASPM_OFFSET];
+	val16 = R_REG(reg16);
 
-		val16 &= ~SRSH_ASPM_ENB;
-		if (pi->pcie_war_aspm_ovr == PCIE_ASPM_ENAB)
-			val16 |= SRSH_ASPM_ENB;
-		else if (pi->pcie_war_aspm_ovr == PCIE_ASPM_L1_ENAB)
-			val16 |= SRSH_ASPM_L1_ENB;
-		else if (pi->pcie_war_aspm_ovr == PCIE_ASPM_L0s_ENAB)
-			val16 |= SRSH_ASPM_L0s_ENB;
+	val16 &= ~SRSH_ASPM_ENB;
+	if (pi->pcie_war_aspm_ovr == PCIE_ASPM_ENAB)
+		val16 |= SRSH_ASPM_ENB;
+	else if (pi->pcie_war_aspm_ovr == PCIE_ASPM_L1_ENAB)
+		val16 |= SRSH_ASPM_L1_ENB;
+	else if (pi->pcie_war_aspm_ovr == PCIE_ASPM_L0s_ENAB)
+		val16 |= SRSH_ASPM_L0s_ENB;
 
-		W_REG(reg16, val16);
+	W_REG(reg16, val16);
 
-		pci_read_config_dword(pi->dev, pi->pciecap_lcreg_offset,
-					&w);
-		w &= ~PCIE_ASPM_ENAB;
-		w |= pi->pcie_war_aspm_ovr;
-		pci_write_config_dword(pi->dev,
-					pi->pciecap_lcreg_offset, w);
-	}
+	pci_read_config_dword(pi->dev, pi->pciecap_lcreg_offset, &w);
+	w &= ~PCIE_ASPM_ENAB;
+	w |= pi->pcie_war_aspm_ovr;
+	pci_write_config_dword(pi->dev, pi->pciecap_lcreg_offset, w);
 
 	reg16 = &pcieregs->sprom[SRSH_CLKREQ_OFFSET_REV5];
 	val16 = R_REG(reg16);
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c +13 -25
index dd56f10..a15c145 100644
@@ -519,6 +519,7 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
 	phy_info_t *pi;
 	u32 sflags = 0;
 	uint phyversion;
+	u32 idcode;
 	int i;
 
 	if (D11REV_IS(sh->corerev, 4))
@@ -589,27 +590,19 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
 		}
 	}
 
-	if (ISSIM_ENAB(pi->sh->sih)) {
-		pi->pubpi.radioid = NORADIO_ID;
-		pi->pubpi.radiorev = 5;
-	} else {
-		u32 idcode;
-
-		wlc_phy_anacore((wlc_phy_t *) pi, ON);
-
-		idcode = wlc_phy_get_radio_ver(pi);
-		pi->pubpi.radioid =
-		    (idcode & IDCODE_ID_MASK) >> IDCODE_ID_SHIFT;
-		pi->pubpi.radiorev =
-		    (idcode & IDCODE_REV_MASK) >> IDCODE_REV_SHIFT;
-		pi->pubpi.radiover =
-		    (idcode & IDCODE_VER_MASK) >> IDCODE_VER_SHIFT;
-		if (!VALID_RADIO(pi, pi->pubpi.radioid)) {
-			goto err;
-		}
+	wlc_phy_anacore((wlc_phy_t *) pi, ON);
 
-		wlc_phy_switch_radio((wlc_phy_t *) pi, OFF);
-	}
+	idcode = wlc_phy_get_radio_ver(pi);
+	pi->pubpi.radioid =
+	    (idcode & IDCODE_ID_MASK) >> IDCODE_ID_SHIFT;
+	pi->pubpi.radiorev =
+	    (idcode & IDCODE_REV_MASK) >> IDCODE_REV_SHIFT;
+	pi->pubpi.radiover =
+	    (idcode & IDCODE_VER_MASK) >> IDCODE_VER_SHIFT;
+	if (!VALID_RADIO(pi, pi->pubpi.radioid))
+		goto err;
+
+	wlc_phy_switch_radio((wlc_phy_t *) pi, OFF);
 
 	wlc_set_phy_uninitted(pi);
 
@@ -1195,11 +1188,6 @@ void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on)
 
 	i = 0;
 	count = ofdm ? 30 : 250;
-
-	if (ISSIM_ENAB(pi->sh->sih)) {
-		count *= 100;
-	}
-
 	while ((i++ < count)
 	       && (R_REG(&regs->txe_status) & (1 << 7))) {
 		udelay(10);
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c +1 -3
index ff0eb22..57fff0f 100644
@@ -15369,9 +15369,7 @@ static void wlc_phy_workarounds_nphy(phy_info_t *pi)
 	if (pi->phyhang_avoid)
 		wlc_phy_stay_in_carriersearch_nphy(pi, true);
 
-	if (!ISSIM_ENAB(pi->sh->sih)) {
-		or_phy_reg(pi, 0xb1, NPHY_IQFlip_ADC1 | NPHY_IQFlip_ADC2);
-	}
+	or_phy_reg(pi, 0xb1, NPHY_IQFlip_ADC1 | NPHY_IQFlip_ADC2);
 
 	if (NREV_GE(pi->pubpi.phy_rev, 7)) {
 
drivers/staging/brcm80211/brcmsmac/pmu.c +2 -8
index 6508243..e8b2b81 100644
@@ -203,7 +203,7 @@ u32 si_pmu_ilp_clock(struct si_pub *sih)
 {
 	static u32 ilpcycles_per_sec;
 
-	if (ISSIM_ENAB(sih) || !PMUCTL_ENAB(sih))
+	if (!PMUCTL_ENAB(sih))
 		return ILP_CLOCK;
 
 	if (ilpcycles_per_sec == 0) {
@@ -225,21 +225,15 @@ u16 si_pmu_fast_pwrup_delay(struct si_pub *sih)
 {
 	uint delay = PMU_MAX_TRANSITION_DLY;
 
-	/* Remember original core before switch to chipc */
-	origidx = ai_coreidx(sih);
-	cc = ai_setcoreidx(sih, SI_CC_IDX);
-
 	switch (sih->chip) {
 	case BCM43224_CHIP_ID:
 	case BCM43225_CHIP_ID:
 	case BCM4313_CHIP_ID:
-		delay = ISSIM_ENAB(sih) ? 70 : 3700;
+		delay = 3700;
 		break;
 	default:
 		break;
 	}
-	/* Return to original core */
-	ai_setcoreidx(sih, origidx);
 
 	return (u16) delay;
 }
drivers/staging/brcm80211/brcmsmac/srom.c +2 -59

81 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#16 lore raw

PATCH 16/119 staging: brcm80211: remove macro FOREACH_AS_STA

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The macro definition FOREACH_AS_STA does an assignment inside the if condition, which is considered a checkpatch error. It has been removed.

---
 drivers/staging/brcm80211/brcmsmac/main.c |   31 +++++++++++++++-------------
 1 files changed, 17 insertions(+), 14 deletions(-)
drivers/staging/brcm80211/brcmsmac/main.c +17 -14
index 093f3bf..f7ebaf1 100644
@@ -252,12 +252,6 @@ const u8 wlc_prio2prec_map[] = {
 #define BSSCFG_STA(cfg)		(1)
 #define BSSCFG_IBSS(cfg)	(!(cfg)->BSS)
 
-/* Iterator for "associated" STA bss configs:
-   (struct brcms_c_info *wlc, int idx, struct brcms_c_bsscfg *cfg) */
-#define FOREACH_AS_STA(wlc, idx, cfg) \
-	for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
-		if ((cfg = (wlc)->bsscfg[idx]) && BSSCFG_STA(cfg) && cfg->associated)
-
 /* As above for all non-NULL BSS configs */
 #define FOREACH_BSS(wlc, idx, cfg) \
 	for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
@@ -396,13 +390,19 @@ bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
 	if (AP_ACTIVE(wlc) || wlc->monitor)
 		return false;
 
-	FOREACH_AS_STA(wlc, idx, cfg) {
-		/* disallow PS when one of the following bsscfg specific conditions meets */
-		if (!cfg->BSS || !WLC_PORTOPEN(cfg))
-			return false;
+	for (idx = 0; idx < WLC_MAXBSSCFG; idx++) {
+		cfg = wlc->bsscfg[idx];
+		if (cfg && BSSCFG_STA(cfg) && cfg->associated) {
+			/*
+			 * disallow PS when one of the following
+			 * bsscfg specific conditions meets
+			 */
+			if (!cfg->BSS || !WLC_PORTOPEN(cfg))
+				return false;
 
-		if (!cfg->dtim_programmed)
-			return false;
+			if (!cfg->dtim_programmed)
+				return false;
+		}
 	}
 
 	return true;
@@ -1060,8 +1060,11 @@ static void WLBANDINITFN(brcms_c_setband) (struct brcms_c_info *wlc,
 		return;
 
 	/* wait for at least one beacon before entering sleeping state */
-	FOREACH_AS_STA(wlc, idx, cfg)
-	    cfg->PMawakebcn = true;
+	for (idx = 0; idx < WLC_MAXBSSCFG; idx++) {
+		cfg = wlc->bsscfg[idx];
+		if (cfg && BSSCFG_STA(cfg) && cfg->associated)
+			cfg->PMawakebcn = true;
+	}
 	brcms_c_set_ps_ctrl(wlc);
 
 	/* band-specific initializations */
Signature · 1 line
1.7.1
author
#17 lore raw

PATCH 17/119 staging: brcm80211: change FOREACH_BSS macro to remove checkpatch error

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The macro FOREACH_BSS did an assignment inside the if condition. The macro has been modified to get rid of the error.

---
 drivers/staging/brcm80211/brcmsmac/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/staging/brcm80211/brcmsmac/main.c +3 -2
index f7ebaf1..9aa74df 100644
@@ -254,8 +254,9 @@ const u8 wlc_prio2prec_map[] = {
 
 /* As above for all non-NULL BSS configs */
 #define FOREACH_BSS(wlc, idx, cfg) \
-	for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
-		if ((cfg = (wlc)->bsscfg[idx]))
+	for (idx = 0, cfg = (wlc)->bsscfg[idx]; \
+	     idx < WLC_MAXBSSCFG; cfg = (wlc)->bsscfg[++idx]) \
+		if (cfg)
 
 /* Sanity check for tx_prec_map and fifo synchup
  * Either there are some packets pending for the fifo, else if fifo is empty then
Signature · 1 line
1.7.1
#18 lore raw

Re: [PATCH 017/119] staging: brcm80211: change FOREACH_BSS macro to remove checkpatch error

drivers/staging/brcm80211/brcmsmac/main.c const u8 wlc_prio2prec_map[] = { · line 259

Quoted 7 lines · Franky Lin

#define FOREACH_BSS(wlc, idx, cfg) \

drivers/staging/brcm80211/brcmsmac/main.c +3 -2
-	for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
-		if ((cfg = (wlc)->bsscfg[idx]))
+	for (idx = 0, cfg = (wlc)->bsscfg[idx]; \
+	     idx < WLC_MAXBSSCFG; cfg = (wlc)->bsscfg[++idx]) \
+		if (cfg)

That's pretty ugly. Better to leave the original in and ignore the checkpatch warning. Or maybe do something like this:

	for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) { \
		cfg = (wlc)->bsscfg[idx];		  \
		if (!cfg)				  \
			continue;			  \

Then #define END_FOREACH_BSS() }

Btw, this patchset has over 100 patches so unless there is something drastically wrong lets just apply it as is and fix up any complaints that people have in later patches. It sucks when people resend huge patchsets and we have to review everything again.

regards,
dan carpenter

#19 lore raw

Re: [PATCH 017/119] staging: brcm80211: change FOREACH_BSS macro to remove checkpatch error

Quoted 11 lines · Dan Carpenter

drivers/staging/brcm80211/brcmsmac/main.c const u8 wlc_prio2prec_map[] = { · line 259

Quoted 7 lines · Franky Lin
  #define FOREACH_BSS(wlc, idx, cfg) \
drivers/staging/brcm80211/brcmsmac/main.c +3 -2
-	for (idx = 0; (int) idx<  WLC_MAXBSSCFG; idx++) \
-		if ((cfg = (wlc)->bsscfg[idx]))
+	for (idx = 0, cfg = (wlc)->bsscfg[idx]; \
+	     idx<  WLC_MAXBSSCFG; cfg = (wlc)->bsscfg[++idx]) \
+		if (cfg)

That's pretty ugly. Better to leave the original in and ignore the checkpatch warning. Or maybe do something like this:

Quoted 6 lines
	for (idx = 0; (int) idx<  WLC_MAXBSSCFG; idx++) { \
		cfg = (wlc)->bsscfg[idx];		  \
		if (!cfg)				  \
			continue;			  \

Then #define END_FOREACH_BSS() }

Hi Dan,

I agree this is not the nicest solution. It was a checkpatch error so we felt an urge to fix it. A warning would have been easier to ignore. I will have a look and see whether the patch can be dropped without issues. Your feedback is noted so I will look for a better iteration solution to replace this.

Gr. AvS

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

Re: [PATCH 017/119] staging: brcm80211: change FOREACH_BSS macro to remove checkpatch error

Quoted 9 lines · Arend van Spriel
Quoted 8 lines · Dan Carpenter

That's pretty ugly. Better to leave the original in and ignore the checkpatch warning. Or maybe do something like this:

	for (idx = 0; (int) idx<   WLC_MAXBSSCFG; idx++) { \
		cfg = (wlc)->bsscfg[idx];		  \
		if (!cfg)				  \
			continue;			  \
Quoted 8 lines
Quoted 1 line

Then #define END_FOREACH_BSS() }

Hi Dan,

I agree this is not the nicest solution. It was a checkpatch error so we felt an urge to fix it. A warning would have been easier to ignore. I will have a look and see whether the patch can be dropped without issues. Your feedback is noted so I will look for a better iteration solution to replace this.

Hi Greg,

Can you please drop this patch from the series? There are no dependencies with the other patches.

Gr. AvS

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

Re: [PATCH 017/119] staging: brcm80211: change FOREACH_BSS macro to remove checkpatch error

Quoted 19 lines · Arend van Spriel
Quoted 9 lines · Arend van Spriel
Quoted 8 lines · Dan Carpenter

That's pretty ugly. Better to leave the original in and ignore the checkpatch warning. Or maybe do something like this:

	for (idx = 0; (int) idx<   WLC_MAXBSSCFG; idx++) { \
		cfg = (wlc)->bsscfg[idx];		  \
		if (!cfg)				  \
			continue;			  \
Quoted 8 lines
Quoted 1 line

Then #define END_FOREACH_BSS() }

Hi Dan,

I agree this is not the nicest solution. It was a checkpatch error so we felt an urge to fix it. A warning would have been easier to ignore. I will have a look and see whether the patch can be dropped without issues. Your feedback is noted so I will look for a better iteration solution to replace this.

Quoted 4 lines

Hi Greg,

Can you please drop this patch from the series? There are no dependencies with the other patches.

Now dropped.

author
#22 lore raw

PATCH 18/119 staging: brcm80211: remove macro definition DRV_MODULE_NAME

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The macro definition DRV_MODULE_NAME has exactly the same value as KBUILD_MODNAME so using that instead now.

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -3
index dfbbda7..d09706b 100644
@@ -180,8 +180,6 @@ MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
 MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
 MODULE_LICENSE("Dual BSD/GPL");
 
-#define DRV_MODULE_NAME "brcmfmac"
-
 /* Linux wireless extension support */
 #if defined(CONFIG_WIRELESS_EXT)
 #include <wl_iw.h>
@@ -1490,7 +1488,7 @@ static void dhd_ethtool_get_drvinfo(struct net_device *net,
 {
 	dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
 
-	sprintf(info->driver, DRV_MODULE_NAME);
+	sprintf(info->driver, KBUILD_MODNAME);
 	sprintf(info->version, "%lu", dhd->pub.drv_version);
 	sprintf(info->fw_version, "%s", wl_cfg80211_get_fwname());
 	sprintf(info->bus_info, "%s", dev_name(&wl_cfg80211_get_sdio_func()->dev));
Signature · 1 line
1.7.1
author
#23 lore raw

PATCH 19/119 staging: brcm80211: get rid on IS_CFG80211_FAVORITE macro

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

cfg80211 module is always favorite for the brcmfmac driver so the macro is not needed to know the answer.

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |  108 +++++------------------
 1 files changed, 24 insertions(+), 84 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +24 -84
index d09706b..386955e 100644
@@ -262,6 +262,10 @@ char nvram_path[MOD_PARAM_PATHLEN];
 module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0);
 module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
 
+/* No firmware required */
+bool dhd_no_fw_req;
+module_param(dhd_no_fw_req, bool, 0);
+
 /* Error bits */
 module_param(dhd_msg_level, int, 0);
 
@@ -339,10 +343,6 @@ module_param(dhd_idletime, int, 0);
 uint dhd_poll;
 module_param(dhd_poll, uint, 0);
 
-/* Use cfg80211 */
-uint dhd_cfg80211 = true;
-module_param(dhd_cfg80211, uint, 0);
-
 /* Use interrupts */
 uint dhd_intr = true;
 module_param(dhd_intr, uint, 0);
@@ -371,11 +371,6 @@ uint dhd_pktgen_len;
 module_param(dhd_pktgen_len, uint, 0);
 #endif
 
-#define FAVORITE_WIFI_CP	(!!dhd_cfg80211)
-#define IS_CFG80211_FAVORITE() FAVORITE_WIFI_CP
-#define DBG_CFG80211_GET() ((dhd_cfg80211 & WL_DBG_MASK) >> 1)
-#define NO_FW_REQ() (dhd_cfg80211 & 0x80)
-
 /* Version string to report */
 #ifdef DHD_DEBUG
 #define DHD_COMPILED "\nCompiled in " SRCBASE
@@ -398,32 +393,6 @@ static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
 static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 			     wl_event_msg_t *event_ptr, void **data_ptr);
 
-#if defined(CONFIG_PM_SLEEP)
-static int dhd_sleep_pm_callback(struct notifier_block *nfb,
-				 unsigned long action, void *ignored)
-{
-	switch (action) {
-	case PM_HIBERNATION_PREPARE:
-	case PM_SUSPEND_PREPARE:
-		atomic_set(&dhd_mmc_suspend, true);
-		return NOTIFY_OK;
-	case PM_POST_HIBERNATION:
-	case PM_POST_SUSPEND:
-		atomic_set(&dhd_mmc_suspend, false);
-		return NOTIFY_OK;
-	}
-	return 0;
-}
-
-static struct notifier_block dhd_sleep_pm_notifier = {
-	.notifier_call = dhd_sleep_pm_callback,
-	.priority = 0
-};
-
-extern int register_pm_notifier(struct notifier_block *nb);
-extern int unregister_pm_notifier(struct notifier_block *nb);
-#endif	/* defined(CONFIG_PM_SLEEP) */
-	/* && defined(DHD_GPL) */
 static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
 {
 #ifdef PKT_FILTER_SUPPORT
@@ -1740,9 +1709,7 @@ static int dhd_stop(struct net_device *net)
 	dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
 
 	DHD_TRACE(("%s: Enter\n", __func__));
-	if (IS_CFG80211_FAVORITE()) {
-		wl_cfg80211_down();
-	}
+	wl_cfg80211_down();
 	if (dhd->pub.up == 0)
 		return 0;
 
@@ -1792,12 +1759,10 @@ static int dhd_open(struct net_device *net)
 	/* Allow transmit calls */
 	netif_start_queue(net);
 	dhd->pub.up = 1;
-	if (IS_CFG80211_FAVORITE()) {
-		if (unlikely(wl_cfg80211_up())) {
-			DHD_ERROR(("%s: failed to bring up cfg80211\n",
-				   __func__));
-			return -1;
-		}
+	if (unlikely(wl_cfg80211_up())) {
+		DHD_ERROR(("%s: failed to bring up cfg80211\n",
+			   __func__));
+		return -1;
 	}
 
 	return ret;
@@ -1937,15 +1902,13 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
 #endif	/* defined(CONFIG_WIRELESS_EXT) */
 
 	/* Attach and link in the cfg80211 */
-	if (IS_CFG80211_FAVORITE()) {
-		if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
-			DHD_ERROR(("wl_cfg80211_attach failed\n"));
-			goto fail;
-		}
-		if (!NO_FW_REQ()) {
-			strcpy(fw_path, wl_cfg80211_get_fwname());
-			strcpy(nv_path, wl_cfg80211_get_nvramname());
-		}
+	if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
+		DHD_ERROR(("wl_cfg80211_attach failed\n"));
+		goto fail;
+	}
+	if (!dhd_no_fw_req) {
+		strcpy(fw_path, wl_cfg80211_get_fwname());
+		strcpy(nv_path, wl_cfg80211_get_nvramname());
 	}
 
 	/* Set up the watchdog timer */
@@ -2011,8 +1974,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
 #endif
 #if defined(CONFIG_PM_SLEEP)
 	atomic_set(&dhd_mmc_suspend, false);
-	if (!IS_CFG80211_FAVORITE())
-		register_pm_notifier(&dhd_sleep_pm_notifier);
 #endif	/* defined(CONFIG_PM_SLEEP) */
 	/* && defined(DHD_GPL) */
 	/* Init lock suspend to prevent kernel going to suspend */
@@ -2302,13 +2263,8 @@ void dhd_detach(dhd_pub_t *dhdp)
 			wl_iw_detach();
 #endif				/* (CONFIG_WIRELESS_EXT) */
 
-			if (IS_CFG80211_FAVORITE())
-				wl_cfg80211_detach();
+			wl_cfg80211_detach();
 
-#if defined(CONFIG_PM_SLEEP)
-			if (!IS_CFG80211_FAVORITE())
-				unregister_pm_notifier(&dhd_sleep_pm_notifier);
-#endif	/* defined(CONFIG_PM_SLEEP) */
 			/* && defined(DHD_GPL) */
 			free_netdev(ifp->net);
 			kfree(ifp);
@@ -2509,7 +2465,7 @@ void *dhd_os_open_image(char *filename)
 {
 	struct file *fp;
 
-	if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
+	if (!dhd_no_fw_req)
 		return wl_cfg80211_request_fw(filename);
 
 	fp = filp_open(filename, O_RDONLY, 0);
@@ -2530,7 +2486,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image)
 	struct file *fp = (struct file *)image;
 	int rdlen;
 
-	if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
+	if (!dhd_no_fw_req)
 		return wl_cfg80211_read_fw(buf, len);
 
 	if (!image)
@@ -2545,7 +2501,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image)
 
 void dhd_os_close_image(void *image)
 {
-	if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
+	if (!dhd_no_fw_req)
 		return wl_cfg80211_release_fw();
 	if (image)
 		filp_close((struct file *)image, NULL);
@@ -2587,26 +2543,10 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 	if (bcmerror != 0)
 		return bcmerror;
 
-#if defined(CONFIG_WIRELESS_EXT)
-	if (!IS_CFG80211_FAVORITE()) {
-		if ((dhd->iflist[*ifidx] == NULL)
-		    || (dhd->iflist[*ifidx]->net == NULL)) {
-			DHD_ERROR(("%s Exit null pointer\n", __func__));
-			return bcmerror;
-		}
-
-		if (dhd->iflist[*ifidx]->net)
-			wl_iw_event(dhd->iflist[*ifidx]->net, event, *data);
-	}
-#endif				/* defined(CONFIG_WIRELESS_EXT)  */
-
-	if (IS_CFG80211_FAVORITE()) {
-		ASSERT(dhd->iflist[*ifidx] != NULL);
-		ASSERT(dhd->iflist[*ifidx]->net != NULL);
-		if (dhd->iflist[*ifidx]->net)
-			wl_cfg80211_event(dhd->iflist[*ifidx]->net, event,
-					  *data);
-	}
+	ASSERT(dhd->iflist[*ifidx] != NULL);
+	ASSERT(dhd->iflist[*ifidx]->net != NULL);
+	if (dhd->iflist[*ifidx]->net)
+		wl_cfg80211_event(dhd->iflist[*ifidx]->net, event, *data);
 
 	return bcmerror;
 }
Signature · 1 line
1.7.1
author
#24 lore raw

PATCH 20/119 staging: brcm80211: move assert function to dhd_linux.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The source file wl_iw.c is primarily intended to provide wireless extensions functionality, which is to be removed from the driver. The assert function is moved to another source file.

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   50 +++++++++++++++++++++++
 drivers/staging/brcm80211/brcmfmac/wl_iw.c     |   51 ------------------------
 2 files changed, 50 insertions(+), 51 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +50 -0
index 386955e..e0cd8e1 100644
@@ -46,6 +46,9 @@
 #define EPI_VERSION_STR		"4.218.248.5"
 #define ETH_P_BRCM			0x886c
 
+/* Global ASSERT type flag */
+u32 g_assert_type;
+
 #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
 #include <linux/wifi_tiwlan.h>
 
@@ -2766,3 +2769,50 @@ exit:
 	return ret;
 }
 #endif				/* DHD_DEBUG */
+
+#if defined(BCMDBG)
+void osl_assert(char *exp, char *file, int line)
+{
+	char tempbuf[256];
+	char *basename;
+
+	basename = strrchr(file, '/');
+	/* skip the '/' */
+	if (basename)
+		basename++;
+
+	if (!basename)
+		basename = file;
+
+	snprintf(tempbuf, 256,
+		 "assertion \"%s\" failed: file \"%s\", line %d\n", exp,
+		 basename, line);
+
+	/*
+	 * Print assert message and give it time to
+	 * be written to /var/log/messages
+	 */
+	if (!in_interrupt()) {
+		const int delay = 3;
+		printk(KERN_ERR "%s", tempbuf);
+		printk(KERN_ERR "panic in %d seconds\n", delay);
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(delay * HZ);
+	}
+
+	switch (g_assert_type) {
+	case 0:
+		panic(KERN_ERR "%s", tempbuf);
+		break;
+	case 1:
+		printk(KERN_ERR "%s", tempbuf);
+		BUG();
+		break;
+	case 2:
+		printk(KERN_ERR "%s", tempbuf);
+		break;
+	default:
+		break;
+	}
+}
+#endif				/* defined(BCMDBG) */
drivers/staging/brcm80211/brcmfmac/wl_iw.c +0 -51

62 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#25 lore raw

PATCH 21/119 staging: brcm80211: parsed ADDBA response ack window parameter

In reply to Franky Lin

From: Roland Vossen <[email protected]>

IEEE80211_AMPDU_TX_OPERATIONAL provides a BA window size parameter. Code is now using this parameter to restrict the amount of outstanding tx AMPDUs.

---
 drivers/staging/brcm80211/brcmsmac/ampdu.c       |   55 +++++++---------------
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c |    9 +++-
 drivers/staging/brcm80211/brcmsmac/pub.h         |    2 +
 drivers/staging/brcm80211/brcmsmac/scb.h         |    3 +-
 4 files changed, 29 insertions(+), 40 deletions(-)
drivers/staging/brcm80211/brcmsmac/ampdu.c +18 -37
index 74c4055..e9b78bf 100644
@@ -114,9 +114,6 @@ static void brcms_c_ffpld_init(struct ampdu_info *ampdu);
 static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int f);
 static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f);
 
-static scb_ampdu_tid_ini_t *brcms_c_ampdu_init_tid_ini(struct ampdu_info *ampdu,
-						   scb_ampdu_t *scb_ampdu,
-						   u8 tid, bool override);
 static void brcms_c_scb_ampdu_update_max_txlen(struct ampdu_info *ampdu,
 					       u8 dur);
 static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu,
@@ -411,22 +408,26 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
 	}
 }
 
-static void
-brcms_c_ampdu_agg(struct ampdu_info *ampdu, struct scb *scb, struct sk_buff *p,
-	      uint prec)
+void
+brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
+		  u8 ba_wsize)		/* negotiated ba window size (in pdu) */
 {
 	scb_ampdu_t *scb_ampdu;
 	scb_ampdu_tid_ini_t *ini;
-	u8 tid = (u8) (p->priority);
-
+	struct ampdu_info *ampdu = wlc->ampdu;
+	struct scb *scb = wlc->pub->global_scb;
 	scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
 
-	/* initialize initiator on first packet; sends addba req */
-	ini = SCB_AMPDU_INI(scb_ampdu, tid);
-	if (ini->magic != INI_MAGIC) {
-		ini = brcms_c_ampdu_init_tid_ini(ampdu, scb_ampdu, tid, false);
+	if (!ampdu->ini_enable[tid]) {
+		wiphy_err(ampdu->wlc->wiphy, "%s: Rejecting tid %d\n",
+			  __func__, tid);
+		return;
 	}
-	return;
+
+	ini = SCB_AMPDU_INI(scb_ampdu, tid);
+	ini->tid = tid;
+	ini->scb = scb_ampdu->scb;
+	ini->ba_wsize = ba_wsize;
 }
 
 int
@@ -479,12 +480,13 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
 
 	/* Let pressure continue to build ... */
 	qlen = pktq_plen(&qi->q, prec);
-	if (ini->tx_in_transit > 0 && qlen < scb_ampdu->max_pdu) {
+	if (ini->tx_in_transit > 0 &&
+	    qlen < min(scb_ampdu->max_pdu, ini->ba_wsize)) {
+		/* Collect multiple MPDU's to be sent in the next AMPDU */
 		return -EBUSY;
 	}
 
-	brcms_c_ampdu_agg(ampdu, scb, p, tid);
-
+	/* at this point we intend to transmit an AMPDU */
 	rr_retry_limit = ampdu->rr_retry_limit_tid[tid];
 	ampdu_len = 0;
 	dma_len = 0;
@@ -1083,27 +1085,6 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
 	brcms_c_txfifo_complete(wlc, queue, ampdu->txpkt_weight);
 }
 
-/* initialize the initiator code for tid */
-static scb_ampdu_tid_ini_t *brcms_c_ampdu_init_tid_ini(struct ampdu_info *ampdu,
-						   scb_ampdu_t *scb_ampdu,
-						   u8 tid, bool override)
-{
-	scb_ampdu_tid_ini_t *ini;
-
-	/* check for per-tid control of ampdu */
-	if (!ampdu->ini_enable[tid]) {
-		wiphy_err(ampdu->wlc->wiphy, "%s: Rejecting tid %d\n",
-			  __func__, tid);
-		return NULL;
-	}
-
-	ini = SCB_AMPDU_INI(scb_ampdu, tid);
-	ini->tid = tid;
-	ini->scb = scb_ampdu->scb;
-	ini->magic = INI_MAGIC;
-	return ini;
-}
-
 static int brcms_c_ampdu_set(struct ampdu_info *ampdu, bool on)
 {
 	struct brcms_c_info *wlc = ampdu->wlc;
drivers/staging/brcm80211/brcmsmac/mac80211_if.c +8 -1
index 73e60df..547df75 100644
@@ -656,7 +656,14 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
 		ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
 		break;
 	case IEEE80211_AMPDU_TX_OPERATIONAL:
-		/* Not sure what to do here */
+		/*
+		 * BA window size from ADDBA response ('buf_size') defines how
+		 * many outstanding MPDUs are allowed for the BA stream by
+		 * recipient and traffic class.
+		 */
+		LOCK(wl);
+		brcms_c_ampdu_tx_operational(wl->wlc, tid, buf_size);
+		UNLOCK(wl);
 		/* Power save wakeup */
 		break;
 	default:
drivers/staging/brcm80211/brcmsmac/pub.h +2 -0
index 2345a31..14c0d20 100644
@@ -626,6 +626,8 @@ extern void brcms_default_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs);
 
 extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
 			    struct ieee80211_sta *sta, u16 tid);
+extern void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
+					 u8 ba_wsize);
 extern int brcms_c_set_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
 			   int val);
 extern int brcms_c_get_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
drivers/staging/brcm80211/brcmsmac/scb.h +1 -2
index fa5c0b3..c2080e9 100644
@@ -25,11 +25,11 @@
 #define AMPDU_TX_BA_MAX_WSIZE	64	/* max Tx ba window size (in pdu) */
 /* structure to store per-tid state for the ampdu initiator */
 struct scb_ampdu_tid_ini {
-	u32 magic;
 	u8 tx_in_transit;	/* number of pending mpdus in transit in driver */
 	u8 tid;		/* initiator tid for easy lookup */
 	u8 txretry[AMPDU_TX_BA_MAX_WSIZE];	/* tx retry count; indexed by seq modulo */
 	struct scb *scb;	/* backptr for easy lookup */
+	u8 ba_wsize;		/* negotiated ba window size (in pdu) */
 };
 
 #define AMPDU_MAX_SCB_TID	NUMPRIO
@@ -51,7 +51,6 @@ struct scb_ampdu {
 };
 
 #define SCB_MAGIC 	0xbeefcafe
-#define INI_MAGIC 	0xabcd1234
 
 /* station control block - one per remote MAC address */
 struct scb {
Signature · 1 line
1.7.1
author
#26 lore raw

PATCH 22/119 staging: brcm80211: taking max AMPDU length advertized by peer into account

In reply to Franky Lin

From: Roland Vossen <[email protected]>

AP advertizes max AMPDU rx length in beacon/probe response frame. Code now uses this information to limit the length of AMPDU frames it transmits.

---
 drivers/staging/brcm80211/brcmsmac/ampdu.c       |   25 ++++++++-------------
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c |    7 ++++-
 drivers/staging/brcm80211/brcmsmac/pub.h         |    2 +-
 drivers/staging/brcm80211/brcmsmac/scb.h         |    2 +-
 4 files changed, 17 insertions(+), 19 deletions(-)
drivers/staging/brcm80211/brcmsmac/ampdu.c +10 -15
index e9b78bf..6271ad1 100644
@@ -220,9 +220,9 @@ static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu,
 
 	scb_ampdu->release = min_t(u8, scb_ampdu->max_pdu, AMPDU_SCB_MAX_RELEASE);
 
-	if (scb_ampdu->max_rxlen)
-		scb_ampdu->release =
-		    min_t(u8, scb_ampdu->release, scb_ampdu->max_rxlen / 1600);
+	if (scb_ampdu->max_rx_ampdu_bytes)
+		scb_ampdu->release = min_t(u8, scb_ampdu->release,
+			scb_ampdu->max_rx_ampdu_bytes / 1600);
 
 	scb_ampdu->release = min(scb_ampdu->release,
 				 ampdu->fifo_tb[TX_AC_BE_FIFO].
@@ -410,7 +410,8 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
 
 void
 brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
-		  u8 ba_wsize)		/* negotiated ba window size (in pdu) */
+	u8 ba_wsize,		/* negotiated ba window size (in pdu) */
+	uint max_rx_ampdu_bytes) /* from ht_cap in beacon */
 {
 	scb_ampdu_t *scb_ampdu;
 	scb_ampdu_tid_ini_t *ini;
@@ -428,6 +429,7 @@ brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
 	ini->tid = tid;
 	ini->scb = scb_ampdu->scb;
 	ini->ba_wsize = ba_wsize;
+	scb_ampdu->max_rx_ampdu_bytes = max_rx_ampdu_bytes;
 }
 
 int
@@ -446,7 +448,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
 	bool rr = true, fbr = false;
 	uint i, count = 0, fifo, seg_cnt = 0;
 	u16 plen, len, seq = 0, mcl, mch, index, frameid, dma_len = 0;
-	u32 ampdu_len, maxlen = 0;
+	u32 ampdu_len, max_ampdu_bytes = 0;
 	d11txh_t *txh = NULL;
 	u8 *plcp;
 	struct ieee80211_hdr *h;
@@ -611,15 +613,10 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
 			is40 = (plcp0 & MIMO_PLCP_40MHZ) ? 1 : 0;
 			sgi = PLCP3_ISSGI(plcp3) ? 1 : 0;
 			mcs = plcp0 & ~MIMO_PLCP_40MHZ;
-			maxlen =
-			    min(scb_ampdu->max_rxlen,
+			max_ampdu_bytes =
+			    min(scb_ampdu->max_rx_ampdu_bytes,
 				ampdu->max_txlen[mcs][is40][sgi]);
 
-			/* XXX Fix me to honor real max_rxlen */
-			/* can fix this as soon as ampdu_action() in mac80211.h
-			 * gets extra u8buf_size par */
-			maxlen = 64 * 1024;
-
 			if (is40)
 				mimo_ctlchbw =
 				    CHSPEC_SB_UPPER(WLC_BAND_PI_RADIO_CHANSPEC)
@@ -681,10 +678,8 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
 				       AMPDU_MAX_MPDU_OVERHEAD;
 				plen = max(scb_ampdu->min_len, plen);
 
-				if ((plen + ampdu_len) > maxlen) {
+				if ((plen + ampdu_len) > max_ampdu_bytes) {
 					p = NULL;
-					wiphy_err(wiphy, "%s: Bogus plen #1\n",
-						__func__);
 					continue;
 				}
 
drivers/staging/brcm80211/brcmsmac/mac80211_if.c +5 -2
index 547df75..c74c186 100644
@@ -659,10 +659,13 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
 		/*
 		 * BA window size from ADDBA response ('buf_size') defines how
 		 * many outstanding MPDUs are allowed for the BA stream by
-		 * recipient and traffic class.
+		 * recipient and traffic class. 'ampdu_factor' gives maximum
+		 * AMPDU size.
 		 */
 		LOCK(wl);
-		brcms_c_ampdu_tx_operational(wl->wlc, tid, buf_size);
+		brcms_c_ampdu_tx_operational(wl->wlc, tid, buf_size,
+			(1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
+			 sta->ht_cap.ampdu_factor)) - 1);
 		UNLOCK(wl);
 		/* Power save wakeup */
 		break;
drivers/staging/brcm80211/brcmsmac/pub.h +1 -1
index 14c0d20..58ae61d 100644
@@ -627,7 +627,7 @@ extern void brcms_default_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs);
 extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
 			    struct ieee80211_sta *sta, u16 tid);
 extern void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
-					 u8 ba_wsize);
+					 u8 ba_wsize, uint max_rx_ampdu_bytes);
 extern int brcms_c_set_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
 			   int val);
 extern int brcms_c_get_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
drivers/staging/brcm80211/brcmsmac/scb.h +1 -1
index c2080e9..62e005e 100644
@@ -40,7 +40,7 @@ struct scb_ampdu {
 	u8 max_pdu;		/* max pdus allowed in ampdu */
 	u8 release;		/* # of mpdus released at a time */
 	u16 min_len;		/* min mpdu len to support the density */
-	u32 max_rxlen;	/* max ampdu rcv length; 8k, 16k, 32k, 64k */
+	u32 max_rx_ampdu_bytes;	/* max ampdu rcv length; 8k, 16k, 32k, 64k */
 	struct pktq txq;	/* sdu transmit queue pending aggregation */
 
 	/* This could easily be a ini[] pointer and we keep this info in wl itself instead
Signature · 1 line
1.7.1
author
#27 lore raw

PATCH 23/119 staging: brcm80211: corrected tx status feedback for non AMPDU packets

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code still contained a 'FIXME' label that said tx status feedback (consumed by the rate control algorithm) was not yet taking RTS/CTS into account.

---
 drivers/staging/brcm80211/brcmsmac/main.c |   30 ++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 7 deletions(-)
drivers/staging/brcm80211/brcmsmac/main.c +23 -7
index 9aa74df..64f4fe7 100644
@@ -4371,8 +4371,18 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, tx_status_t *txs, u32 frm_tx2)
 	if (!lastframe) {
 		wiphy_err(wlc->wiphy, "Not last frame!\n");
 	} else {
-		u16 sfbl, lfbl;
-		ieee80211_tx_info_clear_status(tx_info);
+		/*
+		 * Set information to be consumed by Minstrel ht.
+		 *
+		 * The "fallback limit" is the number of tx attempts a given
+		 * MPDU is sent at the "primary" rate. Tx attempts beyond that
+		 * limit are sent at the "secondary" rate.
+		 * A 'short frame' does not exceed RTS treshold.
+		 */
+		u16 sfbl,	/* Short Frame Rate Fallback Limit */
+		    lfbl,	/* Long Frame Rate Fallback Limit */
+		    fbl;
+
 		if (queue < AC_COUNT) {
 			sfbl = WLC_WME_RETRY_SFB_GET(wlc, wme_fifo2ac[queue]);
 			lfbl = WLC_WME_RETRY_LFB_GET(wlc, wme_fifo2ac[queue]);
@@ -4382,14 +4392,20 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, tx_status_t *txs, u32 frm_tx2)
 		}
 
 		txrate = tx_info->status.rates;
-		/* FIXME: this should use a combination of sfbl, lfbl depending on frame length and RTS setting */
-		if ((tx_frame_count > sfbl) && (txrate[1].idx >= 0)) {
+		if (txrate[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
+			fbl = lfbl;
+		else
+			fbl = sfbl;
+
+		ieee80211_tx_info_clear_status(tx_info);
+
+		if ((tx_frame_count > fbl) && (txrate[1].idx >= 0)) {
 			/* rate selection requested a fallback rate and we used it */
-			txrate->count = lfbl;
-			txrate[1].count = tx_frame_count - lfbl;
+			txrate[0].count = fbl;
+			txrate[1].count = tx_frame_count - fbl;
 		} else {
 			/* rate selection did not request fallback rate, or we didn't need it */
-			txrate->count = tx_frame_count;
+			txrate[0].count = tx_frame_count;
 			/* rc80211_minstrel.c:minstrel_tx_status() expects unused rates to be marked with idx = -1 */
 			txrate[1].idx = -1;
 			txrate[1].count = 0;
Signature · 1 line
1.7.1
author
#28 lore raw

PATCH 24/119 staging: brcm80211: Changed comments

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. BCM4321 is not supported by this driver. Removed 'XXX' in comments since they do not signal a critical issue to be patched. Removed FIXME in comment since it signalled a problem in the Minstrel algorithm, not in our driver.

---
 drivers/staging/brcm80211/brcmsmac/bmac.c        |    1 -
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c |    7 +------
 drivers/staging/brcm80211/brcmsmac/main.c        |    2 +-
 3 files changed, 2 insertions(+), 8 deletions(-)
drivers/staging/brcm80211/brcmsmac/bmac.c +0 -1
index 735230f..bdaad20 100644
@@ -3567,7 +3567,6 @@ u16 brcms_b_rate_shm_offset(struct brcms_c_hw_info *wlc_hw, u8 rate)
 	u8 phy_rate, index;
 
 	/* get the phy specific rate encoding for the PLCP SIGNAL field */
-	/* XXX4321 fixup needed ? */
 	if (IS_OFDM(rate))
 		table_ptr = M_RT_DIRMAP_A;
 	else
drivers/staging/brcm80211/brcmsmac/mac80211_if.c +1 -6
index c74c186..caab99a 100644
@@ -644,7 +644,7 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
 				  tid);
 			return -EINVAL;
 		}
-		/* XXX: Use the starting sequence number provided ... */
+		/* Future improvement: Use the starting sequence number provided ... */
 		*ssn = 0;
 		ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
 		break;
@@ -1089,11 +1089,6 @@ static int ieee_hw_init(struct ieee80211_hw *hw)
 
 	hw->extra_tx_headroom = brcms_c_get_header_len();
 	hw->queues = N_TX_QUEUES;
-	/* FIXME: this doesn't seem to be used properly in minstrel_ht.
-	 * mac80211/status.c:ieee80211_tx_status() checks this value,
-	 * but mac80211/rc80211_minstrel_ht.c:minstrel_ht_get_rate()
-	 * appears to always set 3 rates
-	 */
 	hw->max_rates = 2;	/* Primary rate and 1 fallback rate */
 
 	hw->channel_change_time = 7 * 1000;	/* channel change time is dependent on chip and band  */
drivers/staging/brcm80211/brcmsmac/main.c +1 -1
index 64f4fe7..90293fa 100644
@@ -3166,7 +3166,7 @@ void brcms_c_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu,
 				  "\n", wlc->pub->unit);
 
 		/*
-		 * XXX we might hit this condtion in case
+		 * we might hit this condtion in case
 		 * packet flooding from mac80211 stack
 		 */
 		brcmu_pkt_buf_free_skb(sdu);
Signature · 1 line
1.7.1
author
#29 lore raw

PATCH 25/119 staging: brcm80211: removed unneeded 'if' statement

In reply to Franky Lin

From: Henry Ptasinski <[email protected]>

The 'if' is unnecessary, since no action is taken as a result of the test.

---
 drivers/staging/brcm80211/brcmsmac/bmac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/brcm80211/brcmsmac/bmac.c +1 -1
index bdaad20..90d1b32 100644
@@ -349,7 +349,7 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
 
 	/* TX FIFO suspend/flush completion */
 	if (macintstatus & MI_TXSTOP)
-		if (brcms_b_tx_fifo_suspended(wlc_hw, TX_DATA_FIFO));
+		brcms_b_tx_fifo_suspended(wlc_hw, TX_DATA_FIFO);
 
 	/* noise sample collected */
 	if (macintstatus & MI_BG_NOISE) {
Signature · 1 line
1.7.1
author
#30 lore raw

PATCH 26/119 staging: brcm80211: delete empty brcmfmac/README file

In reply to Franky Lin

From: Henry Ptasinski <[email protected]>

brcm80211/brcmfmac/README contents were move to brcm80211/README previously, but this empty file is still around.

---
 drivers/staging/brcm80211/brcmfmac/README |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/README
drivers/staging/brcm80211/brcmfmac/README deleted +0 -2
deleted file mode 100644
index 139597f..0000000
@@ -1,2 +0,0 @@
-
-
Signature · 1 line
1.7.1
author
#31 lore raw

PATCH 27/119 staging: brcm80211: run scripts/cleanfile to remove whitespace errors

In reply to Franky Lin

From: Henry Ptasinski <[email protected]>

Used scripts/cleanfile to remove assorted whitespace errors.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd.h          |   12 ++++----
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |    2 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c  |    4 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h  |    6 ++--
 drivers/staging/brcm80211/brcmfmac/wl_iw.h        |    4 +-
 drivers/staging/brcm80211/brcmsmac/d11.h          |   30 ++++++++++----------
 drivers/staging/brcm80211/brcmsmac/main.c         |    6 ++--
 drivers/staging/brcm80211/brcmsmac/nicpci.c       |   10 +++---
 drivers/staging/brcm80211/brcmsmac/otp.c          |    4 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h  |    6 ++--
 drivers/staging/brcm80211/brcmsmac/phy/phy_int.h  |    4 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c  |   18 ++++++------
 drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h |   14 +++++-----
 drivers/staging/brcm80211/brcmsmac/rate.h         |    6 ++--
 drivers/staging/brcm80211/brcmsmac/scb.h          |    2 +-
 drivers/staging/brcm80211/brcmsmac/types.h        |    2 +-
 drivers/staging/brcm80211/brcmutil/utils.c        |    2 +-
 drivers/staging/brcm80211/brcmutil/wifi.c         |    1 -
 drivers/staging/brcm80211/include/brcmu_utils.h   |    2 +-
 drivers/staging/brcm80211/include/soc.h           |    2 +-
 21 files changed, 69 insertions(+), 70 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +1 -1
index 42c71a8..ff5e09d 100644
@@ -72,7 +72,7 @@ extern void sdioh_sdmmc_osfree(sdioh_info_t *sd);
 
 /* private bus modes */
 #define SDIOH_MODE_SD4		2
-#define CLIENT_INTR 		0x100	/* Get rid of this! */
+#define CLIENT_INTR		0x100	/* Get rid of this! */
 
 struct sdioh_info {
 	struct osl_info *osh;		/* osh handler */
drivers/staging/brcm80211/brcmfmac/dhd.h +6 -6
index a4dcaf8..4bedf41 100644
@@ -129,9 +129,9 @@ struct dhd_info;
 #define  CCA_FLAG_5G_ONLY		0x02	/* Return a channel from 2.4 Ghz band */
 #define  CCA_FLAG_IGNORE_DURATION	0x04	/* Ignore dwell time for each channel */
 #define  CCA_FLAGS_PREFER_1_6_11	0x10
-#define  CCA_FLAG_IGNORE_INTERFER 	0x20	/* do not exlude channel based on interfer level */
+#define  CCA_FLAG_IGNORE_INTERFER	0x20	/* do not exlude channel based on interfer level */
 
-#define CCA_ERRNO_BAND 		1	/* After filtering for band pref, no choices left */
+#define CCA_ERRNO_BAND		1	/* After filtering for band pref, no choices left */
 #define CCA_ERRNO_DURATION	2	/* After filtering for duration, no choices left */
 #define CCA_ERRNO_PREF_CHAN	3	/* After filtering for chan pref, no choices left */
 #define CCA_ERRNO_INTERFER	4	/* After filtering for interference, no choices left */
@@ -273,8 +273,8 @@ typedef struct bcm_event {
 #define WLC_E_DFS_AP_RESUME	66
 #define WLC_E_RESERVED1		67
 #define WLC_E_RESERVED2		68
-#define WLC_E_ESCAN_RESULT 	69
-#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 	70
+#define WLC_E_ESCAN_RESULT	69
+#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE	70
 #define WLC_E_DCS_REQUEST 73
 
 #define WLC_E_FIFO_CREDIT_MAP	74
@@ -518,7 +518,7 @@ typedef struct wl_assoc_params {
 				 */
 	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(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;
@@ -531,7 +531,7 @@ typedef struct wl_join_params {
 					 * of the wl_assoc_params_t struct when it does present.
 					 */
 } wl_join_params_t;
-#define WL_JOIN_PARAMS_FIXED_SIZE 	(sizeof(wl_join_params_t) - sizeof(chanspec_t))
+#define WL_JOIN_PARAMS_FIXED_SIZE	(sizeof(wl_join_params_t) - sizeof(chanspec_t))
 
 /* 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))
drivers/staging/brcm80211/brcmfmac/sdio_host.h +1 -1
index db19533..96a43cb 100644
@@ -42,7 +42,7 @@ extern const uint bcmsdh_msglevel;
 #define SDIO_FUNC_1		1
 #define SDIO_FUNC_2		2
 
-#define SDIOD_FBR_SIZE  	0x100
+#define SDIOD_FBR_SIZE		0x100
 
 /* io_en */
 #define SDIO_FUNC_ENABLE_1	0x02
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +2 -2
index 52c1782..3bccc22 100644
@@ -322,13 +322,13 @@ static void wl_set_mpc(struct net_device *ndev, int mpc);
 static int wl_debugfs_add_netdev_params(struct wl_priv *wl);
 static void wl_debugfs_remove_netdev(struct wl_priv *wl);
 
-#define WL_PRIV_GET() 							\
+#define WL_PRIV_GET()							\
 	({								\
 	struct wl_iface *ci = wl_get_drvdata(wl_cfg80211_dev);		\
 	if (unlikely(!ci)) {						\
 		WL_ERR("wl_cfg80211_dev is unavailable\n");		\
 		BUG();							\
-	} 								\
+	}								\
 	ci_to_wl(ci);							\
 })
 
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +3 -3
index 2469b90..80940bd 100644
@@ -97,8 +97,8 @@ do {								\
 						 * for 2.6.33 kernel
 						 * or later
 						 */
-#define WL_SCAN_BUF_MAX 		(1024 * 8)
-#define WL_TLV_INFO_MAX 		1024
+#define WL_SCAN_BUF_MAX			(1024 * 8)
+#define WL_TLV_INFO_MAX			1024
 #define WL_BSS_INFO_MAX			2048
 #define WL_ASSOC_INFO_MAX	512	/*
 				 * needs to grab assoc info from dongle to
@@ -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	(WL_SCAN_RESULTS_NO_MEM+1)
 #define WL_AP_MAX	256	/* virtually unlimitted as long
 				 * as kernel memory allows
 				 */
drivers/staging/brcm80211/brcmfmac/wl_iw.h +2 -2
index aa8902c..bfd8172 100644
@@ -20,8 +20,8 @@
 #define WL_SCAN_PARAMS_SSID_MAX	10
 #define GET_SSID	"SSID="
 #define GET_CHANNEL	"CH="
-#define GET_NPROBE 			"NPROBE="
-#define GET_ACTIVE_ASSOC_DWELL  	"ACTIVE="
+#define GET_NPROBE			"NPROBE="
+#define GET_ACTIVE_ASSOC_DWELL		"ACTIVE="
 #define GET_PASSIVE_ASSOC_DWELL	"PASSIVE="
 #define GET_HOME_DWELL		"HOME="
 #define GET_SCAN_TYPE			"TYPE="
drivers/staging/brcm80211/brcmsmac/d11.h +15 -15
index 44f4bc0..bb8bb38 100644
@@ -1148,25 +1148,25 @@ struct tx_status {
 #define M_TX_IDLE_BUSY_RATIO_X_16_OFDM (0x5A * 2)
 
 /* CW RSSI for LCNPHY */
-#define M_LCN_RSSI_0 		0x1332
-#define M_LCN_RSSI_1 		0x1338
-#define M_LCN_RSSI_2 		0x133e
-#define M_LCN_RSSI_3 		0x1344
+#define M_LCN_RSSI_0		0x1332
+#define M_LCN_RSSI_1		0x1338
+#define M_LCN_RSSI_2		0x133e
+#define M_LCN_RSSI_3		0x1344
 
 /* SNR for LCNPHY */
-#define M_LCN_SNR_A_0 	0x1334
-#define M_LCN_SNR_B_0 	0x1336
+#define M_LCN_SNR_A_0	0x1334
+#define M_LCN_SNR_B_0	0x1336
 
-#define M_LCN_SNR_A_1 	0x133a
-#define M_LCN_SNR_B_1 	0x133c
+#define M_LCN_SNR_A_1	0x133a
+#define M_LCN_SNR_B_1	0x133c
 
-#define M_LCN_SNR_A_2 	0x1340
-#define M_LCN_SNR_B_2 	0x1342
+#define M_LCN_SNR_A_2	0x1340
+#define M_LCN_SNR_B_2	0x1342
 
-#define M_LCN_SNR_A_3 	0x1346
-#define M_LCN_SNR_B_3 	0x1348
+#define M_LCN_SNR_A_3	0x1346
+#define M_LCN_SNR_B_3	0x1348
 
-#define M_LCN_LAST_RESET 	(81*2)
+#define M_LCN_LAST_RESET	(81*2)
 #define M_LCN_LAST_LOC	(63*2)
 #define M_LCNPHY_RESET_STATUS (4902)
 #define M_LCNPHY_DSC_TIME	(0x98d*2)
@@ -1279,7 +1279,7 @@ struct shm_acparams {
 
 /* Flags in M_HOST_FLAGS4 */
 #define MHF4_BPHY_TXCORE0	0x0080	/* force bphy Tx on core 0 (board level WAR) */
-#define MHF4_EXTPA_ENABLE  	0x4000	/* for 4313A0 FEM boards */
+#define MHF4_EXTPA_ENABLE	0x4000	/* for 4313A0 FEM boards */
 
 /* Flags in M_HOST_FLAGS5 */
 #define MHF5_4313_GPIOCTRL	0x0001
@@ -1673,7 +1673,7 @@ struct macstat {
 #define	BPHY_PEAK_ENERGY_HI	0x34
 #define	BPHY_SYNC_CTL		0x35
 #define	BPHY_TX_PWR_CTRL	0x36
-#define BPHY_TX_EST_PWR 	0x37
+#define BPHY_TX_EST_PWR		0x37
 #define	BPHY_STEP		0x38
 #define	BPHY_WARMUP		0x39
 #define	BPHY_LMS_CFF_READ	0x3a
drivers/staging/brcm80211/brcmsmac/main.c +3 -3
index 90293fa..20d65e0 100644
@@ -224,7 +224,7 @@ const u8 prio2fifo[NUMPRIO] = {
 #define	_WLC_PREC_NC		14	/* NC - Network Control */
 
 #define MAXMACLIST		64	/* max # source MAC matches */
-#define BCN_TEMPLATE_COUNT 	2
+#define BCN_TEMPLATE_COUNT	2
 
 #define WLC_BSSCFG_HW_BCN	0x20	/* The BSS is generating beacons in HW */
 
@@ -857,7 +857,7 @@ ratespec_t brcms_c_lowest_basic_rspec(struct brcms_c_info *wlc,
 /* This function changes the phytxctl for beacon based on current beacon ratespec AND txant
  * setting as per this table:
  *  ratespec     CCK		ant = wlc->stf->txant
- *  		OFDM		ant = 3
+ *		OFDM		ant = 3
  */
 void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
 				       ratespec_t bcn_rspec)
@@ -1357,7 +1357,7 @@ struct wlc_pub *brcms_c_pub(void *wlc)
 	return ((struct brcms_c_info *) wlc)->pub;
 }
 
-#define CHIP_SUPPORTS_11N(wlc) 	1
+#define CHIP_SUPPORTS_11N(wlc)	1
 
 /*
  * The common driver entry routine. Error codes should be unique
drivers/staging/brcm80211/brcmsmac/nicpci.c +5 -5
index 70d4173..a5eebf3 100644
@@ -65,9 +65,9 @@
 #define	MDIODATA_BLK_ADDR		0x1F	/* blk address for serdes */
 
 /* serdes regs (rev < 10) */
-#define MDIODATA_DEV_PLL       		0x1d	/* SERDES PLL Dev */
-#define MDIODATA_DEV_TX        		0x1e	/* SERDES TX Dev */
-#define MDIODATA_DEV_RX        		0x1f	/* SERDES RX Dev */
+#define MDIODATA_DEV_PLL		0x1d	/* SERDES PLL Dev */
+#define MDIODATA_DEV_TX			0x1e	/* SERDES TX Dev */
+#define MDIODATA_DEV_RX			0x1f	/* SERDES RX Dev */
 
 	/* SERDES RX registers */
 #define SERDES_RX_CTRL			1	/* Rx cntrl */
@@ -100,8 +100,8 @@
 #define PCIE_ASPMTIMER_EXTEND		0x01000000	/* > rev7: enable extend ASPM timer */
 
 /* different register spaces to access thr'u pcie indirect access */
-#define PCIE_CONFIGREGS 	1	/* Access to config space */
-#define PCIE_PCIEREGS 		2	/* Access to pcie registers */
+#define PCIE_CONFIGREGS		1	/* Access to config space */
+#define PCIE_PCIEREGS		2	/* Access to pcie registers */
 
 /* PCIE protocol PHY diagnostic registers */
 #define	PCIE_PLP_STATUSREG		0x204	/* Status */
drivers/staging/brcm80211/brcmsmac/otp.c +2 -2
index 4e19b35..7edc435 100644
@@ -460,8 +460,8 @@ static otp_fn_t ipxotp_fn = {
  *	otp_size()
  *	otp_read_bit()
  *	otp_init()
- * 	otp_read_region()
- * 	otp_nvread()
+ *	otp_read_region()
+ *	otp_nvread()
  */
 
 int otp_status(void *oh)
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h +3 -3
index 756ad71..3c125c3 100644
@@ -80,9 +80,9 @@
 #define PHY_MUTE_FOR_PREISM	1
 #define PHY_MUTE_ALL		0xffffffff
 
-#define PHY_NOISE_FIXED_VAL 		(-95)
-#define PHY_NOISE_FIXED_VAL_NPHY       	(-92)
-#define PHY_NOISE_FIXED_VAL_LCNPHY     	(-92)
+#define PHY_NOISE_FIXED_VAL		(-95)
+#define PHY_NOISE_FIXED_VAL_NPHY	(-92)
+#define PHY_NOISE_FIXED_VAL_LCNPHY	(-92)
 
 #define PHY_MODE_CAL		0x0002
 #define PHY_MODE_NOISEM		0x0004
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h +2 -2
index 9506da5..68938fe 100644
@@ -63,7 +63,7 @@ typedef void (*detachfn_t) (phy_info_t *);
 #undef ISNPHY
 #undef ISLCNPHY
 #define ISNPHY(pi)	PHYTYPE_IS((pi)->pubpi.phy_type, PHY_TYPE_N)
-#define ISLCNPHY(pi)  	PHYTYPE_IS((pi)->pubpi.phy_type, PHY_TYPE_LCN)
+#define ISLCNPHY(pi)	PHYTYPE_IS((pi)->pubpi.phy_type, PHY_TYPE_LCN)
 
 #define ISPHY_11N_CAP(pi)	(ISNPHY(pi) || ISLCNPHY(pi))
 
@@ -1092,7 +1092,7 @@ extern void wlc_phy_txpower_recalc_target(phy_info_t *pi);
 #define LCNPHY_TBL_ID_PAPDCOMPDELTATBL	0x18
 #define LCNPHY_TX_POWER_TABLE_SIZE	128
 #define LCNPHY_MAX_TX_POWER_INDEX	(LCNPHY_TX_POWER_TABLE_SIZE - 1)
-#define LCNPHY_TBL_ID_TXPWRCTL 	0x07
+#define LCNPHY_TBL_ID_TXPWRCTL	0x07
 #define LCNPHY_TX_PWR_CTRL_OFF	0
 #define LCNPHY_TX_PWR_CTRL_SW		(0x1 << 15)
 #define LCNPHY_TX_PWR_CTRL_HW         ((0x1 << 15) | \
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c +9 -9
index efa985c..4d35e5d 100644
@@ -26,8 +26,8 @@
 #include "phy_lcn.h"
 
 #define PLL_2064_NDIV		90
-#define PLL_2064_LOW_END_VCO 	3000
-#define PLL_2064_LOW_END_KVCO 	27
+#define PLL_2064_LOW_END_VCO	3000
+#define PLL_2064_LOW_END_KVCO	27
 #define PLL_2064_HIGH_END_VCO	4200
 #define PLL_2064_HIGH_END_KVCO	68
 #define PLL_2064_LOOP_BW_DOUBLER	200
@@ -38,7 +38,7 @@
 #define PLL_2064_MHZ		1000000
 #define PLL_2064_OPEN_LOOP_DELAY	5
 
-#define TEMPSENSE 			1
+#define TEMPSENSE			1
 #define VBATSENSE           2
 
 #define NOISE_IF_UPD_CHK_INTERVAL	1
@@ -50,10 +50,10 @@
 #define NOISE_IF_CHK			1
 #define NOISE_IF_ON			2
 
-#define PAPD_BLANKING_PROFILE 		3
+#define PAPD_BLANKING_PROFILE		3
 #define PAPD2LUT			0
-#define PAPD_CORR_NORM 			0
-#define PAPD_BLANKING_THRESHOLD 	0
+#define PAPD_CORR_NORM			0
+#define PAPD_BLANKING_THRESHOLD		0
 #define PAPD_STOP_AFTER_LAST_UPDATE	0
 
 #define LCN_TARGET_PWR  60
@@ -108,9 +108,9 @@
 #define LCNPHY_TBL_ID_SAMPLEPLAY		0x15
 #define LCNPHY_TBL_ID_SAMPLEPLAY1		0x16
 
-#define LCNPHY_TX_PWR_CTRL_RATE_OFFSET 	832
-#define LCNPHY_TX_PWR_CTRL_MAC_OFFSET 	128
-#define LCNPHY_TX_PWR_CTRL_GAIN_OFFSET 	192
+#define LCNPHY_TX_PWR_CTRL_RATE_OFFSET	832
+#define LCNPHY_TX_PWR_CTRL_MAC_OFFSET	128
+#define LCNPHY_TX_PWR_CTRL_GAIN_OFFSET	192
 #define LCNPHY_TX_PWR_CTRL_IQ_OFFSET		320
 #define LCNPHY_TX_PWR_CTRL_LO_OFFSET		448
 #define LCNPHY_TX_PWR_CTRL_PWR_OFFSET		576
drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h +7 -7
index 211bc3a..a97c3a7 100644
@@ -123,13 +123,13 @@
 #define NPHY_REV3_RFSEQ_CMD_CLR_RXRX_BIAS	0xf
 #define NPHY_REV3_RFSEQ_CMD_END		0x1f
 
-#define NPHY_RSSI_SEL_W1 		0x0
-#define NPHY_RSSI_SEL_W2 		0x1
-#define NPHY_RSSI_SEL_NB 		0x2
-#define NPHY_RSSI_SEL_IQ 		0x3
-#define NPHY_RSSI_SEL_TSSI_2G 		0x4
-#define NPHY_RSSI_SEL_TSSI_5G 		0x5
-#define NPHY_RSSI_SEL_TBD 		0x6
+#define NPHY_RSSI_SEL_W1		0x0
+#define NPHY_RSSI_SEL_W2		0x1
+#define NPHY_RSSI_SEL_NB		0x2
+#define NPHY_RSSI_SEL_IQ		0x3
+#define NPHY_RSSI_SEL_TSSI_2G		0x4
+#define NPHY_RSSI_SEL_TSSI_5G		0x5
+#define NPHY_RSSI_SEL_TBD		0x6
 
 #define NPHY_RAIL_I			0x0
 #define NPHY_RAIL_Q			0x1
drivers/staging/brcm80211/brcmsmac/rate.h +3 -3
index 8b4de8b..268125f 100644
@@ -84,7 +84,7 @@ extern const mcs_info_t mcs_table[];
 #define WLC_HTPHY		127	/* HT PHY Membership */
 
 #define RSPEC_ACTIVE(rspec)	(rspec & (RSPEC_RATE_MASK | RSPEC_MIMORATE))
-#define RSPEC2RATE(rspec)      	((rspec & RSPEC_MIMORATE) ? \
+#define RSPEC2RATE(rspec)	((rspec & RSPEC_MIMORATE) ? \
 	MCS_RATE((rspec & RSPEC_RATE_MASK), RSPEC_IS40MHZ(rspec), RSPEC_ISSGI(rspec)) : \
 	(rspec & RSPEC_RATE_MASK))
 /* return rate in unit of 500Kbps -- for internal use in wlc_rate_sel.c */
@@ -111,8 +111,8 @@ extern const mcs_info_t mcs_table[];
 #define PLCP3_STC_SHIFT         4
 
 /* Rate info table; takes a legacy rate or ratespec_t */
-#define	IS_MCS(r)     	(r & RSPEC_MIMORATE)
-#define	IS_OFDM(r)     	(!IS_MCS(r) && (rate_info[(r) & RSPEC_RATE_MASK] & WLC_RATE_FLAG))
+#define	IS_MCS(r)	(r & RSPEC_MIMORATE)
+#define	IS_OFDM(r)	(!IS_MCS(r) && (rate_info[(r) & RSPEC_RATE_MASK] & WLC_RATE_FLAG))
 #define	IS_CCK(r)	(!IS_MCS(r) && ( \
 			 ((r) & WLC_RATE_MASK) == WLC_RATE_1M || \
 			 ((r) & WLC_RATE_MASK) == WLC_RATE_2M || \
drivers/staging/brcm80211/brcmsmac/scb.h +1 -1
index 62e005e..e814e5e 100644
@@ -50,7 +50,7 @@ struct scb_ampdu {
 	scb_ampdu_tid_ini_t ini[AMPDU_MAX_SCB_TID];	/* initiator info - per tid (NUMPRIO) */
 };
 
-#define SCB_MAGIC 	0xbeefcafe
+#define SCB_MAGIC	0xbeefcafe
 
 /* station control block - one per remote MAC address */
 struct scb {
drivers/staging/brcm80211/brcmsmac/types.h +1 -1
index af1514e..b1370be 100644
@@ -96,7 +96,7 @@
 					 *      2       4330a0
 					 */
 
-#define SSLPNCONF 	0x0000000f	/* Supported sslpnphy revs:
+#define SSLPNCONF	0x0000000f	/* Supported sslpnphy revs:
 					 *      0       4329a0/k0
 					 *      1       4329b0/4329C0
 					 *      2       4319a0
drivers/staging/brcm80211/brcmutil/utils.c +1 -1
index 2819c1d..e221a3b 100644
@@ -672,7 +672,7 @@ EXPORT_SYMBOL(brcmu_mkiovar);
 #define QDBM_TABLE_HIGH_BOUND 64938	/* High bound */
 
 static const u16 nqdBm_to_mW_map[QDBM_TABLE_LEN] = {
-/* qdBm: 	+0 	+1 	+2 	+3 	+4 	+5 	+6 	+7 */
+/* qdBm:	+0	+1	+2	+3	+4	+5	+6	+7 */
 /* 153: */ 6683, 7079, 7499, 7943, 8414, 8913, 9441, 10000,
 /* 161: */ 10593, 11220, 11885, 12589, 13335, 14125, 14962, 15849,
 /* 169: */ 16788, 17783, 18836, 19953, 21135, 22387, 23714, 25119,
drivers/staging/brcm80211/brcmutil/wifi.c +0 -1
index af88dcb..b9ffe86 100644
@@ -129,4 +129,3 @@ int brcmu_mhz2channel(uint freq, uint start_factor)
 	return ch;
 }
 EXPORT_SYMBOL(brcmu_mhz2channel);
-
drivers/staging/brcm80211/include/brcmu_utils.h +1 -1
index 78c84e2..b0f36e3 100644
@@ -195,7 +195,7 @@ extern int brcmu_iovar_lencheck(const struct brcmu_iovar *table, void *arg,
 
 /* ** driver/apps-shared section ** */
 
-#define BCME_STRLEN 		64	/* Max string length for BCM errors */
+#define BCME_STRLEN		64	/* Max string length for BCM errors */
 
 #ifndef ABS
 #define	ABS(a)			(((a) < 0) ? -(a) : (a))
drivers/staging/brcm80211/include/soc.h +1 -1
index 3e59377..6e5a705 100644
@@ -20,7 +20,7 @@
 #ifdef SI_ENUM_BASE_VARIABLE
 #define SI_ENUM_BASE		(sii->pub.si_enum_base)
 #else
-#define SI_ENUM_BASE    	0x18000000	/* Enumeration space base */
+#define SI_ENUM_BASE		0x18000000	/* Enumeration space base */
 #endif				/* SI_ENUM_BASE_VARIABLE */
 
 /* core codes */
Signature · 1 line
1.7.1
author
#32 lore raw

PATCH 28/119 staging: brcm80211: cleanup whitespace errors

In reply to Franky Lin

From: Henry Ptasinski <[email protected]>

Cleanup remaining whitespace errors:
- space before tabs
- spaces at the start of a line
- space between function name and open parenthesis '('
- unnecessary whitespace before a quoted newline

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |    6 ++--
 drivers/staging/brcm80211/brcmfmac/sbsdio.h        |    2 +-
 drivers/staging/brcm80211/brcmsmac/dma.c           |    2 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_int.h   |   10 +++---
 drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c   |   10 +++----
 .../staging/brcm80211/brcmsmac/phy/phytbl_lcn.c    |   18 ++++++------
 drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c  |   28 ++++++++++----------
 drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h  |   10 +++---
 drivers/staging/brcm80211/brcmsmac/phy_shim.h      |    4 +-
 drivers/staging/brcm80211/brcmutil/utils.c         |    2 +-
 drivers/staging/brcm80211/include/brcmu_utils.h    |    4 +-
 11 files changed, 47 insertions(+), 49 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +3 -3
index e0cd8e1..c556191 100644
@@ -916,14 +916,14 @@ static int _dhd_sysioc_thread(void *data)
 
 				if (in_ap && dhd->set_macaddress) {
 					DHD_TRACE(("attempt to set MAC for %s "
-						"in AP Mode," "blocked. \n",
+						"in AP Mode," "blocked.\n",
 						dhd->iflist[i]->net->name));
 					dhd->set_macaddress = false;
 					continue;
 				}
 
 				if (in_ap && dhd->set_multicast) {
-					DHD_TRACE(("attempt to set MULTICAST list for %s" "in AP Mode, blocked. \n",
+					DHD_TRACE(("attempt to set MULTICAST list for %s" "in AP Mode, blocked.\n",
 						dhd->iflist[i]->net->name));
 					dhd->set_multicast = false;
 					continue;
@@ -2157,7 +2157,7 @@ int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
 	}
 
 	if (ifidx == 1) {
-		DHD_TRACE(("%s ACCESS POINT MAC: \n", __func__));
+		DHD_TRACE(("%s ACCESS POINT MAC:\n", __func__));
 		/*  ACCESSPOINT INTERFACE CASE */
 		temp_addr[0] |= 0X02;	/* set bit 2 ,
 			 - Locally Administered address  */
drivers/staging/brcm80211/brcmfmac/sbsdio.h +1 -1
index 86b62b8..614a25f 100644
@@ -37,7 +37,7 @@
 #define SBSDIO_FUNC1_SBADDRHIGH		0x1000C	/* SB Address Window High (b31:b24)    */
 #define SBSDIO_FUNC1_FRAMECTRL		0x1000D	/* Frame Control (frame term/abort) */
 #define SBSDIO_FUNC1_CHIPCLKCSR		0x1000E	/* ChipClockCSR (ALP/HT ctl/status) */
-#define SBSDIO_FUNC1_SDIOPULLUP 	0x1000F	/* SdioPullUp (on cmd, d0-d2) */
+#define SBSDIO_FUNC1_SDIOPULLUP		0x1000F	/* SdioPullUp (on cmd, d0-d2) */
 #define SBSDIO_FUNC1_WFRAMEBCLO		0x10019	/* Write Frame Byte Count Low */
 #define SBSDIO_FUNC1_WFRAMEBCHI		0x1001A	/* Write Frame Byte Count High */
 #define SBSDIO_FUNC1_RFRAMEBCLO		0x1001B	/* Read Frame Byte Count Low */
drivers/staging/brcm80211/brcmsmac/dma.c +1 -1
index adf364c..5cdbfe9 100644
@@ -34,7 +34,7 @@
 #define	D64MAXRINGSZ		(1 << D64RINGALIGN_BITS)
 #define	D64RINGALIGN		(1 << D64RINGALIGN_BITS)
 
-#define	D64MAXDD	(D64MAXRINGSZ / sizeof (dma64dd_t))
+#define	D64MAXDD	(D64MAXRINGSZ / sizeof(dma64dd_t))
 
 /* transmit channel control */
 #define	D64_XC_XE		0x00000001	/* transmit enable */
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h +5 -5
index 68938fe..0019c04 100644
@@ -966,16 +966,16 @@ struct lcnphy_radio_regs {
 extern lcnphy_radio_regs_t lcnphy_radio_regs_2064[];
 extern lcnphy_radio_regs_t lcnphy_radio_regs_2066[];
 extern radio_regs_t regs_2055[], regs_SYN_2056[], regs_TX_2056[],
-    regs_RX_2056[];
+	regs_RX_2056[];
 extern radio_regs_t regs_SYN_2056_A1[], regs_TX_2056_A1[], regs_RX_2056_A1[];
 extern radio_regs_t regs_SYN_2056_rev5[], regs_TX_2056_rev5[],
-    regs_RX_2056_rev5[];
+	regs_RX_2056_rev5[];
 extern radio_regs_t regs_SYN_2056_rev6[], regs_TX_2056_rev6[],
-    regs_RX_2056_rev6[];
+	regs_RX_2056_rev6[];
 extern radio_regs_t regs_SYN_2056_rev7[], regs_TX_2056_rev7[],
-    regs_RX_2056_rev7[];
+	regs_RX_2056_rev7[];
 extern radio_regs_t regs_SYN_2056_rev8[], regs_TX_2056_rev8[],
-    regs_RX_2056_rev8[];
+	regs_RX_2056_rev8[];
 extern radio_20xx_regs_t regs_2057_rev4[], regs_2057_rev5[], regs_2057_rev5v1[];
 extern radio_20xx_regs_t regs_2057_rev7[], regs_2057_rev8[];
 
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c +4 -6
index 4d35e5d..3b61beb 100644
@@ -888,9 +888,8 @@ lcnphy_radio_regs_t lcnphy_radio_regs_2064[] = {
 #define LCNPHY_NUM_DIG_FILT_COEFFS 16
 #define LCNPHY_NUM_TX_DIG_FILTERS_CCK 13
 
-u16
-    LCNPHY_txdigfiltcoeffs_cck[LCNPHY_NUM_TX_DIG_FILTERS_CCK]
-    [LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
+u16 LCNPHY_txdigfiltcoeffs_cck[LCNPHY_NUM_TX_DIG_FILTERS_CCK]
+	[LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
 	{0, 1, 415, 1874, 64, 128, 64, 792, 1656, 64, 128, 64, 778, 1582, 64,
 	 128, 64,},
 	{1, 1, 402, 1847, 259, 59, 259, 671, 1794, 68, 54, 68, 608, 1863, 93,
@@ -920,9 +919,8 @@ u16
 };
 
 #define LCNPHY_NUM_TX_DIG_FILTERS_OFDM 3
-u16
-    LCNPHY_txdigfiltcoeffs_ofdm[LCNPHY_NUM_TX_DIG_FILTERS_OFDM]
-    [LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
+u16 LCNPHY_txdigfiltcoeffs_ofdm[LCNPHY_NUM_TX_DIG_FILTERS_OFDM]
+	[LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
 	{0, 0, 0xa2, 0x0, 0x100, 0x100, 0x0, 0x0, 0x0, 0x100, 0x0, 0x0,
 	 0x278, 0xfea0, 0x80, 0x100, 0x80,},
 	{1, 0, 374, 0xFF79, 16, 32, 16, 799, 0xFE74, 50, 32, 50,
drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c +9 -9
index 6439d81..5b6538f 100644
@@ -1608,20 +1608,20 @@ const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_extlna_5G_rev2[] = {
 };
 
 const u32 dot11lcnphytbl_rx_gain_info_sz_rev0 =
-    sizeof(dot11lcnphytbl_rx_gain_info_rev0) /
-    sizeof(dot11lcnphytbl_rx_gain_info_rev0[0]);
+	sizeof(dot11lcnphytbl_rx_gain_info_rev0) /
+	sizeof(dot11lcnphytbl_rx_gain_info_rev0[0]);
 
 const u32 dot11lcnphytbl_rx_gain_info_sz_rev1 =
-    sizeof(dot11lcnphytbl_rx_gain_info_rev1) /
-    sizeof(dot11lcnphytbl_rx_gain_info_rev1[0]);
+	sizeof(dot11lcnphytbl_rx_gain_info_rev1) /
+	sizeof(dot11lcnphytbl_rx_gain_info_rev1[0]);
 
 const u32 dot11lcnphytbl_rx_gain_info_2G_rev2_sz =
-    sizeof(dot11lcnphytbl_rx_gain_info_2G_rev2) /
-    sizeof(dot11lcnphytbl_rx_gain_info_2G_rev2[0]);
+	sizeof(dot11lcnphytbl_rx_gain_info_2G_rev2) /
+	sizeof(dot11lcnphytbl_rx_gain_info_2G_rev2[0]);
 
 const u32 dot11lcnphytbl_rx_gain_info_5G_rev2_sz =
-    sizeof(dot11lcnphytbl_rx_gain_info_5G_rev2) /
-    sizeof(dot11lcnphytbl_rx_gain_info_5G_rev2[0]);
+	sizeof(dot11lcnphytbl_rx_gain_info_5G_rev2) /
+	sizeof(dot11lcnphytbl_rx_gain_info_5G_rev2[0]);
 
 const u16 dot11lcn_min_sig_sq_tbl_rev0[] = {
 	0x014d,
@@ -2857,7 +2857,7 @@ const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250 = {
 };
 
 const u32 dot11lcnphytbl_info_sz_rev0 =
-    sizeof(dot11lcnphytbl_info_rev0) / sizeof(dot11lcnphytbl_info_rev0[0]);
+	sizeof(dot11lcnphytbl_info_rev0) / sizeof(dot11lcnphytbl_info_rev0[0]);
 
 const lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_extPA_gaintable_rev0[128] = {
 	{3, 0, 31, 0, 72,}
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c +14 -14
index 84b4f69..8835367 100644
@@ -4535,10 +4535,10 @@ const mimophytbl_info_t mimophytbl_info_rev0[] = {
 };
 
 const u32 mimophytbl_info_sz_rev0 =
-    sizeof(mimophytbl_info_rev0) / sizeof(mimophytbl_info_rev0[0]);
+	sizeof(mimophytbl_info_rev0) / sizeof(mimophytbl_info_rev0[0]);
 const u32 mimophytbl_info_sz_rev0_volatile =
-    sizeof(mimophytbl_info_rev0_volatile) /
-    sizeof(mimophytbl_info_rev0_volatile[0]);
+	sizeof(mimophytbl_info_rev0_volatile) /
+	sizeof(mimophytbl_info_rev0_volatile[0]);
 
 const u16 ant_swctrl_tbl_rev3[] = {
 	0x0082,
@@ -9475,19 +9475,19 @@ const mimophytbl_info_t mimophytbl_info_rev3[] = {
 };
 
 const u32 mimophytbl_info_sz_rev3 =
-    sizeof(mimophytbl_info_rev3) / sizeof(mimophytbl_info_rev3[0]);
+	sizeof(mimophytbl_info_rev3) / sizeof(mimophytbl_info_rev3[0]);
 const u32 mimophytbl_info_sz_rev3_volatile =
-    sizeof(mimophytbl_info_rev3_volatile) /
-    sizeof(mimophytbl_info_rev3_volatile[0]);
+	sizeof(mimophytbl_info_rev3_volatile) /
+	sizeof(mimophytbl_info_rev3_volatile[0]);
 const u32 mimophytbl_info_sz_rev3_volatile1 =
-    sizeof(mimophytbl_info_rev3_volatile1) /
-    sizeof(mimophytbl_info_rev3_volatile1[0]);
+	sizeof(mimophytbl_info_rev3_volatile1) /
+	sizeof(mimophytbl_info_rev3_volatile1[0]);
 const u32 mimophytbl_info_sz_rev3_volatile2 =
-    sizeof(mimophytbl_info_rev3_volatile2) /
-    sizeof(mimophytbl_info_rev3_volatile2[0]);
+	sizeof(mimophytbl_info_rev3_volatile2) /
+	sizeof(mimophytbl_info_rev3_volatile2[0]);
 const u32 mimophytbl_info_sz_rev3_volatile3 =
-    sizeof(mimophytbl_info_rev3_volatile3) /
-    sizeof(mimophytbl_info_rev3_volatile3[0]);
+	sizeof(mimophytbl_info_rev3_volatile3) /
+	sizeof(mimophytbl_info_rev3_volatile3[0]);
 
 const u32 tmap_tbl_rev7[] = {
 	0x8a88aa80,
@@ -10579,7 +10579,7 @@ const mimophytbl_info_t mimophytbl_info_rev7[] = {
 };
 
 const u32 mimophytbl_info_sz_rev7 =
-    sizeof(mimophytbl_info_rev7) / sizeof(mimophytbl_info_rev7[0]);
+	sizeof(mimophytbl_info_rev7) / sizeof(mimophytbl_info_rev7[0]);
 
 const mimophytbl_info_t mimophytbl_info_rev16[] = {
 	{&noise_var_tbl_rev7,
@@ -10626,4 +10626,4 @@ const mimophytbl_info_t mimophytbl_info_rev16[] = {
 };
 
 const u32 mimophytbl_info_sz_rev16 =
-    sizeof(mimophytbl_info_rev16) / sizeof(mimophytbl_info_rev16[0]);
+	sizeof(mimophytbl_info_rev16) / sizeof(mimophytbl_info_rev16[0]);
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h +5 -5
index a02b73c..4b2a04d 100644
@@ -20,15 +20,15 @@
 #include "phy_int.h"
 
 extern const mimophytbl_info_t mimophytbl_info_rev0[],
-    mimophytbl_info_rev0_volatile[];
+	mimophytbl_info_rev0_volatile[];
 extern const u32 mimophytbl_info_sz_rev0, mimophytbl_info_sz_rev0_volatile;
 
 extern const mimophytbl_info_t mimophytbl_info_rev3[],
-    mimophytbl_info_rev3_volatile[], mimophytbl_info_rev3_volatile1[],
-    mimophytbl_info_rev3_volatile2[], mimophytbl_info_rev3_volatile3[];
+	mimophytbl_info_rev3_volatile[], mimophytbl_info_rev3_volatile1[],
+	mimophytbl_info_rev3_volatile2[], mimophytbl_info_rev3_volatile3[];
 extern const u32 mimophytbl_info_sz_rev3, mimophytbl_info_sz_rev3_volatile,
-    mimophytbl_info_sz_rev3_volatile1, mimophytbl_info_sz_rev3_volatile2,
-    mimophytbl_info_sz_rev3_volatile3;
+	mimophytbl_info_sz_rev3_volatile1, mimophytbl_info_sz_rev3_volatile2,
+	mimophytbl_info_sz_rev3_volatile3;
 
 extern const u32 noise_var_tbl_rev3[];
 
drivers/staging/brcm80211/brcmsmac/phy_shim.h +2 -2
index 413d5db..61b3720 100644
@@ -31,8 +31,8 @@
 #define RADAR_TYPE_ITU_K	5	/* ITU K Radar type */
 #define RADAR_TYPE_UNCLASSIFIED	6	/* Unclassified Radar type  */
 #define RADAR_TYPE_BIN5		7	/* long pulse radar type */
-#define RADAR_TYPE_STG2 	8	/* staggered-2 radar */
-#define RADAR_TYPE_STG3 	9	/* staggered-3 radar */
+#define RADAR_TYPE_STG2		8	/* staggered-2 radar */
+#define RADAR_TYPE_STG3		9	/* staggered-3 radar */
 #define RADAR_TYPE_FRA		10	/* French radar */
 
 /* French radar pulse widths */
drivers/staging/brcm80211/brcmutil/utils.c +1 -1
index e221a3b..37b6b77 100644
@@ -510,7 +510,7 @@ static const u8 crc8_table[256] = {
 u8 brcmu_crc8(u8 *pdata,	/* pointer to array of data to process */
 			 uint nbytes,	/* number of input data bytes to process */
 			 u8 crc	/* either CRC8_INIT_VALUE or previous return value */
-    ) {
+	) {
 	/* loop over the buffer data */
 	while (nbytes-- > 0)
 		crc = crc8_table[(crc ^ *pdata++) & 0xff];
drivers/staging/brcm80211/include/brcmu_utils.h +2 -2
index b0f36e3..d0039d7 100644
@@ -246,9 +246,9 @@ extern int brcmu_iovar_lencheck(const struct brcmu_iovar *table, void *arg,
 
 /* modulo add/sub - assumes x, y E [0, bound - 1] */
 #define MODADD(x, y, bound) \
-    MUX((x) + (y) >= (bound), (x) + (y) - (bound), (x) + (y))
+	MUX((x) + (y) >= (bound), (x) + (y) - (bound), (x) + (y))
 #define MODSUB(x, y, bound) \
-    MUX(((int)(x)) - ((int)(y)) < 0, (x) - (y) + (bound), (x) - (y))
+	MUX(((int)(x)) - ((int)(y)) < 0, (x) - (y) + (bound), (x) - (y))
 
 /* module add/sub, bound = 2^k */
 #define MODADD_POW2(x, y, bound) (((x) + (y)) & ((bound) - 1))
Signature · 1 line
1.7.1
author
#33 lore raw

PATCH 29/119 staging: brcm80211: add missing KERN_ facility level to printk()

In reply to Franky Lin

From: Henry Ptasinski <[email protected]>

Debug printk() call was missing KERN_DEBUG facility level.

---
 drivers/staging/brcm80211/brcmsmac/phy/phy_n.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c +2 -1
index 57fff0f..c79c047 100644
@@ -24564,7 +24564,8 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
 	}
 
 	if (bcmerror != 0) {
-		printk("%s: Failed, cnt = %d\n", __func__, cal_retry);
+		printk(KERN_DEBUG "%s: Failed, cnt = %d\n", __func__,
+			cal_retry);
 
 		if (cal_retry < CAL_RETRY_CNT) {
 			cal_retry++;
Signature · 1 line
1.7.1
author
#34 lore raw

PATCH 30/119 staging: brcm80211: flatten wlc_phy_shared_detach()

In reply to Franky Lin

From: Henry Ptasinski <[email protected]>

wlc_phy_shared_detach() is an unnecessary level of indirection to just call kfree(), so replace the function with kfree().

---
 drivers/staging/brcm80211/brcmsmac/bmac.c        |    2 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c |    7 -------
 drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h |    1 -
 3 files changed, 1 insertions(+), 9 deletions(-)
drivers/staging/brcm80211/brcmsmac/bmac.c +1 -1
index 90d1b32..f44f581 100644
@@ -982,7 +982,7 @@ int brcms_b_detach(struct brcms_c_info *wlc)
 	}
 
 	/* Free shared phy state */
-	wlc_phy_shared_detach(wlc_hw->phy_sh);
+	kfree(wlc_hw->phy_sh);
 
 	wlc_phy_shim_detach(wlc_hw->physhim);
 
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c +0 -7
index a15c145..b527e5f 100644
@@ -506,13 +506,6 @@ shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp)
 	return sh;
 }
 
-void wlc_phy_shared_detach(shared_phy_t *phy_sh)
-{
-	if (phy_sh) {
-		kfree(phy_sh);
-	}
-}
-
 wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
 			  char *vars, struct wiphy *wiphy)
 {
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h +0 -1
index 3c125c3..0ea337b 100644
@@ -177,7 +177,6 @@ struct shared_phy_params {
 
 
 extern shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp);
-extern void wlc_phy_shared_detach(shared_phy_t *phy_sh);
 extern wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
 				 char *vars, struct wiphy *wiphy);
 extern void wlc_phy_detach(wlc_phy_t *ppi);
Signature · 1 line
1.7.1
author
#35 lore raw

PATCH 31/119 staging: brcm80211: remove unnecessary null check

In reply to Franky Lin

From: Henry Ptasinski <[email protected]>

kfree(NULL) is safe, and the rest of the cleanup should be done regardless to make sure the state is consistent.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +3 -5
index 48550f3..0fae0b1 100644
@@ -5567,11 +5567,9 @@ static void dhdsdio_release_malloc(dhd_bus_t *bus)
 	if (bus->dhd && bus->dhd->dongle_reset)
 		return;
 
-	if (bus->rxbuf) {
-		kfree(bus->rxbuf);
-		bus->rxctl = bus->rxbuf = NULL;
-		bus->rxlen = 0;
-	}
+	kfree(bus->rxbuf);
+	bus->rxctl = bus->rxbuf = NULL;
+	bus->rxlen = 0;
 
 	kfree(bus->databuf);
 	bus->databuf = NULL;
Signature · 1 line
1.7.1
author
#36 lore raw

PATCH 32/119 staging: brcm80211: reorg brcms_c_validboardtype for clarity

In reply to Franky Lin

From: Henry Ptasinski <[email protected]>

The structure of the function made it difficult to understand, so reorganize it to make it clearer.

---
 drivers/staging/brcm80211/brcmsmac/bmac.c |   35 ++++++++++++++++------------
 1 files changed, 20 insertions(+), 15 deletions(-)
drivers/staging/brcm80211/brcmsmac/bmac.c +19 -14
index f44f581..4a220d4 100644
@@ -1905,28 +1905,33 @@ static bool brcms_c_isgoodchip(struct brcms_c_hw_info *wlc_hw)
 	return true;
 }
 
+/* Validate some board info parameters */
 static bool brcms_c_validboardtype(struct brcms_c_hw_info *wlc_hw)
 {
-	bool goodboard = true;
 	uint boardrev = wlc_hw->boardrev;
 
+	/* 4 bits each for board type, major, minor, and tiny version */
+	uint brt = (boardrev & 0xf000) >> 12;
+	uint b0 = (boardrev & 0xf00) >> 8;
+	uint b1 = (boardrev & 0xf0) >> 4;
+	uint b2 = boardrev & 0xf;
+
+	/* voards from other vendors are always considered valid */
+	if (wlc_hw->sih->boardvendor != PCI_VENDOR_ID_BROADCOM)
+		return true;
+
+	/* do some boardrev sanity checks when boardvendor is Broadcom */
 	if (boardrev == 0)
-		goodboard = false;
-	else if (boardrev > 0xff) {
-		uint brt = (boardrev & 0xf000) >> 12;
-		uint b0 = (boardrev & 0xf00) >> 8;
-		uint b1 = (boardrev & 0xf0) >> 4;
-		uint b2 = boardrev & 0xf;
+		return false;
 
-		if ((brt > 2) || (brt == 0) || (b0 > 9) || (b0 == 0) || (b1 > 9)
-		    || (b2 > 9))
-			goodboard = false;
-	}
+	if (boardrev <= 0xff)
+		return true;
 
-	if (wlc_hw->sih->boardvendor != PCI_VENDOR_ID_BROADCOM)
-		return goodboard;
+	if ((brt > 2) || (brt == 0) || (b0 > 9) || (b0 == 0) || (b1 > 9)
+		|| (b2 > 9))
+		return false;
 
-	return goodboard;
+	return true;
 }
 
 static char *brcms_c_get_macaddr(struct brcms_c_hw_info *wlc_hw)
Signature · 1 line
1.7.1
author
#37 lore raw

PATCH 33/119 staging: brcm80211: correct bcmsdh_recv_buf() calls

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The calls in dhd_sdio.c to bcmsdh_recv_buf() function passed a wrong handle. The parameter in the function prototype was typed as void pointer so compiler could not detect. This patch makes the type explicit and fixes the calls to the function.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c    |    3 +--
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c  |   14 +++++++-------
 drivers/staging/brcm80211/brcmfmac/sdio_host.h |    2 +-
 3 files changed, 9 insertions(+), 10 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +1 -2
index 3d0c8e7..58dffc0 100644
@@ -447,11 +447,10 @@ bool bcmsdh_regfail(void *sdh)
 }
 
 int
-bcmsdh_recv_buf(void *sdh, u32 addr, uint fn, uint flags,
+bcmsdh_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
 		u8 *buf, uint nbytes, struct sk_buff *pkt,
 		bcmsdh_cmplt_fn_t complete, void *handle)
 {
-	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
 	SDIOH_API_RC status;
 	uint incr_fix;
 	uint width;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +7 -7
index 0fae0b1..7e4dfde 100644
@@ -3323,7 +3323,7 @@ dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
 	}
 
 	/* Read remainder of frame body into the rxctl buffer */
-	sdret = bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
+	sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
 				F2SYNC, (bus->rxctl + firstread), rdlen,
 				NULL, NULL, NULL);
 	bus->f2rxdata++;
@@ -3485,12 +3485,12 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
 		 * packet and and copy into the chain.
 		 */
 		if (usechain) {
-			errcode = bcmsdh_recv_buf(bus,
+			errcode = bcmsdh_recv_buf(bus->sdh,
 					bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2,
 					F2SYNC, (u8 *) pfirst->data, dlen,
 					pfirst, NULL, NULL);
 		} else if (bus->dataptr) {
-			errcode = bcmsdh_recv_buf(bus,
+			errcode = bcmsdh_recv_buf(bus->sdh,
 					bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2,
 					F2SYNC, bus->dataptr, dlen,
 					NULL, NULL, NULL);
@@ -3867,7 +3867,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 					ASSERT(bus->rxctl >= bus->rxbuf);
 					rxbuf = bus->rxctl;
 					/* Read the entire frame */
-					sdret = bcmsdh_recv_buf(bus,
+					sdret = bcmsdh_recv_buf(sdh,
 						    bcmsdh_cur_sbwad(sdh),
 						    SDIO_FUNC_2, F2SYNC,
 						    rxbuf, rdlen,
@@ -3908,7 +3908,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 				PKTALIGN(pkt, rdlen, DHD_SDALIGN);
 				rxbuf = (u8 *) (pkt->data);
 				/* Read the entire frame */
-				sdret = bcmsdh_recv_buf(bus,
+				sdret = bcmsdh_recv_buf(sdh,
 						bcmsdh_cur_sbwad(sdh),
 						SDIO_FUNC_2, F2SYNC,
 						rxbuf, rdlen,
@@ -4086,7 +4086,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 			break;
 
 		/* Read frame header (hardware and software) */
-		sdret = bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh),
+		sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh),
 				SDIO_FUNC_2, F2SYNC, bus->rxhdr, firstread,
 				NULL, NULL, NULL);
 		bus->f2rxhdrs++;
@@ -4247,7 +4247,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 		PKTALIGN(pkt, rdlen, DHD_SDALIGN);
 
 		/* Read the remaining frame data */
-		sdret = bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
+		sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
 					F2SYNC, ((u8 *) (pkt->data)), rdlen,
 					pkt, NULL, NULL);
 		bus->f2rxdata++;
drivers/staging/brcm80211/brcmfmac/sdio_host.h +1 -1
index 96a43cb..7fa79d6 100644
@@ -150,7 +150,7 @@ typedef void (*bcmsdh_cmplt_fn_t) (void *handle, int status, bool sync_waiting);
 extern int bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
 			   u8 *buf, uint nbytes, void *pkt,
 			   bcmsdh_cmplt_fn_t complete, void *handle);
-extern int bcmsdh_recv_buf(void *sdh, u32 addr, uint fn, uint flags,
+extern int bcmsdh_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn, uint flags,
 			   u8 *buf, uint nbytes, struct sk_buff *pkt,
 			   bcmsdh_cmplt_fn_t complete, void *handle);
 
Signature · 1 line
1.7.1
author
#38 lore raw

PATCH 34/119 staging: brcm80211: remove wireless extensions support from brcmfmac

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The brcmfmac driver contained functions for wireless extensions support. However, brcmfmac is intended to be a cfg80211 driver so all the entire source file is obsolete.

---
 drivers/staging/brcm80211/brcmfmac/Makefile    |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   29 -
 drivers/staging/brcm80211/brcmfmac/wl_iw.c     | 3660 ------------------------
 drivers/staging/brcm80211/brcmfmac/wl_iw.h     |  138 -
 4 files changed, 0 insertions(+), 3828 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/wl_iw.c
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/wl_iw.h
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index c5ec562..d907cae 100644
@@ -40,7 +40,6 @@ ccflags-y += \
 
 DHDOFILES = \
 	wl_cfg80211.o \
-	wl_iw.o \
 	dhd_cdc.o \
 	dhd_common.o \
 	dhd_custom_gpio.o \
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -29
index c556191..48859cd 100644
@@ -183,12 +183,6 @@ MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
 MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
 MODULE_LICENSE("Dual BSD/GPL");
 
-/* Linux wireless extension support */
-#if defined(CONFIG_WIRELESS_EXT)
-#include <wl_iw.h>
-extern wl_iw_extra_params_t g_wl_iw_params;
-#endif		/* defined(CONFIG_WIRELESS_EXT) */
-
 #if defined(CONFIG_HAS_EARLYSUSPEND)
 #include <linux/earlysuspend.h>
 extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
@@ -218,10 +212,6 @@ typedef struct dhd_if {
 
 /* Local private structure (extension of pub) */
 typedef struct dhd_info {
-#if defined(CONFIG_WIRELESS_EXT)
-	wl_iw_t iw;		/* wireless extensions state (must be first) */
-#endif				/* defined(CONFIG_WIRELESS_EXT) */
-
 	dhd_pub_t pub;
 
 	/* OS/stack specifics */
@@ -1602,14 +1592,6 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
 	if (ifidx == DHD_BAD_IF)
 		return -1;
 
-#if defined(CONFIG_WIRELESS_EXT)
-	/* linux wireless extensions */
-	if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) {
-		/* may recurse, do NOT lock */
-		return wl_iw_ioctl(net, ifr, cmd);
-	}
-#endif				/* defined(CONFIG_WIRELESS_EXT) */
-
 	if (cmd == SIOCETHTOOL)
 		return dhd_ethtool(dhd, (void *)ifr->ifr_data);
 
@@ -1896,13 +1878,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
 		DHD_ERROR(("dhd_prot_attach failed\n"));
 		goto fail;
 	}
-#if defined(CONFIG_WIRELESS_EXT)
-	/* Attach and link in the iw */
-	if (wl_iw_attach(net, (void *)&dhd->pub) != 0) {
-		DHD_ERROR(("wl_iw_attach failed\n"));
-		goto fail;
-	}
-#endif	/* defined(CONFIG_WIRELESS_EXT) */
 
 	/* Attach and link in the cfg80211 */
 	if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
@@ -2262,10 +2237,6 @@ void dhd_detach(dhd_pub_t *dhdp)
 			if (dhdp->prot)
 				dhd_prot_detach(dhdp);
 
-#if defined(CONFIG_WIRELESS_EXT)
-			wl_iw_detach();
-#endif				/* (CONFIG_WIRELESS_EXT) */
-
 			wl_cfg80211_detach();
 
 			/* && defined(DHD_GPL) */
drivers/staging/brcm80211/brcmfmac/wl_iw.c deleted +0 -3660

2,934 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_iw.h deleted +0 -138

138 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.1

Part of the diff is not shown here. View the raw message.

author
#39 lore raw

PATCH 35/119 staging: brcm80211: replaced prefix of SDIO related functions

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Prefixed functions with brcmf_ for unique namespace. In addition to that, prefix has been changed to categorize functions depending on their place in the drivers SDIO stack.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h      |   48 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |  158 ++--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |   58 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |  146 ++--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h  |   22 +-
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |   52 +-
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h       |   22 +-
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c       |    9 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c    |   26 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |   29 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      | 1010 ++++++++++----------
 drivers/staging/brcm80211/brcmfmac/sdio_host.h     |   79 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   |    4 +-
 13 files changed, 855 insertions(+), 808 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +25 -23
index e9da1ce..7eb0354 100644
@@ -48,68 +48,70 @@ typedef void (*sdioh_cb_fn_t) (void *);
  *  The handler shall be provided by all subsequent calls. No local cache
  *  cfghdl points to the starting address of pci device mapped memory
  */
-extern sdioh_info_t *sdioh_attach(void *cfghdl, uint irq);
-extern SDIOH_API_RC sdioh_detach(sdioh_info_t *si);
-extern SDIOH_API_RC sdioh_interrupt_register(sdioh_info_t *si,
+extern sdioh_info_t *brcmf_sdioh_attach(void *cfghdl, uint irq);
+extern SDIOH_API_RC brcmf_sdioh_detach(sdioh_info_t *si);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_register(sdioh_info_t *si,
 					     sdioh_cb_fn_t fn, void *argh);
-extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *si);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *si);
 
 /* query whether SD interrupt is enabled or not */
-extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
 
 /* enable or disable SD interrupt */
-extern SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
+extern SDIOH_API_RC
+brcmf_sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
 
 #if defined(DHD_DEBUG)
-extern bool sdioh_interrupt_pending(sdioh_info_t *si);
+extern bool brcmf_sdioh_interrupt_pending(sdioh_info_t *si);
 #endif
 
-extern int sdioh_claim_host_and_lock(sdioh_info_t *si);
-extern int sdioh_release_host_and_unlock(sdioh_info_t *si);
+extern int brcmf_sdioh_claim_host_and_lock(sdioh_info_t *si);
+extern int brcmf_sdioh_release_host_and_unlock(sdioh_info_t *si);
 
 /* read or write one byte using cmd52 */
-extern SDIOH_API_RC sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc,
-				       uint addr, u8 *byte);
+extern SDIOH_API_RC
+brcmf_sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc, uint addr,
+			 u8 *byte);
 
 /* read or write 2/4 bytes using cmd53 */
-extern SDIOH_API_RC sdioh_request_word(sdioh_info_t *si, uint cmd_type,
+extern SDIOH_API_RC brcmf_sdioh_request_word(sdioh_info_t *si, uint cmd_type,
 				       uint rw, uint fnc, uint addr,
 				       u32 *word, uint nbyte);
 
 /* read or write any buffer using cmd53 */
-extern SDIOH_API_RC sdioh_request_buffer(sdioh_info_t *si, uint pio_dma,
+extern SDIOH_API_RC brcmf_sdioh_request_buffer(sdioh_info_t *si, uint pio_dma,
 					 uint fix_inc, uint rw, uint fnc_num,
 					 u32 addr, uint regwidth,
 					 u32 buflen, u8 *buffer,
 					 struct sk_buff *pkt);
 
 /* get cis data */
-extern SDIOH_API_RC sdioh_cis_read(sdioh_info_t *si, uint fuc, u8 *cis,
+extern SDIOH_API_RC brcmf_sdioh_cis_read(sdioh_info_t *si, uint fuc, u8 *cis,
 				   u32 length);
 
-extern SDIOH_API_RC sdioh_cfg_read(sdioh_info_t *si, uint fuc, u32 addr,
+extern SDIOH_API_RC brcmf_sdioh_cfg_read(sdioh_info_t *si, uint fuc, u32 addr,
 				   u8 *data);
-extern SDIOH_API_RC sdioh_cfg_write(sdioh_info_t *si, uint fuc, u32 addr,
+extern SDIOH_API_RC brcmf_sdioh_cfg_write(sdioh_info_t *si, uint fuc, u32 addr,
 				    u8 *data);
 
 /* query number of io functions */
-extern uint sdioh_query_iofnum(sdioh_info_t *si);
+extern uint brcmf_sdioh_query_iofnum(sdioh_info_t *si);
 
 /* handle iovars */
-extern int sdioh_iovar_op(sdioh_info_t *si, const char *name,
+extern int brcmf_sdioh_iovar_op(sdioh_info_t *si, const char *name,
 			  void *params, int plen, void *arg, int len, bool set);
 
 /* Issue abort to the specified function and clear controller as needed */
-extern int sdioh_abort(sdioh_info_t *si, uint fnc);
+extern int brcmf_sdioh_abort(sdioh_info_t *si, uint fnc);
 
 /* Start and Stop SDIO without re-enumerating the SD card. */
-extern int sdioh_start(sdioh_info_t *si, int stage);
-extern int sdioh_stop(sdioh_info_t *si);
+extern int brcmf_sdioh_start(sdioh_info_t *si, int stage);
+extern int brcmf_sdioh_stop(sdioh_info_t *si);
 
 /* Reset and re-initialize the device */
-extern int sdioh_sdio_reset(sdioh_info_t *si);
+extern int brcmf_sdioh_reset(sdioh_info_t *si);
 
 /* Helper function */
-void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh);
+void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
 
 #endif				/* _sdio_api_h_ */
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +79 -79

460 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +29 -29

176 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +73 -73

464 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +13 -9
index ff5e09d..c7863b1 100644
@@ -14,6 +14,10 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+/*
+ * BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
+ */
+
 #ifndef __BCMSDH_SDMMC_H__
 #define __BCMSDH_SDMMC_H__
 
@@ -58,8 +62,8 @@
 #endif
 
 /* Allocate/init/free per-OS private data */
-extern int sdioh_sdmmc_osinit(sdioh_info_t *sd);
-extern void sdioh_sdmmc_osfree(sdioh_info_t *sd);
+extern int brcmf_sdioh_osinit(sdioh_info_t *sd);
+extern void brcmf_sdioh_osfree(sdioh_info_t *sd);
 
 #define BLOCK_SIZE_64 64
 #define BLOCK_SIZE_512 512
@@ -105,23 +109,23 @@ struct sdioh_info {
 extern uint sd_msglevel;
 
 /* OS-independent interrupt handler */
-extern bool check_client_intr(sdioh_info_t *sd);
+extern bool brcmf_sdioh_check_client_intr(sdioh_info_t *sd);
 
 /* Core interrupt enable/disable of device interrupts */
-extern void sdioh_sdmmc_devintr_on(sdioh_info_t *sd);
-extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd);
+extern void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd);
+extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd);
 
 /**************************************************************
  * Internal interfaces: bcmsdh_sdmmc.c references to per-port code
  */
 
 /* Register mapping routines */
-extern u32 *sdioh_sdmmc_reg_map(s32 addr, int size);
-extern void sdioh_sdmmc_reg_unmap(s32 addr, int size);
+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 sdioh_sdmmc_register_irq(sdioh_info_t *sd, uint irq);
-extern void sdioh_sdmmc_free_irq(uint irq, sdioh_info_t *sd);
+extern int brcmf_sdioh_register_irq(sdioh_info_t *sd, uint irq);
+extern void brcmf_sdioh_free_irq(uint irq, sdioh_info_t *sd);
 
 typedef struct _BCMSDH_SDMMC_INSTANCE {
 	sdioh_info_t *sd;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +26 -26

133 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_bus.h +13 -9
index b1bb04f..128a00d 100644
@@ -30,26 +30,30 @@ 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 dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
+extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
 
 /* Initialize bus module: prepare for communication w/dongle */
-extern int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
+extern int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
 
 /* Send a data frame to the dongle.  Callee disposes of txp. */
-extern int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
+extern int brcmf_sdbrcm_bus_txdata(struct dhd_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 dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
-extern int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
+extern int
+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 dhd_bus_watchdog(dhd_pub_t *dhd);
+extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhd);
 
 #ifdef DHD_DEBUG
 /* Device console input function */
-extern int dhd_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
+extern int
+brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
 #endif				/* DHD_DEBUG */
 
 /* Deferred processing for the bus, return true requests reschedule */
@@ -58,12 +62,12 @@ extern void dhd_bus_isr(bool *InterruptRecognized,
 			bool *QueueMiniportHandleInterrupt, void *arg);
 
 /* Check for and handle local prot-specific iovar commands */
-extern int dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
+extern int brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
 			    void *params, int plen, void *arg, int len,
 			    bool set);
 
 /* Add bus dump output to a buffer */
-extern void dhd_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
+extern void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
 
 /* Clear any bus counters */
 extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +5 -4
index bf3fe99..c77c86c 100644
@@ -129,7 +129,8 @@ static int dhdcdc_msg(dhd_pub_t *dhd)
 		len = CDC_MAX_MSG_SIZE;
 
 	/* Send request */
-	return dhd_bus_txctl(dhd->bus, (unsigned char *)&prot->msg, len);
+	return brcmf_sdbrcm_bus_txctl(dhd->bus, (unsigned char *)&prot->msg,
+				      len);
 }
 
 static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
@@ -140,9 +141,9 @@ static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
 	DHD_TRACE(("%s: Enter\n", __func__));
 
 	do {
-		ret =
-		    dhd_bus_rxctl(dhd->bus, (unsigned char *)&prot->msg,
-				  len + sizeof(struct cdc_ioctl));
+		ret = brcmf_sdbrcm_bus_rxctl(dhd->bus,
+					     (unsigned char *)&prot->msg,
+					     len + sizeof(struct cdc_ioctl));
 		if (ret < 0)
 			break;
 	} while (CDC_IOC_ID(le32_to_cpu(prot->msg.flags)) != id);
drivers/staging/brcm80211/brcmfmac/dhd_common.c +15 -11
index 0a5a1a4..34bd5e9 100644
@@ -210,7 +210,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
 	brcmu_bprintf(strbuf, "\n");
 
 	/* Add any bus info */
-	dhd_bus_dump(dhdp, strbuf);
+	brcmf_sdbrcm_bus_dump(dhdp, strbuf);
 
 	return !strbuf->size ? -EOVERFLOW : 0;
 }
@@ -287,7 +287,8 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 
 	case IOV_SVAL(IOV_CONS):
 		if (len > 0)
-			bcmerror = dhd_bus_console_in(dhd_pub, arg, len - 1);
+			bcmerror = brcmf_sdbrcm_bus_console_in(dhd_pub, arg,
+							       len - 1);
 		break;
 #endif
 
@@ -504,13 +505,13 @@ int dhd_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 = dhd_bus_iovar_op(dhd_pub, buf,
-							    arg, arglen, buf,
-							    buflen, IOV_GET);
+				bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
+						buf, arg, arglen, buf, buflen,
+						IOV_GET);
 			else
-				bcmerror = dhd_bus_iovar_op(dhd_pub, buf,
-							    NULL, 0, arg,
-							    arglen, IOV_SET);
+				bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
+						buf, NULL, 0, arg, arglen,
+						IOV_SET);
 
 			break;
 		}
@@ -1168,7 +1169,8 @@ void dhd_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
 	int retcode;
 
 	brcmu_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf));
-	retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+	retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+				       sizeof(iovbuf));
 	retcode = retcode >= 0 ? 0 : retcode;
 	if (retcode)
 		DHD_TRACE(("%s: failed to set ARP offload mode to 0x%x, "
@@ -1184,7 +1186,8 @@ void dhd_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
 	int retcode;
 
 	brcmu_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf));
-	retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+	retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+				       sizeof(iovbuf));
 	retcode = retcode >= 0 ? 0 : retcode;
 	if (retcode)
 		DHD_TRACE(("%s: failed to enabe ARP offload to %d, "
@@ -1224,7 +1227,8 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
 	if (!ret) {
 		brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
 			    buf, sizeof(buf));
-		ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
+		ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf,
+					   sizeof(buf));
 		if (ret < 0) {
 			DHD_ERROR(("%s: can't set MAC address , error=%d\n",
 				   __func__, ret));
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +15 -14
index 48859cd..f80295e 100644
@@ -175,7 +175,7 @@ DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
 #endif	/*  defined(CONFIG_PM_SLEEP) */
 
 #if defined(OOB_INTR_ONLY)
-extern void dhd_enable_oob_intr(struct dhd_bus *bus, bool enable);
+extern void brcmf_sdbrcm_enable_oob_intr(struct dhd_bus *bus, bool enable);
 #endif	/* defined(OOB_INTR_ONLY) */
 
 MODULE_AUTHOR("Broadcom Corporation");
@@ -995,7 +995,7 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
 #ifdef BCMDBUS
 	ret = dbus_send_pkt(dhdp->dbus, pktbuf, NULL /* pktinfo */);
 #else
-	ret = dhd_bus_txdata(dhdp->bus, pktbuf);
+	ret = brcmf_sdbrcm_bus_txdata(dhdp->bus, pktbuf);
 #endif				/* BCMDBUS */
 
 	return ret;
@@ -1264,7 +1264,7 @@ static int dhd_watchdog_thread(void *data)
 		if (down_interruptible(&dhd->watchdog_sem) == 0) {
 			if (dhd->pub.dongle_reset == false) {
 				/* Call the bus module watchdog */
-				dhd_bus_watchdog(&dhd->pub);
+				brcmf_sdbrcm_bus_watchdog(&dhd->pub);
 			}
 			/* Count the tick for reference */
 			dhd->pub.tickcnt++;
@@ -1290,7 +1290,7 @@ static void dhd_watchdog(unsigned long data)
 	}
 
 	/* Call the bus module watchdog */
-	dhd_bus_watchdog(&dhd->pub);
+	brcmf_sdbrcm_bus_watchdog(&dhd->pub);
 
 	/* Count the tick for reference */
 	dhd->pub.tickcnt++;
@@ -1330,7 +1330,7 @@ static int dhd_dpc_thread(void *data)
 					up(&dhd->dpc_sem);
 				}
 			} else {
-				dhd_bus_stop(dhd->pub.bus, true);
+				brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
 			}
 		} else
 			break;
@@ -1349,7 +1349,7 @@ static void dhd_dpc(unsigned long data)
 		if (dhd_bus_dpc(dhd->pub.bus))
 			tasklet_schedule(&dhd->tasklet);
 	} else {
-		dhd_bus_stop(dhd->pub.bus, true);
+		brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
 	}
 }
 
@@ -1990,7 +1990,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
 	if (dhd->pub.busstate == DHD_BUS_DOWN) {
 		if (!(dhd_bus_download_firmware(dhd->pub.bus,
 						fw_path, nv_path))) {
-			DHD_ERROR(("%s: dhdsdio_probe_download failed. "
+			DHD_ERROR(("%s: dhd_bus_download_firmware failed. "
 				"firmware = %s nvram = %s\n",
 				__func__, fw_path, nv_path));
 			return -1;
@@ -2002,14 +2002,15 @@ int dhd_bus_start(dhd_pub_t *dhdp)
 	dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
 
 	/* Bring up the bus */
-	ret = dhd_bus_init(&dhd->pub, true);
+	ret = brcmf_sdbrcm_bus_init(&dhd->pub, true);
 	if (ret != 0) {
-		DHD_ERROR(("%s, dhd_bus_init failed %d\n", __func__, ret));
+		DHD_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
+			   ret));
 		return ret;
 	}
 #if defined(OOB_INTR_ONLY)
 	/* Host registration for OOB interrupt */
-	if (bcmsdh_register_oob_intr(dhdp)) {
+	if (brcmf_sdio_register_oob_intr(dhdp)) {
 		del_timer_sync(&dhd->timer);
 		dhd->wd_timer_valid = false;
 		DHD_ERROR(("%s Host failed to resgister for OOB\n", __func__));
@@ -2017,7 +2018,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
 	}
 
 	/* Enable oob at firmware */
-	dhd_enable_oob_intr(dhd->pub.bus, true);
+	brcmf_sdbrcm_enable_oob_intr(dhd->pub.bus, true);
 #endif				/* defined(OOB_INTR_ONLY) */
 
 	/* If bus is not ready, can't come up */
@@ -2173,9 +2174,9 @@ void dhd_bus_detach(dhd_pub_t *dhdp)
 			dhd_prot_stop(&dhd->pub);
 
 			/* Stop the bus module */
-			dhd_bus_stop(dhd->pub.bus, true);
+			brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
 #if defined(OOB_INTR_ONLY)
-			bcmsdh_unregister_oob_intr();
+			brcmf_sdio_unregister_oob_intr();
 #endif				/* defined(OOB_INTR_ONLY) */
 
 			/* Clear the watchdog timer */
@@ -2305,7 +2306,7 @@ static int __init dhd_module_init(void)
 	error = dhd_bus_register();
 
 	if (error) {
-		DHD_ERROR(("%s: sdio_register_driver failed\n", __func__));
+		DHD_ERROR(("%s: dhd_bus_register failed\n", __func__));
 		goto failed;
 	}
 	return error;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +520 -490

1,388 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sdio_host.h +40 -39

79 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +2 -2
index 3bccc22..915546c 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.1

Part of the diff is not shown here. View the raw message.

author
#40 lore raw

PATCH 36/119 staging: brcm80211: remove dhd_set_timer function prototype

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

This function prototype is not implemented nor referenced in the brcmfmac driver so it has been removed.

---
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -2
index 34bd5e9..bb9a72a 100644
@@ -66,8 +66,6 @@ const char dhd_version[] =
 const char dhd_version[] = "Dongle Host Driver, version " EPI_VERSION_STR;
 #endif
 
-void dhd_set_timer(void *bus, uint wdtick);
-
 /* IOVar table */
 enum {
 	IOV_VERSION = 1,
Signature · 1 line
1.7.1
author
#41 lore raw

PATCH 37/119 staging: brcm80211: remove unused globals from dhd_common.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Three global variable were defined but never used and have been removed.

---
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -5
index bb9a72a..cb7e455 100644
@@ -35,11 +35,6 @@ int dhd_msg_level;
 char fw_path[MOD_PARAM_PATHLEN];
 char nv_path[MOD_PARAM_PATHLEN];
 
-/* Last connection success/failure status */
-u32 dhd_conn_event;
-u32 dhd_conn_status;
-u32 dhd_conn_reason;
-
 extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
 			    uint len);
 extern void dhd_ind_scan_confirm(void *h, bool status);
Signature · 1 line
1.7.1
author
#42 lore raw

PATCH 38/119 staging: brcm80211: remove extern function prototypes from c files

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

It is not recommended to specify function prototypes in c sources using the extern keyword. Several occurrences have been removed or placed in a header file or simply removed as it was already present in a header file.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h       |    6 ++++++
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c   |    2 --
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   14 +++-----------
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h |    5 +++++
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c  |    3 ---
 5 files changed, 14 insertions(+), 16 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +6 -0
index 4bedf41..4fcdf9d 100644
@@ -1021,6 +1021,12 @@ extern int dhd_bus_start(dhd_pub_t *dhdp);
 extern void dhd_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
 extern void dhd_wait_event_wakeup(dhd_pub_t *dhd);
 
+#ifdef PKT_FILTER_SUPPORT
+extern void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
+extern void dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
+					 int master_mode);
+#endif
+
 #ifdef BCMDBG
 #define ASSERT(exp) \
 	  do { if (!(exp)) osl_assert(#exp, __FILE__, __LINE__); } while (0)
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +0 -2
index c77c86c..1d94438 100644
@@ -84,8 +84,6 @@ struct bdc_header {
 int wifi_get_mac_addr(unsigned char *buf);
 #endif
 
-extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
-
 /* Packet alignment for most efficient SDIO (can change based on platform) */
 #ifndef DHD_SDALIGN
 #define DHD_SDALIGN	32
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +3 -11
index f80295e..ed4a296 100644
@@ -32,6 +32,9 @@
 #include <linux/fs.h>
 #include <linux/uaccess.h>
 #include <net/cfg80211.h>
+#if defined(CONFIG_HAS_EARLYSUSPEND)
+#include <linux/earlysuspend.h>
+#endif
 #include <defs.h>
 #include <brcmu_utils.h>
 #include <brcmu_wifi.h>
@@ -183,17 +186,6 @@ MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
 MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
 MODULE_LICENSE("Dual BSD/GPL");
 
-#if defined(CONFIG_HAS_EARLYSUSPEND)
-#include <linux/earlysuspend.h>
-extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
-			    uint len);
-#endif		/* defined(CONFIG_HAS_EARLYSUSPEND) */
-
-#ifdef PKT_FILTER_SUPPORT
-extern void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
-extern void dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
-					 int master_mode);
-#endif
 
 /* Interface control information */
 typedef struct dhd_if {
drivers/staging/brcm80211/brcmfmac/dhd_proto.h +5 -0
index 188b588..f75eb1c 100644
@@ -71,6 +71,11 @@ extern int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
 
 extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
 
+#if defined(CONFIG_HAS_EARLYSUSPEND)
+extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
+			    uint len);
+#endif		/* defined(CONFIG_HAS_EARLYSUSPEND) */
+
 /********************************
  * For version-string expansion *
  */
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -3
index e253cb5..19ac421 100644
@@ -654,9 +654,6 @@ static int tx_packets[NUMPRIO];
 /* Deferred transmit */
 const uint dhd_deferred_tx = 1;
 
-extern uint dhd_watchdog_ms;
-extern void dhd_os_wd_timer(void *bus, uint wdtick);
-
 /* Tx/Rx bounds */
 uint dhd_txbound;
 uint dhd_rxbound;
Signature · 1 line
1.7.1
author
#43 lore raw

PATCH 39/119 staging: brcm80211: rename functions and variables in dhd_common.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The naming convention of the drivers is to be made consistent. This commit fixes the function in dhd_common.c and use the new names from the calling code.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |   16 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c    |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |   90 +++++++++++-----------
 drivers/staging/brcm80211/brcmfmac/dhd_dbg.h    |   56 +++++++-------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |   26 +++---
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h  |    4 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |    8 +-
 7 files changed, 101 insertions(+), 101 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +8 -8
index 4fcdf9d..b16ffc2 100644
@@ -875,8 +875,8 @@ extern uint dhd_pktgen_len;
 #define MAX_PKTGEN_LEN 1800
 #endif
 
-extern char fw_path[MOD_PARAM_PATHLEN];
-extern char nv_path[MOD_PARAM_PATHLEN];
+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[];
@@ -938,7 +938,7 @@ extern void dhd_detach(dhd_pub_t *dhdp);
 /* Indication from bus module to change flow-control state */
 extern void dhd_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);
 
-extern bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q,
+extern bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q,
 			 struct sk_buff *pkt, int prec);
 
 /* Receive frame for delivery to OS.  Callee disposes of rxp. */
@@ -992,10 +992,10 @@ extern int dhd_timeout_expired(dhd_timeout_t *tmo);
 
 extern int dhd_ifname2idx(struct dhd_info *dhd, char *name);
 extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
-extern int wl_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
+extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
 			 wl_event_msg_t *, void **data_ptr);
 
-extern void dhd_common_init(void);
+extern void brcmf_c_init(void);
 
 extern int dhd_add_if(struct dhd_info *dhd, int ifidx, void *handle,
 		      char *name, u8 *mac_addr, u32 flags, u8 bssidx);
@@ -1022,9 +1022,9 @@ extern void dhd_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
 extern void dhd_wait_event_wakeup(dhd_pub_t *dhd);
 
 #ifdef PKT_FILTER_SUPPORT
-extern void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
-extern void dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
-					 int master_mode);
+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);
 #endif
 
 #ifdef BCMDBG
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -1
index 1d94438..af78764 100644
@@ -513,7 +513,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
 	dhd_os_proto_unblock(dhd);
 
 #ifdef EMBEDDED_PLATFORM
-	ret = dhd_preinit_ioctls(dhd);
+	ret = brcmf_c_preinit_ioctls(dhd);
 #endif				/* EMBEDDED_PLATFORM */
 
 	/* Always assumes wl for now */
drivers/staging/brcm80211/brcmfmac/dhd_common.c +45 -45

279 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_dbg.h +28 -28

81 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_linux.c +13 -13
index ed4a296..da39948 100644
@@ -252,7 +252,7 @@ bool dhd_no_fw_req;
 module_param(dhd_no_fw_req, bool, 0);
 
 /* Error bits */
-module_param(dhd_msg_level, int, 0);
+module_param(brcmf_msg_level, int, 0);
 
 /* Spawn a thread for system ioctls (set mac, set mcast) */
 uint dhd_sysioc = true;
@@ -388,8 +388,8 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
 		int i;
 
 		for (i = 0; i < dhd->pktfilter_count; i++) {
-			dhd_pktfilter_offload_set(dhd, dhd->pktfilter[i]);
-			dhd_pktfilter_offload_enable(dhd, dhd->pktfilter[i],
+			brcmf_c_pktfilter_offload_set(dhd, dhd->pktfilter[i]);
+			brcmf_c_pktfilter_offload_enable(dhd, dhd->pktfilter[i],
 						     value, dhd_master_mode);
 		}
 	}
@@ -1634,7 +1634,7 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
 
 	/* check for local dhd ioctl and handle it */
 	if (driver == DHD_IOCTL_MAGIC) {
-		bcmerror = dhd_ioctl((void *)&dhd->pub, &ioc, buf, buflen);
+		bcmerror = brcmf_c_ioctl((void *)&dhd->pub, &ioc, buf, buflen);
 		if (bcmerror)
 			dhd->pub.bcmerror = bcmerror;
 		goto done;
@@ -1810,9 +1810,9 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	/* updates firmware nvram path if it was provided as module
 		 paramters */
 	if ((firmware_path != NULL) && (firmware_path[0] != '\0'))
-		strcpy(fw_path, firmware_path);
+		strcpy(brcmf_fw_path, firmware_path);
 	if ((nvram_path != NULL) && (nvram_path[0] != '\0'))
-		strcpy(nv_path, nvram_path);
+		strcpy(brcmf_nv_path, nvram_path);
 
 	/* Allocate etherdev, including space for private structure */
 	net = alloc_etherdev(sizeof(dhd));
@@ -1877,8 +1877,8 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
 		goto fail;
 	}
 	if (!dhd_no_fw_req) {
-		strcpy(fw_path, wl_cfg80211_get_fwname());
-		strcpy(nv_path, wl_cfg80211_get_nvramname());
+		strcpy(brcmf_fw_path, wl_cfg80211_get_fwname());
+		strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
 	}
 
 	/* Set up the watchdog timer */
@@ -1980,11 +1980,11 @@ int dhd_bus_start(dhd_pub_t *dhdp)
 
 	/* try to download image and nvram to the dongle */
 	if (dhd->pub.busstate == DHD_BUS_DOWN) {
-		if (!(dhd_bus_download_firmware(dhd->pub.bus,
-						fw_path, nv_path))) {
+		if (!(dhd_bus_download_firmware(dhd->pub.bus, brcmf_fw_path,
+						brcmf_nv_path))) {
 			DHD_ERROR(("%s: dhd_bus_download_firmware failed. "
 				"firmware = %s nvram = %s\n",
-				__func__, fw_path, nv_path));
+				__func__, brcmf_fw_path, brcmf_nv_path));
 			return -1;
 		}
 	}
@@ -2506,7 +2506,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 
 	ASSERT(dhd != NULL);
 
-	bcmerror = wl_host_event(dhd, ifidx, pktdata, event, data);
+	bcmerror = brcmf_c_host_event(dhd, ifidx, pktdata, event, data);
 	if (bcmerror != 0)
 		return bcmerror;
 
@@ -2625,7 +2625,7 @@ void dhd_dev_init_ioctl(struct net_device *dev)
 {
 	dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
 
-	dhd_preinit_ioctls(&dhd->pub);
+	brcmf_c_preinit_ioctls(&dhd->pub);
 }
 
 #ifdef PNO_SUPPORT
drivers/staging/brcm80211/brcmfmac/dhd_proto.h +2 -2
index f75eb1c..fccd3dd 100644
@@ -66,10 +66,10 @@ extern void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
 /* Update local copy of dongle statistics */
 extern void dhd_prot_dstats(dhd_pub_t *dhdp);
 
-extern int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
+extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
 		     uint buflen);
 
-extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
+extern int brcmf_c_preinit_ioctls(dhd_pub_t *dhd);
 
 #if defined(CONFIG_HAS_EARLYSUSPEND)
 extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +4 -4
index 19ac421..7e7d288 100644
@@ -1375,7 +1375,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
 
 		/* Priority based enq */
 		spin_lock_bh(&bus->txqlock);
-		if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
+		if (brcmf_c_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
 			skb_pull(pkt, SDPCM_HDRLEN);
 			dhd_txcomplete(bus->dhd, pkt, false);
 			brcmu_pkt_buf_free_skb(pkt);
@@ -2784,7 +2784,7 @@ exit:
 	dhd_os_sdunlock(bus->dhd);
 
 	if (actionid == IOV_SVAL(IOV_DEVRESET) && bool_val == false)
-		dhd_preinit_ioctls((dhd_pub_t *) bus->dhd);
+		brcmf_c_preinit_ioctls((dhd_pub_t *) bus->dhd);
 
 	return bcmerror;
 }
@@ -5213,7 +5213,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
 
 	forcealign = true;
 
-	dhd_common_init();
+	brcmf_c_init();
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 	DHD_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));
@@ -5660,7 +5660,7 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
 	void *image = NULL;
 	u8 *memblock = NULL, *memptr;
 
-	DHD_INFO(("%s: download firmware %s\n", __func__, fw_path));
+	DHD_INFO(("%s: download firmware %s\n", __func__, brcmf_fw_path));
 
 	image = dhd_os_open_image(fw_path);
 	if (image == NULL)
Signature · 1 line
1.7.1
author
#44 lore raw

PATCH 40/119 staging: brcm80211: rename ioctl command codes in dhd.h

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The naming convention in the driver is to be aligned. This commit changes the prefix used for the ioctl command codes.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |   96 +++++++++---------
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c     |   20 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_common.c  |   58 ++++++------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |   39 ++++----
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |  118 +++++++++++-----------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |    4 +-
 6 files changed, 171 insertions(+), 164 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +48 -48
index b16ffc2..14713f5 100644
@@ -26,50 +26,54 @@ struct dhd_bus;
 struct dhd_prot;
 struct dhd_info;
 
-#define WLC_UP					2
-#define WLC_SET_PROMISC				10
-#define WLC_GET_RATE				12
-#define WLC_GET_INFRA				19
-#define WLC_SET_INFRA				20
-#define WLC_GET_AUTH				21
-#define WLC_SET_AUTH				22
-#define WLC_GET_BSSID				23
-#define WLC_GET_SSID				25
-#define WLC_SET_SSID				26
-#define WLC_GET_CHANNEL				29
-#define WLC_GET_SRL				31
-#define WLC_GET_LRL				33
-#define WLC_GET_RADIO				37
-#define WLC_SET_RADIO				38
-#define WLC_GET_PHYTYPE				39
-#define WLC_SET_KEY				45
-#define WLC_SET_PASSIVE_SCAN			49
-#define WLC_SCAN				50
-#define WLC_SCAN_RESULTS			51
-#define WLC_DISASSOC				52
-#define WLC_REASSOC				53
-#define WLC_SET_ROAM_TRIGGER			55
-#define WLC_SET_ROAM_DELTA			57
-#define WLC_GET_DTIMPRD				77
-#define WLC_SET_COUNTRY				84
-#define WLC_GET_PM				85
-#define WLC_SET_PM				86
-#define WLC_GET_AP				117
-#define WLC_SET_AP				118
-#define WLC_GET_RSSI				127
-#define WLC_GET_WSEC				133
-#define WLC_SET_WSEC				134
-#define WLC_GET_PHY_NOISE			135
-#define WLC_GET_BSS_INFO			136
-#define WLC_SET_SCAN_CHANNEL_TIME		185
-#define WLC_SET_SCAN_UNASSOC_TIME		187
-#define WLC_SCB_DEAUTHENTICATE_FOR_REASON	201
-#define WLC_GET_VALID_CHANNELS			217
-#define WLC_GET_KEY_PRIMARY			235
-#define WLC_SET_KEY_PRIMARY			236
-#define WLC_SET_SCAN_PASSIVE_TIME		258
-#define WLC_GET_VAR				262	/* get value of named variable */
-#define WLC_SET_VAR				263	/* set named variable to value */
+#define	BRCMF_C_IOCTL_SMLEN	256	/* "small" ioctl buffer required */
+#define BRCMF_C_IOCTL_MEDLEN	1536	/* "med" ioctl buffer required */
+#define	BRCMF_C_IOCTL_MAXLEN	8192
+
+#define BRCMF_C_UP				2
+#define BRCMF_C_SET_PROMISC			10
+#define BRCMF_C_GET_RATE			12
+#define BRCMF_C_GET_INFRA			19
+#define BRCMF_C_SET_INFRA			20
+#define BRCMF_C_GET_AUTH			21
+#define BRCMF_C_SET_AUTH			22
+#define BRCMF_C_GET_BSSID			23
+#define BRCMF_C_GET_SSID			25
+#define BRCMF_C_SET_SSID			26
+#define BRCMF_C_GET_CHANNEL			29
+#define BRCMF_C_GET_SRL				31
+#define BRCMF_C_GET_LRL				33
+#define BRCMF_C_GET_RADIO			37
+#define BRCMF_C_SET_RADIO			38
+#define BRCMF_C_GET_PHYTYPE			39
+#define BRCMF_C_SET_KEY				45
+#define BRCMF_C_SET_PASSIVE_SCAN		49
+#define BRCMF_C_SCAN				50
+#define BRCMF_C_SCAN_RESULTS			51
+#define BRCMF_C_DISASSOC			52
+#define BRCMF_C_REASSOC				53
+#define BRCMF_C_SET_ROAM_TRIGGER		55
+#define BRCMF_C_SET_ROAM_DELTA			57
+#define BRCMF_C_GET_DTIMPRD			77
+#define BRCMF_C_SET_COUNTRY			84
+#define BRCMF_C_GET_PM				85
+#define BRCMF_C_SET_PM				86
+#define BRCMF_C_GET_AP				117
+#define BRCMF_C_SET_AP				118
+#define BRCMF_C_GET_RSSI			127
+#define BRCMF_C_GET_WSEC			133
+#define BRCMF_C_SET_WSEC			134
+#define BRCMF_C_GET_PHY_NOISE			135
+#define BRCMF_C_GET_BSS_INFO			136
+#define BRCMF_C_SET_SCAN_CHANNEL_TIME		185
+#define BRCMF_C_SET_SCAN_UNASSOC_TIME		187
+#define BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON	201
+#define BRCMF_C_GET_VALID_CHANNELS		217
+#define BRCMF_C_GET_KEY_PRIMARY			235
+#define BRCMF_C_SET_KEY_PRIMARY			236
+#define BRCMF_C_SET_SCAN_PASSIVE_TIME		258
+#define BRCMF_C_GET_VAR				262
+#define BRCMF_C_SET_VAR				263
 
 /* phy types (returned by WLC_GET_PHYTPE) */
 #define	WLC_PHY_TYPE_A		0
@@ -154,10 +158,6 @@ struct dhd_info;
 #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 */
 
-#define	WLC_IOCTL_SMLEN			256	/* "small" length ioctl buffer required */
-#define WLC_IOCTL_MEDLEN		1536	/* "med" length ioctl buffer required */
-#define	WLC_IOCTL_MAXLEN	8192
-
 #define DHD_IF_VIF	0x01	/* Virtual IF (Hidden from user) */
 
 /* optionally set by a module_param_string() */
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +11 -9
index af78764..0ed62a0 100644
@@ -109,7 +109,7 @@ typedef struct dhd_prot {
 	u32 lastcmd;
 	u8 bus_header[BUS_HEADER_LEN];
 	struct cdc_ioctl msg;
-	unsigned char buf[WLC_IOCTL_MAXLEN + ROUND_UP_MARGIN];
+	unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
 } dhd_prot_t;
 
 static int dhdcdc_msg(dhd_pub_t *dhd)
@@ -162,7 +162,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
 	DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
 
 	/* Respond "bcmerror" and "bcmerrorstr" with local cache */
-	if (cmd == WLC_GET_VAR && buf) {
+	if (cmd == BRCMF_C_GET_VAR && buf) {
 		if (!strcmp((char *)buf, "bcmerrorstr")) {
 			strncpy((char *)buf, "bcm_error",
 				BCME_STRLEN);
@@ -296,9 +296,9 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
-	ASSERT(len <= WLC_IOCTL_MAXLEN);
+	ASSERT(len <= BRCMF_C_IOCTL_MAXLEN);
 
-	if (len > WLC_IOCTL_MAXLEN)
+	if (len > BRCMF_C_IOCTL_MAXLEN)
 		goto done;
 
 	if (prot->pending == true) {
@@ -306,7 +306,8 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
 			"lastcmd=0x%x (%lu)\n",
 			ioc->cmd, (unsigned long)ioc->cmd, prot->lastcmd,
 			(unsigned long)prot->lastcmd));
-		if ((ioc->cmd == WLC_SET_VAR) || (ioc->cmd == WLC_GET_VAR))
+		if ((ioc->cmd == BRCMF_C_SET_VAR) ||
+		    (ioc->cmd == BRCMF_C_GET_VAR))
 			DHD_TRACE(("iovar cmd=%s\n", (char *)buf));
 
 		goto done;
@@ -332,7 +333,8 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
 	}
 
 	/* Intercept the wme_dp ioctl here */
-	if ((!ret) && (ioc->cmd == WLC_SET_VAR) && (!strcmp(buf, "wme_dp"))) {
+	if (!ret && ioc->cmd == BRCMF_C_SET_VAR &&
+	    !strcmp(buf, "wme_dp")) {
 		int slen, val = 0;
 
 		slen = strlen("wme_dp") + 1;
@@ -464,8 +466,8 @@ int dhd_prot_attach(dhd_pub_t *dhd)
 #ifdef BDC
 	dhd->hdrlen += BDC_HEADER_LEN;
 #endif
-	dhd->maxctl =
-		WLC_IOCTL_MAXLEN + sizeof(struct cdc_ioctl) + ROUND_UP_MARGIN;
+	dhd->maxctl = BRCMF_C_IOCTL_MAXLEN +
+				sizeof(struct cdc_ioctl) + ROUND_UP_MARGIN;
 	return 0;
 
 fail:
@@ -503,7 +505,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
 
 	/* Get the device MAC address */
 	strcpy(buf, "cur_etheraddr");
-	ret = dhdcdc_query_ioctl(dhd, 0, WLC_GET_VAR, buf, sizeof(buf));
+	ret = dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
 	if (ret < 0) {
 		dhd_os_proto_unblock(dhd);
 		return ret;
drivers/staging/brcm80211/brcmfmac/dhd_common.c +29 -29

184 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_linux.c +20 -19
index da39948..0ab95b3 100644
@@ -417,7 +417,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 			DHD_TRACE(("%s: force extra Suspend setting\n",
 				   __func__));
 
-			dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM,
+			dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
 					 (char *)&power_mode,
 					 sizeof(power_mode));
 
@@ -437,7 +437,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 				bcn_li_dtim = dhd->dtim_skip;
 			brcmu_mkiovar("bcn_li_dtim", (char *)&bcn_li_dtim,
 				    4, iovbuf, sizeof(iovbuf));
-			dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+			dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
 					 sizeof(iovbuf));
 #ifdef CUSTOMER_HW2
 			/* Disable build-in roaming to allowed \
@@ -445,7 +445,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 			 */
 			brcmu_mkiovar("roam_off", (char *)&roamvar, 4,
 				    iovbuf, sizeof(iovbuf));
-			dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+			dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
 					 sizeof(iovbuf));
 #endif				/* CUSTOMER_HW2 */
 		} else {
@@ -455,7 +455,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 				   __func__));
 
 			power_mode = PM_FAST;
-			dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM,
+			dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
 					 (char *)&power_mode,
 					 sizeof(power_mode));
 
@@ -466,13 +466,13 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 			brcmu_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip,
 				    4, iovbuf, sizeof(iovbuf));
 
-			dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+			dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
 					 sizeof(iovbuf));
 #ifdef CUSTOMER_HW2
 			roamvar = 0;
 			brcmu_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf,
 				    sizeof(iovbuf));
-			dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+			dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
 					 sizeof(iovbuf));
 #endif				/* CUSTOMER_HW2 */
 		}
@@ -672,7 +672,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
 	}
 
 	memset(&ioc, 0, sizeof(ioc));
-	ioc.cmd = WLC_SET_VAR;
+	ioc.cmd = BRCMF_C_SET_VAR;
 	ioc.buf = buf;
 	ioc.len = buflen;
 	ioc.set = true;
@@ -710,7 +710,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
 	}
 
 	memset(&ioc, 0, sizeof(ioc));
-	ioc.cmd = WLC_SET_VAR;
+	ioc.cmd = BRCMF_C_SET_VAR;
 	ioc.buf = buf;
 	ioc.len = buflen;
 	ioc.set = true;
@@ -731,7 +731,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
 	allmulti = cpu_to_le32(allmulti);
 
 	memset(&ioc, 0, sizeof(ioc));
-	ioc.cmd = WLC_SET_PROMISC;
+	ioc.cmd = BRCMF_C_SET_PROMISC;
 	ioc.buf = &allmulti;
 	ioc.len = sizeof(allmulti);
 	ioc.set = true;
@@ -759,7 +759,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
 		return -1;
 	}
 	memset(&ioc, 0, sizeof(ioc));
-	ioc.cmd = WLC_SET_VAR;
+	ioc.cmd = BRCMF_C_SET_VAR;
 	ioc.buf = buf;
 	ioc.len = 32;
 	ioc.set = true;
@@ -1368,7 +1368,7 @@ static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
 
 	memset(&ioc, 0, sizeof(ioc));
 
-	ioc.cmd = WLC_GET_VAR;
+	ioc.cmd = BRCMF_C_GET_VAR;
 	ioc.buf = buf;
 	ioc.len = (uint) sizeof(buf);
 	ioc.set = false;
@@ -1402,7 +1402,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
 
 	memset(&ioc, 0, sizeof(ioc));
 
-	ioc.cmd = WLC_SET_VAR;
+	ioc.cmd = BRCMF_C_SET_VAR;
 	ioc.buf = buf;
 	ioc.len = (uint) sizeof(buf);
 	ioc.set = true;
@@ -1652,13 +1652,14 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
 		goto done;
 	}
 
-	/* Intercept WLC_SET_KEY IOCTL - serialize M4 send and set key IOCTL to
-	 * prevent M4 encryption.
+	/*
+	 * Intercept BRCMF_C_SET_KEY IOCTL - serialize M4 send and
+	 * set key IOCTL to prevent M4 encryption.
 	 */
-	is_set_key_cmd = ((ioc.cmd == WLC_SET_KEY) ||
-			  ((ioc.cmd == WLC_SET_VAR) &&
+	is_set_key_cmd = ((ioc.cmd == BRCMF_C_SET_KEY) ||
+			  ((ioc.cmd == BRCMF_C_SET_VAR) &&
 			   !(strncmp("wsec_key", ioc.buf, 9))) ||
-			  ((ioc.cmd == WLC_SET_VAR) &&
+			  ((ioc.cmd == BRCMF_C_SET_VAR) &&
 			   !(strncmp("bsscfg:wsec_key", ioc.buf, 15))));
 	if (is_set_key_cmd)
 		dhd_wait_pend8021x(net);
@@ -2023,7 +2024,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
 #ifdef EMBEDDED_PLATFORM
 	brcmu_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN,
 		      iovbuf, sizeof(iovbuf));
-	dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
+	dhdcdc_query_ioctl(dhdp, 0, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
 	memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
 
 	setbit(dhdp->eventmask, WLC_E_SET_SSID);
@@ -2076,7 +2077,7 @@ dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len,
 
 	memset(&ioc, 0, sizeof(ioc));
 
-	ioc.cmd = set ? WLC_SET_VAR : WLC_GET_VAR;
+	ioc.cmd = set ? BRCMF_C_SET_VAR : BRCMF_C_GET_VAR;
 	ioc.buf = buf;
 	ioc.len = len;
 	ioc.set = set;
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +61 -57

442 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +2 -2
index 80940bd..3b0c8ae 100644
@@ -108,7 +108,7 @@ do {								\
 #define WL_IOCTL_LEN_MAX	1024
 #define WL_EXTRA_BUF_MAX	2048
 #define WL_ISCAN_BUF_MAX	2048	/*
-				 * the buf lengh can be WLC_IOCTL_MAXLEN (8K)
+				 * the buf length can be BRCMF_C_IOCTL_MAXLEN
 				 * to reduce iteration
 				 */
 #define WL_ISCAN_TIMER_INTERVAL_MS	3000
@@ -276,7 +276,7 @@ struct wl_iscan_ctrl {
 	struct semaphore sync;
 	struct wl_iscan_eloop el;
 	void *data;
-	s8 ioctl_buf[WLC_IOCTL_SMLEN];
+	s8 ioctl_buf[BRCMF_C_IOCTL_SMLEN];
 	s8 scan_buf[WL_ISCAN_BUF_MAX];
 };
 
Signature · 1 line
1.7.1
author
#45 lore raw

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

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The header file dhd.h contained a number of macro definitions that are not used within the driver and have been removed.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h |   41 ------------------------------
 1 files changed, 0 insertions(+), 41 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -41
index 14713f5..9b27982 100644
@@ -119,47 +119,12 @@ struct dhd_info;
 #define WL_SCAN_RESULTS_ABORTED	3
 #define WL_SCAN_RESULTS_NO_MEM	4
 
-#define MAX_CCA_CHANNELS 38	/* Max number of 20 Mhz wide channels */
-#define MAX_CCA_SECS     60	/* CCA keeps this many seconds history */
-
-#define IBSS_MED        15	/* Mediom in-bss congestion percentage */
-#define IBSS_HI         25	/* Hi in-bss congestion percentage */
-#define OBSS_MED        12
-#define OBSS_HI         25
-#define INTERFER_MED    5
-#define INTERFER_HI     10
-
-#define  CCA_FLAG_2G_ONLY		0x01	/* Return a channel from 2.4 Ghz band */
-#define  CCA_FLAG_5G_ONLY		0x02	/* Return a channel from 2.4 Ghz band */
-#define  CCA_FLAG_IGNORE_DURATION	0x04	/* Ignore dwell time for each channel */
-#define  CCA_FLAGS_PREFER_1_6_11	0x10
-#define  CCA_FLAG_IGNORE_INTERFER	0x20	/* do not exlude channel based on interfer level */
-
-#define CCA_ERRNO_BAND		1	/* After filtering for band pref, no choices left */
-#define CCA_ERRNO_DURATION	2	/* After filtering for duration, no choices left */
-#define CCA_ERRNO_PREF_CHAN	3	/* After filtering for chan pref, no choices left */
-#define CCA_ERRNO_INTERFER	4	/* After filtering for interference, no choices left */
-#define CCA_ERRNO_TOO_FEW	5	/* Only 1 channel was input */
-
-#define WL_NUM_RPI_BINS		8
-#define WL_RM_TYPE_BASIC	1
-#define WL_RM_TYPE_CCA		2
-#define WL_RM_TYPE_RPI		3
-
-#define WL_RM_FLAG_PARALLEL	(1<<0)
-
-#define WL_RM_FLAG_LATE		(1<<1)
-#define WL_RM_FLAG_INCAPABLE	(1<<2)
-#define WL_RM_FLAG_REFUSED	(1<<3)
-
 #define WL_SOFT_KEY	(1 << 0)	/* Indicates this key is using soft encrypt */
 #define WL_PRIMARY_KEY	(1 << 1)	/* Indicates this key is the primary (ie tx) key */
 #define WL_KF_RES_4	(1 << 4)	/* Reserved for backward compat */
 #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 */
 
-#define DHD_IF_VIF	0x01	/* Virtual IF (Hidden from user) */
-
 /* optionally set by a module_param_string() */
 #define MOD_PARAM_PATHLEN	2048
 
@@ -171,7 +136,6 @@ struct dhd_info;
 #define DOT11_BSSTYPE_ANY			2
 #define DOT11_MAX_DEFAULT_KEYS	4
 
-#define BCM_EVENT_MSG_VERSION		1
 #define BCM_MSG_IFNAME_MAX		16
 
 #define WLC_EVENT_MSG_LINK		0x01
@@ -522,7 +486,6 @@ typedef struct wl_assoc_params {
 
 /* used for reassociation/roam to a specific BSSID and channel */
 typedef wl_assoc_params_t wl_reassoc_params_t;
-#define WL_REASSOC_PARAMS_FIXED_SIZE	WL_ASSOC_PARAMS_FIXED_SIZE
 
 /* used for join with or without a specific bssid and channel list */
 typedef struct wl_join_params {
@@ -531,7 +494,6 @@ typedef struct wl_join_params {
 					 * of the wl_assoc_params_t struct when it does present.
 					 */
 } wl_join_params_t;
-#define WL_JOIN_PARAMS_FIXED_SIZE	(sizeof(wl_join_params_t) - sizeof(chanspec_t))
 
 /* 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))
@@ -609,7 +571,6 @@ typedef struct wl_rm_req {
 	void *cb_arg;		/* arg to completion callback function */
 	wl_rm_req_elt_t req[1];	/* variable length block of requests */
 } wl_rm_req_t;
-#define WL_RM_REQ_FIXED_LEN	offsetof(wl_rm_req_t, req)
 
 typedef struct wl_rm_rep_elt {
 	s8 type;
@@ -622,7 +583,6 @@ typedef struct wl_rm_rep_elt {
 	u32 len;		/* byte length of data block */
 	u8 data[1];		/* variable length data block */
 } wl_rm_rep_elt_t;
-#define WL_RM_REP_ELT_FIXED_LEN	24	/* length excluding data block */
 
 #define WL_RPI_REP_BIN_NUM 8
 typedef struct wl_rm_rpi_rep {
@@ -635,7 +595,6 @@ typedef struct wl_rm_rep {
 	u32 len;		/* length of measurement report block */
 	wl_rm_rep_elt_t rep[1];	/* variable length block of reports */
 } wl_rm_rep_t;
-#define WL_RM_REP_FIXED_LEN	8
 
 typedef struct wl_wsec_key {
 	u32 index;		/* key index */
Signature · 1 line
1.7.1
author
#46 lore raw

PATCH 42/119 staging: brcm80211: replace macro BCM_MSG_IFNAME_MAX with IFNAMSIZ

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

In dhd.h the macro BCM_MSG_IFNAME_MAX was defined and used. As this is used to carry the interface name we might as well use IFNAMSIZ which results in the same size.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +1 -3
index 9b27982..55cbd8a 100644
@@ -136,8 +136,6 @@ struct dhd_info;
 #define DOT11_BSSTYPE_ANY			2
 #define DOT11_MAX_DEFAULT_KEYS	4
 
-#define BCM_MSG_IFNAME_MAX		16
-
 #define WLC_EVENT_MSG_LINK		0x01
 #define WLC_EVENT_MSG_FLUSHTXQ		0x02
 #define WLC_EVENT_MSG_GROUP		0x04
@@ -151,7 +149,7 @@ typedef struct {
 	u32 auth_type;
 	u32 datalen;
 	u8 addr[ETH_ALEN];
-	char ifname[BCM_MSG_IFNAME_MAX];
+	char ifname[IFNAMSIZ];
 } __attribute__((packed)) wl_event_msg_t;
 
 typedef  struct bcmeth_hdr {
Signature · 1 line
1.7.1
author
#47 lore raw

PATCH 43/119 staging: brcm80211: rename event handling definition

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Renaming fullmac to have more consistent naming throughout the driver. This commit renames identifiers related to firmware event handling.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |  326 +++++++++++-----------
 drivers/staging/brcm80211/brcmfmac/dhd_common.c  |  242 ++++++++--------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |   56 ++--
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |  111 ++++----
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |   10 +-
 5 files changed, 371 insertions(+), 374 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +161 -165
index 55cbd8a..1145e5b 100644
@@ -136,11 +136,11 @@ struct dhd_info;
 #define DOT11_BSSTYPE_ANY			2
 #define DOT11_MAX_DEFAULT_KEYS	4
 
-#define WLC_EVENT_MSG_LINK		0x01
-#define WLC_EVENT_MSG_FLUSHTXQ		0x02
-#define WLC_EVENT_MSG_GROUP		0x04
+#define BRCMF_EVENT_MSG_LINK		0x01
+#define BRCMF_EVENT_MSG_FLUSHTXQ	0x02
+#define BRCMF_EVENT_MSG_GROUP		0x04
 
-typedef struct {
+typedef struct brcmf_event_msg {
 	u16 version;
 	u16 flags;
 	u32 event_type;
@@ -150,173 +150,169 @@ typedef struct {
 	u32 datalen;
 	u8 addr[ETH_ALEN];
 	char ifname[IFNAMSIZ];
-} __attribute__((packed)) wl_event_msg_t;
+} __packed brcmf_event_msg_t;
 
-typedef  struct bcmeth_hdr {
+struct brcm_ethhdr {
 	u16 subtype;
 	u16 length;
 	u8 version;
 	u8 oui[3];
 	u16 usr_subtype;
-} __attribute__((packed)) bcmeth_hdr_t;
+} __packed;
 
-#ifdef BRCM_FULLMAC
-typedef struct bcm_event {
+typedef struct brcmf_event {
 	struct ethhdr eth;
-	bcmeth_hdr_t		bcm_hdr;
-	wl_event_msg_t		event;
-} __attribute__((packed)) bcm_event_t;
-#endif
-#define BCM_MSG_LEN	(sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - \
-	sizeof(struct ether_header))
-
-#define WLC_E_SET_SSID		0
-#define WLC_E_JOIN		1
-#define WLC_E_START		2
-#define WLC_E_AUTH		3
-#define WLC_E_AUTH_IND		4
-#define WLC_E_DEAUTH		5
-#define WLC_E_DEAUTH_IND	6
-#define WLC_E_ASSOC		7
-#define WLC_E_ASSOC_IND		8
-#define WLC_E_REASSOC		9
-#define WLC_E_REASSOC_IND	10
-#define WLC_E_DISASSOC		11
-#define WLC_E_DISASSOC_IND	12
-#define WLC_E_QUIET_START	13
-#define WLC_E_QUIET_END		14
-#define WLC_E_BEACON_RX		15
-#define WLC_E_LINK		16
-#define WLC_E_MIC_ERROR		17
-#define WLC_E_NDIS_LINK		18
-#define WLC_E_ROAM		19
-#define WLC_E_TXFAIL		20
-#define WLC_E_PMKID_CACHE	21
-#define WLC_E_RETROGRADE_TSF	22
-#define WLC_E_PRUNE		23
-#define WLC_E_AUTOAUTH		24
-#define WLC_E_EAPOL_MSG		25
-#define WLC_E_SCAN_COMPLETE	26
-#define WLC_E_ADDTS_IND		27
-#define WLC_E_DELTS_IND		28
-#define WLC_E_BCNSENT_IND	29
-#define WLC_E_BCNRX_MSG		30
-#define WLC_E_BCNLOST_MSG	31
-#define WLC_E_ROAM_PREP		32
-#define WLC_E_PFN_NET_FOUND	33
-#define WLC_E_PFN_NET_LOST	34
-#define WLC_E_RESET_COMPLETE	35
-#define WLC_E_JOIN_START	36
-#define WLC_E_ROAM_START	37
-#define WLC_E_ASSOC_START	38
-#define WLC_E_IBSS_ASSOC	39
-#define WLC_E_RADIO		40
-#define WLC_E_PSM_WATCHDOG	41
-#define WLC_E_PROBREQ_MSG       44
-#define WLC_E_SCAN_CONFIRM_IND  45
-#define WLC_E_PSK_SUP		46
-#define WLC_E_COUNTRY_CODE_CHANGED 47
-#define	WLC_E_EXCEEDED_MEDIUM_TIME 48
-#define WLC_E_ICV_ERROR		49
-#define WLC_E_UNICAST_DECODE_ERROR 50
-#define WLC_E_MULTICAST_DECODE_ERROR 51
-#define WLC_E_TRACE		52
-#define WLC_E_IF		54
-#define WLC_E_RSSI		56
-#define WLC_E_PFN_SCAN_COMPLETE	57
-#define WLC_E_EXTLOG_MSG	58
-#define WLC_E_ACTION_FRAME      59
-#define WLC_E_ACTION_FRAME_COMPLETE 60
-#define WLC_E_PRE_ASSOC_IND	61
-#define WLC_E_PRE_REASSOC_IND	62
-#define WLC_E_CHANNEL_ADOPTED	63
-#define WLC_E_AP_STARTED	64
-#define WLC_E_DFS_AP_STOP	65
-#define WLC_E_DFS_AP_RESUME	66
-#define WLC_E_RESERVED1		67
-#define WLC_E_RESERVED2		68
-#define WLC_E_ESCAN_RESULT	69
-#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE	70
-#define WLC_E_DCS_REQUEST 73
-
-#define WLC_E_FIFO_CREDIT_MAP	74
-
-#define WLC_E_LAST		75
-
-#define WLC_E_STATUS_SUCCESS		0
-#define WLC_E_STATUS_FAIL		1
-#define WLC_E_STATUS_TIMEOUT		2
-#define WLC_E_STATUS_NO_NETWORKS	3
-#define WLC_E_STATUS_ABORT		4
-#define WLC_E_STATUS_NO_ACK		5
-#define WLC_E_STATUS_UNSOLICITED	6
-#define WLC_E_STATUS_ATTEMPT		7
-#define WLC_E_STATUS_PARTIAL		8
-#define WLC_E_STATUS_NEWSCAN		9
-#define WLC_E_STATUS_NEWASSOC		10
-#define WLC_E_STATUS_11HQUIET		11
-#define WLC_E_STATUS_SUPPRESS		12
-#define WLC_E_STATUS_NOCHANS		13
-#define WLC_E_STATUS_CS_ABORT		15
-#define WLC_E_STATUS_ERROR		16
-
-#define WLC_E_REASON_INITIAL_ASSOC	0
-#define WLC_E_REASON_LOW_RSSI		1
-#define WLC_E_REASON_DEAUTH		2
-#define WLC_E_REASON_DISASSOC		3
-#define WLC_E_REASON_BCNS_LOST		4
-#define WLC_E_REASON_MINTXRATE		9
-#define WLC_E_REASON_TXFAIL		10
-
-#define WLC_E_REASON_FAST_ROAM_FAILED	5
-#define WLC_E_REASON_DIRECTED_ROAM	6
-#define WLC_E_REASON_TSPEC_REJECTED	7
-#define WLC_E_REASON_BETTER_AP		8
-
-#define WLC_E_PRUNE_ENCR_MISMATCH	1
-#define WLC_E_PRUNE_BCAST_BSSID		2
-#define WLC_E_PRUNE_MAC_DENY		3
-#define WLC_E_PRUNE_MAC_NA		4
-#define WLC_E_PRUNE_REG_PASSV		5
-#define WLC_E_PRUNE_SPCT_MGMT		6
-#define WLC_E_PRUNE_RADAR		7
-#define WLC_E_RSN_MISMATCH		8
-#define WLC_E_PRUNE_NO_COMMON_RATES	9
-#define WLC_E_PRUNE_BASIC_RATES		10
-#define WLC_E_PRUNE_CIPHER_NA		12
-#define WLC_E_PRUNE_KNOWN_STA		13
-#define WLC_E_PRUNE_WDS_PEER		15
-#define WLC_E_PRUNE_QBSS_LOAD		16
-#define WLC_E_PRUNE_HOME_AP		17
-
-#define WLC_E_SUP_OTHER			0
-#define WLC_E_SUP_DECRYPT_KEY_DATA	1
-#define WLC_E_SUP_BAD_UCAST_WEP128	2
-#define WLC_E_SUP_BAD_UCAST_WEP40	3
-#define WLC_E_SUP_UNSUP_KEY_LEN		4
-#define WLC_E_SUP_PW_KEY_CIPHER		5
-#define WLC_E_SUP_MSG3_TOO_MANY_IE	6
-#define WLC_E_SUP_MSG3_IE_MISMATCH	7
-#define WLC_E_SUP_NO_INSTALL_FLAG	8
-#define WLC_E_SUP_MSG3_NO_GTK		9
-#define WLC_E_SUP_GRP_KEY_CIPHER	10
-#define WLC_E_SUP_GRP_MSG1_NO_GTK	11
-#define WLC_E_SUP_GTK_DECRYPT_FAIL	12
-#define WLC_E_SUP_SEND_FAIL		13
-#define WLC_E_SUP_DEAUTH		14
-
-#define WLC_E_IF_ADD		1
-#define WLC_E_IF_DEL		2
-#define WLC_E_IF_CHANGE		3
-
-#define WLC_E_IF_ROLE_STA		0
-#define WLC_E_IF_ROLE_AP		1
-#define WLC_E_IF_ROLE_WDS		2
-
-#define WLC_E_LINK_BCN_LOSS	1
-#define WLC_E_LINK_DISASSOC	2
-#define WLC_E_LINK_ASSOC_REC	3
-#define WLC_E_LINK_BSSCFG_DIS	4
+	struct brcm_ethhdr hdr;
+	struct brcmf_event_msg msg;
+} __packed brcmf_event_t;
+
+#define BRCMF_E_SET_SSID			0
+#define BRCMF_E_JOIN				1
+#define BRCMF_E_START				2
+#define BRCMF_E_AUTH				3
+#define BRCMF_E_AUTH_IND			4
+#define BRCMF_E_DEAUTH				5
+#define BRCMF_E_DEAUTH_IND			6
+#define BRCMF_E_ASSOC				7
+#define BRCMF_E_ASSOC_IND			8
+#define BRCMF_E_REASSOC				9
+#define BRCMF_E_REASSOC_IND			10
+#define BRCMF_E_DISASSOC			11
+#define BRCMF_E_DISASSOC_IND			12
+#define BRCMF_E_QUIET_START			13
+#define BRCMF_E_QUIET_END			14
+#define BRCMF_E_BEACON_RX			15
+#define BRCMF_E_LINK				16
+#define BRCMF_E_MIC_ERROR			17
+#define BRCMF_E_NDIS_LINK			18
+#define BRCMF_E_ROAM				19
+#define BRCMF_E_TXFAIL				20
+#define BRCMF_E_PMKID_CACHE			21
+#define BRCMF_E_RETROGRADE_TSF			22
+#define BRCMF_E_PRUNE				23
+#define BRCMF_E_AUTOAUTH			24
+#define BRCMF_E_EAPOL_MSG			25
+#define BRCMF_E_SCAN_COMPLETE			26
+#define BRCMF_E_ADDTS_IND			27
+#define BRCMF_E_DELTS_IND			28
+#define BRCMF_E_BCNSENT_IND			29
+#define BRCMF_E_BCNRX_MSG			30
+#define BRCMF_E_BCNLOST_MSG			31
+#define BRCMF_E_ROAM_PREP			32
+#define BRCMF_E_PFN_NET_FOUND			33
+#define BRCMF_E_PFN_NET_LOST			34
+#define BRCMF_E_RESET_COMPLETE			35
+#define BRCMF_E_JOIN_START			36
+#define BRCMF_E_ROAM_START			37
+#define BRCMF_E_ASSOC_START			38
+#define BRCMF_E_IBSS_ASSOC			39
+#define BRCMF_E_RADIO				40
+#define BRCMF_E_PSM_WATCHDOG			41
+#define BRCMF_E_PROBREQ_MSG			44
+#define BRCMF_E_SCAN_CONFIRM_IND		45
+#define BRCMF_E_PSK_SUP				46
+#define BRCMF_E_COUNTRY_CODE_CHANGED		47
+#define	BRCMF_E_EXCEEDED_MEDIUM_TIME		48
+#define BRCMF_E_ICV_ERROR			49
+#define BRCMF_E_UNICAST_DECODE_ERROR		50
+#define BRCMF_E_MULTICAST_DECODE_ERROR		51
+#define BRCMF_E_TRACE				52
+#define BRCMF_E_IF				54
+#define BRCMF_E_RSSI				56
+#define BRCMF_E_PFN_SCAN_COMPLETE		57
+#define BRCMF_E_EXTLOG_MSG			58
+#define BRCMF_E_ACTION_FRAME			59
+#define BRCMF_E_ACTION_FRAME_COMPLETE		60
+#define BRCMF_E_PRE_ASSOC_IND			61
+#define BRCMF_E_PRE_REASSOC_IND			62
+#define BRCMF_E_CHANNEL_ADOPTED			63
+#define BRCMF_E_AP_STARTED			64
+#define BRCMF_E_DFS_AP_STOP			65
+#define BRCMF_E_DFS_AP_RESUME			66
+#define BRCMF_E_RESERVED1			67
+#define BRCMF_E_RESERVED2			68
+#define BRCMF_E_ESCAN_RESULT			69
+#define BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE	70
+#define BRCMF_E_DCS_REQUEST			73
+
+#define BRCMF_E_FIFO_CREDIT_MAP			74
+
+#define BRCMF_E_LAST				75
+
+#define BRCMF_E_STATUS_SUCCESS			0
+#define BRCMF_E_STATUS_FAIL			1
+#define BRCMF_E_STATUS_TIMEOUT			2
+#define BRCMF_E_STATUS_NO_NETWORKS		3
+#define BRCMF_E_STATUS_ABORT			4
+#define BRCMF_E_STATUS_NO_ACK			5
+#define BRCMF_E_STATUS_UNSOLICITED		6
+#define BRCMF_E_STATUS_ATTEMPT			7
+#define BRCMF_E_STATUS_PARTIAL			8
+#define BRCMF_E_STATUS_NEWSCAN			9
+#define BRCMF_E_STATUS_NEWASSOC			10
+#define BRCMF_E_STATUS_11HQUIET			11
+#define BRCMF_E_STATUS_SUPPRESS			12
+#define BRCMF_E_STATUS_NOCHANS			13
+#define BRCMF_E_STATUS_CS_ABORT			15
+#define BRCMF_E_STATUS_ERROR			16
+
+#define BRCMF_E_REASON_INITIAL_ASSOC		0
+#define BRCMF_E_REASON_LOW_RSSI			1
+#define BRCMF_E_REASON_DEAUTH			2
+#define BRCMF_E_REASON_DISASSOC			3
+#define BRCMF_E_REASON_BCNS_LOST		4
+#define BRCMF_E_REASON_MINTXRATE		9
+#define BRCMF_E_REASON_TXFAIL			10
+
+#define BRCMF_E_REASON_FAST_ROAM_FAILED		5
+#define BRCMF_E_REASON_DIRECTED_ROAM		6
+#define BRCMF_E_REASON_TSPEC_REJECTED		7
+#define BRCMF_E_REASON_BETTER_AP		8
+
+#define BRCMF_E_PRUNE_ENCR_MISMATCH		1
+#define BRCMF_E_PRUNE_BCAST_BSSID		2
+#define BRCMF_E_PRUNE_MAC_DENY			3
+#define BRCMF_E_PRUNE_MAC_NA			4
+#define BRCMF_E_PRUNE_REG_PASSV			5
+#define BRCMF_E_PRUNE_SPCT_MGMT			6
+#define BRCMF_E_PRUNE_RADAR			7
+#define BRCMF_E_RSN_MISMATCH			8
+#define BRCMF_E_PRUNE_NO_COMMON_RATES		9
+#define BRCMF_E_PRUNE_BASIC_RATES		10
+#define BRCMF_E_PRUNE_CIPHER_NA			12
+#define BRCMF_E_PRUNE_KNOWN_STA			13
+#define BRCMF_E_PRUNE_WDS_PEER			15
+#define BRCMF_E_PRUNE_QBSS_LOAD			16
+#define BRCMF_E_PRUNE_HOME_AP			17
+
+#define BRCMF_E_SUP_OTHER			0
+#define BRCMF_E_SUP_DECRYPT_KEY_DATA		1
+#define BRCMF_E_SUP_BAD_UCAST_WEP128		2
+#define BRCMF_E_SUP_BAD_UCAST_WEP40		3
+#define BRCMF_E_SUP_UNSUP_KEY_LEN		4
+#define BRCMF_E_SUP_PW_KEY_CIPHER		5
+#define BRCMF_E_SUP_MSG3_TOO_MANY_IE		6
+#define BRCMF_E_SUP_MSG3_IE_MISMATCH		7
+#define BRCMF_E_SUP_NO_INSTALL_FLAG		8
+#define BRCMF_E_SUP_MSG3_NO_GTK			9
+#define BRCMF_E_SUP_GRP_KEY_CIPHER		10
+#define BRCMF_E_SUP_GRP_MSG1_NO_GTK		11
+#define BRCMF_E_SUP_GTK_DECRYPT_FAIL		12
+#define BRCMF_E_SUP_SEND_FAIL			13
+#define BRCMF_E_SUP_DEAUTH			14
+
+#define BRCMF_E_IF_ADD				1
+#define BRCMF_E_IF_DEL				2
+#define BRCMF_E_IF_CHANGE			3
+
+#define BRCMF_E_IF_ROLE_STA			0
+#define BRCMF_E_IF_ROLE_AP			1
+#define BRCMF_E_IF_ROLE_WDS			2
+
+#define BRCMF_E_LINK_BCN_LOSS			1
+#define BRCMF_E_LINK_DISASSOC			2
+#define BRCMF_E_LINK_ASSOC_REC			3
+#define BRCMF_E_LINK_BSSCFG_DIS			4
 
 enum cust_gpio_modes {
 	WLAN_RESET_ON,
@@ -950,7 +946,7 @@ extern int dhd_timeout_expired(dhd_timeout_t *tmo);
 extern int dhd_ifname2idx(struct dhd_info *dhd, char *name);
 extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
 extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
-			 wl_event_msg_t *, void **data_ptr);
+			 brcmf_event_msg_t *, void **data_ptr);
 
 extern void brcmf_c_init(void);
 
@@ -969,7 +965,7 @@ extern void dhd_vif_sendup(struct dhd_info *dhd, int ifidx, unsigned char * cp,
 extern int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
 
 /* Send event to host */
-extern void dhd_sendup_event(dhd_pub_t *dhdp, wl_event_msg_t *event,
+extern void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event,
 			     void *data);
 extern int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag);
 extern uint dhd_bus_status(dhd_pub_t *dhdp);
drivers/staging/brcm80211/brcmfmac/dhd_common.c +121 -121

406 lines not on this page · raw message

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

113 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +56 -55

257 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +5 -5
index 3b0c8ae..77d0559 100644
@@ -188,9 +188,9 @@ struct wl_conf {
 
 /* cfg80211 main event loop */
 struct wl_event_loop {
-	s32(*handler[WLC_E_LAST]) (struct wl_priv *wl,
+	s32(*handler[BRCMF_E_LAST]) (struct wl_priv *wl,
 				     struct net_device *ndev,
-				     const wl_event_msg_t *e, void *data);
+				     const brcmf_event_msg_t *e, void *data);
 };
 
 /* representing interface of cfg80211 plane */
@@ -226,7 +226,7 @@ struct wl_ie {
 struct wl_event_q {
 	struct list_head eq_list;
 	u32 etype;
-	wl_event_msg_t emsg;
+	brcmf_event_msg_t emsg;
 	s8 edata[1];
 };
 
@@ -387,8 +387,8 @@ static inline struct wl_bss_info *next_bss(struct wl_scan_results *list,
 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 wl_event_msg_t *e,
-			      void *data);
+extern void wl_cfg80211_event(struct net_device *ndev,
+			      const brcmf_event_msg_t *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
#48 lore raw

PATCH 44/119 staging: brcm80211: rename module parameters

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Fullmac source is renamed to be consistent throughout the driver. This commit renames the modules parameters for module loading.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |   40 ++++++------
 drivers/staging/brcm80211/brcmfmac/dhd_common.c  |   23 ++++---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |   78 +++++++++++-----------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c    |   49 +++++++-------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |    2 +-
 5 files changed, 97 insertions(+), 95 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +20 -20
index 1145e5b..46381bb 100644
@@ -775,57 +775,57 @@ extern atomic_t dhd_mmc_suspend;
  */
 
 /* Watchdog timer interval */
-extern uint dhd_watchdog_ms;
+extern uint brcmf_watchdog_ms;
 
 #if defined(DHD_DEBUG)
 /* Console output poll interval */
-extern uint dhd_console_ms;
+extern uint brcmf_console_ms;
 #endif				/* defined(DHD_DEBUG) */
 
 /* Use interrupts */
-extern uint dhd_intr;
+extern uint brcmf_intr;
 
 /* Use polling */
-extern uint dhd_poll;
+extern uint brcmf_poll;
 
 /* ARP offload agent mode */
-extern uint dhd_arp_mode;
+extern uint brcmf_arp_mode;
 
 /* ARP offload enable */
-extern uint dhd_arp_enable;
+extern uint brcmf_arp_enable;
 
 /* Pkt filte enable control */
-extern uint dhd_pkt_filter_enable;
+extern uint brcmf_pkt_filter_enable;
 
 /*  Pkt filter init setup */
-extern uint dhd_pkt_filter_init;
+extern uint brcmf_pkt_filter_init;
 
 /* Pkt filter mode control */
-extern uint dhd_master_mode;
+extern uint brcmf_master_mode;
 
 /* Roaming mode control */
-extern uint dhd_roam;
+extern uint brcmf_roam;
 
 /* Roaming mode control */
-extern uint dhd_radio_up;
+extern uint brcmf_radio_up;
 
 /* Initial idletime ticks (may be -1 for immediate idle, 0 for no idle) */
-extern int dhd_idletime;
-#define DHD_IDLETIME_TICKS 1
+extern int brcmf_idletime;
+#define BRCMF_IDLETIME_TICKS 1
 
 /* SDIO Drive Strength */
-extern uint dhd_sdiod_drive_strength;
+extern uint brcmf_sdiod_drive_strength;
 
 /* Override to force tx queueing all the time */
-extern uint dhd_force_tx_queueing;
+extern uint brcmf_force_tx_queueing;
 
 #ifdef SDTEST
 /* Echo packet generator (SDIO), pkts/s */
-extern uint dhd_pktgen;
+extern uint brcmf_pktgen;
 
 /* Echo packet len (0 => sawtooth, max 1800) */
-extern uint dhd_pktgen_len;
-#define MAX_PKTGEN_LEN 1800
+extern uint brcmf_pktgen_len;
+#define BRCMF_MAX_PKTGEN_LEN 1800
 #endif
 
 extern char brcmf_fw_path[MOD_PARAM_PATHLEN];
@@ -1032,7 +1032,7 @@ typedef struct dhd_ioctl {
 
 #ifdef SDTEST
 /* For pktgen iovar */
-typedef struct dhd_pktgen {
+typedef 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 */
@@ -1045,7 +1045,7 @@ typedef struct dhd_pktgen {
 	uint numfail;		/* Count of test send failures */
 	uint mode;		/* Test mode (type of test packets) */
 	uint stop;		/* Stop after this many tx failures */
-} dhd_pktgen_t;
+} brcmf_pktgen_t;
 
 /* Version in case structure changes */
 #define DHD_PKTGEN_VERSION 2
drivers/staging/brcm80211/brcmfmac/dhd_common.c +12 -11
index b06d7e0..9d604a6 100644
@@ -253,7 +253,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 		break;
 
 	case IOV_GVAL(IOV_WDTICK):
-		int_val = (s32) dhd_watchdog_ms;
+		int_val = (s32) brcmf_watchdog_ms;
 		memcpy(arg, &int_val, val_size);
 		break;
 
@@ -271,12 +271,12 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 
 #ifdef DHD_DEBUG
 	case IOV_GVAL(IOV_DCONSOLE_POLL):
-		int_val = (s32) dhd_console_ms;
+		int_val = (s32) brcmf_console_ms;
 		memcpy(arg, &int_val, val_size);
 		break;
 
 	case IOV_SVAL(IOV_DCONSOLE_POLL):
-		dhd_console_ms = (uint) int_val;
+		brcmf_console_ms = (uint) int_val;
 		break;
 
 	case IOV_SVAL(IOV_CONS):
@@ -1271,11 +1271,12 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 
 	/* Enable/Disable build-in roaming to allowed ext supplicant to take
 		 of romaing */
-	brcmu_mkiovar("roam_off", (char *)&dhd_roam, 4, iovbuf, sizeof(iovbuf));
+	brcmu_mkiovar("roam_off", (char *)&brcmf_roam, 4,
+		      iovbuf, sizeof(iovbuf));
 	dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
 
 	/* Force STA UP */
-	if (dhd_radio_up)
+	if (brcmf_radio_up)
 		dhdcdc_set_ioctl(dhd, 0, BRCMF_C_UP, (char *)&up, sizeof(up));
 
 	/* Setup event_msgs */
@@ -1290,23 +1291,23 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 
 #ifdef ARP_OFFLOAD_SUPPORT
 	/* Set and enable ARP offload feature */
-	if (dhd_arp_enable)
-		brcmf_c_arp_offload_set(dhd, dhd_arp_mode);
-	brcmf_c_arp_offload_enable(dhd, dhd_arp_enable);
+	if (brcmf_arp_enable)
+		brcmf_c_arp_offload_set(dhd, brcmf_arp_mode);
+	brcmf_c_arp_offload_enable(dhd, brcmf_arp_enable);
 #endif				/* ARP_OFFLOAD_SUPPORT */
 
 #ifdef PKT_FILTER_SUPPORT
 	{
 		int i;
 		/* Set up pkt filter */
-		if (dhd_pkt_filter_enable) {
+		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],
-				     dhd_pkt_filter_init,
-				     dhd_master_mode);
+				     brcmf_pkt_filter_init,
+				     brcmf_master_mode);
 			}
 		}
 	}
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +39 -39

182 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +25 -24

143 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +1 -1
index b30ae73..dd47451 100644
@@ -2101,7 +2101,7 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
 
 	if (test_bit(WL_STATUS_READY, &wl->status)) {
 		/* Turn on Watchdog timer */
-		wl_os_wd_timer(ndev, dhd_watchdog_ms);
+		wl_os_wd_timer(ndev, brcmf_watchdog_ms);
 		wl_invoke_iscan(wiphy_to_wl(wiphy));
 	}
 
Signature · 1 line
1.7.1
author
#49 lore raw

PATCH 45/119 staging: brcm80211: remove unnecessary abstraction for scheduler

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The source dhd_linux_sched.c provided function setScheduler, but it simply calls sched_setscheduler() linux function. The setScheduler() function has been removed.

---
 drivers/staging/brcm80211/brcmfmac/Makefile        |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd.h           |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |    4 +-
 .../staging/brcm80211/brcmfmac/dhd_linux_sched.c   |   25 --------------------
 4 files changed, 2 insertions(+), 30 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index d907cae..4963155 100644
@@ -45,7 +45,6 @@ DHDOFILES = \
 	dhd_custom_gpio.o \
 	dhd_sdio.o	\
 	dhd_linux.o \
-	dhd_linux_sched.o \
 	bcmsdh.o \
 	bcmsdh_linux.o	\
 	bcmsdh_sdmmc.o \
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
index 46381bb..bccda7f 100644
@@ -938,8 +938,6 @@ extern int write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
 extern int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr);
 #endif				/* defined(OOB_INTR_ONLY) */
 
-int setScheduler(struct task_struct *p, int policy, struct sched_param *param);
-
 extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec);
 extern int dhd_timeout_expired(dhd_timeout_t *tmo);
 
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +2 -2
index 2d4e2c7..bebdd4d 100644
@@ -1244,7 +1244,7 @@ static int dhd_watchdog_thread(void *data)
 		struct sched_param param;
 		param.sched_priority = (dhd_watchdog_prio < MAX_RT_PRIO) ?
 		    dhd_watchdog_prio : (MAX_RT_PRIO - 1);
-		setScheduler(current, SCHED_FIFO, &param);
+		sched_setscheduler(current, SCHED_FIFO, &param);
 	}
 #endif				/* DHD_SCHED */
 
@@ -1305,7 +1305,7 @@ static int dhd_dpc_thread(void *data)
 		param.sched_priority =
 		    (dhd_dpc_prio <
 		     MAX_RT_PRIO) ? dhd_dpc_prio : (MAX_RT_PRIO - 1);
-		setScheduler(current, SCHED_FIFO, &param);
+		sched_setscheduler(current, SCHED_FIFO, &param);
 	}
 #endif				/* DHD_SCHED */
 
drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c deleted +0 -25
deleted file mode 100644
index c66f1c2..0000000
@@ -1,25 +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.
- */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-
-int setScheduler(struct task_struct *p, int policy, struct sched_param *param)
-{
-	int rc = 0;
-	rc = sched_setscheduler(p, policy, param);
-	return rc;
-}
Signature · 1 line
1.7.1
author
#50 lore raw

PATCH 46/119 staging: brcm80211: rename fullmac functions

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The function provided by dhd_linux.c have been renamed to make the naming throughout the driver more consistent and remove Broadcom specific acronyms which are not meaningful.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd.h           |   88 ++++++------
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c       |   20 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_common.c    |   24 ++--
 .../staging/brcm80211/brcmfmac/dhd_custom_gpio.c   |    6 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |  142 ++++++++++----------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |  132 +++++++++---------
 7 files changed, 209 insertions(+), 205 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +1 -1
index 8007e90..3fabc08 100644
@@ -169,7 +169,7 @@ int brcmf_sdio_probe(struct device *dev)
 #else
 	irq_flags = IRQF_TRIGGER_FALLING;
 #endif				/* HW_OOB */
-	irq = dhd_customer_oob_irq_map(&irq_flags);
+	irq = brcmf_customer_oob_irq_map(&irq_flags);
 	if (irq < 0) {
 		SDLX_MSG(("%s: Host irq is not defined\n", __func__));
 		return 1;
drivers/staging/brcm80211/brcmfmac/dhd.h +45 -43

141 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +11 -9
index 0ed62a0..b229e05 100644
@@ -204,7 +204,8 @@ retry:
 		goto retry;
 	if (id != prot->reqid) {
 		DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
-			   dhd_ifname(dhd, ifidx), __func__, id, prot->reqid));
+			   brcmf_ifname(dhd, ifidx), __func__, id,
+			   prot->reqid));
 		ret = -EINVAL;
 		goto done;
 	}
@@ -264,7 +265,8 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
 
 	if (id != prot->reqid) {
 		DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
-			   dhd_ifname(dhd, ifidx), __func__, id, prot->reqid));
+			   brcmf_ifname(dhd, ifidx), __func__, id,
+			   prot->reqid));
 		ret = -EINVAL;
 		goto done;
 	}
@@ -292,7 +294,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
 			   __func__));
 		return ret;
 	}
-	dhd_os_proto_block(dhd);
+	brcmf_os_proto_block(dhd);
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -346,7 +348,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
 	prot->pending = false;
 
 done:
-	dhd_os_proto_unblock(dhd);
+	brcmf_os_proto_unblock(dhd);
 
 	return ret;
 }
@@ -427,14 +429,14 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
 	if (((h->flags & BDC_FLAG_VER_MASK) >> BDC_FLAG_VER_SHIFT) !=
 	    BDC_PROTO_VER) {
 		DHD_ERROR(("%s: non-BDC packet received, flags 0x%x\n",
-			   dhd_ifname(dhd, *ifidx), h->flags));
+			   brcmf_ifname(dhd, *ifidx), h->flags));
 		return -EBADE;
 	}
 
 	if (h->flags & BDC_FLAG_SUM_GOOD) {
 		DHD_INFO(("%s: BDC packet received with good rx-csum, "
 			"flags 0x%x\n",
-			dhd_ifname(dhd, *ifidx), h->flags));
+			brcmf_ifname(dhd, *ifidx), h->flags));
 		PKTSETSUMGOOD(pktbuf, true);
 	}
 
@@ -501,18 +503,18 @@ int dhd_prot_init(dhd_pub_t *dhd)
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
-	dhd_os_proto_block(dhd);
+	brcmf_os_proto_block(dhd);
 
 	/* Get the device MAC address */
 	strcpy(buf, "cur_etheraddr");
 	ret = dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
 	if (ret < 0) {
-		dhd_os_proto_unblock(dhd);
+		brcmf_os_proto_unblock(dhd);
 		return ret;
 	}
 	memcpy(dhd->mac, buf, ETH_ALEN);
 
-	dhd_os_proto_unblock(dhd);
+	brcmf_os_proto_unblock(dhd);
 
 #ifdef EMBEDDED_PLATFORM
 	ret = brcmf_c_preinit_ioctls(dhd);
drivers/staging/brcm80211/brcmfmac/dhd_common.c +12 -12
index 9d604a6..e4680fb 100644
@@ -262,7 +262,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 			bcmerror = -ENOLINK;
 			break;
 		}
-		dhd_os_wd_timer(dhd_pub, (uint) int_val);
+		brcmf_os_wd_timer(dhd_pub, (uint) int_val);
 		break;
 
 	case IOV_GVAL(IOV_DUMP):
@@ -300,7 +300,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 		break;
 
 	case IOV_GVAL(IOV_IOCTLTIMEOUT):{
-			int_val = (s32) dhd_os_get_ioctl_resp_timeout();
+			int_val = (s32) brcmf_os_get_ioctl_resp_timeout();
 			memcpy(arg, &int_val, sizeof(int_val));
 			break;
 		}
@@ -309,7 +309,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
 			if (int_val <= 0)
 				bcmerror = -EINVAL;
 			else
-				dhd_os_set_ioctl_resp_timeout((unsigned int)
+				brcmf_os_set_ioctl_resp_timeout((unsigned int)
 							      int_val);
 			break;
 		}
@@ -865,13 +865,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)
-					dhd_add_if(dhd, ifevent->ifidx,
+					brcmf_add_if(dhd, ifevent->ifidx,
 						   NULL, event->ifname,
 						   pvt_data->eth.h_dest,
 						   ifevent->flags,
 						   ifevent->bssidx);
 				else
-					dhd_del_if(dhd, ifevent->ifidx);
+					brcmf_del_if(dhd, ifevent->ifidx);
 			} else {
 				DHD_ERROR(("%s: Invalid ifidx %d for %s\n",
 					   __func__, ifevent->ifidx,
@@ -879,9 +879,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
 			}
 		}
 		/* send up the if event: btamp user needs it */
-		*ifidx = dhd_ifname2idx(dhd, event->ifname);
+		*ifidx = brcmf_ifname2idx(dhd, event->ifname);
 		/* push up to external supp/auth */
-		dhd_event(dhd, (char *)pvt_data, evlen, *ifidx);
+		brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
 		break;
 
 #ifdef P2P
@@ -898,9 +898,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
 	default:
 		/* Fall through: this should get _everything_  */
 
-		*ifidx = dhd_ifname2idx(dhd, event->ifname);
+		*ifidx = brcmf_ifname2idx(dhd, event->ifname);
 		/* push up to external supp/auth */
-		dhd_event(dhd, (char *)pvt_data, evlen, *ifidx);
+		brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
 		DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
 			   __func__, type, flags, status));
 
@@ -1207,7 +1207,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	u8 ea_addr[ETH_ALEN];
 #endif				/* GET_CUSTOM_MAC_ENABLE */
 
-	dhd_os_proto_block(dhd);
+	brcmf_os_proto_block(dhd);
 
 #ifdef GET_CUSTOM_MAC_ENABLE
 	/* Read MAC address from external customer place
@@ -1216,7 +1216,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	 ** firmware but unique per board mac address maybe provided by
 	 ** customer code
 	 */
-	ret = dhd_custom_get_mac_address(ea_addr);
+	ret = brcmf_custom_get_mac_address(ea_addr);
 	if (!ret) {
 		brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
 			    buf, sizeof(buf));
@@ -1313,7 +1313,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	}
 #endif				/* PKT_FILTER_SUPPORT */
 
-	dhd_os_proto_unblock(dhd);
+	brcmf_os_proto_unblock(dhd);
 
 	return 0;
 }
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +3 -3
index defc009..a60caea 100644
@@ -52,7 +52,7 @@ static int dhd_oob_gpio_num = -1;	/* GG 19 */
 module_param(dhd_oob_gpio_num, int, 0644);
 MODULE_PARM_DESC(dhd_oob_gpio_num, "DHD oob gpio number");
 
-int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
+int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr)
 {
 	int host_oob_irq = 0;
 
@@ -88,7 +88,7 @@ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
 #endif				/* defined(OOB_INTR_ONLY) */
 
 /* Customer function to control hw specific wlan gpios */
-void dhd_customer_gpio_wlan_ctrl(int onoff)
+void brcmf_customer_gpio_wlan_ctrl(int onoff)
 {
 	switch (onoff) {
 	case WLAN_RESET_OFF:
@@ -137,7 +137,7 @@ void dhd_customer_gpio_wlan_ctrl(int onoff)
 
 #ifdef GET_CUSTOM_MAC_ENABLE
 /* Function to get custom MAC address */
-int dhd_custom_get_mac_address(unsigned char *buf)
+int brcmf_custom_get_mac_address(unsigned char *buf)
 {
 	WL_TRACE("%s Enter\n", __func__);
 	if (!buf)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +71 -71

514 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +66 -66

462 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#51 lore raw

PATCH 47/119 staging: brcm80211: remove unused prototypes from dhd.h

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

A couple of prototypes are not defined or not used and have been removed from the driver.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h       |    5 -----
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |    9 ---------
 2 files changed, 0 insertions(+), 14 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -5
index d19d091..3f1b757 100644
@@ -943,7 +943,6 @@ extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
 extern int brcmf_timeout_expired(dhd_timeout_t *tmo);
 
 extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name);
-extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
 extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
 			 brcmf_event_msg_t *, void **data_ptr);
 
@@ -964,11 +963,7 @@ extern void brcmf_vif_sendup(struct dhd_info *dhd, int ifidx,
 /* Send packet to dongle via data channel */
 extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
 
-/* Send event to host */
-extern void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event,
-			     void *data);
 extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
-extern uint dhd_bus_status(dhd_pub_t *dhdp);
 extern int brcmf_bus_start(dhd_pub_t *dhdp);
 
 extern void brcmf_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -9
index 928220c..f326071 100644
@@ -2519,15 +2519,6 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 	return bcmerror;
 }
 
-/* send up locally generated event */
-void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event, void *data)
-{
-	switch (be32_to_cpu(event->event_type)) {
-	default:
-		break;
-	}
-}
-
 void brcmf_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
 {
 	struct dhd_info *dhdinfo = dhd->info;
Signature · 1 line
1.7.1
author
#52 lore raw

PATCH 48/119 staging: brcm80211: removed BDC defines

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. BDC (Broadcom Device Class) protocol extension is used on top of the USB related CDC (Communication Device Class) definition. BDC is always used, so the #ifdefs were redundant.

---
 drivers/staging/brcm80211/brcmfmac/Makefile    |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c   |   10 ----------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |    3 ---
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h |   13 -------------
 4 files changed, 0 insertions(+), 27 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index 4963155..9fa689b 100644
@@ -20,7 +20,6 @@ ccflags-y :=			\
 	-DBCMLXSDMMC		\
 	-DBCMPLATFORM_BUS	\
 	-DBCMSDIO		\
-	-DBDC			\
 	-DBRCM_FULLMAC		\
 	-DDHD_FIRSTREAD=64	\
 	-DDHD_SCHED		\
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +0 -10
index b229e05..156abd6 100644
@@ -376,13 +376,10 @@ void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
 
 void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
 {
-#ifdef BDC
 	struct bdc_header *h;
-#endif				/* BDC */
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
-#ifdef BDC
 	/* Push BDC header used to convey priority for buses that don't */
 
 	skb_push(pktbuf, BDC_HEADER_LEN);
@@ -396,19 +393,15 @@ void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
 	h->priority = (pktbuf->priority & BDC_PRIORITY_MASK);
 	h->flags2 = 0;
 	h->rssi = 0;
-#endif				/* BDC */
 	BDC_SET_IF_IDX(h, ifidx);
 }
 
 int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
 {
-#ifdef BDC
 	struct bdc_header *h;
-#endif
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
-#ifdef BDC
 	/* Pop BDC header used to convey priority for buses that don't */
 
 	if (pktbuf->len < BDC_HEADER_LEN) {
@@ -443,7 +436,6 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
 	pktbuf->priority = h->priority & BDC_PRIORITY_MASK;
 
 	skb_pull(pktbuf, BDC_HEADER_LEN);
-#endif				/* BDC */
 
 	return 0;
 }
@@ -465,9 +457,7 @@ int dhd_prot_attach(dhd_pub_t *dhd)
 	}
 
 	dhd->prot = cdc;
-#ifdef BDC
 	dhd->hdrlen += BDC_HEADER_LEN;
-#endif
 	dhd->maxctl = BRCMF_C_IOCTL_MAXLEN +
 				sizeof(struct cdc_ioctl) + ROUND_UP_MARGIN;
 	return 0;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -3
index f326071..f90a0be 100644
@@ -368,9 +368,6 @@ static void dhd_dpc(unsigned long data);
 extern int dhd_wait_pend8021x(struct net_device *dev);
 
 #ifdef TOE
-#ifndef BDC
-#error TOE requires BDC
-#endif				/* !BDC */
 static int dhd_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
 static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
 #endif				/* TOE */
drivers/staging/brcm80211/brcmfmac/dhd_proto.h +0 -13
index fccd3dd..b2ab3ea 100644
@@ -76,17 +76,4 @@ extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
 			    uint len);
 #endif		/* defined(CONFIG_HAS_EARLYSUSPEND) */
 
-/********************************
- * For version-string expansion *
- */
-#if defined(BDC)
-#define DHD_PROTOCOL "bdc"
-#elif defined(CDC)
-#define DHD_PROTOCOL "cdc"
-#elif defined(RNDIS)
-#define DHD_PROTOCOL "rndis"
-#else
-#define DHD_PROTOCOL "unknown"
-#endif				/* proto */
-
 #endif				/* _dhd_proto_h_ */
Signature · 1 line
1.7.1
author
#53 lore raw

PATCH 49/119 staging: brcm80211: rename fullmac protocol related functions

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The fullmac functions for firmware communication protocol handling have been renamed to make naming more consistent.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |    4 +-
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c    |   49 ++++++++-------
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |   75 +++++++++++++----------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |   56 +++++++++--------
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h  |   26 ++++----
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |    8 +--
 6 files changed, 115 insertions(+), 103 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +2 -2
index 3f1b757..2cde233 100644
@@ -909,8 +909,8 @@ extern void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp,
 			     bool success);
 
 /* Query ioctl */
-extern int dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
-			      uint len);
+extern int brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+				       void *buf, uint len);
 
 /* OS independent layer functions */
 extern int brcmf_os_proto_block(dhd_pub_t *pub);
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +27 -22

169 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_common.c +42 -33

203 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_linux.c +29 -27

192 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_proto.h +12 -14
index b2ab3ea..f8ca781 100644
@@ -30,50 +30,48 @@
  */
 
 /* Linkage, sets prot link and updates hdrlen in pub */
-extern int dhd_prot_attach(dhd_pub_t *dhdp);
+extern int brcmf_proto_attach(dhd_pub_t *dhdp);
 
 /* Unlink, frees allocated protocol memory (including dhd_prot) */
-extern void dhd_prot_detach(dhd_pub_t *dhdp);
+extern void brcmf_proto_detach(dhd_pub_t *dhdp);
 
 /* Initialize protocol: sync w/dongle state.
  * Sets dongle media info (iswl, drv_version, mac address).
  */
-extern int dhd_prot_init(dhd_pub_t *dhdp);
+extern int brcmf_proto_init(dhd_pub_t *dhdp);
 
 /* Stop protocol: sync w/dongle state. */
-extern void dhd_prot_stop(dhd_pub_t *dhdp);
+extern void brcmf_proto_stop(dhd_pub_t *dhdp);
 
 /* Add any protocol-specific data header.
  * Caller must reserve prot_hdrlen prepend space.
  */
-extern void dhd_prot_hdrpush(dhd_pub_t *, int ifidx, struct sk_buff *txp);
+extern void brcmf_proto_hdrpush(dhd_pub_t *, int ifidx, struct sk_buff *txp);
 
 /* Remove any protocol-specific data header. */
-extern int dhd_prot_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
+extern int brcmf_proto_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
 
 /* Use protocol to issue ioctl to dongle */
-extern int dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc,
+extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc,
 			  void *buf, int len);
 
 /* Check for and handle local prot-specific iovar commands */
-extern int dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
+extern int brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
 			     void *params, int plen, void *arg, int len,
 			     bool set);
 
 /* Add prot dump output to a buffer */
-extern void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
+extern void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
 
 /* Update local copy of dongle statistics */
-extern void dhd_prot_dstats(dhd_pub_t *dhdp);
+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_preinit_ioctls(dhd_pub_t *dhd);
 
-#if defined(CONFIG_HAS_EARLYSUSPEND)
-extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
-			    uint len);
-#endif		/* defined(CONFIG_HAS_EARLYSUSPEND) */
+extern int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+				     void *buf, uint len);
 
 #endif				/* _dhd_proto_h_ */
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +3 -5
index cb389ae..905afbc 100644
@@ -408,8 +408,6 @@ typedef struct {
 	((prio^2)) : (prio))
 
 DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
-extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
-			    uint len);
 
 /* Core reg address translation */
 #define CORE_CC_REG(base, field)	(base + offsetof(chipcregs_t, field))
@@ -3723,8 +3721,8 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
 					save_pfirst = pnext;
 				}
 				continue;
-			} else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pfirst) !=
-				   0) {
+			} else if (brcmf_proto_hdrpull(bus->dhd, &ifidx, pfirst)
+					!= 0) {
 				DHD_ERROR(("%s: rx protocol error\n",
 					   __func__));
 				bus->dhd->rx_errors++;
@@ -4336,7 +4334,7 @@ deliver:
 		if (pkt->len == 0) {
 			brcmu_pkt_buf_free_skb(pkt);
 			continue;
-		} else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
+		} else if (brcmf_proto_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
 			DHD_ERROR(("%s: rx protocol error\n", __func__));
 			brcmu_pkt_buf_free_skb(pkt);
 			bus->dhd->rx_errors++;
Signature · 1 line
1.7.1
author
#54 lore raw

PATCH 50/119 staging: brcm80211: get rid of PKT[TO/FROM]NATIVE macros

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

These macros are not needed in a linux-only driver and have been removed.

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   42 +++--------------------
 1 files changed, 6 insertions(+), 36 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +6 -36
index 006b642..a3b60da 100644
@@ -990,26 +990,9 @@ int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
 	return ret;
 }
 
-static inline void *
-osl_pkt_frmnative(struct sk_buff *skb)
-{
-	return (void *)skb;
-}
-#define PKTFRMNATIVE(osh, skb)	\
-	osl_pkt_frmnative((struct sk_buff *)(skb))
-
-static inline struct sk_buff *
-osl_pkt_tonative(void *pkt)
-{
-	return (struct sk_buff *)pkt;
-}
-#define PKTTONATIVE(osh, pkt)	\
-	osl_pkt_tonative((pkt))
-
 static int dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
 {
 	int ret;
-	void *pktbuf;
 	dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
 	int ifidx;
 
@@ -1048,17 +1031,7 @@ static int dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
 		}
 	}
 
-	/* Convert to packet */
-	pktbuf = PKTFRMNATIVE(dhd->pub.osh, skb);
-	if (!pktbuf) {
-		DHD_ERROR(("%s: PKTFRMNATIVE failed\n",
-			   brcmf_ifname(&dhd->pub, ifidx)));
-		dev_kfree_skb_any(skb);
-		ret = -ENOMEM;
-		goto done;
-	}
-
-	ret = brcmf_sendpkt(&dhd->pub, ifidx, pktbuf);
+	ret = brcmf_sendpkt(&dhd->pub, ifidx, skb);
 
 done:
 	if (ret)
@@ -1086,11 +1059,10 @@ void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool state)
 		netif_wake_queue(net);
 }
 
-void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
+void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
 		  int numpkt)
 {
 	dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
-	struct sk_buff *skb;
 	unsigned char *eth;
 	uint len;
 	void *data;
@@ -1101,14 +1073,12 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
-	save_pktbuf = pktbuf;
-
-	for (i = 0; pktbuf && i < numpkt; i++, pktbuf = pnext) {
+	save_pktbuf = skb;
 
-		pnext = pktbuf->next;
-		pktbuf->next = NULL;
+	for (i = 0; skb && i < numpkt; i++, skb = pnext) {
 
-		skb = PKTTONATIVE(dhdp->osh, pktbuf);
+		pnext = skb->next;
+		skb->next = NULL;
 
 		/* Get the protocol, maintain skb around eth_type_trans()
 		 * The main reason for this hack is for the limitation of
Signature · 1 line
1.7.1
author
#55 lore raw

PATCH 51/119 staging: brcm80211: rename dhd_prot and get rid of dhd_prot_t typedef

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The structure dhd_prot has been renamed to brcmf_proto to align with fullmac naming convention and removed structure typedef dhd_prot_t.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h     |   16 ++++----
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c |   55 +++++++++++++-------------
 2 files changed, 36 insertions(+), 35 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +8 -8
index 2cde233..8736e6f 100644
@@ -21,11 +21,6 @@
 #ifndef _dhd_h_
 #define _dhd_h_
 
-/* Forward decls */
-struct dhd_bus;
-struct dhd_prot;
-struct dhd_info;
-
 #define	BRCMF_C_IOCTL_SMLEN	256	/* "small" ioctl buffer required */
 #define BRCMF_C_IOCTL_MEDLEN	1536	/* "med" ioctl buffer required */
 #define	BRCMF_C_IOCTL_MAXLEN	8192
@@ -633,12 +628,17 @@ typedef struct wl_ioctl {
 	uint needed;		/* bytes needed (optional) */
 } wl_ioctl_t;
 
+/* 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 */
+
 /* Common structure for module and instance linkage */
 typedef struct dhd_pub {
 	/* Linkage ponters */
-	struct dhd_bus *bus;	/* Bus module handle */
-	struct dhd_prot *prot;	/* Protocol module handle */
-	struct dhd_info *info;	/* Info module handle */
+	struct dhd_bus *bus;
+	struct brcmf_proto *prot;
+	struct dhd_info *info;
 
 	/* Internal dhd items */
 	bool up;		/* Driver up/down (to OS) */
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +28 -27

177 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#56 lore raw

PATCH 52/119 staging: brcm80211: remove conditional SIMPLE_ISCAN code

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Code between #ifdef SIMPLE_ISCAN is not enabled and unnecessary. It has been removed from the fullmac driver.

---
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |  391 -----------------------
 1 files changed, 0 insertions(+), 391 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -391
index 70d2591..a255d3d 100644
@@ -35,11 +35,6 @@ int brcmf_msg_level;
 char brcmf_fw_path[MOD_PARAM_PATHLEN];
 char brcmf_nv_path[MOD_PARAM_PATHLEN];
 
-extern void dhd_ind_scan_confirm(void *h, bool status);
-extern int dhd_wl_ioctl(dhd_pub_t *dhd, uint cmd, char *buf, uint buflen);
-void dhd_iscan_lock(void);
-void dhd_iscan_unlock(void);
-
 /* Packet alignment for most efficient SDIO (can change based on platform) */
 #ifndef DHD_SDALIGN
 #define DHD_SDALIGN	32
@@ -1325,392 +1320,6 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	return 0;
 }
 
-#ifdef SIMPLE_ISCAN
-uint iscan_thread_id;
-iscan_buf_t *iscan_chain;
-
-iscan_buf_t *dhd_iscan_allocate_buf(dhd_pub_t *dhd, iscan_buf_t **iscanbuf)
-{
-	iscan_buf_t *iscanbuf_alloc = 0;
-	iscan_buf_t *iscanbuf_head;
-
-	dhd_iscan_lock();
-
-	iscanbuf_alloc = kmalloc(sizeof(iscan_buf_t), GFP_ATOMIC);
-	if (iscanbuf_alloc == NULL)
-		goto fail;
-
-	iscanbuf_alloc->next = NULL;
-	iscanbuf_head = *iscanbuf;
-
-	DHD_ISCAN(("%s: addr of allocated node = 0x%X"
-		   "addr of iscanbuf_head = 0x%X dhd = 0x%X\n",
-		   __func__, iscanbuf_alloc, iscanbuf_head, dhd));
-
-	if (iscanbuf_head == NULL) {
-		*iscanbuf = iscanbuf_alloc;
-		DHD_ISCAN(("%s: Head is allocated\n", __func__));
-		goto fail;
-	}
-
-	while (iscanbuf_head->next)
-		iscanbuf_head = iscanbuf_head->next;
-
-	iscanbuf_head->next = iscanbuf_alloc;
-
-fail:
-	dhd_iscan_unlock();
-	return iscanbuf_alloc;
-}
-
-void dhd_iscan_free_buf(void *dhdp, iscan_buf_t *iscan_delete)
-{
-	iscan_buf_t *iscanbuf_free = 0;
-	iscan_buf_t *iscanbuf_prv = 0;
-	iscan_buf_t *iscanbuf_cur = iscan_chain;
-	dhd_pub_t *dhd = dhd_bus_pub(dhdp);
-
-	dhd_iscan_lock();
-	/* If iscan_delete is null then delete the entire
-	 * chain or else delete specific one provided
-	 */
-	if (!iscan_delete) {
-		while (iscanbuf_cur) {
-			iscanbuf_free = iscanbuf_cur;
-			iscanbuf_cur = iscanbuf_cur->next;
-			iscanbuf_free->next = 0;
-			kfree(iscanbuf_free);
-		}
-		iscan_chain = 0;
-	} else {
-		while (iscanbuf_cur) {
-			if (iscanbuf_cur == iscan_delete)
-				break;
-			iscanbuf_prv = iscanbuf_cur;
-			iscanbuf_cur = iscanbuf_cur->next;
-		}
-		if (iscanbuf_prv)
-			iscanbuf_prv->next = iscan_delete->next;
-
-		iscan_delete->next = 0;
-		kfree(iscan_delete);
-
-		if (!iscanbuf_prv)
-			iscan_chain = 0;
-	}
-	dhd_iscan_unlock();
-}
-
-iscan_buf_t *dhd_iscan_result_buf(void)
-{
-	return iscan_chain;
-}
-
-/*
-* print scan cache
-* print partial iscan_skip list differently
-*/
-int dhd_iscan_print_cache(iscan_buf_t *iscan_skip)
-{
-	int i = 0, l = 0;
-	iscan_buf_t *iscan_cur;
-	wl_iscan_results_t *list;
-	wl_scan_results_t *results;
-	wl_bss_info_t UNALIGNED *bi;
-
-	dhd_iscan_lock();
-
-	iscan_cur = dhd_iscan_result_buf();
-
-	while (iscan_cur) {
-		list = (wl_iscan_results_t *)iscan_cur->iscan_buf;
-		if (!list)
-			break;
-
-		results = (wl_scan_results_t *)&list->results;
-		if (!results)
-			break;
-
-		if (results->version != WL_BSS_INFO_VERSION) {
-			DHD_ISCAN(("%s: results->version %d != "
-				"WL_BSS_INFO_VERSION\n",
-				__func__, results->version));
-			goto done;
-		}
-
-		bi = results->bss_info;
-		for (i = 0; i < results->count; i++) {
-			if (!bi)
-				break;
-
-			DHD_ISCAN(("%s[%2.2d:%2.2d] %X:%X:%X:%X:%X:%X\n",
-				   iscan_cur != iscan_skip ? "BSS" : "bss", l,
-				   i, bi->BSSID.octet[0], bi->BSSID.octet[1],
-				   bi->BSSID.octet[2], bi->BSSID.octet[3],
-				   bi->BSSID.octet[4], bi->BSSID.octet[5]));
-
-			bi = (wl_bss_info_t *)((unsigned long)bi + bi->length);
-		}
-		iscan_cur = iscan_cur->next;
-		l++;
-	}
-
-done:
-	dhd_iscan_unlock();
-	return 0;
-}
-
-/*
-* delete disappeared AP from specific scan cache but skip partial
-* list in iscan_skip
-*/
-int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
-{
-	int i = 0, j = 0, l = 0;
-	iscan_buf_t *iscan_cur;
-	wl_iscan_results_t *list;
-	wl_scan_results_t *results;
-	wl_bss_info_t UNALIGNED *bi, *bi_new, *bi_next;
-
-	unsigned char *s_addr = addr;
-
-	dhd_iscan_lock();
-	DHD_ISCAN(("%s: BSS to remove %X:%X:%X:%X:%X:%X\n",
-		   __func__, s_addr[0], s_addr[1], s_addr[2],
-		   s_addr[3], s_addr[4], s_addr[5]));
-
-	iscan_cur = dhd_iscan_result_buf();
-
-	while (iscan_cur) {
-		if (iscan_cur != iscan_skip) {
-			list = (wl_iscan_results_t *)iscan_cur->iscan_buf;
-			if (!list)
-				break;
-
-			results = (wl_scan_results_t *)&list->results;
-			if (!results)
-				break;
-
-			if (results->version != WL_BSS_INFO_VERSION) {
-				DHD_ERROR(("%s: results->version %d != "
-					"WL_BSS_INFO_VERSION\n",
-					__func__, results->version));
-				goto done;
-			}
-
-			bi = results->bss_info;
-			for (i = 0; i < results->count; i++) {
-				if (!bi)
-					break;
-
-				if (!memcmp
-				    (bi->BSSID.octet, addr, ETH_ALEN)) {
-					DHD_ISCAN(("%s: Del BSS[%2.2d:%2.2d] "
-					"%X:%X:%X:%X:%X:%X\n",
-					__func__, l, i, bi->BSSID.octet[0],
-					bi->BSSID.octet[1], bi->BSSID.octet[2],
-					bi->BSSID.octet[3], bi->BSSID.octet[4],
-					bi->BSSID.octet[5]));
-
-					bi_new = bi;
-					bi = (wl_bss_info_t *)((unsigned long)
-							       bi + bi->length);
-/*
-			if(bi && bi_new) {
-				memcpy(bi_new, bi, results->buflen -
-				bi_new->length);
-				results->buflen -= bi_new->length;
-			}
-*/
-					results->buflen -= bi_new->length;
-					results->count--;
-
-					for (j = i; j < results->count; j++) {
-						if (bi && bi_new) {
-							DHD_ISCAN(("%s: Moved up BSS[%2.2d:%2.2d]" "%X:%X:%X:%X:%X:%X\n",
-							__func__, l, j,
-							bi->BSSID.octet[0],
-							bi->BSSID.octet[1],
-							bi->BSSID.octet[2],
-							bi->BSSID.octet[3],
-							bi->BSSID.octet[4],
-							bi->BSSID.octet[5]));
-
-							bi_next =
-							    (wl_bss_info_t *)((unsigned long)bi +
-								 bi->length);
-							memcpy(bi_new, bi,
-							      bi->length);
-							bi_new =
-							    (wl_bss_info_t *)((unsigned long)bi_new +
-								 bi_new->
-								  length);
-							bi = bi_next;
-						}
-					}
-
-					if (results->count == 0) {
-						/* Prune now empty partial
-						scan list */
-						dhd_iscan_free_buf(dhdp,
-								   iscan_cur);
-						goto done;
-					}
-					break;
-				}
-				bi = (wl_bss_info_t *)((unsigned long)bi +
-							bi->length);
-			}
-		}
-		iscan_cur = iscan_cur->next;
-		l++;
-	}
-
-done:
-	dhd_iscan_unlock();
-	return 0;
-}
-
-int dhd_iscan_remove_duplicates(void *dhdp, iscan_buf_t *iscan_cur)
-{
-	int i = 0;
-	wl_iscan_results_t *list;
-	wl_scan_results_t *results;
-	wl_bss_info_t UNALIGNED *bi, *bi_new, *bi_next;
-
-	dhd_iscan_lock();
-
-	DHD_ISCAN(("%s: Scan cache before delete\n", __func__));
-	dhd_iscan_print_cache(iscan_cur);
-
-	if (!iscan_cur)
-		goto done;
-
-	list = (wl_iscan_results_t *)iscan_cur->iscan_buf;
-	if (!list)
-		goto done;
-
-	results = (wl_scan_results_t *)&list->results;
-	if (!results)
-		goto done;
-
-	if (results->version != WL_BSS_INFO_VERSION) {
-		DHD_ERROR(("%s: results->version %d != WL_BSS_INFO_VERSION\n",
-			   __func__, results->version));
-		goto done;
-	}
-
-	bi = results->bss_info;
-	for (i = 0; i < results->count; i++) {
-		if (!bi)
-			break;
-
-		DHD_ISCAN(("%s: Find dups for BSS[%2.2d] %X:%X:%X:%X:%X:%X\n",
-			   __func__, i, bi->BSSID.octet[0],
-			   bi->BSSID.octet[1], bi->BSSID.octet[2],
-			   bi->BSSID.octet[3], bi->BSSID.octet[4],
-			   bi->BSSID.octet[5]));
-
-		dhd_iscan_delete_bss(dhdp, bi->BSSID.octet, iscan_cur);
-
-		bi = (wl_bss_info_t *)((unsigned long)bi + bi->length);
-	}
-
-done:
-	DHD_ISCAN(("%s: Scan cache after delete\n", __func__));
-	dhd_iscan_print_cache(iscan_cur);
-	dhd_iscan_unlock();
-	return 0;
-}
-
-void dhd_iscan_ind_scan_confirm(void *dhdp, bool status)
-{
-
-	dhd_ind_scan_confirm(dhdp, status);
-}
-
-int dhd_iscan_request(void *dhdp, u16 action)
-{
-	int rc;
-	wl_iscan_params_t params;
-	dhd_pub_t *dhd = dhd_bus_pub(dhdp);
-	char buf[BRCMF_C_IOCTL_SMLEN];
-
-	memset(&params, 0, sizeof(wl_iscan_params_t));
-	memcpy(&params.params.bssid, &ether_bcast, ETH_ALEN);
-
-	params.params.bss_type = DOT11_BSSTYPE_ANY;
-	params.params.scan_type = DOT11_SCANTYPE_ACTIVE;
-
-	params.params.nprobes = -1;
-	params.params.active_time = -1;
-	params.params.passive_time = -1;
-	params.params.home_time = -1;
-	params.params.channel_num = 0;
-
-	params.version = ISCAN_REQ_VERSION;
-	params.action = action;
-	params.scan_duration = 0;
-
-	brcmu_mkiovar("iscan", (char *)&params, sizeof(wl_iscan_params_t), buf,
-		    BRCMF_C_IOCTL_SMLEN);
-	rc = dhd_wl_ioctl(dhdp, BRCMF_C_SET_VAR, buf, BRCMF_C_IOCTL_SMLEN);
-
-	return rc;
-}
-
-static int dhd_iscan_get_partial_result(void *dhdp, uint *scan_count)
-{
-	wl_iscan_results_t *list_buf;
-	wl_iscan_results_t list;
-	wl_scan_results_t *results;
-	iscan_buf_t *iscan_cur;
-	int status = -1;
-	dhd_pub_t *dhd = dhd_bus_pub(dhdp);
-	int rc;
-
-	iscan_cur = dhd_iscan_allocate_buf(dhd, &iscan_chain);
-	if (!iscan_cur) {
-		DHD_ERROR(("%s: Failed to allocate node\n", __func__));
-		dhd_iscan_free_buf(dhdp, 0);
-		dhd_iscan_request(dhdp, WL_SCAN_ACTION_ABORT);
-		goto fail;
-	}
-
-	dhd_iscan_lock();
-
-	memset(iscan_cur->iscan_buf, 0, WLC_IW_ISCAN_MAXLEN);
-	list_buf = (wl_iscan_results_t *) iscan_cur->iscan_buf;
-	results = &list_buf->results;
-	results->buflen = WL_ISCAN_RESULTS_FIXED_SIZE;
-	results->version = 0;
-	results->count = 0;
-
-	memset(&list, 0, sizeof(list));
-	list.results.buflen = WLC_IW_ISCAN_MAXLEN;
-	brcmu_mkiovar("iscanresults", (char *)&list,
-		      WL_ISCAN_RESULTS_FIXED_SIZE,
-		      iscan_cur->iscan_buf, WLC_IW_ISCAN_MAXLEN);
-	rc = dhd_wl_ioctl(dhdp, BRCMF_C_GET_VAR, iscan_cur->iscan_buf,
-			  WLC_IW_ISCAN_MAXLEN);
-
-	results->buflen = results->buflen;
-	results->version = results->version;
-	*scan_count = results->count = results->count;
-	status = list_buf->status;
-
-	dhd_iscan_unlock();
-
-	if (!(*scan_count))
-		dhd_iscan_free_buf(dhdp, iscan_cur);
-	else
-		dhd_iscan_remove_duplicates(dhdp, iscan_cur);
-
-fail:
-	return status;
-}
-#endif				/* SIMPLE_ISCAN */
-
 #ifdef PNO_SUPPORT
 int dhd_pno_clean(dhd_pub_t *dhd)
 {
Signature · 1 line
1.7.1
author
#57 lore raw

PATCH 53/119 staging: brcm80211: rename netdevice related functions in fullmac

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Change functions related to netdevice in fullmac to more consistent naming convention.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |    1 +
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |   71 +++++++++++-----------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |    7 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |    2 +-
 4 files changed, 40 insertions(+), 41 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +1 -0
index 8736e6f..c990a2c 100644
@@ -884,6 +884,7 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
 extern dhd_pub_t *brcmf_attach(struct dhd_bus *bus,
 				uint bus_hdrlen);
 extern int brcmf_net_attach(dhd_pub_t *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);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +35 -36

235 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +3 -4
index dd47451..ca45829 100644
@@ -342,7 +342,6 @@ do {									\
 	}								\
 } while (0)
 
-extern int dhd_wait_pend8021x(struct net_device *dev);
 #define CHAN2G(_channel, _freq, _flags) {			\
 	.band			= IEEE80211_BAND_2GHZ,		\
 	.center_freq		= (_freq),			\
@@ -1677,7 +1676,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
 		}
 		swap_key_from_BE(&key);
 
-		dhd_wait_pend8021x(dev);
+		brcmf_netdev_wait_pend8021x(dev);
 		err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
 		if (unlikely(err)) {
 			WL_ERR("WLC_SET_KEY error (%d)\n", err);
@@ -2101,7 +2100,7 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
 
 	if (test_bit(WL_STATUS_READY, &wl->status)) {
 		/* Turn on Watchdog timer */
-		wl_os_wd_timer(ndev, brcmf_watchdog_ms);
+		brcmf_netdev_os_wd_timer(ndev, brcmf_watchdog_ms);
 		wl_invoke_iscan(wiphy_to_wl(wiphy));
 	}
 
@@ -2163,7 +2162,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
 	if (test_bit(WL_STATUS_READY, &wl->status)) {
 		WL_INFO("Terminate watchdog timer and enable MPC\n");
 		wl_set_mpc(ndev, 1);
-		wl_os_wd_timer(ndev, 0);
+		brcmf_netdev_os_wd_timer(ndev, 0);
 	}
 
 #if defined(CONFIG_PM_SLEEP)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +1 -1
index 77d0559..6ad6b5b 100644
@@ -404,6 +404,6 @@ 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 wl_os_wd_timer(struct net_device *ndev, uint wdtick);
+extern void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick);
 
 #endif				/* _wl_cfg80211_h_ */
Signature · 1 line
1.7.1
author
#58 lore raw

PATCH 54/119 staging: brcm80211: rename static functions in dhd_linux.c

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

functions in dhd_linux.c are renamed according more consistent naming convention.

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |  121 ++++++++++++------------
 1 files changed, 59 insertions(+), 62 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +59 -62
index aa31bf0..fb5bef0 100644
@@ -363,17 +363,17 @@ module_param(brcmf_pktgen_len, uint, 0);
 #define DHD_COMPILED
 #endif
 
-static void dhd_dpc(unsigned long data);
+static void brcmf_dpc(unsigned long data);
 
 #ifdef TOE
-static int dhd_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
-static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
+static int brcmf_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
+static int brcmf_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
 #endif				/* TOE */
 
-static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
+static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 			     brcmf_event_msg_t *event_ptr, void **data_ptr);
 
-static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
+static void brcmf_set_packet_filter(int value, dhd_pub_t *dhd)
 {
 #ifdef PKT_FILTER_SUPPORT
 	DHD_TRACE(("%s: %d\n", __func__, value));
@@ -392,7 +392,7 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
 }
 
 #if defined(CONFIG_HAS_EARLYSUSPEND)
-static int dhd_set_suspend(int value, dhd_pub_t *dhd)
+static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
 {
 	int power_mode = PM_MAX;
 	/* wl_pkt_filter_enable_t       enable_parm; */
@@ -418,7 +418,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 
 			/* Enable packet filter, only allow unicast
 				 packet to send up */
-			dhd_set_packet_filter(1, dhd);
+			brcmf_set_packet_filter(1, dhd);
 
 			/* if dtim skip setup as default force it
 			 * to wake each third dtim
@@ -455,7 +455,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 					 sizeof(power_mode));
 
 			/* disable pkt filter */
-			dhd_set_packet_filter(0, dhd);
+			brcmf_set_packet_filter(0, dhd);
 
 			/* restore pre-suspend setting for dtim_skip */
 			brcmu_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip,
@@ -476,7 +476,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
 	return 0;
 }
 
-static void dhd_suspend_resume_helper(struct dhd_info *dhd, int val)
+static void brcmf_suspend_resume_helper(struct dhd_info *dhd, int val)
 {
 	dhd_pub_t *dhdp = &dhd->pub;
 
@@ -484,11 +484,11 @@ static void dhd_suspend_resume_helper(struct dhd_info *dhd, int val)
 	/* Set flag when early suspend was called */
 	dhdp->in_suspend = val;
 	if (!dhdp->suspend_disable_flag)
-		dhd_set_suspend(val, dhdp);
+		brcmf_set_suspend(val, dhdp);
 	brcmf_os_proto_unblock(dhdp);
 }
 
-static void dhd_early_suspend(struct early_suspend *h)
+static void brcmf_early_suspend(struct early_suspend *h)
 {
 	struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
 
@@ -499,7 +499,7 @@ static void dhd_early_suspend(struct early_suspend *h)
 
 }
 
-static void dhd_late_resume(struct early_suspend *h)
+static void brcmf_late_resume(struct early_suspend *h)
 {
 	struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
 
@@ -568,7 +568,7 @@ int brcmf_timeout_expired(dhd_timeout_t *tmo)
 	return 0;
 }
 
-static int dhd_net2idx(dhd_info_t *dhd, struct net_device *net)
+static int brcmf_net2idx(dhd_info_t *dhd, struct net_device *net)
 {
 	int i = 0;
 
@@ -623,7 +623,7 @@ char *brcmf_ifname(dhd_pub_t *dhdp, int ifidx)
 	return "<if_none>";
 }
 
-static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
+static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
 {
 	struct net_device *dev;
 	struct netdev_hw_addr *ha;
@@ -739,8 +739,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
 	}
 }
 
-static int
-_dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
+static int _brcmf_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
 {
 	char buf[32];
 	wl_ioctl_t ioc;
@@ -774,7 +773,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
 extern struct net_device *ap_net_dev;
 #endif
 
-static void dhd_op_if(dhd_if_t *ifp)
+static void brcmf_op_if(dhd_if_t *ifp)
 {
 	dhd_info_t *dhd;
 	int ret = 0, err = 0;
@@ -864,7 +863,7 @@ static void dhd_op_if(dhd_if_t *ifp)
 	}
 }
 
-static int _dhd_sysioc_thread(void *data)
+static int _brcmf_sysioc_thread(void *data)
 {
 	dhd_info_t *dhd = (dhd_info_t *) data;
 	int i;
@@ -883,7 +882,7 @@ static int _dhd_sysioc_thread(void *data)
 				in_ap = (ap_net_dev != NULL);
 #endif				/* SOFTAP */
 				if (dhd->iflist[i]->state)
-					dhd_op_if(dhd->iflist[i]);
+					brcmf_op_if(dhd->iflist[i]);
 #ifdef SOFTAP
 				if (dhd->iflist[i] == NULL) {
 					DHD_TRACE(("\n\n %s: interface %d "
@@ -908,11 +907,11 @@ static int _dhd_sysioc_thread(void *data)
 #endif				/* SOFTAP */
 				if (dhd->set_multicast) {
 					dhd->set_multicast = false;
-					_dhd_set_multicast_list(dhd, i);
+					_brcmf_set_multicast_list(dhd, i);
 				}
 				if (dhd->set_macaddress) {
 					dhd->set_macaddress = false;
-					_dhd_set_mac_address(dhd, i,
+					_brcmf_set_mac_address(dhd, i,
 							     dhd->macvalue);
 				}
 			}
@@ -929,7 +928,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
 	struct sockaddr *sa = (struct sockaddr *)addr;
 	int ifidx;
 
-	ifidx = dhd_net2idx(dhd, dev);
+	ifidx = brcmf_net2idx(dhd, dev);
 	if (ifidx == DHD_BAD_IF)
 		return -1;
 
@@ -946,7 +945,7 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
 	dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
 	int ifidx;
 
-	ifidx = dhd_net2idx(dhd, dev);
+	ifidx = brcmf_net2idx(dhd, dev);
 	if (ifidx == DHD_BAD_IF)
 		return;
 
@@ -1004,7 +1003,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
 		return -ENODEV;
 	}
 
-	ifidx = dhd_net2idx(dhd, net);
+	ifidx = brcmf_net2idx(dhd, net);
 	if (ifidx == DHD_BAD_IF) {
 		DHD_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
 		netif_stop_queue(net);
@@ -1112,7 +1111,7 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
 
 		/* Process special event packets and then discard them */
 		if (ntohs(skb->protocol) == ETH_P_BRCM)
-			dhd_wl_host_event(dhd, &ifidx,
+			brcmf_host_event(dhd, &ifidx,
 					  skb_mac_header(skb),
 					  &event, &data);
 
@@ -1171,7 +1170,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
-	ifidx = dhd_net2idx(dhd, net);
+	ifidx = brcmf_net2idx(dhd, net);
 	if (ifidx == DHD_BAD_IF)
 		return NULL;
 
@@ -1197,7 +1196,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
 	return &ifp->stats;
 }
 
-static int dhd_watchdog_thread(void *data)
+static int brcmf_watchdog_thread(void *data)
 {
 	dhd_info_t *dhd = (dhd_info_t *) data;
 
@@ -1231,7 +1230,7 @@ static int dhd_watchdog_thread(void *data)
 	return 0;
 }
 
-static void dhd_watchdog(unsigned long data)
+static void brcmf_watchdog(unsigned long data)
 {
 	dhd_info_t *dhd = (dhd_info_t *) data;
 
@@ -1257,7 +1256,7 @@ static void dhd_watchdog(unsigned long data)
 		mod_timer(&dhd->timer, jiffies + brcmf_watchdog_ms * HZ / 1000);
 }
 
-static int dhd_dpc_thread(void *data)
+static int brcmf_dpc_thread(void *data)
 {
 	dhd_info_t *dhd = (dhd_info_t *) data;
 
@@ -1295,7 +1294,7 @@ static int dhd_dpc_thread(void *data)
 	return 0;
 }
 
-static void dhd_dpc(unsigned long data)
+static void brcmf_dpc(unsigned long data)
 {
 	dhd_info_t *dhd;
 
@@ -1325,7 +1324,7 @@ void brcmf_sched_dpc(dhd_pub_t *dhdp)
 #ifdef TOE
 /* Retrieve current toe component enables, which are kept
 	 as a bitmap in toe_ol iovar */
-static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
+static int brcmf_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
 {
 	wl_ioctl_t ioc;
 	char buf[32];
@@ -1359,7 +1358,7 @@ static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
 
 /* Set current toe component enables in toe_ol iovar,
 	 and set toe global enable iovar */
-static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
+static int brcmf_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
 {
 	wl_ioctl_t ioc;
 	char buf[32];
@@ -1475,7 +1474,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
 		/* Get toe offload components from dongle */
 	case ETHTOOL_GRXCSUM:
 	case ETHTOOL_GTXCSUM:
-		ret = dhd_toe_get(dhd, 0, &toe_cmpnt);
+		ret = brcmf_toe_get(dhd, 0, &toe_cmpnt);
 		if (ret < 0)
 			return ret;
 
@@ -1496,7 +1495,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
 			return -EFAULT;
 
 		/* Read the current settings, update and write back */
-		ret = dhd_toe_get(dhd, 0, &toe_cmpnt);
+		ret = brcmf_toe_get(dhd, 0, &toe_cmpnt);
 		if (ret < 0)
 			return ret;
 
@@ -1508,7 +1507,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
 		else
 			toe_cmpnt &= ~csum_dir;
 
-		ret = dhd_toe_set(dhd, 0, toe_cmpnt);
+		ret = brcmf_toe_set(dhd, 0, toe_cmpnt);
 		if (ret < 0)
 			return ret;
 
@@ -1544,7 +1543,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
 	int ifidx;
 	bool is_set_key_cmd;
 
-	ifidx = dhd_net2idx(dhd, net);
+	ifidx = brcmf_net2idx(dhd, net);
 	DHD_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
 
 	if (ifidx == DHD_BAD_IF)
@@ -1675,7 +1674,7 @@ static int brcmf_netdev_open(struct net_device *net)
 #ifdef TOE
 	u32 toe_ol;
 #endif
-	int ifidx = dhd_net2idx(dhd, net);
+	int ifidx = brcmf_net2idx(dhd, net);
 	s32 ret = 0;
 
 	DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
@@ -1694,7 +1693,7 @@ static int brcmf_netdev_open(struct net_device *net)
 
 #ifdef TOE
 		/* Get current TOE mode from dongle */
-		if (dhd_toe_get(dhd, ifidx, &toe_ol) >= 0
+		if (brcmf_toe_get(dhd, ifidx, &toe_ol) >= 0
 		    && (toe_ol & TOE_TX_CSUM_OL) != 0)
 			dhd->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
 		else
@@ -1852,7 +1851,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	/* Set up the watchdog timer */
 	init_timer(&dhd->timer);
 	dhd->timer.data = (unsigned long) dhd;
-	dhd->timer.function = dhd_watchdog;
+	dhd->timer.function = brcmf_watchdog;
 
 	/* Initialize thread based operation and lock */
 	sema_init(&dhd->sdsem, 1);
@@ -1864,7 +1863,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	if (dhd_dpc_prio >= 0) {
 		/* Initialize watchdog thread */
 		sema_init(&dhd->watchdog_sem, 0);
-		dhd->watchdog_tsk = kthread_run(dhd_watchdog_thread, dhd,
+		dhd->watchdog_tsk = kthread_run(brcmf_watchdog_thread, dhd,
 						"dhd_watchdog");
 		if (IS_ERR(dhd->watchdog_tsk)) {
 			printk(KERN_WARNING
@@ -1879,20 +1878,20 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	if (dhd_dpc_prio >= 0) {
 		/* Initialize DPC thread */
 		sema_init(&dhd->dpc_sem, 0);
-		dhd->dpc_tsk = kthread_run(dhd_dpc_thread, dhd, "dhd_dpc");
+		dhd->dpc_tsk = kthread_run(brcmf_dpc_thread, dhd, "dhd_dpc");
 		if (IS_ERR(dhd->dpc_tsk)) {
 			printk(KERN_WARNING
 				"dhd_dpc thread failed to start\n");
 			dhd->dpc_tsk = NULL;
 		}
 	} else {
-		tasklet_init(&dhd->tasklet, dhd_dpc, (unsigned long) dhd);
+		tasklet_init(&dhd->tasklet, brcmf_dpc, (unsigned long) dhd);
 		dhd->dpc_tsk = NULL;
 	}
 
 	if (dhd_sysioc) {
 		sema_init(&dhd->sysioc_sem, 0);
-		dhd->sysioc_tsk = kthread_run(_dhd_sysioc_thread, dhd,
+		dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
 						"_dhd_sysioc");
 		if (IS_ERR(dhd->sysioc_tsk)) {
 			printk(KERN_WARNING
@@ -1917,8 +1916,8 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	/* Init lock suspend to prevent kernel going to suspend */
 #ifdef CONFIG_HAS_EARLYSUSPEND
 	dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
-	dhd->early_suspend.suspend = dhd_early_suspend;
-	dhd->early_suspend.resume = dhd_late_resume;
+	dhd->early_suspend.suspend = brcmf_early_suspend;
+	dhd->early_suspend.resume = brcmf_late_resume;
 	register_early_suspend(&dhd->early_suspend);
 #endif
 
@@ -2032,9 +2031,8 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
 	return 0;
 }
 
-int
-dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len,
-	  int set)
+int brcmf_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf,
+	  uint cmd_len, int set)
 {
 	char buf[strlen(name) + 1 + cmd_len];
 	int len = sizeof(buf);
@@ -2122,7 +2120,7 @@ fail:
 	return -EBADE;
 }
 
-void dhd_bus_detach(dhd_pub_t *dhdp)
+static void brcmf_bus_detach(dhd_pub_t *dhdp)
 {
 	dhd_info_t *dhd;
 
@@ -2194,7 +2192,7 @@ void brcmf_detach(dhd_pub_t *dhdp)
 				dhd->sysioc_tsk = NULL;
 			}
 
-			dhd_bus_detach(dhdp);
+			brcmf_bus_detach(dhdp);
 
 			if (dhdp->prot)
 				brcmf_proto_detach(dhdp);
@@ -2209,7 +2207,7 @@ void brcmf_detach(dhd_pub_t *dhdp)
 	}
 }
 
-static void __exit dhd_module_cleanup(void)
+static void __exit brcmf_module_cleanup(void)
 {
 	DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -2221,7 +2219,7 @@ static void __exit dhd_module_cleanup(void)
 	brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
 }
 
-static int __init dhd_module_init(void)
+static int __init brcmf_module_init(void)
 {
 	int error;
 
@@ -2278,8 +2276,8 @@ failed:
 	return -EINVAL;
 }
 
-module_init(dhd_module_init);
-module_exit(dhd_module_cleanup);
+module_init(brcmf_module_init);
+module_exit(brcmf_module_cleanup);
 
 /*
  * OS specific functions required to implement DHD driver in OS independent way
@@ -2467,9 +2465,8 @@ void brcmf_os_sdunlock(dhd_pub_t *pub)
 		spin_unlock_bh(&dhd->sdlock);
 }
 
-static int
-dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
-		  brcmf_event_msg_t *event, void **data)
+static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
+			    brcmf_event_msg_t *event, void **data)
 {
 	int bcmerror = 0;
 
@@ -2543,7 +2540,7 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val)
 
 	if (dhd) {
 		brcmf_os_proto_block(&dhd->pub);
-		ret = dhd_set_suspend(val, &dhd->pub);
+		ret = brcmf_set_suspend(val, &dhd->pub);
 		brcmf_os_proto_unblock(&dhd->pub);
 	}
 #endif		/* defined(CONFIG_HAS_EARLYSUSPEND) */
@@ -2574,7 +2571,7 @@ int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
 		brcmf_os_proto_block(&dhd->pub);
 		if (dhd->pub.in_suspend) {
 			if (!val || (val && !dhd->pub.suspend_disable_flag))
-				dhd_set_packet_filter(val, &dhd->pub);
+				brcmf_set_packet_filter(val, &dhd->pub);
 		}
 		brcmf_os_proto_unblock(&dhd->pub);
 	}
@@ -2625,7 +2622,7 @@ int brcmf_netdev_get_pno_status(struct net_device *dev)
 
 #endif				/* PNO_SUPPORT */
 
-static int dhd_get_pend_8021x_cnt(dhd_info_t *dhd)
+static int brcmf_get_pend_8021x_cnt(dhd_info_t *dhd)
 {
 	return atomic_read(&dhd->pend_8021x_cnt);
 }
@@ -2637,7 +2634,7 @@ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
 	dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
 	int timeout = 10 * HZ / 1000;
 	int ntimes = MAX_WAIT_FOR_8021X_TX;
-	int pend = dhd_get_pend_8021x_cnt(dhd);
+	int pend = brcmf_get_pend_8021x_cnt(dhd);
 
 	while (ntimes && pend) {
 		if (pend) {
@@ -2646,7 +2643,7 @@ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
 			set_current_state(TASK_RUNNING);
 			ntimes--;
 		}
-		pend = dhd_get_pend_8021x_cnt(dhd);
+		pend = brcmf_get_pend_8021x_cnt(dhd);
 	}
 	return pend;
 }
Signature · 1 line
1.7.1
author
#59 lore raw

PATCH 55/119 staging: brcm80211: rename more brcmfmac module parameters

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Renamed remaining brcmfmac module parameters to more consistent naming convention.

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   74 ++++++++++++------------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c  |   42 +++++++-------
 2 files changed, 58 insertions(+), 58 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +37 -37
index fb5bef0..5aa4492 100644
@@ -248,15 +248,15 @@ module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0);
 module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
 
 /* No firmware required */
-bool dhd_no_fw_req;
-module_param(dhd_no_fw_req, bool, 0);
+bool brcmf_no_fw_req;
+module_param(brcmf_no_fw_req, bool, 0);
 
 /* Error bits */
 module_param(brcmf_msg_level, int, 0);
 
 /* Spawn a thread for system ioctls (set mac, set mcast) */
-uint dhd_sysioc = true;
-module_param(dhd_sysioc, uint, 0);
+uint brcmf_sysioc = true;
+module_param(brcmf_sysioc, uint, 0);
 
 /* Watchdog interval */
 uint brcmf_watchdog_ms = 10;
@@ -290,16 +290,16 @@ uint brcmf_master_mode = true;
 module_param(brcmf_master_mode, uint, 1);
 
 /* Watchdog thread priority, -1 to use kernel timer */
-int dhd_watchdog_prio = 97;
-module_param(dhd_watchdog_prio, int, 0);
+int brcmf_watchdog_prio = 97;
+module_param(brcmf_watchdog_prio, int, 0);
 
 /* DPC thread priority, -1 to use tasklet */
-int dhd_dpc_prio = 98;
-module_param(dhd_dpc_prio, int, 0);
+int brcmf_dpc_prio = 98;
+module_param(brcmf_dpc_prio, int, 0);
 
 /* DPC thread priority, -1 to use tasklet */
-extern int dhd_dongle_memsize;
-module_param(dhd_dongle_memsize, int, 0);
+extern int brcmf_dongle_memsize;
+module_param(brcmf_dongle_memsize, int, 0);
 
 /* Contorl fw roaming */
 #ifdef CUSTOMER_HW2
@@ -318,7 +318,7 @@ module_param_string(iface_name, iface_name, IFNAMSIZ, 0);
 /* The following are specific to the SDIO dongle */
 
 /* IOCTL response timeout */
-int dhd_ioctl_timeout_msec = IOCTL_RESP_TIMEOUT;
+int brcmf_ioctl_timeout_msec = IOCTL_RESP_TIMEOUT;
 
 /* Idle timeout for backplane clock */
 int brcmf_idletime = BRCMF_IDLETIME_TICKS;
@@ -337,14 +337,14 @@ uint brcmf_sdiod_drive_strength = 6;
 module_param(brcmf_sdiod_drive_strength, uint, 0);
 
 /* Tx/Rx bounds */
-extern uint dhd_txbound;
-extern uint dhd_rxbound;
-module_param(dhd_txbound, uint, 0);
-module_param(dhd_rxbound, uint, 0);
+extern uint brcmf_txbound;
+extern uint brcmf_rxbound;
+module_param(brcmf_txbound, uint, 0);
+module_param(brcmf_rxbound, uint, 0);
 
 /* Deferred transmits */
-extern uint dhd_deferred_tx;
-module_param(dhd_deferred_tx, uint, 0);
+extern uint brcmf_deferred_tx;
+module_param(brcmf_deferred_tx, uint, 0);
 
 #ifdef SDTEST
 /* Echo packet generator (pkts/s) */
@@ -1204,10 +1204,10 @@ static int brcmf_watchdog_thread(void *data)
 	 * so get rid of all our resources
 	 */
 #ifdef DHD_SCHED
-	if (dhd_watchdog_prio > 0) {
+	if (brcmf_watchdog_prio > 0) {
 		struct sched_param param;
-		param.sched_priority = (dhd_watchdog_prio < MAX_RT_PRIO) ?
-		    dhd_watchdog_prio : (MAX_RT_PRIO - 1);
+		param.sched_priority = (brcmf_watchdog_prio < MAX_RT_PRIO) ?
+		    brcmf_watchdog_prio : (MAX_RT_PRIO - 1);
 		sched_setscheduler(current, SCHED_FIFO, &param);
 	}
 #endif				/* DHD_SCHED */
@@ -1264,11 +1264,11 @@ static int brcmf_dpc_thread(void *data)
 	 * so get rid of all our resources
 	 */
 #ifdef DHD_SCHED
-	if (dhd_dpc_prio > 0) {
+	if (brcmf_dpc_prio > 0) {
 		struct sched_param param;
 		param.sched_priority =
-		    (dhd_dpc_prio <
-		     MAX_RT_PRIO) ? dhd_dpc_prio : (MAX_RT_PRIO - 1);
+		    (brcmf_dpc_prio <
+		     MAX_RT_PRIO) ? brcmf_dpc_prio : (MAX_RT_PRIO - 1);
 		sched_setscheduler(current, SCHED_FIFO, &param);
 	}
 #endif				/* DHD_SCHED */
@@ -1843,7 +1843,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 		DHD_ERROR(("wl_cfg80211_attach failed\n"));
 		goto fail;
 	}
-	if (!dhd_no_fw_req) {
+	if (!brcmf_no_fw_req) {
 		strcpy(brcmf_fw_path, wl_cfg80211_get_fwname());
 		strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
 	}
@@ -1855,12 +1855,12 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 
 	/* Initialize thread based operation and lock */
 	sema_init(&dhd->sdsem, 1);
-	if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0))
+	if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0))
 		dhd->threads_only = true;
 	else
 		dhd->threads_only = false;
 
-	if (dhd_dpc_prio >= 0) {
+	if (brcmf_dpc_prio >= 0) {
 		/* Initialize watchdog thread */
 		sema_init(&dhd->watchdog_sem, 0);
 		dhd->watchdog_tsk = kthread_run(brcmf_watchdog_thread, dhd,
@@ -1875,7 +1875,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	}
 
 	/* Set up the bottom half handler */
-	if (dhd_dpc_prio >= 0) {
+	if (brcmf_dpc_prio >= 0) {
 		/* Initialize DPC thread */
 		sema_init(&dhd->dpc_sem, 0);
 		dhd->dpc_tsk = kthread_run(brcmf_dpc_thread, dhd, "dhd_dpc");
@@ -1889,7 +1889,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 		dhd->dpc_tsk = NULL;
 	}
 
-	if (dhd_sysioc) {
+	if (brcmf_sysioc) {
 		sema_init(&dhd->sysioc_sem, 0);
 		dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
 						"_dhd_sysioc");
@@ -2228,12 +2228,12 @@ static int __init brcmf_module_init(void)
 	/* Sanity check on the module parameters */
 	do {
 		/* Both watchdog and DPC as tasklets are ok */
-		if ((dhd_watchdog_prio < 0) && (dhd_dpc_prio < 0))
+		if ((brcmf_watchdog_prio < 0) && (brcmf_dpc_prio < 0))
 			break;
 
 		/* If both watchdog and DPC are threads, TX must be deferred */
-		if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0)
-		    && dhd_deferred_tx)
+		if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0)
+		    && brcmf_deferred_tx)
 			break;
 
 		DHD_ERROR(("Invalid module parameters.\n"));
@@ -2307,19 +2307,19 @@ int brcmf_os_proto_unblock(dhd_pub_t *pub)
 
 unsigned int brcmf_os_get_ioctl_resp_timeout(void)
 {
-	return (unsigned int)dhd_ioctl_timeout_msec;
+	return (unsigned int)brcmf_ioctl_timeout_msec;
 }
 
 void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
 {
-	dhd_ioctl_timeout_msec = (int)timeout_msec;
+	brcmf_ioctl_timeout_msec = (int)timeout_msec;
 }
 
 int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
 {
 	dhd_info_t *dhd = (dhd_info_t *) (pub->info);
 	DECLARE_WAITQUEUE(wait, current);
-	int timeout = dhd_ioctl_timeout_msec;
+	int timeout = brcmf_ioctl_timeout_msec;
 
 	/* Convert timeout in millsecond to jiffies */
 	timeout = timeout * HZ / 1000;
@@ -2399,7 +2399,7 @@ void *brcmf_os_open_image(char *filename)
 {
 	struct file *fp;
 
-	if (!dhd_no_fw_req)
+	if (!brcmf_no_fw_req)
 		return wl_cfg80211_request_fw(filename);
 
 	fp = filp_open(filename, O_RDONLY, 0);
@@ -2420,7 +2420,7 @@ int brcmf_os_get_image_block(char *buf, int len, void *image)
 	struct file *fp = (struct file *)image;
 	int rdlen;
 
-	if (!dhd_no_fw_req)
+	if (!brcmf_no_fw_req)
 		return wl_cfg80211_read_fw(buf, len);
 
 	if (!image)
@@ -2435,7 +2435,7 @@ int brcmf_os_get_image_block(char *buf, int len, void *image)
 
 void brcmf_os_close_image(void *image)
 {
-	if (!dhd_no_fw_req)
+	if (!brcmf_no_fw_req)
 		return wl_cfg80211_release_fw();
 	if (image)
 		filp_close((struct file *)image, NULL);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +21 -21

111 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#60 lore raw

PATCH 56/119 staging: brcm80211: replaced typedef sdioh_info_t by struct sdioh_info

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h      |   65 +++++++++---------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |   70 ++++++++++----------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h  |   16 ++--
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |   12 ++--
 4 files changed, 82 insertions(+), 81 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +32 -33
index 7eb0354..ffe258a 100644
@@ -38,9 +38,6 @@
 
 typedef int SDIOH_API_RC;
 
-/* SDio Host structure */
-typedef struct sdioh_info sdioh_info_t;
-
 /* callback function, taking one arg */
 typedef void (*sdioh_cb_fn_t) (void *);
 
@@ -48,68 +45,70 @@ typedef void (*sdioh_cb_fn_t) (void *);
  *  The handler shall be provided by all subsequent calls. No local cache
  *  cfghdl points to the starting address of pci device mapped memory
  */
-extern sdioh_info_t *brcmf_sdioh_attach(void *cfghdl, uint irq);
-extern SDIOH_API_RC brcmf_sdioh_detach(sdioh_info_t *si);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_register(sdioh_info_t *si,
+extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
+extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *si);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_register(struct sdioh_info *si,
 					     sdioh_cb_fn_t fn, void *argh);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *si);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
 
 /* query whether SD interrupt is enabled or not */
-extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
+extern SDIOH_API_RC
+brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
 
 /* enable or disable SD interrupt */
 extern SDIOH_API_RC
-brcmf_sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
+brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
 
 #if defined(DHD_DEBUG)
-extern bool brcmf_sdioh_interrupt_pending(sdioh_info_t *si);
+extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *si);
 #endif
 
-extern int brcmf_sdioh_claim_host_and_lock(sdioh_info_t *si);
-extern int brcmf_sdioh_release_host_and_unlock(sdioh_info_t *si);
+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 SDIOH_API_RC
-brcmf_sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc, uint addr,
+brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
 			 u8 *byte);
 
 /* read or write 2/4 bytes using cmd53 */
-extern SDIOH_API_RC brcmf_sdioh_request_word(sdioh_info_t *si, uint cmd_type,
-				       uint rw, uint fnc, uint addr,
-				       u32 *word, uint nbyte);
+extern SDIOH_API_RC
+brcmf_sdioh_request_word(struct sdioh_info *si, uint cmd_type,
+			 uint rw, uint fnc, uint addr,
+			 u32 *word, uint nbyte);
 
 /* read or write any buffer using cmd53 */
-extern SDIOH_API_RC brcmf_sdioh_request_buffer(sdioh_info_t *si, uint pio_dma,
-					 uint fix_inc, uint rw, uint fnc_num,
-					 u32 addr, uint regwidth,
-					 u32 buflen, u8 *buffer,
-					 struct sk_buff *pkt);
+extern SDIOH_API_RC
+brcmf_sdioh_request_buffer(struct sdioh_info *si, uint pio_dma,
+			   uint fix_inc, uint rw, uint fnc_num,
+			   u32 addr, uint regwidth,
+			   u32 buflen, u8 *buffer, struct sk_buff *pkt);
 
 /* get cis data */
-extern SDIOH_API_RC brcmf_sdioh_cis_read(sdioh_info_t *si, uint fuc, u8 *cis,
-				   u32 length);
+extern SDIOH_API_RC
+brcmf_sdioh_cis_read(struct sdioh_info *si, uint fuc, u8 *cis, u32 length);
 
-extern SDIOH_API_RC brcmf_sdioh_cfg_read(sdioh_info_t *si, uint fuc, u32 addr,
-				   u8 *data);
-extern SDIOH_API_RC brcmf_sdioh_cfg_write(sdioh_info_t *si, uint fuc, u32 addr,
-				    u8 *data);
+extern SDIOH_API_RC
+brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
+extern SDIOH_API_RC
+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(sdioh_info_t *si);
+extern uint brcmf_sdioh_query_iofnum(struct sdioh_info *si);
 
 /* handle iovars */
-extern int brcmf_sdioh_iovar_op(sdioh_info_t *si, const char *name,
+extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
 			  void *params, int plen, void *arg, int len, bool set);
 
 /* Issue abort to the specified function and clear controller as needed */
-extern int brcmf_sdioh_abort(sdioh_info_t *si, uint fnc);
+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(sdioh_info_t *si, int stage);
-extern int brcmf_sdioh_stop(sdioh_info_t *si);
+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(sdioh_info_t *si);
+extern int brcmf_sdioh_reset(struct sdioh_info *si);
 
 /* Helper function */
 void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +36 -34

254 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +8 -8
index c7863b1..1a6f68a 100644
@@ -62,8 +62,8 @@
 #endif
 
 /* Allocate/init/free per-OS private data */
-extern int brcmf_sdioh_osinit(sdioh_info_t *sd);
-extern void brcmf_sdioh_osfree(sdioh_info_t *sd);
+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
@@ -109,11 +109,11 @@ struct sdioh_info {
 extern uint sd_msglevel;
 
 /* OS-independent interrupt handler */
-extern bool brcmf_sdioh_check_client_intr(sdioh_info_t *sd);
+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(sdioh_info_t *sd);
-extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *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
@@ -124,11 +124,11 @@ 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(sdioh_info_t *sd, uint irq);
-extern void brcmf_sdioh_free_irq(uint irq, sdioh_info_t *sd);
+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 {
-	sdioh_info_t *sd;
+	struct sdioh_info *sd;
 	struct sdio_func *func[SDIOD_MAX_IOFUNCS];
 	u32 host_claimed;
 } BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +6 -6
index 8f13988..955168f 100644
@@ -55,8 +55,8 @@
 #include "dhd_dbg.h"
 #include "wl_cfg80211.h"
 
-extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd);
-extern void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd);
+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);
@@ -144,11 +144,11 @@ static struct sdio_driver bcmsdh_sdmmc_driver = {
 };
 
 struct sdos_info {
-	sdioh_info_t *sd;
+	struct sdioh_info *sd;
 	spinlock_t lock;
 };
 
-int brcmf_sdioh_osinit(sdioh_info_t *sd)
+int brcmf_sdioh_osinit(struct sdioh_info *sd)
 {
 	struct sdos_info *sdos;
 
@@ -162,7 +162,7 @@ int brcmf_sdioh_osinit(sdioh_info_t *sd)
 	return 0;
 }
 
-void brcmf_sdioh_osfree(sdioh_info_t *sd)
+void brcmf_sdioh_osfree(struct sdioh_info *sd)
 {
 	struct sdos_info *sdos;
 	ASSERT(sd && sd->sdos_info);
@@ -172,7 +172,7 @@ void brcmf_sdioh_osfree(sdioh_info_t *sd)
 }
 
 /* Interrupt enable/disable */
-SDIOH_API_RC brcmf_sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
+SDIOH_API_RC brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
 {
 	unsigned long flags;
 	struct sdos_info *sdos;
Signature · 1 line
1.7.1
author
#61 lore raw

PATCH 57/119 staging: brcm80211: replaced typedef bcmsdh_info_t by struct brcmf_sdio

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h     |    2 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |   70 ++++++++++----------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    4 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   30 +++++-----
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |   10 ++--
 5 files changed, 58 insertions(+), 58 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +1 -1
index ffe258a..5d09076 100644
@@ -111,6 +111,6 @@ 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(bcmsdh_info_t *sdh);
+void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
 
 #endif				/* _sdio_api_h_ */
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +35 -35

257 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +2 -2
index 3fabc08..66d81d1 100644
@@ -59,7 +59,7 @@ struct bcmsdh_hc {
 	struct pci_dev *dev;	/* pci device handle */
 #endif				/* BCMPLATFORM_BUS */
 	void *regs;		/* SDIO Host Controller address */
-	bcmsdh_info_t *sdh;	/* SDIO Host Controller handle */
+	struct brcmf_sdio *sdh;	/* SDIO Host Controller handle */
 	void *ch;
 	unsigned int oob_irq;
 	unsigned long oob_flags;	/* OOB Host specifiction
@@ -144,7 +144,7 @@ int brcmf_sdio_probe(struct device *dev)
 {
 	bcmsdh_hc_t *sdhc = NULL;
 	unsigned long regs = 0;
-	bcmsdh_info_t *sdh = NULL;
+	struct brcmf_sdio *sdh = NULL;
 #if !defined(BCMLXSDMMC) && defined(BCMPLATFORM_BUS)
 	struct platform_device *pdev;
 	struct resource *r;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +15 -15
index 003f485..2ede425 100644
@@ -460,7 +460,7 @@ struct chip_info {
 typedef struct dhd_bus {
 	dhd_pub_t *dhd;
 
-	bcmsdh_info_t *sdh;	/* Handle for BCMSDH calls */
+	struct brcmf_sdio *sdh;	/* Handle for BCMSDH calls */
 	struct chip_info *ci;	/* Chip info struct */
 	char *vars;		/* Variables (from CIS and/or other) */
 	uint varsz;		/* Size of variables buffer */
@@ -786,9 +786,9 @@ static int  _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
 static int
 brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *image_path);
 static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus);
-static void brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase);
+static void brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase);
 static int brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs);
-static void brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase);
+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);
@@ -835,7 +835,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
 {
 	int err;
 	u8 clkctl, clkreq, devctl;
-	bcmsdh_info_t *sdh;
+	struct brcmf_sdio *sdh;
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -1044,7 +1044,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
 
 int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
 {
-	bcmsdh_info_t *sdh = bus->sdh;
+	struct brcmf_sdio *sdh = bus->sdh;
 	struct sdpcmd_regs *regs = bus->regs;
 	uint retries = 0;
 
@@ -1177,7 +1177,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
 	u16 len, pad = 0;
 	u32 swheader;
 	uint retries = 0;
-	bcmsdh_info_t *sdh;
+	struct brcmf_sdio *sdh;
 	struct sk_buff *new;
 	int i;
 
@@ -1496,7 +1496,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
 	u16 len;
 	u32 swheader;
 	uint retries = 0;
-	bcmsdh_info_t *sdh = bus->sdh;
+	struct brcmf_sdio *sdh = bus->sdh;
 	u8 doff = 0;
 	int ret = -1;
 	int i;
@@ -3199,7 +3199,7 @@ exit:
 
 static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
 {
-	bcmsdh_info_t *sdh = bus->sdh;
+	struct brcmf_sdio *sdh = bus->sdh;
 	struct sdpcmd_regs *regs = bus->regs;
 	uint retries = 0;
 	u16 lastrbc;
@@ -3263,7 +3263,7 @@ static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
 static void
 brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
 {
-	bcmsdh_info_t *sdh = bus->sdh;
+	struct brcmf_sdio *sdh = bus->sdh;
 	uint rdlen, pad;
 
 	int sdret;
@@ -3771,7 +3771,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
 static uint
 brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
 {
-	bcmsdh_info_t *sdh = bus->sdh;
+	struct brcmf_sdio *sdh = bus->sdh;
 
 	u16 len, check;	/* Extracted hardware header fields */
 	u8 chan, seq, doff;	/* Extracted software header fields */
@@ -4439,7 +4439,7 @@ static u32 brcmf_sdbrcm_hostmail(dhd_bus_t *bus)
 
 bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
 {
-	bcmsdh_info_t *sdh = bus->sdh;
+	struct brcmf_sdio *sdh = bus->sdh;
 	struct sdpcmd_regs *regs = bus->regs;
 	u32 intstatus, newstatus = 0;
 	uint retries = 0;
@@ -4706,7 +4706,7 @@ bool dhd_bus_dpc(struct dhd_bus *bus)
 void brcmf_sdbrcm_isr(void *arg)
 {
 	dhd_bus_t *bus = (dhd_bus_t *) arg;
-	bcmsdh_info_t *sdh;
+	struct brcmf_sdio *sdh;
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -6000,7 +6000,7 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
 }
 
 static int
-brcmf_sdbrcm_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci,
+brcmf_sdbrcm_chip_recognition(struct brcmf_sdio *sdh, struct chip_info *ci,
 			    void *regs)
 {
 	u32 regdata;
@@ -6059,7 +6059,7 @@ brcmf_sdbrcm_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci,
 }
 
 static void
-brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase)
 {
 	u32 regdata;
 
@@ -6235,7 +6235,7 @@ fail:
 }
 
 static void
-brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase)
 {
 	u32 regdata;
 
drivers/staging/brcm80211/brcmfmac/sdio_host.h +5 -5
index 4063508..c7d60ca 100644
@@ -60,7 +60,7 @@ extern const uint bcmsdh_msglevel;
 #define SDIOD_MAX_IOFUNCS	7
 
 /* forward declarations */
-typedef struct bcmsdh_info bcmsdh_info_t;
+struct brcmf_sdio;
 typedef void (*bcmsdh_cb_fn_t) (void *);
 
 /* Attach and build an interface to the underlying SD host driver.
@@ -70,7 +70,7 @@ typedef void (*bcmsdh_cb_fn_t) (void *);
  *    implementation may maintain a single "default" handle (e.g. the first or
  *    most recent one) to enable single-instance implementations to pass NULL.
  */
-extern bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva,
+extern struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva,
 					  uint irq);
 
 /* Detach - freeup resources allocated in attach */
@@ -151,7 +151,7 @@ typedef void (*bcmsdh_cmplt_fn_t) (void *handle, int status, bool sync_waiting);
 extern 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);
-extern int brcmf_sdcard_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn,
+extern int brcmf_sdcard_recv_buf(struct brcmf_sdio *sdh, u32 addr, uint fn,
 		uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
 		bcmsdh_cmplt_fn_t complete, void *handle);
 
@@ -194,11 +194,11 @@ extern int brcmf_sdcard_iovar_op(void *sdh, const char *name,
 			   bool set);
 
 /* Reset and reinitialize the device */
-extern int brcmf_sdcard_reset(bcmsdh_info_t *sdh);
+extern int brcmf_sdcard_reset(struct brcmf_sdio *sdh);
 
 /* helper functions */
 
-extern void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
+extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
 
 /* callback functions */
 typedef struct {
Signature · 1 line
1.7.1
author
#62 lore raw

PATCH 58/119 staging: brcm80211: replaced typedef by struct for several sdio types

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |   16 +++++++---------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |    2 +-
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |    6 +++---
 3 files changed, 11 insertions(+), 13 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +7 -9
index 66d81d1..a2408ec 100644
@@ -49,10 +49,8 @@ extern void brcmf_sdbrcm_isr(void *args);
 /**
  * SDIO Host Controller info
  */
-typedef struct bcmsdh_hc bcmsdh_hc_t;
-
 struct bcmsdh_hc {
-	bcmsdh_hc_t *next;
+	struct bcmsdh_hc *next;
 #ifdef BCMPLATFORM_BUS
 	struct device *dev;	/* platform device handle */
 #else
@@ -69,10 +67,10 @@ struct bcmsdh_hc {
 	spinlock_t irq_lock;
 #endif
 };
-static bcmsdh_hc_t *sdhcinfo;
+static struct bcmsdh_hc *sdhcinfo;
 
 /* driver info, initialized when brcmf_sdio_register is called */
-static bcmsdh_driver_t drvinfo = { NULL, NULL };
+static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
 
 /* debugging macros */
 #define SDLX_MSG(x)
@@ -142,7 +140,7 @@ static
 #endif				/* BCMLXSDMMC */
 int brcmf_sdio_probe(struct device *dev)
 {
-	bcmsdh_hc_t *sdhc = NULL;
+	struct bcmsdh_hc *sdhc = NULL;
 	unsigned long regs = 0;
 	struct brcmf_sdio *sdh = NULL;
 #if !defined(BCMLXSDMMC) && defined(BCMPLATFORM_BUS)
@@ -176,7 +174,7 @@ int brcmf_sdio_probe(struct device *dev)
 	}
 #endif				/* defined(OOB_INTR_ONLY) */
 	/* allocate SDIO Host Controller state info */
-	sdhc = kzalloc(sizeof(bcmsdh_hc_t), GFP_ATOMIC);
+	sdhc = kzalloc(sizeof(struct bcmsdh_hc), GFP_ATOMIC);
 	if (!sdhc) {
 		SDLX_MSG(("%s: out of memory\n", __func__));
 		goto err;
@@ -236,7 +234,7 @@ static
 #endif				/* BCMLXSDMMC */
 int brcmf_sdio_remove(struct device *dev)
 {
-	bcmsdh_hc_t *sdhc, *prev;
+	struct bcmsdh_hc *sdhc, *prev;
 
 	sdhc = sdhcinfo;
 	drvinfo.detach(sdhc->ch);
@@ -271,7 +269,7 @@ int brcmf_sdio_remove(struct device *dev)
 
 extern int brcmf_sdio_function_init(void);
 
-int brcmf_sdio_register(bcmsdh_driver_t *driver)
+int brcmf_sdio_register(struct brcmf_sdioh_driver *driver)
 {
 	drvinfo = *driver;
 
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -1
index 2ede425..c00f0f2 100644
@@ -5632,7 +5632,7 @@ static void brcmf_sdbrcm_disconnect(void *ptr)
  * order to look for or await the device.
  */
 
-static bcmsdh_driver_t dhd_sdio = {
+static struct brcmf_sdioh_driver dhd_sdio = {
 	brcmf_sdbrcm_probe,
 	brcmf_sdbrcm_disconnect
 };
drivers/staging/brcm80211/brcmfmac/sdio_host.h +3 -3
index c7d60ca..b7e0754 100644
@@ -201,16 +201,16 @@ extern int brcmf_sdcard_reset(struct brcmf_sdio *sdh);
 extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
 
 /* callback functions */
-typedef struct {
+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);
 	/* detach from device */
 	void (*detach) (void *ch);
-} bcmsdh_driver_t;
+};
 
 /* platform specific/high level functions */
-extern int brcmf_sdio_register(bcmsdh_driver_t *driver);
+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);
Signature · 1 line
1.7.1
author
#63 lore raw

PATCH 59/119 staging: brcm80211: replaced typedef SDIOH_API_RC by int

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h      |   24 ++++++-------
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |   30 ++++++++--------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |   36 ++++++++++----------
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    2 +-
 4 files changed, 45 insertions(+), 47 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +11 -13
index 5d09076..88d0b02 100644
@@ -36,8 +36,6 @@
 #define SDIOH_DATA_PIO          0	/* PIO mode */
 #define SDIOH_DATA_DMA          1	/* DMA mode */
 
-typedef int SDIOH_API_RC;
-
 /* callback function, taking one arg */
 typedef void (*sdioh_cb_fn_t) (void *);
 
@@ -46,17 +44,17 @@ typedef void (*sdioh_cb_fn_t) (void *);
  *  cfghdl points to the starting address of pci device mapped memory
  */
 extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
-extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *si);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_register(struct sdioh_info *si,
+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 SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
+extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
 
 /* query whether SD interrupt is enabled or not */
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
 
 /* enable or disable SD interrupt */
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
 
 #if defined(DHD_DEBUG)
@@ -67,30 +65,30 @@ 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 SDIOH_API_RC
+extern int
 brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
 			 u8 *byte);
 
 /* read or write 2/4 bytes using cmd53 */
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_request_word(struct sdioh_info *si, uint cmd_type,
 			 uint rw, uint fnc, uint addr,
 			 u32 *word, uint nbyte);
 
 /* read or write any buffer using cmd53 */
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_request_buffer(struct sdioh_info *si, uint pio_dma,
 			   uint fix_inc, uint rw, uint fnc_num,
 			   u32 addr, uint regwidth,
 			   u32 buflen, u8 *buffer, struct sk_buff *pkt);
 
 /* get cis data */
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_cis_read(struct sdioh_info *si, uint fuc, u8 *cis, u32 length);
 
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
 
 /* query number of io functions */
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +15 -15
index 0ebca53..733ba96 100644
@@ -109,7 +109,7 @@ brcmf_sdcard_iovar_op(void *sdh, const char *name,
 bool brcmf_sdcard_intr_query(void *sdh)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 	bool on;
 
 	ASSERT(bcmsdh);
@@ -123,7 +123,7 @@ bool brcmf_sdcard_intr_query(void *sdh)
 int brcmf_sdcard_intr_enable(void *sdh)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 	ASSERT(bcmsdh);
 
 	status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
@@ -133,7 +133,7 @@ int brcmf_sdcard_intr_enable(void *sdh)
 int brcmf_sdcard_intr_disable(void *sdh)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 	ASSERT(bcmsdh);
 
 	status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
@@ -143,7 +143,7 @@ int brcmf_sdcard_intr_disable(void *sdh)
 int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 	ASSERT(bcmsdh);
 
 	status = brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
@@ -153,7 +153,7 @@ int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
 int brcmf_sdcard_intr_dereg(void *sdh)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 	ASSERT(bcmsdh);
 
 	status = brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
@@ -181,7 +181,7 @@ 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;
-	SDIOH_API_RC status;
+	int status;
 #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
 	s32 retry = 0;
 #endif
@@ -217,7 +217,7 @@ void
 brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
 	s32 retry = 0;
 #endif
@@ -249,7 +249,7 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
 u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 	u32 data = 0;
 
 	if (!bcmsdh)
@@ -274,7 +274,7 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
 		      int *err)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 
 	if (!bcmsdh)
 		bcmsdh = l_bcmsdh;
@@ -295,7 +295,7 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
 int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 
 	u8 *tmp_buf, *tmp_ptr;
 	u8 *ptr;
@@ -355,7 +355,7 @@ 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;
-	SDIOH_API_RC status;
+	int status;
 	u32 word = 0;
 	uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
 
@@ -408,7 +408,7 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
 u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 	uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
 	int err = 0;
 
@@ -454,7 +454,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
 		u8 *buf, uint nbytes, struct sk_buff *pkt,
 		bcmsdh_cmplt_fn_t complete, void *handle)
 {
-	SDIOH_API_RC status;
+	int status;
 	uint incr_fix;
 	uint width;
 	uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -498,7 +498,7 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
 		bcmsdh_cmplt_fn_t complete, void *handle)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 	uint incr_fix;
 	uint width;
 	uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -539,7 +539,7 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
 int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
-	SDIOH_API_RC status;
+	int status;
 
 	ASSERT(bcmsdh);
 	ASSERT(bcmsdh->init_success);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +18 -18
index df1e8c1..4f7d32a 100644
@@ -167,7 +167,7 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
 	return sd;
 }
 
-extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *sd)
+extern int brcmf_sdioh_detach(struct sdioh_info *sd)
 {
 	sd_trace(("%s\n", __func__));
 
@@ -193,7 +193,7 @@ extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *sd)
 
 #if defined(OOB_INTR_ONLY) && defined(HW_OOB)
 
-extern SDIOH_API_RC brcmf_sdioh_enable_func_intr(void)
+extern int brcmf_sdioh_enable_func_intr(void)
 {
 	u8 reg;
 	int err;
@@ -227,7 +227,7 @@ extern SDIOH_API_RC brcmf_sdioh_enable_func_intr(void)
 	return SDIOH_API_RC_SUCCESS;
 }
 
-extern SDIOH_API_RC brcmf_sdioh_disable_func_intr(void)
+extern int brcmf_sdioh_disable_func_intr(void)
 {
 	u8 reg;
 	int err;
@@ -260,7 +260,7 @@ extern SDIOH_API_RC brcmf_sdioh_disable_func_intr(void)
 #endif				/* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
 
 /* Configure callback to client when we receive client interrupt */
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
 			       void *argh)
 {
@@ -293,7 +293,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
 	return SDIOH_API_RC_SUCCESS;
 }
 
-extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
+extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
 {
 	sd_trace(("%s: Entering\n", __func__));
 
@@ -322,7 +322,7 @@ extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
 	return SDIOH_API_RC_SUCCESS;
 }
 
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
 {
 	sd_trace(("%s: Entering\n", __func__));
@@ -536,9 +536,9 @@ exit:
 
 #if defined(OOB_INTR_ONLY) && defined(HW_OOB)
 
-SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
+int brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
 {
-	SDIOH_API_RC status;
+	int status;
 	u8 data;
 
 	if (enable)
@@ -552,20 +552,20 @@ SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
 }
 #endif				/* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
 
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_cfg_read(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
 {
-	SDIOH_API_RC status;
+	int status;
 	/* No lock needed since brcmf_sdioh_request_byte does locking */
 	status = brcmf_sdioh_request_byte(sd, SDIOH_READ, fnc_num, addr, data);
 	return status;
 }
 
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_cfg_write(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
 {
 	/* No lock needed since brcmf_sdioh_request_byte does locking */
-	SDIOH_API_RC status;
+	int status;
 	status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, fnc_num, addr, data);
 	return status;
 }
@@ -591,7 +591,7 @@ static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr)
 	return scratch;
 }
 
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
 {
 	u32 count;
@@ -625,7 +625,7 @@ brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
 	return SDIOH_API_RC_SUCCESS;
 }
 
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 			 uint regaddr, u8 *byte)
 {
@@ -724,7 +724,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 	return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
 }
 
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
 			 uint func, uint addr, u32 *word, uint nbytes)
 {
@@ -777,7 +777,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
 	return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
 }
 
-static SDIOH_API_RC
+static int
 brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
 			   uint func, uint addr, struct sk_buff *pkt)
 {
@@ -873,12 +873,12 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
  * aligned packet.
  *
  */
-extern SDIOH_API_RC
+extern int
 brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
 			   uint write, uint func, uint addr, uint reg_width,
 			   uint buflen_u, u8 *buffer, struct sk_buff *pkt)
 {
-	SDIOH_API_RC Status;
+	int Status;
 	struct sk_buff *mypkt = NULL;
 
 	sd_trace(("%s: Enter\n", __func__));
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +1 -1
index 955168f..c95112e 100644
@@ -172,7 +172,7 @@ void brcmf_sdioh_osfree(struct sdioh_info *sd)
 }
 
 /* Interrupt enable/disable */
-SDIOH_API_RC brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
+int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
 {
 	unsigned long flags;
 	struct sdos_info *sdos;
Signature · 1 line
1.7.1
author
#64 lore raw

PATCH 60/119 staging: brcm80211: replaced more sdio related typedefs by structs

In reply to Franky Lin

From: Roland Vossen <[email protected]>

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    8 ++-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   54 ++++++++++----------
 drivers/staging/brcm80211/brcmfmac/sdiovar.h      |    4 +-
 3 files changed, 34 insertions(+), 32 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +5 -3
index 4f7d32a..c814701 100644
@@ -359,7 +359,7 @@ const struct brcmu_iovar sdioh_iovars[] = {
 								 size) */
 	{"sd_ints", IOV_USEINTS, 0, IOVT_BOOL, 0},
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
-	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
+	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
 	,
 	{"sd_rxchain", IOV_RXCHAIN, 0, IOVT_BOOL, 0}
 	,
@@ -498,7 +498,8 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
 
 	case IOV_GVAL(IOV_DEVREG):
 		{
-			sdreg_t *sd_ptr = (sdreg_t *) params;
+			struct brcmf_sdreg *sd_ptr =
+					(struct brcmf_sdreg *) params;
 			u8 data = 0;
 
 			if (brcmf_sdioh_cfg_read
@@ -514,7 +515,8 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
 
 	case IOV_SVAL(IOV_DEVREG):
 		{
-			sdreg_t *sd_ptr = (sdreg_t *) params;
+			struct brcmf_sdreg *sd_ptr =
+					(struct brcmf_sdreg *) params;
 			u8 data = (u8) sd_ptr->value;
 
 			if (brcmf_sdioh_cfg_write
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +27 -27

187 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sdiovar.h +2 -2
index d1cfa5f..35e913b 100644
@@ -17,11 +17,11 @@
 #ifndef _sdiovar_h_
 #define _sdiovar_h_
 
-typedef struct sdreg {
+struct brcmf_sdreg {
 	int func;
 	int offset;
 	int value;
-} sdreg_t;
+};
 
 /* Common msglevel constants */
 #define SDH_ERROR_VAL		0x0001	/* Error */
Signature · 1 line
1.7.1
author
#65 lore raw

PATCH 61/119 staging: brcm80211: further renaming in fullmac sources

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

couple of items needed renaming to more consistent naming convention.

---
 drivers/staging/brcm80211/brcmfmac/Makefile      |    4 +-
 drivers/staging/brcm80211/brcmfmac/dhd.h         |    8 +-
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h     |    8 ++
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c     |   10 +--
 drivers/staging/brcm80211/brcmfmac/dhd_common.c  |   20 +---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |   10 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c    |  110 ++++++++++------------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |    9 +-
 8 files changed, 80 insertions(+), 99 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +2 -2
index 9fa689b..07b9340 100644
@@ -21,9 +21,9 @@ ccflags-y :=			\
 	-DBCMPLATFORM_BUS	\
 	-DBCMSDIO		\
 	-DBRCM_FULLMAC		\
-	-DDHD_FIRSTREAD=64	\
+	-DBRCMF_FIRSTREAD=64	\
 	-DDHD_SCHED		\
-	-DDHD_SDALIGN=64	\
+	-DBRCMF_SDALIGN=64	\
 	-DEMBEDDED_PLATFORM	\
 	-DMAX_HDR_READ=64	\
 	-DMMC_SDIO_ABORT	\
drivers/staging/brcm80211/brcmfmac/dhd.h +4 -4
index c990a2c..fb88c05 100644
@@ -725,20 +725,20 @@ typedef struct {
 } bcmevent_name_t;
 
 #if defined(CONFIG_PM_SLEEP)
-extern atomic_t dhd_mmc_suspend;
+extern atomic_t brcmf_mmc_suspend;
 #define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
 #define _DHD_PM_RESUME_WAIT(a, b) do { \
 		int retry = 0; \
-		while (atomic_read(&dhd_mmc_suspend) && retry++ != b) { \
+		while (atomic_read(&brcmf_mmc_suspend) && retry++ != b) { \
 			wait_event_timeout(a, false, HZ/100); \
 		} \
 	}	while (0)
 #define DHD_PM_RESUME_WAIT(a)	_DHD_PM_RESUME_WAIT(a, 30)
 #define DHD_PM_RESUME_WAIT_FOREVER(a)	_DHD_PM_RESUME_WAIT(a, ~0)
 #define DHD_PM_RESUME_RETURN_ERROR(a)	\
-	do { if (atomic_read(&dhd_mmc_suspend)) return a; } while (0)
+	do { if (atomic_read(&brcmf_mmc_suspend)) return a; } while (0)
 #define DHD_PM_RESUME_RETURN	do { \
-	if (atomic_read(&dhd_mmc_suspend)) \
+	if (atomic_read(&brcmf_mmc_suspend)) \
 		return; \
 	} while (0)
 
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +8 -0
index 128a00d..73b72ff 100644
@@ -17,6 +17,14 @@
 #ifndef _dhd_bus_h_
 #define _dhd_bus_h_
 
+/* Packet alignment for most efficient SDIO (can change based on platform) */
+#ifndef BRCMF_SDALIGN
+#define BRCMF_SDALIGN	32
+#endif
+#if !ISPOWEROF2(BRCMF_SDALIGN)
+#error BRCMF_SDALIGN is not a power of 2!
+#endif
+
 /*
  * Exported from dhd bus module (dhd_usb, dhd_sdio)
  */
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -9
index c544cbf..594c217 100644
@@ -84,16 +84,8 @@ struct brcmf_proto_bdc_header {
 int wifi_get_mac_addr(unsigned char *buf);
 #endif
 
-/* Packet alignment for most efficient SDIO (can change based on platform) */
-#ifndef DHD_SDALIGN
-#define DHD_SDALIGN	32
-#endif
-#if !ISPOWEROF2(DHD_SDALIGN)
-#error DHD_SDALIGN is not a power of 2!
-#endif
-
 #define RETRIES 2	/* # of retries to retrieve matching ioctl response */
-#define BUS_HEADER_LEN	(16+DHD_SDALIGN) /* Must be atleast SDPCM_RESERVE
+#define BUS_HEADER_LEN	(16+BRCMF_SDALIGN) /* Must be atleast SDPCM_RESERVE
 					 * defined in dhd_sdio.c
 					 * (amount of header tha might be added)
 					 * plus any space that might be needed
drivers/staging/brcm80211/brcmfmac/dhd_common.c +6 -14
index a255d3d..deb8566 100644
@@ -27,22 +27,15 @@
 #include "dhd_proto.h"
 #include "dhd_dbg.h"
 
-#define BRCM_OUI		"\x00\x10\x18"
+#define BRCM_OUI			"\x00\x10\x18"
 #define DOT11_OUI_LEN			3
-#define BCMILCP_BCM_SUBTYPE_EVENT		1
+#define BCMILCP_BCM_SUBTYPE_EVENT	1
+#define PKTFILTER_BUF_SIZE		2048
 
 int brcmf_msg_level;
 char brcmf_fw_path[MOD_PARAM_PATHLEN];
 char brcmf_nv_path[MOD_PARAM_PATHLEN];
 
-/* Packet alignment for most efficient SDIO (can change based on platform) */
-#ifndef DHD_SDALIGN
-#define DHD_SDALIGN	32
-#endif
-#if !ISPOWEROF2(DHD_SDALIGN)
-#error DHD_SDALIGN is not a power of 2!
-#endif
-
 #define EPI_VERSION_STR         "4.218.248.5"
 #define MSGTRACE_VERSION	1
 
@@ -1028,7 +1021,6 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
 	char *argv[8], *buf = 0;
 	int i = 0;
 	char *arg_save = 0, *arg_org = 0;
-#define BUF_SIZE		2048
 
 	arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
 	if (!arg_save) {
@@ -1038,7 +1030,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
 
 	arg_org = arg_save;
 
-	buf = kmalloc(BUF_SIZE, GFP_ATOMIC);
+	buf = kmalloc(PKTFILTER_BUF_SIZE, GFP_ATOMIC);
 	if (!buf) {
 		DHD_ERROR(("%s: kmalloc failed\n", __func__));
 		goto fail;
@@ -1046,7 +1038,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
 
 	memcpy(arg_save, arg, strlen(arg) + 1);
 
-	if (strlen(arg) > BUF_SIZE) {
+	if (strlen(arg) > PKTFILTER_BUF_SIZE) {
 		DHD_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
 			   (int)sizeof(buf)));
 		goto fail;
@@ -1193,7 +1185,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	uint up = 0;
 	char buf[128], *ptr;
 	uint power_mode = PM_FAST;
-	u32 dongle_align = DHD_SDALIGN;
+	u32 dongle_align = BRCMF_SDALIGN;
 	u32 glom = 0;
 	uint bcn_timeout = 3;
 	int scan_assoc_time = 40;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +5 -5
index 5aa4492..9ee4866 100644
@@ -173,7 +173,7 @@ void wifi_del_dev(void)
 
 #if defined(CONFIG_PM_SLEEP)
 #include <linux/suspend.h>
-atomic_t dhd_mmc_suspend;
+atomic_t brcmf_mmc_suspend;
 DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
 #endif	/*  defined(CONFIG_PM_SLEEP) */
 
@@ -1910,7 +1910,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	g_bus = bus;
 #endif
 #if defined(CONFIG_PM_SLEEP)
-	atomic_set(&dhd_mmc_suspend, false);
+	atomic_set(&brcmf_mmc_suspend, false);
 #endif	/* defined(CONFIG_PM_SLEEP) */
 	/* && defined(DHD_GPL) */
 	/* Init lock suspend to prevent kernel going to suspend */
@@ -2055,7 +2055,7 @@ int brcmf_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf,
 	return ret;
 }
 
-static struct net_device_ops dhd_ops_pri = {
+static struct net_device_ops brcmf_netdev_ops_pri = {
 	.ndo_open = brcmf_netdev_open,
 	.ndo_stop = brcmf_netdev_stop,
 	.ndo_get_stats = brcmf_netdev_get_stats,
@@ -2080,7 +2080,7 @@ int brcmf_net_attach(dhd_pub_t *dhdp, int ifidx)
 	ASSERT(net);
 
 	ASSERT(!net->netdev_ops);
-	net->netdev_ops = &dhd_ops_pri;
+	net->netdev_ops = &brcmf_netdev_ops_pri;
 
 	/*
 	 * We have to use the primary MAC for virtual interfaces
@@ -2168,7 +2168,7 @@ void brcmf_detach(dhd_pub_t *dhdp)
 
 			ifp = dhd->iflist[0];
 			ASSERT(ifp);
-			if (ifp->net->netdev_ops == &dhd_ops_pri) {
+			if (ifp->net->netdev_ops == &brcmf_netdev_ops_pri) {
 				brcmf_netdev_stop(ifp->net);
 				unregister_netdev(ifp->net);
 			}
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +51 -59

325 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +3 -6
index ca45829..086a93b 100644
@@ -2095,7 +2095,7 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
 	WL_TRACE("Enter\n");
 
 #if defined(CONFIG_PM_SLEEP)
-	atomic_set(&dhd_mmc_suspend, false);
+	atomic_set(&brcmf_mmc_suspend, false);
 #endif	/*  defined(CONFIG_PM_SLEEP) */
 
 	if (test_bit(WL_STATUS_READY, &wl->status)) {
@@ -2166,7 +2166,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
 	}
 
 #if defined(CONFIG_PM_SLEEP)
-	atomic_set(&dhd_mmc_suspend, true);
+	atomic_set(&brcmf_mmc_suspend, true);
 #endif	/*  defined(CONFIG_PM_SLEEP) */
 
 	WL_TRACE("Exit\n");
@@ -4014,9 +4014,6 @@ dongle_scantime_out:
 
 s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
 {
-#ifndef DHD_SDALIGN
-#define DHD_SDALIGN	32
-#endif
 	struct net_device *ndev;
 	struct wireless_dev *wdev;
 	s32 err = 0;
@@ -4039,7 +4036,7 @@ s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
 	err = wl_dongle_power(ndev, PM_FAST);
 	if (unlikely(err))
 		goto default_conf_out;
-	err = wl_dongle_glom(ndev, 0, DHD_SDALIGN);
+	err = wl_dongle_glom(ndev, 0, BRCMF_SDALIGN);
 	if (unlikely(err))
 		goto default_conf_out;
 
Signature · 1 line
1.7.1
#66 lore raw

Re: [PATCH 061/119] staging: brcm80211: further renaming in fullmac sources

drivers/staging/brcm80211/brcmfmac/dhd_common.c void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg) · line 1041

Quoted 6 lines · Franky Lin
drivers/staging/brcm80211/brcmfmac/dhd_common.c +1 -1
@@ -1046,7 +1038,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
 
 	memcpy(arg_save, arg, strlen(arg) + 1);
 
-	if (strlen(arg) > BUF_SIZE) {
+	if (strlen(arg) > PKTFILTER_BUF_SIZE) {

strlen() doesn't include the NULL terminator so probably this test is off by one. I didn't actually follow the code through to see where the buffer overflow happens. The arg_save buffer is dynamically allocated to the correct size... buf was the only buffer that is PKTFILTER_BUF_SIZE and it stores a different string.

(maybe the test can just be removed?).

This whole function could be cleaned up with regards to string handling.

For example:

	str = "pkt_filter_add";
	str_len = strlen(str);
	strncpy(buf, str, str_len);
	buf[str_len] = '\0';

could be replaced with:

	strcpy(buf, "pkt_filter_add");

drivers/staging/brcm80211/brcmfmac/dhd_common.c void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg) · line 1044

Quoted 3 lines
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -0
 		DHD_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
 			   (int)sizeof(buf)));
 		goto fail;

regards,
dan carpenter

#67 lore raw

Re: [PATCH 061/119] staging: brcm80211: further renaming in fullmac sources

Hello Dan,

I will create a patch (in the short term, couple of days) to address the issues you detected below. Since this patch [061/119] does not regress behavior, is it ok with you to *not* drop it ?

Quoted 13 lines

drivers/staging/brcm80211/brcmfmac/dhd_common.c void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg) · line 1041

Quoted 6 lines
drivers/staging/brcm80211/brcmfmac/dhd_common.c +1 -1
@@ -1046,7 +1038,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
 
  	memcpy(arg_save, arg, strlen(arg) + 1);
 
-	if (strlen(arg)>  BUF_SIZE) {
+	if (strlen(arg)>  PKTFILTER_BUF_SIZE) {

strlen() doesn't include the NULL terminator so probably this test is off by one. I didn't actually follow the code through to see where the buffer overflow happens. The arg_save buffer is dynamically allocated to the correct size... buf was the only buffer that is PKTFILTER_BUF_SIZE and it stores a different string.

Quoted 1 line

(maybe the test can just be removed?).

I agree, the test is useless. So I will remove it.

Quoted 15 lines

This whole function could be cleaned up with regards to string handling.

For example:

	str = "pkt_filter_add";
	str_len = strlen(str);
	strncpy(buf, str, str_len);
	buf[str_len] = '\0';

could be replaced with:

	strcpy(buf, "pkt_filter_add");
Quoted 3 lines
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -0
  		DHD_ERROR(("Not enough buffer %d<  %d\n", (int)strlen(arg),
  			   (int)sizeof(buf)));
  		goto fail;

Not completely, since variable 'str_len' is used in subsequent code. But this code snippet can be simplified. Will work on it.

Thanks for the feedback,

Roland.

#68 lore raw

Re: [PATCH 061/119] staging: brcm80211: further renaming in fullmac sources

Quoted 6 lines · Roland Vossen

Hello Dan,

I will create a patch (in the short term, couple of days) to address the issues you detected below. Since this patch [061/119] does not regress behavior, is it ok with you to *not* drop it ?

Yeah. I said that earlier, that we should just apply the whole series as is.

These were all in the original code etc, but I there can't be a hundred patches in a row without some complaints or it looks like no one is reviewing. :)

The whole series looks good by the way.

regards,
dan carpenter

author
#69 lore raw

PATCH 62/119 staging: brcm80211: remove ARP_OFFLOAD_SUPPORT macro definition

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The conditional code for ARP offloading is now always enabled in the fullmac driver.

---
 drivers/staging/brcm80211/brcmfmac/Makefile     |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |    2 --
 2 files changed, 0 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index 07b9340..8a7cbf3 100644
@@ -16,7 +16,6 @@
 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 ccflags-y :=			\
-	-DARP_OFFLOAD_SUPPORT	\
 	-DBCMLXSDMMC		\
 	-DBCMPLATFORM_BUS	\
 	-DBCMSDIO		\
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -2
index deb8566..8f593cf 100644
@@ -1283,12 +1283,10 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
 			 (char *)&scan_unassoc_time, sizeof(scan_unassoc_time));
 
-#ifdef ARP_OFFLOAD_SUPPORT
 	/* 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);
-#endif				/* ARP_OFFLOAD_SUPPORT */
 
 #ifdef PKT_FILTER_SUPPORT
 	{
Signature · 1 line
1.7.1
author
#70 lore raw

PATCH 63/119 staging: brcm80211: remove PKT_FILTER_SUPPORT macro definition

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Packet filtering support is now always compiled into the fullmac driver.

---
 drivers/staging/brcm80211/brcmfmac/Makefile     |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd.h        |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |   24 +++++++++-------------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |    2 -
 4 files changed, 10 insertions(+), 19 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index 8a7cbf3..95d3147 100644
@@ -26,7 +26,6 @@ ccflags-y :=			\
 	-DEMBEDDED_PLATFORM	\
 	-DMAX_HDR_READ=64	\
 	-DMMC_SDIO_ABORT	\
-	-DPKT_FILTER_SUPPORT	\
 	-DSHOW_EVENTS		\
 	-DTOE
 
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
index fb88c05..65e00a8 100644
@@ -970,11 +970,9 @@ 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);
 
-#ifdef PKT_FILTER_SUPPORT
 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);
-#endif
 
 #ifdef BCMDBG
 #define ASSERT(exp) \
drivers/staging/brcm80211/brcmfmac/dhd_common.c +10 -14
index 8f593cf..b481eb3 100644
@@ -1190,6 +1190,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 	uint bcn_timeout = 3;
 	int scan_assoc_time = 40;
 	int scan_unassoc_time = 40;
+	int i;
 #ifdef GET_CUSTOM_MAC_ENABLE
 	int ret = 0;
 	u8 ea_addr[ETH_ALEN];
@@ -1288,22 +1289,17 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
 		brcmf_c_arp_offload_set(dhd, brcmf_arp_mode);
 	brcmf_c_arp_offload_enable(dhd, brcmf_arp_enable);
 
-#ifdef PKT_FILTER_SUPPORT
-	{
-		int i;
-		/* 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],
-				     brcmf_pkt_filter_init,
-				     brcmf_master_mode);
-			}
+	/* 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],
+			     brcmf_pkt_filter_init,
+			     brcmf_master_mode);
 		}
 	}
-#endif				/* PKT_FILTER_SUPPORT */
 
 	brcmf_os_proto_unblock(dhd);
 
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -2
index 9ee4866..c3a0e94 100644
@@ -375,7 +375,6 @@ static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 
 static void brcmf_set_packet_filter(int value, dhd_pub_t *dhd)
 {
-#ifdef PKT_FILTER_SUPPORT
 	DHD_TRACE(("%s: %d\n", __func__, value));
 	/* 1 - Enable packet filter, only allow unicast packet to send up */
 	/* 0 - Disable packet filter */
@@ -388,7 +387,6 @@ static void brcmf_set_packet_filter(int value, dhd_pub_t *dhd)
 						     value, brcmf_master_mode);
 		}
 	}
-#endif
 }
 
 #if defined(CONFIG_HAS_EARLYSUSPEND)
Signature · 1 line
1.7.1
author
#71 lore raw

PATCH 64/119 staging: brcm80211: remove BCMLXSDMMC macro definition

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The conditional code depending on BCMLXSDMMC macro definition is always compiled into the fullmac driver.

---
 drivers/staging/brcm80211/brcmfmac/Makefile        |    1 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |   39 +-------------------
 .../staging/brcm80211/brcmfmac/dhd_custom_gpio.c   |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    9 +----
 4 files changed, 2 insertions(+), 49 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index 95d3147..f76e62a 100644
@@ -16,7 +16,6 @@
 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 ccflags-y :=			\
-	-DBCMLXSDMMC		\
 	-DBCMPLATFORM_BUS	\
 	-DBCMSDIO		\
 	-DBRCM_FULLMAC		\
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +1 -38
index a2408ec..5243f33 100644
@@ -121,7 +121,6 @@ bool brcmf_sdio_chipmatch(u16 vendor, u16 device)
 }
 
 #if defined(BCMPLATFORM_BUS)
-#if defined(BCMLXSDMMC)
 /* forward declarations */
 int brcmf_sdio_probe(struct device *dev);
 EXPORT_SYMBOL(brcmf_sdio_probe);
@@ -129,36 +128,15 @@ EXPORT_SYMBOL(brcmf_sdio_probe);
 int brcmf_sdio_remove(struct device *dev);
 EXPORT_SYMBOL(brcmf_sdio_remove);
 
-#else
-/* forward declarations */
-static int __devinit brcmf_sdio_probe(struct device *dev);
-static int __devexit brcmf_sdio_remove(struct device *dev);
-#endif				/* BCMLXSDMMC */
-
-#ifndef BCMLXSDMMC
-static
-#endif				/* BCMLXSDMMC */
 int brcmf_sdio_probe(struct device *dev)
 {
 	struct bcmsdh_hc *sdhc = NULL;
 	unsigned long regs = 0;
 	struct brcmf_sdio *sdh = NULL;
-#if !defined(BCMLXSDMMC) && defined(BCMPLATFORM_BUS)
-	struct platform_device *pdev;
-	struct resource *r;
-#endif				/* BCMLXSDMMC */
 	int irq = 0;
 	u32 vendevid;
 	unsigned long irq_flags = 0;
 
-#if !defined(BCMLXSDMMC) && defined(BCMPLATFORM_BUS)
-	pdev = to_platform_device(dev);
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	irq = platform_get_irq(pdev, 0);
-	if (!r || irq == NO_IRQ)
-		return -ENXIO;
-#endif				/* BCMLXSDMMC */
-
 #if defined(OOB_INTR_ONLY)
 #ifdef HW_OOB
 	irq_flags =
@@ -181,19 +159,12 @@ int brcmf_sdio_probe(struct device *dev)
 	}
 	sdhc->dev = (void *)dev;
 
-#ifdef BCMLXSDMMC
 	sdh = brcmf_sdcard_attach((void *)0, (void **)&regs, irq);
 	if (!sdh) {
 		SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
 		goto err;
 	}
-#else
-	sdh = brcmf_sdcard_attach((void *)r->start, (void **)&regs, irq);
-	if (!sdh) {
-		SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
-		goto err;
-	}
-#endif				/* BCMLXSDMMC */
+
 	sdhc->sdh = sdh;
 	sdhc->oob_irq = irq;
 	sdhc->oob_flags = irq_flags;
@@ -229,9 +200,6 @@ err:
 	return -ENODEV;
 }
 
-#ifndef BCMLXSDMMC
-static
-#endif				/* BCMLXSDMMC */
 int brcmf_sdio_remove(struct device *dev)
 {
 	struct bcmsdh_hc *sdhc, *prev;
@@ -258,11 +226,6 @@ int brcmf_sdio_remove(struct device *dev)
 
 	/* release SDIO Host Controller info */
 	kfree(sdhc);
-
-#if !defined(BCMLXSDMMC)
-	dev_set_drvdata(dev, NULL);
-#endif				/* !defined(BCMLXSDMMC) */
-
 	return 0;
 }
 #endif				/* BCMPLATFORM_BUS */
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +0 -2
index a60caea..6fd1072 100644
@@ -38,9 +38,7 @@ int wifi_get_irq_number(unsigned long *irq_flags_ptr);
 
 #if defined(OOB_INTR_ONLY)
 
-#if defined(BCMLXSDMMC)
 extern int sdioh_mmc_irq(int irq);
-#endif				/* (BCMLXSDMMC)  */
 
 #ifdef CUSTOMER_HW3
 #include <mach/gpio.h>
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -8
index 2b1762e..afb840a 100644
@@ -923,14 +923,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
 		DHD_INFO(("CLKCTL: turned ON\n"));
 
 #if defined(DHD_DEBUG)
-		if (bus->alp_only == true) {
-#if !defined(BCMLXSDMMC)
-			if (!SBSDIO_ALPONLY(clkctl)) {
-				DHD_ERROR(("%s: HT Clock, when ALP Only\n",
-					   __func__));
-			}
-#endif				/* !defined(BCMLXSDMMC) */
-		} else {
+		if (bus->alp_only != true) {
 			if (SBSDIO_ALPONLY(clkctl)) {
 				DHD_ERROR(("%s: HT Clock should be on.\n",
 					   __func__));
Signature · 1 line
1.7.1
author
#72 lore raw

PATCH 65/119 staging: brcm80211: always enable code for PLATFORM_BUS functionality

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Some code is conditionally compiled in upon defintion of PLATFORM_BUS macro. This patch will have it compiled in unconditionally.

---
 drivers/staging/brcm80211/brcmfmac/Makefile       |    1 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    9 ---------
 2 files changed, 0 insertions(+), 10 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index f76e62a..0674a6a 100644
@@ -16,7 +16,6 @@
 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 ccflags-y :=			\
-	-DBCMPLATFORM_BUS	\
 	-DBCMSDIO		\
 	-DBRCM_FULLMAC		\
 	-DBRCMF_FIRSTREAD=64	\
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -9
index 5243f33..5194c59 100644
@@ -36,9 +36,6 @@
 extern void brcmf_sdbrcm_isr(void *args);
 #endif				/* defined(OOB_INTR_ONLY) */
 #if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270)
-#if !defined(BCMPLATFORM_BUS)
-#define BCMPLATFORM_BUS
-#endif				/* !defined(BCMPLATFORM_BUS) */
 
 #include <linux/platform_device.h>
 #endif				/* CONFIG_MACH_SANDGATE2G */
@@ -51,11 +48,7 @@ extern void brcmf_sdbrcm_isr(void *args);
  */
 struct bcmsdh_hc {
 	struct bcmsdh_hc *next;
-#ifdef BCMPLATFORM_BUS
 	struct device *dev;	/* platform device handle */
-#else
-	struct pci_dev *dev;	/* pci device handle */
-#endif				/* BCMPLATFORM_BUS */
 	void *regs;		/* SDIO Host Controller address */
 	struct brcmf_sdio *sdh;	/* SDIO Host Controller handle */
 	void *ch;
@@ -120,7 +113,6 @@ bool brcmf_sdio_chipmatch(u16 vendor, u16 device)
 	return false;
 }
 
-#if defined(BCMPLATFORM_BUS)
 /* forward declarations */
 int brcmf_sdio_probe(struct device *dev);
 EXPORT_SYMBOL(brcmf_sdio_probe);
@@ -228,7 +220,6 @@ int brcmf_sdio_remove(struct device *dev)
 	kfree(sdhc);
 	return 0;
 }
-#endif				/* BCMPLATFORM_BUS */
 
 extern int brcmf_sdio_function_init(void);
 
Signature · 1 line
1.7.1
author
#73 lore raw

PATCH 66/119 staging: brcm80211: remove DHD_SCHED macro definition

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The fullmac driver now always uses scheduler functionality.

---
 drivers/staging/brcm80211/brcmfmac/Makefile    |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |    4 ----
 2 files changed, 0 insertions(+), 5 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index 0674a6a..1444fd4 100644
@@ -19,7 +19,6 @@ ccflags-y :=			\
 	-DBCMSDIO		\
 	-DBRCM_FULLMAC		\
 	-DBRCMF_FIRSTREAD=64	\
-	-DDHD_SCHED		\
 	-DBRCMF_SDALIGN=64	\
 	-DEMBEDDED_PLATFORM	\
 	-DMAX_HDR_READ=64	\
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -4
index c3a0e94..593d180 100644
@@ -1201,14 +1201,12 @@ static int brcmf_watchdog_thread(void *data)
 	/* This thread doesn't need any user-level access,
 	 * so get rid of all our resources
 	 */
-#ifdef DHD_SCHED
 	if (brcmf_watchdog_prio > 0) {
 		struct sched_param param;
 		param.sched_priority = (brcmf_watchdog_prio < MAX_RT_PRIO) ?
 		    brcmf_watchdog_prio : (MAX_RT_PRIO - 1);
 		sched_setscheduler(current, SCHED_FIFO, &param);
 	}
-#endif				/* DHD_SCHED */
 
 	allow_signal(SIGTERM);
 	/* Run until signal received */
@@ -1261,7 +1259,6 @@ static int brcmf_dpc_thread(void *data)
 	/* This thread doesn't need any user-level access,
 	 * so get rid of all our resources
 	 */
-#ifdef DHD_SCHED
 	if (brcmf_dpc_prio > 0) {
 		struct sched_param param;
 		param.sched_priority =
@@ -1269,7 +1266,6 @@ static int brcmf_dpc_thread(void *data)
 		     MAX_RT_PRIO) ? brcmf_dpc_prio : (MAX_RT_PRIO - 1);
 		sched_setscheduler(current, SCHED_FIFO, &param);
 	}
-#endif				/* DHD_SCHED */
 
 	allow_signal(SIGTERM);
 	/* Run until signal received */
Signature · 1 line
1.7.1
author
#74 lore raw

PATCH 67/119 staging: brcm80211: remove EMBEDDED_PLATFORM macro definition

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The macro is always intended to be defined so no need for it.

---
 drivers/staging/brcm80211/brcmfmac/Makefile      |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c     |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |    5 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |  238 ----------------------
 4 files changed, 1 insertions(+), 245 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index 1444fd4..2ccfa1f 100644
@@ -20,7 +20,6 @@ ccflags-y :=			\
 	-DBRCM_FULLMAC		\
 	-DBRCMF_FIRSTREAD=64	\
 	-DBRCMF_SDALIGN=64	\
-	-DEMBEDDED_PLATFORM	\
 	-DMAX_HDR_READ=64	\
 	-DMMC_SDIO_ABORT	\
 	-DSHOW_EVENTS		\
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +0 -2
index 594c217..a766707 100644
@@ -504,9 +504,7 @@ int brcmf_proto_init(dhd_pub_t *dhd)
 
 	brcmf_os_proto_unblock(dhd);
 
-#ifdef EMBEDDED_PLATFORM
 	ret = brcmf_c_preinit_ioctls(dhd);
-#endif				/* EMBEDDED_PLATFORM */
 
 	/* Always assumes wl for now */
 	dhd->iswl = true;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -4
index 593d180..8a2c73d 100644
@@ -1930,10 +1930,8 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
 {
 	int ret = -1;
 	dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
-#ifdef EMBEDDED_PLATFORM
 	char iovbuf[WL_EVENTING_MASK_LEN + 12];	/*  Room for "event_msgs" +
 						 '\0' + bitvec  */
-#endif				/* EMBEDDED_PLATFORM */
 
 	ASSERT(dhd);
 
@@ -1981,7 +1979,7 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
 		DHD_ERROR(("%s failed bus is not ready\n", __func__));
 		return -ENODEV;
 	}
-#ifdef EMBEDDED_PLATFORM
+
 	brcmu_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN,
 		      iovbuf, sizeof(iovbuf));
 	brcmf_proto_cdc_query_ioctl(dhdp, 0, BRCMF_C_GET_VAR, iovbuf,
@@ -2015,7 +2013,6 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
 	dhdp->pktfilter_count = 1;
 	/* Setup filter to allow only unicast */
 	dhdp->pktfilter[0] = "100 0 0 0 0x01 0x00";
-#endif				/* EMBEDDED_PLATFORM */
 
 	/* Bus is ready, do any protocol initialization */
 	ret = brcmf_proto_init(&dhd->pub);
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +0 -238

256 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#75 lore raw

PATCH 68/119 staging: brcm80211: remove MMC_SDIO_ABORT macro definition

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The fullmac driver is always needing the code conditionalized with MMC_SDIO_ABORT macro so the macro has been removed and the code is always compiled in.

---
 drivers/staging/brcm80211/brcmfmac/Makefile       |    1 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    6 ------
 2 files changed, 0 insertions(+), 7 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index 2ccfa1f..c97e5bb 100644
@@ -21,7 +21,6 @@ ccflags-y :=			\
 	-DBRCMF_FIRSTREAD=64	\
 	-DBRCMF_SDALIGN=64	\
 	-DMAX_HDR_READ=64	\
-	-DMMC_SDIO_ABORT	\
 	-DSHOW_EVENTS		\
 	-DTOE
 
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -6
index c814701..5e52813 100644
@@ -667,7 +667,6 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 					sdio_release_host(gInstance->func[2]);
 				}
 			}
-#if defined(MMC_SDIO_ABORT)
 			/* to allow abort command through F1 */
 			else if (regaddr == SDIO_CCCR_ABORT) {
 				sdio_claim_host(gInstance->func[func]);
@@ -681,7 +680,6 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
 					    regaddr, &err_ret);
 				sdio_release_host(gInstance->func[func]);
 			}
-#endif				/* MMC_SDIO_ABORT */
 			else if (regaddr < 0xF0) {
 				sd_err(("bcmsdh_sdmmc: F0 Wr:0x%02x: write "
 					"disallowed\n", regaddr));
@@ -951,16 +949,12 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
 /* this function performs "abort" for both of host & device */
 extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func)
 {
-#if defined(MMC_SDIO_ABORT)
 	char t_func = (char)func;
-#endif				/* defined(MMC_SDIO_ABORT) */
 	sd_trace(("%s: Enter\n", __func__));
 
-#if defined(MMC_SDIO_ABORT)
 	/* issue abort cmd52 command through F0 */
 	brcmf_sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
 			   &t_func);
-#endif				/* defined(MMC_SDIO_ABORT) */
 
 	sd_trace(("%s: Exit\n", __func__));
 	return SDIOH_API_RC_SUCCESS;
Signature · 1 line
1.7.1
author
#76 lore raw

PATCH 69/119 staging: brcm80211: remove TOE macro definition

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The code conditional by TOE macro is always needed so TOE macro usage has been removed from the fullmac sources.

---
 drivers/staging/brcm80211/brcmfmac/Makefile    |    3 +--
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |   14 --------------
 2 files changed, 1 insertions(+), 16 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +1 -2
index c97e5bb..7441649 100644
@@ -21,8 +21,7 @@ ccflags-y :=			\
 	-DBRCMF_FIRSTREAD=64	\
 	-DBRCMF_SDALIGN=64	\
 	-DMAX_HDR_READ=64	\
-	-DSHOW_EVENTS		\
-	-DTOE
+	-DSHOW_EVENTS
 
 ccflags-$(CONFIG_BRCMDBG)	+= -DDHD_DEBUG
 
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -14
index 8a2c73d..0764d02 100644
@@ -364,12 +364,8 @@ module_param(brcmf_pktgen_len, uint, 0);
 #endif
 
 static void brcmf_dpc(unsigned long data);
-
-#ifdef TOE
 static int brcmf_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
 static int brcmf_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
-#endif				/* TOE */
-
 static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
 			     brcmf_event_msg_t *event_ptr, void **data_ptr);
 
@@ -1315,7 +1311,6 @@ void brcmf_sched_dpc(dhd_pub_t *dhdp)
 	tasklet_schedule(&dhd->tasklet);
 }
 
-#ifdef TOE
 /* Retrieve current toe component enables, which are kept
 	 as a bitmap in toe_ol iovar */
 static int brcmf_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
@@ -1393,7 +1388,6 @@ static int brcmf_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
 
 	return 0;
 }
-#endif				/* TOE */
 
 static void brcmf_ethtool_get_drvinfo(struct net_device *net,
 				    struct ethtool_drvinfo *info)
@@ -1415,11 +1409,9 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
 	struct ethtool_drvinfo info;
 	char drvname[sizeof(info.driver)];
 	u32 cmd;
-#ifdef TOE
 	struct ethtool_value edata;
 	u32 toe_cmpnt, csum_dir;
 	int ret;
-#endif
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -1464,7 +1456,6 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
 			 (int)sizeof(drvname), drvname, info.driver));
 		break;
 
-#ifdef TOE
 		/* Get toe offload components from dongle */
 	case ETHTOOL_GRXCSUM:
 	case ETHTOOL_GTXCSUM:
@@ -1516,7 +1507,6 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
 		}
 
 		break;
-#endif				/* TOE */
 
 	default:
 		return -EOPNOTSUPP;
@@ -1665,9 +1655,7 @@ static int brcmf_netdev_stop(struct net_device *net)
 static int brcmf_netdev_open(struct net_device *net)
 {
 	dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
-#ifdef TOE
 	u32 toe_ol;
-#endif
 	int ifidx = brcmf_net2idx(dhd, net);
 	s32 ret = 0;
 
@@ -1685,14 +1673,12 @@ static int brcmf_netdev_open(struct net_device *net)
 
 		memcpy(net->dev_addr, dhd->pub.mac, ETH_ALEN);
 
-#ifdef TOE
 		/* Get current TOE mode from dongle */
 		if (brcmf_toe_get(dhd, ifidx, &toe_ol) >= 0
 		    && (toe_ol & TOE_TX_CSUM_OL) != 0)
 			dhd->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
 		else
 			dhd->iflist[ifidx]->net->features &= ~NETIF_F_IP_CSUM;
-#endif
 	}
 	/* Allow transmit calls */
 	netif_start_queue(net);
Signature · 1 line
1.7.1
author
#77 lore raw

PATCH 70/119 staging: brcm80211: define SHOW_EVENTS macro only for debugging

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The macro SHOW_EVENTS will only be defined when Kconfig setting BRCMDBG is set.

---
 drivers/staging/brcm80211/brcmfmac/Makefile |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +2 -3
index 7441649..2fcc409 100644
@@ -20,10 +20,9 @@ ccflags-y :=			\
 	-DBRCM_FULLMAC		\
 	-DBRCMF_FIRSTREAD=64	\
 	-DBRCMF_SDALIGN=64	\
-	-DMAX_HDR_READ=64	\
-	-DSHOW_EVENTS
+	-DMAX_HDR_READ=64
 
-ccflags-$(CONFIG_BRCMDBG)	+= -DDHD_DEBUG
+ccflags-$(CONFIG_BRCMDBG)	+= -DDHD_DEBUG -DSHOW_EVENTS
 
 ccflags-y += \
 	-Idrivers/staging/brcm80211/brcmfmac	\
Signature · 1 line
1.7.1
author
#78 lore raw

PATCH 71/119 staging: brcm80211: replace DHD_DEBUG macro with BCMDBG

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The common Makefile for both brcm80211 drivers defines the macro BCMDBG upon select Kconfig item BRCMDBG. The fullmac source add another macro DHD_DEBUG with the same meaning. This is removed and all conditional code now checks for BCMDBG definition.

---
 drivers/staging/brcm80211/brcmfmac/Makefile       |    2 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h     |    2 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |    2 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd.h          |    8 +-
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h      |    4 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c   |   12 +-
 drivers/staging/brcm80211/brcmfmac/dhd_dbg.h      |    6 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |   10 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |  126 ++++++++++-----------
 drivers/staging/brcm80211/brcmfmac/sdio_host.h    |    2 +-
 11 files changed, 87 insertions(+), 89 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +1 -1
index 2fcc409..a54a7d3 100644
@@ -22,7 +22,7 @@ ccflags-y :=			\
 	-DBRCMF_SDALIGN=64	\
 	-DMAX_HDR_READ=64
 
-ccflags-$(CONFIG_BRCMDBG)	+= -DDHD_DEBUG -DSHOW_EVENTS
+ccflags-$(CONFIG_BRCMDBG)	+= -DSHOW_EVENTS
 
 ccflags-y += \
 	-Idrivers/staging/brcm80211/brcmfmac	\
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +1 -1
index 88d0b02..05600e0 100644
@@ -57,7 +57,7 @@ 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(DHD_DEBUG)
+#if defined(BCMDBG)
 extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *si);
 #endif
 
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +1 -1
index 733ba96..72a91bd 100644
@@ -160,7 +160,7 @@ int brcmf_sdcard_intr_dereg(void *sdh)
 	return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
 }
 
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
 bool brcmf_sdcard_intr_pending(void *sdh)
 {
 	struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +1 -1
index 5e52813..335da48 100644
@@ -330,7 +330,7 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
 	return SDIOH_API_RC_SUCCESS;
 }
 
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
 extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *sd)
 {
 	return 0;
drivers/staging/brcm80211/brcmfmac/dhd.h +4 -4
index 65e00a8..b7ed29c 100644
@@ -777,10 +777,10 @@ extern atomic_t brcmf_mmc_suspend;
 /* Watchdog timer interval */
 extern uint brcmf_watchdog_ms;
 
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
 /* Console output poll interval */
 extern uint brcmf_console_ms;
-#endif				/* defined(DHD_DEBUG) */
+#endif				/* defined(BCMDBG) */
 
 /* Use interrupts */
 extern uint brcmf_intr;
@@ -933,9 +933,9 @@ 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);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
 extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
-#endif				/* DHD_DEBUG */
+#endif				/* BCMDBG */
 #if defined(OOB_INTR_ONLY)
 extern int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr);
 #endif				/* defined(OOB_INTR_ONLY) */
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +2 -2
index 73b72ff..722dbb4 100644
@@ -58,11 +58,11 @@ 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 DHD_DEBUG
+#ifdef BCMDBG
 /* Device console input function */
 extern int
 brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
-#endif				/* DHD_DEBUG */
+#endif				/* BCMDBG */
 
 /* Deferred processing for the bus, return true requests reschedule */
 extern bool dhd_bus_dpc(struct dhd_bus *bus);
drivers/staging/brcm80211/brcmfmac/dhd_common.c +6 -6
index b481eb3..6c41088 100644
@@ -39,7 +39,7 @@ char brcmf_nv_path[MOD_PARAM_PATHLEN];
 #define EPI_VERSION_STR         "4.218.248.5"
 #define MSGTRACE_VERSION	1
 
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
 const char brcmf_version[] =
 "Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__
 " at " __TIME__;
@@ -55,7 +55,7 @@ enum {
 	IOV_BCMERROR,
 	IOV_WDTICK,
 	IOV_DUMP,
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
 	IOV_CONS,
 	IOV_DCONSOLE_POLL,
 #endif
@@ -71,10 +71,10 @@ enum {
 const struct brcmu_iovar brcmf_iovars[] = {
 	{"version", IOV_VERSION, 0, IOVT_BUFFER, sizeof(brcmf_version)}
 	,
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
 	{"msglevel", IOV_MSGLEVEL, 0, IOVT_UINT32, 0}
 	,
-#endif				/* DHD_DEBUG */
+#endif				/* BCMDBG */
 	{"bcmerrorstr", IOV_BCMERRORSTR, 0, IOVT_BUFFER, BCME_STRLEN}
 	,
 	{"bcmerror", IOV_BCMERROR, 0, IOVT_INT8, 0}
@@ -83,7 +83,7 @@ const struct brcmu_iovar brcmf_iovars[] = {
 	,
 	{"dump", IOV_DUMP, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
 	,
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
 	{"dconpoll", IOV_DCONSOLE_POLL, 0, IOVT_UINT32, 0}
 	,
 	{"cons", IOV_CONS, 0, IOVT_BUFFER, 0}
@@ -255,7 +255,7 @@ 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 DHD_DEBUG
+#ifdef BCMDBG
 	case IOV_GVAL(IOV_DCONSOLE_POLL):
 		int_val = (s32) brcmf_console_ms;
 		memcpy(arg, &int_val, val_size);
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h +3 -3
index 2cbfb51..e0fc124 100644
@@ -17,7 +17,7 @@
 #ifndef _dhd_dbg_
 #define _dhd_dbg_
 
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
 
 #define DHD_ERROR(args) \
 	do {if ((brcmf_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
@@ -61,7 +61,7 @@
 #define DHD_BTA_ON()		(brcmf_msg_level & DHD_BTA_VAL)
 #define DHD_ISCAN_ON()		(brcmf_msg_level & DHD_ISCAN_VAL)
 
-#else	/* (defined BCMDBG) || (defined DHD_DEBUG) */
+#else	/* (defined BCMDBG) || (defined BCMDBG) */
 
 #define DHD_ERROR(args)  do {if (net_ratelimit()) printk args; } while (0)
 #define DHD_TRACE(args)
@@ -90,7 +90,7 @@
 #define DHD_EVENT_ON()		0
 #define DHD_BTA_ON()		0
 #define DHD_ISCAN_ON()		0
-#endif				/* defined(DHD_DEBUG) */
+#endif				/* defined(BCMDBG) */
 
 #define DHD_LOG(args)
 
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +5 -5
index 0764d02..6507891 100644
@@ -262,11 +262,11 @@ module_param(brcmf_sysioc, uint, 0);
 uint brcmf_watchdog_ms = 10;
 module_param(brcmf_watchdog_ms, uint, 0);
 
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
 /* Console poll interval */
 uint brcmf_console_ms;
 module_param(brcmf_console_ms, uint, 0);
-#endif				/* DHD_DEBUG */
+#endif				/* BCMDBG */
 
 /* ARP offload agent mode : Enable ARP Host Auto-Reply
 and ARP Peer Auto-Reply */
@@ -357,7 +357,7 @@ module_param(brcmf_pktgen_len, uint, 0);
 #endif
 
 /* Version string to report */
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
 #define DHD_COMPILED "\nCompiled in " SRCBASE
 #else
 #define DHD_COMPILED
@@ -2632,7 +2632,7 @@ void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick)
 	brcmf_os_wd_timer(&dhd->pub, wdtick);
 }
 
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
 int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
 {
 	int ret = 0;
@@ -2666,7 +2666,7 @@ exit:
 
 	return ret;
 }
-#endif				/* DHD_DEBUG */
+#endif				/* BCMDBG */
 
 #if defined(BCMDBG)
 void osl_assert(char *exp, char *file, int line)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +62 -64

454 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sdio_host.h +1 -1
index b7e0754..6938abc 100644
@@ -87,7 +87,7 @@ extern int brcmf_sdcard_intr_disable(void *sdh);
 extern int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
 extern int brcmf_sdcard_intr_dereg(void *sdh);
 
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
 /* Query pending interrupt status from the host controller */
 extern bool brcmf_sdcard_intr_pending(void *sdh);
 #endif
Signature · 1 line
1.7.1
author
#79 lore raw

PATCH 72/119 staging: brcm80211: remove unnecessary macro defintions

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The common makefile and the fullmac makefile contained a few macro definitions that are not or no longer used. These are removed.

---
 drivers/staging/brcm80211/Makefile          |    2 +-
 drivers/staging/brcm80211/brcmfmac/Makefile |    2 --
 2 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/Makefile +1 -1
index db9a57e..8b01f5e 100644
@@ -17,7 +17,7 @@
 
 # common flags
 subdir-ccflags-y					:= -DBCMDMA32
-subdir-ccflags-$(CONFIG_BRCMDBG)	+= -DBCMDBG -DBCMDBG_ASSERT
+subdir-ccflags-$(CONFIG_BRCMDBG)	+= -DBCMDBG
 
 obj-$(CONFIG_BRCMUTIL)	+= brcmutil/
 obj-$(CONFIG_BRCMFMAC)	+= brcmfmac/
drivers/staging/brcm80211/brcmfmac/Makefile +0 -2
index a54a7d3..f097246 100644
@@ -16,8 +16,6 @@
 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 ccflags-y :=			\
-	-DBCMSDIO		\
-	-DBRCM_FULLMAC		\
 	-DBRCMF_FIRSTREAD=64	\
 	-DBRCMF_SDALIGN=64	\
 	-DMAX_HDR_READ=64
Signature · 1 line
1.7.1
author
#80 lore raw

PATCH 73/119 staging: brcm80211: remove custom gpio support code

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The custom gpio code is intended for hardware platform for specific customers and require supporting functionality not included in the fullmac driver. The fullmac driver does not need this so it has been removed.

---
 drivers/staging/brcm80211/brcmfmac/Makefile        |    1 -
 .../staging/brcm80211/brcmfmac/dhd_custom_gpio.c   |  156 --------------------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |    8 +-
 3 files changed, 1 insertions(+), 164 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
index f097246..c38fa55 100644
@@ -30,7 +30,6 @@ DHDOFILES = \
 	wl_cfg80211.o \
 	dhd_cdc.o \
 	dhd_common.o \
-	dhd_custom_gpio.o \
 	dhd_sdio.o	\
 	dhd_linux.o \
 	bcmsdh.o \
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c deleted +0 -156

156 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -7
index 6507891..5a0bcb2 100644
@@ -2192,8 +2192,6 @@ static void __exit brcmf_module_cleanup(void)
 #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
 	wifi_del_dev();
 #endif
-	/* Call customer gpio to turn off power with WL_REG_ON signal */
-	brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
 }
 
 static int __init brcmf_module_init(void)
@@ -2216,8 +2214,6 @@ static int __init brcmf_module_init(void)
 		DHD_ERROR(("Invalid module parameters.\n"));
 		return -EINVAL;
 	} while (0);
-	/* Call customer gpio to turn on power with WL_REG_ON signal */
-	brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_ON);
 
 #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
 	sema_init(&wifi_control_sem, 0);
@@ -2245,11 +2241,9 @@ static int __init brcmf_module_init(void)
 		DHD_ERROR(("%s: dhd_bus_register failed\n", __func__));
 		goto failed;
 	}
-	return error;
+	return 0;
 
 failed:
-	/* turn off power and exit */
-	brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
 	return -EINVAL;
 }
 
Signature · 1 line
1.7.1
author
#81 lore raw

PATCH 74/119 staging: brcm80211: remove conditional code fragments from brcmfmac

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The fullmac sources contained a lot of conditional code sections that are never to be enabled for the fullmac driver. These have been removed.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |    9 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |  101 ---------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |  135 +-----------
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    2 -
 drivers/staging/brcm80211/brcmfmac/dhd.h           |    6 -
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c       |    4 -
 drivers/staging/brcm80211/brcmfmac/dhd_common.c    |  200 -----------------
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |  236 +-------------------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |   58 -----
 9 files changed, 4 insertions(+), 747 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +0 -9
index 72a91bd..c8e84d3 100644
@@ -44,15 +44,6 @@ struct brcmf_sdio {
 /* local copy of bcm sd handler */
 struct brcmf_sdio *l_bcmsdh;
 
-#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-extern int brcmf_sdioh_enable_hw_oob_intr(void *sdioh, bool enable);
-
-void brcmf_sdcard_enable_hw_oob_intr(struct brcmf_sdio *sdh, bool enable)
-{
-	brcmf_sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
-}
-#endif
-
 struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
 {
 	struct brcmf_sdio *bcmsdh;
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -101

132 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +3 -132

197 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +0 -2
index c95112e..6abd9c0 100644
@@ -182,13 +182,11 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
 	sdos = (struct sdos_info *)sd->sdos_info;
 	ASSERT(sdos);
 
-#if !defined(OOB_INTR_ONLY)
 	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;
 	}
-#endif				/* !defined(OOB_INTR_ONLY) */
 
 	/* Ensure atomicity for enable/disable calls */
 	spin_lock_irqsave(&sdos->lock, flags);
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -6
index b7ed29c..87c65f1 100644
@@ -691,9 +691,6 @@ typedef struct dhd_pub {
 	int suspend_disable_flag;	/* "1" to disable all extra powersaving
 					 during suspend */
 	int in_suspend;		/* flag set to 1 when early suspend called */
-#ifdef PNO_SUPPORT
-	int pno_enable;		/* pno status : "1" is pno enable */
-#endif				/* PNO_SUPPORT */
 	int dtim_skip;		/* dtim skip , default 0 means wake each dtim */
 
 	/* Pkt filter defination */
@@ -936,9 +933,6 @@ extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
 #ifdef BCMDBG
 extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
 #endif				/* BCMDBG */
-#if defined(OOB_INTR_ONLY)
-extern int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr);
-#endif				/* defined(OOB_INTR_ONLY) */
 
 extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
 extern int brcmf_timeout_expired(dhd_timeout_t *tmo);
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +0 -4
index a766707..471869f 100644
@@ -80,10 +80,6 @@ struct brcmf_proto_bdc_header {
 };
 
 
-#ifdef CUSTOMER_HW2
-int wifi_get_mac_addr(unsigned char *buf);
-#endif
-
 #define RETRIES 2	/* # of retries to retrieve matching ioctl response */
 #define BUS_HEADER_LEN	(16+BRCMF_SDALIGN) /* Must be atleast SDPCM_RESERVE
 					 * defined in dhd_sdio.c
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -200

218 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -235

327 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -58

101 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#82 lore raw

PATCH 75/119 staging: brcm80211: rename EPI_VERSION_STR macro

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The fullmac version macro has been renamed and moved to dhd.h to get rid of having it defined in two separate c source files.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |    2 ++
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |    5 ++---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c  |    3 +--
 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +2 -0
index 87c65f1..7e19d80 100644
@@ -21,6 +21,8 @@
 #ifndef _dhd_h_
 #define _dhd_h_
 
+#define BRCMF_VERSION_STR		"4.218.248.5"
+
 #define	BRCMF_C_IOCTL_SMLEN	256	/* "small" ioctl buffer required */
 #define BRCMF_C_IOCTL_MEDLEN	1536	/* "med" ioctl buffer required */
 #define	BRCMF_C_IOCTL_MAXLEN	8192
drivers/staging/brcm80211/brcmfmac/dhd_common.c +2 -3
index 22739f0..5207fa9 100644
@@ -36,15 +36,14 @@ int brcmf_msg_level;
 char brcmf_fw_path[MOD_PARAM_PATHLEN];
 char brcmf_nv_path[MOD_PARAM_PATHLEN];
 
-#define EPI_VERSION_STR         "4.218.248.5"
 #define MSGTRACE_VERSION	1
 
 #ifdef BCMDBG
 const char brcmf_version[] =
-"Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__
+"Dongle Host Driver, version " BRCMF_VERSION_STR "\nCompiled on " __DATE__
 " at " __TIME__;
 #else
-const char brcmf_version[] = "Dongle Host Driver, version " EPI_VERSION_STR;
+const char brcmf_version[] = "Dongle Host Driver, version " BRCMF_VERSION_STR;
 #endif
 
 /* IOVar table */
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -2
index 5327941..19e09bd 100644
@@ -43,7 +43,6 @@
 #include "dhd_dbg.h"
 #include "wl_cfg80211.h"
 
-#define EPI_VERSION_STR		"4.218.248.5"
 #define ETH_P_BRCM			0x886c
 
 /* Global ASSERT type flag */
@@ -1278,7 +1277,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
 		/* if dhd requested, identify ourselves */
 		if (strcmp(drvname, "?dhd") == 0) {
 			sprintf(info.driver, "dhd");
-			strcpy(info.version, EPI_VERSION_STR);
+			strcpy(info.version, BRCMF_VERSION_STR);
 		}
 
 		/* otherwise, require dongle to be up */
Signature · 1 line
1.7.1
author
#83 lore raw

PATCH 76/119 staging: brcm80211: use linux native ethertype iso ETH_P_BRCM

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

The linux native ethertype ETH_P_LINK_CTL is matching ETH_P_BRCM so lets use that definition and get rid of ETH_P_BRCM.

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -3
index 19e09bd..c3cbda6 100644
@@ -43,8 +43,6 @@
 #include "dhd_dbg.h"
 #include "wl_cfg80211.h"
 
-#define ETH_P_BRCM			0x886c
-
 /* Global ASSERT type flag */
 u32 g_assert_type;
 
@@ -947,7 +945,7 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
 		skb_pull(skb, ETH_HLEN);
 
 		/* Process special event packets and then discard them */
-		if (ntohs(skb->protocol) == ETH_P_BRCM)
+		if (ntohs(skb->protocol) == ETH_P_LINK_CTL)
 			brcmf_host_event(dhd, &ifidx,
 					  skb_mac_header(skb),
 					  &event, &data);
Signature · 1 line
1.7.1