Skip to contentSkip to conversation

staging: brcm80211: removed unused Broadcom specific ioctls codes

PATCH In review Roland Vossen 8 participants 115 messages Jun 1, 2011 – Jun 8, 2011 Staging Page 1 of 2

lore
Share & tools
lore
#0 lore raw

PATCH 1/83 staging: brcm80211: removed unused Broadcom specific ioctls codes

Code cleanup. Removal of code that is not invoked.

---
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c   |   21 -
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_hal.h   |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_main.c      | 1184 +-------------------
 drivers/staging/brcm80211/brcmsmac/wlc_main.h      |    5 -
 drivers/staging/brcm80211/brcmsmac/wlc_pub.h       |    9 -
 drivers/staging/brcm80211/brcmsmac/wlc_stf.c       |   33 -
 drivers/staging/brcm80211/brcmsmac/wlc_stf.h       |    2 -
 7 files changed, 5 insertions(+), 1250 deletions(-)
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c +0 -21
index 6cba4df..f45628a 100644
@@ -2350,27 +2350,6 @@ bool wlc_phy_test_ison(wlc_phy_t *ppi)
 	return pi->phytest_on;
 }
 
-bool wlc_phy_ant_rxdiv_get(wlc_phy_t *ppi, u8 *pval)
-{
-	phy_info_t *pi = (phy_info_t *) ppi;
-	bool ret = true;
-
-	wlc_phyreg_enter(ppi);
-
-	if (ISNPHY(pi)) {
-
-		ret = false;
-	} else if (ISLCNPHY(pi)) {
-		u16 crsctrl = read_phy_reg(pi, 0x410);
-		u16 div = crsctrl & (0x1 << 1);
-		*pval = (div | ((crsctrl & (0x1 << 0)) ^ (div >> 1)));
-	}
-
-	wlc_phyreg_exit(ppi);
-
-	return ret;
-}
-
 void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val)
 {
 	phy_info_t *pi = (phy_info_t *) ppi;
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_hal.h +0 -1
index 8939153..1ef96c7 100644
@@ -226,7 +226,6 @@ extern void wlc_phy_edcrs_lock(wlc_phy_t *pih, bool lock);
 extern void wlc_phy_cal_papd_recal(wlc_phy_t *ppi);
 
 extern void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val);
-extern bool wlc_phy_ant_rxdiv_get(wlc_phy_t *ppi, u8 *pval);
 extern void wlc_phy_clear_tssi(wlc_phy_t *ppi);
 extern void wlc_phy_hold_upd(wlc_phy_t *ppi, mbool id, bool val);
 extern void wlc_phy_mute_upd(wlc_phy_t *ppi, bool val, mbool flags);
drivers/staging/brcm80211/brcmsmac/wlc_main.c +5 -1179

1,302 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_main.h +0 -5
index fb48dfc..0bb3784 100644
@@ -805,8 +805,6 @@ extern void wlc_write_template_ram(struct wlc_info *wlc, int offset, int len,
 				   void *buf);
 extern void wlc_write_hw_bcntemplates(struct wlc_info *wlc, void *bcn, int len,
 				      bool both);
-extern void wlc_set_cwmin(struct wlc_info *wlc, u16 newmin);
-extern void wlc_set_cwmax(struct wlc_info *wlc, u16 newmax);
 extern void wlc_pllreq(struct wlc_info *wlc, bool set, mbool req_bit);
 extern void wlc_reset_bmac_done(struct wlc_info *wlc);
 
@@ -928,10 +926,7 @@ extern ratespec_t wlc_lowest_basic_rspec(struct wlc_info *wlc,
 					 wlc_rateset_t *rs);
 extern void wlc_radio_disable(struct wlc_info *wlc);
 extern void wlc_bcn_li_upd(struct wlc_info *wlc);
-
-extern int wlc_get_revision_info(struct wlc_info *wlc, void *buf, uint len);
 extern void wlc_set_home_chanspec(struct wlc_info *wlc, chanspec_t chanspec);
-extern void wlc_watchdog_upd(struct wlc_info *wlc, bool tbtt);
 extern bool wlc_ps_allowed(struct wlc_info *wlc);
 extern bool wlc_stay_awake(struct wlc_info *wlc);
 extern void wlc_wme_initparams_sta(struct wlc_info *wlc, wme_param_ie_t *pe);
drivers/staging/brcm80211/brcmsmac/wlc_pub.h +0 -9
index 9334dea..88b0967 100644
@@ -134,7 +134,6 @@ struct rsn_parms {
 };
 
 /*
- * buffer length needed for wlc_format_ssid
  * 32 SSID chars, max of 4 chars for each SSID char "\xFF", plus NULL.
  */
 #define SSID_FMT_BUF_LEN	((4 * IEEE80211_MAX_SSID_LEN) + 1)
@@ -558,18 +557,10 @@ extern void wlc_scan_stop(struct wlc_info *wlc);
 extern int wlc_get_curband(struct wlc_info *wlc);
 extern void wlc_wait_for_tx_completion(struct wlc_info *wlc, bool drop);
 
-#if defined(BCMDBG)
-extern int wlc_iocregchk(struct wlc_info *wlc, uint band);
-#endif
-
 /* helper functions */
 extern bool wlc_check_radio_disabled(struct wlc_info *wlc);
 extern bool wlc_radio_monitor_stop(struct wlc_info *wlc);
 
-#if defined(BCMDBG)
-extern int wlc_format_ssid(char *buf, const unsigned char ssid[], uint ssid_len);
-#endif
-
 #define	MAXBANDS		2	/* Maximum #of bands */
 /* bandstate array indices */
 #define BAND_2G_INDEX		0	/* wlc->bandstate[x] index */
drivers/staging/brcm80211/brcmsmac/wlc_stf.c +0 -33
index c4f5817..544d883 100644
@@ -364,39 +364,6 @@ void wlc_stf_detach(struct wlc_info *wlc)
 {
 }
 
-int wlc_stf_ant_txant_validate(struct wlc_info *wlc, s8 val)
-{
-	int bcmerror = 0;
-
-	/* when there is only 1 tx_streams, don't allow to change the txant */
-	if (WLCISNPHY(wlc->band) && (wlc->stf->txstreams == 1))
-		return ((val == wlc->stf->txant) ? bcmerror : -EINVAL);
-
-	switch (val) {
-	case -1:
-		val = ANT_TX_DEF;
-		break;
-	case 0:
-		val = ANT_TX_FORCE_0;
-		break;
-	case 1:
-		val = ANT_TX_FORCE_1;
-		break;
-	case 3:
-		val = ANT_TX_LAST_RX;
-		break;
-	default:
-		bcmerror = -EINVAL;
-		break;
-	}
-
-	if (bcmerror == 0)
-		wlc->stf->txant = (s8) val;
-
-	return bcmerror;
-
-}
-
 /*
  * Centralized txant update function. call it whenever wlc->stf->txant and/or wlc->stf->txchain
  *  change
drivers/staging/brcm80211/brcmsmac/wlc_stf.h +0 -2
index 2b1180b..eedd9da 100644
@@ -28,8 +28,6 @@ extern int wlc_stf_ss_update(struct wlc_info *wlc, struct wlcband *band);
 extern void wlc_stf_phy_txant_upd(struct wlc_info *wlc);
 extern int wlc_stf_txchain_set(struct wlc_info *wlc, s32 int_val, bool force);
 extern bool wlc_stf_stbc_rx_set(struct wlc_info *wlc, s32 int_val);
-
-extern int wlc_stf_ant_txant_validate(struct wlc_info *wlc, s8 val);
 extern void wlc_stf_phy_txant_upd(struct wlc_info *wlc);
 extern void wlc_stf_phy_chain_calc(struct wlc_info *wlc);
 extern u16 wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec);
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 2/83 staging: brcm80211: removed iovar layer from softmac

Code cleanup. Softmac contained a redundant level of indirection, named 'iovar functionality'.

---
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c |   17 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c    |  433 ++++------------------
 drivers/staging/brcm80211/brcmsmac/wlc_main.h    |    6 -
 drivers/staging/brcm80211/brcmsmac/wlc_pub.h     |   23 +-
 4 files changed, 90 insertions(+), 389 deletions(-)
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +8 -9
index 6c6236c..3deb903 100644
@@ -270,14 +270,14 @@ static int wl_ops_config(struct ieee80211_hw *hw, u32 changed)
 
 	WL_LOCK(wl);
 	if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) {
-		if (wlc_iovar_setint
-		    (wl->wlc, "bcn_li_bcn", conf->listen_interval)) {
+		if (wlc_set_par(wl->wlc, IOV_BCN_LI_BCN, conf->listen_interval)
+		    < 0) {
 			wiphy_err(wiphy, "%s: Error setting listen_interval\n",
 				  __func__);
 			err = -EIO;
 			goto config_out;
 		}
-		wlc_iovar_getint(wl->wlc, "bcn_li_bcn", &new_int);
+		wlc_get_par(wl->wlc, IOV_BCN_LI_BCN, &new_int);
 	}
 	if (changed & IEEE80211_CONF_CHANGE_MONITOR)
 		wiphy_err(wiphy, "%s: change monitor mode: %s (implement)\n",
@@ -289,14 +289,14 @@ static int wl_ops_config(struct ieee80211_hw *hw, u32 changed)
 			  "true" : "false");
 
 	if (changed & IEEE80211_CONF_CHANGE_POWER) {
-		if (wlc_iovar_setint
-		    (wl->wlc, "qtxpower", conf->power_level * 4)) {
+		if (wlc_set_par(wl->wlc, IOV_QTXPOWER, conf->power_level * 4)
+				< 0) {
 			wiphy_err(wiphy, "%s: Error setting power_level\n",
 				  __func__);
 			err = -EIO;
 			goto config_out;
 		}
-		wlc_iovar_getint(wl->wlc, "qtxpower", &new_int);
+		wlc_get_par(wl->wlc, IOV_QTXPOWER, &new_int);
 		if (new_int != (conf->power_level * 4))
 			wiphy_err(wiphy, "%s: Power level req != actual, %d %d"
 				  "\n", __func__, conf->power_level * 4,
@@ -808,7 +808,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
 
 	wl->pub->ieee_hw = hw;
 
-	if (wlc_iovar_setint(wl->wlc, "mpc", 0)) {
+	if (wlc_set_par(wl->wlc, IOV_MPC, 0) < 0) {
 		wiphy_err(wl->wiphy, "wl%d: Error setting MPC variable to 0\n",
 			  unit);
 	}
@@ -821,8 +821,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
 	wl->irq = irq;
 
 	/* register module */
-	wlc_module_register(wl->pub, NULL, "linux", wl, NULL, wl_linux_watchdog,
-			    NULL);
+	wlc_module_register(wl->pub, "linux", wl, wl_linux_watchdog, NULL);
 
 	if (ieee_hw_init(hw)) {
 		wiphy_err(wl->wiphy, "wl%d: %s: ieee_hw_init failed!\n", unit,
drivers/staging/brcm80211/brcmsmac/wlc_main.c +71 -362

481 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_main.h +0 -6
index 0bb3784..193f73a 100644
@@ -898,12 +898,6 @@ extern void wlc_set_chanspec(struct wlc_info *wlc, chanspec_t chanspec);
 
 extern bool wlc_timers_init(struct wlc_info *wlc, int unit);
 
-extern const bcm_iovar_t wlc_iovars[];
-
-extern int wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
-		       const char *name, void *params, uint p_len, void *arg,
-		       int len, int val_size, struct wlc_if *wlcif);
-
 #if defined(BCMDBG)
 extern void wlc_print_ies(struct wlc_info *wlc, u8 *ies, uint ies_len);
 #endif
drivers/staging/brcm80211/brcmsmac/wlc_pub.h +11 -12
index 88b0967..b3a79ab 100644
@@ -370,6 +370,13 @@ typedef struct wl_rxsts {
 #define WL_RXS_NFRM_AMSDU_FIRST		0x00000004	/* first MSDU in A-MSDU */
 #define WL_RXS_NFRM_AMSDU_SUB		0x00000008	/* subsequent MSDU(s) in A-MSDU */
 
+enum wlc_par_id {
+	IOV_MPC = 1,
+	IOV_RTSTHRESH,
+	IOV_QTXPOWER,
+	IOV_BCN_LI_BCN		/* Beacon listen interval in # of beacons */
+};
+
 /* forward declare and use the struct notation so we don't have to
  * have it defined if not necessary.
  */
@@ -492,8 +499,6 @@ extern uint wlc_down(struct wlc_info *wlc);
 
 extern int wlc_set(struct wlc_info *wlc, int cmd, int arg);
 extern int wlc_get(struct wlc_info *wlc, int cmd, int *arg);
-extern int wlc_iovar_getint(struct wlc_info *wlc, const char *name, int *arg);
-extern int wlc_iovar_setint(struct wlc_info *wlc, const char *name, int arg);
 extern bool wlc_chipmatch(u16 vendor, u16 device);
 extern void wlc_init(struct wlc_info *wlc);
 extern void wlc_reset(struct wlc_info *wlc);
@@ -506,9 +511,6 @@ extern bool wlc_isr(struct wlc_info *wlc, bool *wantdpc);
 extern bool wlc_dpc(struct wlc_info *wlc, bool bounded);
 extern bool wlc_sendpkt_mac80211(struct wlc_info *wlc, struct sk_buff *sdu,
 				 struct ieee80211_hw *hw);
-extern int wlc_iovar_op(struct wlc_info *wlc, const char *name, void *params,
-			int p_len, void *arg, int len, bool set,
-			struct wlc_if *wlcif);
 extern int wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
 		     struct wlc_if *wlcif);
 extern bool wlc_aggregatable(struct wlc_info *wlc, u8 tid);
@@ -534,18 +536,15 @@ extern void wlc_default_rateset(struct wlc_info *wlc, wlc_rateset_t *rs);
 struct ieee80211_sta;
 extern void wlc_ampdu_flush(struct wlc_info *wlc, struct ieee80211_sta *sta,
 			    u16 tid);
+int wlc_set_par(struct wlc_info *wlc, enum wlc_par_id par_id, int val);
+int wlc_get_par(struct wlc_info *wlc, enum wlc_par_id par_id, int *ret_int_ptr);
 
 /* wlc_phy.c helper functions */
 extern void wlc_set_ps_ctrl(struct wlc_info *wlc);
 extern void wlc_mctrl(struct wlc_info *wlc, u32 mask, u32 val);
 
-/* ioctl */
-extern int wlc_iovar_check(struct wlc_pub *pub, const bcm_iovar_t *vi,
-			   void *arg,
-			   int len, bool set);
-
-extern int wlc_module_register(struct wlc_pub *pub, const bcm_iovar_t *iovars,
-			       const char *name, void *hdl, iovar_fn_t iovar_fn,
+extern int wlc_module_register(struct wlc_pub *pub,
+			       const char *name, void *hdl,
 			       watchdog_fn_t watchdog_fn, down_fn_t down_fn);
 extern int wlc_module_unregister(struct wlc_pub *pub, const char *name,
 				 void *hdl);
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 3/83 staging: brcm80211: cleanup struct wl_info

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

removed unused field piomode from struct wl_info definition.

---
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c |    7 ++-----
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.h |    6 +++++-
 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +2 -5
index 3deb903..f951f22 100644
@@ -739,7 +739,6 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
 {
 	struct wl_info *wl = NULL;
 	int unit, err;
-
 	unsigned long base_addr;
 	struct ieee80211_hw *hw;
 	u8 perm[ETH_ALEN];
@@ -768,9 +767,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
 
 	base_addr = regs;
 
-	if (bustype == PCI_BUS) {
-		wl->piomode = false;
-	} else if (bustype == RPC_BUS) {
+	if (bustype == PCI_BUS || bustype == RPC_BUS) {
 		/* Do nothing */
 	} else {
 		bustype = PCI_BUS;
@@ -796,7 +793,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
 	}
 
 	/* common load-time initialization */
-	wl->wlc = wlc_attach((void *)wl, vendor, device, unit, wl->piomode,
+	wl->wlc = wlc_attach((void *)wl, vendor, device, unit, false,
 			     wl->regsva, wl->bcm_bustype, btparam, &err);
 	wl_release_fw(wl);
 	if (!wl->wlc) {
drivers/staging/brcm80211/brcmsmac/wl_mac80211.h +5 -1
index e703d8b..c878690 100644
@@ -57,11 +57,15 @@ struct wl_info {
 
 	spinlock_t lock;	/* per-device perimeter lock */
 	spinlock_t isr_lock;	/* per-device ISR synchronization lock */
+
+	/* bus type and regsva for unmap in wl_free() */
 	uint bcm_bustype;	/* bus type */
-	bool piomode;		/* set from insmod argument */
 	void *regsva;		/* opaque chip registers virtual address */
+
+	/* timer related fields */
 	atomic_t callbacks;	/* # outstanding callback functions */
 	struct wl_timer *timers;	/* timer cleanup queue */
+
 	struct tasklet_struct tasklet;	/* dpc tasklet */
 	bool resched;		/* dpc needs to be and is rescheduled */
 #ifdef LINUXSTA_PS
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH 4/83 staging: brcm80211: removed unused timeout fields in wlc_protection

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The structure definition wlc_protection contained a numbers of timeout fields that were not used in the driver. These have been removed.

---
 drivers/staging/brcm80211/brcmsmac/wlc_main.h |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)
drivers/staging/brcm80211/brcmsmac/wlc_main.h +0 -13
index 193f73a..4d45972 100644
@@ -208,19 +208,6 @@ struct wlc_protection {
 	s8 nongf_override;	/* override for use of GF protection */
 	s8 n_pam_override;	/* override for preamble: MM or GF */
 	bool n_obss;		/* indicated OBSS Non-HT STA present */
-
-	uint longpre_detect_timeout;	/* #sec until long preamble bcns gone */
-	uint barker_detect_timeout;	/* #sec until bcns signaling Barker long preamble */
-	/* only is gone */
-	uint ofdm_ibss_timeout;	/* #sec until ofdm IBSS beacons gone */
-	uint ofdm_ovlp_timeout;	/* #sec until ofdm overlapping BSS bcns gone */
-	uint nonerp_ibss_timeout;	/* #sec until nonerp IBSS beacons gone */
-	uint nonerp_ovlp_timeout;	/* #sec until nonerp overlapping BSS bcns gone */
-	uint g_ibss_timeout;	/* #sec until bcns signaling Use_Protection gone */
-	uint n_ibss_timeout;	/* #sec until bcns signaling Use_OFDM_Protection gone */
-	uint ht20in40_ovlp_timeout;	/* #sec until 20MHz overlapping OPMODE gone */
-	uint ht20in40_ibss_timeout;	/* #sec until 20MHz-only HT station bcns gone */
-	uint non_gf_ibss_timeout;	/* #sec until non-GF bcns gone */
 };
 
 /* anything affects the single/dual streams/antenna operation */
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH 5/83 staging: brcm80211: remove WLC_WATCHDOG_TBTT macro

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The expanded macro expression will always be false so it has been removed.

---
 drivers/staging/brcm80211/brcmsmac/wlc_main.c |   34 -------------------------
 1 files changed, 0 insertions(+), 34 deletions(-)
drivers/staging/brcm80211/brcmsmac/wlc_main.c +0 -34
index c078ea0..56ea77f 100644
@@ -100,10 +100,6 @@
  * calibration and scb update
  */
 
-/* watchdog trigger mode: OSL timer or TBTT */
-#define WLC_WATCHDOG_TBTT(wlc) \
-	(wlc->stas_associated > 0 && wlc->PM != PM_OFF && wlc->pub->align_wd_tbtt)
-
 /* To inform the ucode of the last mcast frame posted so that it can clear moredata bit */
 #define BCMCFID(wlc, fid) wlc_bmac_write_shm((wlc)->hw, M_BCMC_FID, (fid))
 
@@ -1945,14 +1941,7 @@ bool wlc_radio_monitor_stop(struct wlc_info *wlc)
 
 static void wlc_watchdog_by_timer(void *arg)
 {
-	struct wlc_info *wlc = (struct wlc_info *) arg;
 	wlc_watchdog(arg);
-	if (WLC_WATCHDOG_TBTT(wlc)) {
-		/* set to normal osl watchdog period */
-		wl_del_timer(wlc->wl, wlc->wdtimer);
-		wl_add_timer(wlc->wl, wlc->wdtimer, TIMER_INTERVAL_WATCHDOG,
-			     true);
-	}
 }
 
 /* common watchdog code */
@@ -4281,29 +4270,6 @@ void wlc_tbtt(struct wlc_info *wlc, d11regs_t *regs)
 {
 	struct wlc_bsscfg *cfg = wlc->cfg;
 
-	if (BSSCFG_STA(cfg)) {
-		/* run watchdog here if the watchdog timer is not armed */
-		if (WLC_WATCHDOG_TBTT(wlc)) {
-			u32 cur, delta;
-			if (wlc->WDarmed) {
-				wl_del_timer(wlc->wl, wlc->wdtimer);
-				wlc->WDarmed = false;
-			}
-
-			cur = OSL_SYSUPTIME();
-			delta = cur > wlc->WDlast ? cur - wlc->WDlast :
-			    (u32) ~0 - wlc->WDlast + cur + 1;
-			if (delta >= TIMER_INTERVAL_WATCHDOG) {
-				wlc_watchdog((void *)wlc);
-				wlc->WDlast = cur;
-			}
-
-			wl_add_timer(wlc->wl, wlc->wdtimer,
-				     wlc_watchdog_backup_bi(wlc), true);
-			wlc->WDarmed = true;
-		}
-	}
-
 	if (!cfg->BSS) {
 		/* DirFrmQ is now valid...defer setting until end of ATIM window */
 		wlc->qvalid |= MCMD_DIRFRMQVAL;
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH 6/83 staging: brcm80211: cleanup struct wlc_info definition

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The structure definition for wlc_info contained a lot of fields that are only initialized or not used at all. These have been removed to cleanup the driver code.

---
 drivers/staging/brcm80211/brcmsmac/wlc_alloc.c |   11 --
 drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c |    4 -
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c  |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c  |  121 ++----------------------
 drivers/staging/brcm80211/brcmsmac/wlc_main.h  |   86 -----------------
 5 files changed, 11 insertions(+), 213 deletions(-)
drivers/staging/brcm80211/brcmsmac/wlc_alloc.c +0 -11
index 82c64cd..3c4b2c0 100644
@@ -152,8 +152,6 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
 		goto fail;
 	}
 
-	wlc->hwrxoff = WL_HWRXOFF;
-
 	/* allocate struct wlc_pub state structure */
 	wlc->pub = wlc_pub_malloc(unit, err, devid);
 	if (wlc->pub == NULL) {
@@ -206,14 +204,6 @@ struct wlc_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
 	}
 	wlc_bsscfg_ID_assign(wlc, wlc->cfg);
 
-	wlc->pkt_callback = kzalloc(sizeof(struct pkt_cb) *
-				    (wlc->pub->tunables->maxpktcb + 1),
-				    GFP_ATOMIC);
-	if (wlc->pkt_callback == NULL) {
-		*err = 1013;
-		goto fail;
-	}
-
 	wlc->wsec_def_keys[0] =
 		kzalloc(sizeof(wsec_key_t) * WLC_DEFAULT_KEYS, GFP_ATOMIC);
 	if (wlc->wsec_def_keys[0] == NULL) {
@@ -284,7 +274,6 @@ void wlc_detach_mfree(struct wlc_info *wlc)
 	wlc_pub_mfree(wlc->pub);
 	kfree(wlc->modulecb);
 	kfree(wlc->default_bss);
-	kfree(wlc->pkt_callback);
 	kfree(wlc->wsec_def_keys[0]);
 	kfree(wlc->protection);
 	kfree(wlc->stf);
drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c +0 -4
index 85ad700..75343ab 100644
@@ -499,10 +499,6 @@ wlc_sendampdu(struct ampdu_info *ampdu, struct wlc_txq_info *qi,
 
 	wlc_ampdu_agg(ampdu, scb, p, tid);
 
-	if (wlc->block_datafifo) {
-		wiphy_err(wiphy, "%s: Fifo blocked\n", __func__);
-		return -EBUSY;
-	}
 	rr_retry_limit = ampdu->rr_retry_limit_tid[tid];
 	ampdu_len = 0;
 	dma_len = 0;
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +1 -1
index 4534926..9ef7707 100644
@@ -333,7 +333,7 @@ bool wlc_dpc(struct wlc_info *wlc, bool bounded)
 
 	/* BCN template is available */
 	/* ZZZ: Use AP_ACTIVE ? */
-	if (AP_ENAB(wlc->pub) && (!APSTA_ENAB(wlc->pub) || wlc->aps_associated)
+	if (AP_ENAB(wlc->pub) && (!APSTA_ENAB(wlc->pub))
 	    && (macintstatus & MI_BCNTPL)) {
 		wlc_update_beacon(wlc);
 	}
drivers/staging/brcm80211/brcmsmac/wlc_main.c +10 -111

291 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_main.h +0 -86

189 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#6 lore raw

PATCH 7/83 staging: brcm80211: fix compiler warning introduced

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

Patch "[0f06b6a] remove WLC_WATCHDOG_TBTT macro" resulted in compiler warning because static function wlc_watchdog_backup_bi() is no longer used. This has been fixed in this patch.

---
 drivers/staging/brcm80211/brcmsmac/wlc_main.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)
drivers/staging/brcm80211/brcmsmac/wlc_main.c +0 -16
index 33045d5..c1257d4 100644
@@ -732,22 +732,6 @@ void wlc_set_chanspec(struct wlc_info *wlc, chanspec_t chanspec)
 	wlc_ucode_mac_upd(wlc);
 }
 
-static u32 wlc_watchdog_backup_bi(struct wlc_info *wlc)
-{
-	u32 bi;
-	bi = 2 * wlc->cfg->current_bss->dtim_period *
-	    wlc->cfg->current_bss->beacon_period;
-	if (wlc->bcn_li_dtim)
-		bi *= wlc->bcn_li_dtim;
-	else if (wlc->bcn_li_bcn)
-		/* recalculate bi based on bcn_li_bcn */
-		bi = 2 * wlc->bcn_li_bcn * wlc->cfg->current_bss->beacon_period;
-
-	if (bi < 2 * TIMER_INTERVAL_WATCHDOG)
-		bi = 2 * TIMER_INTERVAL_WATCHDOG;
-	return bi;
-}
-
 ratespec_t wlc_lowest_basic_rspec(struct wlc_info *wlc, wlc_rateset_t *rs)
 {
 	ratespec_t lowest_basic_rspec;
Signature · 1 line
1.7.4.1
#7 lore raw

PATCH 8/83 staging: brcm80211: replaced #ifdef __mips__ sections by W_REG_FLUSH

In reply to Roland Vossen

Code cleanup. A read-after-write construct is present in the code to ensure write order for certain Broadcom chips. Those chips are: bcm4706, bcm4716, bcm4717, bcm4718. All these chips contain a MIPS processor. This patch gets rid of several #ifdef __mips__ sections by defining a new macro in a header file. This patch does not introduce behavioral changes and is purely meant for code cleanup. The __mips__ define will be made more specific in a future patch.

---
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c   |   63 ++++----------------
 drivers/staging/brcm80211/include/bcmutils.h       |   11 ++++
 2 files changed, 24 insertions(+), 50 deletions(-)
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c +13 -50
index f45628a..07a5bcb 100644
@@ -247,16 +247,10 @@ u16 read_radio_reg(phy_info_t *pi, u16 addr)
 	if ((D11REV_GE(pi->sh->corerev, 24)) ||
 	    (D11REV_IS(pi->sh->corerev, 22)
 	     && (pi->pubpi.phy_type != PHY_TYPE_SSN))) {
-		W_REG(&pi->regs->radioregaddr, addr);
-#ifdef __mips__
-		(void)R_REG(&pi->regs->radioregaddr);
-#endif
+		W_REG_FLUSH(&pi->regs->radioregaddr, addr);
 		data = R_REG(&pi->regs->radioregdata);
 	} else {
-		W_REG(&pi->regs->phy4waddr, addr);
-#ifdef __mips__
-		(void)R_REG(&pi->regs->phy4waddr);
-#endif
+		W_REG_FLUSH(&pi->regs->phy4waddr, addr);
 
 #ifdef __ARM_ARCH_4T__
 		__asm__(" .align 4 ");
@@ -281,16 +275,10 @@ void write_radio_reg(phy_info_t *pi, u16 addr, u16 val)
 	    (D11REV_IS(pi->sh->corerev, 22)
 	     && (pi->pubpi.phy_type != PHY_TYPE_SSN))) {
 
-		W_REG(&pi->regs->radioregaddr, addr);
-#ifdef __mips__
-		(void)R_REG(&pi->regs->radioregaddr);
-#endif
+		W_REG_FLUSH(&pi->regs->radioregaddr, addr);
 		W_REG(&pi->regs->radioregdata, val);
 	} else {
-		W_REG(&pi->regs->phy4waddr, addr);
-#ifdef __mips__
-		(void)R_REG(&pi->regs->phy4waddr);
-#endif
+		W_REG_FLUSH(&pi->regs->phy4waddr, addr);
 		W_REG(&pi->regs->phy4wdatalo, val);
 	}
 
@@ -312,29 +300,17 @@ static u32 read_radio_id(phy_info_t *pi)
 	if (D11REV_GE(pi->sh->corerev, 24)) {
 		u32 b0, b1, b2;
 
-		W_REG(&pi->regs->radioregaddr, 0);
-#ifdef __mips__
-		(void)R_REG(&pi->regs->radioregaddr);
-#endif
+		W_REG_FLUSH(&pi->regs->radioregaddr, 0);
 		b0 = (u32) R_REG(&pi->regs->radioregdata);
-		W_REG(&pi->regs->radioregaddr, 1);
-#ifdef __mips__
-		(void)R_REG(&pi->regs->radioregaddr);
-#endif
+		W_REG_FLUSH(&pi->regs->radioregaddr, 1);
 		b1 = (u32) R_REG(&pi->regs->radioregdata);
-		W_REG(&pi->regs->radioregaddr, 2);
-#ifdef __mips__
-		(void)R_REG(&pi->regs->radioregaddr);
-#endif
+		W_REG_FLUSH(&pi->regs->radioregaddr, 2);
 		b2 = (u32) R_REG(&pi->regs->radioregdata);
 
 		id = ((b0 & 0xf) << 28) | (((b2 << 8) | b1) << 12) | ((b0 >> 4)
 								      & 0xf);
 	} else {
-		W_REG(&pi->regs->phy4waddr, RADIO_IDCODE);
-#ifdef __mips__
-		(void)R_REG(&pi->regs->phy4waddr);
-#endif
+		W_REG_FLUSH(&pi->regs->phy4waddr, RADIO_IDCODE);
 		id = (u32) R_REG(&pi->regs->phy4wdatalo);
 		id |= (u32) R_REG(&pi->regs->phy4wdatahi) << 16;
 	}
@@ -397,10 +373,7 @@ u16 read_phy_reg(phy_info_t *pi, u16 addr)
 
 	regs = pi->regs;
 
-	W_REG(&regs->phyregaddr, addr);
-#ifdef __mips__
-	(void)R_REG(&regs->phyregaddr);
-#endif
+	W_REG_FLUSH(&regs->phyregaddr, addr);
 
 	pi->phy_wreg = 0;
 	return R_REG(&regs->phyregdata);
@@ -413,8 +386,7 @@ void write_phy_reg(phy_info_t *pi, u16 addr, u16 val)
 	regs = pi->regs;
 
 #ifdef __mips__
-	W_REG(&regs->phyregaddr, addr);
-	(void)R_REG(&regs->phyregaddr);
+	W_REG_FLUSH(&regs->phyregaddr, addr);
 	W_REG(&regs->phyregdata, val);
 	if (addr == 0x72)
 		(void)R_REG(&regs->phyregdata);
@@ -436,10 +408,7 @@ void and_phy_reg(phy_info_t *pi, u16 addr, u16 val)
 
 	regs = pi->regs;
 
-	W_REG(&regs->phyregaddr, addr);
-#ifdef __mips__
-	(void)R_REG(&regs->phyregaddr);
-#endif
+	W_REG_FLUSH(&regs->phyregaddr, addr);
 
 	W_REG(&regs->phyregdata, (R_REG(&regs->phyregdata) & val));
 	pi->phy_wreg = 0;
@@ -451,10 +420,7 @@ void or_phy_reg(phy_info_t *pi, u16 addr, u16 val)
 
 	regs = pi->regs;
 
-	W_REG(&regs->phyregaddr, addr);
-#ifdef __mips__
-	(void)R_REG(&regs->phyregaddr);
-#endif
+	W_REG_FLUSH(&regs->phyregaddr, addr);
 
 	W_REG(&regs->phyregdata, (R_REG(&regs->phyregdata) | val));
 	pi->phy_wreg = 0;
@@ -466,10 +432,7 @@ void mod_phy_reg(phy_info_t *pi, u16 addr, u16 mask, u16 val)
 
 	regs = pi->regs;
 
-	W_REG(&regs->phyregaddr, addr);
-#ifdef __mips__
-	(void)R_REG(&regs->phyregaddr);
-#endif
+	W_REG_FLUSH(&regs->phyregaddr, addr);
 
 	W_REG(&regs->phyregdata,
 	      ((R_REG(&regs->phyregdata) & ~mask) | (val & mask)));
drivers/staging/brcm80211/include/bcmutils.h +11 -0
index 17683f2..d7f531e 100644
@@ -366,6 +366,17 @@ extern void bcm_prpkt(const char *msg, struct sk_buff *p0);
 	} while (0)
 #endif				/* __BIG_ENDIAN */
 
+#ifdef __mips__
+/*
+ * bcm4716 (which includes 4717 & 4718), plus 4706 on PCIe can reorder
+ * transactions. As a fix, a read after write is performed on certain places
+ * in the code. Older chips and the newer 5357 family don't require this fix.
+ */
+#define W_REG_FLUSH(r, v)	({ W_REG((r), (v)); (void)R_REG(r); })
+#else
+#define W_REG_FLUSH(r, v)	W_REG((r), (v))
+#endif				/* __mips__ */
+
 #define AND_REG(r, v)	W_REG((r), R_REG(r) & (v))
 #define OR_REG(r, v)	W_REG((r), R_REG(r) | (v))
 
Signature · 1 line
1.7.4.1
#8 lore raw

Re: [PATCH 08/83] staging: brcm80211: replaced #ifdef __mips__ sections by W_REG_FLUSH

drivers/staging/brcm80211/include/bcmutils.h extern void bcm_prpkt(const char *msg, struct sk_buff *p0); · line 374

Quoted 12 lines · Roland Vossen
drivers/staging/brcm80211/include/bcmutils.h +6 -0
@@ -366,6 +366,17 @@ extern void bcm_prpkt(const char *msg, struct sk_buff *p0);
        } while (0)
  #endif                         /* __BIG_ENDIAN */
 
+#ifdef __mips__
+/*
+ * bcm4716 (which includes 4717 & 4718), plus 4706 on PCIe can reorder
+ * transactions. As a fix, a read after write is performed on certain places
+ * in the code. Older chips and the newer 5357 family don't require this fix.
+ */

Checking for CONFIG_BCM47XX instead of __mips__ would be a bit cleaner and less broad. Although the bcm47x6s are not supported by BCM47XX yet, when the support gets added they will be caught by this without affecting other mips platforms.
Perhaps a clean solution would be to introduce a quirk option/value in the pci_bus or pci_dev the driver can use to decide at runtime whether it needs this workaround or not. This would also allow other drivers to check for it if they are also affected by it (even if the probability of this is rather low - at least I haven't seen a bcm47x6 yet with anything other than a broadcom wifi connected to its pcie ;-).

Jonas

#9 lore raw

Re: [PATCH 08/83] staging: brcm80211: replaced #ifdef __mips__ sections by W_REG_FLUSH

Hello Jonas,

Quoted 11 lines

Checking for CONFIG_BCM47XX instead of __mips__ would be a bit cleaner and less broad. Although the bcm47x6s are not supported by BCM47XX yet, when the support gets added they will be caught by this without affecting other mips platforms.
Perhaps a clean solution would be to introduce a quirk option/value in the pci_bus or pci_dev the driver can use to decide at runtime whether it needs this workaround or not. This would also allow other drivers to check for it if they are also affected by it (even if the probability of this is rather low - at least I haven't seen a bcm47x6 yet with anything other than a broadcom wifi connected to its pcie ;-).

Further mips cleanup is in the pipeline, your suggestion is certainly a good one. A similar suggestion has been made by GregKH in the past.

However, the focus of the patch set is on code cleanup. So my intention is to rewrite code to make it cleaner, without changing existing behavior.

Your (and Gregs) suggestion have been noted down and will get a follow-up in the future.

Thanks for the feedback,

Roland.

#10 lore raw

PATCH 9/83 staging: brcm80211: emptied wlioctl.h

In reply to Roland Vossen

Code cleanup. Broadcom specific ioctl functionality is not necessary in the Linux world. Deleted unused defines and structs from wlioctl.h. Moved softmac specific items from wlioctl.h to softmac header files, same for fullmac items. Moved shared fullmac/softmac definitions to other header files.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h           |  714 +++++++++--
 drivers/staging/brcm80211/brcmfmac/dhd_common.c    |    1 -
 .../staging/brcm80211/brcmfmac/dhd_custom_gpio.c   |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h     |    1 -
 drivers/staging/brcm80211/brcmfmac/dhdioctl.h      |   80 --
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h   |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         |   20 +-
 drivers/staging/brcm80211/brcmfmac/wl_iw.h         |    2 -
 drivers/staging/brcm80211/brcmsmac/bcmsrom_tbl.h   |    2 -
 drivers/staging/brcm80211/brcmsmac/d11.h           |   13 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_hal.h   |   40 +-
 drivers/staging/brcm80211/brcmsmac/wl_dbg.h        |    2 +-
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c   |    1 -
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.h   |    4 +
 drivers/staging/brcm80211/brcmsmac/wlc_alloc.c     |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c     |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_antsel.c    |    9 +-
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |    2 -
 drivers/staging/brcm80211/brcmsmac/wlc_channel.c   |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_key.h       |    2 +
 drivers/staging/brcm80211/brcmsmac/wlc_main.c      |   29 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.h      |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c  |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.h  |   55 +
 drivers/staging/brcm80211/brcmsmac/wlc_pub.h       |  103 ++-
 drivers/staging/brcm80211/brcmsmac/wlc_rate.c      |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_scb.h       |    2 +
 drivers/staging/brcm80211/brcmsmac/wlc_stf.c       |    1 -
 drivers/staging/brcm80211/include/bcmdefs.h        |   52 +
 drivers/staging/brcm80211/include/bcmwifi.h        |   58 +
 drivers/staging/brcm80211/include/wlioctl.h        | 1345 --------------------
 32 files changed, 993 insertions(+), 1555 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +621 -93
index a726b49..6156062 100644
@@ -34,15 +34,167 @@
 #include <linux/suspend.h>
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
+#include "bcmdefs.h"
 /* The kernel threading is sdio-specific */
-
-#include <wlioctl.h>
+#include "bcmwifi.h"
+#include "proto/802.11.h"
+#include "proto/bcmeth.h"
+#include "proto/bcmevent.h"
 
 /* Forward decls */
 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 */
+
+/* phy types (returned by WLC_GET_PHYTPE) */
+#define	WLC_PHY_TYPE_A		0
+#define	WLC_PHY_TYPE_B		1
+#define	WLC_PHY_TYPE_G		2
+#define	WLC_PHY_TYPE_N		4
+#define	WLC_PHY_TYPE_LP		5
+#define	WLC_PHY_TYPE_SSN	6
+#define	WLC_PHY_TYPE_HT		7
+#define	WLC_PHY_TYPE_LCN	8
+#define	WLC_PHY_TYPE_NULL	0xf
+
+#define WL_PKT_FILTER_FIXED_LEN		  offsetof(wl_pkt_filter_t, u)
+#define WL_PKT_FILTER_PATTERN_FIXED_LEN	  offsetof(wl_pkt_filter_pattern_t, mask_and_pattern)
+
+#define WL_EVENTING_MASK_LEN	16
+
+#define TOE_TX_CSUM_OL		0x00000001
+#define TOE_RX_CSUM_OL		0x00000002
+
+/* maximum channels returned by the get valid channels iovar */
+#define WL_NUMCHANNELS		64
+
+#define	WL_BSS_INFO_VERSION	108	/* current ver of wl_bss_info struct */
+
+/* size of wl_scan_params not including variable length array */
+#define WL_SCAN_PARAMS_FIXED_SIZE 64
+
+/* masks for channel and ssid count */
+#define WL_SCAN_PARAMS_COUNT_MASK 0x0000ffff
+#define WL_SCAN_PARAMS_NSSID_SHIFT 16
+
+#define WL_SCAN_ACTION_START      1
+#define WL_SCAN_ACTION_CONTINUE   2
+#define WL_SCAN_ACTION_ABORT      3
+
+#define ISCAN_REQ_VERSION 1
+
+/* wl_iscan_results status values */
+#define WL_SCAN_RESULTS_SUCCESS	0
+#define WL_SCAN_RESULTS_PARTIAL	1
+#define WL_SCAN_RESULTS_PENDING	2
+#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	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() */
+#define MOD_PARAM_PATHLEN	2048
+
+/* For supporting multiple interfaces */
+#define DHD_MAX_IFS	16
+#define DHD_DEL_IF	-0xe
+#define DHD_BAD_IF	-0xf
+
+enum cust_gpio_modes {
+	WLAN_RESET_ON,
+	WLAN_RESET_OFF,
+	WLAN_POWER_ON,
+	WLAN_POWER_OFF
+};
+
 /* The level of bus communication with the dongle */
 enum dhd_bus_state {
 	DHD_BUS_DOWN,		/* Not ready for frame transfers */
@@ -50,6 +202,316 @@ enum dhd_bus_state {
 	DHD_BUS_DATA		/* Ready for frame transfers */
 };
 
+/* Pattern matching filter. Specifies an offset within received packets to
+ * start matching, the pattern to match, the size of the pattern, and a bitmask
+ * that indicates which bits within the pattern should be matched.
+ */
+typedef struct wl_pkt_filter_pattern {
+	u32 offset;		/* Offset within received packet to start pattern matching.
+				 * Offset '0' is the first byte of the ethernet header.
+				 */
+	u32 size_bytes;	/* Size of the pattern.  Bitmask must be the same size. */
+	u8 mask_and_pattern[1];	/* Variable length mask and pattern data.  mask starts
+					 * at offset 0.  Pattern immediately follows mask.
+					 */
+} wl_pkt_filter_pattern_t;
+
+/* IOVAR "pkt_filter_add" parameter. Used to install packet filters. */
+typedef struct wl_pkt_filter {
+	u32 id;		/* Unique filter id, specified by app. */
+	u32 type;		/* Filter type (WL_PKT_FILTER_TYPE_xxx). */
+	u32 negate_match;	/* Negate the result of filter matches */
+	union {			/* Filter definitions */
+		wl_pkt_filter_pattern_t pattern;	/* Pattern matching filter */
+	} u;
+} wl_pkt_filter_t;
+
+/* IOVAR "pkt_filter_enable" parameter. */
+typedef struct wl_pkt_filter_enable {
+	u32 id;		/* Unique filter id */
+	u32 enable;		/* Enable/disable bool */
+} wl_pkt_filter_enable_t;
+
+/* BSS info structure
+ * Applications MUST CHECK ie_offset field and length field to access IEs and
+ * next bss_info structure in a vector (in wl_scan_results_t)
+ */
+typedef struct wl_bss_info {
+	u32 version;		/* version field */
+	u32 length;		/* byte length of data in this record,
+				 * starting at version and including IEs
+				 */
+	u8 BSSID[ETH_ALEN];
+	u16 beacon_period;	/* units are Kusec */
+	u16 capability;	/* Capability information */
+	u8 SSID_len;
+	u8 SSID[32];
+	struct {
+		uint count;	/* # rates in this set */
+		u8 rates[16];	/* rates in 500kbps units w/hi bit set if basic */
+	} rateset;		/* supported rates */
+	chanspec_t chanspec;	/* chanspec for bss */
+	u16 atim_window;	/* units are Kusec */
+	u8 dtim_period;	/* DTIM period */
+	s16 RSSI;		/* receive signal strength (in dBm) */
+	s8 phy_noise;		/* noise (in dBm) */
+
+	u8 n_cap;		/* BSS is 802.11N Capable */
+	u32 nbss_cap;	/* 802.11N BSS Capabilities (based on HT_CAP_*) */
+	u8 ctl_ch;		/* 802.11N BSS control channel number */
+	u32 reserved32[1];	/* Reserved for expansion of BSS properties */
+	u8 flags;		/* flags */
+	u8 reserved[3];	/* Reserved for expansion of BSS properties */
+	u8 basic_mcs[MCSSET_LEN];	/* 802.11N BSS required MCS set */
+
+	u16 ie_offset;	/* offset at which IEs start, from beginning */
+	u32 ie_length;	/* byte length of Information Elements */
+	s16 SNR;		/* average SNR of during frame reception */
+	/* Add new fields here */
+	/* variable length Information Elements */
+} wl_bss_info_t;
+
+typedef struct wlc_ssid {
+	u32 SSID_len;
+	unsigned char SSID[32];
+} wlc_ssid_t;
+
+typedef struct wl_scan_params {
+	wlc_ssid_t ssid;	/* default: {0, ""} */
+	u8 bssid[ETH_ALEN];	/* default: bcast */
+	s8 bss_type;		/* default: any,
+				 * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
+				 */
+	u8 scan_type;	/* flags, 0 use default */
+	s32 nprobes;		/* -1 use default, number of probes per channel */
+	s32 active_time;	/* -1 use default, dwell time per channel for
+				 * active scanning
+				 */
+	s32 passive_time;	/* -1 use default, dwell time per channel
+				 * for passive scanning
+				 */
+	s32 home_time;	/* -1 use default, dwell time for the home channel
+				 * between channel scans
+				 */
+	s32 channel_num;	/* count of channels and ssids that follow
+				 *
+				 * low half is count of channels in channel_list, 0
+				 * means default (use all available channels)
+				 *
+				 * high half is entries in wlc_ssid_t array that
+				 * follows channel_list, aligned for s32 (4 bytes)
+				 * meaning an odd channel count implies a 2-byte pad
+				 * between end of channel_list and first ssid
+				 *
+				 * if ssid count is zero, single ssid in the fixed
+				 * parameter portion is assumed, otherwise ssid in
+				 * the fixed portion is ignored
+				 */
+	u16 channel_list[1];	/* list of chanspecs */
+} wl_scan_params_t;
+
+/* incremental scan struct */
+typedef struct wl_iscan_params {
+	u32 version;
+	u16 action;
+	u16 scan_duration;
+	wl_scan_params_t params;
+} wl_iscan_params_t;
+
+/* 3 fields + size of wl_scan_params, not including variable length array */
+#define WL_ISCAN_PARAMS_FIXED_SIZE (offsetof(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
+
+typedef struct wl_scan_results {
+	u32 buflen;
+	u32 version;
+	u32 count;
+	wl_bss_info_t bss_info[1];
+} wl_scan_results_t;
+
+typedef struct wl_rateset_args {
+	u32 count;		/* # rates in this set */
+	u8 rates[WL_NUMRATES];	/* rates in 500kbps units w/hi bit set if basic */
+	u8 mcs[MCSSET_LEN];	/* supported mcs index bit map */
+} wl_rateset_args_t;
+
+/* u32 list */
+typedef struct wl_u32_list {
+	/* in - # of elements, out - # of entries */
+	u32 count;
+	/* variable length u32 list */
+	u32 element[1];
+} wl_u32_list_t;
+
+/* used for association with a specific BSSID and chanspec list */
+typedef struct wl_assoc_params {
+	u8 bssid[ETH_ALEN];	/* 00:00:00:00:00:00: broadcast scan */
+	s32 chanspec_num;	/* 0: all available channels,
+				 * otherwise count of chanspecs in chanspec_list
+				 */
+	chanspec_t chanspec_list[1];	/* list of chanspecs */
+} wl_assoc_params_t;
+#define WL_ASSOC_PARAMS_FIXED_SIZE 	(sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
+
+/* 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 {
+	wlc_ssid_t ssid;
+	wl_assoc_params_t params;	/* optional field, but it must include the fixed portion
+					 * of the wl_assoc_params_t struct when it does present.
+					 */
+} wl_join_params_t;
+#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))
+
+/* incremental scan results struct */
+typedef struct wl_iscan_results {
+	u32 status;
+	wl_scan_results_t results;
+} wl_iscan_results_t;
+
+/* size of wl_iscan_results not including variable length array */
+#define WL_ISCAN_RESULTS_FIXED_SIZE \
+	(WL_SCAN_RESULTS_FIXED_SIZE + offsetof(wl_iscan_results_t, results))
+
+typedef struct {
+	u32 duration;	/* millisecs spent sampling this channel */
+	u32 congest_ibss;	/* millisecs in our bss (presumably this traffic will */
+	/*  move if cur bss moves channels) */
+	u32 congest_obss;	/* traffic not in our bss */
+	u32 interference;	/* millisecs detecting a non 802.11 interferer. */
+	u32 timestamp;	/* second timestamp */
+} cca_congest_t;
+
+typedef struct {
+	chanspec_t chanspec;	/* Which channel? */
+	u8 num_secs;		/* How many secs worth of data */
+	cca_congest_t secs[1];	/* Data */
+} cca_congest_channel_req_t;
+
+typedef struct wl_country {
+	char country_abbrev[WLC_CNTRY_BUF_SZ];	/* nul-terminated country code used in
+						 * the Country IE
+						 */
+	s32 rev;		/* revision specifier for ccode
+				 * on set, -1 indicates unspecified.
+				 * on get, rev >= 0
+				 */
+	char ccode[WLC_CNTRY_BUF_SZ];	/* nul-terminated built-in country code.
+					 * variable length, but fixed size in
+					 * struct allows simple allocation for
+					 * expected country strings <= 3 chars.
+					 */
+} wl_country_t;
+
+typedef struct wl_channels_in_country {
+	u32 buflen;
+	u32 band;
+	char country_abbrev[WLC_CNTRY_BUF_SZ];
+	u32 count;
+	u32 channel[1];
+} wl_channels_in_country_t;
+
+typedef struct wl_country_list {
+	u32 buflen;
+	u32 band_set;
+	u32 band;
+	u32 count;
+	char country_abbrev[1];
+} wl_country_list_t;
+
+typedef struct wl_rm_req_elt {
+	s8 type;
+	s8 flags;
+	chanspec_t chanspec;
+	u32 token;		/* token for this measurement */
+	u32 tsf_h;		/* TSF high 32-bits of Measurement start time */
+	u32 tsf_l;		/* TSF low 32-bits */
+	u32 dur;		/* TUs */
+} wl_rm_req_elt_t;
+
+typedef struct wl_rm_req {
+	u32 token;		/* overall measurement set token */
+	u32 count;		/* number of measurement requests */
+	void *cb;		/* completion callback function: may be NULL */
+	void *cb_arg;		/* arg to completion callback function */
+	wl_rm_req_elt_t req[1];	/* variable length block of requests */
+} wl_rm_req_t;
+#define WL_RM_REQ_FIXED_LEN	offsetof(wl_rm_req_t, req)
+
+typedef struct wl_rm_rep_elt {
+	s8 type;
+	s8 flags;
+	chanspec_t chanspec;
+	u32 token;		/* token for this measurement */
+	u32 tsf_h;		/* TSF high 32-bits of Measurement start time */
+	u32 tsf_l;		/* TSF low 32-bits */
+	u32 dur;		/* TUs */
+	u32 len;		/* byte length of data block */
+	u8 data[1];		/* variable length data block */
+} wl_rm_rep_elt_t;
+#define WL_RM_REP_ELT_FIXED_LEN	24	/* length excluding data block */
+
+#define WL_RPI_REP_BIN_NUM 8
+typedef struct wl_rm_rpi_rep {
+	u8 rpi[WL_RPI_REP_BIN_NUM];
+	s8 rpi_max[WL_RPI_REP_BIN_NUM];
+} wl_rm_rpi_rep_t;
+
+typedef struct wl_rm_rep {
+	u32 token;		/* overall measurement set token */
+	u32 len;		/* length of measurement report block */
+	wl_rm_rep_elt_t rep[1];	/* variable length block of reports */
+} wl_rm_rep_t;
+#define WL_RM_REP_FIXED_LEN	8
+
+typedef struct wl_wsec_key {
+	u32 index;		/* key index */
+	u32 len;		/* key length */
+	u8 data[WLAN_MAX_KEY_LEN];	/* key data */
+	u32 pad_1[18];
+	u32 algo;		/* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
+	u32 flags;		/* misc flags */
+	u32 pad_2[2];
+	int pad_3;
+	int iv_initialized;	/* has IV been initialized already? */
+	int pad_4;
+	/* Rx IV */
+	struct {
+		u32 hi;	/* upper 32 bits of IV */
+		u16 lo;	/* lower 16 bits of IV */
+	} rxiv;
+	u32 pad_5[2];
+	u8 ea[ETH_ALEN];	/* per station */
+} wl_wsec_key_t;
+
+/* Used to get specific STA parameters */
+typedef struct {
+	u32 val;
+	u8 ea[ETH_ALEN];
+} scb_val_t;
+
+/* channel encoding */
+typedef struct channel_info {
+	int hw_channel;
+	int target_channel;
+	int scan_channel;
+} channel_info_t;
+
+/* Linux network driver ioctl encoding */
+typedef struct wl_ioctl {
+	uint cmd;		/* common ioctl definition */
+	void *buf;		/* pointer to user buffer */
+	uint len;		/* length of user buffer */
+	u8 set;		/* get or set request (optional) */
+	uint used;		/* bytes read or written (optional) */
+	uint needed;		/* bytes needed (optional) */
+} wl_ioctl_t;
+
 /* Common structure for module and instance linkage */
 typedef struct dhd_pub {
 	/* Linkage ponters */
@@ -122,6 +584,20 @@ typedef struct dhd_pub {
 
 } dhd_pub_t;
 
+typedef struct dhd_if_event {
+	u8 ifidx;
+	u8 action;
+	u8 flags;
+	u8 bssidx;
+} dhd_if_event_t;
+
+typedef struct {
+	u32 limit;		/* Expiration time (usec) */
+	u32 increment;	/* Current expiration increment (usec) */
+	u32 elapsed;		/* Current elapsed time (usec) */
+	u32 tick;		/* O/S tick time (usec) */
+} dhd_timeout_t;
+
 #if defined(CONFIG_PM_SLEEP)
 extern atomic_t dhd_mmc_suspend;
 #define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
@@ -167,7 +643,69 @@ extern atomic_t dhd_mmc_suspend;
 	} while (0)
 
 #endif	/* defined(CONFIG_PM_SLEEP) */
-#define DHD_IF_VIF	0x01	/* Virtual IF (Hidden from user) */
+
+/*
+ * Insmod parameters for debug/test
+ */
+
+/* Watchdog timer interval */
+extern uint dhd_watchdog_ms;
+
+#if defined(DHD_DEBUG)
+/* Console output poll interval */
+extern uint dhd_console_ms;
+#endif				/* defined(DHD_DEBUG) */
+
+/* Use interrupts */
+extern uint dhd_intr;
+
+/* Use polling */
+extern uint dhd_poll;
+
+/* ARP offload agent mode */
+extern uint dhd_arp_mode;
+
+/* ARP offload enable */
+extern uint dhd_arp_enable;
+
+/* Pkt filte enable control */
+extern uint dhd_pkt_filter_enable;
+
+/*  Pkt filter init setup */
+extern uint dhd_pkt_filter_init;
+
+/* Pkt filter mode control */
+extern uint dhd_master_mode;
+
+/* Roaming mode control */
+extern uint dhd_roam;
+
+/* Roaming mode control */
+extern uint dhd_radio_up;
+
+/* Initial idletime ticks (may be -1 for immediate idle, 0 for no idle) */
+extern int dhd_idletime;
+#define DHD_IDLETIME_TICKS 1
+
+/* SDIO Drive Strength */
+extern uint dhd_sdiod_drive_strength;
+
+/* Override to force tx queueing all the time */
+extern uint dhd_force_tx_queueing;
+
+#ifdef SDTEST
+/* Echo packet generator (SDIO), pkts/s */
+extern uint dhd_pktgen;
+
+/* Echo packet len (0 => sawtooth, max 1800) */
+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 u32 g_assert_type;
 
 static inline void MUTEX_LOCK_INIT(dhd_pub_t *dhdp)
 {
@@ -205,13 +743,6 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
 {
 }
 
-typedef struct dhd_if_event {
-	u8 ifidx;
-	u8 action;
-	u8 flags;
-	u8 bssidx;
-} dhd_if_event_t;
-
 /*
  * Exported from dhd OS modules (dhd_linux/dhd_ndis)
  */
@@ -286,13 +817,6 @@ extern void dhd_os_sdtxunlock(dhd_pub_t *pub);
 
 int setScheduler(struct task_struct *p, int policy, struct sched_param *param);
 
-typedef struct {
-	u32 limit;		/* Expiration time (usec) */
-	u32 increment;	/* Current expiration increment (usec) */
-	u32 elapsed;		/* Current elapsed time (usec) */
-	u32 tick;		/* O/S tick time (usec) */
-} dhd_timeout_t;
-
 extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec);
 extern int dhd_timeout_expired(dhd_timeout_t *tmo);
 
@@ -324,85 +848,9 @@ extern int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag);
 extern uint dhd_bus_status(dhd_pub_t *dhdp);
 extern int dhd_bus_start(dhd_pub_t *dhdp);
 
-enum cust_gpio_modes {
-	WLAN_RESET_ON,
-	WLAN_RESET_OFF,
-	WLAN_POWER_ON,
-	WLAN_POWER_OFF
-};
-/*
- * Insmod parameters for debug/test
- */
-
-/* Watchdog timer interval */
-extern uint dhd_watchdog_ms;
-
-#if defined(DHD_DEBUG)
-/* Console output poll interval */
-extern uint dhd_console_ms;
-#endif				/* defined(DHD_DEBUG) */
-
-/* Use interrupts */
-extern uint dhd_intr;
-
-/* Use polling */
-extern uint dhd_poll;
-
-/* ARP offload agent mode */
-extern uint dhd_arp_mode;
-
-/* ARP offload enable */
-extern uint dhd_arp_enable;
-
-/* Pkt filte enable control */
-extern uint dhd_pkt_filter_enable;
-
-/*  Pkt filter init setup */
-extern uint dhd_pkt_filter_init;
-
-/* Pkt filter mode control */
-extern uint dhd_master_mode;
-
-/* Roaming mode control */
-extern uint dhd_roam;
-
-/* Roaming mode control */
-extern uint dhd_radio_up;
-
-/* Initial idletime ticks (may be -1 for immediate idle, 0 for no idle) */
-extern int dhd_idletime;
-#define DHD_IDLETIME_TICKS 1
-
-/* SDIO Drive Strength */
-extern uint dhd_sdiod_drive_strength;
-
-/* Override to force tx queueing all the time */
-extern uint dhd_force_tx_queueing;
-
-#ifdef SDTEST
-/* Echo packet generator (SDIO), pkts/s */
-extern uint dhd_pktgen;
-
-/* Echo packet len (0 => sawtooth, max 1800) */
-extern uint dhd_pktgen_len;
-#define MAX_PKTGEN_LEN 1800
-#endif
-
-/* optionally set by a module_param_string() */
-#define MOD_PARAM_PATHLEN	2048
-extern char fw_path[MOD_PARAM_PATHLEN];
-extern char nv_path[MOD_PARAM_PATHLEN];
-
-/* For supporting multiple interfaces */
-#define DHD_MAX_IFS	16
-#define DHD_DEL_IF	-0xe
-#define DHD_BAD_IF	-0xf
-
 extern void dhd_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
 extern void dhd_wait_event_wakeup(dhd_pub_t *dhd);
 
-extern u32 g_assert_type;
-
 #ifdef BCMDBG
 #define ASSERT(exp) \
 	  do { if (!(exp)) osl_assert(#exp, __FILE__, __LINE__); } while (0)
@@ -411,4 +859,84 @@ extern void osl_assert(char *exp, char *file, int line);
 #define ASSERT(exp)	do {} while (0)
 #endif  /* defined(BCMDBG) */
 
+/* Linux network driver ioctl encoding */
+typedef struct dhd_ioctl {
+	uint cmd;		/* common ioctl definition */
+	void *buf;		/* pointer to user buffer */
+	uint len;		/* length of user buffer */
+	bool set;		/* get or set request (optional) */
+	uint used;		/* bytes read or written (optional) */
+	uint needed;		/* bytes needed (optional) */
+	uint driver;		/* to identify target driver */
+} dhd_ioctl_t;
+
+/* per-driver magic numbers */
+#define DHD_IOCTL_MAGIC		0x00444944
+
+/* bump this number if you change the ioctl interface */
+#define DHD_IOCTL_VERSION	1
+
+#define	DHD_IOCTL_MAXLEN	8192	/* max length ioctl buffer required */
+#define	DHD_IOCTL_SMLEN	256	/* "small" length ioctl buffer required */
+
+/* common ioctl definitions */
+#define DHD_GET_MAGIC				0
+#define DHD_GET_VERSION				1
+#define DHD_GET_VAR				2
+#define DHD_SET_VAR				3
+
+/* message levels */
+#define DHD_ERROR_VAL	0x0001
+#define DHD_TRACE_VAL	0x0002
+#define DHD_INFO_VAL	0x0004
+#define DHD_DATA_VAL	0x0008
+#define DHD_CTL_VAL	0x0010
+#define DHD_TIMER_VAL	0x0020
+#define DHD_HDRS_VAL	0x0040
+#define DHD_BYTES_VAL	0x0080
+#define DHD_INTR_VAL	0x0100
+#define DHD_LOG_VAL	0x0200
+#define DHD_GLOM_VAL	0x0400
+#define DHD_EVENT_VAL	0x0800
+#define DHD_BTA_VAL	0x1000
+#define DHD_ISCAN_VAL 0x2000
+
+#ifdef SDTEST
+/* For pktgen iovar */
+typedef struct dhd_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 */
+	uint print;		/* Print counts every <print> attempts */
+	uint total;		/* Total packets (or bursts) */
+	uint minlen;		/* Minimum length of packets to send */
+	uint maxlen;		/* Maximum length of packets to send */
+	uint numsent;		/* Count of test packets sent */
+	uint numrcvd;		/* Count of test packets received */
+	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;
+
+/* Version in case structure changes */
+#define DHD_PKTGEN_VERSION 2
+
+/* Type of test packets to use */
+#define DHD_PKTGEN_ECHO		1	/* Send echo requests */
+#define DHD_PKTGEN_SEND		2	/* Send discard packets */
+#define DHD_PKTGEN_RXBURST	3	/* Request dongle send N packets */
+#define DHD_PKTGEN_RECV		4	/* Continuous rx from continuous
+					 tx dongle */
+#endif				/* SDTEST */
+
+/* Enter idle immediately (no timeout) */
+#define DHD_IDLE_IMMEDIATE	(-1)
+
+/* Values for idleclock iovar: other values are the sd_divisor to use
+	 when idle */
+#define DHD_IDLE_ACTIVE	0	/* Do not request any SD clock change
+				 when idle */
+#define DHD_IDLE_STOP   (-1)	/* Request SD clock be stopped
+				 (and use SD1 mode) */
+
 #endif				/* _dhd_h_ */
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -1
index 0bfb93c..5aa5ee4 100644
@@ -24,7 +24,6 @@
 #include <dhd_proto.h>
 #include <dhd_dbg.h>
 #include <msgtrace.h>
-#include <wlioctl.h>
 
 int dhd_msg_level;
 char fw_path[MOD_PARAM_PATHLEN];
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +0 -1
index 1cf6c5d..abd41e3 100644
@@ -20,7 +20,6 @@
 #include <dngl_stats.h>
 #include <dhd.h>
 
-#include <wlioctl.h>
 #include <wl_iw.h>
 
 #define WL_ERROR(fmt, args...) printk(fmt, ##args)
drivers/staging/brcm80211/brcmfmac/dhd_proto.h +0 -1
index 030d5ff..16b8942 100644
@@ -18,7 +18,6 @@
 #define _dhd_proto_h_
 
 #include <dhdioctl.h>
-#include <wlioctl.h>
 
 #ifndef IOCTL_RESP_TIMEOUT
 #define IOCTL_RESP_TIMEOUT  2000	/* In milli second */
drivers/staging/brcm80211/brcmfmac/dhdioctl.h +0 -80

84 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +0 -1
index 945e039..fa005d3 100644
@@ -24,7 +24,6 @@
 #include <dngl_stats.h>
 #include <dhd.h>
 #include <dhdioctl.h>
-#include <wlioctl.h>
 
 #include <linux/kthread.h>
 #include <linux/netdevice.h>
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +0 -1
index 996033c..4bd0392 100644
@@ -20,7 +20,6 @@
 #include <linux/wireless.h>
 #include <linux/wireless.h>
 #include <net/cfg80211.h>
-#include <wlioctl.h>
 
 struct wl_conf;
 struct wl_iface;
drivers/staging/brcm80211/brcmfmac/wl_iw.c +18 -2
index 929ceaf..b284b12 100644
@@ -18,7 +18,6 @@
 #include <linux/semaphore.h>
 #include <bcmdefs.h>
 #include <linux/netdevice.h>
-#include <wlioctl.h>
 
 #include <bcmutils.h>
 
@@ -30,7 +29,6 @@
 #include <dhdioctl.h>
 #include <linux/ieee80211.h>
 typedef const struct si_pub si_t;
-#include <wlioctl.h>
 
 #include <dngl_stats.h>
 #include <dhd.h>
@@ -115,6 +113,24 @@ typedef struct iscan_info {
 } iscan_info_t;
 iscan_info_t *g_iscan;
 
+typedef enum sup_auth_status {
+	WLC_SUP_DISCONNECTED = 0,
+	WLC_SUP_CONNECTING,
+	WLC_SUP_IDREQUIRED,
+	WLC_SUP_AUTHENTICATING,
+	WLC_SUP_AUTHENTICATED,
+	WLC_SUP_KEYXCHANGE,
+	WLC_SUP_KEYED,
+	WLC_SUP_TIMEOUT,
+	WLC_SUP_LAST_BASIC_STATE,
+	WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
+	WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
+	WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
+	WLC_SUP_KEYXCHANGE_PREP_M4,
+	WLC_SUP_KEYXCHANGE_WAIT_G1,
+	WLC_SUP_KEYXCHANGE_PREP_G2
+} sup_auth_status_t;
+
 static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
 
 /* Global ASSERT type flag */
drivers/staging/brcm80211/brcmfmac/wl_iw.h +0 -2
index fe06174..c92a8b5 100644
@@ -19,8 +19,6 @@
 
 #include <linux/wireless.h>
 
-#include <wlioctl.h>
-
 #define WL_SCAN_PARAMS_SSID_MAX	10
 #define GET_SSID	"SSID="
 #define GET_CHANNEL	"CH="
drivers/staging/brcm80211/brcmsmac/bcmsrom_tbl.h +0 -2
index f4b3e61..a41e62c 100644
@@ -17,8 +17,6 @@
 #ifndef	_bcmsrom_tbl_h_
 #define	_bcmsrom_tbl_h_
 
-#include "wlioctl.h"
-
 typedef struct {
 	const char *name;
 	u32 revmask;
drivers/staging/brcm80211/brcmsmac/d11.h +7 -6
index d91e418..cb434e5 100644
@@ -17,14 +17,9 @@
 #ifndef	_D11_H
 #define	_D11_H
 
+#include <linux/ieee80211.h>
 #include <sbconfig.h>
 
-#ifndef WL_RSSI_ANT_MAX
-#define WL_RSSI_ANT_MAX		4	/* max possible rx antennas */
-#elif WL_RSSI_ANT_MAX != 4
-#error "WL_RSSI_ANT_MAX does not match"
-#endif
-
 /* cpp contortions to concatenate w/arg prescan */
 #ifndef	PAD
 #define	_PADLINE(line)	pad ## line
@@ -56,6 +51,12 @@
 #define	TX_DATA_FIFO		TX_AC_BE_FIFO
 #define	TX_CTL_FIFO		TX_AC_VO_FIFO
 
+#ifndef WL_RSSI_ANT_MAX
+#define WL_RSSI_ANT_MAX		4	/* max possible rx antennas */
+#elif WL_RSSI_ANT_MAX != 4
+#error "WL_RSSI_ANT_MAX does not match"
+#endif
+
 typedef volatile struct {
 	u32 intstatus;
 	u32 intmask;
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_hal.h +39 -1
index 1ef96c7..93e3db9 100644
@@ -14,14 +14,18 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+/*
+ * wlc_phy_hal.h:  functionality exported from the phy to higher layers
+ */
+
 #ifndef _wlc_phy_h_
 #define _wlc_phy_h_
 
-#include <wlioctl.h>
 #include <aiutils.h>
 #include <d11.h>
 #include <wlc_phy_shim.h>
 #include <net/mac80211.h>	/* struct wiphy */
+#include "bcmwifi.h"		/* chanspec_t */
 
 #define	IDCODE_VER_MASK		0x0000000f
 #define	IDCODE_VER_SHIFT	0
@@ -87,12 +91,20 @@
 
 #define WLC_TXPWR_DB_FACTOR	4
 
+/* a large TX Power as an init value to factor out of min() calculations,
+ * keep low enough to fit in an s8, units are .25 dBm
+ */
+#define WLC_TXPWR_MAX		(127)	/* ~32 dBm = 1,500 mW */
+
 #define WLC_NUM_RATES_CCK           4
 #define WLC_NUM_RATES_OFDM          8
 #define WLC_NUM_RATES_MCS_1_STREAM  8
 #define WLC_NUM_RATES_MCS_2_STREAM  8
 #define WLC_NUM_RATES_MCS_3_STREAM  8
 #define WLC_NUM_RATES_MCS_4_STREAM  8
+
+#define	WLC_RSSI_INVALID	 0	/* invalid RSSI value */
+
 typedef struct txpwr_limits {
 	u8 cck[WLC_NUM_RATES_CCK];
 	u8 ofdm[WLC_NUM_RATES_OFDM];
@@ -115,6 +127,32 @@ typedef struct txpwr_limits {
 } txpwr_limits_t;
 
 typedef struct {
+	u32 flags;
+	chanspec_t chanspec;	/* txpwr report for this channel */
+	chanspec_t local_chanspec;	/* channel on which we are associated */
+	u8 local_max;	/* local max according to the AP */
+	u8 local_constraint;	/* local constraint according to the AP */
+	s8 antgain[2];	/* Ant gain for each band - from SROM */
+	u8 rf_cores;		/* count of RF Cores being reported */
+	u8 est_Pout[4];	/* Latest tx power out estimate per RF chain */
+	u8 est_Pout_act[4];	/* Latest tx power out estimate per RF chain
+				 * without adjustment
+				 */
+	u8 est_Pout_cck;	/* Latest CCK tx power out estimate */
+	u8 tx_power_max[4];	/* Maximum target power among all rates */
+	u8 tx_power_max_rate_ind[4];	/* Index of the rate with the max target power */
+	u8 user_limit[WL_TX_POWER_RATES];	/* User limit */
+	u8 reg_limit[WL_TX_POWER_RATES];	/* Regulatory power limit */
+	u8 board_limit[WL_TX_POWER_RATES];	/* Max power board can support (SROM) */
+	u8 target[WL_TX_POWER_RATES];	/* Latest target power */
+} tx_power_t;
+
+typedef struct tx_inst_power {
+	u8 txpwr_est_Pout[2];	/* Latest estimate for 2.4 and 5 Ghz */
+	u8 txpwr_est_Pout_gofdm;	/* Pwr estimate for 2.4 OFDM */
+} tx_inst_power_t;
+
+typedef struct {
 	u8 vec[MAXCHANNEL / NBBY];
 } chanvec_t;
 
drivers/staging/brcm80211/brcmsmac/wl_dbg.h +1 -1
index 5582de3..8cc6b1a 100644
@@ -19,7 +19,7 @@
 
 #include <linux/device.h>			/* dev_err() */
 
-/* wl_msg_level is a bit vector with defs in wlioctl.h */
+/* wl_msg_level is a bit vector with defs in bcmdefs.h */
 extern u32 wl_msg_level;
 
 #define BCMMSG(dev, fmt, args...)		\
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +0 -1
index f951f22..105f426 100644
@@ -32,7 +32,6 @@
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include <pcicfg.h>
-#include <wlioctl.h>
 #include <sbhnddma.h>
 
 #include "phy/wlc_phy_int.h"
drivers/staging/brcm80211/brcmsmac/wl_mac80211.h +4 -0
index c878690..fafde6a 100644
@@ -17,6 +17,10 @@
 #ifndef _wl_mac80211_h_
 #define _wl_mac80211_h_
 
+/* softmac ioctl definitions */
+#define WLC_SET_SHORTSLOT_OVERRIDE		146
+
+
 /* BMAC Note: High-only driver is no longer working in softirq context as it needs to block and
  * sleep so perimeter lock has to be a semaphore instead of spinlock. This requires timers to be
  * submitted to workqueue instead of being on kernel timer
drivers/staging/brcm80211/brcmsmac/wlc_alloc.c +0 -1
index 3c4b2c0..3b04e02 100644
@@ -19,7 +19,6 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <wlioctl.h>
 #include <sbhnddma.h>
 
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c +0 -1
index 75343ab..c83896b 100644
@@ -19,7 +19,6 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <wlioctl.h>
 #include <sbhnddma.h>
 #include <hnddma.h>
 #include <d11.h>
drivers/staging/brcm80211/brcmsmac/wlc_antsel.c +7 -2
index 111ef32..efdc62a 100644
@@ -26,7 +26,6 @@
 #include <aiutils.h>
 #include <bcmdevs.h>
 #include <sbhnddma.h>
-#include <wlioctl.h>
 
 #include "d11.h"
 #include "wlc_rate.h"
@@ -39,9 +38,15 @@
 #include "wlc_channel.h"
 #include "wlc_main.h"
 #include "wl_export.h"
-#include "wlc_phy_shim.h"
 #include "wlc_antsel.h"
 
+#define ANT_SELCFG_AUTO		0x80	/* bit indicates antenna sel AUTO */
+#define ANT_SELCFG_MASK		0x33	/* antenna configuration mask */
+#define ANT_SELCFG_TX_UNICAST	0	/* unicast tx antenna configuration */
+#define ANT_SELCFG_RX_UNICAST	1	/* unicast rx antenna configuration */
+#define ANT_SELCFG_TX_DEF	2	/* default tx antenna configuration */
+#define ANT_SELCFG_RX_DEF	3	/* default rx antenna configuration */
+
 /* useful macros */
 #define WLC_ANTSEL_11N_0(ant)	((((ant) & ANT_SELCFG_MASK) >> 4) & 0xf)
 #define WLC_ANTSEL_11N_1(ant)	(((ant) & ANT_SELCFG_MASK) & 0xf)
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +0 -2
index 9ef7707..adc06fc 100644
@@ -30,7 +30,6 @@
 #include <bcmotp.h>
 #include <bcmutils.h>
 #include <bcmnvram.h>
-#include <wlioctl.h>
 #include <sbconfig.h>
 #include <sbchipc.h>
 #include <pcicfg.h>
@@ -45,7 +44,6 @@
 #include "wlc_scb.h"
 #include "wlc_pub.h"
 #include "wlc_key.h"
-#include "wlc_phy_shim.h"
 #include "phy/wlc_phy_hal.h"
 #include "wlc_channel.h"
 #include "wlc_main.h"
drivers/staging/brcm80211/brcmsmac/wlc_channel.c +0 -1
index a3a2bf9..9e29339 100644
@@ -24,7 +24,6 @@
 #include <bcmnvram.h>
 #include <aiutils.h>
 #include <sbhnddma.h>
-#include <wlioctl.h>
 
 #include "wlc_types.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_key.h +2 -0
index cab10c7..f4bced5 100644
@@ -17,6 +17,8 @@
 #ifndef _wlc_key_h_
 #define _wlc_key_h_
 
+#include <linux/if_ether.h>	/* for ETH_ALEN */
+
 struct scb;
 struct wlc_info;
 struct wlc_bsscfg;
drivers/staging/brcm80211/brcmsmac/wlc_main.c +24 -5
index c1257d4..0837e8d 100644
@@ -27,7 +27,6 @@
 #include <aiutils.h>
 #include <pcicfg.h>
 #include <bcmsrom.h>
-#include <wlioctl.h>
 #include <sbhnddma.h>
 #include <hnddma.h>
 
@@ -45,14 +44,12 @@
 #include "wlc_main.h"
 #include "wlc_bmac.h"
 #include "wlc_phy_hal.h"
-#include "wlc_phy_shim.h"
 #include "wlc_antsel.h"
 #include "wlc_stf.h"
 #include "wlc_ampdu.h"
 #include "wl_export.h"
 #include "wlc_alloc.h"
 #include "wl_dbg.h"
-
 #include "wl_mac80211.h"
 
 /*
@@ -93,6 +90,30 @@
 
 #define	TBTT_ALIGN_LEEWAY_US	100	/* min leeway before first TBTT in us */
 
+/* Software feature flag defines used by wlfeatureflag */
+#define WL_SWFL_NOHWRADIO	0x0004
+#define WL_SWFL_FLOWCONTROL     0x0008	/* Enable backpressure to OS stack */
+#define WL_SWFL_WLBSSSORT	0x0010	/* Per-port supports sorting of BSS */
+
+/* n-mode support capability */
+/* 2x2 includes both 1x1 & 2x2 devices
+ * reserved #define 2 for future when we want to separate 1x1 & 2x2 and
+ * control it independently
+ */
+#define WL_11N_2x2			1
+#define WL_11N_3x3			3
+#define WL_11N_4x4			4
+
+/* define 11n feature disable flags */
+#define WLFEATURE_DISABLE_11N		0x00000001
+#define WLFEATURE_DISABLE_11N_STBC_TX	0x00000002
+#define WLFEATURE_DISABLE_11N_STBC_RX	0x00000004
+#define WLFEATURE_DISABLE_11N_SGI_TX	0x00000008
+#define WLFEATURE_DISABLE_11N_SGI_RX	0x00000010
+#define WLFEATURE_DISABLE_11N_AMPDU_TX	0x00000020
+#define WLFEATURE_DISABLE_11N_AMPDU_RX	0x00000040
+#define WLFEATURE_DISABLE_11N_GF	0x00000080
+
 /*
  * driver maintains internal 'tick'(wlc->pub->now) which increments in 1s OS timer(soft
  * watchdog) it is not a wall clock and won't increment when driver is in "down" state
@@ -2428,7 +2449,6 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
 	struct scb *nextscb;
 	bool ta_ok;
 	uint band;
-	rw_reg_t *r;
 	struct wlc_bsscfg *bsscfg;
 	wlc_bss_info_t *current_bss;
 
@@ -2440,7 +2460,6 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
 	nextscb = NULL;
 	ta_ok = false;
 	band = 0;
-	r = NULL;
 
 	/* If the device is turned off, then it's not "removed" */
 	if (!wlc->pub->hw_off && DEVICEREMOVED(wlc)) {
drivers/staging/brcm80211/brcmsmac/wlc_main.h +1 -1
index edbf3d2..3bbb774 100644
@@ -290,7 +290,7 @@ struct wlcband {
 	wlc_phy_t *pi;		/* pointer to phy specific information */
 	bool abgphy_encore;
 
-	u8 gmode;		/* currently active gmode (see wlioctl.h) */
+	u8 gmode;		/* currently active gmode */
 
 	struct scb *hwrs_scb;	/* permanent scb for hw rateset */
 
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +0 -1
index 16fea02..c33b61b 100644
@@ -30,7 +30,6 @@
 #include <bcmutils.h>
 #include <bcmwifi.h>
 #include <aiutils.h>
-#include <wlioctl.h>
 #include <sbconfig.h>
 #include <sbchipc.h>
 #include <pcicfg.h>
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.h +55 -0

67 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_pub.h +102 -1

127 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_rate.c +0 -1
index 87b252d..6c9574a 100644
@@ -20,7 +20,6 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <wlioctl.h>
 #include <sbhnddma.h>
 
 #include "wlc_types.h"
drivers/staging/brcm80211/brcmsmac/wlc_scb.h +2 -0
index f07a891..fd7767c 100644
@@ -17,6 +17,8 @@
 #ifndef _wlc_scb_h_
 #define _wlc_scb_h_
 
+#include <linux/if_ether.h>	/* for ETH_ALEN */
+
 #define AMPDU_TX_BA_MAX_WSIZE	64	/* max Tx ba window size (in pdu) */
 /* structure to store per-tid state for the ampdu initiator */
 typedef struct scb_ampdu_tid_ini {
drivers/staging/brcm80211/brcmsmac/wlc_stf.c +0 -1
index 544d883..ca1b8aa 100644
@@ -22,7 +22,6 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <wlioctl.h>
 #include <bcmwifi.h>
 #include <bcmnvram.h>
 #include <sbhnddma.h>
drivers/staging/brcm80211/include/bcmdefs.h +52 -0

56 lines not on this page · raw message

drivers/staging/brcm80211/include/bcmwifi.h +58 -0

68 lines not on this page · raw message

drivers/staging/brcm80211/include/wlioctl.h +0 -1345

1,349 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#11 lore raw

PATCH 10/83 staging: brcm80211: removed wlioctl.h and dhdioctl.h

In reply to Roland Vossen

Code cleanup. These header files were emptied by the previous patch.

---
 drivers/staging/brcm80211/brcmfmac/dhd_dbg.h     |    3 ---
 drivers/staging/brcm80211/brcmfmac/dhd_proto.h   |    2 --
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c    |    1 -
 drivers/staging/brcm80211/brcmfmac/dhdioctl.h    |   20 --------------------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |    1 -
 drivers/staging/brcm80211/brcmfmac/wl_iw.c       |    1 -
 drivers/staging/brcm80211/include/wlioctl.h      |   20 --------------------
 7 files changed, 0 insertions(+), 48 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhdioctl.h
 delete mode 100644 drivers/staging/brcm80211/include/wlioctl.h
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h +0 -3
index 0817f13..d0fa231 100644
@@ -97,7 +97,4 @@
 #define DHD_NONE(args)
 extern int dhd_msg_level;
 
-/* Defines msg bits */
-#include <dhdioctl.h>
-
 #endif				/* _dhd_dbg_ */
drivers/staging/brcm80211/brcmfmac/dhd_proto.h +0 -2
index 16b8942..d0c8321 100644
@@ -17,8 +17,6 @@
 #ifndef _dhd_proto_h_
 #define _dhd_proto_h_
 
-#include <dhdioctl.h>
-
 #ifndef IOCTL_RESP_TIMEOUT
 #define IOCTL_RESP_TIMEOUT  2000	/* In milli second */
 #endif
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -1
index b00029a..19a12b9 100644
@@ -49,7 +49,6 @@
 #include <dhd_bus.h>
 #include <dhd_proto.h>
 #include <dhd_dbg.h>
-#include <dhdioctl.h>
 #include <sdiovar.h>
 #include <bcmchip.h>
 
drivers/staging/brcm80211/brcmfmac/dhdioctl.h deleted +0 -20
deleted file mode 100644
index db0b9e8..0000000
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _dhdioctl_h_
-#define	_dhdioctl_h_
-
-#endif				/* _dhdioctl_h_ */
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +0 -1
index fa005d3..6aa186e 100644
@@ -23,7 +23,6 @@
 
 #include <dngl_stats.h>
 #include <dhd.h>
-#include <dhdioctl.h>
 
 #include <linux/kthread.h>
 #include <linux/netdevice.h>
drivers/staging/brcm80211/brcmfmac/wl_iw.c +0 -1
index b284b12..b5cb897 100644
@@ -26,7 +26,6 @@
 
 #include <dngl_stats.h>
 #include <dhd.h>
-#include <dhdioctl.h>
 #include <linux/ieee80211.h>
 typedef const struct si_pub si_t;
 
drivers/staging/brcm80211/include/wlioctl.h deleted +0 -20
deleted file mode 100644
index 281ca70..0000000
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _wlioctl_h_
-#define	_wlioctl_h_
-
-#endif				/* _wlioctl_h_ */
Signature · 1 line
1.7.4.1
#12 lore raw

PATCH 11/83 staging: brcm80211: updated MAINTAINERS, README and TODO files

In reply to Roland Vossen

README now only contains a link to the brcm80211 driver page. Two maintainers have been added, one deleted. TODO file has also been updated.

---
 MAINTAINERS                      |    3 +-
 drivers/staging/brcm80211/README |   65 +-------------------------------------
 drivers/staging/brcm80211/TODO   |   14 ++++++--
 3 files changed, 14 insertions(+), 68 deletions(-)
MAINTAINERS +2 -1
index 29801f7..39c17dd 100644
@@ -1533,9 +1533,10 @@ F:	drivers/net/tg3.*
 BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
 M:	Brett Rudley <[email protected]>
 M:	Henry Ptasinski <[email protected]>
-M:	Dowan Kim <[email protected]>
 M:	Roland Vossen <[email protected]>
 M:	Arend van Spriel <[email protected]>
+M:	Franky (Zhenhui) Lin <[email protected]>
+M:	Kan Yan	<[email protected]>
 L:	[email protected]
 S:	Supported
 F:	drivers/staging/brcm80211/
drivers/staging/brcm80211/README +1 -64

65 lines not on this page · raw message

drivers/staging/brcm80211/TODO +11 -3
index e9c1393..2d9948d 100644
@@ -2,14 +2,22 @@ To Do List for Broadcom Mac80211 driver before getting in mainline
 
 Bugs
 ====
-- Oops on AMPDU traffic, to be solved by new ucode (currently under test)
+- none known at this moment
 
 brcmfmac and brcmsmac
 =====================
-- ASSERTS not allowed in mainline, replace by warning + error handling
-- Replace printk and WL_ERROR() with proper routines
+
+- Remove unnecessary includes, move #includes from .h files into .c files.
+- Absorb and delete header files that are included in only one .c file
 
 brcmfmac
 =====================
+
+- ASSERTS not allowed in mainline, replace by warning + error handling
+- Replace printk and WL_ERROR() with proper routines
 - Replace driver's proprietary ssb interface with generic kernel ssb module
 - Build and test on 64 bit linux kernel
+
+brcm80211 info page
+=====================
+http://linuxwireless.org/en/users/Drivers/brcm80211
Signature · 1 line
1.7.4.1
#13 lore raw

PATCH 12/83 staging: brcm80211: remove iovars IOV_BLOCKMODE

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_BLCOKMODE for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -13
index c0ffbd3..4b13f42 100644
@@ -138,7 +138,6 @@ sdioh_info_t *sdioh_attach(void *bar0, uint irq)
 	}
 
 	sd->num_funcs = 2;
-	sd->sd_blockmode = true;
 	sd->use_client_ints = true;
 	sd->client_block_size[0] = 64;
 
@@ -352,7 +351,6 @@ uint sdioh_query_iofnum(sdioh_info_t *sd)
 /* IOVar table */
 enum {
 	IOV_MSGLEVEL = 1,
-	IOV_BLOCKMODE,
 	IOV_BLOCKSIZE,
 	IOV_DMA,
 	IOV_USEINTS,
@@ -371,7 +369,6 @@ enum {
 
 const bcm_iovar_t sdioh_iovars[] = {
 	{"sd_msglevel", IOV_MSGLEVEL, 0, IOVT_UINT32, 0},
-	{"sd_blockmode", IOV_BLOCKMODE, 0, IOVT_BOOL, 0},
 	{"sd_blocksize", IOV_BLOCKSIZE, 0, IOVT_UINT32, 0},/* ((fn << 16) |
 								 size) */
 	{"sd_dma", IOV_DMA, 0, IOVT_BOOL, 0},
@@ -457,16 +454,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 		sd_msglevel = int_val;
 		break;
 
-	case IOV_GVAL(IOV_BLOCKMODE):
-		int_val = (s32) si->sd_blockmode;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_BLOCKMODE):
-		si->sd_blockmode = (bool) int_val;
-		/* Haven't figured out how to make non-block mode with DMA */
-		break;
-
 	case IOV_GVAL(IOV_BLOCKSIZE):
 		if ((u32) int_val > si->num_funcs) {
 			bcmerror = -EINVAL;
Signature · 1 line
1.7.4.1
#14 lore raw

PATCH 13/83 staging: brcm80211: remove iovars IOV_DMA

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_DMA for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   12 ------------
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h |    1 -
 2 files changed, 0 insertions(+), 13 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -12
index 4b13f42..a0f2463 100644
@@ -54,7 +54,6 @@ uint sd_power = 1;		/* Default to SD Slot powered ON */
 uint sd_clock = 1;		/* Default to SD Clock turned ON */
 uint sd_hiok = false;		/* Don't use hi-speed mode by default */
 uint sd_msglevel = 0x01;
-uint sd_use_dma = true;
 DHD_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
 DHD_PM_RESUME_WAIT_INIT(sdioh_request_word_wait);
 DHD_PM_RESUME_WAIT_INIT(sdioh_request_packet_wait);
@@ -352,7 +351,6 @@ uint sdioh_query_iofnum(sdioh_info_t *sd)
 enum {
 	IOV_MSGLEVEL = 1,
 	IOV_BLOCKSIZE,
-	IOV_DMA,
 	IOV_USEINTS,
 	IOV_NUMINTS,
 	IOV_NUMLOCALINTS,
@@ -371,7 +369,6 @@ const bcm_iovar_t sdioh_iovars[] = {
 	{"sd_msglevel", IOV_MSGLEVEL, 0, IOVT_UINT32, 0},
 	{"sd_blocksize", IOV_BLOCKSIZE, 0, IOVT_UINT32, 0},/* ((fn << 16) |
 								 size) */
-	{"sd_dma", IOV_DMA, 0, IOVT_BOOL, 0},
 	{"sd_ints", IOV_USEINTS, 0, IOVT_BOOL, 0},
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
 	{"sd_numlocalints", IOV_NUMLOCALINTS, 0, IOVT_UINT32, 0},
@@ -505,15 +502,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 		memcpy(arg, &int_val, val_size);
 		break;
 
-	case IOV_GVAL(IOV_DMA):
-		int_val = (s32) si->sd_use_dma;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_DMA):
-		si->sd_use_dma = (bool) int_val;
-		break;
-
 	case IOV_GVAL(IOV_USEINTS):
 		int_val = (s32) si->use_client_ints;
 		memcpy(arg, &int_val, val_size);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +0 -1
index 3ef42b3..86f88bf 100644
@@ -85,7 +85,6 @@ struct sdioh_info {
 
 	uint irq;		/* Client irq */
 	int intrcount;		/* Client interrupts */
-	bool sd_use_dma;	/* DMA on CMD53 */
 	bool sd_blockmode;	/* sd_blockmode == false => 64 Byte Cmd 53s. */
 	/*  Must be on for sd_multiblock to be effective */
 	bool use_client_ints;	/* If this is false, make sure to restore */
Signature · 1 line
1.7.4.1
#15 lore raw

PATCH 14/83 staging: brcm80211: remove iovars IOV_NUMLOCALINTS

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_NUMLOCALINTS for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -7
index a0f2463..44b1371 100644
@@ -353,7 +353,6 @@ enum {
 	IOV_BLOCKSIZE,
 	IOV_USEINTS,
 	IOV_NUMINTS,
-	IOV_NUMLOCALINTS,
 	IOV_HOSTREG,
 	IOV_DEVREG,
 	IOV_DIVISOR,
@@ -371,7 +370,6 @@ const bcm_iovar_t sdioh_iovars[] = {
 								 size) */
 	{"sd_ints", IOV_USEINTS, 0, IOVT_BOOL, 0},
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
-	{"sd_numlocalints", IOV_NUMLOCALINTS, 0, IOVT_UINT32, 0},
 	{"sd_hostreg", IOV_HOSTREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
 	,
 	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
@@ -566,11 +564,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 		memcpy(arg, &int_val, val_size);
 		break;
 
-	case IOV_GVAL(IOV_NUMLOCALINTS):
-		int_val = (s32) 0;
-		memcpy(arg, &int_val, val_size);
-		break;
-
 	case IOV_GVAL(IOV_HOSTREG):
 		{
 			sdreg_t *sd_ptr = (sdreg_t *) params;
Signature · 1 line
1.7.4.1
#16 lore raw

PATCH 15/83 staging: brcm80211: remove iovars IOV_HOSTREG

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_HOSTREG for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   53 ---------------------
 1 files changed, 0 insertions(+), 53 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -53
index 44b1371..f24de82 100644
@@ -353,7 +353,6 @@ enum {
 	IOV_BLOCKSIZE,
 	IOV_USEINTS,
 	IOV_NUMINTS,
-	IOV_HOSTREG,
 	IOV_DEVREG,
 	IOV_DIVISOR,
 	IOV_SDMODE,
@@ -370,8 +369,6 @@ const bcm_iovar_t sdioh_iovars[] = {
 								 size) */
 	{"sd_ints", IOV_USEINTS, 0, IOVT_BOOL, 0},
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
-	{"sd_hostreg", IOV_HOSTREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
-	,
 	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
 	,
 	{"sd_divisor", IOV_DIVISOR, 0, IOVT_UINT32, 0}
@@ -564,56 +561,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 		memcpy(arg, &int_val, val_size);
 		break;
 
-	case IOV_GVAL(IOV_HOSTREG):
-		{
-			sdreg_t *sd_ptr = (sdreg_t *) params;
-
-			if (sd_ptr->offset < SD_SysAddr
-			    || sd_ptr->offset > SD_MaxCurCap) {
-				sd_err(("%s: bad offset 0x%x\n", __func__,
-					sd_ptr->offset));
-				bcmerror = -EINVAL;
-				break;
-			}
-
-			sd_trace(("%s: rreg%d at offset %d\n", __func__,
-				  (sd_ptr->offset & 1) ? 8
-				  : ((sd_ptr->offset & 2) ? 16 : 32),
-				  sd_ptr->offset));
-			if (sd_ptr->offset & 1)
-				int_val = 8;	/* sdioh_sdmmc_rreg8(si,
-						 sd_ptr->offset); */
-			else if (sd_ptr->offset & 2)
-				int_val = 16;	/* sdioh_sdmmc_rreg16(si,
-						 sd_ptr->offset); */
-			else
-				int_val = 32;	/* sdioh_sdmmc_rreg(si,
-						 sd_ptr->offset); */
-
-			memcpy(arg, &int_val, sizeof(int_val));
-			break;
-		}
-
-	case IOV_SVAL(IOV_HOSTREG):
-		{
-			sdreg_t *sd_ptr = (sdreg_t *) params;
-
-			if (sd_ptr->offset < SD_SysAddr
-			    || sd_ptr->offset > SD_MaxCurCap) {
-				sd_err(("%s: bad offset 0x%x\n", __func__,
-					sd_ptr->offset));
-				bcmerror = -EINVAL;
-				break;
-			}
-
-			sd_trace(("%s: wreg%d value 0x%08x at offset %d\n",
-				  __func__, sd_ptr->value,
-				  (sd_ptr->offset & 1) ? 8
-				  : ((sd_ptr->offset & 2) ? 16 : 32),
-				  sd_ptr->offset));
-			break;
-		}
-
 	case IOV_GVAL(IOV_DEVREG):
 		{
 			sdreg_t *sd_ptr = (sdreg_t *) params;
Signature · 1 line
1.7.4.1
#17 lore raw

PATCH 16/83 staging: brcm80211: remove iovars IOV_DIVISOR

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_DIVISOR for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    3 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   14 ------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   51 +-------------------
 3 files changed, 3 insertions(+), 65 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -3
index 465f623..ab4d0cc 100644
@@ -373,9 +373,6 @@ extern uint sd_clock;		/* SD Clock Control, 0 = SD Clock OFF,
 				 1 = SD Clock ON */
 module_param(sd_clock, uint, 0);
 
-extern uint sd_divisor;		/* Divisor (-1 means external clock) */
-module_param(sd_divisor, uint, 0);
-
 extern uint sd_sdmode;		/* Default is SD4, 0=SPI, 1=SD1, 2=SD4 */
 module_param(sd_sdmode, uint, 0);
 
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -14
index f24de82..02fa5b4 100644
@@ -48,8 +48,6 @@ extern PBCMSDH_SDMMC_INSTANCE gInstance;
 uint sd_sdmode = SDIOH_MODE_SD4;	/* Use SD4 mode by default */
 uint sd_f2_blocksize = 512;	/* Default blocksize */
 
-uint sd_divisor = 2;		/* Default 48MHz/2 = 24MHz */
-
 uint sd_power = 1;		/* Default to SD Slot powered ON */
 uint sd_clock = 1;		/* Default to SD Clock turned ON */
 uint sd_hiok = false;		/* Don't use hi-speed mode by default */
@@ -354,7 +352,6 @@ enum {
 	IOV_USEINTS,
 	IOV_NUMINTS,
 	IOV_DEVREG,
-	IOV_DIVISOR,
 	IOV_SDMODE,
 	IOV_HISPEED,
 	IOV_HCIREGS,
@@ -371,8 +368,6 @@ const bcm_iovar_t sdioh_iovars[] = {
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
 	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
 	,
-	{"sd_divisor", IOV_DIVISOR, 0, IOVT_UINT32, 0}
-	,
 	{"sd_power", IOV_POWER, 0, IOVT_UINT32, 0}
 	,
 	{"sd_clock", IOV_CLOCK, 0, IOVT_UINT32, 0}
@@ -511,15 +506,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 
 		break;
 
-	case IOV_GVAL(IOV_DIVISOR):
-		int_val = (u32) sd_divisor;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_DIVISOR):
-		sd_divisor = int_val;
-		break;
-
 	case IOV_GVAL(IOV_POWER):
 		int_val = (u32) sd_power;
 		memcpy(arg, &int_val, val_size);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +3 -48

85 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#18 lore raw

PATCH 17/83 staging: brcm80211: remove iovars IOV_POWER

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_POWER for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    4 ----
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   13 -------------
 2 files changed, 0 insertions(+), 17 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -4
index ab4d0cc..5b8529c 100644
@@ -365,10 +365,6 @@ void bcmsdh_unregister_oob_intr(void)
 extern uint sd_msglevel;	/* Debug message level */
 module_param(sd_msglevel, uint, 0);
 
-extern uint sd_power;		/* 0 = SD Power OFF,
-					 1 = SD Power ON. */
-module_param(sd_power, uint, 0);
-
 extern uint sd_clock;		/* SD Clock Control, 0 = SD Clock OFF,
 				 1 = SD Clock ON */
 module_param(sd_clock, uint, 0);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -13
index 02fa5b4..a2d0ad8 100644
@@ -48,7 +48,6 @@ extern PBCMSDH_SDMMC_INSTANCE gInstance;
 uint sd_sdmode = SDIOH_MODE_SD4;	/* Use SD4 mode by default */
 uint sd_f2_blocksize = 512;	/* Default blocksize */
 
-uint sd_power = 1;		/* Default to SD Slot powered ON */
 uint sd_clock = 1;		/* Default to SD Clock turned ON */
 uint sd_hiok = false;		/* Don't use hi-speed mode by default */
 uint sd_msglevel = 0x01;
@@ -355,7 +354,6 @@ enum {
 	IOV_SDMODE,
 	IOV_HISPEED,
 	IOV_HCIREGS,
-	IOV_POWER,
 	IOV_CLOCK,
 	IOV_RXCHAIN
 };
@@ -368,8 +366,6 @@ const bcm_iovar_t sdioh_iovars[] = {
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
 	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
 	,
-	{"sd_power", IOV_POWER, 0, IOVT_UINT32, 0}
-	,
 	{"sd_clock", IOV_CLOCK, 0, IOVT_UINT32, 0}
 	,
 	{"sd_mode", IOV_SDMODE, 0, IOVT_UINT32, 100}
@@ -506,15 +502,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 
 		break;
 
-	case IOV_GVAL(IOV_POWER):
-		int_val = (u32) sd_power;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_POWER):
-		sd_power = int_val;
-		break;
-
 	case IOV_GVAL(IOV_CLOCK):
 		int_val = (u32) sd_clock;
 		memcpy(arg, &int_val, val_size);
Signature · 1 line
1.7.4.1
#19 lore raw

PATCH 18/83 staging: brcm80211: remove iovars IOV_CLOCK

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_CLOCK for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    4 ----
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   13 -------------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   19 -------------------
 3 files changed, 0 insertions(+), 36 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -4
index 5b8529c..3755774 100644
@@ -365,10 +365,6 @@ void bcmsdh_unregister_oob_intr(void)
 extern uint sd_msglevel;	/* Debug message level */
 module_param(sd_msglevel, uint, 0);
 
-extern uint sd_clock;		/* SD Clock Control, 0 = SD Clock OFF,
-				 1 = SD Clock ON */
-module_param(sd_clock, uint, 0);
-
 extern uint sd_sdmode;		/* Default is SD4, 0=SPI, 1=SD1, 2=SD4 */
 module_param(sd_sdmode, uint, 0);
 
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -13
index a2d0ad8..c817e5e 100644
@@ -48,7 +48,6 @@ extern PBCMSDH_SDMMC_INSTANCE gInstance;
 uint sd_sdmode = SDIOH_MODE_SD4;	/* Use SD4 mode by default */
 uint sd_f2_blocksize = 512;	/* Default blocksize */
 
-uint sd_clock = 1;		/* Default to SD Clock turned ON */
 uint sd_hiok = false;		/* Don't use hi-speed mode by default */
 uint sd_msglevel = 0x01;
 DHD_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
@@ -354,7 +353,6 @@ enum {
 	IOV_SDMODE,
 	IOV_HISPEED,
 	IOV_HCIREGS,
-	IOV_CLOCK,
 	IOV_RXCHAIN
 };
 
@@ -366,8 +364,6 @@ const bcm_iovar_t sdioh_iovars[] = {
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
 	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
 	,
-	{"sd_clock", IOV_CLOCK, 0, IOVT_UINT32, 0}
-	,
 	{"sd_mode", IOV_SDMODE, 0, IOVT_UINT32, 100}
 	,
 	{"sd_highspeed", IOV_HISPEED, 0, IOVT_UINT32, 0}
@@ -502,15 +498,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 
 		break;
 
-	case IOV_GVAL(IOV_CLOCK):
-		int_val = (u32) sd_clock;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_CLOCK):
-		sd_clock = int_val;
-		break;
-
 	case IOV_GVAL(IOV_SDMODE):
 		int_val = (u32) sd_sdmode;
 		memcpy(arg, &int_val, val_size);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -19
index ff3e88c..d2c4301 100644
@@ -665,16 +665,6 @@ static int dhdsdio_sdclk(dhd_bus_t *bus, bool on)
 
 	if (on) {
 		if (bus->idleclock == DHD_IDLE_STOP) {
-			/* Turn on clock and restore mode */
-			iovalue = 1;
-			err = bcmsdh_iovar_op(bus->sdh, "sd_clock", NULL, 0,
-					      &iovalue, sizeof(iovalue), true);
-			if (err) {
-				DHD_ERROR(("%s: error enabling sd_clock: %d\n",
-					   __func__, err));
-				return -EBADE;
-			}
-
 			iovalue = bus->sd_mode;
 			err = bcmsdh_iovar_op(bus->sdh, "sd_mode", NULL, 0,
 					      &iovalue, sizeof(iovalue), true);
@@ -706,15 +696,6 @@ static int dhdsdio_sdclk(dhd_bus_t *bus, bool on)
 					return -EBADE;
 				}
 			}
-
-			iovalue = 0;
-			err = bcmsdh_iovar_op(bus->sdh, "sd_clock", NULL, 0,
-					      &iovalue, sizeof(iovalue), true);
-			if (err) {
-				DHD_ERROR(("%s: error disabling sd_clock: %d\n",
-					   __func__, err));
-				return -EBADE;
-			}
 		}
 		bus->clkstate = CLK_NONE;
 	}
Signature · 1 line
1.7.4.1
#20 lore raw

PATCH 19/83 staging: brcm80211: remove iovars IOV_SDMODE

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_SDMODE for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    3 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   13 ----
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   65 +--------------------
 4 files changed, 2 insertions(+), 80 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -3
index 3755774..789922b 100644
@@ -365,9 +365,6 @@ void bcmsdh_unregister_oob_intr(void)
 extern uint sd_msglevel;	/* Debug message level */
 module_param(sd_msglevel, uint, 0);
 
-extern uint sd_sdmode;		/* Default is SD4, 0=SPI, 1=SD1, 2=SD4 */
-module_param(sd_sdmode, uint, 0);
-
 extern uint sd_hiok;		/* Ok to use hi-speed mode */
 module_param(sd_hiok, uint, 0);
 
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -13
index c817e5e..2422890 100644
@@ -45,7 +45,6 @@ extern int sdio_reset_comm(struct mmc_card *card);
 
 extern PBCMSDH_SDMMC_INSTANCE gInstance;
 
-uint sd_sdmode = SDIOH_MODE_SD4;	/* Use SD4 mode by default */
 uint sd_f2_blocksize = 512;	/* Default blocksize */
 
 uint sd_hiok = false;		/* Don't use hi-speed mode by default */
@@ -350,7 +349,6 @@ enum {
 	IOV_USEINTS,
 	IOV_NUMINTS,
 	IOV_DEVREG,
-	IOV_SDMODE,
 	IOV_HISPEED,
 	IOV_HCIREGS,
 	IOV_RXCHAIN
@@ -364,8 +362,6 @@ const bcm_iovar_t sdioh_iovars[] = {
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
 	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
 	,
-	{"sd_mode", IOV_SDMODE, 0, IOVT_UINT32, 100}
-	,
 	{"sd_highspeed", IOV_HISPEED, 0, IOVT_UINT32, 0}
 	,
 	{"sd_rxchain", IOV_RXCHAIN, 0, IOVT_BOOL, 0}
@@ -498,15 +494,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 
 		break;
 
-	case IOV_GVAL(IOV_SDMODE):
-		int_val = (u32) sd_sdmode;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_SDMODE):
-		sd_sdmode = int_val;
-		break;
-
 	case IOV_GVAL(IOV_HISPEED):
 		int_val = (u32) sd_hiok;
 		memcpy(arg, &int_val, val_size);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +0 -1
index 86f88bf..42c71a8 100644
@@ -88,7 +88,6 @@ struct sdioh_info {
 	bool sd_blockmode;	/* sd_blockmode == false => 64 Byte Cmd 53s. */
 	/*  Must be on for sd_multiblock to be effective */
 	bool use_client_ints;	/* If this is false, make sure to restore */
-	int sd_mode;		/* SD1/SD4/SPI */
 	int client_block_size[SDIOD_MAX_IOFUNCS];	/* Blocksize */
 	u8 num_funcs;	/* Supported funcs on client */
 	u32 com_cis_ptr;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +2 -63

93 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#21 lore raw

PATCH 20/83 staging: brcm80211: remove iovars IOV_HISPEED

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused sdio related iovars IOV_HISPEED for fullmac driver

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c |    3 ---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   13 -------------
 2 files changed, 0 insertions(+), 16 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -3
index 789922b..e57dd00 100644
@@ -365,8 +365,5 @@ void bcmsdh_unregister_oob_intr(void)
 extern uint sd_msglevel;	/* Debug message level */
 module_param(sd_msglevel, uint, 0);
 
-extern uint sd_hiok;		/* Ok to use hi-speed mode */
-module_param(sd_hiok, uint, 0);
-
 extern uint sd_f2_blocksize;
 module_param(sd_f2_blocksize, int, 0);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -13
index 2422890..cc4738a 100644
@@ -47,7 +47,6 @@ extern PBCMSDH_SDMMC_INSTANCE gInstance;
 
 uint sd_f2_blocksize = 512;	/* Default blocksize */
 
-uint sd_hiok = false;		/* Don't use hi-speed mode by default */
 uint sd_msglevel = 0x01;
 DHD_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
 DHD_PM_RESUME_WAIT_INIT(sdioh_request_word_wait);
@@ -349,7 +348,6 @@ enum {
 	IOV_USEINTS,
 	IOV_NUMINTS,
 	IOV_DEVREG,
-	IOV_HISPEED,
 	IOV_HCIREGS,
 	IOV_RXCHAIN
 };
@@ -362,8 +360,6 @@ const bcm_iovar_t sdioh_iovars[] = {
 	{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
 	{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
 	,
-	{"sd_highspeed", IOV_HISPEED, 0, IOVT_UINT32, 0}
-	,
 	{"sd_rxchain", IOV_RXCHAIN, 0, IOVT_BOOL, 0}
 	,
 	{NULL, 0, 0, 0, 0}
@@ -494,15 +490,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
 
 		break;
 
-	case IOV_GVAL(IOV_HISPEED):
-		int_val = (u32) sd_hiok;
-		memcpy(arg, &int_val, val_size);
-		break;
-
-	case IOV_SVAL(IOV_HISPEED):
-		sd_hiok = int_val;
-		break;
-
 	case IOV_GVAL(IOV_NUMINTS):
 		int_val = (s32) si->intrcount;
 		memcpy(arg, &int_val, val_size);
Signature · 1 line
1.7.4.1
#22 lore raw

PATCH 21/83 staging: brcm80211: added support for more bcm43224 based boards

In reply to Roland Vossen

Patch created by Gottfried Haider. Add support for BCM943224HMB devices as found in recent Lenovo ThinkPads.

---
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c |    5 ++++-
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c    |    3 ++-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c    |    3 ++-
 drivers/staging/brcm80211/include/bcmdevs.h      |    1 +
 4 files changed, 9 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +4 -1
index 105f426..590d65b 100644
@@ -95,6 +95,8 @@ static struct pci_device_id wl_id_table[] = {
 	{PCI_VENDOR_ID_BROADCOM, 0x4357, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},	/* 43225 2G */
 	{PCI_VENDOR_ID_BROADCOM, 0x4353, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},	/* 43224 DUAL */
 	{PCI_VENDOR_ID_BROADCOM, 0x4727, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},	/* 4313 DUAL */
+	/* 43224 Ven */
+	{PCI_VENDOR_ID_BROADCOM, 0x0576, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
 	{0}
 };
 
@@ -1112,7 +1114,8 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	       PCI_FUNC(pdev->devfn), pdev->irq);
 
 	if ((pdev->vendor != PCI_VENDOR_ID_BROADCOM) ||
-	    (((pdev->device & 0xff00) != 0x4300) &&
+	    ((pdev->device != 0x0576) &&
+	     ((pdev->device & 0xff00) != 0x4300) &&
 	     ((pdev->device & 0xff00) != 0x4700) &&
 	     ((pdev->device < 43000) || (pdev->device > 43999))))
 		return -ENODEV;
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +2 -1
index adc06fc..f98f0fd 100644
@@ -741,7 +741,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
 		wlc->war16165 = true;
 
 	/* check device id(srom, nvram etc.) to set bands */
-	if (wlc_hw->deviceid == BCM43224_D11N_ID) {
+	if (wlc_hw->deviceid == BCM43224_D11N_ID ||
+	    wlc_hw->deviceid == BCM43224_D11N_ID_VEN1) {
 		/* Dualband boards */
 		wlc_hw->_nbands = 2;
 	} else
drivers/staging/brcm80211/brcmsmac/wlc_main.c +2 -1
index 0837e8d..54b5b79 100644
@@ -2857,9 +2857,10 @@ bool wlc_chipmatch(u16 vendor, u16 device)
 		return false;
 	}
 
+	if (device == BCM43224_D11N_ID_VEN1)
+		return true;
 	if ((device == BCM43224_D11N_ID) || (device == BCM43225_D11N2G_ID))
 		return true;
-
 	if (device == BCM4313_D11N2G_ID)
 		return true;
 	if ((device == BCM43236_D11N_ID) || (device == BCM43236_D11N2G_ID))
drivers/staging/brcm80211/include/bcmdevs.h +1 -0
index 26947ef..eba10b6 100644
@@ -30,6 +30,7 @@
 #define BCM4319_D11N5G_ID	0x4339	/* 4319 802.11n 5G device */
 
 #define BCM43224_D11N_ID	0x4353	/* 43224 802.11n dualband device */
+#define BCM43224_D11N_ID_VEN1	0x0576	/* Vendor specific 43224 802.11n db */
 
 #define BCM43225_D11N2G_ID	0x4357	/* 43225 802.11n 2.4GHz device */
 
Signature · 1 line
1.7.4.1
#23 lore raw

PATCH 22/83 staging: brcm80211: removed 'hnd' from filenames

In reply to Roland Vossen

Cleanup. 'hnd' is a company specific acronym.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    8 ++++----
 .../brcmfmac/{hndrte_armtrap.h => rte_armtrap.h}   |    0
 .../brcmfmac/{hndrte_cons.h => rte_cons.h}         |    0
 drivers/staging/brcm80211/brcmsmac/Makefile        |    2 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.c       |    2 +-
 .../{include/hnddma.h => brcmsmac/bcmdma.h}        |    0
 drivers/staging/brcm80211/brcmsmac/bcmotp.c        |    2 +-
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c       |    2 +-
 .../staging/brcm80211/brcmsmac/{hnddma.c => dma.c} |    6 +++---
 drivers/staging/brcm80211/brcmsmac/nicpci.c        |    2 +-
 drivers/staging/brcm80211/brcmsmac/nvram.c         |    2 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c   |    2 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c   |    2 +-
 drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c |    2 +-
 .../brcm80211/brcmsmac/phy/wlc_phytbl_lcn.c        |    2 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phytbl_n.c  |    2 +-
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c   |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_alloc.c     |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c     |    4 ++--
 drivers/staging/brcm80211/brcmsmac/wlc_antsel.c    |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |    4 ++--
 drivers/staging/brcm80211/brcmsmac/wlc_channel.c   |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c      |    4 ++--
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c  |    4 ++--
 drivers/staging/brcm80211/brcmsmac/wlc_rate.c      |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_stf.c       |    2 +-
 .../brcm80211/include/{hndsoc.h => bcmsoc.h}       |    0
 .../brcm80211/include/{sbhnddma.h => sbdma.h}      |    0
 29 files changed, 33 insertions(+), 33 deletions(-)
 rename drivers/staging/brcm80211/brcmfmac/{hndrte_armtrap.h => rte_armtrap.h} (100%)
 rename drivers/staging/brcm80211/brcmfmac/{hndrte_cons.h => rte_cons.h} (100%)
 rename drivers/staging/brcm80211/{include/hnddma.h => brcmsmac/bcmdma.h} (100%)
 rename drivers/staging/brcm80211/brcmsmac/{hnddma.c => dma.c} (99%)
 rename drivers/staging/brcm80211/include/{hndsoc.h => bcmsoc.h} (100%)
 rename drivers/staging/brcm80211/include/{sbhnddma.h => sbdma.h} (100%)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +1 -1
index 3750fcf..e11c615 100644
@@ -21,7 +21,7 @@
 #include <bcmdefs.h>
 #include <bcmdevs.h>
 #include <bcmutils.h>
-#include <hndsoc.h>
+#include <bcmsoc.h>
 
 #include <bcmsdh.h>		/* BRCM API for SDIO
 			 clients (such as wl, dhd) */
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +4 -4
index 7b94613..9593cff 100644
@@ -29,13 +29,13 @@
 #include <bcmutils.h>
 #include <bcmdevs.h>
 
-#include <hndsoc.h>
+#include <bcmsoc.h>
 #ifdef DHD_DEBUG
-#include <hndrte_armtrap.h>
-#include <hndrte_cons.h>
+#include <rte_armtrap.h>
+#include <rte_cons.h>
 #endif				/* DHD_DEBUG */
 #include <sbchipc.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include <sdio.h>
 #include <sbsdio.h>
drivers/staging/brcm80211/brcmfmac/rte_armtrap.h renamed from drivers/staging/brcm80211/brcmfmac/hndrte_armtrap.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/brcmfmac/hndrte_armtrap.h
rename to drivers/staging/brcm80211/brcmfmac/rte_armtrap.h
drivers/staging/brcm80211/brcmfmac/rte_cons.h renamed from drivers/staging/brcm80211/brcmfmac/hndrte_cons.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/brcmfmac/hndrte_cons.h
rename to drivers/staging/brcm80211/brcmfmac/rte_cons.h
drivers/staging/brcm80211/brcmsmac/Makefile +1 -1
index 8d75fe1..4356a29 100644
@@ -49,7 +49,7 @@ BRCMSMAC_OFILES := \
 	phy/wlc_phy_qmath.o \
 	bcmotp.o \
 	bcmsrom.o \
-	hnddma.o \
+	dma.o \
 	nicpci.o \
 	nvram.o
 
drivers/staging/brcm80211/brcmsmac/aiutils.c +1 -1
index a61185f..73587b3 100644
@@ -22,7 +22,7 @@
 #include <linux/pci.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <hndsoc.h>
+#include <bcmsoc.h>
 #include <sbchipc.h>
 #include <pcicfg.h>
 #include <bcmdevs.h>
drivers/staging/brcm80211/brcmsmac/bcmdma.h renamed from drivers/staging/brcm80211/include/hnddma.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/hnddma.h
rename to drivers/staging/brcm80211/brcmsmac/bcmdma.h
drivers/staging/brcm80211/brcmsmac/bcmotp.c +1 -1
index d09628b..f025641 100644
@@ -25,7 +25,7 @@
 #include <bcmdevs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <hndsoc.h>
+#include <bcmsoc.h>
 #include <sbchipc.h>
 #include <bcmotp.h>
 
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +1 -1
index bbfc642..9de10fe 100644
@@ -21,7 +21,7 @@
 #include <linux/pci.h>
 #include <stdarg.h>
 #include <bcmutils.h>
-#include <hndsoc.h>
+#include <bcmsoc.h>
 #include <sbchipc.h>
 #include <bcmdevs.h>
 #include <pcicfg.h>
drivers/staging/brcm80211/brcmsmac/dma.c renamed from drivers/staging/brcm80211/brcmsmac/hnddma.c +3 -3
similarity index 99%
rename from drivers/staging/brcm80211/brcmsmac/hnddma.c
rename to drivers/staging/brcm80211/brcmsmac/dma.c
index f607315..6fde51f 100644
@@ -20,12 +20,12 @@
 #include <linux/pci.h>
 #include <bcmdefs.h>
 #include <bcmdevs.h>
-#include <hndsoc.h>
+#include <bcmsoc.h>
 #include <bcmutils.h>
 #include <aiutils.h>
 
-#include <sbhnddma.h>
-#include <hnddma.h>
+#include <sbdma.h>
+#include <bcmdma.h>
 
 #if defined(__mips__)
 #include <asm/addrspace.h>
drivers/staging/brcm80211/brcmsmac/nicpci.c +1 -1
index 18b844a..51d56b6 100644
@@ -21,7 +21,7 @@
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include <aiutils.h>
-#include <hndsoc.h>
+#include <bcmsoc.h>
 #include <bcmdevs.h>
 #include <sbchipc.h>
 #include <pci_core.h>
drivers/staging/brcm80211/brcmsmac/nvram.c +1 -1
index 085ec0b..65fee2f 100644
@@ -21,7 +21,7 @@
 #include <bcmnvram.h>
 #include <sbchipc.h>
 #include <bcmdevs.h>
-#include <hndsoc.h>
+#include <bcmsoc.h>
 
 #define NVR_MSG(x)
 
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c +1 -1
index 07a5bcb..22ba415 100644
@@ -27,7 +27,7 @@
 #include <bcmnvram.h>
 #include <sbchipc.h>
 #include <bcmdevs.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include <wlc_phy_int.h>
 #include <wlc_phyreg_n.h>
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c +1 -1
index b8864c5..b5ec9ae 100644
@@ -25,7 +25,7 @@
 #include <bcmnvram.h>
 
 #include <bcmdevs.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include "wlc_phy_radio.h"
 #include "wlc_phy_int.h"
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c +1 -1
index 7127509..123bd6a 100644
@@ -25,7 +25,7 @@
 #include <wlc_pmu.h>
 
 #include <bcmdevs.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include <wlc_phy_radio.h>
 #include <wlc_phy_int.h>
drivers/staging/brcm80211/brcmsmac/phy/wlc_phytbl_lcn.c +1 -1
index 81c59b0..e9d8661 100644
@@ -15,7 +15,7 @@
  */
 
 #include <linux/types.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 #include <wlc_phy_int.h>
 #include <wlc_phytbl_lcn.h>
 
drivers/staging/brcm80211/brcmsmac/phy/wlc_phytbl_n.c +1 -1
index 742df99..e4a15c4 100644
@@ -16,7 +16,7 @@
 
 #include <linux/kernel.h>
 
-#include <sbhnddma.h>
+#include <sbdma.h>
 #include <wlc_phy_int.h>
 #include <wlc_phytbl_n.h>
 
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +1 -1
index 590d65b..f58272a 100644
@@ -32,7 +32,7 @@
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include <pcicfg.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include "phy/wlc_phy_int.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_alloc.c +1 -1
index 3b04e02..8a4875d 100644
@@ -19,7 +19,7 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include "d11.h"
 #include "wlc_types.h"
drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c +2 -2
index c83896b..53ca0ff 100644
@@ -19,8 +19,8 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <sbhnddma.h>
-#include <hnddma.h>
+#include <sbdma.h>
+#include <bcmdma.h>
 #include <d11.h>
 
 #include "wlc_types.h"
drivers/staging/brcm80211/brcmsmac/wlc_antsel.c +1 -1
index efdc62a..d26a520 100644
@@ -25,7 +25,7 @@
 #include <bcmnvram.h>
 #include <aiutils.h>
 #include <bcmdevs.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include "d11.h"
 #include "wlc_rate.h"
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +2 -2
index f98f0fd..492fb3e 100644
@@ -33,8 +33,8 @@
 #include <sbconfig.h>
 #include <sbchipc.h>
 #include <pcicfg.h>
-#include <sbhnddma.h>
-#include <hnddma.h>
+#include <sbdma.h>
+#include <bcmdma.h>
 
 #include "wlc_types.h"
 #include "wlc_pmu.h"
drivers/staging/brcm80211/brcmsmac/wlc_channel.c +1 -1
index 9e29339..0b980ac 100644
@@ -23,7 +23,7 @@
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include <aiutils.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include "wlc_types.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_main.c +2 -2
index 54b5b79..c63920c 100644
@@ -27,8 +27,8 @@
 #include <aiutils.h>
 #include <pcicfg.h>
 #include <bcmsrom.h>
-#include <sbhnddma.h>
-#include <hnddma.h>
+#include <sbdma.h>
+#include <bcmdma.h>
 
 #include "wlc_pmu.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +2 -2
index c33b61b..3a80706 100644
@@ -33,8 +33,8 @@
 #include <sbconfig.h>
 #include <sbchipc.h>
 #include <pcicfg.h>
-#include <sbhnddma.h>
-#include <hnddma.h>
+#include <sbdma.h>
+#include <bcmdma.h>
 #include <wlc_pmu.h>
 
 #include "wlc_types.h"
drivers/staging/brcm80211/brcmsmac/wlc_rate.c +1 -1
index 6c9574a..4b84cc1 100644
@@ -20,7 +20,7 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include "wlc_types.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_stf.c +1 -1
index ca1b8aa..cd051d9 100644
@@ -24,7 +24,7 @@
 #include <aiutils.h>
 #include <bcmwifi.h>
 #include <bcmnvram.h>
-#include <sbhnddma.h>
+#include <sbdma.h>
 
 #include "wlc_types.h"
 #include "d11.h"
drivers/staging/brcm80211/include/bcmsoc.h renamed from drivers/staging/brcm80211/include/hndsoc.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/hndsoc.h
rename to drivers/staging/brcm80211/include/bcmsoc.h
drivers/staging/brcm80211/include/sbdma.h renamed from drivers/staging/brcm80211/include/sbhnddma.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/sbhnddma.h
rename to drivers/staging/brcm80211/include/sbdma.h
Signature · 1 line
1.7.4.1
#24 lore raw

PATCH 23/83 staging: brcm80211: removed 'hnd' from everything but function names

In reply to Roland Vossen

Code cleanup. 'hnd' is a company specific acronym.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c    |   12 ++--
 drivers/staging/brcm80211/brcmfmac/rte_armtrap.h |    6 +-
 drivers/staging/brcm80211/brcmfmac/rte_cons.h    |   13 ++--
 drivers/staging/brcm80211/brcmsmac/bcmdma.h      |  102 +++++++++++-----------
 drivers/staging/brcm80211/brcmsmac/bcmotp.c      |    4 +-
 drivers/staging/brcm80211/brcmsmac/dma.c         |   90 +++++++++----------
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c    |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c    |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.h    |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_types.h   |    8 +--
 drivers/staging/brcm80211/include/bcmdefs.h      |    8 +-
 drivers/staging/brcm80211/include/bcmsdpcm.h     |    2 +-
 drivers/staging/brcm80211/include/sbdma.h        |    6 +-
 13 files changed, 123 insertions(+), 134 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +6 -6
index 9593cff..6882c9f 100644
@@ -151,7 +151,7 @@ extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
 typedef struct dhd_console {
 	uint count;		/* Poll interval msec counter */
 	uint log_addr;		/* Log struct address (fixed) */
-	hndrte_log_t log;	/* Log struct (host copy) */
+	rte_log_t log;	/* Log struct (host copy) */
 	uint bufsize;		/* Size of log buffer */
 	u8 *buf;		/* Log buffer (host copy) */
 	uint last;		/* Last buffer read index */
@@ -1733,7 +1733,7 @@ static int dhdsdio_readshared(dhd_bus_t *bus, sdpcm_shared_t *sh)
 		return -EBADE;
 	}
 
-	/* Read hndrte_shared structure */
+	/* Read rte_shared structure */
 	rv = dhdsdio_membytes(bus, false, addr, (u8 *) sh,
 			      sizeof(sdpcm_shared_t));
 	if (rv < 0)
@@ -1948,7 +1948,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
 		return 0;
 
 	/* Read console log struct */
-	addr = bus->console_addr + offsetof(hndrte_cons_t, log);
+	addr = bus->console_addr + offsetof(rte_cons_t, log);
 	rv = dhdsdio_membytes(bus, false, addr, (u8 *)&c->log,
 				sizeof(c->log));
 	if (rv < 0)
@@ -4825,20 +4825,20 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)
 	dhdsdio_clkctl(bus, CLK_AVAIL, false);
 
 	/* Zero cbuf_index */
-	addr = bus->console_addr + offsetof(hndrte_cons_t, cbuf_idx);
+	addr = bus->console_addr + offsetof(rte_cons_t, cbuf_idx);
 	val = cpu_to_le32(0);
 	rv = dhdsdio_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
 	if (rv < 0)
 		goto done;
 
 	/* Write message into cbuf */
-	addr = bus->console_addr + offsetof(hndrte_cons_t, cbuf);
+	addr = bus->console_addr + offsetof(rte_cons_t, cbuf);
 	rv = dhdsdio_membytes(bus, true, addr, (u8 *)msg, msglen);
 	if (rv < 0)
 		goto done;
 
 	/* Write length into vcons_in */
-	addr = bus->console_addr + offsetof(hndrte_cons_t, vcons_in);
+	addr = bus->console_addr + offsetof(rte_cons_t, vcons_in);
 	val = cpu_to_le32(msglen);
 	rv = dhdsdio_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
 	if (rv < 0)
drivers/staging/brcm80211/brcmfmac/rte_armtrap.h +3 -3
index 28f092c..ebb2237 100644
@@ -14,8 +14,8 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#ifndef	_hndrte_armtrap_h
-#define	_hndrte_armtrap_h
+#ifndef	_rte_armtrap_h
+#define	_rte_armtrap_h
 
 /* ARM trap handling */
 
@@ -72,4 +72,4 @@ typedef struct _trap_struct {
 
 #endif				/* !_LANGUAGE_ASSEMBLY */
 
-#endif				/* _hndrte_armtrap_h */
+#endif				/* _rte_armtrap_h */
drivers/staging/brcm80211/brcmfmac/rte_cons.h +6 -7
index 4df3eec..7977e08 100644
@@ -13,8 +13,8 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
-#ifndef _hndrte_cons_h
-#define _hndrte_cons_h
+#ifndef _rte_cons_h
+#define _rte_cons_h
 
 #define CBUF_LEN	(128)
 
@@ -25,7 +25,7 @@ typedef struct {
 	uint buf_size;
 	uint idx;
 	char *_buf_compat;	/* Redundant pointer for backward compat. */
-} hndrte_log_t;
+} rte_log_t;
 
 typedef struct {
 	/* Virtual UART
@@ -46,7 +46,7 @@ typedef struct {
 	 * Output will be lost if the output wraps around faster than the host
 	 * polls.
 	 */
-	hndrte_log_t log;
+	rte_log_t log;
 
 	/* Console input line buffer
 	 * Characters are read one at a time into cbuf
@@ -56,7 +56,6 @@ typedef struct {
 	 */
 	uint cbuf_idx;
 	char cbuf[CBUF_LEN];
-} hndrte_cons_t;
-
-#endif /* _hndrte_cons_h */
+} rte_cons_t;
 
+#endif /* _rte_cons_h */
drivers/staging/brcm80211/brcmsmac/bcmdma.h +51 -51

143 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/bcmotp.c +2 -2
index f025641..d01f60a 100644
@@ -819,7 +819,7 @@ static int hndotp_nvread(void *oh, char *data, uint *len)
 	return rc;
 }
 
-static otp_fn_t hndotp_fn = {
+static otp_fn_t otp_fn = {
 	(otp_size_t) hndotp_size,
 	(otp_read_bit_t) hndotp_read_bit,
 
@@ -883,7 +883,7 @@ void *otp_init(si_t *sih)
 
 #ifdef BCMHNDOTP
 	if (OTPTYPE_HND(oi->ccrev))
-		oi->fn = &hndotp_fn;
+		oi->fn = &otp_fn;
 #endif
 
 	if (oi->fn == NULL) {
drivers/staging/brcm80211/brcmsmac/dma.c +43 -47

308 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +1 -1
index 492fb3e..e2e5653 100644
@@ -2064,7 +2064,7 @@ void wlc_bmac_hw_up(struct wlc_hw_info *wlc_hw)
 
 static bool wlc_dma_rxreset(struct wlc_hw_info *wlc_hw, uint fifo)
 {
-	struct hnddma_pub *di = wlc_hw->di[fifo];
+	struct dma_pub *di = wlc_hw->di[fifo];
 	return dma_rxreset(di);
 }
 
drivers/staging/brcm80211/brcmsmac/wlc_main.c +1 -1
index c63920c..026d200 100644
@@ -5837,7 +5837,7 @@ void wlc_inval_dma_pkts(struct wlc_hw_info *hw,
 			       struct ieee80211_sta *sta,
 			       void (*dma_callback_fn))
 {
-	struct hnddma_pub *dmah;
+	struct dma_pub *dmah;
 	int i;
 	for (i = 0; i < NFIFO; i++) {
 		dmah = hw->di[i];
drivers/staging/brcm80211/brcmsmac/wlc_main.h +1 -1
index 3bbb774..d4ae29b 100644
@@ -384,7 +384,7 @@ struct wlc_hw_info {
 	struct wlc_info *wlc;
 
 	/* fifo */
-	struct hnddma_pub *di[NFIFO];	/* hnddma handles, per fifo */
+	struct dma_pub *di[NFIFO];	/* dma handles, per fifo */
 
 	uint unit;		/* device instance number */
 
drivers/staging/brcm80211/brcmsmac/wlc_types.h +1 -7
index df6e04c..b8cede1 100644
@@ -18,7 +18,6 @@
 #define _wlc_types_h_
 
 /* forward declarations */
-
 struct wlc_info;
 struct wlc_hw_info;
 struct wlc_if;
@@ -26,12 +25,7 @@ struct wl_if;
 struct ampdu_info;
 struct antsel_info;
 struct bmac_pmq;
-
 struct d11init;
-
-#ifndef _hnddma_pub_
-#define _hnddma_pub_
-struct hnddma_pub;
-#endif				/* _hnddma_pub_ */
+struct dma_pub;
 
 #endif				/* _wlc_types_h_ */
drivers/staging/brcm80211/include/bcmdefs.h +4 -4
index 6500547..7613845 100644
@@ -89,7 +89,7 @@ typedef unsigned long dmaaddr_t;
 typedef struct {
 	dmaaddr_t addr;
 	u32 length;
-} hnddma_seg_t;
+} dma_seg_t;
 
 #define MAX_DMA_SEGS 4
 
@@ -97,13 +97,13 @@ typedef struct {
 	void *oshdmah;		/* Opaque handle for OSL to store its information */
 	uint origsize;		/* Size of the virtual packet */
 	uint nsegs;
-	hnddma_seg_t segs[MAX_DMA_SEGS];
-} hnddma_seg_map_t;
+	dma_seg_t segs[MAX_DMA_SEGS];
+} dma_seg_map_t;
 
 /* packet headroom necessary to accommodate the largest header in the system, (i.e TXOFF).
  * By doing, we avoid the need  to allocate an extra buffer for the header when bridging to WL.
  * There is a compile time check in wlc.c which ensure that this value is at least as big
- * as TXOFF. This value is used in dma_rxfill (hnddma.c).
+ * as TXOFF. This value is used in dma_rxfill (dma.c).
  */
 
 #define BCMEXTRAHDROOM 172
drivers/staging/brcm80211/include/bcmsdpcm.h +1 -1
index 5175e67..21d6a3a 100644
@@ -198,7 +198,7 @@ typedef struct {
 	u32 assert_exp_addr;
 	u32 assert_file_addr;
 	u32 assert_line;
-	u32 console_addr;	/* Address of hndrte_cons_t */
+	u32 console_addr;	/* Address of rte_cons_t */
 	u32 msgtrace_addr;
 	u8 tag[32];
 } sdpcm_shared_t;
drivers/staging/brcm80211/include/sbdma.h +3 -3
index 08cb7f6..1da979a 100644
@@ -14,8 +14,8 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#ifndef	_sbhnddma_h_
-#define	_sbhnddma_h_
+#ifndef	_sbdma_h_
+#define	_sbdma_h_
 
 /* DMA structure:
  *  support two DMA engines: 32 bits address or 64 bit addressing
@@ -312,4 +312,4 @@ typedef volatile struct {
 	u16 flags;
 } dma_rxh_t;
 
-#endif				/* _sbhnddma_h_ */
+#endif				/* _sbdma_h_ */
Signature · 1 line
1.7.4.1
#25 lore raw

PATCH 24/83 staging: brcm80211: merged two header files into dhd_sdio.c

In reply to Roland Vossen

Code cleanup. Decreasing number of header files.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c    |  100 +++++++++++++++++++++-
 drivers/staging/brcm80211/brcmfmac/rte_armtrap.h |   75 ----------------
 drivers/staging/brcm80211/brcmfmac/rte_cons.h    |   61 -------------
 3 files changed, 98 insertions(+), 138 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/rte_armtrap.h
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/rte_cons.h
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +98 -2
index 6882c9f..9c5cfa7 100644
@@ -31,8 +31,104 @@
 
 #include <bcmsoc.h>
 #ifdef DHD_DEBUG
-#include <rte_armtrap.h>
-#include <rte_cons.h>
+
+/* ARM trap handling */
+
+/* Trap types defined by ARM (see arminc.h) */
+
+/* Trap locations in lo memory */
+#define	TRAP_STRIDE	4
+#define FIRST_TRAP	TR_RST
+#define LAST_TRAP	(TR_FIQ * TRAP_STRIDE)
+
+#if defined(__ARM_ARCH_4T__)
+#define	MAX_TRAP_TYPE	(TR_FIQ + 1)
+#elif defined(__ARM_ARCH_7M__)
+#define	MAX_TRAP_TYPE	(TR_ISR + ARMCM3_NUMINTS)
+#endif				/* __ARM_ARCH_7M__ */
+
+/* The trap structure is defined here as offsets for assembly */
+#define	TR_TYPE		0x00
+#define	TR_EPC		0x04
+#define	TR_CPSR		0x08
+#define	TR_SPSR		0x0c
+#define	TR_REGS		0x10
+#define	TR_REG(n)	(TR_REGS + (n) * 4)
+#define	TR_SP		TR_REG(13)
+#define	TR_LR		TR_REG(14)
+#define	TR_PC		TR_REG(15)
+
+#define	TRAP_T_SIZE	80
+
+#ifndef	_LANGUAGE_ASSEMBLY
+
+typedef struct _trap_struct {
+	u32 type;
+	u32 epc;
+	u32 cpsr;
+	u32 spsr;
+	u32 r0;
+	u32 r1;
+	u32 r2;
+	u32 r3;
+	u32 r4;
+	u32 r5;
+	u32 r6;
+	u32 r7;
+	u32 r8;
+	u32 r9;
+	u32 r10;
+	u32 r11;
+	u32 r12;
+	u32 r13;
+	u32 r14;
+	u32 pc;
+} trap_t;
+
+#endif				/* !_LANGUAGE_ASSEMBLY */
+
+#define CBUF_LEN	(128)
+
+#define LOG_BUF_LEN	1024
+
+typedef struct {
+	u32 buf;		/* Can't be pointer on (64-bit) hosts */
+	uint buf_size;
+	uint idx;
+	char *_buf_compat;	/* Redundant pointer for backward compat. */
+} rte_log_t;
+
+typedef struct {
+	/* Virtual UART
+	 * When there is no UART (e.g. Quickturn),
+	 * the host should write a complete
+	 * input line directly into cbuf and then write
+	 * the length into vcons_in.
+	 * This may also be used when there is a real UART
+	 * (at risk of conflicting with
+	 * the real UART).  vcons_out is currently unused.
+	 */
+	volatile uint vcons_in;
+	volatile uint vcons_out;
+
+	/* Output (logging) buffer
+	 * Console output is written to a ring buffer log_buf at index log_idx.
+	 * The host may read the output when it sees log_idx advance.
+	 * Output will be lost if the output wraps around faster than the host
+	 * polls.
+	 */
+	rte_log_t log;
+
+	/* Console input line buffer
+	 * Characters are read one at a time into cbuf
+	 * until <CR> is received, then
+	 * the buffer is processed as a command line.
+	 * Also used for virtual UART.
+	 */
+	uint cbuf_idx;
+	char cbuf[CBUF_LEN];
+} rte_cons_t;
+
 #endif				/* DHD_DEBUG */
 #include <sbchipc.h>
 #include <sbdma.h>
drivers/staging/brcm80211/brcmfmac/rte_armtrap.h deleted +0 -75

75 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/rte_cons.h deleted +0 -61

61 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#26 lore raw

PATCH 25/83 staging: brcm80211: removed unused stuff from proto/802.11.h

In reply to Roland Vossen
---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |    2 -
 drivers/staging/brcm80211/brcmsmac/d11.h          |   17 ++
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c  |    2 -
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c     |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_rate.c     |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_stf.c      |    2 -
 drivers/staging/brcm80211/include/proto/802.11.h  |  200 +++++++-------------
 drivers/staging/brcm80211/util/bcmutils.c         |    1 -
 9 files changed, 87 insertions(+), 140 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -2
index 9c5cfa7..0034dcd 100644
@@ -138,8 +138,6 @@ typedef struct {
 #include <sbsdpcmdev.h>
 #include <bcmsdpcm.h>
 
-#include <proto/802.11.h>
-
 #include <dngl_stats.h>
 #include <dhd.h>
 #include <dhd_bus.h>
drivers/staging/brcm80211/brcmsmac/d11.h +17 -0
index cb434e5..e022224 100644
@@ -1771,4 +1771,21 @@ typedef struct macstat {
 #define SHM_BYT_CNT	0x2	/* IHR location */
 #define MAX_BYT_CNT	0x600	/* Maximum frame len */
 
+typedef struct d11cnt {
+	u32 txfrag;
+	u32 txmulti;
+	u32 txfail;
+	u32 txretry;
+	u32 txretrie;
+	u32 rxdup;
+	u32 txrts;
+	u32 txnocts;
+	u32 txnoack;
+	u32 rxfrag;
+	u32 rxmulti;
+	u32 rxcrc;
+	u32 txfrmsnt;
+	u32 rxundec;
+} d11cnt_t;
+
 #endif				/* _D11_H */
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +0 -2
index f58272a..3d9f791 100644
@@ -25,8 +25,6 @@
 #include <linux/sched.h>
 #include <linux/firmware.h>
 #include <net/mac80211.h>
-
-#include <proto/802.11.h>
 #include <bcmdefs.h>
 #include <bcmwifi.h>
 #include <bcmutils.h>
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +0 -1
index e2e5653..128c27b 100644
@@ -21,7 +21,6 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 
-#include <proto/802.11.h>
 #include <bcmdefs.h>
 #include <bcmdevs.h>
 #include <bcmwifi.h>
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +0 -1
index 3a80706..c6f9694 100644
@@ -25,7 +25,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 
-#include <proto/802.11.h>
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <bcmwifi.h>
drivers/staging/brcm80211/brcmsmac/wlc_rate.c +0 -1
index 4b84cc1..53dcf24 100644
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 
-#include <proto/802.11.h>
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
drivers/staging/brcm80211/brcmsmac/wlc_stf.c +0 -2
index cd051d9..a08db2e 100644
@@ -17,8 +17,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 
-#include <proto/802.11.h>
-
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
drivers/staging/brcm80211/include/proto/802.11.h +70 -130

243 lines not on this page · raw message

drivers/staging/brcm80211/util/bcmutils.c +0 -1
index 1c8b6c6..63843bc 100644
@@ -26,7 +26,6 @@
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include <bcmdevs.h>
-#include <proto/802.11.h>
 
 MODULE_AUTHOR("Broadcom Corporation");
 MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver utilities.");
Signature · 1 line
1.7.4.1
#27 lore raw

PATCH 26/83 staging: brcm80211: emptied include/802.11.h

In reply to Roland Vossen

Code cleanup. Removed unused definitions. Moved other definitions to less generic locations.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |    3 +
 drivers/staging/brcm80211/brcmfmac/dhd_common.c  |    3 +
 drivers/staging/brcm80211/brcmfmac/wl_iw.c       |    4 +
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c    |    3 +
 drivers/staging/brcm80211/brcmsmac/wlc_main.c    |   64 ++++++++++++
 drivers/staging/brcm80211/brcmsmac/wlc_main.h    |   30 ++++++
 drivers/staging/brcm80211/include/bcmwifi.h      |   17 +++
 drivers/staging/brcm80211/include/proto/802.11.h |  120 ----------------------
 8 files changed, 124 insertions(+), 120 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +3 -0
index 6156062..9583f57 100644
@@ -188,6 +188,9 @@ struct dhd_info;
 #define DHD_DEL_IF	-0xe
 #define DHD_BAD_IF	-0xf
 
+#define DOT11_BSSTYPE_ANY			2
+#define DOT11_MAX_DEFAULT_KEYS	4
+
 enum cust_gpio_modes {
 	WLAN_RESET_ON,
 	WLAN_RESET_OFF,
drivers/staging/brcm80211/brcmfmac/dhd_common.c +3 -0
index 5aa5ee4..b7f4e63 100644
@@ -25,6 +25,9 @@
 #include <dhd_dbg.h>
 #include <msgtrace.h>
 
+#define BRCM_OUI		"\x00\x10\x18"
+#define DOT11_OUI_LEN			3
+
 int dhd_msg_level;
 char fw_path[MOD_PARAM_PATHLEN];
 char nv_path[MOD_PARAM_PATHLEN];
drivers/staging/brcm80211/brcmfmac/wl_iw.c +4 -0
index b5cb897..2cc9bc7 100644
@@ -32,6 +32,10 @@ typedef const struct si_pub si_t;
 #include <dngl_stats.h>
 #include <dhd.h>
 
+#define WPA_OUI			"\x00\x50\xF2"
+#define DOT11_MNG_RSN_ID			48
+#define DOT11_MNG_WPA_ID			221
+
 #define WL_ERROR(fmt, args...)	printk(fmt, ##args)
 #define WL_TRACE(fmt, args...)	no_printk(fmt, ##args)
 #define WL_INFORM(fmt, args...)	no_printk(fmt, ##args)
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +3 -0
index 128c27b..ab4ef6c 100644
@@ -75,6 +75,9 @@
 		(void *)&(wlc_hw->regs->fifo64regs[fifonum].dmaxmt) : \
 		(void *)&(wlc_hw->regs->fifo64regs[fifonum].dmarcv))
 
+#define APHY_SLOT_TIME		9
+#define BPHY_SLOT_TIME		20
+
 /*
  * The following table lists the buffer memory allocated to xmt fifos in HW.
  * the size is in units of 256bytes(one block), total size is HW dependent
drivers/staging/brcm80211/brcmsmac/wlc_main.c +64 -0

70 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_main.h +30 -0
index d4ae29b..d066339 100644
@@ -23,6 +23,16 @@
 #define	MAXCOREREV		28	/* max # supported core revisions (0 .. MAXCOREREV - 1) */
 #define WLC_MAXMODULES		22	/* max #  wlc_module_register() calls */
 
+#define SEQNUM_SHIFT		4
+#define AMPDU_DELIMITER_LEN	4
+#define SEQNUM_MAX		0x1000
+
+#define	APHY_CWMIN		15
+#define PHY_CWMAX		1023
+
+#define EDCF_AIFSN_MIN               1
+#define FRAGNUM_MASK		0xF
+
 #define WLC_BITSCNT(x)	bcm_bitcount((u8 *)&(x), sizeof(u8))
 
 /* Maximum wait time for a MAC suspend */
@@ -35,6 +45,8 @@
 /* transmit buffer max headroom for protocol headers */
 #define TXOFF (D11_TXH_LEN + D11_PHY_HDR_LEN)
 
+#define AC_COUNT		4
+
 /* For managing scan result lists */
 struct wlc_bss_list {
 	uint count;
@@ -342,6 +354,24 @@ struct dumpcb_s {
 	struct dumpcb_s *next;
 };
 
+struct edcf_acparam {
+	u8 ACI;
+	u8 ECW;
+	u16 TXOP;
+} __attribute__((packed));
+typedef struct edcf_acparam edcf_acparam_t;
+
+struct wme_param_ie {
+	u8 oui[3];
+	u8 type;
+	u8 subtype;
+	u8 version;
+	u8 qosinfo;
+	u8 rsvd;
+	edcf_acparam_t acparam[AC_COUNT];
+} __attribute__((packed));
+typedef struct wme_param_ie wme_param_ie_t;
+
 /* virtual interface */
 struct wlc_if {
 	struct wlc_if *next;
drivers/staging/brcm80211/include/bcmwifi.h +17 -0
index f0dc6f8..60f404c 100644
@@ -131,6 +131,10 @@ typedef u16 chanspec_t;
 
 #define WLC_2G_25MHZ_OFFSET		5	/* 2.4GHz band channel offset */
 
+#define MCSSET_LEN	16
+
+#define AC_BITMAP_TST(ab, ac)	(((ab) & (1 << (ac))) != 0)
+
 /*
  * Verify the chanspec is using a legal set of parameters, i.e. that the
  * chanspec specified a band, bw, ctl_sb and channel and that the
@@ -202,6 +206,17 @@ extern int bcm_mhz2channel(uint freq, uint start_factor);
 /* pmkid */
 #define	MAXPMKID		16
 
+#define DOT11_DEFAULT_RTS_LEN		2347
+#define DOT11_DEFAULT_FRAG_LEN		2346
+
+#define DOT11_ICV_AES_LEN		8
+#define DOT11_QOS_LEN			2
+#define DOT11_IV_MAX_LEN		8
+#define DOT11_A4_HDR_LEN		30
+
+#define HT_CAP_RX_STBC_NO		0x0
+#define HT_CAP_RX_STBC_ONE_STREAM	0x1
+
 typedef struct _pmkid {
 	u8 BSSID[ETH_ALEN];
 	u8 PMKID[WLAN_PMKID_LEN];
@@ -222,4 +237,6 @@ typedef struct _pmkid_cand_list {
 	pmkid_cand_t pmkid_cand[1];
 } pmkid_cand_list_t;
 
+typedef u8 ac_bitmap_t;
+
 #endif				/* _bcmwifi_h_ */
drivers/staging/brcm80211/include/proto/802.11.h +0 -120

124 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#28 lore raw

PATCH 27/83 staging: brcm80211: removed 802.11.h

In reply to Roland Vossen

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_pub.h     |    1 -
 drivers/staging/brcm80211/include/proto/802.11.h |   20 --------------------
 3 files changed, 0 insertions(+), 22 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/include/proto/802.11.h
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -1
index 9583f57..eca6732 100644
@@ -37,7 +37,6 @@
 #include "bcmdefs.h"
 /* The kernel threading is sdio-specific */
 #include "bcmwifi.h"
-#include "proto/802.11.h"
 #include "proto/bcmeth.h"
 #include "proto/bcmevent.h"
 
drivers/staging/brcm80211/brcmsmac/wlc_pub.h +0 -1
index 2bbf995..bd0885e 100644
@@ -17,7 +17,6 @@
 #ifndef _wlc_pub_h_
 #define _wlc_pub_h_
 
-#include "proto/802.11.h"	/* for MCSSET_LEN */
 #include "bcmwifi.h"		/* for chanspec_t */
 
 #define	WLC_NUMRATES	16	/* max # of rates in a rateset */
drivers/staging/brcm80211/include/proto/802.11.h deleted +0 -20
deleted file mode 100644
index 048dae5..0000000
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _802_11_H_
-#define _802_11_H_
-
-#endif				/* _802_11_H_ */
Signature · 1 line
1.7.4.1
#29 lore raw

PATCH 28/83 staging: brcm80211: cleaned bcmeth.h and bcmevent.h

In reply to Roland Vossen

Code cleanup. Deleted unused definitions and moved others into less generic files.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h           |  195 +++++++++++++++++++-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c    |    1 +
 drivers/staging/brcm80211/include/proto/bcmeth.h   |   24 ---
 drivers/staging/brcm80211/include/proto/bcmevent.h |  185 -------------------
 4 files changed, 194 insertions(+), 211 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +193 -2
index eca6732..081cda0 100644
@@ -37,8 +37,6 @@
 #include "bcmdefs.h"
 /* The kernel threading is sdio-specific */
 #include "bcmwifi.h"
-#include "proto/bcmeth.h"
-#include "proto/bcmevent.h"
 
 /* Forward decls */
 struct dhd_bus;
@@ -190,6 +188,191 @@ 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
+#define WLC_EVENT_MSG_FLUSHTXQ		0x02
+#define WLC_EVENT_MSG_GROUP		0x04
+
+typedef struct {
+	u16 version;
+	u16 flags;
+	u32 event_type;
+	u32 status;
+	u32 reason;
+	u32 auth_type;
+	u32 datalen;
+	u8 addr[ETH_ALEN];
+	char ifname[BCM_MSG_IFNAME_MAX];
+} __attribute__((packed)) wl_event_msg_t;
+
+typedef  struct bcmeth_hdr {
+	u16 subtype;
+	u16 length;
+	u8 version;
+	u8 oui[3];
+	u16 usr_subtype;
+} __attribute__((packed)) bcmeth_hdr_t;
+
+#ifdef BRCM_FULLMAC
+typedef struct bcm_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
+
 enum cust_gpio_modes {
 	WLAN_RESET_ON,
 	WLAN_RESET_OFF,
@@ -600,6 +783,11 @@ typedef struct {
 	u32 tick;		/* O/S tick time (usec) */
 } dhd_timeout_t;
 
+typedef struct {
+	uint event;
+	const char *name;
+} bcmevent_name_t;
+
 #if defined(CONFIG_PM_SLEEP)
 extern atomic_t dhd_mmc_suspend;
 #define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
@@ -708,6 +896,9 @@ extern char fw_path[MOD_PARAM_PATHLEN];
 extern char nv_path[MOD_PARAM_PATHLEN];
 
 extern u32 g_assert_type;
+extern const bcmevent_name_t bcmevent_names[];
+extern const int bcmevent_names_size;
+
 
 static inline void MUTEX_LOCK_INIT(dhd_pub_t *dhdp)
 {
drivers/staging/brcm80211/brcmfmac/dhd_common.c +1 -0
index b7f4e63..85d87db 100644
@@ -27,6 +27,7 @@
 
 #define BRCM_OUI		"\x00\x10\x18"
 #define DOT11_OUI_LEN			3
+#define BCMILCP_BCM_SUBTYPE_EVENT		1
 
 int dhd_msg_level;
 char fw_path[MOD_PARAM_PATHLEN];
drivers/staging/brcm80211/include/proto/bcmeth.h +0 -24
index e98ee65..0053984 100644
@@ -17,28 +17,4 @@
 #ifndef _BCMETH_H_
 #define _BCMETH_H_
 
-#define	BCMILCP_SUBTYPE_RATE		1
-#define	BCMILCP_SUBTYPE_LINK		2
-#define	BCMILCP_SUBTYPE_CSA		3
-#define	BCMILCP_SUBTYPE_LARQ		4
-#define BCMILCP_SUBTYPE_VENDOR		5
-#define	BCMILCP_SUBTYPE_FLH		17
-#define BCMILCP_SUBTYPE_VENDOR_LONG	32769
-#define BCMILCP_SUBTYPE_CERT		32770
-#define BCMILCP_SUBTYPE_SES		32771
-#define BCMILCP_BCM_SUBTYPE_RESERVED		0
-#define BCMILCP_BCM_SUBTYPE_EVENT		1
-#define BCMILCP_BCM_SUBTYPE_SES			2
-#define BCMILCP_BCM_SUBTYPE_DPT			4
-#define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH	8
-#define BCMILCP_BCM_SUBTYPEHDR_VERSION		0
-
-typedef  struct bcmeth_hdr {
-	u16 subtype;
-	u16 length;
-	u8 version;
-	u8 oui[3];
-	u16 usr_subtype;
-} __attribute__((packed)) bcmeth_hdr_t;
-
 #endif				/* _BCMETH_H_ */
drivers/staging/brcm80211/include/proto/bcmevent.h +0 -185

189 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#30 lore raw

PATCH 29/83 staging: brcm80211: removed include/proto dir

In reply to Roland Vossen

Code cleanup.

---
 drivers/staging/brcm80211/include/proto/bcmeth.h   |   20 ------------------
 drivers/staging/brcm80211/include/proto/bcmevent.h |   22 --------------------
 2 files changed, 0 insertions(+), 42 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/include/proto/bcmeth.h
 delete mode 100644 drivers/staging/brcm80211/include/proto/bcmevent.h
drivers/staging/brcm80211/include/proto/bcmeth.h deleted +0 -20
deleted file mode 100644
index 0053984..0000000
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _BCMETH_H_
-#define _BCMETH_H_
-
-#endif				/* _BCMETH_H_ */
drivers/staging/brcm80211/include/proto/bcmevent.h deleted +0 -22
deleted file mode 100644
index 1f4ab64..0000000
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _BCMEVENT_H_
-#define _BCMEVENT_H_
-
-#include <linux/if_ether.h>
-
-#endif				/* _BCMEVENT_H_ */
Signature · 1 line
1.7.4.1
#31 lore raw

PATCH 30/83 staging: brcm80211: remove SDIO related definitions from nicpci.h

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The header file nicpci.h is now only used by brcmsmac driver, which does not support SDIO. The conditional defintions have been removed from the header file.

---
 drivers/staging/brcm80211/include/nicpci.h |   29 +---------------------------
 1 files changed, 1 insertions(+), 28 deletions(-)
drivers/staging/brcm80211/include/nicpci.h +1 -28
index 30321eb..f901c60 100644
@@ -17,32 +17,6 @@
 #ifndef	_NICPCI_H
 #define	_NICPCI_H
 
-#if defined(BCMSDIO) || (defined(BCMBUSTYPE) && (BCMBUSTYPE == SI_BUS))
-#define pcicore_find_pci_capability(a, b, c, d) (0)
-#define pcie_readreg(a, b, c, d) (0)
-#define pcie_writereg(a, b, c, d, e) (0)
-
-#define pcie_clkreq(a, b, c)	(0)
-#define pcie_lcreg(a, b, c)	(0)
-
-#define pcicore_init(a, b, c) (0x0dadbeef)
-#define pcicore_deinit(a)	do { } while (0)
-#define pcicore_attach(a, b, c)	do { } while (0)
-#define pcicore_hwup(a)		do { } while (0)
-#define pcicore_up(a, b)	do { } while (0)
-#define pcicore_sleep(a)	do { } while (0)
-#define pcicore_down(a, b)	do { } while (0)
-
-#define pcie_war_ovr_aspm_update(a, b)	do { } while (0)
-
-#define pcicore_pcieserdesreg(a, b, c, d, e) (0)
-#define pcicore_pciereg(a, b, c, d, e) (0)
-
-#define pcicore_pmecap_fast(a)	(false)
-#define pcicore_pmeen(a)	do { } while (0)
-#define pcicore_pmeclr(a)	do { } while (0)
-#define pcicore_pmestat(a)	(false)
-#else
 struct sbpcieregs;
 
 extern u8 pcicore_find_pci_capability(void *dev, u8 req_cap_id,
@@ -74,6 +48,5 @@ extern bool pcicore_pmecap_fast(void *pch);
 extern void pcicore_pmeen(void *pch);
 extern void pcicore_pmeclr(void *pch);
 extern bool pcicore_pmestat(void *pch);
-#endif /* defined(BCMSDIO)||(defined(BCMBUSTYPE) && (BCMBUSTYPE==SI_BUS)) */
 
-#endif				/* _NICPCI_H */
+#endif /* _NICPCI_H */
Signature · 1 line
1.7.4.1
#32 lore raw

PATCH 31/83 staging: brcm80211: remove usage of bcmsrom_tbl.h

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The include file bcmsrom_tbl.h was only included by bcmsrom.c. The required definitions have been move to bcmsrom.c and bcmsrom_tbl.h has subsequenly been removed.

---
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c     |  419 ++++++++++++++++++-
 drivers/staging/brcm80211/brcmsmac/bcmsrom_tbl.h |  511 ----------------------
 2 files changed, 418 insertions(+), 512 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmsmac/bcmsrom_tbl.h
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +418 -1
index 9de10fe..487e731 100644
@@ -27,7 +27,6 @@
 #include <pcicfg.h>
 #include <aiutils.h>
 #include <bcmsrom.h>
-#include <bcmsrom_tbl.h>
 
 #include <bcmnvram.h>
 #include <bcmotp.h>
@@ -42,6 +41,24 @@
 #define WRITE_WORD_DELAY	20	/* 20 ms between each word write */
 #endif
 
+/* SROM flags (see sromvar_t) */
+#define SRFL_MORE	1	/* value continues as described by the next entry */
+#define	SRFL_NOFFS	2	/* value bits can't be all one's */
+#define	SRFL_PRHEX	4	/* value is in hexdecimal format */
+#define	SRFL_PRSIGN	8	/* value is in signed decimal format */
+#define	SRFL_CCODE	0x10	/* value is in country code format */
+#define	SRFL_ETHADDR	0x20	/* value is an Ethernet address */
+#define SRFL_LEDDC	0x40	/* value is an LED duty cycle */
+#define SRFL_NOVAR	0x80	/* do not generate a nvram param, entry is for mfgc */
+
+typedef struct {
+	const char *name;
+	u32 revmask;
+	u32 flags;
+	u16 off;
+	u16 mask;
+} sromvar_t;
+
 typedef struct varbuf {
 	char *base;		/* pointer to buffer base */
 	char *buf;		/* pointer to current position */
@@ -50,6 +67,406 @@ typedef struct varbuf {
 extern char *_vars;
 extern uint _varsz;
 
+/* Assumptions:
+ * - Ethernet address spans across 3 consective words
+ *
+ * Table rules:
+ * - Add multiple entries next to each other if a value spans across multiple words
+ *   (even multiple fields in the same word) with each entry except the last having
+ *   it's SRFL_MORE bit set.
+ * - Ethernet address entry does not follow above rule and must not have SRFL_MORE
+ *   bit set. Its SRFL_ETHADDR bit implies it takes multiple words.
+ * - The last entry's name field must be NULL to indicate the end of the table. Other
+ *   entries must have non-NULL name.
+ */
+static const sromvar_t pci_sromvars[] = {
+	{"devid", 0xffffff00, SRFL_PRHEX | SRFL_NOVAR, PCI_F0DEVID, 0xffff},
+	{"boardrev", 0x0000000e, SRFL_PRHEX, SROM_AABREV, SROM_BR_MASK},
+	{"boardrev", 0x000000f0, SRFL_PRHEX, SROM4_BREV, 0xffff},
+	{"boardrev", 0xffffff00, SRFL_PRHEX, SROM8_BREV, 0xffff},
+	{"boardflags", 0x00000002, SRFL_PRHEX, SROM_BFL, 0xffff},
+	{"boardflags", 0x00000004, SRFL_PRHEX | SRFL_MORE, SROM_BFL, 0xffff},
+	{"", 0, 0, SROM_BFL2, 0xffff},
+	{"boardflags", 0x00000008, SRFL_PRHEX | SRFL_MORE, SROM_BFL, 0xffff},
+	{"", 0, 0, SROM3_BFL2, 0xffff},
+	{"boardflags", 0x00000010, SRFL_PRHEX | SRFL_MORE, SROM4_BFL0, 0xffff},
+	{"", 0, 0, SROM4_BFL1, 0xffff},
+	{"boardflags", 0x000000e0, SRFL_PRHEX | SRFL_MORE, SROM5_BFL0, 0xffff},
+	{"", 0, 0, SROM5_BFL1, 0xffff},
+	{"boardflags", 0xffffff00, SRFL_PRHEX | SRFL_MORE, SROM8_BFL0, 0xffff},
+	{"", 0, 0, SROM8_BFL1, 0xffff},
+	{"boardflags2", 0x00000010, SRFL_PRHEX | SRFL_MORE, SROM4_BFL2, 0xffff},
+	{"", 0, 0, SROM4_BFL3, 0xffff},
+	{"boardflags2", 0x000000e0, SRFL_PRHEX | SRFL_MORE, SROM5_BFL2, 0xffff},
+	{"", 0, 0, SROM5_BFL3, 0xffff},
+	{"boardflags2", 0xffffff00, SRFL_PRHEX | SRFL_MORE, SROM8_BFL2, 0xffff},
+	{"", 0, 0, SROM8_BFL3, 0xffff},
+	{"boardtype", 0xfffffffc, SRFL_PRHEX, SROM_SSID, 0xffff},
+	{"boardnum", 0x00000006, 0, SROM_MACLO_IL0, 0xffff},
+	{"boardnum", 0x00000008, 0, SROM3_MACLO, 0xffff},
+	{"boardnum", 0x00000010, 0, SROM4_MACLO, 0xffff},
+	{"boardnum", 0x000000e0, 0, SROM5_MACLO, 0xffff},
+	{"boardnum", 0xffffff00, 0, SROM8_MACLO, 0xffff},
+	{"cc", 0x00000002, 0, SROM_AABREV, SROM_CC_MASK},
+	{"regrev", 0x00000008, 0, SROM_OPO, 0xff00},
+	{"regrev", 0x00000010, 0, SROM4_REGREV, 0x00ff},
+	{"regrev", 0x000000e0, 0, SROM5_REGREV, 0x00ff},
+	{"regrev", 0xffffff00, 0, SROM8_REGREV, 0x00ff},
+	{"ledbh0", 0x0000000e, SRFL_NOFFS, SROM_LEDBH10, 0x00ff},
+	{"ledbh1", 0x0000000e, SRFL_NOFFS, SROM_LEDBH10, 0xff00},
+	{"ledbh2", 0x0000000e, SRFL_NOFFS, SROM_LEDBH32, 0x00ff},
+	{"ledbh3", 0x0000000e, SRFL_NOFFS, SROM_LEDBH32, 0xff00},
+	{"ledbh0", 0x00000010, SRFL_NOFFS, SROM4_LEDBH10, 0x00ff},
+	{"ledbh1", 0x00000010, SRFL_NOFFS, SROM4_LEDBH10, 0xff00},
+	{"ledbh2", 0x00000010, SRFL_NOFFS, SROM4_LEDBH32, 0x00ff},
+	{"ledbh3", 0x00000010, SRFL_NOFFS, SROM4_LEDBH32, 0xff00},
+	{"ledbh0", 0x000000e0, SRFL_NOFFS, SROM5_LEDBH10, 0x00ff},
+	{"ledbh1", 0x000000e0, SRFL_NOFFS, SROM5_LEDBH10, 0xff00},
+	{"ledbh2", 0x000000e0, SRFL_NOFFS, SROM5_LEDBH32, 0x00ff},
+	{"ledbh3", 0x000000e0, SRFL_NOFFS, SROM5_LEDBH32, 0xff00},
+	{"ledbh0", 0xffffff00, SRFL_NOFFS, SROM8_LEDBH10, 0x00ff},
+	{"ledbh1", 0xffffff00, SRFL_NOFFS, SROM8_LEDBH10, 0xff00},
+	{"ledbh2", 0xffffff00, SRFL_NOFFS, SROM8_LEDBH32, 0x00ff},
+	{"ledbh3", 0xffffff00, SRFL_NOFFS, SROM8_LEDBH32, 0xff00},
+	{"pa0b0", 0x0000000e, SRFL_PRHEX, SROM_WL0PAB0, 0xffff},
+	{"pa0b1", 0x0000000e, SRFL_PRHEX, SROM_WL0PAB1, 0xffff},
+	{"pa0b2", 0x0000000e, SRFL_PRHEX, SROM_WL0PAB2, 0xffff},
+	{"pa0itssit", 0x0000000e, 0, SROM_ITT, 0x00ff},
+	{"pa0maxpwr", 0x0000000e, 0, SROM_WL10MAXP, 0x00ff},
+	{"pa0b0", 0xffffff00, SRFL_PRHEX, SROM8_W0_PAB0, 0xffff},
+	{"pa0b1", 0xffffff00, SRFL_PRHEX, SROM8_W0_PAB1, 0xffff},
+	{"pa0b2", 0xffffff00, SRFL_PRHEX, SROM8_W0_PAB2, 0xffff},
+	{"pa0itssit", 0xffffff00, 0, SROM8_W0_ITTMAXP, 0xff00},
+	{"pa0maxpwr", 0xffffff00, 0, SROM8_W0_ITTMAXP, 0x00ff},
+	{"opo", 0x0000000c, 0, SROM_OPO, 0x00ff},
+	{"opo", 0xffffff00, 0, SROM8_2G_OFDMPO, 0x00ff},
+	{"aa2g", 0x0000000e, 0, SROM_AABREV, SROM_AA0_MASK},
+	{"aa2g", 0x000000f0, 0, SROM4_AA, 0x00ff},
+	{"aa2g", 0xffffff00, 0, SROM8_AA, 0x00ff},
+	{"aa5g", 0x0000000e, 0, SROM_AABREV, SROM_AA1_MASK},
+	{"aa5g", 0x000000f0, 0, SROM4_AA, 0xff00},
+	{"aa5g", 0xffffff00, 0, SROM8_AA, 0xff00},
+	{"ag0", 0x0000000e, 0, SROM_AG10, 0x00ff},
+	{"ag1", 0x0000000e, 0, SROM_AG10, 0xff00},
+	{"ag0", 0x000000f0, 0, SROM4_AG10, 0x00ff},
+	{"ag1", 0x000000f0, 0, SROM4_AG10, 0xff00},
+	{"ag2", 0x000000f0, 0, SROM4_AG32, 0x00ff},
+	{"ag3", 0x000000f0, 0, SROM4_AG32, 0xff00},
+	{"ag0", 0xffffff00, 0, SROM8_AG10, 0x00ff},
+	{"ag1", 0xffffff00, 0, SROM8_AG10, 0xff00},
+	{"ag2", 0xffffff00, 0, SROM8_AG32, 0x00ff},
+	{"ag3", 0xffffff00, 0, SROM8_AG32, 0xff00},
+	{"pa1b0", 0x0000000e, SRFL_PRHEX, SROM_WL1PAB0, 0xffff},
+	{"pa1b1", 0x0000000e, SRFL_PRHEX, SROM_WL1PAB1, 0xffff},
+	{"pa1b2", 0x0000000e, SRFL_PRHEX, SROM_WL1PAB2, 0xffff},
+	{"pa1lob0", 0x0000000c, SRFL_PRHEX, SROM_WL1LPAB0, 0xffff},
+	{"pa1lob1", 0x0000000c, SRFL_PRHEX, SROM_WL1LPAB1, 0xffff},
+	{"pa1lob2", 0x0000000c, SRFL_PRHEX, SROM_WL1LPAB2, 0xffff},
+	{"pa1hib0", 0x0000000c, SRFL_PRHEX, SROM_WL1HPAB0, 0xffff},
+	{"pa1hib1", 0x0000000c, SRFL_PRHEX, SROM_WL1HPAB1, 0xffff},
+	{"pa1hib2", 0x0000000c, SRFL_PRHEX, SROM_WL1HPAB2, 0xffff},
+	{"pa1itssit", 0x0000000e, 0, SROM_ITT, 0xff00},
+	{"pa1maxpwr", 0x0000000e, 0, SROM_WL10MAXP, 0xff00},
+	{"pa1lomaxpwr", 0x0000000c, 0, SROM_WL1LHMAXP, 0xff00},
+	{"pa1himaxpwr", 0x0000000c, 0, SROM_WL1LHMAXP, 0x00ff},
+	{"pa1b0", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB0, 0xffff},
+	{"pa1b1", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB1, 0xffff},
+	{"pa1b2", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB2, 0xffff},
+	{"pa1lob0", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB0_LC, 0xffff},
+	{"pa1lob1", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB1_LC, 0xffff},
+	{"pa1lob2", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB2_LC, 0xffff},
+	{"pa1hib0", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB0_HC, 0xffff},
+	{"pa1hib1", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB1_HC, 0xffff},
+	{"pa1hib2", 0xffffff00, SRFL_PRHEX, SROM8_W1_PAB2_HC, 0xffff},
+	{"pa1itssit", 0xffffff00, 0, SROM8_W1_ITTMAXP, 0xff00},
+	{"pa1maxpwr", 0xffffff00, 0, SROM8_W1_ITTMAXP, 0x00ff},
+	{"pa1lomaxpwr", 0xffffff00, 0, SROM8_W1_MAXP_LCHC, 0xff00},
+	{"pa1himaxpwr", 0xffffff00, 0, SROM8_W1_MAXP_LCHC, 0x00ff},
+	{"bxa2g", 0x00000008, 0, SROM_BXARSSI2G, 0x1800},
+	{"rssisav2g", 0x00000008, 0, SROM_BXARSSI2G, 0x0700},
+	{"rssismc2g", 0x00000008, 0, SROM_BXARSSI2G, 0x00f0},
+	{"rssismf2g", 0x00000008, 0, SROM_BXARSSI2G, 0x000f},
+	{"bxa2g", 0xffffff00, 0, SROM8_BXARSSI2G, 0x1800},
+	{"rssisav2g", 0xffffff00, 0, SROM8_BXARSSI2G, 0x0700},
+	{"rssismc2g", 0xffffff00, 0, SROM8_BXARSSI2G, 0x00f0},
+	{"rssismf2g", 0xffffff00, 0, SROM8_BXARSSI2G, 0x000f},
+	{"bxa5g", 0x00000008, 0, SROM_BXARSSI5G, 0x1800},
+	{"rssisav5g", 0x00000008, 0, SROM_BXARSSI5G, 0x0700},
+	{"rssismc5g", 0x00000008, 0, SROM_BXARSSI5G, 0x00f0},
+	{"rssismf5g", 0x00000008, 0, SROM_BXARSSI5G, 0x000f},
+	{"bxa5g", 0xffffff00, 0, SROM8_BXARSSI5G, 0x1800},
+	{"rssisav5g", 0xffffff00, 0, SROM8_BXARSSI5G, 0x0700},
+	{"rssismc5g", 0xffffff00, 0, SROM8_BXARSSI5G, 0x00f0},
+	{"rssismf5g", 0xffffff00, 0, SROM8_BXARSSI5G, 0x000f},
+	{"tri2g", 0x00000008, 0, SROM_TRI52G, 0x00ff},
+	{"tri5g", 0x00000008, 0, SROM_TRI52G, 0xff00},
+	{"tri5gl", 0x00000008, 0, SROM_TRI5GHL, 0x00ff},
+	{"tri5gh", 0x00000008, 0, SROM_TRI5GHL, 0xff00},
+	{"tri2g", 0xffffff00, 0, SROM8_TRI52G, 0x00ff},
+	{"tri5g", 0xffffff00, 0, SROM8_TRI52G, 0xff00},
+	{"tri5gl", 0xffffff00, 0, SROM8_TRI5GHL, 0x00ff},
+	{"tri5gh", 0xffffff00, 0, SROM8_TRI5GHL, 0xff00},
+	{"rxpo2g", 0x00000008, SRFL_PRSIGN, SROM_RXPO52G, 0x00ff},
+	{"rxpo5g", 0x00000008, SRFL_PRSIGN, SROM_RXPO52G, 0xff00},
+	{"rxpo2g", 0xffffff00, SRFL_PRSIGN, SROM8_RXPO52G, 0x00ff},
+	{"rxpo5g", 0xffffff00, SRFL_PRSIGN, SROM8_RXPO52G, 0xff00},
+	{"txchain", 0x000000f0, SRFL_NOFFS, SROM4_TXRXC, SROM4_TXCHAIN_MASK},
+	{"rxchain", 0x000000f0, SRFL_NOFFS, SROM4_TXRXC, SROM4_RXCHAIN_MASK},
+	{"antswitch", 0x000000f0, SRFL_NOFFS, SROM4_TXRXC, SROM4_SWITCH_MASK},
+	{"txchain", 0xffffff00, SRFL_NOFFS, SROM8_TXRXC, SROM4_TXCHAIN_MASK},
+	{"rxchain", 0xffffff00, SRFL_NOFFS, SROM8_TXRXC, SROM4_RXCHAIN_MASK},
+	{"antswitch", 0xffffff00, SRFL_NOFFS, SROM8_TXRXC, SROM4_SWITCH_MASK},
+	{"tssipos2g", 0xffffff00, 0, SROM8_FEM2G, SROM8_FEM_TSSIPOS_MASK},
+	{"extpagain2g", 0xffffff00, 0, SROM8_FEM2G, SROM8_FEM_EXTPA_GAIN_MASK},
+	{"pdetrange2g", 0xffffff00, 0, SROM8_FEM2G, SROM8_FEM_PDET_RANGE_MASK},
+	{"triso2g", 0xffffff00, 0, SROM8_FEM2G, SROM8_FEM_TR_ISO_MASK},
+	{"antswctl2g", 0xffffff00, 0, SROM8_FEM2G, SROM8_FEM_ANTSWLUT_MASK},
+	{"tssipos5g", 0xffffff00, 0, SROM8_FEM5G, SROM8_FEM_TSSIPOS_MASK},
+	{"extpagain5g", 0xffffff00, 0, SROM8_FEM5G, SROM8_FEM_EXTPA_GAIN_MASK},
+	{"pdetrange5g", 0xffffff00, 0, SROM8_FEM5G, SROM8_FEM_PDET_RANGE_MASK},
+	{"triso5g", 0xffffff00, 0, SROM8_FEM5G, SROM8_FEM_TR_ISO_MASK},
+	{"antswctl5g", 0xffffff00, 0, SROM8_FEM5G, SROM8_FEM_ANTSWLUT_MASK},
+	{"tempthresh", 0xffffff00, 0, SROM8_THERMAL, 0xff00},
+	{"tempoffset", 0xffffff00, 0, SROM8_THERMAL, 0x00ff},
+	{"txpid2ga0", 0x000000f0, 0, SROM4_TXPID2G, 0x00ff},
+	{"txpid2ga1", 0x000000f0, 0, SROM4_TXPID2G, 0xff00},
+	{"txpid2ga2", 0x000000f0, 0, SROM4_TXPID2G + 1, 0x00ff},
+	{"txpid2ga3", 0x000000f0, 0, SROM4_TXPID2G + 1, 0xff00},
+	{"txpid5ga0", 0x000000f0, 0, SROM4_TXPID5G, 0x00ff},
+	{"txpid5ga1", 0x000000f0, 0, SROM4_TXPID5G, 0xff00},
+	{"txpid5ga2", 0x000000f0, 0, SROM4_TXPID5G + 1, 0x00ff},
+	{"txpid5ga3", 0x000000f0, 0, SROM4_TXPID5G + 1, 0xff00},
+	{"txpid5gla0", 0x000000f0, 0, SROM4_TXPID5GL, 0x00ff},
+	{"txpid5gla1", 0x000000f0, 0, SROM4_TXPID5GL, 0xff00},
+	{"txpid5gla2", 0x000000f0, 0, SROM4_TXPID5GL + 1, 0x00ff},
+	{"txpid5gla3", 0x000000f0, 0, SROM4_TXPID5GL + 1, 0xff00},
+	{"txpid5gha0", 0x000000f0, 0, SROM4_TXPID5GH, 0x00ff},
+	{"txpid5gha1", 0x000000f0, 0, SROM4_TXPID5GH, 0xff00},
+	{"txpid5gha2", 0x000000f0, 0, SROM4_TXPID5GH + 1, 0x00ff},
+	{"txpid5gha3", 0x000000f0, 0, SROM4_TXPID5GH + 1, 0xff00},
+
+	{"ccode", 0x0000000f, SRFL_CCODE, SROM_CCODE, 0xffff},
+	{"ccode", 0x00000010, SRFL_CCODE, SROM4_CCODE, 0xffff},
+	{"ccode", 0x000000e0, SRFL_CCODE, SROM5_CCODE, 0xffff},
+	{"ccode", 0xffffff00, SRFL_CCODE, SROM8_CCODE, 0xffff},
+	{"macaddr", 0xffffff00, SRFL_ETHADDR, SROM8_MACHI, 0xffff},
+	{"macaddr", 0x000000e0, SRFL_ETHADDR, SROM5_MACHI, 0xffff},
+	{"macaddr", 0x00000010, SRFL_ETHADDR, SROM4_MACHI, 0xffff},
+	{"macaddr", 0x00000008, SRFL_ETHADDR, SROM3_MACHI, 0xffff},
+	{"il0macaddr", 0x00000007, SRFL_ETHADDR, SROM_MACHI_IL0, 0xffff},
+	{"et1macaddr", 0x00000007, SRFL_ETHADDR, SROM_MACHI_ET1, 0xffff},
+	{"leddc", 0xffffff00, SRFL_NOFFS | SRFL_LEDDC, SROM8_LEDDC, 0xffff},
+	{"leddc", 0x000000e0, SRFL_NOFFS | SRFL_LEDDC, SROM5_LEDDC, 0xffff},
+	{"leddc", 0x00000010, SRFL_NOFFS | SRFL_LEDDC, SROM4_LEDDC, 0xffff},
+	{"leddc", 0x00000008, SRFL_NOFFS | SRFL_LEDDC, SROM3_LEDDC, 0xffff},
+	{"rawtempsense", 0xffffff00, SRFL_PRHEX, SROM8_MPWR_RAWTS, 0x01ff},
+	{"measpower", 0xffffff00, SRFL_PRHEX, SROM8_MPWR_RAWTS, 0xfe00},
+	{"tempsense_slope", 0xffffff00, SRFL_PRHEX, SROM8_TS_SLP_OPT_CORRX,
+	 0x00ff},
+	{"tempcorrx", 0xffffff00, SRFL_PRHEX, SROM8_TS_SLP_OPT_CORRX, 0xfc00},
+	{"tempsense_option", 0xffffff00, SRFL_PRHEX, SROM8_TS_SLP_OPT_CORRX,
+	 0x0300},
+	{"freqoffset_corr", 0xffffff00, SRFL_PRHEX, SROM8_FOC_HWIQ_IQSWP,
+	 0x000f},
+	{"iqcal_swp_dis", 0xffffff00, SRFL_PRHEX, SROM8_FOC_HWIQ_IQSWP, 0x0010},
+	{"hw_iqcal_en", 0xffffff00, SRFL_PRHEX, SROM8_FOC_HWIQ_IQSWP, 0x0020},
+	{"phycal_tempdelta", 0xffffff00, 0, SROM8_PHYCAL_TEMPDELTA, 0x00ff},
+
+	{"cck2gpo", 0x000000f0, 0, SROM4_2G_CCKPO, 0xffff},
+	{"cck2gpo", 0x00000100, 0, SROM8_2G_CCKPO, 0xffff},
+	{"ofdm2gpo", 0x000000f0, SRFL_MORE, SROM4_2G_OFDMPO, 0xffff},
+	{"", 0, 0, SROM4_2G_OFDMPO + 1, 0xffff},
+	{"ofdm5gpo", 0x000000f0, SRFL_MORE, SROM4_5G_OFDMPO, 0xffff},
+	{"", 0, 0, SROM4_5G_OFDMPO + 1, 0xffff},
+	{"ofdm5glpo", 0x000000f0, SRFL_MORE, SROM4_5GL_OFDMPO, 0xffff},
+	{"", 0, 0, SROM4_5GL_OFDMPO + 1, 0xffff},
+	{"ofdm5ghpo", 0x000000f0, SRFL_MORE, SROM4_5GH_OFDMPO, 0xffff},
+	{"", 0, 0, SROM4_5GH_OFDMPO + 1, 0xffff},
+	{"ofdm2gpo", 0x00000100, SRFL_MORE, SROM8_2G_OFDMPO, 0xffff},
+	{"", 0, 0, SROM8_2G_OFDMPO + 1, 0xffff},
+	{"ofdm5gpo", 0x00000100, SRFL_MORE, SROM8_5G_OFDMPO, 0xffff},
+	{"", 0, 0, SROM8_5G_OFDMPO + 1, 0xffff},
+	{"ofdm5glpo", 0x00000100, SRFL_MORE, SROM8_5GL_OFDMPO, 0xffff},
+	{"", 0, 0, SROM8_5GL_OFDMPO + 1, 0xffff},
+	{"ofdm5ghpo", 0x00000100, SRFL_MORE, SROM8_5GH_OFDMPO, 0xffff},
+	{"", 0, 0, SROM8_5GH_OFDMPO + 1, 0xffff},
+	{"mcs2gpo0", 0x000000f0, 0, SROM4_2G_MCSPO, 0xffff},
+	{"mcs2gpo1", 0x000000f0, 0, SROM4_2G_MCSPO + 1, 0xffff},
+	{"mcs2gpo2", 0x000000f0, 0, SROM4_2G_MCSPO + 2, 0xffff},
+	{"mcs2gpo3", 0x000000f0, 0, SROM4_2G_MCSPO + 3, 0xffff},
+	{"mcs2gpo4", 0x000000f0, 0, SROM4_2G_MCSPO + 4, 0xffff},
+	{"mcs2gpo5", 0x000000f0, 0, SROM4_2G_MCSPO + 5, 0xffff},
+	{"mcs2gpo6", 0x000000f0, 0, SROM4_2G_MCSPO + 6, 0xffff},
+	{"mcs2gpo7", 0x000000f0, 0, SROM4_2G_MCSPO + 7, 0xffff},
+	{"mcs5gpo0", 0x000000f0, 0, SROM4_5G_MCSPO, 0xffff},
+	{"mcs5gpo1", 0x000000f0, 0, SROM4_5G_MCSPO + 1, 0xffff},
+	{"mcs5gpo2", 0x000000f0, 0, SROM4_5G_MCSPO + 2, 0xffff},
+	{"mcs5gpo3", 0x000000f0, 0, SROM4_5G_MCSPO + 3, 0xffff},
+	{"mcs5gpo4", 0x000000f0, 0, SROM4_5G_MCSPO + 4, 0xffff},
+	{"mcs5gpo5", 0x000000f0, 0, SROM4_5G_MCSPO + 5, 0xffff},
+	{"mcs5gpo6", 0x000000f0, 0, SROM4_5G_MCSPO + 6, 0xffff},
+	{"mcs5gpo7", 0x000000f0, 0, SROM4_5G_MCSPO + 7, 0xffff},
+	{"mcs5glpo0", 0x000000f0, 0, SROM4_5GL_MCSPO, 0xffff},
+	{"mcs5glpo1", 0x000000f0, 0, SROM4_5GL_MCSPO + 1, 0xffff},
+	{"mcs5glpo2", 0x000000f0, 0, SROM4_5GL_MCSPO + 2, 0xffff},
+	{"mcs5glpo3", 0x000000f0, 0, SROM4_5GL_MCSPO + 3, 0xffff},
+	{"mcs5glpo4", 0x000000f0, 0, SROM4_5GL_MCSPO + 4, 0xffff},
+	{"mcs5glpo5", 0x000000f0, 0, SROM4_5GL_MCSPO + 5, 0xffff},
+	{"mcs5glpo6", 0x000000f0, 0, SROM4_5GL_MCSPO + 6, 0xffff},
+	{"mcs5glpo7", 0x000000f0, 0, SROM4_5GL_MCSPO + 7, 0xffff},
+	{"mcs5ghpo0", 0x000000f0, 0, SROM4_5GH_MCSPO, 0xffff},
+	{"mcs5ghpo1", 0x000000f0, 0, SROM4_5GH_MCSPO + 1, 0xffff},
+	{"mcs5ghpo2", 0x000000f0, 0, SROM4_5GH_MCSPO + 2, 0xffff},
+	{"mcs5ghpo3", 0x000000f0, 0, SROM4_5GH_MCSPO + 3, 0xffff},
+	{"mcs5ghpo4", 0x000000f0, 0, SROM4_5GH_MCSPO + 4, 0xffff},
+	{"mcs5ghpo5", 0x000000f0, 0, SROM4_5GH_MCSPO + 5, 0xffff},
+	{"mcs5ghpo6", 0x000000f0, 0, SROM4_5GH_MCSPO + 6, 0xffff},
+	{"mcs5ghpo7", 0x000000f0, 0, SROM4_5GH_MCSPO + 7, 0xffff},
+	{"mcs2gpo0", 0x00000100, 0, SROM8_2G_MCSPO, 0xffff},
+	{"mcs2gpo1", 0x00000100, 0, SROM8_2G_MCSPO + 1, 0xffff},
+	{"mcs2gpo2", 0x00000100, 0, SROM8_2G_MCSPO + 2, 0xffff},
+	{"mcs2gpo3", 0x00000100, 0, SROM8_2G_MCSPO + 3, 0xffff},
+	{"mcs2gpo4", 0x00000100, 0, SROM8_2G_MCSPO + 4, 0xffff},
+	{"mcs2gpo5", 0x00000100, 0, SROM8_2G_MCSPO + 5, 0xffff},
+	{"mcs2gpo6", 0x00000100, 0, SROM8_2G_MCSPO + 6, 0xffff},
+	{"mcs2gpo7", 0x00000100, 0, SROM8_2G_MCSPO + 7, 0xffff},
+	{"mcs5gpo0", 0x00000100, 0, SROM8_5G_MCSPO, 0xffff},
+	{"mcs5gpo1", 0x00000100, 0, SROM8_5G_MCSPO + 1, 0xffff},
+	{"mcs5gpo2", 0x00000100, 0, SROM8_5G_MCSPO + 2, 0xffff},
+	{"mcs5gpo3", 0x00000100, 0, SROM8_5G_MCSPO + 3, 0xffff},
+	{"mcs5gpo4", 0x00000100, 0, SROM8_5G_MCSPO + 4, 0xffff},
+	{"mcs5gpo5", 0x00000100, 0, SROM8_5G_MCSPO + 5, 0xffff},
+	{"mcs5gpo6", 0x00000100, 0, SROM8_5G_MCSPO + 6, 0xffff},
+	{"mcs5gpo7", 0x00000100, 0, SROM8_5G_MCSPO + 7, 0xffff},
+	{"mcs5glpo0", 0x00000100, 0, SROM8_5GL_MCSPO, 0xffff},
+	{"mcs5glpo1", 0x00000100, 0, SROM8_5GL_MCSPO + 1, 0xffff},
+	{"mcs5glpo2", 0x00000100, 0, SROM8_5GL_MCSPO + 2, 0xffff},
+	{"mcs5glpo3", 0x00000100, 0, SROM8_5GL_MCSPO + 3, 0xffff},
+	{"mcs5glpo4", 0x00000100, 0, SROM8_5GL_MCSPO + 4, 0xffff},
+	{"mcs5glpo5", 0x00000100, 0, SROM8_5GL_MCSPO + 5, 0xffff},
+	{"mcs5glpo6", 0x00000100, 0, SROM8_5GL_MCSPO + 6, 0xffff},
+	{"mcs5glpo7", 0x00000100, 0, SROM8_5GL_MCSPO + 7, 0xffff},
+	{"mcs5ghpo0", 0x00000100, 0, SROM8_5GH_MCSPO, 0xffff},
+	{"mcs5ghpo1", 0x00000100, 0, SROM8_5GH_MCSPO + 1, 0xffff},
+	{"mcs5ghpo2", 0x00000100, 0, SROM8_5GH_MCSPO + 2, 0xffff},
+	{"mcs5ghpo3", 0x00000100, 0, SROM8_5GH_MCSPO + 3, 0xffff},
+	{"mcs5ghpo4", 0x00000100, 0, SROM8_5GH_MCSPO + 4, 0xffff},
+	{"mcs5ghpo5", 0x00000100, 0, SROM8_5GH_MCSPO + 5, 0xffff},
+	{"mcs5ghpo6", 0x00000100, 0, SROM8_5GH_MCSPO + 6, 0xffff},
+	{"mcs5ghpo7", 0x00000100, 0, SROM8_5GH_MCSPO + 7, 0xffff},
+	{"cddpo", 0x000000f0, 0, SROM4_CDDPO, 0xffff},
+	{"stbcpo", 0x000000f0, 0, SROM4_STBCPO, 0xffff},
+	{"bw40po", 0x000000f0, 0, SROM4_BW40PO, 0xffff},
+	{"bwduppo", 0x000000f0, 0, SROM4_BWDUPPO, 0xffff},
+	{"cddpo", 0x00000100, 0, SROM8_CDDPO, 0xffff},
+	{"stbcpo", 0x00000100, 0, SROM8_STBCPO, 0xffff},
+	{"bw40po", 0x00000100, 0, SROM8_BW40PO, 0xffff},
+	{"bwduppo", 0x00000100, 0, SROM8_BWDUPPO, 0xffff},
+
+	/* power per rate from sromrev 9 */
+	{"cckbw202gpo", 0xfffffe00, 0, SROM9_2GPO_CCKBW20, 0xffff},
+	{"cckbw20ul2gpo", 0xfffffe00, 0, SROM9_2GPO_CCKBW20UL, 0xffff},
+	{"legofdmbw202gpo", 0xfffffe00, SRFL_MORE, SROM9_2GPO_LOFDMBW20,
+	 0xffff},
+	{"", 0, 0, SROM9_2GPO_LOFDMBW20 + 1, 0xffff},
+	{"legofdmbw20ul2gpo", 0xfffffe00, SRFL_MORE, SROM9_2GPO_LOFDMBW20UL,
+	 0xffff},
+	{"", 0, 0, SROM9_2GPO_LOFDMBW20UL + 1, 0xffff},
+	{"legofdmbw205glpo", 0xfffffe00, SRFL_MORE, SROM9_5GLPO_LOFDMBW20,
+	 0xffff},
+	{"", 0, 0, SROM9_5GLPO_LOFDMBW20 + 1, 0xffff},
+	{"legofdmbw20ul5glpo", 0xfffffe00, SRFL_MORE, SROM9_5GLPO_LOFDMBW20UL,
+	 0xffff},
+	{"", 0, 0, SROM9_5GLPO_LOFDMBW20UL + 1, 0xffff},
+	{"legofdmbw205gmpo", 0xfffffe00, SRFL_MORE, SROM9_5GMPO_LOFDMBW20,
+	 0xffff},
+	{"", 0, 0, SROM9_5GMPO_LOFDMBW20 + 1, 0xffff},
+	{"legofdmbw20ul5gmpo", 0xfffffe00, SRFL_MORE, SROM9_5GMPO_LOFDMBW20UL,
+	 0xffff},
+	{"", 0, 0, SROM9_5GMPO_LOFDMBW20UL + 1, 0xffff},
+	{"legofdmbw205ghpo", 0xfffffe00, SRFL_MORE, SROM9_5GHPO_LOFDMBW20,
+	 0xffff},
+	{"", 0, 0, SROM9_5GHPO_LOFDMBW20 + 1, 0xffff},
+	{"legofdmbw20ul5ghpo", 0xfffffe00, SRFL_MORE, SROM9_5GHPO_LOFDMBW20UL,
+	 0xffff},
+	{"", 0, 0, SROM9_5GHPO_LOFDMBW20UL + 1, 0xffff},
+	{"mcsbw202gpo", 0xfffffe00, SRFL_MORE, SROM9_2GPO_MCSBW20, 0xffff},
+	{"", 0, 0, SROM9_2GPO_MCSBW20 + 1, 0xffff},
+	{"mcsbw20ul2gpo", 0xfffffe00, SRFL_MORE, SROM9_2GPO_MCSBW20UL, 0xffff},
+	{"", 0, 0, SROM9_2GPO_MCSBW20UL + 1, 0xffff},
+	{"mcsbw402gpo", 0xfffffe00, SRFL_MORE, SROM9_2GPO_MCSBW40, 0xffff},
+	{"", 0, 0, SROM9_2GPO_MCSBW40 + 1, 0xffff},
+	{"mcsbw205glpo", 0xfffffe00, SRFL_MORE, SROM9_5GLPO_MCSBW20, 0xffff},
+	{"", 0, 0, SROM9_5GLPO_MCSBW20 + 1, 0xffff},
+	{"mcsbw20ul5glpo", 0xfffffe00, SRFL_MORE, SROM9_5GLPO_MCSBW20UL,
+	 0xffff},
+	{"", 0, 0, SROM9_5GLPO_MCSBW20UL + 1, 0xffff},
+	{"mcsbw405glpo", 0xfffffe00, SRFL_MORE, SROM9_5GLPO_MCSBW40, 0xffff},
+	{"", 0, 0, SROM9_5GLPO_MCSBW40 + 1, 0xffff},
+	{"mcsbw205gmpo", 0xfffffe00, SRFL_MORE, SROM9_5GMPO_MCSBW20, 0xffff},
+	{"", 0, 0, SROM9_5GMPO_MCSBW20 + 1, 0xffff},
+	{"mcsbw20ul5gmpo", 0xfffffe00, SRFL_MORE, SROM9_5GMPO_MCSBW20UL,
+	 0xffff},
+	{"", 0, 0, SROM9_5GMPO_MCSBW20UL + 1, 0xffff},
+	{"mcsbw405gmpo", 0xfffffe00, SRFL_MORE, SROM9_5GMPO_MCSBW40, 0xffff},
+	{"", 0, 0, SROM9_5GMPO_MCSBW40 + 1, 0xffff},
+	{"mcsbw205ghpo", 0xfffffe00, SRFL_MORE, SROM9_5GHPO_MCSBW20, 0xffff},
+	{"", 0, 0, SROM9_5GHPO_MCSBW20 + 1, 0xffff},
+	{"mcsbw20ul5ghpo", 0xfffffe00, SRFL_MORE, SROM9_5GHPO_MCSBW20UL,
+	 0xffff},
+	{"", 0, 0, SROM9_5GHPO_MCSBW20UL + 1, 0xffff},
+	{"mcsbw405ghpo", 0xfffffe00, SRFL_MORE, SROM9_5GHPO_MCSBW40, 0xffff},
+	{"", 0, 0, SROM9_5GHPO_MCSBW40 + 1, 0xffff},
+	{"mcs32po", 0xfffffe00, 0, SROM9_PO_MCS32, 0xffff},
+	{"legofdm40duppo", 0xfffffe00, 0, SROM9_PO_LOFDM40DUP, 0xffff},
+
+	{NULL, 0, 0, 0, 0}
+};
+
+static const sromvar_t perpath_pci_sromvars[] = {
+	{"maxp2ga", 0x000000f0, 0, SROM4_2G_ITT_MAXP, 0x00ff},
+	{"itt2ga", 0x000000f0, 0, SROM4_2G_ITT_MAXP, 0xff00},
+	{"itt5ga", 0x000000f0, 0, SROM4_5G_ITT_MAXP, 0xff00},
+	{"pa2gw0a", 0x000000f0, SRFL_PRHEX, SROM4_2G_PA, 0xffff},
+	{"pa2gw1a", 0x000000f0, SRFL_PRHEX, SROM4_2G_PA + 1, 0xffff},
+	{"pa2gw2a", 0x000000f0, SRFL_PRHEX, SROM4_2G_PA + 2, 0xffff},
+	{"pa2gw3a", 0x000000f0, SRFL_PRHEX, SROM4_2G_PA + 3, 0xffff},
+	{"maxp5ga", 0x000000f0, 0, SROM4_5G_ITT_MAXP, 0x00ff},
+	{"maxp5gha", 0x000000f0, 0, SROM4_5GLH_MAXP, 0x00ff},
+	{"maxp5gla", 0x000000f0, 0, SROM4_5GLH_MAXP, 0xff00},
+	{"pa5gw0a", 0x000000f0, SRFL_PRHEX, SROM4_5G_PA, 0xffff},
+	{"pa5gw1a", 0x000000f0, SRFL_PRHEX, SROM4_5G_PA + 1, 0xffff},
+	{"pa5gw2a", 0x000000f0, SRFL_PRHEX, SROM4_5G_PA + 2, 0xffff},
+	{"pa5gw3a", 0x000000f0, SRFL_PRHEX, SROM4_5G_PA + 3, 0xffff},
+	{"pa5glw0a", 0x000000f0, SRFL_PRHEX, SROM4_5GL_PA, 0xffff},
+	{"pa5glw1a", 0x000000f0, SRFL_PRHEX, SROM4_5GL_PA + 1, 0xffff},
+	{"pa5glw2a", 0x000000f0, SRFL_PRHEX, SROM4_5GL_PA + 2, 0xffff},
+	{"pa5glw3a", 0x000000f0, SRFL_PRHEX, SROM4_5GL_PA + 3, 0xffff},
+	{"pa5ghw0a", 0x000000f0, SRFL_PRHEX, SROM4_5GH_PA, 0xffff},
+	{"pa5ghw1a", 0x000000f0, SRFL_PRHEX, SROM4_5GH_PA + 1, 0xffff},
+	{"pa5ghw2a", 0x000000f0, SRFL_PRHEX, SROM4_5GH_PA + 2, 0xffff},
+	{"pa5ghw3a", 0x000000f0, SRFL_PRHEX, SROM4_5GH_PA + 3, 0xffff},
+	{"maxp2ga", 0xffffff00, 0, SROM8_2G_ITT_MAXP, 0x00ff},
+	{"itt2ga", 0xffffff00, 0, SROM8_2G_ITT_MAXP, 0xff00},
+	{"itt5ga", 0xffffff00, 0, SROM8_5G_ITT_MAXP, 0xff00},
+	{"pa2gw0a", 0xffffff00, SRFL_PRHEX, SROM8_2G_PA, 0xffff},
+	{"pa2gw1a", 0xffffff00, SRFL_PRHEX, SROM8_2G_PA + 1, 0xffff},
+	{"pa2gw2a", 0xffffff00, SRFL_PRHEX, SROM8_2G_PA + 2, 0xffff},
+	{"maxp5ga", 0xffffff00, 0, SROM8_5G_ITT_MAXP, 0x00ff},
+	{"maxp5gha", 0xffffff00, 0, SROM8_5GLH_MAXP, 0x00ff},
+	{"maxp5gla", 0xffffff00, 0, SROM8_5GLH_MAXP, 0xff00},
+	{"pa5gw0a", 0xffffff00, SRFL_PRHEX, SROM8_5G_PA, 0xffff},
+	{"pa5gw1a", 0xffffff00, SRFL_PRHEX, SROM8_5G_PA + 1, 0xffff},
+	{"pa5gw2a", 0xffffff00, SRFL_PRHEX, SROM8_5G_PA + 2, 0xffff},
+	{"pa5glw0a", 0xffffff00, SRFL_PRHEX, SROM8_5GL_PA, 0xffff},
+	{"pa5glw1a", 0xffffff00, SRFL_PRHEX, SROM8_5GL_PA + 1, 0xffff},
+	{"pa5glw2a", 0xffffff00, SRFL_PRHEX, SROM8_5GL_PA + 2, 0xffff},
+	{"pa5ghw0a", 0xffffff00, SRFL_PRHEX, SROM8_5GH_PA, 0xffff},
+	{"pa5ghw1a", 0xffffff00, SRFL_PRHEX, SROM8_5GH_PA + 1, 0xffff},
+	{"pa5ghw2a", 0xffffff00, SRFL_PRHEX, SROM8_5GH_PA + 2, 0xffff},
+	{NULL, 0, 0, 0, 0}
+};
+
 static int initvars_srom_si(si_t *sih, void *curmap, char **vars, uint *count);
 static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b);
 static int initvars_srom_pci(si_t *sih, void *curmap, char **vars, uint *count);
drivers/staging/brcm80211/brcmsmac/bcmsrom_tbl.h deleted +0 -511

511 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#33 lore raw

PATCH 32/83 staging: brcm80211: remove extern variable definitions in bcmsrom.c

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The file bcmsrom.c defined two global externals. As these were also not used these have been removed.

---
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +0 -2
index 487e731..a1a2fc5 100644
@@ -64,8 +64,6 @@ typedef struct varbuf {
 	char *buf;		/* pointer to current position */
 	unsigned int size;	/* current (residual) size in bytes */
 } varbuf_t;
-extern char *_vars;
-extern uint _varsz;
 
 /* Assumptions:
  * - Ethernet address spans across 3 consective words
Signature · 1 line
1.7.4.1
#34 lore raw

PATCH 33/83 staging: brcm80211: remove inclusion of bcmsrom_fmt.h

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The header file bcmsrom_fmt.h contains a lot of macro definitions used by bcmsrom.c and one type definition used by wlc_phy_int.h. The defintions have been moved appropriately and the include file bcmsrom_fmt.h is removed.

---
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c       |  311 +++++++++++++++++
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_int.h   |   13 +-
 drivers/staging/brcm80211/include/bcmsrom.h        |    2 -
 drivers/staging/brcm80211/include/bcmsrom_fmt.h    |  367 --------------------
 4 files changed, 321 insertions(+), 372 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/include/bcmsrom_fmt.h
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +311 -0
index a1a2fc5..d374673 100644
@@ -41,6 +41,317 @@
 #define WRITE_WORD_DELAY	20	/* 20 ms between each word write */
 #endif
 
+/* Maximum srom: 6 Kilobits == 768 bytes */
+#define	SROM_MAX		768
+
+/* PCI fields */
+#define PCI_F0DEVID		48
+
+#define	SROM_WORDS		64
+
+#define	SROM_SSID		2
+
+#define	SROM_WL1LHMAXP		29
+
+#define	SROM_WL1LPAB0		30
+#define	SROM_WL1LPAB1		31
+#define	SROM_WL1LPAB2		32
+
+#define	SROM_WL1HPAB0		33
+#define	SROM_WL1HPAB1		34
+#define	SROM_WL1HPAB2		35
+
+#define	SROM_MACHI_IL0		36
+#define	SROM_MACMID_IL0		37
+#define	SROM_MACLO_IL0		38
+#define	SROM_MACHI_ET1		42
+#define	SROM_MACMID_ET1		43
+#define	SROM_MACLO_ET1		44
+#define	SROM3_MACHI		37
+#define	SROM3_MACMID		38
+#define	SROM3_MACLO		39
+
+#define	SROM_BXARSSI2G		40
+#define	SROM_BXARSSI5G		41
+
+#define	SROM_TRI52G		42
+#define	SROM_TRI5GHL		43
+
+#define	SROM_RXPO52G		45
+
+#define	SROM_AABREV		46
+/* Fields in AABREV */
+#define	SROM_BR_MASK		0x00ff
+#define	SROM_CC_MASK		0x0f00
+#define	SROM_CC_SHIFT		8
+#define	SROM_AA0_MASK		0x3000
+#define	SROM_AA0_SHIFT		12
+#define	SROM_AA1_MASK		0xc000
+#define	SROM_AA1_SHIFT		14
+
+#define	SROM_WL0PAB0		47
+#define	SROM_WL0PAB1		48
+#define	SROM_WL0PAB2		49
+
+#define	SROM_LEDBH10		50
+#define	SROM_LEDBH32		51
+
+#define	SROM_WL10MAXP		52
+
+#define	SROM_WL1PAB0		53
+#define	SROM_WL1PAB1		54
+#define	SROM_WL1PAB2		55
+
+#define	SROM_ITT		56
+
+#define	SROM_BFL		57
+#define	SROM_BFL2		28
+#define	SROM3_BFL2		61
+
+#define	SROM_AG10		58
+
+#define	SROM_CCODE		59
+
+#define	SROM_OPO		60
+
+#define	SROM3_LEDDC		62
+
+#define	SROM_CRCREV		63
+
+/* SROM Rev 4: Reallocate the software part of the srom to accommodate
+ * MIMO features. It assumes up to two PCIE functions and 440 bytes
+ * of usable srom i.e. the usable storage in chips with OTP that
+ * implements hardware redundancy.
+ */
+
+#define	SROM4_WORDS		220
+
+#define	SROM4_SIGN		32
+#define	SROM4_SIGNATURE		0x5372
+
+#define	SROM4_BREV		33
+
+#define	SROM4_BFL0		34
+#define	SROM4_BFL1		35
+#define	SROM4_BFL2		36
+#define	SROM4_BFL3		37
+#define	SROM5_BFL0		37
+#define	SROM5_BFL1		38
+#define	SROM5_BFL2		39
+#define	SROM5_BFL3		40
+
+#define	SROM4_MACHI		38
+#define	SROM4_MACMID		39
+#define	SROM4_MACLO		40
+#define	SROM5_MACHI		41
+#define	SROM5_MACMID		42
+#define	SROM5_MACLO		43
+
+#define	SROM4_CCODE		41
+#define	SROM4_REGREV		42
+#define	SROM5_CCODE		34
+#define	SROM5_REGREV		35
+
+#define	SROM4_LEDBH10		43
+#define	SROM4_LEDBH32		44
+#define	SROM5_LEDBH10		59
+#define	SROM5_LEDBH32		60
+
+#define	SROM4_LEDDC		45
+#define	SROM5_LEDDC		45
+
+#define	SROM4_AA		46
+
+#define	SROM4_AG10		47
+#define	SROM4_AG32		48
+
+#define	SROM4_TXPID2G		49
+#define	SROM4_TXPID5G		51
+#define	SROM4_TXPID5GL		53
+#define	SROM4_TXPID5GH		55
+
+#define SROM4_TXRXC		61
+#define SROM4_TXCHAIN_MASK	0x000f
+#define SROM4_TXCHAIN_SHIFT	0
+#define SROM4_RXCHAIN_MASK	0x00f0
+#define SROM4_RXCHAIN_SHIFT	4
+#define SROM4_SWITCH_MASK	0xff00
+#define SROM4_SWITCH_SHIFT	8
+
+/* Per-path fields */
+#define	MAX_PATH_SROM		4
+#define	SROM4_PATH0		64
+#define	SROM4_PATH1		87
+#define	SROM4_PATH2		110
+#define	SROM4_PATH3		133
+
+#define	SROM4_2G_ITT_MAXP	0
+#define	SROM4_2G_PA		1
+#define	SROM4_5G_ITT_MAXP	5
+#define	SROM4_5GLH_MAXP		6
+#define	SROM4_5G_PA		7
+#define	SROM4_5GL_PA		11
+#define	SROM4_5GH_PA		15
+
+/* All the miriad power offsets */
+#define	SROM4_2G_CCKPO		156
+#define	SROM4_2G_OFDMPO		157
+#define	SROM4_5G_OFDMPO		159
+#define	SROM4_5GL_OFDMPO	161
+#define	SROM4_5GH_OFDMPO	163
+#define	SROM4_2G_MCSPO		165
+#define	SROM4_5G_MCSPO		173
+#define	SROM4_5GL_MCSPO		181
+#define	SROM4_5GH_MCSPO		189
+#define	SROM4_CDDPO		197
+#define	SROM4_STBCPO		198
+#define	SROM4_BW40PO		199
+#define	SROM4_BWDUPPO		200
+
+#define	SROM4_CRCREV		219
+
+/* SROM Rev 8: Make space for a 48word hardware header for PCIe rev >= 6.
+ * This is acombined srom for both MIMO and SISO boards, usable in
+ * the .130 4Kilobit OTP with hardware redundancy.
+ */
+#define	SROM8_BREV		65
+
+#define	SROM8_BFL0		66
+#define	SROM8_BFL1		67
+#define	SROM8_BFL2		68
+#define	SROM8_BFL3		69
+
+#define	SROM8_MACHI		70
+#define	SROM8_MACMID		71
+#define	SROM8_MACLO		72
+
+#define	SROM8_CCODE		73
+#define	SROM8_REGREV		74
+
+#define	SROM8_LEDBH10		75
+#define	SROM8_LEDBH32		76
+
+#define	SROM8_LEDDC		77
+
+#define	SROM8_AA		78
+
+#define	SROM8_AG10		79
+#define	SROM8_AG32		80
+
+#define	SROM8_TXRXC		81
+
+#define	SROM8_BXARSSI2G		82
+#define	SROM8_BXARSSI5G		83
+#define	SROM8_TRI52G		84
+#define	SROM8_TRI5GHL		85
+#define	SROM8_RXPO52G		86
+
+#define SROM8_FEM2G		87
+#define SROM8_FEM5G		88
+#define SROM8_FEM_ANTSWLUT_MASK		0xf800
+#define SROM8_FEM_ANTSWLUT_SHIFT	11
+#define SROM8_FEM_TR_ISO_MASK		0x0700
+#define SROM8_FEM_TR_ISO_SHIFT		8
+#define SROM8_FEM_PDET_RANGE_MASK	0x00f8
+#define SROM8_FEM_PDET_RANGE_SHIFT	3
+#define SROM8_FEM_EXTPA_GAIN_MASK	0x0006
+#define SROM8_FEM_EXTPA_GAIN_SHIFT	1
+#define SROM8_FEM_TSSIPOS_MASK		0x0001
+#define SROM8_FEM_TSSIPOS_SHIFT		0
+
+#define SROM8_THERMAL		89
+
+/* Temp sense related entries */
+#define SROM8_MPWR_RAWTS		90
+#define SROM8_TS_SLP_OPT_CORRX	91
+/* FOC: freiquency offset correction, HWIQ: H/W IOCAL enable, IQSWP: IQ CAL swap disable */
+#define SROM8_FOC_HWIQ_IQSWP	92
+
+/* Temperature delta for PHY calibration */
+#define SROM8_PHYCAL_TEMPDELTA	93
+
+/* Per-path offsets & fields */
+#define	SROM8_PATH0		96
+#define	SROM8_PATH1		112
+#define	SROM8_PATH2		128
+#define	SROM8_PATH3		144
+
+#define	SROM8_2G_ITT_MAXP	0
+#define	SROM8_2G_PA		1
+#define	SROM8_5G_ITT_MAXP	4
+#define	SROM8_5GLH_MAXP		5
+#define	SROM8_5G_PA		6
+#define	SROM8_5GL_PA		9
+#define	SROM8_5GH_PA		12
+
+/* All the miriad power offsets */
+#define	SROM8_2G_CCKPO		160
+
+#define	SROM8_2G_OFDMPO		161
+#define	SROM8_5G_OFDMPO		163
+#define	SROM8_5GL_OFDMPO	165
+#define	SROM8_5GH_OFDMPO	167
+
+#define	SROM8_2G_MCSPO		169
+#define	SROM8_5G_MCSPO		177
+#define	SROM8_5GL_MCSPO		185
+#define	SROM8_5GH_MCSPO		193
+
+#define	SROM8_CDDPO		201
+#define	SROM8_STBCPO		202
+#define	SROM8_BW40PO		203
+#define	SROM8_BWDUPPO		204
+
+/* SISO PA parameters are in the path0 spaces */
+#define	SROM8_SISO		96
+
+/* Legacy names for SISO PA paramters */
+#define	SROM8_W0_ITTMAXP	(SROM8_SISO + SROM8_2G_ITT_MAXP)
+#define	SROM8_W0_PAB0		(SROM8_SISO + SROM8_2G_PA)
+#define	SROM8_W0_PAB1		(SROM8_SISO + SROM8_2G_PA + 1)
+#define	SROM8_W0_PAB2		(SROM8_SISO + SROM8_2G_PA + 2)
+#define	SROM8_W1_ITTMAXP	(SROM8_SISO + SROM8_5G_ITT_MAXP)
+#define	SROM8_W1_MAXP_LCHC	(SROM8_SISO + SROM8_5GLH_MAXP)
+#define	SROM8_W1_PAB0		(SROM8_SISO + SROM8_5G_PA)
+#define	SROM8_W1_PAB1		(SROM8_SISO + SROM8_5G_PA + 1)
+#define	SROM8_W1_PAB2		(SROM8_SISO + SROM8_5G_PA + 2)
+#define	SROM8_W1_PAB0_LC	(SROM8_SISO + SROM8_5GL_PA)
+#define	SROM8_W1_PAB1_LC	(SROM8_SISO + SROM8_5GL_PA + 1)
+#define	SROM8_W1_PAB2_LC	(SROM8_SISO + SROM8_5GL_PA + 2)
+#define	SROM8_W1_PAB0_HC	(SROM8_SISO + SROM8_5GH_PA)
+#define	SROM8_W1_PAB1_HC	(SROM8_SISO + SROM8_5GH_PA + 1)
+#define	SROM8_W1_PAB2_HC	(SROM8_SISO + SROM8_5GH_PA + 2)
+
+/* SROM REV 9 */
+#define SROM9_2GPO_CCKBW20	160
+#define SROM9_2GPO_CCKBW20UL	161
+#define SROM9_2GPO_LOFDMBW20	162
+#define SROM9_2GPO_LOFDMBW20UL	164
+
+#define SROM9_5GLPO_LOFDMBW20	166
+#define SROM9_5GLPO_LOFDMBW20UL	168
+#define SROM9_5GMPO_LOFDMBW20	170
+#define SROM9_5GMPO_LOFDMBW20UL	172
+#define SROM9_5GHPO_LOFDMBW20	174
+#define SROM9_5GHPO_LOFDMBW20UL	176
+
+#define SROM9_2GPO_MCSBW20	178
+#define SROM9_2GPO_MCSBW20UL	180
+#define SROM9_2GPO_MCSBW40	182
+
+#define SROM9_5GLPO_MCSBW20	184
+#define SROM9_5GLPO_MCSBW20UL	186
+#define SROM9_5GLPO_MCSBW40	188
+#define SROM9_5GMPO_MCSBW20	190
+#define SROM9_5GMPO_MCSBW20UL	192
+#define SROM9_5GMPO_MCSBW40	194
+#define SROM9_5GHPO_MCSBW20	196
+#define SROM9_5GHPO_MCSBW20UL	198
+#define SROM9_5GHPO_MCSBW40	200
+
+#define SROM9_PO_MCS32		202
+#define SROM9_PO_LOFDM40DUP	203
+
 /* SROM flags (see sromvar_t) */
 #define SRFL_MORE	1	/* value continues as described by the next entry */
 #define	SRFL_NOFFS	2	/* value bits can't be all one's */
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h +10 -3
index 10cbf52..8e7fb94 100644
@@ -21,7 +21,6 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 
-#include <bcmsrom_fmt.h>
 #include <wlc_phy_hal.h>
 
 #define PHYHAL_ERROR	0x0001
@@ -42,6 +41,14 @@ extern u32 phyhal_msg_level;
 
 #define LCNXN_BASEREV		16
 
+typedef struct {
+	u8 tssipos;		/* TSSI positive slope, 1: positive, 0: negative */
+	u8 extpagain;	/* Ext PA gain-type: full-gain: 0, pa-lite: 1, no_pa: 2 */
+	u8 pdetrange;	/* support 32 combinations of different Pdet dynamic ranges */
+	u8 triso;		/* TR switch isolation */
+	u8 antswctrllut;	/* antswctrl lookup table configuration: 32 possible choices */
+} wlc_phy_srom_fem_t;
+
 struct wlc_hw_info;
 typedef struct phy_info phy_info_t;
 typedef void (*initfn_t) (phy_info_t *);
@@ -653,8 +660,8 @@ struct phy_info {
 	s8 tx_power_offset[TXP_NUM_RATES];
 	u8 tx_power_target[TXP_NUM_RATES];
 
-	srom_fem_t srom_fem2g;
-	srom_fem_t srom_fem5g;
+	wlc_phy_srom_fem_t srom_fem2g;
+	wlc_phy_srom_fem_t srom_fem5g;
 
 	u8 tx_power_max;
 	u8 tx_power_max_rate_ind;
drivers/staging/brcm80211/include/bcmsrom.h +0 -2
index b2dc895..b9500ec 100644
@@ -17,8 +17,6 @@
 #ifndef	_bcmsrom_h_
 #define	_bcmsrom_h_
 
-#include <bcmsrom_fmt.h>
-
 /* Prototypes */
 extern int srom_var_init(si_t *sih, uint bus, void *curmap,
 			 char **vars, uint *count);
drivers/staging/brcm80211/include/bcmsrom_fmt.h deleted +0 -367

367 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#35 lore raw

PATCH 34/83 staging: brcm80211: cleaned sb* header files

In reply to Roland Vossen

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/bcmchip.h       |    6 -
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |   86 ++
 .../brcm80211/{include => brcmfmac}/sbsdio.h       |    0
 .../brcm80211/{include => brcmfmac}/sbsdpcmdev.h   |   23 +-
 .../staging/brcm80211/{include => brcmfmac}/sdio.h |    0
 drivers/staging/brcm80211/brcmsmac/aiutils.c       |  128 ++
 drivers/staging/brcm80211/brcmsmac/aiutils.h       |   46 +
 drivers/staging/brcm80211/brcmsmac/bcmotp.c        |   31 +
 drivers/staging/brcm80211/brcmsmac/d11.h           |    4 -
 drivers/staging/brcm80211/brcmsmac/dma.c           |  128 ++
 drivers/staging/brcm80211/brcmsmac/nicpci.c        |    3 +
 drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c |    4 +
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c  |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_pmu.c       |  465 +++++++
 drivers/staging/brcm80211/include/sbchipc.h        | 1302 --------------------
 drivers/staging/brcm80211/include/sbconfig.h       |  240 ----
 drivers/staging/brcm80211/include/sbdma.h          |  268 ----
 18 files changed, 913 insertions(+), 1823 deletions(-)
 rename drivers/staging/brcm80211/{include => brcmfmac}/sbsdio.h (100%)
 rename drivers/staging/brcm80211/{include => brcmfmac}/sbsdpcmdev.h (94%)
 rename drivers/staging/brcm80211/{include => brcmfmac}/sdio.h (100%)
drivers/staging/brcm80211/brcmfmac/bcmchip.h +0 -6
index c0d4c3b..08729e1 100644
@@ -17,12 +17,6 @@
 #ifndef _bcmchip_h_
 #define _bcmchip_h_
 
-/* Core reg address translation */
-#define CORE_CC_REG(base, field)	(base + offsetof(chipcregs_t, field))
-#define CORE_BUS_REG(base, field)	(base + offsetof(sdpcmd_regs_t, field))
-#define CORE_SB(base, field) \
-		(base + SBCONFIGOFF + offsetof(sbconfig_t, field))
-
 /* bcm4329 */
 /* SDIO device core, ID 0x829 */
 #define BCM4329_CORE_BUS_BASE		0x18011000
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +86 -0

104 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sbsdio.h renamed from drivers/staging/brcm80211/include/sbsdio.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/sbsdio.h
rename to drivers/staging/brcm80211/brcmfmac/sbsdio.h
drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h renamed from drivers/staging/brcm80211/include/sbsdpcmdev.h +22 -1
similarity index 94%
rename from drivers/staging/brcm80211/include/sbsdpcmdev.h
rename to drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h
index afd3581..76266db 100644
@@ -24,6 +24,19 @@
 #define	PAD		_XSTR(__LINE__)
 #endif				/* PAD */
 
+/* dma registers per channel(xmt or rcv) */
+typedef volatile struct {
+	u32 control;		/* enable, et al */
+	u32 addr;		/* descriptor ring base address (4K aligned) */
+	u32 ptr;		/* last descriptor posted to chip */
+	u32 status;		/* current active descriptor, et al */
+} dma32regs_t;
+
+typedef volatile struct {
+	dma32regs_t xmt;	/* dma tx channel */
+	dma32regs_t rcv;	/* dma rx channel */
+} dma32regp_t;
+
 typedef volatile struct {
 	dma64regs_t xmt;	/* dma tx */
 	u32 PAD[2];
@@ -31,6 +44,14 @@ typedef volatile struct {
 	u32 PAD[2];
 } dma64p_t;
 
+
+typedef volatile struct {	/* diag access */
+	u32 fifoaddr;	/* diag address */
+	u32 fifodatalow;	/* low 32bits of data */
+	u32 fifodatahigh;	/* high 32bits of data */
+	u32 pad;		/* reserved */
+} dma64diag_t;
+
 /* dma64 sdiod corerev >= 1 */
 typedef volatile struct {
 	dma64p_t dma64regs[2];
@@ -144,7 +165,7 @@ typedef volatile struct {
 	u32 PAD[464];
 
 	/* Sonics SiliconBackplane registers */
-	sbconfig_t sbconfig;	/* SbConfig Regs, 0xf00-0xfff, rev8 */
+	u16 PAD[0x80];		/* SbConfig Regs, 0xf00-0xfff, rev8 */
 } sdpcmd_regs_t;
 
 /* corecontrol */
drivers/staging/brcm80211/brcmfmac/sdio.h renamed from drivers/staging/brcm80211/include/sdio.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/sdio.h
rename to drivers/staging/brcm80211/brcmfmac/sdio.h
drivers/staging/brcm80211/brcmsmac/aiutils.c +128 -0

134 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/aiutils.h +46 -0

52 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/bcmotp.c +31 -0
index d01f60a..aa147c3 100644
@@ -29,6 +29,37 @@
 #include <sbchipc.h>
 #include <bcmotp.h>
 
+#define OTPS_GUP_MASK		0x00000f00
+#define OTPS_GUP_SHIFT		8
+#define OTPS_GUP_HW		0x00000100	/* h/w subregion is programmed */
+#define OTPS_GUP_SW		0x00000200	/* s/w subregion is programmed */
+#define OTPS_GUP_CI		0x00000400	/* chipid/pkgopt subregion is programmed */
+#define OTPS_GUP_FUSE		0x00000800	/* fuse subregion is programmed */
+
+/* Fields in otpprog in rev >= 21 and HND OTP */
+#define OTPP_COL_MASK		0x000000ff
+#define OTPP_COL_SHIFT		0
+#define OTPP_ROW_MASK		0x0000ff00
+#define OTPP_ROW_SHIFT		8
+#define OTPP_OC_MASK		0x0f000000
+#define OTPP_OC_SHIFT		24
+#define OTPP_READERR		0x10000000
+#define OTPP_VALUE_MASK		0x20000000
+#define OTPP_VALUE_SHIFT	29
+#define OTPP_START_BUSY		0x80000000
+#define	OTPP_READ		0x40000000	/* HND OTP */
+
+/* Opcodes for OTPP_OC field */
+#define OTPPOC_READ		0
+#define OTPPOC_BIT_PROG		1
+#define OTPPOC_VERIFY		3
+#define OTPPOC_INIT		4
+#define OTPPOC_SET		5
+#define OTPPOC_RESET		6
+#define OTPPOC_OCST		7
+#define OTPPOC_ROW_LOCK		8
+#define OTPPOC_PRESCN_TEST	9
+
 /*
  * There are two different OTP controllers so far:
  * 	1. new IPX OTP controller:	chipc 21, >=23
drivers/staging/brcm80211/brcmsmac/d11.h +0 -4
index e022224..d1babcd 100644
@@ -18,7 +18,6 @@
 #define	_D11_H
 
 #include <linux/ieee80211.h>
-#include <sbconfig.h>
 
 /* cpp contortions to concatenate w/arg prescan */
 #ifndef	PAD
@@ -440,9 +439,6 @@ typedef volatile struct _d11regs {
 
 	/* SHM *//* 0x800 - 0xEFE */
 	u16 PAD[0x380];	/* 0x800 - 0xEFE */
-
-	/* SB configuration registers: 0xF00 */
-	sbconfig_t sbconfig;	/* sb config regs occupy top 256 bytes */
 } d11regs_t;
 
 #define	PIHR_BASE	0x0400	/* byte address of packed IHR region */
drivers/staging/brcm80211/brcmsmac/dma.c +128 -0

140 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/nicpci.c +3 -0
index 51d56b6..806b2ca 100644
@@ -29,6 +29,9 @@
 #include <nicpci.h>
 #include <pcicfg.h>
 
+/* chipcontrol */
+#define CHIPCTRL_4321_PLL_DOWN	0x800000	/* serdes PLL down override */
+
 typedef struct {
 	union {
 		sbpcieregs_t *pcieregs;
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c +4 -0
index 123bd6a..620eb86 100644
@@ -141,6 +141,10 @@
 
 #define NPHY_ADJUSTED_MINCRSPOWER 0x1e
 
+/* 5357 Chip specific ChipControl register bits */
+#define CCTRL5357_EXTPA                 (1<<14)	/* extPA in ChipControl 1, bit 14 */
+#define CCTRL5357_ANT_MUX_2o3		(1<<15)	/* 2o3 in ChipControl 1, bit 15 */
+
 typedef struct _nphy_iqcal_params {
 	u16 txlpf;
 	u16 txgm;
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +0 -1
index ab4ef6c..a7994e4 100644
@@ -29,7 +29,6 @@
 #include <bcmotp.h>
 #include <bcmutils.h>
 #include <bcmnvram.h>
-#include <sbconfig.h>
 #include <sbchipc.h>
 #include <pcicfg.h>
 #include <sbdma.h>
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +0 -1
index c6f9694..7bb122b 100644
@@ -29,7 +29,6 @@
 #include <bcmutils.h>
 #include <bcmwifi.h>
 #include <aiutils.h>
-#include <sbconfig.h>
 #include <sbchipc.h>
 #include <pcicfg.h>
 #include <sbdma.h>
drivers/staging/brcm80211/brcmsmac/wlc_pmu.c +465 -0

474 lines not on this page · raw message

drivers/staging/brcm80211/include/sbchipc.h +0 -1302

1,330 lines not on this page · raw message

drivers/staging/brcm80211/include/sbconfig.h +0 -240

249 lines not on this page · raw message

drivers/staging/brcm80211/include/sbdma.h +0 -268

284 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#36 lore raw

PATCH 35/83 staging: brcm80211: moved header files to more specific directory

In reply to Roland Vossen

Code cleanup. Header files only used by the softmac were moved to the brcmsmac dir, same approach for fullmac header files.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |    1 -
 .../brcm80211/{include => brcmfmac}/bcmsdpcm.h     |    0
 .../brcm80211/{include => brcmsmac}/bcmnvram.h     |    0
 .../brcm80211/{include => brcmsmac}/bcmotp.h       |    0
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c       |    3 +++
 drivers/staging/brcm80211/util/bcmutils.c          |    1 -
 6 files changed, 3 insertions(+), 2 deletions(-)
 rename drivers/staging/brcm80211/{include => brcmfmac}/bcmsdpcm.h (100%)
 rename drivers/staging/brcm80211/{include => brcmsmac}/bcmnvram.h (100%)
 rename drivers/staging/brcm80211/{include => brcmsmac}/bcmotp.h (100%)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +0 -1
index e57dd00..d441500 100644
@@ -24,7 +24,6 @@
 #include <linux/pci.h>
 #include <linux/completion.h>
 
-#include <pcicfg.h>
 #include <bcmdefs.h>
 #include <bcmdevs.h>
 #include <bcmutils.h>
drivers/staging/brcm80211/brcmfmac/bcmsdpcm.h renamed from drivers/staging/brcm80211/include/bcmsdpcm.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/bcmsdpcm.h
rename to drivers/staging/brcm80211/brcmfmac/bcmsdpcm.h
drivers/staging/brcm80211/brcmsmac/bcmnvram.h renamed from drivers/staging/brcm80211/include/bcmnvram.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/bcmnvram.h
rename to drivers/staging/brcm80211/brcmsmac/bcmnvram.h
drivers/staging/brcm80211/brcmsmac/bcmotp.h renamed from drivers/staging/brcm80211/include/bcmotp.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/bcmotp.h
rename to drivers/staging/brcm80211/brcmsmac/bcmotp.h
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +3 -0
index d374673..311bc0c 100644
@@ -362,6 +362,9 @@
 #define SRFL_LEDDC	0x40	/* value is an LED duty cycle */
 #define SRFL_NOVAR	0x80	/* do not generate a nvram param, entry is for mfgc */
 
+/* Max. nvram variable table size */
+#define	MAXSZ_NVRAM_VARS	4096
+
 typedef struct {
 	const char *name;
 	u32 revmask;
drivers/staging/brcm80211/util/bcmutils.c +0 -1
index 63843bc..c23e9b5 100644
@@ -24,7 +24,6 @@
 #include <bcmdefs.h>
 #include <stdarg.h>
 #include <bcmutils.h>
-#include <bcmnvram.h>
 #include <bcmdevs.h>
 
 MODULE_AUTHOR("Broadcom Corporation");
Signature · 1 line
1.7.4.1
#37 lore raw

Re: [PATCH 35/83] staging: brcm80211: moved header files to more specific directory

Quoted 5 lines · Roland Vossen

Code cleanup. Header files only used by the softmac were moved to the brcmsmac dir, same approach for fullmac header files.

Again, should there be some code changes associated with the header file move or am I missing something?

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#38 lore raw

Re: [PATCH 35/83] staging: brcm80211: moved header files to more specific directory

Quoted 8 lines · Julian Calaby
Quoted 5 lines · Roland Vossen

Code cleanup. Header files only used by the softmac were moved to the brcmsmac dir, same approach for fullmac header files.

Again, should there be some code changes associated with the header file move or am I missing something?

Hi Julian,

This change (and 38/83) move the include file from brcm80211/include to brcmfmac or brcmsmac depending which driver is actually using it. So these include files can still be found by the preprocessor and no other changes are needed to make it compile. The remaining issue would be a style issue replacing brackets by quotes. Roland is currently going over all c sources to cleanup file inclusion and the style issue is part of that cleanup. Not sure if this is kind of code change you were expecting. If not please give some more hints ;-)

Gr. AvS

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

Re: [PATCH 35/83] staging: brcm80211: moved header files to more specific directory

Quoted 15 lines · Arend van Spriel
Quoted 11 lines · Julian Calaby
Quoted 6 lines · Roland Vossen

Code cleanup. Header files only used by the softmac were moved to the brcmsmac dir, same approach for fullmac header files.

Again, should there be some code changes associated with the header file move or am I missing something?

Hi Julian,

Quoted 8 lines

This change (and 38/83) move the include file from brcm80211/include to brcmfmac or brcmsmac depending which driver is actually using it. So these include files can still be found by the preprocessor and no other changes are needed to make it compile. The remaining issue would be a style issue replacing brackets by quotes. Roland is currently going over all c sources to cleanup file inclusion and the style issue is part of that cleanup. Not sure if this is kind of code change you were expecting. If not please give some more hints ;-)

I was expecting the header files to be included using a directive like:

#include "includes/bcmotp.h"

Not

#include <bcmotp.h>

as you've done it. I was unaware that you were using the c-flags setting in the Makefile to make that work.

Under my assumption, I was expecting to see a number of changes like:

-#include "includes/bcmotp.h"
+#include "brcmsmac/bcmotp.h"

But now that I have seen the actual code in one of the later patches, I understand what you're doing here.

Sorry for the noise.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#40 lore raw

PATCH 36/83 staging: brcm80211: cleaned bcmdefs.h

In reply to Roland Vossen

Code cleanup.

---
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c       |    1 +
 drivers/staging/brcm80211/brcmsmac/dma.c           |   36 +++++++
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c   |    1 +
 drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c |    1 +
 drivers/staging/brcm80211/brcmsmac/wl_ucode.h      |    2 +
 drivers/staging/brcm80211/brcmsmac/wlc_main.h      |   20 ++++
 drivers/staging/brcm80211/brcmsmac/wlc_pub.h       |    1 +
 drivers/staging/brcm80211/brcmsmac/wlc_types.h     |   18 ++++
 drivers/staging/brcm80211/include/bcmdefs.h        |  108 +-------------------
 9 files changed, 82 insertions(+), 106 deletions(-)
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +1 -0
index 311bc0c..952bc40 100644
@@ -20,6 +20,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <stdarg.h>
+#include "wlc_types.h"
 #include <bcmutils.h>
 #include <bcmsoc.h>
 #include <sbchipc.h>
drivers/staging/brcm80211/brcmsmac/dma.c +36 -0
index 77baef2..611a7e2 100644
@@ -24,6 +24,7 @@
 #include <bcmutils.h>
 #include <aiutils.h>
 
+#include "wlc_types.h"
 #include <sbdma.h>
 #include <bcmdma.h>
 
@@ -148,6 +149,19 @@
 #define D64_RX_FRM_STS_DSCRCNT	0x0f000000  /* no. of descriptors used - 1 */
 #define D64_RX_FRM_STS_DATATYPE	0xf0000000	/* core-dependent data type */
 
+#define	DMADDRWIDTH_30  30	/* 30-bit addressing capability */
+#define	DMADDRWIDTH_32  32	/* 32-bit addressing capability */
+#define	DMADDRWIDTH_63  63	/* 64-bit addressing capability */
+#define	DMADDRWIDTH_64  64	/* 64-bit addressing capability */
+
+/* packet headroom necessary to accommodate the largest header in the system, (i.e TXOFF).
+ * By doing, we avoid the need  to allocate an extra buffer for the header when bridging to WL.
+ * There is a compile time check in wlc.c which ensure that this value is at least as big
+ * as TXOFF. This value is used in dma_rxfill (dma.c).
+ */
+
+#define BCMEXTRAHDROOM 172
+
 /* debug/trace */
 #ifdef BCMDBG
 #define	DMA_ERROR(args) \
@@ -171,6 +185,15 @@
 
 #define	DMA_NONE(args)
 
+typedef unsigned long dmaaddr_t;
+#define PHYSADDRHI(_pa) (0)
+#define PHYSADDRHISET(_pa, _val)
+#define PHYSADDRLO(_pa) ((_pa))
+#define PHYSADDRLOSET(_pa, _val) \
+	do { \
+		(_pa) = (_val);			\
+	} while (0)
+
 #define d64txregs	dregs.d64_u.txregs_64
 #define d64rxregs	dregs.d64_u.rxregs_64
 #define txd64		dregs.d64_u.txd_64
@@ -186,6 +209,19 @@ static uint dma_msg_level;
 #define R_SM(r)		(*(r))
 #define W_SM(r, v)	(*(r) = (v))
 
+/* One physical DMA segment */
+typedef struct {
+	dmaaddr_t addr;
+	u32 length;
+} dma_seg_t;
+
+typedef struct {
+	void *oshdmah;		/* Opaque handle for OSL to store its information */
+	uint origsize;		/* Size of the virtual packet */
+	uint nsegs;
+	dma_seg_t segs[MAX_DMA_SEGS];
+} dma_seg_map_t;
+
 /*
  * DMA Descriptor
  * Descriptors are only read by the hardware, never written back.
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c +1 -0
index 22ba415..1e9865f 100644
@@ -29,6 +29,7 @@
 #include <bcmdevs.h>
 #include <sbdma.h>
 
+#include <wlc_types.h>
 #include <wlc_phy_int.h>
 #include <wlc_phyreg_n.h>
 #include <wlc_phy_radio.h>
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c +1 -0
index 620eb86..78d8cbe 100644
@@ -27,6 +27,7 @@
 #include <bcmdevs.h>
 #include <sbdma.h>
 
+#include <wlc_types.h>
 #include <wlc_phy_radio.h>
 #include <wlc_phy_int.h>
 #include <wlc_phyreg_n.h>
drivers/staging/brcm80211/brcmsmac/wl_ucode.h +2 -0
index 6933fda..28838d8 100644
@@ -14,6 +14,8 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "wlc_types.h"		/* forward structure declarations */
+
 #define MIN_FW_SIZE 40000	/* minimum firmware file size in bytes */
 #define MAX_FW_SIZE 150000
 
drivers/staging/brcm80211/brcmsmac/wlc_main.h +20 -0
index d066339..4e62b11 100644
@@ -47,6 +47,24 @@
 
 #define AC_COUNT		4
 
+/* Macros for doing definition and get/set of bitfields
+ * Usage example, e.g. a three-bit field (bits 4-6):
+ *    #define <NAME>_M	BITFIELD_MASK(3)
+ *    #define <NAME>_S	4
+ * ...
+ *    regval = R_REG(osh, &regs->regfoo);
+ *    field = GFIELD(regval, <NAME>);
+ *    regval = SFIELD(regval, <NAME>, 1);
+ *    W_REG(osh, &regs->regfoo, regval);
+ */
+#define BITFIELD_MASK(width) \
+		(((unsigned)1 << (width)) - 1)
+#define GFIELD(val, field) \
+		(((val) >> field ## _S) & field ## _M)
+#define SFIELD(val, field, bits) \
+		(((val) & (~(field ## _M << field ## _S))) | \
+		 ((unsigned)(bits) << field ## _S))
+
 /* For managing scan result lists */
 struct wlc_bss_list {
 	uint count;
@@ -158,6 +176,8 @@ extern const u8 prio2fifo[];
 #define EDCF_LONG_M             BITFIELD_MASK(4)
 #define EDCF_LFB_M              BITFIELD_MASK(4)
 
+#define	NFIFO			6	/* # tx/rx fifopairs */
+
 #define WLC_WME_RETRY_SHORT_GET(wlc, ac)    GFIELD(wlc->wme_retries[ac], EDCF_SHORT)
 #define WLC_WME_RETRY_SFB_GET(wlc, ac)      GFIELD(wlc->wme_retries[ac], EDCF_SFB)
 #define WLC_WME_RETRY_LONG_GET(wlc, ac)     GFIELD(wlc->wme_retries[ac], EDCF_LONG)
drivers/staging/brcm80211/brcmsmac/wlc_pub.h +1 -0
index bd0885e..0ab16c4 100644
@@ -17,6 +17,7 @@
 #ifndef _wlc_pub_h_
 #define _wlc_pub_h_
 
+#include "wlc_types.h"		/* forward structure declarations */
 #include "bcmwifi.h"		/* for chanspec_t */
 
 #define	WLC_NUMRATES	16	/* max # of rates in a rateset */
drivers/staging/brcm80211/brcmsmac/wlc_types.h +18 -0
index b8cede1..76a1348 100644
@@ -17,7 +17,24 @@
 #ifndef _wlc_types_h_
 #define _wlc_types_h_
 
+/* Bus types */
+#define	SI_BUS			0	/* SOC Interconnect */
+#define	PCI_BUS			1	/* PCI target */
+#define SDIO_BUS		3	/* SDIO target */
+#define JTAG_BUS		4	/* JTAG */
+#define USB_BUS			5	/* USB (does not support R/W REG) */
+#define SPI_BUS			6	/* gSPI target */
+#define RPC_BUS			7	/* RPC target */
+
+#define WL_CHAN_FREQ_RANGE_2G      0
+#define WL_CHAN_FREQ_RANGE_5GL     1
+#define WL_CHAN_FREQ_RANGE_5GM     2
+#define WL_CHAN_FREQ_RANGE_5GH     3
+
+#define MAX_DMA_SEGS 4
+
 /* forward declarations */
+struct wl_info;
 struct wlc_info;
 struct wlc_hw_info;
 struct wlc_if;
@@ -27,5 +44,6 @@ struct antsel_info;
 struct bmac_pmq;
 struct d11init;
 struct dma_pub;
+struct wlc_bsscfg;
 
 #endif				/* _wlc_types_h_ */
drivers/staging/brcm80211/include/bcmdefs.h +2 -106

138 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#41 lore raw

PATCH 37/83 staging: brcm80211: remove usage of pcicfg.h from brcmsmac driver

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

All PCI related definitions needed by the brcmsmac driver are going to be consolidated in single header file nicpci.h. This commit removes need to include pcicfg.h in brcmsmac driver sources.

---
 drivers/staging/brcm80211/brcmsmac/aiutils.c      |    1 -
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c      |    2 +-
 drivers/staging/brcm80211/brcmsmac/nicpci.c       |    3 +-
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c  |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c     |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c     |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c |    2 -
 drivers/staging/brcm80211/include/nicpci.h        |   42 ++++++++++++++++++++-
 8 files changed, 45 insertions(+), 10 deletions(-)
drivers/staging/brcm80211/brcmsmac/aiutils.c +0 -1
index 9aec084..bae40fe 100644
@@ -24,7 +24,6 @@
 #include <aiutils.h>
 #include <bcmsoc.h>
 #include <sbchipc.h>
-#include <pcicfg.h>
 #include <bcmdevs.h>
 
 /* ********** from siutils.c *********** */
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +1 -1
index 952bc40..e0899c8 100644
@@ -25,7 +25,7 @@
 #include <bcmsoc.h>
 #include <sbchipc.h>
 #include <bcmdevs.h>
-#include <pcicfg.h>
+#include <nicpci.h>
 #include <aiutils.h>
 #include <bcmsrom.h>
 
drivers/staging/brcm80211/brcmsmac/nicpci.c +1 -2
index 806b2ca..a96173d 100644
@@ -27,7 +27,6 @@
 #include <pci_core.h>
 #include <pcie_core.h>
 #include <nicpci.h>
-#include <pcicfg.h>
 
 /* chipcontrol */
 #define CHIPCTRL_4321_PLL_DOWN	0x800000	/* serdes PLL down override */
@@ -83,7 +82,7 @@ static bool pcicore_pmecap(pcicore_info_t *pi);
 /* Initialize the PCI core. It's caller's responsibility to make sure that this is done
  * only once
  */
-void *pcicore_init(si_t *sih, void *pdev, void *regs)
+void *pcicore_init(struct si_pub *sih, void *pdev, void *regs)
 {
 	pcicore_info_t *pi;
 
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +1 -1
index 3d9f791..ee026d3 100644
@@ -29,7 +29,7 @@
 #include <bcmwifi.h>
 #include <bcmutils.h>
 #include <bcmnvram.h>
-#include <pcicfg.h>
+#include <nicpci.h>
 #include <sbdma.h>
 
 #include "phy/wlc_phy_int.h"
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +1 -1
index a7994e4..2ee0785 100644
@@ -30,7 +30,7 @@
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include <sbchipc.h>
-#include <pcicfg.h>
+#include <nicpci.h>
 #include <sbdma.h>
 #include <bcmdma.h>
 
drivers/staging/brcm80211/brcmsmac/wlc_main.c +0 -1
index c50f335..18a5463 100644
@@ -25,7 +25,6 @@
 #include <bcmwifi.h>
 #include <bcmnvram.h>
 #include <aiutils.h>
-#include <pcicfg.h>
 #include <bcmsrom.h>
 #include <sbdma.h>
 #include <bcmdma.h>
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +0 -2
index 7bb122b..c94b459 100644
@@ -23,14 +23,12 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/pci.h>
 
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <bcmwifi.h>
 #include <aiutils.h>
 #include <sbchipc.h>
-#include <pcicfg.h>
 #include <sbdma.h>
 #include <bcmdma.h>
 #include <wlc_pmu.h>
drivers/staging/brcm80211/include/nicpci.h +41 -1

55 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#42 lore raw

PATCH 38/83 staging: brcm80211: move PCI related header files to appropriate driver folder

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The include file pcicfg.h is now only required by brcmfmac driver. Similarly, nicpci.h is only required by brcmsmac driver. These header files have been moved to the appropriate driver specific folder.

---
 .../brcm80211/{include => brcmfmac}/pcicfg.h       |    0
 .../brcm80211/{include => brcmsmac}/nicpci.h       |    0
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename drivers/staging/brcm80211/{include => brcmfmac}/pcicfg.h (100%)
 rename drivers/staging/brcm80211/{include => brcmsmac}/nicpci.h (100%)
drivers/staging/brcm80211/brcmfmac/pcicfg.h renamed from drivers/staging/brcm80211/include/pcicfg.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/pcicfg.h
rename to drivers/staging/brcm80211/brcmfmac/pcicfg.h
drivers/staging/brcm80211/brcmsmac/nicpci.h renamed from drivers/staging/brcm80211/include/nicpci.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/nicpci.h
rename to drivers/staging/brcm80211/brcmsmac/nicpci.h
Signature · 1 line
1.7.4.1
#43 lore raw

Re: [PATCH 38/83] staging: brcm80211: move PCI related header files to appropriate driver folder

Quoted 8 lines · Roland Vossen

From: Arend van Spriel <[email protected]>

The include file pcicfg.h is now only required by brcmfmac driver. Similarly, nicpci.h is only required by brcmsmac driver. These header files have been moved to the appropriate driver specific folder.

Should there be any code changes associated with this?

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#44 lore raw

PATCH 39/83 staging: brcm80211: remove functions from nicpci.h

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

Couple of functions in the header file are actually only used by nicpci.c itself and as such made static and removed from the header file.

---
 drivers/staging/brcm80211/brcmsmac/nicpci.c |    6 +++---
 drivers/staging/brcm80211/brcmsmac/nicpci.h |    6 ------
 2 files changed, 3 insertions(+), 9 deletions(-)
drivers/staging/brcm80211/brcmsmac/nicpci.c +3 -3
index a96173d..4da155a 100644
@@ -180,7 +180,7 @@ pcicore_find_pci_capability(void *dev, u8 req_cap_id,
 }
 
 /* ***** Register Access API */
-uint
+static uint
 pcie_readreg(sbpcieregs_t *pcieregs, uint addrtype,
 	     uint offset)
 {
@@ -204,7 +204,7 @@ pcie_readreg(sbpcieregs_t *pcieregs, uint addrtype,
 	return retval;
 }
 
-uint
+static uint
 pcie_writereg(sbpcieregs_t *pcieregs, uint addrtype,
 	      uint offset, uint val)
 {
@@ -329,7 +329,7 @@ pcie_mdiowrite(pcicore_info_t *pi, uint physmedia, uint regaddr, uint val)
 }
 
 /* ***** Support functions ***** */
-u8 pcie_clkreq(void *pch, u32 mask, u32 val)
+static u8 pcie_clkreq(void *pch, u32 mask, u32 val)
 {
 	pcicore_info_t *pi = (pcicore_info_t *) pch;
 	u32 reg_val;
drivers/staging/brcm80211/brcmsmac/nicpci.h +0 -6
index e9058c6..a6baf7f 100644
@@ -56,17 +56,11 @@
 /* bar0 + 12K accesses chipc core registers */
 #define PCI_16KB0_CCREGS_OFFSET	(12 * 1024)
 
-struct sbpcieregs;
 struct si_pub;
 
 extern u8 pcicore_find_pci_capability(void *dev, u8 req_cap_id,
 					 unsigned char *buf, u32 *buflen);
-extern uint pcie_readreg(struct sbpcieregs *pcieregs,
-			 uint addrtype, uint offset);
-extern uint pcie_writereg(struct sbpcieregs *pcieregs,
-			  uint addrtype, uint offset, uint val);
 
-extern u8 pcie_clkreq(void *pch, u32 mask, u32 val);
 extern u32 pcie_lcreg(void *pch, u32 mask, u32 val);
 
 extern void *pcicore_init(struct si_pub *sih, void *pdev, void *regs);
Signature · 1 line
1.7.4.1
#45 lore raw

PATCH 40/83 staging: brcm80211: remove unused functions from nicpci.c

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

Several functions are defined but not used. These have been removed.

---
 drivers/staging/brcm80211/brcmsmac/nicpci.c |  182 ---------------------------
 drivers/staging/brcm80211/brcmsmac/nicpci.h |   19 +---
 2 files changed, 2 insertions(+), 199 deletions(-)
drivers/staging/brcm80211/brcmsmac/nicpci.c +0 -182
index 4da155a..196cdf1 100644
@@ -71,8 +71,6 @@ static void pcie_war_noplldown(pcicore_info_t *pi);
 static void pcie_war_polarity(pcicore_info_t *pi);
 static void pcie_war_pci_setup(pcicore_info_t *pi);
 
-static bool pcicore_pmecap(pcicore_info_t *pi);
-
 #define PCIE_ASPM(sih)	((PCIE_PUB(sih)) && (((sih)->buscorerev >= 3) && ((sih)->buscorerev <= 5)))
 
 
@@ -579,23 +577,6 @@ static void pcie_war_pci_setup(pcicore_info_t *pi)
 		pcie_misc_config_fixup(pi);
 }
 
-void pcie_war_ovr_aspm_update(void *pch, u8 aspm)
-{
-	pcicore_info_t *pi = (pcicore_info_t *) pch;
-
-	if (!PCIE_ASPM(pi->sih))
-		return;
-
-	/* Validate */
-	if (aspm > PCIE_ASPM_ENAB)
-		return;
-
-	pi->pcie_war_aspm_ovr = aspm;
-
-	/* Update the current state */
-	pcie_war_aspm_clkreq(pi);
-}
-
 /* ***** Functions called during driver state changes ***** */
 void pcicore_attach(void *pch, char *pvars, int state)
 {
@@ -673,166 +654,3 @@ void pcicore_down(void *pch, int state)
 	/* Reduce L1 timer for better power savings */
 	pcie_extendL1timer(pi, false);
 }
-
-/* ***** Wake-on-wireless-LAN (WOWL) support functions ***** */
-/* Just uses PCI config accesses to find out, when needed before sb_attach is done */
-bool pcicore_pmecap_fast(void *pch)
-{
-	pcicore_info_t *pi = (pcicore_info_t *) pch;
-	u8 cap_ptr;
-	u32 pmecap;
-
-	cap_ptr = pcicore_find_pci_capability(pi->dev, PCI_CAP_ID_PM, NULL,
-					      NULL);
-
-	if (!cap_ptr)
-		return false;
-
-	pci_read_config_dword(pi->dev, cap_ptr, &pmecap);
-
-	return (pmecap & (PCI_PM_CAP_PME_MASK << 16)) != 0;
-}
-
-/* return true if PM capability exists in the pci config space
- * Uses and caches the information using core handle
- */
-static bool pcicore_pmecap(pcicore_info_t *pi)
-{
-	u8 cap_ptr;
-	u32 pmecap;
-
-	if (!pi->pmecap_offset) {
-		cap_ptr = pcicore_find_pci_capability(pi->dev,
-						      PCI_CAP_ID_PM,
-						      NULL, NULL);
-		if (!cap_ptr)
-			return false;
-
-		pi->pmecap_offset = cap_ptr;
-
-		pci_read_config_dword(pi->dev, pi->pmecap_offset,
-					&pmecap);
-
-		/* At least one state can generate PME */
-		pi->pmecap = (pmecap & (PCI_PM_CAP_PME_MASK << 16)) != 0;
-	}
-
-	return pi->pmecap;
-}
-
-/* Enable PME generation */
-void pcicore_pmeen(void *pch)
-{
-	pcicore_info_t *pi = (pcicore_info_t *) pch;
-	u32 w;
-
-	/* if not pmecapable return */
-	if (!pcicore_pmecap(pi))
-		return;
-
-	pci_read_config_dword(pi->dev, pi->pmecap_offset + PCI_PM_CTRL,
-				&w);
-	w |= (PCI_PM_CTRL_PME_ENABLE);
-	pci_write_config_dword(pi->dev,
-				pi->pmecap_offset + PCI_PM_CTRL, w);
-}
-
-/*
- * Return true if PME status set
- */
-bool pcicore_pmestat(void *pch)
-{
-	pcicore_info_t *pi = (pcicore_info_t *) pch;
-	u32 w;
-
-	if (!pcicore_pmecap(pi))
-		return false;
-
-	pci_read_config_dword(pi->dev, pi->pmecap_offset + PCI_PM_CTRL,
-				&w);
-
-	return (w & PCI_PM_CTRL_PME_STATUS) == PCI_PM_CTRL_PME_STATUS;
-}
-
-/* Disable PME generation, clear the PME status bit if set
- */
-void pcicore_pmeclr(void *pch)
-{
-	pcicore_info_t *pi = (pcicore_info_t *) pch;
-	u32 w;
-
-	if (!pcicore_pmecap(pi))
-		return;
-
-	pci_read_config_dword(pi->dev, pi->pmecap_offset + PCI_PM_CTRL,
-				&w);
-
-	PCI_ERROR(("pcicore_pci_pmeclr PMECSR : 0x%x\n", w));
-
-	/* PMESTAT is cleared by writing 1 to it */
-	w &= ~(PCI_PM_CTRL_PME_ENABLE);
-
-	pci_write_config_dword(pi->dev,
-				pi->pmecap_offset + PCI_PM_CTRL, w);
-}
-
-u32 pcie_lcreg(void *pch, u32 mask, u32 val)
-{
-	pcicore_info_t *pi = (pcicore_info_t *) pch;
-	u8 offset;
-	u32 tmpval;
-
-	offset = pi->pciecap_lcreg_offset;
-	if (!offset)
-		return 0;
-
-	/* set operation */
-	if (mask)
-		pci_write_config_dword(pi->dev, offset, val);
-
-	pci_read_config_dword(pi->dev, offset, &tmpval);
-	return tmpval;
-}
-
-u32
-pcicore_pciereg(void *pch, u32 offset, u32 mask, u32 val, uint type)
-{
-	u32 reg_val = 0;
-	pcicore_info_t *pi = (pcicore_info_t *) pch;
-	sbpcieregs_t *pcieregs = pi->regs.pcieregs;
-
-	if (mask) {
-		PCI_ERROR(("PCIEREG: 0x%x writeval  0x%x\n", offset, val));
-		pcie_writereg(pcieregs, type, offset, val);
-	}
-
-	/* Should not read register 0x154 */
-	if (pi->sih->buscorerev <= 5 && offset == PCIE_DLLP_PCIE11
-	    && type == PCIE_PCIEREGS)
-		return reg_val;
-
-	reg_val = pcie_readreg(pcieregs, type, offset);
-	PCI_ERROR(("PCIEREG: 0x%x readval is 0x%x\n", offset, reg_val));
-
-	return reg_val;
-}
-
-u32
-pcicore_pcieserdesreg(void *pch, u32 mdioslave, u32 offset, u32 mask,
-		      u32 val)
-{
-	u32 reg_val = 0;
-	pcicore_info_t *pi = (pcicore_info_t *) pch;
-
-	if (mask) {
-		PCI_ERROR(("PCIEMDIOREG: 0x%x writeval  0x%x\n", offset, val));
-		pcie_mdiowrite(pi, mdioslave, offset, val);
-	}
-
-	if (pcie_mdioread(pi, mdioslave, offset, &reg_val))
-		reg_val = 0xFFFFFFFF;
-	PCI_ERROR(("PCIEMDIOREG: dev 0x%x offset 0x%x read 0x%x\n", mdioslave,
-		   offset, reg_val));
-
-	return reg_val;
-}
drivers/staging/brcm80211/brcmsmac/nicpci.h +2 -17
index a6baf7f..b32f1af 100644
@@ -58,11 +58,6 @@
 
 struct si_pub;
 
-extern u8 pcicore_find_pci_capability(void *dev, u8 req_cap_id,
-					 unsigned char *buf, u32 *buflen);
-
-extern u32 pcie_lcreg(void *pch, u32 mask, u32 val);
-
 extern void *pcicore_init(struct si_pub *sih, void *pdev, void *regs);
 extern void pcicore_deinit(void *pch);
 extern void pcicore_attach(void *pch, char *pvars, int state);
@@ -70,17 +65,7 @@ extern void pcicore_hwup(void *pch);
 extern void pcicore_up(void *pch, int state);
 extern void pcicore_sleep(void *pch);
 extern void pcicore_down(void *pch, int state);
-
-extern void pcie_war_ovr_aspm_update(void *pch, u8 aspm);
-extern u32 pcicore_pcieserdesreg(void *pch, u32 mdioslave, u32 offset,
-				    u32 mask, u32 val);
-
-extern u32 pcicore_pciereg(void *pch, u32 offset, u32 mask,
-			      u32 val, uint type);
-
-extern bool pcicore_pmecap_fast(void *pch);
-extern void pcicore_pmeen(void *pch);
-extern void pcicore_pmeclr(void *pch);
-extern bool pcicore_pmestat(void *pch);
+extern u8 pcicore_find_pci_capability(void *dev, u8 req_cap_id,
+					 unsigned char *buf, u32 *buflen);
 
 #endif /* _NICPCI_H */
Signature · 1 line
1.7.4.1
#46 lore raw

PATCH 41/83 staging: brcm80211: add braces to SI_INFO macro definition

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The additional braces allow the casted parameter to be indirected immediately. Here is an example to clarify:

	x = SI_INFO(y);    => z = SI_INFO(y)->field_a;
	z = x->field_a;
---
 drivers/staging/brcm80211/brcmsmac/aiutils.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/brcm80211/brcmsmac/aiutils.h +1 -1
index 2941537..a0fec83 100644
@@ -271,7 +271,7 @@
 #define	CST4330_CBUCK_POWER_OK		0x00004000
 #define	CST4330_BB_PLL_LOCKED		0x00008000
 
-#define	SI_INFO(sih)	(si_info_t *)sih
+#define	SI_INFO(sih)	((si_info_t *)sih)
 
 #define	GOODCOREADDR(x, b) \
 	(((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
Signature · 1 line
1.7.4.1
#47 lore raw

PATCH 42/83 staging: brcm80211: remove dependency on pci core difinitions from aiutils.c

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The file aiutils.c included the register definition includes for the PCI and PCIe core. This was for two functions which have been partly moved to nicpci.c. This means that nicpci.h is the only include file to provide interface to aiutils.c for PCI core related functions.

---
 drivers/staging/brcm80211/brcmsmac/aiutils.c |   41 +++------------------
 drivers/staging/brcm80211/brcmsmac/nicpci.c  |   50 ++++++++++++++++++++++++++
 drivers/staging/brcm80211/brcmsmac/nicpci.h  |    2 +
 3 files changed, 58 insertions(+), 35 deletions(-)
drivers/staging/brcm80211/brcmsmac/aiutils.c +6 -35
index bae40fe..43320b4 100644
@@ -27,8 +27,6 @@
 #include <bcmdevs.h>
 
 /* ********** from siutils.c *********** */
-#include <pci_core.h>
-#include <pcie_core.h>
 #include <nicpci.h>
 #include <bcmnvram.h>
 #include <bcmsrom.h>
@@ -1915,7 +1913,7 @@ void ai_pci_down(si_t *sih)
 void ai_pci_setup(si_t *sih, uint coremask)
 {
 	si_info_t *sii;
-	struct sbpciregs *pciregs = NULL;
+	void *regs = NULL;
 	u32 siflag = 0, w;
 	uint idx = 0;
 
@@ -1932,7 +1930,7 @@ void ai_pci_setup(si_t *sih, uint coremask)
 		siflag = ai_flag(sih);
 
 		/* switch over to pci core */
-		pciregs = ai_setcoreidx(sih, sii->pub.buscoreidx);
+		regs = ai_setcoreidx(sih, sii->pub.buscoreidx);
 	}
 
 	/*
@@ -1950,16 +1948,7 @@ void ai_pci_setup(si_t *sih, uint coremask)
 	}
 
 	if (PCI(sii)) {
-		OR_REG(&pciregs->sbtopci2,
-		       (SBTOPCI_PREF | SBTOPCI_BURST));
-		if (sii->pub.buscorerev >= 11) {
-			OR_REG(&pciregs->sbtopci2,
-			       SBTOPCI_RC_READMULTI);
-			w = R_REG(&pciregs->clkrun);
-			W_REG(&pciregs->clkrun,
-			      (w | PCI_CLKRUN_DSBL));
-			w = R_REG(&pciregs->clkrun);
-		}
+		pcicore_pci_setup(sii->pch, regs);
 
 		/* switch back to previous core */
 		ai_setcoreidx(sih, idx);
@@ -1972,11 +1961,8 @@ void ai_pci_setup(si_t *sih, uint coremask)
  */
 int ai_pci_fixcfg(si_t *sih)
 {
-	uint origidx, pciidx;
-	struct sbpciregs *pciregs = NULL;
-	sbpcieregs_t *pcieregs = NULL;
+	uint origidx;
 	void *regs = NULL;
-	u16 val16, *reg16 = NULL;
 
 	si_info_t *sii = SI_INFO(sih);
 
@@ -1985,23 +1971,8 @@ int ai_pci_fixcfg(si_t *sih)
 	origidx = ai_coreidx(&sii->pub);
 
 	/* check 'pi' is correct and fix it if not */
-	if (sii->pub.buscoretype == PCIE_CORE_ID) {
-		pcieregs = ai_setcore(&sii->pub, PCIE_CORE_ID, 0);
-		regs = pcieregs;
-		reg16 = &pcieregs->sprom[SRSH_PI_OFFSET];
-	} else if (sii->pub.buscoretype == PCI_CORE_ID) {
-		pciregs = ai_setcore(&sii->pub, PCI_CORE_ID, 0);
-		regs = pciregs;
-		reg16 = &pciregs->sprom[SRSH_PI_OFFSET];
-	}
-	pciidx = ai_coreidx(&sii->pub);
-	val16 = R_REG(reg16);
-	if (((val16 & SRSH_PI_MASK) >> SRSH_PI_SHIFT) != (u16) pciidx) {
-		val16 =
-		    (u16) (pciidx << SRSH_PI_SHIFT) | (val16 &
-							  ~SRSH_PI_MASK);
-		W_REG(reg16, val16);
-	}
+	regs = ai_setcore(&sii->pub, sii->pub.buscoretype, 0);
+	pcicore_fixcfg(sii->pch, regs);
 
 	/* restore the original index */
 	ai_setcoreidx(&sii->pub, origidx);
drivers/staging/brcm80211/brcmsmac/nicpci.c +50 -0

53 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/nicpci.h +2 -0
index b32f1af..f1441c5 100644
@@ -67,5 +67,7 @@ extern void pcicore_sleep(void *pch);
 extern void pcicore_down(void *pch, int state);
 extern u8 pcicore_find_pci_capability(void *dev, u8 req_cap_id,
 					 unsigned char *buf, u32 *buflen);
+extern void pcicore_fixcfg(void *pch, void *regs);
+extern void pcicore_pci_setup(void *pch, void *regs);
 
 #endif /* _NICPCI_H */
Signature · 1 line
1.7.4.1
#48 lore raw

Re: [PATCH 42/83] staging: brcm80211: remove dependency on pci core difinitions from aiutils.c

Quoted 15 lines · Roland Vossen

From: Arend van Spriel <[email protected]>

The file aiutils.c included the register definition includes for the PCI and PCIe core. This was for two functions which have been partly moved to nicpci.c. This means that nicpci.h is the only include file to provide interface to aiutils.c for PCI core related functions.

---

drivers/staging/brcm80211/brcmsmac/aiutils.c +0 -0
index bae40fe..43320b4 100644

drivers/staging/brcm80211/brcmsmac/aiutils.c void ai_pci_down(si_t *sih) · line 1919

Quoted 8 lines
drivers/staging/brcm80211/brcmsmac/aiutils.c +1 -1
@@ -1915,7 +1913,7 @@ void ai_pci_down(si_t *sih)
  void ai_pci_setup(si_t *sih, uint coremask)
  {
        si_info_t *sii;
-       struct sbpciregs *pciregs = NULL;
+       void *regs = NULL;
        u32 siflag = 0, w;
        uint idx = 0;
 

Is changing this to void* necessarily a good idea? - the regs variable appears to only be used by PCI code, so having it declared as a struct sdpciregs* isn't going to make it any less generic - and having it declared as a structure would help to spot bugs in the code.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#49 lore raw

Re: [PATCH 42/83] staging: brcm80211: remove dependency on pci core difinitions from aiutils.c

Quoted 29 lines · Julian Calaby
Quoted 15 lines · Roland Vossen

From: Arend van Spriel<[email protected]>

The file aiutils.c included the register definition includes for the PCI and PCIe core. This was for two functions which have been partly moved to nicpci.c. This means that nicpci.h is the only include file to provide interface to aiutils.c for PCI core related functions.

---

drivers/staging/brcm80211/brcmsmac/aiutils.c +0 -0
index bae40fe..43320b4 100644

drivers/staging/brcm80211/brcmsmac/aiutils.c void ai_pci_down(si_t *sih) · line 1919

Quoted 8 lines
drivers/staging/brcm80211/brcmsmac/aiutils.c +1 -1
@@ -1915,7 +1913,7 @@ void ai_pci_down(si_t *sih)
  void ai_pci_setup(si_t *sih, uint coremask)
  {
        si_info_t *sii;
-       struct sbpciregs *pciregs = NULL;
+       void *regs = NULL;
        u32 siflag = 0, w;
        uint idx = 0;
 

Is changing this to void* necessarily a good idea? - the regs variable appears to only be used by PCI code, so having it declared as a struct sdpciregs* isn't going to make it any less generic - and having it declared as a structure would help to spot bugs in the code.

Quoted 1 line

Thanks,

Hi Julian,

The separation I tried to accomplish was to have the knowledge of the pci core register layout in one file, ie. nicpci.c. So this step is to make aiutils.c unaware of that layout. Another solution would be to move the function itself to nicpci.c. I will look into this as tend to agree with you.

Gr. AvS

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

PATCH 43/83 staging: brcm80211: remove pci core defintion files

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

The source file nicpci.c is the only file left which needs the pci core register definitions. These definitions have been added to the source file so the include files can be removed.

---
 drivers/staging/brcm80211/brcmsmac/nicpci.c   |  160 +++++++++++++-
 drivers/staging/brcm80211/brcmsmac/nicpci.h   |   12 +
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c |    1 -
 drivers/staging/brcm80211/include/pci_core.h  |  122 ----------
 drivers/staging/brcm80211/include/pcie_core.h |  299 -------------------------
 5 files changed, 170 insertions(+), 424 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/include/pci_core.h
 delete mode 100644 drivers/staging/brcm80211/include/pcie_core.h
drivers/staging/brcm80211/brcmsmac/nicpci.c +158 -2
index c509c9a..e1612ec 100644
@@ -24,13 +24,169 @@
 #include <bcmsoc.h>
 #include <bcmdevs.h>
 #include <sbchipc.h>
-#include <pci_core.h>
-#include <pcie_core.h>
 #include <nicpci.h>
 
+/* SPROM offsets */
+#define SRSH_ASPM_OFFSET		4	/* word 4 */
+#define SRSH_ASPM_ENB			0x18	/* bit 3, 4 */
+#define SRSH_ASPM_L1_ENB		0x10	/* bit 4 */
+#define SRSH_ASPM_L0s_ENB		0x8	/* bit 3 */
+
+#define SRSH_PCIE_MISC_CONFIG		5	/* word 5 */
+#define SRSH_L23READY_EXIT_NOPERST	0x8000	/* bit 15 */
+#define SRSH_CLKREQ_OFFSET_REV5		20	/* word 20 for srom rev <= 5 */
+#define SRSH_CLKREQ_ENB			0x0800	/* bit 11 */
+#define SRSH_BD_OFFSET                  6	/* word 6 */
+
 /* chipcontrol */
 #define CHIPCTRL_4321_PLL_DOWN	0x800000	/* serdes PLL down override */
 
+/* MDIO control */
+#define MDIOCTL_DIVISOR_MASK		0x7f	/* clock to be used on MDIO */
+#define MDIOCTL_DIVISOR_VAL		0x2
+#define MDIOCTL_PREAM_EN		0x80	/* Enable preamble sequnce */
+#define MDIOCTL_ACCESS_DONE		0x100	/* Tranaction complete */
+
+/* MDIO Data */
+#define MDIODATA_MASK			0x0000ffff	/* data 2 bytes */
+#define MDIODATA_TA			0x00020000	/* Turnaround */
+#define MDIODATA_REGADDR_SHF_OLD	18	/* Regaddr shift (rev < 10) */
+#define MDIODATA_REGADDR_MASK_OLD	0x003c0000	/* Regaddr Mask (rev < 10) */
+#define MDIODATA_DEVADDR_SHF_OLD	22	/* Physmedia devaddr shift (rev < 10) */
+#define MDIODATA_DEVADDR_MASK_OLD	0x0fc00000	/* Physmedia devaddr Mask (rev < 10) */
+#define MDIODATA_REGADDR_SHF		18	/* Regaddr shift */
+#define MDIODATA_REGADDR_MASK		0x007c0000	/* Regaddr Mask */
+#define MDIODATA_DEVADDR_SHF		23	/* Physmedia devaddr shift */
+#define MDIODATA_DEVADDR_MASK		0x0f800000	/* Physmedia devaddr Mask */
+#define MDIODATA_WRITE			0x10000000	/* write Transaction */
+#define MDIODATA_READ			0x20000000	/* Read Transaction */
+#define MDIODATA_START			0x40000000	/* start of Transaction */
+
+#define MDIODATA_DEV_ADDR		0x0	/* dev address for serdes */
+#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 */
+
+	/* SERDES RX registers */
+#define SERDES_RX_CTRL			1	/* Rx cntrl */
+#define SERDES_RX_TIMER1		2	/* Rx Timer1 */
+#define SERDES_RX_CDR			6	/* CDR */
+#define SERDES_RX_CDRBW			7	/* CDR BW */
+	/* SERDES RX control register */
+#define SERDES_RX_CTRL_FORCE		0x80	/* rxpolarity_force */
+#define SERDES_RX_CTRL_POLARITY		0x40	/* rxpolarity_value */
+
+	/* SERDES PLL registers */
+#define SERDES_PLL_CTRL                 1	/* PLL control reg */
+#define PLL_CTRL_FREQDET_EN             0x4000	/* bit 14 is FREQDET on */
+
+/* Linkcontrol reg offset in PCIE Cap */
+#define PCIE_CAP_LINKCTRL_OFFSET	16	/* linkctrl offset in pcie cap */
+#define PCIE_CAP_LCREG_ASPML0s		0x01	/* ASPM L0s in linkctrl */
+#define PCIE_CAP_LCREG_ASPML1		0x02	/* ASPM L1 in linkctrl */
+#define PCIE_CLKREQ_ENAB		0x100	/* CLKREQ Enab in linkctrl */
+
+#define PCIE_ASPM_ENAB			3	/* ASPM L0s & L1 in linkctrl */
+#define PCIE_ASPM_L1_ENAB		2	/* ASPM L0s & L1 in linkctrl */
+#define PCIE_ASPM_L0s_ENAB		1	/* ASPM L0s & L1 in linkctrl */
+#define PCIE_ASPM_DISAB			0	/* ASPM L0s & L1 in linkctrl */
+
+/* Power management threshold */
+#define PCIE_L1THRESHOLDTIME_MASK       0xFF00	/* bits 8 - 15 */
+#define PCIE_L1THRESHOLDTIME_SHIFT      8	/* PCIE_L1THRESHOLDTIME_SHIFT */
+#define PCIE_L1THRESHOLD_WARVAL         0x72	/* WAR value */
+#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 */
+
+/* PCIE protocol PHY diagnostic registers */
+#define	PCIE_PLP_STATUSREG		0x204	/* Status */
+
+/* Status reg PCIE_PLP_STATUSREG */
+#define PCIE_PLP_POLARITYINV_STAT	0x10
+
+/* PCIE protocol DLLP diagnostic registers */
+#define PCIE_DLLP_LCREG			0x100	/* Link Control */
+#define PCIE_DLLP_PMTHRESHREG		0x128	/* Power Management Threshold */
+
+/* PCIE protocol TLP diagnostic registers */
+#define PCIE_TLP_WORKAROUNDSREG		0x004	/* TLP Workarounds */
+
+/* cpp contortions to concatenate w/arg prescan */
+#ifndef PAD
+#define	_PADLINE(line)	pad ## line
+#define	_XSTR(line)	_PADLINE(line)
+#define	PAD		_XSTR(__LINE__)
+#endif
+
+/* Sonics side: PCI core and host control registers */
+struct sbpciregs {
+	u32 control;		/* PCI control */
+	u32 PAD[3];
+	u32 arbcontrol;	/* PCI arbiter control */
+	u32 clkrun;		/* Clkrun Control (>=rev11) */
+	u32 PAD[2];
+	u32 intstatus;	/* Interrupt status */
+	u32 intmask;		/* Interrupt mask */
+	u32 sbtopcimailbox;	/* Sonics to PCI mailbox */
+	u32 PAD[9];
+	u32 bcastaddr;	/* Sonics broadcast address */
+	u32 bcastdata;	/* Sonics broadcast data */
+	u32 PAD[2];
+	u32 gpioin;		/* ro: gpio input (>=rev2) */
+	u32 gpioout;		/* rw: gpio output (>=rev2) */
+	u32 gpioouten;	/* rw: gpio output enable (>= rev2) */
+	u32 gpiocontrol;	/* rw: gpio control (>= rev2) */
+	u32 PAD[36];
+	u32 sbtopci0;	/* Sonics to PCI translation 0 */
+	u32 sbtopci1;	/* Sonics to PCI translation 1 */
+	u32 sbtopci2;	/* Sonics to PCI translation 2 */
+	u32 PAD[189];
+	u32 pcicfg[4][64];	/* 0x400 - 0x7FF, PCI Cfg Space (>=rev8) */
+	u16 sprom[36];	/* SPROM shadow Area */
+	u32 PAD[46];
+};
+
+/* SB side: PCIE core and host control registers */
+typedef struct sbpcieregs {
+	u32 control;		/* host mode only */
+	u32 PAD[2];
+	u32 biststatus;	/* bist Status: 0x00C */
+	u32 gpiosel;		/* PCIE gpio sel: 0x010 */
+	u32 gpioouten;	/* PCIE gpio outen: 0x14 */
+	u32 PAD[2];
+	u32 intstatus;	/* Interrupt status: 0x20 */
+	u32 intmask;		/* Interrupt mask: 0x24 */
+	u32 sbtopcimailbox;	/* sb to pcie mailbox: 0x028 */
+	u32 PAD[53];
+	u32 sbtopcie0;	/* sb to pcie translation 0: 0x100 */
+	u32 sbtopcie1;	/* sb to pcie translation 1: 0x104 */
+	u32 sbtopcie2;	/* sb to pcie translation 2: 0x108 */
+	u32 PAD[5];
+
+	/* pcie core supports in direct access to config space */
+	u32 configaddr;	/* pcie config space access: Address field: 0x120 */
+	u32 configdata;	/* pcie config space access: Data field: 0x124 */
+
+	/* mdio access to serdes */
+	u32 mdiocontrol;	/* controls the mdio access: 0x128 */
+	u32 mdiodata;	/* Data to the mdio access: 0x12c */
+
+	/* pcie protocol phy/dllp/tlp register indirect access mechanism */
+	u32 pcieindaddr;	/* indirect access to the internal register: 0x130 */
+	u32 pcieinddata;	/* Data to/from the internal regsiter: 0x134 */
+
+	u32 clkreqenctrl;	/* >= rev 6, Clkreq rdma control : 0x138 */
+	u32 PAD[177];
+	u32 pciecfg[4][64];	/* 0x400 - 0x7FF, PCIE Cfg Space */
+	u16 sprom[64];	/* SPROM shadow Area */
+} sbpcieregs_t;
+
 typedef struct {
 	union {
 		sbpcieregs_t *pcieregs;
drivers/staging/brcm80211/brcmsmac/nicpci.h +12 -0
index f1441c5..0e65b11 100644
@@ -56,6 +56,18 @@
 /* bar0 + 12K accesses chipc core registers */
 #define PCI_16KB0_CCREGS_OFFSET	(12 * 1024)
 
+#define PCI_CLKRUN_DSBL	0x8000	/* Bit 15 forceClkrun */
+
+/* Sonics to PCI translation types */
+#define	SBTOPCI_PREF	0x4		/* prefetch enable */
+#define	SBTOPCI_BURST	0x8		/* burst enable */
+#define	SBTOPCI_RC_READMULTI	0x20	/* memory read multiple */
+
+/* PCI core index in SROM shadow area */
+#define SRSH_PI_OFFSET	0	/* first word */
+#define SRSH_PI_MASK	0xf000	/* bit 15:12 */
+#define SRSH_PI_SHIFT	12	/* bit 15:12 */
+
 struct si_pub;
 
 extern void *pcicore_init(struct si_pub *sih, void *pdev, void *regs);
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +0 -1
index 2ee0785..d069ebe 100644
@@ -48,7 +48,6 @@
 #include "wl_export.h"
 #include "wl_ucode.h"
 #include "wlc_antsel.h"
-#include "pcie_core.h"
 #include "wlc_alloc.h"
 #include "wl_dbg.h"
 #include "wlc_bmac.h"
drivers/staging/brcm80211/include/pci_core.h deleted +0 -122

122 lines not on this page · raw message

drivers/staging/brcm80211/include/pcie_core.h deleted +0 -299

299 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#51 lore raw

PATCH 44/83 staging: brcm80211: replaced typedef si_t with struct si_pub

In reply to Roland Vossen

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         |    3 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.c       |  117 +++++++++--------
 drivers/staging/brcm80211/brcmsmac/aiutils.h       |  133 +++++++++----------
 drivers/staging/brcm80211/brcmsmac/bcmdma.h        |    4 +-
 drivers/staging/brcm80211/brcmsmac/bcmotp.c        |   16 ++--
 drivers/staging/brcm80211/brcmsmac/bcmotp.h        |    5 +-
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c       |   34 +++---
 drivers/staging/brcm80211/brcmsmac/dma.c           |    4 +-
 drivers/staging/brcm80211/brcmsmac/nicpci.c        |   12 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_hal.h   |    2 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_int.h   |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.h      |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_pmu.c       |   75 ++++++------
 drivers/staging/brcm80211/brcmsmac/wlc_pmu.h       |   36 +++---
 drivers/staging/brcm80211/brcmsmac/wlc_pub.h       |    2 +-
 drivers/staging/brcm80211/include/bcmsrom.h        |    4 +-
 16 files changed, 228 insertions(+), 223 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_iw.c +2 -1
index 2cc9bc7..9819a35 100644
@@ -27,7 +27,8 @@
 #include <dngl_stats.h>
 #include <dhd.h>
 #include <linux/ieee80211.h>
-typedef const struct si_pub si_t;
+
+struct si_pub;
 
 #include <dngl_stats.h>
 #include <dhd.h>
drivers/staging/brcm80211/brcmsmac/aiutils.c +61 -56

447 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/aiutils.h +63 -70

170 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/bcmdma.h +2 -2
index fc68d49..005410d 100644
@@ -148,7 +148,7 @@ struct dma_pub {
 	uint txnobuf;		/* tx out of dma descriptors */
 };
 
-extern struct dma_pub *dma_attach(char *name, si_t *sih,
+extern struct dma_pub *dma_attach(char *name, struct si_pub *sih,
 			    void *dmaregstx, void *dmaregsrx, uint ntxd,
 			    uint nrxd, uint rxbufsize, int rxextheadroom,
 			    uint nrxpost, uint rxoffset, uint *msg_level);
@@ -201,7 +201,7 @@ extern const di_fcn_t dma64proc;
  * SB attach provides ability to probe backplane and dma core capabilities
  * This info is needed by DMA_ALLOC_CONSISTENT in dma attach
  */
-extern uint dma_addrwidth(si_t *sih, void *dmaregs);
+extern uint dma_addrwidth(struct si_pub *sih, void *dmaregs);
 void dma_walk_packets(struct dma_pub *dmah, void (*callback_fnc)
 		      (void *pkt, void *arg_a), void *arg_a);
 
drivers/staging/brcm80211/brcmsmac/bcmotp.c +8 -8
index aa147c3..dab71fb 100644
@@ -89,9 +89,9 @@
 /* OTP common function type */
 typedef int (*otp_status_t) (void *oh);
 typedef int (*otp_size_t) (void *oh);
-typedef void *(*otp_init_t) (si_t *sih);
+typedef void *(*otp_init_t) (struct si_pub *sih);
 typedef u16(*otp_read_bit_t) (void *oh, chipcregs_t *cc, uint off);
-typedef int (*otp_read_region_t) (si_t *sih, int region, u16 *data,
+typedef int (*otp_read_region_t) (struct si_pub *sih, int region, u16 *data,
 				  uint *wlen);
 typedef int (*otp_nvread_t) (void *oh, char *data, uint *len);
 
@@ -108,7 +108,7 @@ typedef struct otp_fn_s {
 typedef struct {
 	uint ccrev;		/* chipc revision */
 	otp_fn_t *fn;		/* OTP functions */
-	si_t *sih;		/* Saved sb handle */
+	struct si_pub *sih;		/* Saved sb handle */
 
 #ifdef BCMIPXOTP
 	/* IPX OTP section */
@@ -245,7 +245,7 @@ static u16 ipxotp_read_bit(void *oh, chipcregs_t *cc, uint off)
 /* Calculate max HW/SW region byte size by subtracting fuse region and checksum size,
  * osizew is oi->wsize (OTP size - GU size) in words
  */
-static int ipxotp_max_rgnsz(si_t *sih, int osizew)
+static int ipxotp_max_rgnsz(struct si_pub *sih, int osizew)
 {
 	int ret = 0;
 
@@ -335,7 +335,7 @@ static void _ipxotp_init(otpinfo_t *oi, chipcregs_t *cc)
 	oi->flim = oi->wsize;
 }
 
-static void *ipxotp_init(si_t *sih)
+static void *ipxotp_init(struct si_pub *sih)
 {
 	uint idx;
 	chipcregs_t *cc;
@@ -635,7 +635,7 @@ static u16 hndotp_read_bit(void *oh, chipcregs_t *cc, uint idx)
 	return (u16) st;
 }
 
-static void *hndotp_init(si_t *sih)
+static void *hndotp_init(struct si_pub *sih)
 {
 	uint idx;
 	chipcregs_t *cc;
@@ -897,7 +897,7 @@ u16 otp_read_bit(void *oh, uint offset)
 	return readBit;
 }
 
-void *otp_init(si_t *sih)
+void *otp_init(struct si_pub *sih)
 {
 	otpinfo_t *oi;
 	void *ret = NULL;
@@ -929,7 +929,7 @@ void *otp_init(si_t *sih)
 }
 
 int
-otp_read_region(si_t *sih, int region, u16 *data,
+otp_read_region(struct si_pub *sih, int region, u16 *data,
 				 uint *wlen) {
 	bool wasup = false;
 	void *oh;
drivers/staging/brcm80211/brcmsmac/bcmotp.h +3 -2
index 5803acc..ccfb9ff 100644
@@ -37,8 +37,9 @@
 extern int otp_status(void *oh);
 extern int otp_size(void *oh);
 extern u16 otp_read_bit(void *oh, uint offset);
-extern void *otp_init(si_t *sih);
-extern int otp_read_region(si_t *sih, int region, u16 *data, uint *wlen);
+extern void *otp_init(struct si_pub *sih);
+extern int otp_read_region(struct si_pub *sih, int region, u16 *data,
+			   uint *wlen);
 extern int otp_nvread(void *oh, char *data, uint *len);
 
 #endif				/* _bcmotp_h_ */
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +19 -15
index e0899c8..c776a76 100644
@@ -780,21 +780,23 @@ static const sromvar_t perpath_pci_sromvars[] = {
 	{NULL, 0, 0, 0, 0}
 };
 
-static int initvars_srom_si(si_t *sih, void *curmap, char **vars, uint *count);
+static int initvars_srom_si(struct si_pub *sih, void *curmap, char **vars,
+			    uint *count);
 static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b);
-static int initvars_srom_pci(si_t *sih, void *curmap, char **vars, uint *count);
-static int initvars_flash_si(si_t *sih, char **vars, uint *count);
-static int sprom_read_pci(si_t *sih, u16 *sprom,
+static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
+			     uint *count);
+static int initvars_flash_si(struct si_pub *sih, char **vars, uint *count);
+static int sprom_read_pci(struct si_pub *sih, u16 *sprom,
 			  uint wordoff, u16 *buf, uint nwords, bool check_crc);
 #if defined(BCMNVRAMR)
-static int otp_read_pci(si_t *sih, u16 *buf, uint bufsz);
+static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz);
 #endif
-static u16 srom_cc_cmd(si_t *sih, void *ccregs, u32 cmd,
+static u16 srom_cc_cmd(struct si_pub *sih, void *ccregs, u32 cmd,
 			  uint wordoff, u16 data);
 
 static int initvars_table(char *start, char *end,
 			  char **vars, uint *count);
-static int initvars_flash(si_t *sih, char **vp,
+static int initvars_flash(struct si_pub *sih, char **vp,
 			  uint len);
 
 /* Initialization of varbuf structure */
@@ -862,7 +864,7 @@ static int varbuf_append(varbuf_t *b, const char *fmt, ...)
  * Initialize local vars from the right source for this platform.
  * Return 0 on success, nonzero on error.
  */
-int srom_var_init(si_t *sih, uint bustype, void *curmap,
+int srom_var_init(struct si_pub *sih, uint bustype, void *curmap,
 		  char **vars, uint *count)
 {
 	uint len;
@@ -896,7 +898,7 @@ int srom_var_init(si_t *sih, uint bustype, void *curmap,
  * not in the bus cores.
  */
 static u16
-srom_cc_cmd(si_t *sih, void *ccregs, u32 cmd,
+srom_cc_cmd(struct si_pub *sih, void *ccregs, u32 cmd,
 	    uint wordoff, u16 data)
 {
 	chipcregs_t *cc = (chipcregs_t *) ccregs;
@@ -941,7 +943,7 @@ static inline void htol16_buf(u16 *buf, unsigned int size)
  * Return 0 on success, nonzero on error.
  */
 static int
-sprom_read_pci(si_t *sih, u16 *sprom, uint wordoff,
+sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
 	       u16 *buf, uint nwords, bool check_crc)
 {
 	int err = 0;
@@ -998,7 +1000,7 @@ sprom_read_pci(si_t *sih, u16 *sprom, uint wordoff,
 }
 
 #if defined(BCMNVRAMR)
-static int otp_read_pci(si_t *sih, u16 *buf, uint bufsz)
+static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz)
 {
 	u8 *otp;
 	uint sz = OTP_SZ_MAX / 2;	/* size in words */
@@ -1066,7 +1068,7 @@ static int initvars_table(char *start, char *end,
  * of the table upon enter and to the end of the table upon exit when success.
  * Return 0 on success, nonzero on error.
  */
-static int initvars_flash(si_t *sih, char **base, uint len)
+static int initvars_flash(struct si_pub *sih, char **base, uint len)
 {
 	char *vp = *base;
 	char *flash;
@@ -1124,7 +1126,7 @@ static int initvars_flash(si_t *sih, char **base, uint len)
  * Initialize nonvolatile variable table from flash.
  * Return 0 on success, nonzero on error.
  */
-static int initvars_flash_si(si_t *sih, char **vars, uint *count)
+static int initvars_flash_si(struct si_pub *sih, char **vars, uint *count)
 {
 	char *vp, *base;
 	int err;
@@ -1304,7 +1306,8 @@ static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b)
  * Initialize nonvolatile variable table from sprom.
  * Return 0 on success, nonzero on error.
  */
-static int initvars_srom_pci(si_t *sih, void *curmap, char **vars, uint *count)
+static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
+			     uint *count)
 {
 	u16 *srom, *sromwindow;
 	u8 sromrev = 0;
@@ -1437,7 +1440,8 @@ static int initvars_srom_pci(si_t *sih, void *curmap, char **vars, uint *count)
 }
 
 
-static int initvars_srom_si(si_t *sih, void *curmap, char **vars, uint *varsz)
+static int initvars_srom_si(struct si_pub *sih, void *curmap, char **vars,
+			    uint *varsz)
 {
 	/* Search flash nvram section for srom variables */
 	return initvars_flash_si(sih, vars, varsz);
drivers/staging/brcm80211/brcmsmac/dma.c +2 -2
index 611a7e2..7d666c6 100644
@@ -434,7 +434,7 @@ const di_fcn_t dma64proc = {
 	39
 };
 
-struct dma_pub *dma_attach(char *name, si_t *sih,
+struct dma_pub *dma_attach(char *name, struct si_pub *sih,
 		     void *dmaregstx, void *dmaregsrx, uint ntxd,
 		     uint nrxd, uint rxbufsize, int rxextheadroom,
 		     uint nrxpost, uint rxoffset, uint *msg_level)
@@ -1873,7 +1873,7 @@ static void dma64_txrotate(dma_info_t *di)
 	      di->xmtptrbase + I2B(di->txout, dma64dd_t));
 }
 
-uint dma_addrwidth(si_t *sih, void *dmaregs)
+uint dma_addrwidth(struct si_pub *sih, void *dmaregs)
 {
 	/* Perform 64-bit checks only if we want to advertise 64-bit (> 32bit) capability) */
 	/* DMA engine is 64-bit capable */
drivers/staging/brcm80211/brcmsmac/nicpci.c +6 -6
index e1612ec..8bc65e0 100644
@@ -193,7 +193,7 @@ typedef struct {
 		struct sbpciregs *pciregs;
 	} regs;			/* Memory mapped register to the core */
 
-	si_t *sih;		/* System interconnect handle */
+	struct si_pub *sih;		/* System interconnect handle */
 	struct pci_dev *dev;
 	u8 pciecap_lcreg_offset;	/* PCIE capability LCreg offset in the config space */
 	bool pcie_pr42767;
@@ -512,7 +512,7 @@ static u8 pcie_clkreq(void *pch, u32 mask, u32 val)
 static void pcie_extendL1timer(pcicore_info_t *pi, bool extend)
 {
 	u32 w;
-	si_t *sih = pi->sih;
+	struct si_pub *sih = pi->sih;
 	sbpcieregs_t *pcieregs = pi->regs.pcieregs;
 
 	if (!PCIE_PUB(sih) || sih->buscorerev < 7)
@@ -530,7 +530,7 @@ static void pcie_extendL1timer(pcicore_info_t *pi, bool extend)
 /* centralized clkreq control policy */
 static void pcie_clkreq_upd(pcicore_info_t *pi, uint state)
 {
-	si_t *sih = pi->sih;
+	struct si_pub *sih = pi->sih;
 
 	switch (state) {
 	case SI_DOATTACH:
@@ -596,7 +596,7 @@ static void pcie_war_polarity(pcicore_info_t *pi)
 static void pcie_war_aspm_clkreq(pcicore_info_t *pi)
 {
 	sbpcieregs_t *pcieregs = pi->regs.pcieregs;
-	si_t *sih = pi->sih;
+	struct si_pub *sih = pi->sih;
 	u16 val16, *reg16;
 	u32 w;
 
@@ -691,7 +691,7 @@ static void pcie_war_noplldown(pcicore_info_t *pi)
 /* Needs to happen when coming out of 'standby'/'hibernate' */
 static void pcie_war_pci_setup(pcicore_info_t *pi)
 {
-	si_t *sih = pi->sih;
+	struct si_pub *sih = pi->sih;
 	sbpcieregs_t *pcieregs = pi->regs.pcieregs;
 	u32 w;
 
@@ -737,7 +737,7 @@ static void pcie_war_pci_setup(pcicore_info_t *pi)
 void pcicore_attach(void *pch, char *pvars, int state)
 {
 	pcicore_info_t *pi = (pcicore_info_t *) pch;
-	si_t *sih = pi->sih;
+	struct si_pub *sih = pi->sih;
 
 	/* Determine if this board needs override */
 	if (PCIE_ASPM(sih)) {
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_hal.h +1 -1
index 93e3db9..6d4473c 100644
@@ -164,7 +164,7 @@ struct phy_pub;
 typedef struct phy_pub wlc_phy_t;
 
 typedef struct shared_phy_params {
-	si_t *sih;
+	struct si_pub *sih;
 	void *physhim;
 	uint unit;
 	uint corerev;
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h +1 -1
index 8e7fb94..51e37aa 100644
@@ -534,7 +534,7 @@ typedef struct {
 struct shared_phy {
 	struct phy_info *phy_head;
 	uint unit;
-	si_t *sih;
+	struct si_pub *sih;
 	void *physhim;
 	uint corerev;
 	u32 machwcap;
drivers/staging/brcm80211/brcmsmac/wlc_main.h +1 -1
index 4e62b11..0dcb73f 100644
@@ -450,7 +450,7 @@ struct wlc_hw_info {
 	u32 machwcap_backup;	/* backup of machwcap */
 	u16 ucode_dbgsel;	/* dbgsel for ucode debug(config gpio) */
 
-	si_t *sih;		/* SB handle (cookie for siutils calls) */
+	struct si_pub *sih;	/* SI handle (cookie for siutils calls) */
 	char *vars;		/* "environment" name=value */
 	uint vars_size;		/* size of vars, free vars on detach */
 	d11regs_t *regs;	/* pointer to device registers */
drivers/staging/brcm80211/brcmsmac/wlc_pmu.c +38 -37

277 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_pmu.h +18 -18
index bd5b809b..6b005b0 100644
@@ -36,23 +36,23 @@
 #define SET_LDO_VOLTAGE_LNLDO1	9
 #define SET_LDO_VOLTAGE_LNLDO2_SEL	10
 
-extern void si_pmu_set_ldo_voltage(si_t *sih, u8 ldo, u8 voltage);
-extern u16 si_pmu_fast_pwrup_delay(si_t *sih);
-extern void si_pmu_sprom_enable(si_t *sih, bool enable);
-extern u32 si_pmu_chipcontrol(si_t *sih, uint reg, u32 mask, u32 val);
-extern u32 si_pmu_regcontrol(si_t *sih, uint reg, u32 mask, u32 val);
-extern u32 si_pmu_ilp_clock(si_t *sih);
-extern u32 si_pmu_alp_clock(si_t *sih);
-extern void si_pmu_pllupd(si_t *sih);
-extern void si_pmu_spuravoid(si_t *sih, u8 spuravoid);
-extern u32 si_pmu_pllcontrol(si_t *sih, uint reg, u32 mask, u32 val);
-extern void si_pmu_init(si_t *sih);
-extern void si_pmu_chip_init(si_t *sih);
-extern void si_pmu_pll_init(si_t *sih, u32 xtalfreq);
-extern void si_pmu_res_init(si_t *sih);
-extern void si_pmu_swreg_init(si_t *sih);
-extern u32 si_pmu_measure_alpclk(si_t *sih);
-extern bool si_pmu_is_otp_powered(si_t *sih);
-extern void si_pmu_otp_power(si_t *sih, bool on);
+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);
+extern u32 si_pmu_regcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val);
+extern u32 si_pmu_ilp_clock(struct si_pub *sih);
+extern u32 si_pmu_alp_clock(struct si_pub *sih);
+extern void si_pmu_pllupd(struct si_pub *sih);
+extern void si_pmu_spuravoid(struct si_pub *sih, u8 spuravoid);
+extern u32 si_pmu_pllcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val);
+extern void si_pmu_init(struct si_pub *sih);
+extern void si_pmu_chip_init(struct si_pub *sih);
+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 /* WLC_PMU_H_ */
drivers/staging/brcm80211/brcmsmac/wlc_pub.h +1 -1
index 0ab16c4..77b0738 100644
@@ -255,7 +255,7 @@ struct wlc_pub {
 	uint mac80211_state;
 	uint unit;		/* device instance number */
 	uint corerev;		/* core revision */
-	si_t *sih;		/* SB handle (cookie for siutils calls) */
+	struct si_pub *sih;	/* SI handle (cookie for siutils calls) */
 	char *vars;		/* "environment" name=value */
 	bool up;		/* interface up and running */
 	bool hw_off;		/* HW is off */
drivers/staging/brcm80211/include/bcmsrom.h +2 -2
index b9500ec..dc9ccee 100644
@@ -18,10 +18,10 @@
 #define	_bcmsrom_h_
 
 /* Prototypes */
-extern int srom_var_init(si_t *sih, uint bus, void *curmap,
+extern int srom_var_init(struct si_pub *sih, uint bus, void *curmap,
 			 char **vars, uint *count);
 
-extern int srom_read(si_t *sih, uint bus, void *curmap,
+extern int srom_read(struct si_pub *sih, uint bus, void *curmap,
 		     uint byteoff, uint nbytes, u16 *buf, bool check_crc);
 
 /* parse standard PCMCIA cis, normally used by SB/PCMCIA/SDIO/SPI/OTP
Signature · 1 line
1.7.4.1
#52 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Quoted 10 lines · Roland Vossen

Code cleanup.

drivers/staging/brcm80211/brcmfmac/wl_iw.c +0 -0
index 2cc9bc7..9819a35 100644

drivers/staging/brcm80211/brcmfmac/wl_iw.c line 34

Quoted 9 lines
drivers/staging/brcm80211/brcmfmac/wl_iw.c +2 -1
@@ -27,7 +27,8 @@
  #include <dngl_stats.h>
  #include <dhd.h>
  #include <linux/ieee80211.h>
-typedef const struct si_pub si_t;
+
+struct si_pub;
 
  #include <dngl_stats.h>
  #include <dhd.h>

Should this struct definition be in a header file somewhere?

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#53 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Hello Julian,

the structure definition itself is already in a header file (aiutils.h). Probably you are referring to the forward declaration used in the patch?

Bye, Roland.

Quoted 22 lines · Julian Calaby
Quoted 10 lines · Roland Vossen

Code cleanup.

drivers/staging/brcm80211/brcmfmac/wl_iw.c +0 -0
index 2cc9bc7..9819a35 100644

drivers/staging/brcm80211/brcmfmac/wl_iw.c line 34

Quoted 9 lines
drivers/staging/brcm80211/brcmfmac/wl_iw.c +2 -1
@@ -27,7 +27,8 @@
  #include<dngl_stats.h>
  #include<dhd.h>
  #include<linux/ieee80211.h>
-typedef const struct si_pub si_t;
+
+struct si_pub;
 
  #include<dngl_stats.h>
  #include<dhd.h>

Should this struct definition be in a header file somewhere?

#54 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Quoted 4 lines · Roland Vossen

Hello Julian,

the structure definition itself is already in a header file (aiutils.h). Probably you are referring to the forward declaration used in the patch?

Exactly, it probably shouldn't be here as the header file that includes the structure should arguably already be included.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#55 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Hi Julian,

Quoted 8 lines · Roland Vossen
Quoted 4 lines

Hello Julian,

the structure definition itself is already in a header file (aiutils.h). Probably you are referring to the forward declaration used in the patch?

Exactly, it probably shouldn't be here as the header file that includes the structure should arguably already be included.

I am afraid I have to disagree with you, for the reason that by including the header file you introduce unnecessary coupling. Let me elaborate. If a .c file does not need to know the contents of a struct, but it only needs to know that a pointer to an opaque struct, then one should not provide the C file with knowledge on the internals of the struct (hence not include the .h file).

Bye, Roland.

#56 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Quoted 12 lines · Roland Vossen

Hi Julian,

Quoted 9 lines · Roland Vossen
Quoted 5 lines

Hello Julian,

the structure definition itself is already in a header file (aiutils.h). Probably you are referring to the forward declaration used in the patch?

Exactly, it probably shouldn't be here as the header file that includes the structure should arguably already be included.

Quoted 6 lines

I am afraid I have to disagree with you, for the reason that by including the header file you introduce unnecessary coupling. Let me elaborate. If a .c file does not need to know the contents of a struct, but it only needs to know that a pointer to an opaque struct, then one should not provide the C file with knowledge on the internals of the struct (hence not include the .h file).

Fair enough. I guess I just don't like void pointers.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#57 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Quoted 11 lines

#include <dngl_stats.h>

#include <dhd.h>
#include <linux/ieee80211.h>

drivers/staging/brcm80211/brcmfmac/wl_iw.c +2 -1
-typedef const struct si_pub si_t;
+
+struct si_pub;

#include <dngl_stats.h>
#include <dhd.h>

Is there any reason why dngl_stats.h and dhd.h are included twice in wl_iw.c?

(if not, maybe you corrected this in another patch, I couldn't get the series to apply cleanly so there was no easy way of checking. If so sorry for the noise)

Cheers
Julie

#58 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Quoted 9 lines · julie Sullivan
Quoted 9 lines

#include <dngl_stats.h>

#include <dhd.h>
#include <linux/ieee80211.h>

(quoted diff) +2 -1
-typedef const struct si_pub si_t;
+
+struct si_pub;
Quoted 4 lines
Quoted 2 lines

#include <dngl_stats.h>
#include <dhd.h>

Is there any reason why dngl_stats.h and dhd.h are included twice in wl_iw.c?

No, no good reason. The double inclusion seems to have been aournd for quite a while. A few others got cleaned up, but this one got missed.

Quoted 3 lines

(if not, maybe you corrected this in another patch, I couldn't get the series to apply cleanly so there was no easy way of checking. If so sorry for the noise)

Nope, not fixed yet. We'll get it cleaned up in a subsequent patch.

- Henry

#59 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

In reply to julie Sullivan

Hi Julie,

Quoted 5 lines

Is there any reason why dngl_stats.h and dhd.h are included twice in wl_iw.c?

(if not, maybe you corrected this in another patch, I couldn't get the series to apply cleanly so there was no easy way of checking. If so sorry for the noise)

In addition to Henry's answer: I just created a commit that fixes any double header issues. This commit will appear in a future patch series (so not as a repost of the current patch series), if that is ok with you.

Thanks for noticing this,

Roland.

#60 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

In reply to Julian Calaby

Hi Julian,

Quoted 8 lines
Quoted 6 lines

I am afraid I have to disagree with you, for the reason that by including the header file you introduce unnecessary coupling. Let me elaborate. If a .c file does not need to know the contents of a struct, but it only needs to know that a pointer to an opaque struct, then one should not provide the C file with knowledge on the internals of the struct (hence not include the .h file).

Fair enough. I guess I just don't like void pointers.

Well, what I mean is this: suppose you have a function that gets a pointer to a struct as one of its parameters. This function calls another function with this parameter:

void foo(struct *bar) {
	some_other_fnct(bar);
}

Then foo() simply passes the pointer on to some_other_fnct(), and foo() does not need to know about the members inside struct bar. So I am not talking about void pointers here as the alternative.

Bye, Roland.

#61 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Quoted 19 lines · Roland Vossen

Hi Julian,

Quoted 11 lines
Quoted 10 lines

I am afraid I have to disagree with you, for the reason that by including the header file you introduce unnecessary coupling. Let me elaborate. If a
.c file does not need to know the contents of a struct, but it only needs to
know that a pointer to an opaque struct, then one should not provide the C
file with knowledge on the internals of the struct (hence not include the .h
file).

Quoted 1 line

Fair enough. I guess I just don't like void pointers.

Well, what I mean is this: suppose you have a function that gets a pointer to a struct as one of its parameters. This function calls another function with this parameter:

Quoted 7 lines

void foo(struct *bar) {
       some_other_fnct(bar);
}

Then foo() simply passes the pointer on to some_other_fnct(), and foo() does not need to know about the members inside struct bar. So I am not talking about void pointers here as the alternative.

The reason I was pointing this out was that while foo() doesn't need to know what's in struct bar, it will help type safety and general code cleanliness to have some declaration of struct bar in the headers.

If we have a module that exports a set of functions in it's header file (say "bar.h") like:

extern struct bar *get_bar();
extern void foo(struct bar *bar);

the struct bar is part of the API of the module, even if no caller ever uses it's internals. Therefore the header file should include the line:

struct bar;

so that users of the API don't have to declare it themselves to suppress the compiler warnings that would be generated otherwise.

My objection was to the struct declaration appearing at the top of wl_iw.c, rather than in the header file that defines the functions that use it.

In fact, looking a bit further around, it appears that this declaration is already in aiutils.h making it's appearance at the top of wl_iw.c completely redundant, especially given that the file in question appears to not use *any* functions that use the struct, and if it does, it should include aiutils.h rather than declaring the struct itself - and this isn't introducing extra coupling, this is merely including the header that defines the API for the code that actually uses this struct.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#62 lore raw

Re: [PATCH 44/83] staging: brcm80211: replaced typedef si_t with struct si_pub

Hi Julian,

Quoted 4 lines

The reason I was pointing this out was that while foo() doesn't need to know what's in struct bar, it will help type safety and general code cleanliness to have some declaration of struct bar in the headers.

Mostly agree with you. It is cleaner to define all forward declarations in one header file.

Quoted 6 lines

If we have a module that exports a set of functions in it's header file (say "bar.h") like:

extern struct bar *get_bar();
extern void foo(struct bar *bar);

Quoted 8 lines

the struct bar is part of the API of the module, even if no caller ever uses it's internals. Therefore the header file should include the line:

struct bar;

so that users of the API don't have to declare it themselves to suppress the compiler warnings that would be generated otherwise.

Or the header file should include another header file with this declaration.

Quoted 3 lines

My objection was to the struct declaration appearing at the top of wl_iw.c, rather than in the header file that defines the functions that use it.

Got it.

Quoted 8 lines

In fact, looking a bit further around, it appears that this declaration is already in aiutils.h making it's appearance at the top of wl_iw.c completely redundant, especially given that the file in question appears to not use *any* functions that use the struct, and if it does, it should include aiutils.h rather than declaring the struct itself - and this isn't introducing extra coupling, this is merely including the header that defines the API for the code that actually uses this struct.

I just created a patch that removes all forward struct declarations from .c files. This patch will be part of a future patch set, I have added a 'Reported-by: ' line with your name to the commit message.

Thanks, Roland.

#63 lore raw

PATCH 45/83 staging: brcm80211: deleted sbconfig.h, renamed sbcc.h

In reply to Roland Vossen

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    2 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.c       |    2 +-
 drivers/staging/brcm80211/brcmsmac/bcmotp.c        |    2 +-
 drivers/staging/brcm80211/brcmsmac/bcmsrom.c       |    2 +-
 drivers/staging/brcm80211/brcmsmac/nicpci.c        |    2 +-
 drivers/staging/brcm80211/brcmsmac/nvram.c         |    2 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c   |    2 +-
 drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c  |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_pmu.c       |    2 +-
 drivers/staging/brcm80211/include/bcmdefs.h        |   12 +++++++
 drivers/staging/brcm80211/include/bcmsoc.h         |    1 -
 .../brcm80211/include/{sbchipc.h => chipcommon.h}  |    0
 drivers/staging/brcm80211/include/sbconfig.h       |   32 --------------------
 15 files changed, 23 insertions(+), 44 deletions(-)
 rename drivers/staging/brcm80211/include/{sbchipc.h => chipcommon.h} (100%)
 delete mode 100644 drivers/staging/brcm80211/include/sbconfig.h
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -1
index 275fa7c..67768bb 100644
@@ -130,7 +130,7 @@ typedef struct {
 } rte_cons_t;
 
 #endif				/* DHD_DEBUG */
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <sbdma.h>
 
 #include <sdio.h>
drivers/staging/brcm80211/brcmsmac/aiutils.c +1 -1
index e065895..2de6cfb 100644
@@ -23,7 +23,7 @@
 #include <bcmutils.h>
 #include <aiutils.h>
 #include <bcmsoc.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <bcmdevs.h>
 
 /* ********** from siutils.c *********** */
drivers/staging/brcm80211/brcmsmac/bcmotp.c +1 -1
index dab71fb..2b7f061 100644
@@ -26,7 +26,7 @@
 #include <bcmutils.h>
 #include <aiutils.h>
 #include <bcmsoc.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <bcmotp.h>
 
 #define OTPS_GUP_MASK		0x00000f00
drivers/staging/brcm80211/brcmsmac/bcmsrom.c +1 -1
index c776a76..2946d06 100644
@@ -23,7 +23,7 @@
 #include "wlc_types.h"
 #include <bcmutils.h>
 #include <bcmsoc.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <bcmdevs.h>
 #include <nicpci.h>
 #include <aiutils.h>
drivers/staging/brcm80211/brcmsmac/nicpci.c +1 -1
index 8bc65e0..6b9cb6b 100644
@@ -23,7 +23,7 @@
 #include <aiutils.h>
 #include <bcmsoc.h>
 #include <bcmdevs.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <nicpci.h>
 
 /* SPROM offsets */
drivers/staging/brcm80211/brcmsmac/nvram.c +1 -1
index 65fee2f..5cef837 100644
@@ -19,7 +19,7 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <bcmnvram.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <bcmdevs.h>
 #include <bcmsoc.h>
 
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c +1 -1
index 1e9865f..d54e264 100644
@@ -25,7 +25,7 @@
 
 #include <bcmdefs.h>
 #include <bcmnvram.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <bcmdevs.h>
 #include <sbdma.h>
 
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c +1 -1
index 78d8cbe..bc362f3 100644
@@ -21,7 +21,7 @@
 #include <linux/delay.h>
 #include <linux/pci.h>
 #include <aiutils.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <wlc_pmu.h>
 
 #include <bcmdevs.h>
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +1 -1
index d069ebe..0f876a7 100644
@@ -29,7 +29,7 @@
 #include <bcmotp.h>
 #include <bcmutils.h>
 #include <bcmnvram.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <nicpci.h>
 #include <sbdma.h>
 #include <bcmdma.h>
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +1 -1
index c94b459..b97fa3e 100644
@@ -28,7 +28,7 @@
 #include <bcmutils.h>
 #include <bcmwifi.h>
 #include <aiutils.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <sbdma.h>
 #include <bcmdma.h>
 #include <wlc_pmu.h>
drivers/staging/brcm80211/brcmsmac/wlc_pmu.c +1 -1
index ab2c0b7..047cd1a 100644
@@ -19,7 +19,7 @@
 #include <linux/io.h>
 
 #include <bcmdevs.h>
-#include <sbchipc.h>
+#include <chipcommon.h>
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include "wlc_pmu.h"
drivers/staging/brcm80211/include/bcmdefs.h +12 -0
index cf9dc0e..304d8ed 100644
@@ -95,4 +95,16 @@ typedef struct wl_rateset {
 #define PM_MAX	1
 #define PM_FAST 2
 
+/*
+ * Sonics Configuration Space Registers.
+ */
+#define	SBCONFIGOFF		0xf00	/* core sbconfig regs are top 256bytes of regs */
+
+/* cpp contortions to concatenate w/arg prescan */
+#ifndef	PAD
+#define	_PADLINE(line)	pad ## line
+#define	_XSTR(line)	_PADLINE(line)
+#define	PAD		_XSTR(__LINE__)
+#endif
+
 #endif				/* _bcmdefs_h_ */
drivers/staging/brcm80211/include/bcmsoc.h +0 -1
index 6435686..012e465 100644
@@ -18,7 +18,6 @@
 #define	_HNDSOC_H
 
 /* Include the soci specific files */
-#include <sbconfig.h>
 #include <aidmp.h>
 
 /*
drivers/staging/brcm80211/include/chipcommon.h renamed from drivers/staging/brcm80211/include/sbchipc.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/include/sbchipc.h
rename to drivers/staging/brcm80211/include/chipcommon.h
drivers/staging/brcm80211/include/sbconfig.h deleted +0 -32
deleted file mode 100644
index 68e4b54..0000000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef	_SBCONFIG_H
-#define	_SBCONFIG_H
-
-/* cpp contortions to concatenate w/arg prescan */
-#ifndef PAD
-#define	_PADLINE(line)	pad ## line
-#define	_XSTR(line)	_PADLINE(line)
-#define	PAD		_XSTR(__LINE__)
-#endif
-
-/*
- * Sonics Configuration Space Registers.
- */
-#define	SBCONFIGOFF		0xf00	/* core sbconfig regs are top 256bytes of regs */
-
-#endif				/* _SBCONFIG_H */
Signature · 1 line
1.7.4.1
#64 lore raw

PATCH 46/83 staging: brcm80211: moved sbdma.h into brcmsmac/bcmdma.h

In reply to Roland Vossen

Code cleanup. Removed fullmac dependencies on this file.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    1 -
 drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h    |   57 +-------------------
 drivers/staging/brcm80211/brcmsmac/bcmdma.h        |   29 ++++++++++
 drivers/staging/brcm80211/brcmsmac/dma.c           |    2 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c   |    2 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c   |    2 +-
 drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c |    2 +-
 .../brcm80211/brcmsmac/phy/wlc_phytbl_lcn.c        |    2 +-
 .../staging/brcm80211/brcmsmac/phy/wlc_phytbl_n.c  |    2 +-
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c   |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_alloc.c     |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c     |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_antsel.c    |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_channel.c   |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c      |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c  |    3 +-
 drivers/staging/brcm80211/brcmsmac/wlc_rate.c      |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_stf.c       |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_types.h     |    3 +
 drivers/staging/brcm80211/include/sbdma.h          |   47 ----------------
 21 files changed, 48 insertions(+), 121 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/include/sbdma.h
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -1
index 67768bb..ebead09 100644
@@ -131,7 +131,6 @@ typedef struct {
 
 #endif				/* DHD_DEBUG */
 #include <chipcommon.h>
-#include <sbdma.h>
 
 #include <sdio.h>
 #include <sbsdio.h>
drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h +1 -56

69 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/bcmdma.h +29 -0
index 005410d..1a1ca03 100644
@@ -17,11 +17,40 @@
 #ifndef	_bcmdma_h_
 #define	_bcmdma_h_
 
+#include "wlc_types.h"		/* forward structure declarations */
+
 #ifndef _dma_pub_
 #define _dma_pub_
 struct dma_pub;
 #endif				/* _dma_pub_ */
 
+/* DMA structure:
+ *  support two DMA engines: 32 bits address or 64 bit addressing
+ *  basic DMA register set is per channel(transmit or receive)
+ *  a pair of channels is defined for convenience
+ */
+
+/* 32 bits addressing */
+
+typedef volatile struct {	/* diag access */
+	u32 fifoaddr;	/* diag address */
+	u32 fifodatalow;	/* low 32bits of data */
+	u32 fifodatahigh;	/* high 32bits of data */
+	u32 pad;		/* reserved */
+} dma32diag_t;
+
+/* 64 bits addressing */
+
+/* dma registers per channel(xmt or rcv) */
+typedef volatile struct {
+	u32 control;		/* enable, et al */
+	u32 ptr;		/* last descriptor posted to chip */
+	u32 addrlow;		/* descriptor ring base address low 32-bits (8K aligned) */
+	u32 addrhigh;	/* descriptor ring base address bits 63:32 (8K aligned) */
+	u32 status0;		/* current descriptor, xmt state */
+	u32 status1;		/* active descriptor, xmt error */
+} dma64regs_t;
+
 /* map/unmap direction */
 #define	DMA_TX	1		/* TX direction for DMA */
 #define	DMA_RX	2		/* RX direction for DMA */
drivers/staging/brcm80211/brcmsmac/dma.c +1 -1
index 7d666c6..d50395d 100644
@@ -25,7 +25,7 @@
 #include <aiutils.h>
 
 #include "wlc_types.h"
-#include <sbdma.h>
+#include "bcmdma.h"
 #include <bcmdma.h>
 
 #if defined(__mips__)
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c +1 -1
index d54e264..8045c39 100644
@@ -27,7 +27,7 @@
 #include <bcmnvram.h>
 #include <chipcommon.h>
 #include <bcmdevs.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include <wlc_types.h>
 #include <wlc_phy_int.h>
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c +1 -1
index b5ec9ae..1011ca5 100644
@@ -25,7 +25,7 @@
 #include <bcmnvram.h>
 
 #include <bcmdevs.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include "wlc_phy_radio.h"
 #include "wlc_phy_int.h"
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c +1 -1
index bc362f3..da2afbb 100644
@@ -25,7 +25,7 @@
 #include <wlc_pmu.h>
 
 #include <bcmdevs.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include <wlc_types.h>
 #include <wlc_phy_radio.h>
drivers/staging/brcm80211/brcmsmac/phy/wlc_phytbl_lcn.c +1 -1
index e9d8661..679002e 100644
@@ -15,7 +15,7 @@
  */
 
 #include <linux/types.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 #include <wlc_phy_int.h>
 #include <wlc_phytbl_lcn.h>
 
drivers/staging/brcm80211/brcmsmac/phy/wlc_phytbl_n.c +1 -1
index e4a15c4..ad41a19 100644
@@ -16,7 +16,7 @@
 
 #include <linux/kernel.h>
 
-#include <sbdma.h>
+#include "bcmdma.h"
 #include <wlc_phy_int.h>
 #include <wlc_phytbl_n.h>
 
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +1 -1
index ee026d3..0f4a1cc 100644
@@ -30,7 +30,7 @@
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include <nicpci.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include "phy/wlc_phy_int.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_alloc.c +1 -1
index 8a4875d..218210a 100644
@@ -19,7 +19,7 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include "d11.h"
 #include "wlc_types.h"
drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c +1 -1
index 53ca0ff..0c325c7 100644
@@ -19,7 +19,7 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 #include <bcmdma.h>
 #include <d11.h>
 
drivers/staging/brcm80211/brcmsmac/wlc_antsel.c +1 -1
index d26a520..fba9eaf 100644
@@ -25,7 +25,7 @@
 #include <bcmnvram.h>
 #include <aiutils.h>
 #include <bcmdevs.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include "d11.h"
 #include "wlc_rate.h"
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +0 -1
index 0f876a7..6bc547a 100644
@@ -31,7 +31,6 @@
 #include <bcmnvram.h>
 #include <chipcommon.h>
 #include <nicpci.h>
-#include <sbdma.h>
 #include <bcmdma.h>
 
 #include "wlc_types.h"
drivers/staging/brcm80211/brcmsmac/wlc_channel.c +1 -1
index 0b980ac..cd37971 100644
@@ -23,7 +23,7 @@
 #include <bcmutils.h>
 #include <bcmnvram.h>
 #include <aiutils.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include "wlc_types.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_main.c +1 -1
index 18a5463..3e34b31 100644
@@ -26,7 +26,7 @@
 #include <bcmnvram.h>
 #include <aiutils.h>
 #include <bcmsrom.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 #include <bcmdma.h>
 
 #include "wlc_pmu.h"
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +1 -2
index b97fa3e..6689691 100644
@@ -29,8 +29,7 @@
 #include <bcmwifi.h>
 #include <aiutils.h>
 #include <chipcommon.h>
-#include <sbdma.h>
-#include <bcmdma.h>
+#include "bcmdma.h"
 #include <wlc_pmu.h>
 
 #include "wlc_types.h"
drivers/staging/brcm80211/brcmsmac/wlc_rate.c +1 -1
index 53dcf24..d6eae1f 100644
@@ -19,7 +19,7 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <aiutils.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include "wlc_types.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_stf.c +1 -1
index a08db2e..8fb90d4 100644
@@ -22,7 +22,7 @@
 #include <aiutils.h>
 #include <bcmwifi.h>
 #include <bcmnvram.h>
-#include <sbdma.h>
+#include "bcmdma.h"
 
 #include "wlc_types.h"
 #include "d11.h"
drivers/staging/brcm80211/brcmsmac/wlc_types.h +3 -0
index 76a1348..5cca063 100644
@@ -34,6 +34,7 @@
 #define MAX_DMA_SEGS 4
 
 /* forward declarations */
+struct sk_buff;
 struct wl_info;
 struct wlc_info;
 struct wlc_hw_info;
@@ -45,5 +46,7 @@ struct bmac_pmq;
 struct d11init;
 struct dma_pub;
 struct wlc_bsscfg;
+struct bcmstrbuf;
+struct si_pub;
 
 #endif				/* _wlc_types_h_ */
drivers/staging/brcm80211/include/sbdma.h deleted +0 -47

47 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#65 lore raw

PATCH 47/83 staging: brcm80211: macro cleanup

In reply to Roland Vossen

Code cleanup. Replaced bcopy() by memcpy(). Removed redundant PAD macro definitions.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |    8 --------
 drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h |    7 -------
 drivers/staging/brcm80211/brcmsmac/aiutils.c    |    2 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.h    |    7 -------
 drivers/staging/brcm80211/brcmsmac/bcmnvram.h   |    4 ----
 drivers/staging/brcm80211/brcmsmac/d11.h        |    7 -------
 drivers/staging/brcm80211/brcmsmac/nicpci.c     |    7 -------
 drivers/staging/brcm80211/include/aidmp.h       |    6 ++----
 drivers/staging/brcm80211/include/bcmutils.h    |    2 --
 drivers/staging/brcm80211/include/chipcommon.h  |    7 +------
 10 files changed, 4 insertions(+), 53 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -8
index ebead09..835beaa 100644
@@ -60,8 +60,6 @@
 
 #define	TRAP_T_SIZE	80
 
-#ifndef	_LANGUAGE_ASSEMBLY
-
 typedef struct _trap_struct {
 	u32 type;
 	u32 epc;
@@ -85,8 +83,6 @@ typedef struct _trap_struct {
 	u32 pc;
 } trap_t;
 
-#endif				/* !_LANGUAGE_ASSEMBLY */
-
 #define CBUF_LEN	(128)
 
 #define LOG_BUF_LEN	1024
@@ -447,8 +443,6 @@ typedef struct dhd_bus {
 	bool ctrl_frame_stat;
 } dhd_bus_t;
 
-#ifndef _LANGUAGE_ASSEMBLY
-
 typedef volatile struct _sbconfig {
 	u32 PAD[2];
 	u32 sbipsflag;	/* initiator port ocp slave flag */
@@ -489,8 +483,6 @@ typedef volatile struct _sbconfig {
 	u32 sbidhigh;	/* identification */
 } sbconfig_t;
 
-#endif				/* _LANGUAGE_ASSEMBLY */
-
 /* clkstate */
 #define CLK_NONE	0
 #define CLK_SDONLY	1
drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h +0 -7
index cc64b2f..3799d50 100644
@@ -17,13 +17,6 @@
 #ifndef	_sbsdpcmdev_h_
 #define	_sbsdpcmdev_h_
 
-/* cpp contortions to concatenate w/arg prescan */
-#ifndef PAD
-#define	_PADLINE(line)	pad ## line
-#define	_XSTR(line)	_PADLINE(line)
-#define	PAD		_XSTR(__LINE__)
-#endif				/* PAD */
-
 /* core registers */
 typedef volatile struct {
 	u32 corecontrol;	/* CoreControl, 0x000, rev8 */
drivers/staging/brcm80211/brcmsmac/aiutils.c +1 -1
index 2de6cfb..d57908b 100644
@@ -1082,7 +1082,7 @@ void ai_detach(struct si_pub *sih)
 	uint idx;
 
 	struct si_pub *si_local = NULL;
-	bcopy(&sih, &si_local, sizeof(struct si_pub **));
+	memcpy(&si_local, &sih, sizeof(struct si_pub **));
 
 	sii = SI_INFO(sih);
 
drivers/staging/brcm80211/brcmsmac/aiutils.h +0 -7
index 53d2e02..ec7acd1 100644
@@ -17,13 +17,6 @@
 #ifndef	_aiutils_h_
 #define	_aiutils_h_
 
-/* cpp contortions to concatenate w/arg prescan */
-#ifndef PAD
-#define	_PADLINE(line)	pad ## line
-#define	_XSTR(line)	_PADLINE(line)
-#define	PAD		_XSTR(__LINE__)
-#endif
-
 /* Include the soci specific files */
 #include <aidmp.h>
 
drivers/staging/brcm80211/brcmsmac/bcmnvram.h +0 -4
index 12645dd..bc62695 100644
@@ -17,8 +17,6 @@
 #ifndef _bcmnvram_h_
 #define _bcmnvram_h_
 
-#ifndef _LANGUAGE_ASSEMBLY
-
 #include <bcmdefs.h>
 
 struct nvram_header {
@@ -128,8 +126,6 @@ extern int nvram_commit(void);
  */
 extern int nvram_getall(char *nvram_buf, int count);
 
-#endif				/* _LANGUAGE_ASSEMBLY */
-
 /* variable access */
 extern char *getvar(char *vars, const char *name);
 extern int getintvar(char *vars, const char *name);
drivers/staging/brcm80211/brcmsmac/d11.h +0 -7
index d1babcd..12a0ead 100644
@@ -19,13 +19,6 @@
 
 #include <linux/ieee80211.h>
 
-/* cpp contortions to concatenate w/arg prescan */
-#ifndef	PAD
-#define	_PADLINE(line)	pad ## line
-#define	_XSTR(line)	_PADLINE(line)
-#define	PAD		_XSTR(__LINE__)
-#endif
-
 #define	BCN_TMPL_LEN		512	/* length of the BCN template area */
 
 /* RX FIFO numbers */
drivers/staging/brcm80211/brcmsmac/nicpci.c +0 -7
index 6b9cb6b..8a956f5 100644
@@ -117,13 +117,6 @@
 /* PCIE protocol TLP diagnostic registers */
 #define PCIE_TLP_WORKAROUNDSREG		0x004	/* TLP Workarounds */
 
-/* cpp contortions to concatenate w/arg prescan */
-#ifndef PAD
-#define	_PADLINE(line)	pad ## line
-#define	_XSTR(line)	_PADLINE(line)
-#define	PAD		_XSTR(__LINE__)
-#endif
-
 /* Sonics side: PCI core and host control registers */
 struct sbpciregs {
 	u32 control;		/* PCI control */
drivers/staging/brcm80211/include/aidmp.h +2 -4
index 7e0ce8f..2c10177 100644
@@ -17,6 +17,8 @@
 #ifndef	_AIDMP_H
 #define	_AIDMP_H
 
+#include "bcmdefs.h"		/* for PAD macro */
+
 /* Manufacturer Ids */
 #define	MFGID_ARM		0x43b
 #define	MFGID_BRCM		0x4bf
@@ -100,8 +102,6 @@
 #define	SD_SG32			0x00000008
 #define	SD_SZ_ALIGN		0x00000fff
 
-#ifndef _LANGUAGE_ASSEMBLY
-
 typedef volatile struct _aidmp {
 	u32 oobselina30;	/* 0x000 */
 	u32 oobselina74;	/* 0x004 */
@@ -220,8 +220,6 @@ typedef volatile struct _aidmp {
 	u32 componentid3;	/* 0xffc */
 } aidmp_t;
 
-#endif				/* _LANGUAGE_ASSEMBLY */
-
 /* Out-of-band Router registers */
 #define	OOB_BUSCONFIG		0x020
 #define	OOB_STATUSA		0x100
drivers/staging/brcm80211/include/bcmutils.h +0 -2
index d7f531e..1a1c8ad 100644
@@ -272,8 +272,6 @@ extern void bcm_prpkt(const char *msg, struct sk_buff *p0);
 #include <linux/kernel.h>	/* for vsn/printf's */
 #include <linux/string.h>	/* for mem*, str* */
 #endif
-/* bcopy's: Linux kernel doesn't provide these (anymore) */
-#define	bcopy(src, dst, len)	memcpy((dst), (src), (len))
 
 /* register access macros */
 #ifndef __BIG_ENDIAN
drivers/staging/brcm80211/include/chipcommon.h +1 -6
index 9ca2e69..ee1130f 100644
@@ -17,12 +17,7 @@
 #ifndef	_SBCHIPC_H
 #define	_SBCHIPC_H
 
-/* cpp contortions to concatenate w/arg prescan */
-#ifndef PAD
-#define	_PADLINE(line)	pad ## line
-#define	_XSTR(line)	_PADLINE(line)
-#define	PAD		_XSTR(__LINE__)
-#endif				/* PAD */
+#include "bcmdefs.h"		/* for PAD macro */
 
 typedef volatile struct {
 	u32 chipid;		/* 0x0 */
Signature · 1 line
1.7.4.1
#66 lore raw

PATCH 48/83 staging: brcm80211: remove phy_version.h

In reply to Roland Vossen

From: Arend van Spriel <[email protected]>

Removed the file phy_version.h from the driver sources. It was not used. For keeping track of the phy version, which is a separately developed component, one definition has been kept and placed in wlc_phy_int.h.

---
 .../staging/brcm80211/brcmsmac/phy/phy_version.h   |   36 --------------------
 .../staging/brcm80211/brcmsmac/phy/wlc_phy_int.h   |    2 +
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c   |    1 -
 3 files changed, 2 insertions(+), 37 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmsmac/phy/phy_version.h
drivers/staging/brcm80211/brcmsmac/phy/phy_version.h deleted +0 -36
deleted file mode 100644
index 51a2238..0000000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef phy_version_h_
-#define phy_version_h_
-
-#define	PHY_MAJOR_VERSION		1
-
-#define	PHY_MINOR_VERSION		82
-
-#define	PHY_RC_NUMBER		8
-
-#define	PHY_INCREMENTAL_NUMBER	0
-
-#define	PHY_BUILD_NUMBER		0
-
-#define	PHY_VERSION			{ 1, 82, 8, 0 }
-
-#define	PHY_VERSION_NUM		0x01520800
-
-#define	PHY_VERSION_STR		"1.82.8.0"
-
-#endif				/* phy_version_h_ */
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h +2 -0
index 51e37aa..92064ba 100644
@@ -23,6 +23,8 @@
 
 #include <wlc_phy_hal.h>
 
+#define	PHY_VERSION			{ 1, 82, 8, 0 }
+
 #define PHYHAL_ERROR	0x0001
 #define PHYHAL_TRACE	0x0002
 #define PHYHAL_INFORM	0x0004
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +0 -1
index 0f4a1cc..6856a60 100644
@@ -36,7 +36,6 @@
 #include "d11.h"
 #include "wlc_types.h"
 #include "wlc_cfg.h"
-#include "phy/phy_version.h"
 #include "wlc_key.h"
 #include "wlc_channel.h"
 #include "wlc_scb.h"
Signature · 1 line
1.7.4.1
#67 lore raw

PATCH 49/83 staging: brcm80211: remove BCMEMBEDIMAGE related codes from fullmac

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove BCMEMBEDIMAGE related codes in fullmac driver as we don't need this in firmware download routine.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |  120 +------------------------
 1 files changed, 1 insertions(+), 119 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -119
index 835beaa..ad3f0e6 100644
@@ -21,10 +21,6 @@
 #include <bcmdefs.h>
 #include <bcmsdh.h>
 
-#ifdef BCMEMBEDIMAGE
-#include BCMEMBEDIMAGE
-#endif				/* BCMEMBEDIMAGE */
-
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <bcmdevs.h>
@@ -633,9 +629,6 @@ static int _dhdsdio_download_firmware(struct dhd_bus *bus);
 
 static int dhdsdio_download_code_file(struct dhd_bus *bus, char *image_path);
 static int dhdsdio_download_nvram(struct dhd_bus *bus);
-#ifdef BCMEMBEDIMAGE
-static int dhdsdio_download_code_array(struct dhd_bus *bus);
-#endif
 static void dhdsdio_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase);
 static int dhdsdio_chip_attach(struct dhd_bus *bus, void *regs);
 static void dhdsdio_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase);
@@ -5587,97 +5580,6 @@ void dhd_bus_unregister(void)
 	bcmsdh_unregister();
 }
 
-#ifdef BCMEMBEDIMAGE
-static int dhdsdio_download_code_array(struct dhd_bus *bus)
-{
-	int bcmerror = -1;
-	int offset = 0;
-
-	DHD_INFO(("%s: download embedded firmware...\n", __func__));
-
-	/* Download image */
-	while ((offset + MEMBLOCK) < sizeof(dlarray)) {
-		bcmerror =
-		    dhdsdio_membytes(bus, true, offset, dlarray + offset,
-				     MEMBLOCK);
-		if (bcmerror) {
-			DHD_ERROR(("%s: error %d on writing %d membytes at "
-				"0x%08x\n",
-				__func__, bcmerror, MEMBLOCK, offset));
-			goto err;
-		}
-
-		offset += MEMBLOCK;
-	}
-
-	if (offset < sizeof(dlarray)) {
-		bcmerror = dhdsdio_membytes(bus, true, offset,
-					    dlarray + offset,
-					    sizeof(dlarray) - offset);
-		if (bcmerror) {
-			DHD_ERROR(("%s: error %d on writing %d membytes at "
-				"0x%08x\n", __func__, bcmerror,
-				sizeof(dlarray) - offset, offset));
-			goto err;
-		}
-	}
-#ifdef DHD_DEBUG
-	/* Upload and compare the downloaded code */
-	{
-		unsigned char *ularray;
-
-		ularray = kmalloc(bus->ramsize, GFP_ATOMIC);
-		if (!ularray) {
-			bcmerror = -ENOMEM;
-			goto err;
-		}
-		/* Upload image to verify downloaded contents. */
-		offset = 0;
-		memset(ularray, 0xaa, bus->ramsize);
-		while ((offset + MEMBLOCK) < sizeof(dlarray)) {
-			bcmerror =
-			    dhdsdio_membytes(bus, false, offset,
-					     ularray + offset, MEMBLOCK);
-			if (bcmerror) {
-				DHD_ERROR(("%s: error %d on reading %d membytes"
-					" at 0x%08x\n",
-					__func__, bcmerror, MEMBLOCK, offset));
-				goto free;
-			}
-
-			offset += MEMBLOCK;
-		}
-
-		if (offset < sizeof(dlarray)) {
-			bcmerror = dhdsdio_membytes(bus, false, offset,
-						    ularray + offset,
-						    sizeof(dlarray) - offset);
-			if (bcmerror) {
-				DHD_ERROR(("%s: error %d on reading %d membytes at 0x%08x\n",
-				__func__, bcmerror,
-				sizeof(dlarray) - offset, offset));
-				goto free;
-			}
-		}
-
-		if (memcmp(dlarray, ularray, sizeof(dlarray))) {
-			DHD_ERROR(("%s: Downloaded image is corrupted.\n",
-				   __func__));
-			ASSERT(0);
-			goto free;
-		} else
-			DHD_ERROR(("%s: Download/Upload/Compare succeeded.\n",
-				__func__));
-free:
-		kfree(ularray);
-	}
-#endif				/* DHD_DEBUG */
-
-err:
-	return bcmerror;
-}
-#endif				/* BCMEMBEDIMAGE */
-
 static int dhdsdio_download_code_file(struct dhd_bus *bus, char *fw_path)
 {
 	int bcmerror = -1;
@@ -5871,13 +5773,8 @@ static int _dhdsdio_download_firmware(struct dhd_bus *bus)
 	bool dlok = false;	/* download firmware succeeded */
 
 	/* Out immediately if no image to download */
-	if ((bus->fw_path == NULL) || (bus->fw_path[0] == '\0')) {
-#ifdef BCMEMBEDIMAGE
-		embed = true;
-#else
+	if ((bus->fw_path == NULL) || (bus->fw_path[0] == '\0'))
 		return bcmerror;
-#endif
-	}
 
 	/* Keep arm in reset */
 	if (dhdsdio_download_state(bus, true)) {
@@ -5890,27 +5787,12 @@ static int _dhdsdio_download_firmware(struct dhd_bus *bus)
 		if (dhdsdio_download_code_file(bus, bus->fw_path)) {
 			DHD_ERROR(("%s: dongle image file download failed\n",
 				   __func__));
-#ifdef BCMEMBEDIMAGE
-			embed = true;
-#else
 			goto err;
-#endif
 		} else {
 			embed = false;
 			dlok = true;
 		}
 	}
-#ifdef BCMEMBEDIMAGE
-	if (embed) {
-		if (dhdsdio_download_code_array(bus)) {
-			DHD_ERROR(("%s: dongle image array download failed\n",
-				   __func__));
-			goto err;
-		} else {
-			dlok = true;
-		}
-	}
-#endif
 	if (!dlok) {
 		DHD_ERROR(("%s: dongle image download failed\n", __func__));
 		goto err;
Signature · 1 line
1.7.4.1
#68 lore raw

PATCH 50/83 staging: brcm80211: absorb bcmcdc.h into dhd_cdc.c

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Merge bcmcdc.h into dhd_cdc.c in fullmac as it's only used by dhd_cdc.c

---
 drivers/staging/brcm80211/brcmfmac/bcmcdc.h  |   98 --------------------------
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c |   75 +++++++++++++++++---
 2 files changed, 64 insertions(+), 109 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmcdc.h
drivers/staging/brcm80211/brcmfmac/bcmcdc.h deleted +0 -98
deleted file mode 100644
index ed4c4a5..0000000
@@ -1,98 +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/if_ether.h>
-
-typedef struct cdc_ioctl {
-	u32 cmd;		/* ioctl command value */
-	u32 len;		/* lower 16: output buflen; upper 16:
-				 input buflen (excludes header) */
-	u32 flags;		/* flag defns given below */
-	u32 status;		/* status code returned from the device */
-} cdc_ioctl_t;
-
-/* Max valid buffer size that can be sent to the dongle */
-#define CDC_MAX_MSG_SIZE	(ETH_FRAME_LEN+ETH_FCS_LEN)
-
-/* len field is divided into input and output buffer lengths */
-#define CDCL_IOC_OUTLEN_MASK   0x0000FFFF	/* maximum or expected
-						 response length, */
-					   /* excluding IOCTL header */
-#define CDCL_IOC_OUTLEN_SHIFT  0
-#define CDCL_IOC_INLEN_MASK    0xFFFF0000	/* input buffer length,
-						 excluding IOCTL header */
-#define CDCL_IOC_INLEN_SHIFT   16
-
-/* CDC flag definitions */
-#define CDCF_IOC_ERROR		0x01	/* 0=success, 1=ioctl cmd failed */
-#define CDCF_IOC_SET		0x02	/* 0=get, 1=set cmd */
-#define CDCF_IOC_IF_MASK	0xF000	/* I/F index */
-#define CDCF_IOC_IF_SHIFT	12
-#define CDCF_IOC_ID_MASK	0xFFFF0000	/* used to uniquely id an ioctl
-						 req/resp pairing */
-#define CDCF_IOC_ID_SHIFT	16	/* # of bits of shift for ID Mask */
-
-#define CDC_IOC_IF_IDX(flags)	\
-	(((flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT)
-#define CDC_IOC_ID(flags)	\
-	(((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
-
-#define CDC_GET_IF_IDX(hdr) \
-	((int)((((hdr)->flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT))
-#define CDC_SET_IF_IDX(hdr, idx) \
-	((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | \
-	((idx) << CDCF_IOC_IF_SHIFT)))
-
-/*
- * BDC header
- *
- *   The BDC header is used on data packets to convey priority across USB.
- */
-
-#define	BDC_HEADER_LEN		4
-
-#define BDC_PROTO_VER		1	/* Protocol version */
-
-#define BDC_FLAG_VER_MASK	0xf0	/* Protocol version mask */
-#define BDC_FLAG_VER_SHIFT	4	/* Protocol version shift */
-
-#define BDC_FLAG__UNUSED	0x03	/* Unassigned */
-#define BDC_FLAG_SUM_GOOD	0x04	/* Dongle has verified good
-					 RX checksums */
-#define BDC_FLAG_SUM_NEEDED	0x08	/* Dongle needs to do TX checksums */
-
-#define BDC_PRIORITY_MASK	0x7
-
-#define BDC_FLAG2_FC_FLAG	0x10	/* flag to indicate if pkt contains */
-						/* FLOW CONTROL info only */
-#define BDC_PRIORITY_FC_SHIFT	4	/* flow control info shift */
-
-#define BDC_FLAG2_IF_MASK	0x0f	/* APSTA: interface on which the
-					 packet was received */
-#define BDC_FLAG2_IF_SHIFT	0
-
-#define BDC_GET_IF_IDX(hdr) \
-	((int)((((hdr)->flags2) & BDC_FLAG2_IF_MASK) >> BDC_FLAG2_IF_SHIFT))
-#define BDC_SET_IF_IDX(hdr, idx) \
-	((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | \
-	((idx) << BDC_FLAG2_IF_SHIFT)))
-
-struct bdc_header {
-	u8 flags;		/* Flags */
-	u8 priority;		/* 802.1d Priority 0:2 bits, 4:7 flow
-				 control info for usb */
-	u8 flags2;
-	u8 rssi;
-};
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +64 -11

147 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#69 lore raw

Re: [PATCH 50/83] staging: brcm80211: absorb bcmcdc.h into dhd_cdc.c

Quoted 8 lines · Roland Vossen

From: Franky Lin <[email protected]>

Merge bcmcdc.h into dhd_cdc.c in fullmac as it's only used by dhd_cdc.c

Again, you might want to mention the typedef elimination in the description.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#70 lore raw

Re: [PATCH 50/83] staging: brcm80211: absorb bcmcdc.h into dhd_cdc.c

Quoted 6 lines · Julian Calaby
Quoted 5 lines · Roland Vossen

From: Franky Lin<[email protected]>

Merge bcmcdc.h into dhd_cdc.c in fullmac as it's only used by dhd_cdc.c

Quoted 8 lines
Quoted 3 lines

Again, you might want to mention the typedef elimination in the description.

Thanks,

Hi Julian,

Sorry for the late response. I removed the typedef to fix the checkpatch warning. I will keep this in mind for the future patches.

Thanks for remarks.

Franky

#71 lore raw

PATCH 51/83 staging: brcm80211: clean up dhd.h in fullmac

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove #include lines in dhd.h

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |    2 ++
 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c  |    4 ++--
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |    1 +
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    1 +
 drivers/staging/brcm80211/brcmfmac/dhd.h           |   17 -----------------
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c       |    2 ++
 drivers/staging/brcm80211/brcmfmac/dhd_common.c    |    3 +++
 .../staging/brcm80211/brcmfmac/dhd_custom_gpio.c   |    3 +++
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |    1 +
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |    3 +++
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   |    3 +++
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         |    2 ++
 12 files changed, 23 insertions(+), 19 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +2 -0
index e11c615..b8af4ed 100644
@@ -18,9 +18,11 @@
 #include <linux/types.h>
 #include <linux/netdevice.h>
 #include <linux/pci_ids.h>
+#include <linux/sched.h>
 #include <bcmdefs.h>
 #include <bcmdevs.h>
 #include <bcmutils.h>
+#include <bcmwifi.h>
 #include <bcmsoc.h>
 
 #include <bcmsdh.h>		/* BRCM API for SDIO
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +2 -2
index d441500..c0b9330 100644
@@ -23,16 +23,16 @@
 #include <linux/netdevice.h>
 #include <linux/pci.h>
 #include <linux/completion.h>
+#include <linux/sched.h>
 
 #include <bcmdefs.h>
 #include <bcmdevs.h>
 #include <bcmutils.h>
+#include <bcmwifi.h>
 
 #if defined(OOB_INTR_ONLY)
 #include <linux/irq.h>
 extern void dhdsdio_isr(void *args);
-#include <dngl_stats.h>
-#include <dhd.h>
 #endif				/* defined(OOB_INTR_ONLY) */
 #if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270)
 #if !defined(BCMPLATFORM_BUS)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +1 -0
index cc4738a..067404b 100644
@@ -18,6 +18,7 @@
 #include <bcmdefs.h>
 #include <bcmdevs.h>
 #include <bcmutils.h>
+#include <bcmwifi.h>
 #include <sdio.h>		/* SDIO Device and Protocol Specs */
 #include <sdioh.h>		/* SDIO Host Controller Specification */
 #include <bcmsdbus.h>		/* bcmsdh to/from specific controller APIs */
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +1 -0
index 2792a4d..196b15e 100644
@@ -18,6 +18,7 @@
 #include <linux/netdevice.h>
 #include <bcmdefs.h>
 #include <bcmutils.h>
+#include <bcmwifi.h>
 #include <sdio.h>		/* SDIO Specs */
 #include <bcmsdbus.h>		/* bcmsdh to/from specific controller APIs */
 #include <sdiovar.h>		/* to get msglevel bit values */
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -17
index 081cda0..1fc5202 100644
@@ -21,23 +21,6 @@
 #ifndef _dhd_h_
 #define _dhd_h_
 
-#include <linux/sched.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/skbuff.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/random.h>
-#include <linux/spinlock.h>
-#include <linux/ethtool.h>
-#include <linux/suspend.h>
-#include <asm/uaccess.h>
-#include <asm/unaligned.h>
-#include "bcmdefs.h"
-/* The kernel threading is sdio-specific */
-#include "bcmwifi.h"
-
 /* Forward decls */
 struct dhd_bus;
 struct dhd_prot;
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +2 -0
index 424eacb..f655322 100644
@@ -16,9 +16,11 @@
 
 #include <linux/types.h>
 #include <linux/netdevice.h>
+#include <linux/sched.h>
 #include <bcmdefs.h>
 
 #include <bcmutils.h>
+#include <bcmwifi.h>
 
 #include <dngl_stats.h>
 #include <dhd.h>
drivers/staging/brcm80211/brcmfmac/dhd_common.c +3 -0
index 85d87db..79df125 100644
@@ -15,8 +15,11 @@
  */
 #include <linux/kernel.h>
 #include <linux/string.h>
+#include <linux/sched.h>
 #include <bcmdefs.h>
+#include <bcmwifi.h>
 #include <linux/netdevice.h>
+#include <asm/unaligned.h>
 #include <bcmutils.h>
 #include <dngl_stats.h>
 #include <dhd.h>
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +3 -0
index abd41e3..a3ea415 100644
@@ -15,7 +15,10 @@
  */
 
 #include <linux/netdevice.h>
+#include <linux/sched.h>
 #include <bcmutils.h>
+#include <bcmdefs.h>
+#include <bcmwifi.h>
 
 #include <dngl_stats.h>
 #include <dhd.h>
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -0
index f356c56..b023fc8 100644
@@ -33,6 +33,7 @@
 #include <linux/uaccess.h>
 #include <bcmdefs.h>
 #include <bcmutils.h>
+#include <bcmwifi.h>
 
 #include <dngl_stats.h>
 #include <dhd.h>
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +3 -0
index ad3f0e6..cd0ea4b 100644
@@ -18,10 +18,13 @@
 #include <linux/kernel.h>
 #include <linux/pci_ids.h>
 #include <linux/netdevice.h>
+#include <linux/sched.h>
+#include <asm/unaligned.h>
 #include <bcmdefs.h>
 #include <bcmsdh.h>
 
 #include <bcmdefs.h>
+#include <bcmwifi.h>
 #include <bcmutils.h>
 #include <bcmdevs.h>
 
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +3 -0
index 6aa186e..2e5e996 100644
@@ -16,8 +16,11 @@
 
 #include <linux/kernel.h>
 #include <linux/if_arp.h>
+#include <linux/sched.h>
 
 #include <bcmutils.h>
+#include <bcmdefs.h>
+#include <bcmwifi.h>
 
 #include <asm/uaccess.h>
 
drivers/staging/brcm80211/brcmfmac/wl_iw.c +2 -0
index 9819a35..da052e7e 100644
@@ -18,8 +18,10 @@
 #include <linux/semaphore.h>
 #include <bcmdefs.h>
 #include <linux/netdevice.h>
+#include <linux/etherdevice.h>
 
 #include <bcmutils.h>
+#include <bcmwifi.h>
 
 #include <linux/if_arp.h>
 #include <asm/uaccess.h>
Signature · 1 line
1.7.4.1
#72 lore raw

PATCH 52/83 staging: brcm80211: absorb bcmsdpcm.h in fullmac

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Absorb bcmsdpcm.h into dhd_sdio.c

---
 drivers/staging/brcm80211/brcmfmac/bcmsdpcm.h |  208 -------------------------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |  127 +++++++++++++++-
 2 files changed, 123 insertions(+), 212 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdpcm.h
drivers/staging/brcm80211/brcmfmac/bcmsdpcm.h deleted +0 -208
deleted file mode 100644
index 21d6a3a..0000000
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef	_bcmsdpcm_h_
-#define	_bcmsdpcm_h_
-
-/*
- * Software allocation of To SB Mailbox resources
- */
-
-/* intstatus bits */
-#define I_SMB_NAK	I_SMB_SW0	/* To SB Mailbox Frame NAK */
-#define I_SMB_INT_ACK	I_SMB_SW1	/* To SB Mailbox Host Interrupt ACK */
-#define I_SMB_USE_OOB	I_SMB_SW2	/* To SB Mailbox Use OOB Wakeup */
-#define I_SMB_DEV_INT	I_SMB_SW3	/* To SB Mailbox Miscellaneous Interrupt */
-
-#define I_TOSBMAIL      (I_SMB_NAK | I_SMB_INT_ACK | I_SMB_USE_OOB | I_SMB_DEV_INT)
-
-/* tosbmailbox bits corresponding to intstatus bits */
-#define SMB_NAK		(1 << 0)	/* To SB Mailbox Frame NAK */
-#define SMB_INT_ACK	(1 << 1)	/* To SB Mailbox Host Interrupt ACK */
-#define SMB_USE_OOB	(1 << 2)	/* To SB Mailbox Use OOB Wakeup */
-#define SMB_DEV_INT	(1 << 3)	/* To SB Mailbox Miscellaneous Interrupt */
-#define SMB_MASK	0x0000000f	/* To SB Mailbox Mask */
-
-/* tosbmailboxdata */
-#define SMB_DATA_VERSION_MASK	0x00ff0000	/* host protocol version (sent with F2 enable) */
-#define SMB_DATA_VERSION_SHIFT	16	/* host protocol version (sent with F2 enable) */
-
-/*
- * Software allocation of To Host Mailbox resources
- */
-
-/* intstatus bits */
-#define I_HMB_FC_STATE	I_HMB_SW0	/* To Host Mailbox Flow Control State */
-#define I_HMB_FC_CHANGE	I_HMB_SW1	/* To Host Mailbox Flow Control State Changed */
-#define I_HMB_FRAME_IND	I_HMB_SW2	/* To Host Mailbox Frame Indication */
-#define I_HMB_HOST_INT	I_HMB_SW3	/* To Host Mailbox Miscellaneous Interrupt */
-
-#define I_TOHOSTMAIL    (I_HMB_FC_CHANGE | I_HMB_FRAME_IND | I_HMB_HOST_INT)
-
-/* tohostmailbox bits corresponding to intstatus bits */
-#define HMB_FC_ON	(1 << 0)	/* To Host Mailbox Flow Control State */
-#define HMB_FC_CHANGE	(1 << 1)	/* To Host Mailbox Flow Control State Changed */
-#define HMB_FRAME_IND	(1 << 2)	/* To Host Mailbox Frame Indication */
-#define HMB_HOST_INT	(1 << 3)	/* To Host Mailbox Miscellaneous Interrupt */
-#define HMB_MASK	0x0000000f	/* To Host Mailbox Mask */
-
-/* tohostmailboxdata */
-#define HMB_DATA_NAKHANDLED	1	/* we're ready to retransmit NAK'd frame to host */
-#define HMB_DATA_DEVREADY	2	/* we're ready to to talk to host after enable */
-#define HMB_DATA_FC		4	/* per prio flowcontrol update flag to host */
-#define HMB_DATA_FWREADY	8	/* firmware is ready for protocol activity */
-
-#define HMB_DATA_FCDATA_MASK	0xff000000	/* per prio flowcontrol data */
-#define HMB_DATA_FCDATA_SHIFT	24	/* per prio flowcontrol data */
-
-#define HMB_DATA_VERSION_MASK	0x00ff0000	/* device protocol version (with devready) */
-#define HMB_DATA_VERSION_SHIFT	16	/* device protocol version (with devready) */
-
-/*
- * Software-defined protocol header
- */
-
-/* Current protocol version */
-#define SDPCM_PROT_VERSION	4
-
-/* SW frame header */
-#define SDPCM_SEQUENCE_MASK		0x000000ff	/* Sequence Number Mask */
-#define SDPCM_PACKET_SEQUENCE(p) (((u8 *)p)[0] & 0xff)	/* p starts w/SW Header */
-
-#define SDPCM_CHANNEL_MASK		0x00000f00	/* Channel Number Mask */
-#define SDPCM_CHANNEL_SHIFT		8	/* Channel Number Shift */
-#define SDPCM_PACKET_CHANNEL(p) (((u8 *)p)[1] & 0x0f)	/* p starts w/SW Header */
-
-#define SDPCM_FLAGS_MASK		0x0000f000	/* Mask of flag bits */
-#define SDPCM_FLAGS_SHIFT		12	/* Flag bits shift */
-#define SDPCM_PACKET_FLAGS(p) ((((u8 *)p)[1] & 0xf0) >> 4)	/* p starts w/SW Header */
-
-/* Next Read Len: lookahead length of next frame, in 16-byte units (rounded up) */
-#define SDPCM_NEXTLEN_MASK		0x00ff0000	/* Next Read Len Mask */
-#define SDPCM_NEXTLEN_SHIFT		16	/* Next Read Len Shift */
-#define SDPCM_NEXTLEN_VALUE(p) ((((u8 *)p)[2] & 0xff) << 4)	/* p starts w/SW Header */
-#define SDPCM_NEXTLEN_OFFSET		2
-
-/* Data Offset from SOF (HW Tag, SW Tag, Pad) */
-#define SDPCM_DOFFSET_OFFSET		3	/* Data Offset */
-#define SDPCM_DOFFSET_VALUE(p) 		(((u8 *)p)[SDPCM_DOFFSET_OFFSET] & 0xff)
-#define SDPCM_DOFFSET_MASK		0xff000000
-#define SDPCM_DOFFSET_SHIFT		24
-
-#define SDPCM_FCMASK_OFFSET		4	/* Flow control */
-#define SDPCM_FCMASK_VALUE(p)		(((u8 *)p)[SDPCM_FCMASK_OFFSET] & 0xff)
-#define SDPCM_WINDOW_OFFSET		5	/* Credit based fc */
-#define SDPCM_WINDOW_VALUE(p)		(((u8 *)p)[SDPCM_WINDOW_OFFSET] & 0xff)
-#define SDPCM_VERSION_OFFSET		6	/* Version # */
-#define SDPCM_VERSION_VALUE(p)		(((u8 *)p)[SDPCM_VERSION_OFFSET] & 0xff)
-#define SDPCM_UNUSED_OFFSET		7	/* Spare */
-#define SDPCM_UNUSED_VALUE(p)		(((u8 *)p)[SDPCM_UNUSED_OFFSET] & 0xff)
-
-#define SDPCM_SWHEADER_LEN	8	/* SW header is 64 bits */
-
-/* logical channel numbers */
-#define SDPCM_CONTROL_CHANNEL	0	/* Control Request/Response Channel Id */
-#define SDPCM_EVENT_CHANNEL	1	/* Asyc Event Indication Channel Id */
-#define SDPCM_DATA_CHANNEL	2	/* Data Xmit/Recv Channel Id */
-#define SDPCM_GLOM_CHANNEL	3	/* For coalesced packets (superframes) */
-#define SDPCM_TEST_CHANNEL	15	/* Reserved for test/debug packets */
-#define SDPCM_MAX_CHANNEL	15
-
-#define SDPCM_SEQUENCE_WRAP	256	/* wrap-around val for eight-bit frame seq number */
-
-#define SDPCM_FLAG_RESVD0	0x01
-#define SDPCM_FLAG_RESVD1	0x02
-#define SDPCM_FLAG_GSPI_TXENAB	0x04
-#define SDPCM_FLAG_GLOMDESC	0x08	/* Superframe descriptor mask */
-
-/* For GLOM_CHANNEL frames, use a flag to indicate descriptor frame */
-#define SDPCM_GLOMDESC_FLAG	(SDPCM_FLAG_GLOMDESC << SDPCM_FLAGS_SHIFT)
-
-#define SDPCM_GLOMDESC(p)	(((u8 *)p)[1] & 0x80)
-
-/* For TEST_CHANNEL packets, define another 4-byte header */
-#define SDPCM_TEST_HDRLEN	4	/* Generally: Cmd(1), Ext(1), Len(2);
-					 * Semantics of Ext byte depend on command.
-					 * Len is current or requested frame length, not
-					 * including test header; sent little-endian.
-					 */
-#define SDPCM_TEST_DISCARD	0x01	/* Receiver discards. Ext is a pattern id. */
-#define SDPCM_TEST_ECHOREQ	0x02	/* Echo request. Ext is a pattern id. */
-#define SDPCM_TEST_ECHORSP	0x03	/* Echo response. Ext is a pattern id. */
-#define SDPCM_TEST_BURST	0x04	/* Receiver to send a burst. Ext is a frame count */
-#define SDPCM_TEST_SEND		0x05	/* Receiver sets send mode. Ext is boolean on/off */
-
-/* Handy macro for filling in datagen packets with a pattern */
-#define SDPCM_TEST_FILL(byteno, id)	((u8)(id + byteno))
-
-/*
- * Software counters (first part matches hardware counters)
- */
-
-typedef volatile struct {
-	u32 cmd52rd;		/* Cmd52RdCount, SDIO: cmd52 reads */
-	u32 cmd52wr;		/* Cmd52WrCount, SDIO: cmd52 writes */
-	u32 cmd53rd;		/* Cmd53RdCount, SDIO: cmd53 reads */
-	u32 cmd53wr;		/* Cmd53WrCount, SDIO: cmd53 writes */
-	u32 abort;		/* AbortCount, SDIO: aborts */
-	u32 datacrcerror;	/* DataCrcErrorCount, SDIO: frames w/CRC error */
-	u32 rdoutofsync;	/* RdOutOfSyncCount, SDIO/PCMCIA: Rd Frm out of sync */
-	u32 wroutofsync;	/* RdOutOfSyncCount, SDIO/PCMCIA: Wr Frm out of sync */
-	u32 writebusy;	/* WriteBusyCount, SDIO: device asserted "busy" */
-	u32 readwait;	/* ReadWaitCount, SDIO: no data ready for a read cmd */
-	u32 readterm;	/* ReadTermCount, SDIO: read frame termination cmds */
-	u32 writeterm;	/* WriteTermCount, SDIO: write frames termination cmds */
-	u32 rxdescuflo;	/* receive descriptor underflows */
-	u32 rxfifooflo;	/* receive fifo overflows */
-	u32 txfifouflo;	/* transmit fifo underflows */
-	u32 runt;		/* runt (too short) frames recv'd from bus */
-	u32 badlen;		/* frame's rxh len does not match its hw tag len */
-	u32 badcksum;	/* frame's hw tag chksum doesn't agree with len value */
-	u32 seqbreak;	/* break in sequence # space from one rx frame to the next */
-	u32 rxfcrc;		/* frame rx header indicates crc error */
-	u32 rxfwoos;		/* frame rx header indicates write out of sync */
-	u32 rxfwft;		/* frame rx header indicates write frame termination */
-	u32 rxfabort;	/* frame rx header indicates frame aborted */
-	u32 woosint;		/* write out of sync interrupt */
-	u32 roosint;		/* read out of sync interrupt */
-	u32 rftermint;	/* read frame terminate interrupt */
-	u32 wftermint;	/* write frame terminate interrupt */
-} sdpcmd_cnt_t;
-
-/*
- * Shared structure between dongle and the host.
- * The structure contains pointers to trap or assert information.
- */
-#define SDPCM_SHARED_VERSION       0x0002
-#define SDPCM_SHARED_VERSION_MASK  0x00FF
-#define SDPCM_SHARED_ASSERT_BUILT  0x0100
-#define SDPCM_SHARED_ASSERT        0x0200
-#define SDPCM_SHARED_TRAP          0x0400
-
-typedef struct {
-	u32 flags;
-	u32 trap_addr;
-	u32 assert_exp_addr;
-	u32 assert_file_addr;
-	u32 assert_line;
-	u32 console_addr;	/* Address of rte_cons_t */
-	u32 msgtrace_addr;
-	u8 tag[32];
-} sdpcm_shared_t;
-
-extern sdpcm_shared_t sdpcm_shared;
-
-#endif				/* _bcmsdpcm_h_ */
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +123 -4

163 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#73 lore raw

PATCH 53/83 staging: brcm80211: absorb msgtrace.h in fullmac

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Absorb msgtrace.h into dhd_common.c

---
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |   28 +++++++++--
 drivers/staging/brcm80211/brcmfmac/msgtrace.h   |   61 -----------------------
 2 files changed, 23 insertions(+), 66 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/msgtrace.h
drivers/staging/brcm80211/brcmfmac/dhd_common.c +23 -5
index 79df125..22e5efd 100644
@@ -26,7 +26,6 @@
 #include <dhd_bus.h>
 #include <dhd_proto.h>
 #include <dhd_dbg.h>
-#include <msgtrace.h>
 
 #define BRCM_OUI		"\x00\x10\x18"
 #define DOT11_OUI_LEN			3
@@ -57,6 +56,8 @@ void dhd_iscan_unlock(void);
 #endif
 
 #define EPI_VERSION_STR         "4.218.248.5"
+#define MSGTRACE_VERSION	1
+
 #ifdef DHD_DEBUG
 const char dhd_version[] =
 "Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__
@@ -118,6 +119,22 @@ const bcm_iovar_t dhd_iovars[] = {
 	{NULL, 0, 0, 0, 0}
 };
 
+/* Message trace header */
+struct msgtrace_hdr {
+	u8 version;
+	u8 spare;
+	u16 len;		/* Len of the trace */
+	u32 seqnum;		/* Sequence number of message. Useful
+				 * if the messsage has been lost
+				 * because of DMA error or a bus reset
+				 * (ex: SDIO Func2)
+				 */
+	u32 discarded_bytes;	/* Number of discarded bytes because of
+				 trace overflow  */
+	u32 discarded_printf;	/* Number of discarded printf
+				 because of trace overflow */
+} __packed;
+
 void dhd_common_init(void)
 {
 	/* Init global variables at run-time, not as part of the declaration.
@@ -732,12 +749,12 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
 	case WLC_E_TRACE:
 		{
 			static u32 seqnum_prev;
-			msgtrace_hdr_t hdr;
+			struct msgtrace_hdr hdr;
 			u32 nblost;
 			char *s, *p;
 
 			buf = (unsigned char *) event_data;
-			memcpy(&hdr, buf, MSGTRACE_HDRLEN);
+			memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));
 
 			if (hdr.version != MSGTRACE_VERSION) {
 				DHD_ERROR(
@@ -751,7 +768,8 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
 			}
 
 			/* There are 2 bytes available at the end of data */
-			buf[MSGTRACE_HDRLEN + be16_to_cpu(hdr.len)] = '\0';
+			*(buf + sizeof(struct msgtrace_hdr)
+				 + be16_to_cpu(hdr.len)) = '\0';
 
 			if (be32_to_cpu(hdr.discarded_bytes)
 			    || be32_to_cpu(hdr.discarded_printf)) {
@@ -774,7 +792,7 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
 			 * avoid display big
 			 * printf (issue with Linux printk )
 			 */
-			p = (char *)&buf[MSGTRACE_HDRLEN];
+			p = (char *)&buf[sizeof(struct msgtrace_hdr)];
 			while ((s = strstr(p, "\n")) != NULL) {
 				*s = '\0';
 				printk(KERN_DEBUG"%s\n", p);
drivers/staging/brcm80211/brcmfmac/msgtrace.h deleted +0 -61

61 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#74 lore raw

PATCH 54/83 staging: brcm80211: combine sbsdpcmdev.h and sbsdio.h

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Combine two head files both for sdio sb configuration in fullmac

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |   16 +-
 drivers/staging/brcm80211/brcmfmac/sbsdio.h     |  221 +++++++++++++++++++++
 drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h |  240 -----------------------
 3 files changed, 229 insertions(+), 248 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +8 -8
index 4847026..6653655 100644
@@ -129,7 +129,6 @@ typedef struct {
 
 #include <sdio.h>
 #include <sbsdio.h>
-#include <sbsdpcmdev.h>
 
 #include <dngl_stats.h>
 #include <dhd.h>
@@ -379,7 +378,8 @@ extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
 
 /* Core reg address translation */
 #define CORE_CC_REG(base, field)	(base + offsetof(chipcregs_t, field))
-#define CORE_BUS_REG(base, field)	(base + offsetof(sdpcmd_regs_t, field))
+#define CORE_BUS_REG(base, field) \
+		(base + offsetof(struct sdpcmd_regs, field))
 #define CORE_SB(base, field) \
 		(base + SBCONFIGOFF + offsetof(sbconfig_t, field))
 
@@ -433,7 +433,7 @@ typedef struct dhd_bus {
 	uint varsz;		/* Size of variables buffer */
 	u32 sbaddr;		/* Current SB window pointer (-1, invalid) */
 
-	sdpcmd_regs_t *regs;	/* Registers for SDIO core */
+	struct sdpcmd_regs *regs;	/* SDIO core */
 	uint sdpcmrev;		/* SDIO core revision */
 	uint armrev;		/* CPU core revision */
 	uint ramrev;		/* SOCRAM core revision */
@@ -1013,7 +1013,7 @@ static int dhdsdio_clkctl(dhd_bus_t *bus, uint target, bool pendok)
 int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
 {
 	bcmsdh_info_t *sdh = bus->sdh;
-	sdpcmd_regs_t *regs = bus->regs;
+	struct sdpcmd_regs *regs = bus->regs;
 	uint retries = 0;
 
 	DHD_INFO(("dhdsdio_bussleep: request %s (currently %s)\n",
@@ -1407,7 +1407,7 @@ static uint dhdsdio_sendfromq(dhd_bus_t *bus, uint maxframes)
 	u8 tx_prec_map;
 
 	dhd_pub_t *dhd = bus->dhd;
-	sdpcmd_regs_t *regs = bus->regs;
+	struct sdpcmd_regs *regs = bus->regs;
 
 	DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -3157,7 +3157,7 @@ exit:
 static void dhdsdio_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
 {
 	bcmsdh_info_t *sdh = bus->sdh;
-	sdpcmd_regs_t *regs = bus->regs;
+	struct sdpcmd_regs *regs = bus->regs;
 	uint retries = 0;
 	u16 lastrbc;
 	u8 hi, lo;
@@ -4342,7 +4342,7 @@ deliver:
 
 static u32 dhdsdio_hostmail(dhd_bus_t *bus)
 {
-	sdpcmd_regs_t *regs = bus->regs;
+	struct sdpcmd_regs *regs = bus->regs;
 	u32 intstatus = 0;
 	u32 hmb_data;
 	u8 fcbits;
@@ -4417,7 +4417,7 @@ static u32 dhdsdio_hostmail(dhd_bus_t *bus)
 bool dhdsdio_dpc(dhd_bus_t *bus)
 {
 	bcmsdh_info_t *sdh = bus->sdh;
-	sdpcmd_regs_t *regs = bus->regs;
+	struct sdpcmd_regs *regs = bus->regs;
 	u32 intstatus, newstatus = 0;
 	uint retries = 0;
 	uint rxlimit = dhd_rxbound;	/* Rx frames to read before resched */
drivers/staging/brcm80211/brcmfmac/sbsdio.h +221 -0

225 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sbsdpcmdev.h deleted +0 -240

240 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#75 lore raw

Re: [PATCH 54/83] staging: brcm80211: combine sbsdpcmdev.h and sbsdio.h

Quoted 7 lines · Roland Vossen

From: Franky Lin <[email protected]>

Combine two head files both for sdio sb configuration in fullmac

You might want to mention the typedef removal in the description of this and the other similar patches.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#76 lore raw

PATCH 55/83 staging: brmc80211: remove sdio.h from fullmac

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Use standard sdio.h from mmc core instead of private one

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c        |    1 -
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c  |   16 +-
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    1 -
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c      |   95 +---
 drivers/staging/brcm80211/brcmfmac/sdio.h          |  552 --------------------
 drivers/staging/brcm80211/include/bcmsdh.h         |   21 +
 6 files changed, 37 insertions(+), 649 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/sdio.h
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +0 -1
index b8af4ed..14c07e6 100644
@@ -30,7 +30,6 @@
 #include <bcmsdbus.h>		/* common SDIO/controller interface */
 #include <sbsdio.h>		/* BRCM sdio device core */
 
-#include <sdio.h>		/* sdio spec */
 #include "dngl_stats.h"
 #include "dhd.h"
 
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +8 -8
index 067404b..6b2a450 100644
@@ -15,11 +15,11 @@
  */
 #include <linux/types.h>
 #include <linux/netdevice.h>
+#include <linux/mmc/sdio.h>
 #include <bcmdefs.h>
 #include <bcmdevs.h>
 #include <bcmutils.h>
 #include <bcmwifi.h>
-#include <sdio.h>		/* SDIO Device and Protocol Specs */
 #include <sdioh.h>		/* SDIO Host Controller Specification */
 #include <bcmsdbus.h>		/* bcmsdh to/from specific controller APIs */
 #include <sdiovar.h>		/* ioctl/iovars */
@@ -75,16 +75,16 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
 	sd_trace(("%s\n", __func__));
 
 	/* Get the Card's common CIS address */
-	sd->com_cis_ptr = sdioh_sdmmc_get_cisaddr(sd, SDIOD_CCCR_CISPTR_0);
+	sd->com_cis_ptr = sdioh_sdmmc_get_cisaddr(sd, SDIO_CCCR_CIS);
 	sd->func_cis_ptr[0] = sd->com_cis_ptr;
 	sd_info(("%s: Card's Common CIS Ptr = 0x%x\n", __func__,
 		 sd->com_cis_ptr));
 
 	/* Get the Card's function CIS (for each function) */
-	for (fbraddr = SDIOD_FBR_STARTADDR, func = 1;
+	for (fbraddr = SDIO_FBR_BASE(1), func = 1;
 	     func <= sd->num_funcs; func++, fbraddr += SDIOD_FBR_SIZE) {
 		sd->func_cis_ptr[func] =
-		    sdioh_sdmmc_get_cisaddr(sd, SDIOD_FBR_CISPTR_0 + fbraddr);
+		    sdioh_sdmmc_get_cisaddr(sd, SDIO_FBR_CIS + fbraddr);
 		sd_info(("%s: Function %d CIS Ptr = 0x%x\n", __func__, func,
 			 sd->func_cis_ptr[func]));
 	}
@@ -642,7 +642,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
 			 * Handle F2 enable
 			 * as a special case.
 			 */
-			if (regaddr == SDIOD_CCCR_IOEN) {
+			if (regaddr == SDIO_CCCR_IOEx) {
 				if (gInstance->func[2]) {
 					sdio_claim_host(gInstance->func[2]);
 					if (*byte & SDIO_FUNC_ENABLE_2) {
@@ -667,7 +667,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
 			}
 #if defined(MMC_SDIO_ABORT)
 			/* to allow abort command through F1 */
-			else if (regaddr == SDIOD_CCCR_IOABORT) {
+			else if (regaddr == SDIO_CCCR_ABORT) {
 				sdio_claim_host(gInstance->func[func]);
 				/*
 				 * this sdio_f0_writeb() can be replaced
@@ -955,8 +955,8 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func)
 	sd_trace(("%s: Enter\n", __func__));
 
 #if defined(MMC_SDIO_ABORT)
-	/* issue abort cmd52 command through F1 */
-	sdioh_request_byte(sd, SD_IO_OP_WRITE, SDIO_FUNC_0, SDIOD_CCCR_IOABORT,
+	/* issue abort cmd52 command through F0 */
+	sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
 			   &t_func);
 #endif				/* defined(MMC_SDIO_ABORT) */
 
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +0 -1
index 196b15e..f495d4b 100644
@@ -19,7 +19,6 @@
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <bcmwifi.h>
-#include <sdio.h>		/* SDIO Specs */
 #include <bcmsdbus.h>		/* bcmsdh to/from specific controller APIs */
 #include <sdiovar.h>		/* to get msglevel bit values */
 
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +8 -87

161 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/sdio.h deleted +0 -552

552 lines not on this page · raw message

drivers/staging/brcm80211/include/bcmsdh.h +21 -0
index 3b57dc1..ba3fd62 100644
@@ -38,6 +38,27 @@ extern const uint bcmsdh_msglevel;
 #define BCMSDH_INFO(x)
 #endif				/* BCMDBG */
 
+#define SDIO_FUNC_0		0
+#define SDIO_FUNC_1		1
+#define SDIO_FUNC_2		2
+
+#define SDIOD_FBR_SIZE  	0x100
+
+/* io_en */
+#define SDIO_FUNC_ENABLE_1	0x02
+#define SDIO_FUNC_ENABLE_2	0x04
+
+/* io_rdys */
+#define SDIO_FUNC_READY_1	0x02
+#define SDIO_FUNC_READY_2	0x04
+
+/* intr_status */
+#define INTR_STATUS_FUNC1	0x2
+#define INTR_STATUS_FUNC2	0x4
+
+/* Maximum number of I/O funcs */
+#define SDIOD_MAX_IOFUNCS	7
+
 /* forward declarations */
 typedef struct bcmsdh_info bcmsdh_info_t;
 typedef void (*bcmsdh_cb_fn_t) (void *);
Signature · 1 line
1.7.4.1
#77 lore raw

PATCH 56/83 staging: brcm80211: remove sdioh.h from fullmac

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove unused head file

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    1 -
 drivers/staging/brcm80211/brcmfmac/sdioh.h        |   63 ---------------------
 2 files changed, 0 insertions(+), 64 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmfmac/sdioh.h
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -1
index 6b2a450..3cea01f 100644
@@ -20,7 +20,6 @@
 #include <bcmdevs.h>
 #include <bcmutils.h>
 #include <bcmwifi.h>
-#include <sdioh.h>		/* SDIO Host Controller Specification */
 #include <bcmsdbus.h>		/* bcmsdh to/from specific controller APIs */
 #include <sdiovar.h>		/* ioctl/iovars */
 
drivers/staging/brcm80211/brcmfmac/sdioh.h deleted +0 -63

63 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#78 lore raw

PATCH 57/83 staging: brcm80211: clean up wl_cfg80211.h in fullmac

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove #include lines in wl_cfg80211.h

---
 .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c        |    1 +
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c     |    1 +
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h   |    4 ----
 3 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +1 -0
index f495d4b..fbc9abd 100644
@@ -16,6 +16,7 @@
 #include <linux/types.h>
 #include <linux/sched.h>	/* request_irq() */
 #include <linux/netdevice.h>
+#include <net/cfg80211.h>
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <bcmwifi.h>
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -0
index b023fc8..6ba50bb 100644
@@ -31,6 +31,7 @@
 #include <linux/fcntl.h>
 #include <linux/fs.h>
 #include <linux/uaccess.h>
+#include <net/cfg80211.h>
 #include <bcmdefs.h>
 #include <bcmutils.h>
 #include <bcmwifi.h>
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +0 -4
index 4bd0392..33fb03a 100644
@@ -17,10 +17,6 @@
 #ifndef _wl_cfg80211_h_
 #define _wl_cfg80211_h_
 
-#include <linux/wireless.h>
-#include <linux/wireless.h>
-#include <net/cfg80211.h>
-
 struct wl_conf;
 struct wl_iface;
 struct wl_priv;
Signature · 1 line
1.7.4.1
#79 lore raw

PATCH 58/83 staging: brcm80211: clean up wl_iw.h in fullmac

In reply to Roland Vossen

From: Franky Lin <[email protected]>

Remove #include lines in wl_iw.h

---
 .../staging/brcm80211/brcmfmac/dhd_custom_gpio.c   |    2 --
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         |    1 +
 drivers/staging/brcm80211/brcmfmac/wl_iw.h         |    2 --
 3 files changed, 1 insertions(+), 4 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +0 -2
index a3ea415..a942333 100644
@@ -23,8 +23,6 @@
 #include <dngl_stats.h>
 #include <dhd.h>
 
-#include <wl_iw.h>
-
 #define WL_ERROR(fmt, args...) printk(fmt, ##args)
 #define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
 
drivers/staging/brcm80211/brcmfmac/wl_iw.c +1 -0
index da052e7e..47960de 100644
@@ -19,6 +19,7 @@
 #include <bcmdefs.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/wireless.h>
 
 #include <bcmutils.h>
 #include <bcmwifi.h>
drivers/staging/brcm80211/brcmfmac/wl_iw.h +0 -2
index c92a8b5..aa8902c 100644
@@ -17,8 +17,6 @@
 #ifndef _wl_iw_h_
 #define _wl_iw_h_
 
-#include <linux/wireless.h>
-
 #define WL_SCAN_PARAMS_SSID_MAX	10
 #define GET_SSID	"SSID="
 #define GET_CHANNEL	"CH="
Signature · 1 line
1.7.4.1
#80 lore raw

PATCH 59/83 staging: brcm80211: removed wl_ (vendor specific acronym)

In reply to Roland Vossen

Replaced by brcms_, which is short hand for 'Broadcom softmac'.

---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c   |    2 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h   |   10 +-
 drivers/staging/brcm80211/brcmfmac/wl_iw.c         |    2 +-
 drivers/staging/brcm80211/brcmsmac/wl_dbg.h        |   67 +--
 drivers/staging/brcm80211/brcmsmac/wl_export.h     |   40 +-
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.c   |  624 ++++++++++----------
 drivers/staging/brcm80211/brcmsmac/wl_mac80211.h   |   38 +-
 drivers/staging/brcm80211/brcmsmac/wl_ucode.h      |   13 +-
 .../staging/brcm80211/brcmsmac/wl_ucode_loader.c   |   74 ++--
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |   40 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c      |   43 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.h      |   15 +-
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c  |   15 +-
 drivers/staging/brcm80211/brcmsmac/wlc_pub.h       |    8 +-
 drivers/staging/brcm80211/brcmsmac/wlc_types.h     |    4 +-
 drivers/staging/brcm80211/include/bcmdefs.h        |    4 +-
 16 files changed, 480 insertions(+), 519 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +1 -1
index 2e5e996..7e642cd 100644
@@ -46,7 +46,7 @@ static struct sdio_func *cfg80211_sdio_func;
 static struct wl_dev *wl_cfg80211_dev;
 static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
 
-u32 wl_dbg_level = WL_DBG_ERR;
+u32 brcmf_dbg_level = WL_DBG_ERR;
 
 #define WL_4329_FW_FILE "brcm/bcm4329-fullmac-4.bin"
 #define WL_4329_NVRAM_FILE "brcm/bcm4329-fullmac-4.txt"
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +5 -5
index 33fb03a..2469b90 100644
@@ -34,7 +34,7 @@ struct wl_ibss;
 
 #define	WL_ERR(fmt, args...)					\
 do {								\
-	if (wl_dbg_level & WL_DBG_ERR) {			\
+	if (brcmf_dbg_level & WL_DBG_ERR) {			\
 		if (net_ratelimit()) {				\
 			printk(KERN_ERR "ERROR @%s : " fmt,	\
 				__func__, ##args);		\
@@ -45,7 +45,7 @@ do {								\
 #if (defined BCMDBG)
 #define	WL_INFO(fmt, args...)					\
 do {								\
-	if (wl_dbg_level & WL_DBG_INFO) {			\
+	if (brcmf_dbg_level & WL_DBG_INFO) {			\
 		if (net_ratelimit()) {				\
 			printk(KERN_ERR "INFO @%s : " fmt,	\
 				__func__, ##args);		\
@@ -55,7 +55,7 @@ do {								\
 
 #define	WL_TRACE(fmt, args...)					\
 do {								\
-	if (wl_dbg_level & WL_DBG_TRACE) {			\
+	if (brcmf_dbg_level & WL_DBG_TRACE) {			\
 		if (net_ratelimit()) {				\
 			printk(KERN_ERR "TRACE @%s : " fmt,	\
 				__func__, ##args);		\
@@ -65,7 +65,7 @@ do {								\
 
 #define	WL_SCAN(fmt, args...)					\
 do {								\
-	if (wl_dbg_level & WL_DBG_SCAN) {			\
+	if (brcmf_dbg_level & WL_DBG_SCAN) {			\
 		if (net_ratelimit()) {				\
 			printk(KERN_ERR "SCAN @%s : " fmt,	\
 				__func__, ##args);		\
@@ -75,7 +75,7 @@ do {								\
 
 #define	WL_CONN(fmt, args...)					\
 do {								\
-	if (wl_dbg_level & WL_DBG_CONN) {			\
+	if (brcmf_dbg_level & WL_DBG_CONN) {			\
 		if (net_ratelimit()) {				\
 			printk(KERN_ERR "CONN @%s : " fmt,	\
 				__func__, ##args);		\
drivers/staging/brcm80211/brcmfmac/wl_iw.c +1 -1
index 47960de..974a6e0 100644
@@ -69,7 +69,7 @@ wl_iw_extra_params_t g_wl_iw_params;
 extern bool wl_iw_conn_status_str(u32 event_type, u32 status,
 				  u32 reason, char *stringBuf, uint buflen);
 
-uint wl_msg_level = WL_ERROR_VAL;
+uint brcm_msg_level = LOG_ERROR_VAL;
 
 #define MAX_WLIW_IOCTL_LEN 1024
 
drivers/staging/brcm80211/brcmsmac/wl_dbg.h +4 -63

78 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wl_export.h +20 -20
index 0fe0b24..01d3696 100644
@@ -18,30 +18,30 @@
 #define _wl_export_h_
 
 /* misc callbacks */
-struct wl_info;
-struct wl_if;
+struct brcms_info;
+struct brcms_if;
 struct wlc_if;
-extern void wl_init(struct wl_info *wl);
-extern uint wl_reset(struct wl_info *wl);
-extern void wl_intrson(struct wl_info *wl);
-extern u32 wl_intrsoff(struct wl_info *wl);
-extern void wl_intrsrestore(struct wl_info *wl, u32 macintmask);
-extern int wl_up(struct wl_info *wl);
-extern void wl_down(struct wl_info *wl);
-extern void wl_txflowcontrol(struct wl_info *wl, struct wl_if *wlif, bool state,
-			     int prio);
-extern bool wl_alloc_dma_resources(struct wl_info *wl, uint dmaddrwidth);
-extern bool wl_rfkill_set_hw_state(struct wl_info *wl);
+extern void brcms_init(struct brcms_info *wl);
+extern uint brcms_reset(struct brcms_info *wl);
+extern void brcms_intrson(struct brcms_info *wl);
+extern u32 brcms_intrsoff(struct brcms_info *wl);
+extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
+extern int brcms_up(struct brcms_info *wl);
+extern void brcms_down(struct brcms_info *wl);
+extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
+				bool state, int prio);
+extern bool wl_alloc_dma_resources(struct brcms_info *wl, uint dmaddrwidth);
+extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
 
 /* timer functions */
-struct wl_timer;
-extern struct wl_timer *wl_init_timer(struct wl_info *wl,
+struct brcms_timer;
+extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
 				      void (*fn) (void *arg), void *arg,
 				      const char *name);
-extern void wl_free_timer(struct wl_info *wl, struct wl_timer *timer);
-extern void wl_add_timer(struct wl_info *wl, struct wl_timer *timer, uint ms,
-			 int periodic);
-extern bool wl_del_timer(struct wl_info *wl, struct wl_timer *timer);
-extern void wl_msleep(struct wl_info *wl, uint ms);
+extern void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *timer);
+extern void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *timer,
+			    uint ms, int periodic);
+extern bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *timer);
+extern void brcms_msleep(struct brcms_info *wl, uint ms);
 
 #endif				/* _wl_export_h_ */
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +324 -300

1,492 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wl_mac80211.h +13 -25
index fafde6a..48ec6b0 100644
@@ -25,34 +25,34 @@
  * sleep so perimeter lock has to be a semaphore instead of spinlock. This requires timers to be
  * submitted to workqueue instead of being on kernel timer
  */
-struct wl_timer {
+struct brcms_timer {
 	struct timer_list timer;
-	struct wl_info *wl;
+	struct brcms_info *wl;
 	void (*fn) (void *);
 	void *arg;		/* argument to fn */
 	uint ms;
 	bool periodic;
 	bool set;
-	struct wl_timer *next;
+	struct brcms_timer *next;
 #ifdef BCMDBG
 	char *name;		/* Description of the timer */
 #endif
 };
 
-struct wl_if {
+struct brcms_if {
 	uint subunit;		/* WDS/BSS unit */
 	struct pci_dev *pci_dev;
 };
 
-#define WL_MAX_FW		4
-struct wl_firmware {
+#define MAX_FW_IMAGES		4
+struct brcms_firmware {
 	u32 fw_cnt;
-	const struct firmware *fw_bin[WL_MAX_FW];
-	const struct firmware *fw_hdr[WL_MAX_FW];
-	u32 hdr_num_entries[WL_MAX_FW];
+	const struct firmware *fw_bin[MAX_FW_IMAGES];
+	const struct firmware *fw_hdr[MAX_FW_IMAGES];
+	u32 hdr_num_entries[MAX_FW_IMAGES];
 };
 
-struct wl_info {
+struct brcms_info {
 	struct wlc_pub *pub;		/* pointer to public wlc state */
 	void *wlc;		/* pointer to private common os-independent data */
 	u32 magic;
@@ -62,32 +62,20 @@ struct wl_info {
 	spinlock_t lock;	/* per-device perimeter lock */
 	spinlock_t isr_lock;	/* per-device ISR synchronization lock */
 
-	/* bus type and regsva for unmap in wl_free() */
+	/* bus type and regsva for unmap in brcms_free() */
 	uint bcm_bustype;	/* bus type */
 	void *regsva;		/* opaque chip registers virtual address */
 
 	/* timer related fields */
 	atomic_t callbacks;	/* # outstanding callback functions */
-	struct wl_timer *timers;	/* timer cleanup queue */
+	struct brcms_timer *timers;	/* timer cleanup queue */
 
 	struct tasklet_struct tasklet;	/* dpc tasklet */
 	bool resched;		/* dpc needs to be and is rescheduled */
 #ifdef LINUXSTA_PS
 	u32 pci_psstate[16];	/* pci ps-state save/restore */
 #endif
-	struct wl_firmware fw;
+	struct brcms_firmware fw;
 	struct wiphy *wiphy;
 };
-
-#define WL_LOCK(wl)	spin_lock_bh(&(wl)->lock)
-#define WL_UNLOCK(wl)	spin_unlock_bh(&(wl)->lock)
-
-/* locking from inside wl_isr */
-#define WL_ISRLOCK(wl, flags) do {spin_lock(&(wl)->isr_lock); (void)(flags); } while (0)
-#define WL_ISRUNLOCK(wl, flags) do {spin_unlock(&(wl)->isr_lock); (void)(flags); } while (0)
-
-/* locking under WL_LOCK() to synchronize with wl_isr */
-#define INT_LOCK(wl, flags)	spin_lock_irqsave(&(wl)->isr_lock, flags)
-#define INT_UNLOCK(wl, flags)	spin_unlock_irqrestore(&(wl)->isr_lock, flags)
-
 #endif				/* _wl_mac80211_h_ */
drivers/staging/brcm80211/brcmsmac/wl_ucode.h +7 -6
index 28838d8..4b90121 100644
@@ -41,11 +41,12 @@ extern u32 bcm43xx_16_mimosz;
 extern u32 *bcm43xx_24_lcn;
 extern u32 bcm43xx_24_lcnsz;
 
-extern int wl_ucode_data_init(struct wl_info *wl);
-extern void wl_ucode_data_free(void);
+extern int brcms_ucode_data_init(struct brcms_info *wl);
+extern void brcms_ucode_data_free(void);
 
-extern int wl_ucode_init_buf(struct wl_info *wl, void **pbuf, unsigned int idx);
-extern int wl_ucode_init_uint(struct wl_info *wl, unsigned *data,
+extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf,
+				unsigned int idx);
+extern int brcms_ucode_init_uint(struct brcms_info *wl, unsigned *data,
 			      unsigned int idx);
-extern void wl_ucode_free_buf(void *);
-extern int  wl_check_firmwares(struct wl_info *wl);
+extern void brcms_ucode_free_buf(void *);
+extern int  brcms_check_firmwares(struct brcms_info *wl);
drivers/staging/brcm80211/brcmsmac/wl_ucode_loader.c +39 -35

98 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +20 -20
index 6bc547a..fe031f2 100644
@@ -238,7 +238,7 @@ static u32 WLBANDINITFN(wlc_setband_inact) (struct wlc_info *wlc, uint bandunit)
 	WARN_ON((R_REG(&wlc_hw->regs->maccontrol) & MCTL_EN_MAC) != 0);
 
 	/* disable interrupts */
-	macintmask = wl_intrsoff(wlc->wl);
+	macintmask = brcms_intrsoff(wlc->wl);
 
 	/* radio off */
 	wlc_phy_switch_radio(wlc_hw->band->pi, OFF);
@@ -315,7 +315,7 @@ bool wlc_dpc(struct wlc_info *wlc, bool bounded)
 	if (DEVICEREMOVED(wlc)) {
 		wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit,
 			  __func__);
-		wl_down(wlc->wl);
+		brcms_down(wlc->wl);
 		return false;
 	}
 
@@ -386,7 +386,7 @@ bool wlc_dpc(struct wlc_info *wlc, bool bounded)
 					__func__, wlc_hw->sih->chip,
 					wlc_hw->sih->chiprev);
 		/* big hammer */
-		wl_init(wlc->wl);
+		brcms_init(wlc->wl);
 	}
 
 	/* gptimer timeout */
@@ -397,7 +397,7 @@ bool wlc_dpc(struct wlc_info *wlc, bool bounded)
 	if (macintstatus & MI_RFDISABLE) {
 		BCMMSG(wlc->wiphy, "wl%d: BMAC Detected a change on the"
 		       " RF Disable Input\n", wlc_hw->unit);
-		wl_rfkill_set_hw_state(wlc->wl);
+		brcms_rfkill_set_hw_state(wlc->wl);
 	}
 
 	/* send any enq'd tx packets. Just makes sure to jump start tx */
@@ -408,7 +408,7 @@ bool wlc_dpc(struct wlc_info *wlc, bool bounded)
 	return wlc->macintstatus != 0;
 
  fatal:
-	wl_init(wlc->wl);
+	brcms_init(wlc->wl);
 	return wlc->macintstatus != 0;
 }
 
@@ -526,7 +526,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
 					    NULL), DMAREG(wlc_hw, DMA_RX, 0),
 					   (wme ? tune->ntxd : 0), tune->nrxd,
 					   tune->rxbufsz, -1, tune->nrxbufpost,
-					   WL_HWRXOFF, &wl_msg_level);
+					   WL_HWRXOFF, &brcm_msg_level);
 		dma_attach_err |= (NULL == wlc_hw->di[0]);
 
 		/*
@@ -538,7 +538,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
 		wlc_hw->di[1] = dma_attach(name, wlc_hw->sih,
 					   DMAREG(wlc_hw, DMA_TX, 1), NULL,
 					   tune->ntxd, 0, 0, -1, 0, 0,
-					   &wl_msg_level);
+					   &brcm_msg_level);
 		dma_attach_err |= (NULL == wlc_hw->di[1]);
 
 		/*
@@ -549,7 +549,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
 		wlc_hw->di[2] = dma_attach(name, wlc_hw->sih,
 					   DMAREG(wlc_hw, DMA_TX, 2), NULL,
 					   tune->ntxd, 0, 0, -1, 0, 0,
-					   &wl_msg_level);
+					   &brcm_msg_level);
 		dma_attach_err |= (NULL == wlc_hw->di[2]);
 		/*
 		 * FIFO 3
@@ -559,7 +559,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
 		wlc_hw->di[3] = dma_attach(name, wlc_hw->sih,
 					   DMAREG(wlc_hw, DMA_TX, 3),
 					   NULL, tune->ntxd, 0, 0, -1,
-					   0, 0, &wl_msg_level);
+					   0, 0, &brcm_msg_level);
 		dma_attach_err |= (NULL == wlc_hw->di[3]);
 /* Cleaner to leave this as if with AP defined */
 
@@ -1050,7 +1050,7 @@ wlc_bmac_init(struct wlc_hw_info *wlc_hw, chanspec_t chanspec,
 		wlc_clkctl_clk(wlc_hw, CLK_FAST);
 
 	/* disable interrupts */
-	macintmask = wl_intrsoff(wlc->wl);
+	macintmask = brcms_intrsoff(wlc->wl);
 
 	/* set up the specified band and chanspec */
 	wlc_setxband(wlc_hw, CHSPEC_WLCBANDUNIT(chanspec));
@@ -1070,7 +1070,7 @@ wlc_bmac_init(struct wlc_hw_info *wlc_hw, chanspec_t chanspec,
 	wlc_bmac_bsinit(wlc, chanspec);
 
 	/* restore macintmask */
-	wl_intrsrestore(wlc->wl, macintmask);
+	brcms_intrsrestore(wlc->wl, macintmask);
 
 	/* seed wake_override with WLC_WAKE_OVERRIDE_MACSUSPEND since the mac is suspended
 	 * and wlc_enable_mac() will clear this override bit.
@@ -1140,7 +1140,7 @@ int wlc_bmac_up_finish(struct wlc_hw_info *wlc_hw)
 
 	/* FULLY enable dynamic power control and d11 core interrupt */
 	wlc_clkctl_clk(wlc_hw, CLK_DYNAMIC);
-	wl_intrson(wlc_hw->wlc->wl);
+	brcms_intrson(wlc_hw->wlc->wl);
 	return 0;
 }
 
@@ -1161,7 +1161,7 @@ int wlc_bmac_down_prep(struct wlc_hw_info *wlc_hw)
 		wlc_hw->wlc->macintmask = 0;
 	else {
 		/* now disable interrupts */
-		wl_intrsoff(wlc_hw->wlc->wl);
+		brcms_intrsoff(wlc_hw->wlc->wl);
 
 		/* ensure we're running on the pll clock again */
 		wlc_clkctl_clk(wlc_hw, CLK_FAST);
@@ -1201,7 +1201,7 @@ int wlc_bmac_down_finish(struct wlc_hw_info *wlc_hw)
 			if (R_REG(&wlc_hw->regs->maccontrol) &
 			    MCTL_EN_MAC)
 				wlc_suspend_mac_and_wait(wlc_hw->wlc);
-			callbacks += wl_reset(wlc_hw->wlc->wl);
+			callbacks += brcms_reset(wlc_hw->wlc->wl);
 			wlc_coredisable(wlc_hw);
 		}
 
@@ -1885,7 +1885,7 @@ WLBANDINITFN(wlc_bmac_setband) (struct wlc_hw_info *wlc_hw, uint bandunit,
 		wlc->macintstatus = MI_DMAINT;
 
 	/* restore macintmask */
-	wl_intrsrestore(wlc->wl, macintmask);
+	brcms_intrsrestore(wlc->wl, macintmask);
 
 	/* ucode should still be suspended.. */
 	WARN_ON((R_REG(&wlc_hw->regs->maccontrol) & MCTL_EN_MAC) != 0);
@@ -2683,7 +2683,7 @@ static u32 wlc_wlintrsoff(struct wlc_info *wlc)
 	if (!wlc->hw->up)
 		return 0;
 
-	return wl_intrsoff(wlc->wl);
+	return brcms_intrsoff(wlc->wl);
 }
 
 static void wlc_wlintrsrestore(struct wlc_info *wlc, u32 macintmask)
@@ -2691,7 +2691,7 @@ static void wlc_wlintrsrestore(struct wlc_info *wlc, u32 macintmask)
 	if (!wlc->hw->up)
 		return;
 
-	wl_intrsrestore(wlc->wl, macintmask);
+	brcms_intrsrestore(wlc->wl, macintmask);
 }
 
 u32 wlc_intrsoff(struct wlc_info *wlc)
@@ -3065,7 +3065,7 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
 	if (mc == 0xffffffff) {
 		wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit,
 			  __func__);
-		wl_down(wlc->wl);
+		brcms_down(wlc->wl);
 		return;
 	}
 	WARN_ON(mc & MCTL_PSM_JMP_0);
@@ -3076,7 +3076,7 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
 	if (mi == 0xffffffff) {
 		wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit,
 			  __func__);
-		wl_down(wlc->wl);
+		brcms_down(wlc->wl);
 		return;
 	}
 	WARN_ON(mi & MI_MACSSPNDD);
@@ -3101,7 +3101,7 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
 	if (mc == 0xffffffff) {
 		wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit,
 			  __func__);
-		wl_down(wlc->wl);
+		brcms_down(wlc->wl);
 		return;
 	}
 	WARN_ON(mc & MCTL_PSM_JMP_0);
drivers/staging/brcm80211/brcmsmac/wlc_main.c +22 -21

156 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_main.h +8 -7
index 0dcb73f..916b2a0 100644
@@ -401,7 +401,7 @@ struct wlc_if {
 				 * AID2PVBMAP(scb).
 				 */
 	u8 flags;		/* flags for the interface */
-	struct wl_if *wlif;		/* pointer to wlif */
+	struct brcms_if *wlif;		/* pointer to wlif */
 	struct wlc_txq_info *qi;	/* pointer to associated tx queue */
 	union {
 		struct scb *scb;	/* pointer to scb if WLC_IFTYPE_WDS */
@@ -409,8 +409,8 @@ struct wlc_if {
 	} u;
 };
 
-/* flags for the interface */
-#define WLC_IF_LINKED		0x02	/* this interface is linked to a wl_if */
+/* flags for the interface, this interface is linked to a brcms_if */
+#define WLC_IF_LINKED		0x02
 
 struct wlc_hwband {
 	int bandtype;		/* WLC_BAND_2G, WLC_BAND_5G */
@@ -521,7 +521,7 @@ struct wlc_txq_info {
  */
 struct wlc_info {
 	struct wlc_pub *pub;		/* pointer to wlc public state */
-	struct wl_info *wl;	/* pointer to os-specific private state */
+	struct brcms_info *wl;	/* pointer to os-specific private state */
 	d11regs_t *regs;	/* pointer to device registers */
 
 	struct wlc_hw_info *hw;	/* HW related state used primarily by BMAC */
@@ -587,9 +587,10 @@ struct wlc_info {
 	u8 mpc_delay_off;	/* delay radio disable by # of watchdog cnt */
 	u8 prev_non_delay_mpc;	/* prev state wlc_is_non_delay_mpc */
 
-	/* timer */
-	struct wl_timer *wdtimer;	/* timer for watchdog routine */
-	struct wl_timer *radio_timer;	/* timer for hw radio button monitor routine */
+	/* timer for watchdog routine */
+	struct brcms_timer *wdtimer;
+	/* timer for hw radio button monitor routine */
+	struct brcms_timer *radio_timer;
 
 	/* promiscuous */
 	bool monitor;		/* monitor (MPDU sniffing) mode */
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +8 -7
index 6689691..ba5d67e 100644
@@ -83,39 +83,40 @@ struct wlapi_timer *wlapi_init_timer(wlc_phy_shim_info_t *physhim,
 				     void (*fn) (void *arg), void *arg,
 				     const char *name)
 {
-	return (struct wlapi_timer *)wl_init_timer(physhim->wl, fn, arg, name);
+	return (struct wlapi_timer *)
+			brcms_init_timer(physhim->wl, fn, arg, name);
 }
 
 void wlapi_free_timer(wlc_phy_shim_info_t *physhim, struct wlapi_timer *t)
 {
-	wl_free_timer(physhim->wl, (struct wl_timer *)t);
+	brcms_free_timer(physhim->wl, (struct brcms_timer *)t);
 }
 
 void
 wlapi_add_timer(wlc_phy_shim_info_t *physhim, struct wlapi_timer *t, uint ms,
 		int periodic)
 {
-	wl_add_timer(physhim->wl, (struct wl_timer *)t, ms, periodic);
+	brcms_add_timer(physhim->wl, (struct brcms_timer *)t, ms, periodic);
 }
 
 bool wlapi_del_timer(wlc_phy_shim_info_t *physhim, struct wlapi_timer *t)
 {
-	return wl_del_timer(physhim->wl, (struct wl_timer *)t);
+	return brcms_del_timer(physhim->wl, (struct brcms_timer *)t);
 }
 
 void wlapi_intrson(wlc_phy_shim_info_t *physhim)
 {
-	wl_intrson(physhim->wl);
+	brcms_intrson(physhim->wl);
 }
 
 u32 wlapi_intrsoff(wlc_phy_shim_info_t *physhim)
 {
-	return wl_intrsoff(physhim->wl);
+	return brcms_intrsoff(physhim->wl);
 }
 
 void wlapi_intrsrestore(wlc_phy_shim_info_t *physhim, u32 macintmask)
 {
-	wl_intrsrestore(physhim->wl, macintmask);
+	brcms_intrsrestore(physhim->wl, macintmask);
 }
 
 void wlapi_bmac_write_shm(wlc_phy_shim_info_t *physhim, uint offset, u16 v)
drivers/staging/brcm80211/brcmsmac/wlc_pub.h +4 -4
index 77b0738..4f0fa20 100644
@@ -343,7 +343,7 @@ typedef struct wl_rxsts {
 	uint preamble;		/* Unknown, short, long */
 	uint encoding;		/* Unknown, CCK, PBCC, OFDM */
 	uint nfrmtype;		/* special 802.11n frames(AMPDU, AMSDU) */
-	struct wl_if *wlif;	/* wl interface */
+	struct brcms_if *wlif;	/* wl interface */
 } wl_rxsts_t;
 
 /* status per error RX pkt */
@@ -591,9 +591,9 @@ typedef struct {
 } wlc_antselcfg_t;
 
 /* common functions for every port */
-extern void *wlc_attach(struct wl_info *wl, u16 vendor, u16 device, uint unit,
-			bool piomode, void *regsva, uint bustype, void *btparam,
-			uint *perr);
+extern void *wlc_attach(struct brcms_info *wl, u16 vendor, u16 device,
+			uint unit, bool piomode, void *regsva, uint bustype,
+			void *btparam, uint *perr);
 extern uint wlc_detach(struct wlc_info *wlc);
 extern int wlc_up(struct wlc_info *wlc);
 extern uint wlc_down(struct wlc_info *wlc);
drivers/staging/brcm80211/brcmsmac/wlc_types.h +2 -2
index 5cca063..775d013 100644
@@ -35,11 +35,11 @@
 
 /* forward declarations */
 struct sk_buff;
-struct wl_info;
+struct brcms_info;
 struct wlc_info;
 struct wlc_hw_info;
 struct wlc_if;
-struct wl_if;
+struct brcms_if;
 struct ampdu_info;
 struct antsel_info;
 struct bmac_pmq;
drivers/staging/brcm80211/include/bcmdefs.h +2 -2
index 304d8ed..8cb66c2 100644
@@ -88,8 +88,8 @@ typedef struct wl_rateset {
 #define PM_MAX	1
 
 /* Message levels */
-#define WL_ERROR_VAL		0x00000001
-#define WL_TRACE_VAL		0x00000002
+#define LOG_ERROR_VAL		0x00000001
+#define LOG_TRACE_VAL		0x00000002
 
 #define PM_OFF	0
 #define PM_MAX	1
Signature · 1 line
1.7.4.1
#81 lore raw

PATCH 60/83 staging: brcm80211: renamed files to get rid of wl_ file name prefix

In reply to Roland Vossen

Code cleanup.

---
 drivers/staging/brcm80211/brcmsmac/Makefile        |    4 ++--
 .../brcmsmac/{wl_mac80211.c => brcms_mac80211.c}   |    4 ++--
 .../brcmsmac/{wl_mac80211.h => brcms_mac80211.h}   |    0
 .../brcmsmac/{wl_ucode_loader.c => ucode_loader.c} |    2 +-
 .../brcmsmac/{wl_ucode.h => ucode_loader.h}        |    0
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c      |    2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
 rename drivers/staging/brcm80211/brcmsmac/{wl_mac80211.c => brcms_mac80211.c} (99%)
 rename drivers/staging/brcm80211/brcmsmac/{wl_mac80211.h => brcms_mac80211.h} (100%)
 rename drivers/staging/brcm80211/brcmsmac/{wl_ucode_loader.c => ucode_loader.c} (99%)
 rename drivers/staging/brcm80211/brcmsmac/{wl_ucode.h => ucode_loader.h} (100%)
drivers/staging/brcm80211/brcmsmac/Makefile +2 -2
index 4356a29..c6b5128 100644
@@ -28,8 +28,8 @@ ccflags-y :=				\
 	-Idrivers/staging/brcm80211/include
 
 BRCMSMAC_OFILES := \
-	wl_mac80211.o \
-	wl_ucode_loader.o \
+	brcms_mac80211.o \
+	ucode_loader.o \
 	wlc_alloc.o \
 	wlc_ampdu.o \
 	wlc_antsel.o \
drivers/staging/brcm80211/brcmsmac/brcms_mac80211.c renamed from drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +2 -2
similarity index 99%
rename from drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
rename to drivers/staging/brcm80211/brcmsmac/brcms_mac80211.c
index cc2ed78..8eadb43 100644
@@ -42,8 +42,8 @@
 #include "wlc_pub.h"
 #include "wl_dbg.h"
 #include "wl_export.h"
-#include "wl_ucode.h"
-#include "wl_mac80211.h"
+#include "ucode_loader.h"
+#include "brcms_mac80211.h"
 
 #define N_TX_QUEUES	4 /* #tx queues on mac80211<->driver interface */
 
drivers/staging/brcm80211/brcmsmac/brcms_mac80211.h renamed from drivers/staging/brcm80211/brcmsmac/wl_mac80211.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/brcmsmac/wl_mac80211.h
rename to drivers/staging/brcm80211/brcmsmac/brcms_mac80211.h
drivers/staging/brcm80211/brcmsmac/ucode_loader.c renamed from drivers/staging/brcm80211/brcmsmac/wl_ucode_loader.c +1 -1
similarity index 99%
rename from drivers/staging/brcm80211/brcmsmac/wl_ucode_loader.c
rename to drivers/staging/brcm80211/brcmsmac/ucode_loader.c
index cf0be6b..d38f124 100644
@@ -16,7 +16,7 @@
 
 #include <linux/types.h>
 #include <bcmdefs.h>
-#include <wl_ucode.h>
+#include <ucode_loader.h>
 
 enum {
 	D11UCODE_NAMETAG_START = 0,
drivers/staging/brcm80211/brcmsmac/ucode_loader.h renamed from drivers/staging/brcm80211/brcmsmac/wl_ucode.h +0 -0
similarity index 100%
rename from drivers/staging/brcm80211/brcmsmac/wl_ucode.h
rename to drivers/staging/brcm80211/brcmsmac/ucode_loader.h
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +1 -1
index fe031f2..57c6e8a 100644
@@ -45,7 +45,7 @@
 #include "wlc_channel.h"
 #include "wlc_main.h"
 #include "wl_export.h"
-#include "wl_ucode.h"
+#include "ucode_loader.h"
 #include "wlc_antsel.h"
 #include "wlc_alloc.h"
 #include "wl_dbg.h"
drivers/staging/brcm80211/brcmsmac/wlc_main.c +1 -1
index 1a2108c..d5ba632 100644
@@ -49,7 +49,7 @@
 #include "wl_export.h"
 #include "wlc_alloc.h"
 #include "wl_dbg.h"
-#include "wl_mac80211.h"
+#include "brcms_mac80211.h"
 
 /*
  * WPA(2) definitions
Signature · 1 line
1.7.4.1
#82 lore raw

PATCH 61/83 staging: brcm80211: removed wl_dbg.h

In reply to Roland Vossen

Code cleanup. Reducing number of header files. Merged into wlc_types.h.

---
 .../staging/brcm80211/brcmsmac/brcms_mac80211.c    |    1 -
 drivers/staging/brcm80211/brcmsmac/wl_dbg.h        |   33 --------------------
 drivers/staging/brcm80211/brcmsmac/wlc_alloc.c     |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c     |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_antsel.c    |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_channel.c   |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_main.c      |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c  |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_rate.c      |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_stf.c       |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_types.h     |   11 ++++++
 12 files changed, 11 insertions(+), 43 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmsmac/wl_dbg.h
drivers/staging/brcm80211/brcmsmac/brcms_mac80211.c +0 -1
index 8eadb43..2c239cf 100644
@@ -40,7 +40,6 @@
 #include "wlc_channel.h"
 #include "wlc_scb.h"
 #include "wlc_pub.h"
-#include "wl_dbg.h"
 #include "wl_export.h"
 #include "ucode_loader.h"
 #include "brcms_mac80211.h"
drivers/staging/brcm80211/brcmsmac/wl_dbg.h deleted +0 -33
deleted file mode 100644
index 253c464..0000000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _wl_dbg_h_
-#define _wl_dbg_h_
-
-#include <linux/device.h>			/* dev_err() */
-
-/* brcm_msg_level is a bit vector with defs in bcmdefs.h */
-extern u32 brcm_msg_level;
-
-#define BCMMSG(dev, fmt, args...)		\
-do {						\
-	if (brcm_msg_level & LOG_TRACE_VAL)	\
-		wiphy_err(dev, "%s: " fmt, __func__, ##args);	\
-} while (0)
-
-#define WL_ERROR_ON()		(brcm_msg_level & LOG_ERROR_VAL)
-
-#endif				/* _wl_dbg_h_ */
drivers/staging/brcm80211/brcmsmac/wlc_alloc.c +0 -1
index 218210a..619247a 100644
@@ -28,7 +28,6 @@
 #include "wlc_pub.h"
 #include "wlc_key.h"
 #include "wlc_alloc.h"
-#include "wl_dbg.h"
 #include "wlc_rate.h"
 #include "wlc_bsscfg.h"
 #include "phy/wlc_phy_hal.h"
drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c +0 -1
index 0c325c7..61d4722 100644
@@ -32,7 +32,6 @@
 #include "phy/wlc_phy_hal.h"
 #include "wlc_antsel.h"
 #include "wl_export.h"
-#include "wl_dbg.h"
 #include "wlc_channel.h"
 #include "wlc_main.h"
 #include "wlc_ampdu.h"
drivers/staging/brcm80211/brcmsmac/wlc_antsel.c +0 -1
index fba9eaf..dcedcc2 100644
@@ -32,7 +32,6 @@
 #include "wlc_key.h"
 #include "wlc_scb.h"
 #include "wlc_pub.h"
-#include "wl_dbg.h"
 #include "phy/wlc_phy_hal.h"
 #include "wlc_bmac.h"
 #include "wlc_channel.h"
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +0 -1
index 57c6e8a..228b02d 100644
@@ -48,7 +48,6 @@
 #include "ucode_loader.h"
 #include "wlc_antsel.h"
 #include "wlc_alloc.h"
-#include "wl_dbg.h"
 #include "wlc_bmac.h"
 
 #define	TIMER_INTERVAL_WATCHDOG_BMAC	1000	/* watchdog timer, in unit of ms */
drivers/staging/brcm80211/brcmsmac/wlc_channel.c +0 -1
index cd37971..d1e764a 100644
@@ -37,7 +37,6 @@
 #include "wlc_channel.h"
 #include "wlc_main.h"
 #include "wlc_stf.h"
-#include "wl_dbg.h"
 
 #define	VALID_CHANNEL20_DB(wlc, val) wlc_valid_channel20_db((wlc)->cmi, val)
 #define	VALID_CHANNEL20_IN_BAND(wlc, bandunit, val) \
drivers/staging/brcm80211/brcmsmac/wlc_main.c +0 -1
index d5ba632..f95a6d0 100644
@@ -48,7 +48,6 @@
 #include "wlc_ampdu.h"
 #include "wl_export.h"
 #include "wlc_alloc.h"
-#include "wl_dbg.h"
 #include "brcms_mac80211.h"
 
 /*
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +0 -1
index ba5d67e..a090ee2 100644
@@ -33,7 +33,6 @@
 #include <wlc_pmu.h>
 
 #include "wlc_types.h"
-#include "wl_dbg.h"
 #include "wlc_cfg.h"
 #include "d11.h"
 #include "wlc_rate.h"
drivers/staging/brcm80211/brcmsmac/wlc_rate.c +0 -1
index d6eae1f..88aa134 100644
@@ -23,7 +23,6 @@
 
 #include "wlc_types.h"
 #include "d11.h"
-#include "wl_dbg.h"
 #include "wlc_cfg.h"
 #include "wlc_scb.h"
 #include "wlc_pub.h"
drivers/staging/brcm80211/brcmsmac/wlc_stf.c +0 -1
index 8fb90d4..d4fb6e4 100644
@@ -26,7 +26,6 @@
 
 #include "wlc_types.h"
 #include "d11.h"
-#include "wl_dbg.h"
 #include "wlc_cfg.h"
 #include "wlc_rate.h"
 #include "wlc_scb.h"
drivers/staging/brcm80211/brcmsmac/wlc_types.h +11 -0
index 775d013..383a747 100644
@@ -33,6 +33,14 @@
 
 #define MAX_DMA_SEGS 4
 
+#define BCMMSG(dev, fmt, args...)		\
+do {						\
+	if (brcm_msg_level & LOG_TRACE_VAL)	\
+		wiphy_err(dev, "%s: " fmt, __func__, ##args);	\
+} while (0)
+
+#define WL_ERROR_ON()		(brcm_msg_level & LOG_ERROR_VAL)
+
 /* forward declarations */
 struct sk_buff;
 struct brcms_info;
@@ -49,4 +57,7 @@ struct wlc_bsscfg;
 struct bcmstrbuf;
 struct si_pub;
 
+/* brcm_msg_level is a bit vector with defs in bcmdefs.h */
+extern u32 brcm_msg_level;
+
 #endif				/* _wlc_types_h_ */
Signature · 1 line
1.7.4.1
#83 lore raw

PATCH 62/83 staging: brcm80211: removed wl_export.h

In reply to Roland Vossen

Code cleanup, reducing number of header files. Merged into brcmsmac_80211.h.

---
 .../staging/brcm80211/brcmsmac/brcms_mac80211.c    |    1 -
 .../staging/brcm80211/brcmsmac/brcms_mac80211.h    |   28 ++++++++++++
 drivers/staging/brcm80211/brcmsmac/wl_export.h     |   47 --------------------
 drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c     |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_antsel.c    |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c      |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.c      |    1 -
 drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c  |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_stf.c       |    1 -
 9 files changed, 30 insertions(+), 54 deletions(-)
 delete mode 100644 drivers/staging/brcm80211/brcmsmac/wl_export.h
drivers/staging/brcm80211/brcmsmac/brcms_mac80211.c +0 -1
index 2c239cf..e80e12c 100644
@@ -40,7 +40,6 @@
 #include "wlc_channel.h"
 #include "wlc_scb.h"
 #include "wlc_pub.h"
-#include "wl_export.h"
 #include "ucode_loader.h"
 #include "brcms_mac80211.h"
 
drivers/staging/brcm80211/brcmsmac/brcms_mac80211.h +28 -0
index 48ec6b0..8ef89ad 100644
@@ -78,4 +78,32 @@ struct brcms_info {
 	struct brcms_firmware fw;
 	struct wiphy *wiphy;
 };
+
+/* misc callbacks */
+struct brcms_info;
+struct brcms_if;
+struct wlc_if;
+extern void brcms_init(struct brcms_info *wl);
+extern uint brcms_reset(struct brcms_info *wl);
+extern void brcms_intrson(struct brcms_info *wl);
+extern u32 brcms_intrsoff(struct brcms_info *wl);
+extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
+extern int brcms_up(struct brcms_info *wl);
+extern void brcms_down(struct brcms_info *wl);
+extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
+				bool state, int prio);
+extern bool wl_alloc_dma_resources(struct brcms_info *wl, uint dmaddrwidth);
+extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
+
+/* timer functions */
+struct brcms_timer;
+extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
+				      void (*fn) (void *arg), void *arg,
+				      const char *name);
+extern void brcms_free_timer(struct brcms_info *wl, struct brcms_timer *timer);
+extern void brcms_add_timer(struct brcms_info *wl, struct brcms_timer *timer,
+			    uint ms, int periodic);
+extern bool brcms_del_timer(struct brcms_info *wl, struct brcms_timer *timer);
+extern void brcms_msleep(struct brcms_info *wl, uint ms);
+
 #endif				/* _wl_mac80211_h_ */
drivers/staging/brcm80211/brcmsmac/wl_export.h deleted +0 -47

47 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c +0 -1
index 61d4722..7a00cac 100644
@@ -31,7 +31,6 @@
 #include "wlc_key.h"
 #include "phy/wlc_phy_hal.h"
 #include "wlc_antsel.h"
-#include "wl_export.h"
 #include "wlc_channel.h"
 #include "wlc_main.h"
 #include "wlc_ampdu.h"
drivers/staging/brcm80211/brcmsmac/wlc_antsel.c +0 -1
index dcedcc2..ea27b66 100644
@@ -36,7 +36,6 @@
 #include "wlc_bmac.h"
 #include "wlc_channel.h"
 #include "wlc_main.h"
-#include "wl_export.h"
 #include "wlc_antsel.h"
 
 #define ANT_SELCFG_AUTO		0x80	/* bit indicates antenna sel AUTO */
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +1 -1
index 228b02d..6b02ebe 100644
@@ -44,11 +44,11 @@
 #include "phy/wlc_phy_hal.h"
 #include "wlc_channel.h"
 #include "wlc_main.h"
-#include "wl_export.h"
 #include "ucode_loader.h"
 #include "wlc_antsel.h"
 #include "wlc_alloc.h"
 #include "wlc_bmac.h"
+#include "brcms_mac80211.h"
 
 #define	TIMER_INTERVAL_WATCHDOG_BMAC	1000	/* watchdog timer, in unit of ms */
 
drivers/staging/brcm80211/brcmsmac/wlc_main.c +0 -1
index f95a6d0..1a3af67 100644
@@ -46,7 +46,6 @@
 #include "wlc_antsel.h"
 #include "wlc_stf.h"
 #include "wlc_ampdu.h"
-#include "wl_export.h"
 #include "wlc_alloc.h"
 #include "brcms_mac80211.h"
 
drivers/staging/brcm80211/brcmsmac/wlc_phy_shim.c +1 -1
index a090ee2..d33f720 100644
@@ -44,9 +44,9 @@
 #include "wlc_key.h"
 #include "wlc_bmac.h"
 #include "wlc_phy_hal.h"
-#include "wl_export.h"
 #include "wlc_main.h"
 #include "wlc_phy_shim.h"
+#include "brcms_mac80211.h"
 
 /* PHY SHIM module specific state */
 struct wlc_phy_shim_info {
drivers/staging/brcm80211/brcmsmac/wlc_stf.c +0 -1
index d4fb6e4..b7191af 100644
@@ -34,7 +34,6 @@
 #include "phy/wlc_phy_hal.h"
 #include "wlc_channel.h"
 #include "wlc_main.h"
-#include "wl_export.h"
 #include "wlc_bmac.h"
 #include "wlc_stf.h"
 
Signature · 1 line
1.7.4.1
#84 lore raw

PATCH 63/83 staging: brcm80211: removed unused code from bcmotp.c

In reply to Roland Vossen

Code cleanup. The supported chips all contain an 'IPX' controller, the older 'hnd' OTP controller is not used.

---
 drivers/staging/brcm80211/brcmsmac/bcmotp.c |  410 +--------------------------
 1 files changed, 2 insertions(+), 408 deletions(-)
drivers/staging/brcm80211/brcmsmac/bcmotp.c +2 -408
index 2b7f061..cca64e4 100644
@@ -36,7 +36,7 @@
 #define OTPS_GUP_CI		0x00000400	/* chipid/pkgopt subregion is programmed */
 #define OTPS_GUP_FUSE		0x00000800	/* fuse subregion is programmed */
 
-/* Fields in otpprog in rev >= 21 and HND OTP */
+/* Fields in otpprog in rev >= 21 */
 #define OTPP_COL_MASK		0x000000ff
 #define OTPP_COL_SHIFT		0
 #define OTPP_ROW_MASK		0x0000ff00
@@ -47,7 +47,7 @@
 #define OTPP_VALUE_MASK		0x20000000
 #define OTPP_VALUE_SHIFT	29
 #define OTPP_START_BUSY		0x80000000
-#define	OTPP_READ		0x40000000	/* HND OTP */
+#define	OTPP_READ		0x40000000
 
 /* Opcodes for OTPP_OC field */
 #define OTPPOC_READ		0
@@ -60,31 +60,11 @@
 #define OTPPOC_ROW_LOCK		8
 #define OTPPOC_PRESCN_TEST	9
 
-/*
- * There are two different OTP controllers so far:
- * 	1. new IPX OTP controller:	chipc 21, >=23
- * 	2. older HND OTP controller:	chipc 12, 17, 22
- *
- * Define BCMHNDOTP to include support for the HND OTP controller.
- * Define BCMIPXOTP to include support for the IPX OTP controller.
- *
- * NOTE 1: More than one may be defined
- * NOTE 2: If none are defined, the default is to include them all.
- */
-
-#if !defined(BCMHNDOTP) && !defined(BCMIPXOTP)
-#define BCMHNDOTP	1
-#define BCMIPXOTP	1
-#endif
-
-#define OTPTYPE_HND(ccrev)	((ccrev) < 21 || (ccrev) == 22)
 #define OTPTYPE_IPX(ccrev)	((ccrev) == 21 || (ccrev) >= 23)
 
 #define OTPP_TRIES	10000000	/* # of tries for OTPP */
 
-#ifdef BCMIPXOTP
 #define MAXNUMRDES		9	/* Maximum OTP redundancy entries */
-#endif
 
 /* OTP common function type */
 typedef int (*otp_status_t) (void *oh);
@@ -110,7 +90,6 @@ typedef struct {
 	otp_fn_t *fn;		/* OTP functions */
 	struct si_pub *sih;		/* Saved sb handle */
 
-#ifdef BCMIPXOTP
 	/* IPX OTP section */
 	u16 wsize;		/* Size of otp in words */
 	u16 rows;		/* Geometry */
@@ -125,15 +104,6 @@ typedef struct {
 	u16 fbase;		/* fuse subregion offset */
 	u16 flim;		/* fuse subregion boundary */
 	int otpgu_base;		/* offset to General Use Region */
-#endif				/* BCMIPXOTP */
-
-#ifdef BCMHNDOTP
-	/* HND OTP section */
-	uint size;		/* Size of otp in bytes */
-	uint hwprot;		/* Hardware protection bits */
-	uint signvalid;		/* Signature valid bits */
-	int boundary;		/* hw/sw boundary */
-#endif				/* BCMHNDOTP */
 } otpinfo_t;
 
 static otpinfo_t otpinfo;
@@ -151,8 +121,6 @@ static otpinfo_t otpinfo;
  *
  */
 
-#ifdef BCMIPXOTP
-
 #define HWSW_RGN(rgn)		(((rgn) == OTP_HW_RGN) ? "h/w" : "s/w")
 
 /* OTP layout */
@@ -497,374 +465,7 @@ static otp_fn_t ipxotp_fn = {
 	(otp_status_t) ipxotp_status
 };
 
-#endif				/* BCMIPXOTP */
-
-/*
- * HND OTP Code
- *
- *   Exported functions:
- *	hndotp_status()
- *	hndotp_size()
- *	hndotp_init()
- *	hndotp_read_bit()
- *	hndotp_read_region()
- *	hndotp_nvread()
- *
- */
-
-#ifdef BCMHNDOTP
-
-/* Fields in otpstatus */
-#define	OTPS_PROGFAIL		0x80000000
-#define	OTPS_PROTECT		0x00000007
-#define	OTPS_HW_PROTECT		0x00000001
-#define	OTPS_SW_PROTECT		0x00000002
-#define	OTPS_CID_PROTECT	0x00000004
-#define	OTPS_RCEV_MSK		0x00003f00
-#define	OTPS_RCEV_SHIFT		8
-
-/* Fields in the otpcontrol register */
-#define	OTPC_RECWAIT		0xff000000
-#define	OTPC_PROGWAIT		0x00ffff00
-#define	OTPC_PRW_SHIFT		8
-#define	OTPC_MAXFAIL		0x00000038
-#define	OTPC_VSEL		0x00000006
-#define	OTPC_SELVL		0x00000001
-
-/* OTP regions (Word offsets from otp size) */
-#define	OTP_SWLIM_OFF	(-4)
-#define	OTP_CIDBASE_OFF	0
-#define	OTP_CIDLIM_OFF	4
-
-/* Predefined OTP words (Word offset from otp size) */
-#define	OTP_BOUNDARY_OFF (-4)
-#define	OTP_HWSIGN_OFF	(-3)
-#define	OTP_SWSIGN_OFF	(-2)
-#define	OTP_CIDSIGN_OFF	(-1)
-#define	OTP_CID_OFF	0
-#define	OTP_PKG_OFF	1
-#define	OTP_FID_OFF	2
-#define	OTP_RSV_OFF	3
-#define	OTP_LIM_OFF	4
-#define	OTP_RD_OFF	4	/* Redundancy row starts here */
-#define	OTP_RC0_OFF	28	/* Redundancy control word 1 */
-#define	OTP_RC1_OFF	32	/* Redundancy control word 2 */
-#define	OTP_RC_LIM_OFF	36	/* Redundancy control word end */
-
-#define	OTP_HW_REGION	OTPS_HW_PROTECT
-#define	OTP_SW_REGION	OTPS_SW_PROTECT
-#define	OTP_CID_REGION	OTPS_CID_PROTECT
-
-#if OTP_HW_REGION != OTP_HW_RGN
-#error "incompatible OTP_HW_RGN"
-#endif
-#if OTP_SW_REGION != OTP_SW_RGN
-#error "incompatible OTP_SW_RGN"
-#endif
-#if OTP_CID_REGION != OTP_CI_RGN
-#error "incompatible OTP_CI_RGN"
-#endif
-
-/* Redundancy entry definitions */
-#define	OTP_RCE_ROW_SZ		6
-#define	OTP_RCE_SIGN_MASK	0x7fff
-#define	OTP_RCE_ROW_MASK	0x3f
-#define	OTP_RCE_BITS		21
-#define	OTP_RCE_SIGN_SZ		15
-#define	OTP_RCE_BIT0		1
-
-#define	OTP_WPR		4
-#define	OTP_SIGNATURE	0x578a
-#define	OTP_MAGIC	0x4e56
-
-static int hndotp_status(void *oh)
-{
-	otpinfo_t *oi = (otpinfo_t *) oh;
-	return (int)(oi->hwprot | oi->signvalid);
-}
-
-static int hndotp_size(void *oh)
-{
-	otpinfo_t *oi = (otpinfo_t *) oh;
-	return (int)(oi->size);
-}
-
-static u16 hndotp_otpr(void *oh, chipcregs_t *cc, uint wn)
-{
-	volatile u16 *ptr;
-
-	ptr = (volatile u16 *)((volatile char *)cc + CC_SROM_OTP);
-	return R_REG(&ptr[wn]);
-}
-
-static u16 hndotp_otproff(void *oh, chipcregs_t *cc, int woff)
-{
-	otpinfo_t *oi = (otpinfo_t *) oh;
-	volatile u16 *ptr;
-
-	ptr = (volatile u16 *)((volatile char *)cc + CC_SROM_OTP);
-
-	return R_REG(&ptr[(oi->size / 2) + woff]);
-}
-
-static u16 hndotp_read_bit(void *oh, chipcregs_t *cc, uint idx)
-{
-	uint k, row, col;
-	u32 otpp, st;
-
-	row = idx / 65;
-	col = idx % 65;
-
-	otpp = OTPP_START_BUSY | OTPP_READ |
-	    ((row << OTPP_ROW_SHIFT) & OTPP_ROW_MASK) | (col & OTPP_COL_MASK);
-
-	W_REG(&cc->otpprog, otpp);
-	st = R_REG(&cc->otpprog);
-	for (k = 0;
-	     ((st & OTPP_START_BUSY) == OTPP_START_BUSY) && (k < OTPP_TRIES);
-	     k++)
-		st = R_REG(&cc->otpprog);
-
-	if (k >= OTPP_TRIES) {
-		return 0xffff;
-	}
-	if (st & OTPP_READERR) {
-		return 0xffff;
-	}
-	st = (st & OTPP_VALUE_MASK) >> OTPP_VALUE_SHIFT;
-	return (u16) st;
-}
-
-static void *hndotp_init(struct si_pub *sih)
-{
-	uint idx;
-	chipcregs_t *cc;
-	otpinfo_t *oi;
-	u32 cap = 0, clkdiv, otpdiv = 0;
-	void *ret = NULL;
-
-	oi = &otpinfo;
-
-	idx = ai_coreidx(sih);
-
-	/* Check for otp */
-	cc = ai_setcoreidx(sih, SI_CC_IDX);
-	if (cc != NULL) {
-		cap = R_REG(&cc->capabilities);
-		if ((cap & CC_CAP_OTPSIZE) == 0) {
-			/* Nothing there */
-			goto out;
-		}
-
-		if (!((oi->ccrev == 12) || (oi->ccrev == 17)
-		     || (oi->ccrev == 22)))
-			return NULL;
-
-		/* Read the OTP byte size. chipcommon rev >= 18 has RCE so the size is
-		 * 8 row (64 bytes) smaller
-		 */
-		oi->size =
-		    1 << (((cap & CC_CAP_OTPSIZE) >> CC_CAP_OTPSIZE_SHIFT)
-			  + CC_CAP_OTPSIZE_BASE);
-		if (oi->ccrev >= 18)
-			oi->size -= ((OTP_RC0_OFF - OTP_BOUNDARY_OFF) * 2);
-
-		oi->hwprot = (int)(R_REG(&cc->otpstatus) & OTPS_PROTECT);
-		oi->boundary = -1;
-
-		/* Check the region signature */
-		if (hndotp_otproff(oi, cc, OTP_HWSIGN_OFF) == OTP_SIGNATURE) {
-			oi->signvalid |= OTP_HW_REGION;
-			oi->boundary = hndotp_otproff(oi, cc, OTP_BOUNDARY_OFF);
-		}
-
-		if (hndotp_otproff(oi, cc, OTP_SWSIGN_OFF) == OTP_SIGNATURE)
-			oi->signvalid |= OTP_SW_REGION;
-
-		if (hndotp_otproff(oi, cc, OTP_CIDSIGN_OFF) == OTP_SIGNATURE)
-			oi->signvalid |= OTP_CID_REGION;
-
-		/* Set OTP clkdiv for stability */
-		if (oi->ccrev == 22)
-			otpdiv = 12;
-
-		if (otpdiv) {
-			clkdiv = R_REG(&cc->clkdiv);
-			clkdiv =
-			    (clkdiv & ~CLKD_OTP) | (otpdiv << CLKD_OTP_SHIFT);
-			W_REG(&cc->clkdiv, clkdiv);
-		}
-		udelay(10);
-
-		ret = (void *)oi;
-	}
-
- out:				/* All done */
-	ai_setcoreidx(sih, idx);
-
-	return ret;
-}
-
-static int hndotp_read_region(void *oh, int region, u16 *data, uint *wlen)
-{
-	otpinfo_t *oi = (otpinfo_t *) oh;
-	u32 idx, st;
-	chipcregs_t *cc;
-	int i;
-
-
-	if (region != OTP_HW_REGION) {
-		/*
-		 * Only support HW region
-		 * (no active chips use HND OTP SW region)
-		 * */
-		return -ENOTSUPP;
-	}
-
-	/* Region empty? */
-	st = oi->hwprot | oi->signvalid;
-	if ((st & region) == 0)
-		return -ENODATA;
-
-	*wlen =
-	    ((int)*wlen < oi->boundary / 2) ? *wlen : (uint) oi->boundary / 2;
-
-	idx = ai_coreidx(oi->sih);
-	cc = ai_setcoreidx(oi->sih, SI_CC_IDX);
-
-	for (i = 0; i < (int)*wlen; i++)
-		data[i] = hndotp_otpr(oh, cc, i);
-
-	ai_setcoreidx(oi->sih, idx);
-
-	return 0;
-}
-
-static int hndotp_nvread(void *oh, char *data, uint *len)
-{
-	int rc = 0;
-	otpinfo_t *oi = (otpinfo_t *) oh;
-	u32 base, bound, lim = 0, st;
-	int i, chunk, gchunks, tsz = 0;
-	u32 idx;
-	chipcregs_t *cc;
-	uint offset;
-	u16 *rawotp = NULL;
-
-	/* save the orig core */
-	idx = ai_coreidx(oi->sih);
-	cc = ai_setcoreidx(oi->sih, SI_CC_IDX);
-
-	st = hndotp_status(oh);
-	if (!(st & (OTP_HW_REGION | OTP_SW_REGION))) {
-		rc = -1;
-		goto out;
-	}
-
-	/* Read the whole otp so we can easily manipulate it */
-	lim = hndotp_size(oh);
-	rawotp = kmalloc(lim, GFP_ATOMIC);
-	if (rawotp == NULL) {
-		rc = -2;
-		goto out;
-	}
-	for (i = 0; i < (int)(lim / 2); i++)
-		rawotp[i] = hndotp_otpr(oh, cc, i);
-
-	if ((st & OTP_HW_REGION) == 0) {
-		/* This could be a programming failure in the first
-		 * chunk followed by one or more good chunks
-		 */
-		for (i = 0; i < (int)(lim / 2); i++)
-			if (rawotp[i] == OTP_MAGIC)
-				break;
-
-		if (i < (int)(lim / 2)) {
-			base = i;
-			bound = (i * 2) + rawotp[i + 1];
-		} else {
-			rc = -3;
-			goto out;
-		}
-	} else {
-		bound = rawotp[(lim / 2) + OTP_BOUNDARY_OFF];
-
-		/* There are two cases: 1) The whole otp is used as nvram
-		 * and 2) There is a hardware header followed by nvram.
-		 */
-		if (rawotp[0] == OTP_MAGIC) {
-			base = 0;
-		} else
-			base = bound;
-	}
-
-	/* Find and copy the data */
-
-	chunk = 0;
-	gchunks = 0;
-	i = base / 2;
-	offset = 0;
-	while ((i < (int)(lim / 2)) && (rawotp[i] == OTP_MAGIC)) {
-		int dsz, rsz = rawotp[i + 1];
-
-		if (((i * 2) + rsz) >= (int)lim) {
-			/* Bad length, try to find another chunk anyway */
-			rsz = 6;
-		}
-		if (crc_ccitt(CRC16_INIT_VALUE, (u8 *) &rawotp[i], rsz) ==
-			CRC16_GOOD_VALUE) {
-			/* Good crc, copy the vars */
-			gchunks++;
-			dsz = rsz - 6;
-			tsz += dsz;
-			if (offset + dsz >= *len) {
-				goto out;
-			}
-			memcpy(&data[offset], &rawotp[i + 2], dsz);
-			offset += dsz;
-			/* Remove extra null characters at the end */
-			while (offset > 1 &&
-			       data[offset - 1] == 0 && data[offset - 2] == 0)
-				offset--;
-			i += rsz / 2;
-		} else {
-			/* bad length or crc didn't check, try to find the next set */
-			if (rawotp[i + (rsz / 2)] == OTP_MAGIC) {
-				/* Assume length is good */
-				i += rsz / 2;
-			} else {
-				while (++i < (int)(lim / 2))
-					if (rawotp[i] == OTP_MAGIC)
-						break;
-			}
-		}
-		chunk++;
-	}
-
-	*len = offset;
-
- out:
-	kfree(rawotp);
-	ai_setcoreidx(oi->sih, idx);
-
-	return rc;
-}
-
-static otp_fn_t otp_fn = {
-	(otp_size_t) hndotp_size,
-	(otp_read_bit_t) hndotp_read_bit,
-
-	(otp_init_t) hndotp_init,
-	(otp_read_region_t) hndotp_read_region,
-	(otp_nvread_t) hndotp_nvread,
-
-	(otp_status_t) hndotp_status
-};
-
-#endif				/* BCMHNDOTP */
-
 /*
- * Common Code: Compiled for IPX / HND / AUTO
  *	otp_status()
  *	otp_size()
  *	otp_read_bit()
@@ -907,15 +508,8 @@ void *otp_init(struct si_pub *sih)
 
 	oi->ccrev = sih->ccrev;
 
-#ifdef BCMIPXOTP
 	if (OTPTYPE_IPX(oi->ccrev))
 		oi->fn = &ipxotp_fn;
-#endif
-
-#ifdef BCMHNDOTP
-	if (OTPTYPE_HND(oi->ccrev))
-		oi->fn = &otp_fn;
-#endif
 
 	if (oi->fn == NULL) {
 		return NULL;
Signature · 1 line
1.7.4.1
#85 lore raw

PATCH 64/83 staging: brcm80211: removed Broadcom specific acronym 'hnd'.

In reply to Roland Vossen

Code cleanup.

---
 drivers/staging/brcm80211/brcmfmac/pcicfg.h   |    2 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.h  |    4 +---
 drivers/staging/brcm80211/brcmsmac/bcmdma.h   |    6 +++---
 drivers/staging/brcm80211/brcmsmac/d11.h      |    2 --
 drivers/staging/brcm80211/brcmsmac/dma.c      |   18 +++++++++---------
 drivers/staging/brcm80211/brcmsmac/wlc_bmac.c |    2 +-
 drivers/staging/brcm80211/brcmsmac/wlc_main.h |    2 +-
 drivers/staging/brcm80211/include/bcmsoc.h    |    8 ++++----
 8 files changed, 20 insertions(+), 24 deletions(-)
drivers/staging/brcm80211/brcmfmac/pcicfg.h +1 -1
index d0c617a..3258449 100644
@@ -22,7 +22,7 @@
 /* PCI configuration address space size */
 #define PCI_SZPCR		256
 
-/* Everything below is BRCM HND proprietary */
+/* Everything below is Broadcom specific */
 
 /* Brcm PCI configuration registers */
 #define PCI_BAR0_WIN		0x80	/* backplane address space accessed by BAR0 */
drivers/staging/brcm80211/brcmsmac/aiutils.h +1 -3
index ec7acd1..211a27a 100644
@@ -151,9 +151,7 @@
 					 * maps all unused address ranges
 					 */
 
-/* There are TWO constants on all HND chips: SI_ENUM_BASE above,
- * and chipcommon being the first core:
- */
+/* chipcommon being the first core: */
 #define	SI_CC_IDX		0
 
 /* SOC Interconnect types (aka chip types) */
drivers/staging/brcm80211/brcmsmac/bcmdma.h +3 -3
index 1a1ca03..dd55e29 100644
@@ -58,9 +58,9 @@ typedef volatile struct {
 
 /* range param for dma_getnexttxp() and dma_txreclaim */
 typedef enum txd_range {
-	HNDDMA_RANGE_ALL = 1,
-	HNDDMA_RANGE_TRANSMITTED,
-	HNDDMA_RANGE_TRANSFERED
+	DMA_RANGE_ALL = 1,
+	DMA_RANGE_TRANSMITTED,
+	DMA_RANGE_TRANSFERED
 } txd_range_t;
 
 /* dma function type */
drivers/staging/brcm80211/brcmsmac/d11.h +0 -2
index 12a0ead..e9fa4ca 100644
@@ -105,8 +105,6 @@ typedef volatile struct {
 
 /*
  * Host Interface Registers
- * - primed from hnd_cores/dot11mac/systemC/registers/ihr.h
- * - but definitely not complete
  */
 typedef volatile struct _d11regs {
 	/* Device Control ("semi-standard host registers") */
drivers/staging/brcm80211/brcmsmac/dma.c +9 -9
index d50395d..a754cdd 100644
@@ -1292,9 +1292,9 @@ static void dma64_txreclaim(dma_info_t *di, txd_range_t range)
 	void *p;
 
 	DMA_TRACE(("%s: dma_txreclaim %s\n", di->name,
-		   (range == HNDDMA_RANGE_ALL) ? "all" :
+		   (range == DMA_RANGE_ALL) ? "all" :
 		   ((range ==
-		     HNDDMA_RANGE_TRANSMITTED) ? "transmitted" :
+		     DMA_RANGE_TRANSMITTED) ? "transmitted" :
 		    "transferred")));
 
 	if (di->txin == di->txout)
@@ -1649,11 +1649,11 @@ static int dma64_txfast(dma_info_t *di, struct sk_buff *p0,
 /*
  * Reclaim next completed txd (txds if using chained buffers) in the range
  * specified and return associated packet.
- * If range is HNDDMA_RANGE_TRANSMITTED, reclaim descriptors that have be
+ * If range is DMA_RANGE_TRANSMITTED, reclaim descriptors that have be
  * transmitted as noted by the hardware "CurrDescr" pointer.
- * If range is HNDDMA_RANGE_TRANSFERED, reclaim descriptors that have be
+ * If range is DMA_RANGE_TRANSFERED, reclaim descriptors that have be
  * transferred by the DMA as noted by the hardware "ActiveDescr" pointer.
- * If range is HNDDMA_RANGE_ALL, reclaim all txd(s) posted to the ring and
+ * If range is DMA_RANGE_ALL, reclaim all txd(s) posted to the ring and
  * return associated packet regardless of the value of hardware pointers.
  */
 static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)
@@ -1663,9 +1663,9 @@ static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)
 	void *txp;
 
 	DMA_TRACE(("%s: dma_getnexttxp %s\n", di->name,
-		   (range == HNDDMA_RANGE_ALL) ? "all" :
+		   (range == DMA_RANGE_ALL) ? "all" :
 		   ((range ==
-		     HNDDMA_RANGE_TRANSMITTED) ? "transmitted" :
+		     DMA_RANGE_TRANSMITTED) ? "transmitted" :
 		    "transferred")));
 
 	if (di->ntxd == 0)
@@ -1674,7 +1674,7 @@ static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)
 	txp = NULL;
 
 	start = di->txin;
-	if (range == HNDDMA_RANGE_ALL)
+	if (range == DMA_RANGE_ALL)
 		end = di->txout;
 	else {
 		dma64regs_t *dregs = di->d64txregs;
@@ -1685,7 +1685,7 @@ static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)
 				 D64_XS0_CD_MASK) -
 				di->xmtptrbase) & D64_XS0_CD_MASK, dma64dd_t));
 
-		if (range == HNDDMA_RANGE_TRANSFERED) {
+		if (range == DMA_RANGE_TRANSFERED) {
 			active_desc =
 			    (u16) (R_REG(&dregs->status1) &
 				      D64_XS1_AD_MASK);
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +1 -1
index 6b02ebe..caee8d9 100644
@@ -3415,7 +3415,7 @@ static void wlc_flushqueues(struct wlc_info *wlc)
 	/* free any posted tx packets */
 	for (i = 0; i < NFIFO; i++)
 		if (wlc_hw->di[i]) {
-			dma_txreclaim(wlc_hw->di[i], HNDDMA_RANGE_ALL);
+			dma_txreclaim(wlc_hw->di[i], DMA_RANGE_ALL);
 			TXPKTPENDCLR(wlc, i);
 			BCMMSG(wlc->wiphy, "pktpend fifo %d clrd\n", i);
 		}
drivers/staging/brcm80211/brcmsmac/wlc_main.h +1 -1
index 916b2a0..1dfa04b 100644
@@ -736,7 +736,7 @@ struct antsel_info {
 #define TXPKTPENDCLR(wlc, fifo)		((wlc)->core->txpktpend[(fifo)] = 0)
 #define TXAVAIL(wlc, fifo)		(*(wlc)->core->txavail[(fifo)])
 #define GETNEXTTXP(wlc, _queue)								\
-		dma_getnexttxp((wlc)->hw->di[(_queue)], HNDDMA_RANGE_TRANSMITTED)
+		dma_getnexttxp((wlc)->hw->di[(_queue)], DMA_RANGE_TRANSMITTED)
 
 #define WLC_IS_MATCH_SSID(wlc, ssid1, ssid2, len1, len2) \
 	((len1 == len2) && !memcmp(ssid1, ssid2, len1))
drivers/staging/brcm80211/include/bcmsoc.h +4 -4
index 012e465..4df0c64 100644
@@ -14,8 +14,8 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#ifndef	_HNDSOC_H
-#define	_HNDSOC_H
+#ifndef	_BCMSOC_H
+#define	_BCMSOC_H
 
 /* Include the soci specific files */
 #include <aidmp.h>
@@ -130,7 +130,7 @@
 					 * unused address ranges
 					 */
 
-/* There are TWO constants on all HND chips: SI_ENUM_BASE above,
+/* There are TWO constants on all Broadcom chips: SI_ENUM_BASE above,
  * and chipcommon being the first core:
  */
 #define	SI_CC_IDX		0
@@ -195,4 +195,4 @@
 #define	BISZ_BSSEND_IDX		6	/*      6: bss end */
 #define BISZ_SIZE		7	/* descriptor size in 32-bit integers */
 
-#endif				/* _HNDSOC_H */
+#endif				/* _BCMSOC_H */
Signature · 1 line
1.7.4.1
#86 lore raw

PATCH 65/83 staging: brcm80211: removed lmac remnants

In reply to Roland Vossen

Code cleanup. LMAC (a Broadcom specific acronym) was not used.

---
 drivers/staging/brcm80211/brcmsmac/wlc_pub.h |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmsmac/wlc_pub.h +0 -3
index 4f0fa20..a0c170b 100644
@@ -319,9 +319,6 @@ struct wlc_pub {
 	u32 boardflags;	/* Board specific flags from srom */
 	u32 boardflags2;	/* More board flags if sromrev >= 4 */
 	bool tempsense_disable;	/* disable periodic tempsense check */
-
-	bool _lmac;		/* lmac module included and enabled */
-	bool _lmacproto;	/* lmac protocol module included and enabled */
 	bool phy_11ncapable;	/* the PHY/HW is capable of 802.11N */
 	bool _ampdumac;		/* mac assist ampdu enabled or not */
 
Signature · 1 line
1.7.4.1