Skip to contentSkip to conversation

staging: brcm80211: 7th reaction for mainline patch #2

PATCH Superseded Franky Lin 15 participants 66 messages Sep 19, 2011 – Sep 22, 2011 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
author
#1 lore raw

PATCH 1/20 staging: brcm80211: sparse endianness warnings on dongle events

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Structures received from dongle have been annotated.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h        |   14 ++++++------
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c    |    3 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |   21 ++++++++++---------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c   |   24 +++++++++++-----------
 4 files changed, 32 insertions(+), 30 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +7 -7
index da53dd0..c368f71 100644
@@ -134,13 +134,13 @@
 #define BRCMF_EVENT_MSG_GROUP		0x04
 
 struct brcmf_event_msg {
-	u16 version;
-	u16 flags;
-	u32 event_type;
-	u32 status;
-	u32 reason;
-	u32 auth_type;
-	u32 datalen;
+	__be16 version;
+	__be16 flags;
+	__be32 event_type;
+	__be32 status;
+	__be32 reason;
+	__be32 auth_type;
+	__be32 datalen;
 	u8 addr[ETH_ALEN];
 	char ifname[IFNAMSIZ];
 } __packed;
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +2 -1
index 0d8389e..6f65683 100644
@@ -322,7 +322,8 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
 	/* Intercept the wme_dp ioctl here */
 	if (!ret && ioc->cmd == BRCMF_C_SET_VAR &&
 	    !strcmp(ioc->buf, "wme_dp")) {
-		int slen, val = 0;
+		int slen;
+		__le32 val = 0;
 
 		slen = strlen("wme_dp") + 1;
 		if (len >= (int)(slen + sizeof(int)))
drivers/staging/brcm80211/brcmfmac/dhd_common.c +11 -10
index 02c022a..c9bf92a 100644
@@ -53,15 +53,15 @@ static const char brcmf_version[] =
 struct msgtrace_hdr {
 	u8 version;
 	u8 spare;
-	u16 len;		/* Len of the trace */
-	u32 seqnum;		/* Sequence number of message. Useful
+	__be16 len;		/* Len of the trace */
+	__be32 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
+	__be32 discarded_bytes;	/* Number of discarded bytes because of
 				 trace overflow  */
-	u32 discarded_printf;	/* Number of discarded printf
+	__be32 discarded_printf;	/* Number of discarded printf
 				 because of trace overflow */
 } __packed;
 
@@ -401,7 +401,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
 
 	case BRCMF_E_RSSI:
 		brcmf_dbg(EVENT, "MACEVENT: %s %d\n",
-			  event_name, be32_to_cpu(*((int *)event_data)));
+			  event_name, be32_to_cpu(*((__be32 *)event_data)));
 		break;
 
 	default:
@@ -498,14 +498,15 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
 
 		/* put it back to BRCMF_E_NDIS_LINK */
 		if (type == BRCMF_E_NDIS_LINK) {
-			u32 temp;
+			u32 temp1;
+			__be32 temp2;
 
-			temp = get_unaligned_be32(&event->event_type);
+			temp1 = get_unaligned_be32(&event->event_type);
 			brcmf_dbg(TRACE, "Converted to WLC_E_LINK type %d\n",
-				  temp);
+				  temp1);
 
-			temp = be32_to_cpu(BRCMF_E_NDIS_LINK);
-			memcpy((void *)(&pvt_data->msg.event_type), &temp,
+			temp2 = cpu_to_be32(BRCMF_E_NDIS_LINK);
+			memcpy((void *)(&pvt_data->msg.event_type), &temp2,
 			       sizeof(pvt_data->msg.event_type));
 		}
 		break;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +12 -12
index 720f567..fb9b351 100644
@@ -63,10 +63,10 @@ struct brcmf_trap {
 
 #define CBUF_LEN	(128)
 
-struct rte_log {
-	u32 buf;		/* Can't be pointer on (64-bit) hosts */
-	uint buf_size;
-	uint idx;
+struct rte_log_le {
+	__le32 buf;		/* Can't be pointer on (64-bit) hosts */
+	__le32 buf_size;
+	__le32 idx;
 	char *_buf_compat;	/* Redundant pointer for backward compat. */
 };
 
@@ -89,7 +89,7 @@ struct rte_console {
 	 * Output will be lost if the output wraps around faster than the host
 	 * polls.
 	 */
-	struct rte_log log;
+	struct rte_log_le log_le;
 
 	/* Console input line buffer
 	 * Characters are read one at a time into cbuf
@@ -512,7 +512,7 @@ struct sdpcmd_regs {
 struct brcmf_console {
 	uint count;		/* Poll interval msec counter */
 	uint log_addr;		/* Log struct address (fixed) */
-	struct rte_log log;	/* Log struct (host copy) */
+	struct rte_log_le log_le;	/* Log struct (host copy) */
 	uint bufsize;		/* Size of log buffer */
 	u8 *buf;		/* Log buffer (host copy) */
 	uint last;		/* Last buffer read index */
@@ -3153,21 +3153,21 @@ static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus)
 		return 0;
 
 	/* Read console log struct */
-	addr = bus->console_addr + offsetof(struct rte_console, log);
-	rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *)&c->log,
-				sizeof(c->log));
+	addr = bus->console_addr + offsetof(struct rte_console, log_le);
+	rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *)&c->log_le,
+				   sizeof(c->log_le));
 	if (rv < 0)
 		return rv;
 
 	/* Allocate console buffer (one time only) */
 	if (c->buf == NULL) {
-		c->bufsize = le32_to_cpu(c->log.buf_size);
+		c->bufsize = le32_to_cpu(c->log_le.buf_size);
 		c->buf = kmalloc(c->bufsize, GFP_ATOMIC);
 		if (c->buf == NULL)
 			return -ENOMEM;
 	}
 
-	idx = le32_to_cpu(c->log.idx);
+	idx = le32_to_cpu(c->log_le.idx);
 
 	/* Protect against corrupt value */
 	if (idx > c->bufsize)
@@ -3179,7 +3179,7 @@ static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus)
 		return 0;
 
 	/* Read the console buffer */
-	addr = le32_to_cpu(c->log.buf);
+	addr = le32_to_cpu(c->log_le.buf);
 	rv = brcmf_sdbrcm_membytes(bus, false, addr, c->buf, c->bufsize);
 	if (rv < 0)
 		return rv;
Signature · 1 line
1.7.1
author
#4 lore raw

PATCH 4/20 staging: brcm80211: sparse endianness warnings for struct sdpcm_shared

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Structure that is received from dongle has been annotated.

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   31 +++++++++++++++++-------
 1 files changed, 22 insertions(+), 9 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +22 -9
index 57001d4..9d4850d 100644
@@ -530,6 +530,17 @@ struct sdpcm_shared {
 	u8 tag[32];
 };
 
+struct sdpcm_shared_le {
+	__le32 flags;
+	__le32 trap_addr;
+	__le32 assert_exp_addr;
+	__le32 assert_file_addr;
+	__le32 assert_line;
+	__le32 console_addr;	/* Address of struct rte_console */
+	__le32 msgtrace_addr;
+	u8 tag[32];
+};
+
 
 /* misc chip info needed by some of the routines */
 struct chip_info {
@@ -2919,6 +2930,7 @@ brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
 	u32 addr;
 	__le32 addr_le;
 	int rv;
+	struct sdpcm_shared_le sh_le;
 
 	/* Read last word in memory to determine address of
 			 sdpcm_shared structure */
@@ -2942,19 +2954,20 @@ brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
 	}
 
 	/* Read rte_shared structure */
-	rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *) sh,
-			      sizeof(struct sdpcm_shared));
+	rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *) &sh_le,
+			      sizeof(struct sdpcm_shared_le));
 	if (rv < 0)
 		return rv;
 
 	/* Endianness */
-	sh->flags = le32_to_cpu(sh->flags);
-	sh->trap_addr = le32_to_cpu(sh->trap_addr);
-	sh->assert_exp_addr = le32_to_cpu(sh->assert_exp_addr);
-	sh->assert_file_addr = le32_to_cpu(sh->assert_file_addr);
-	sh->assert_line = le32_to_cpu(sh->assert_line);
-	sh->console_addr = le32_to_cpu(sh->console_addr);
-	sh->msgtrace_addr = le32_to_cpu(sh->msgtrace_addr);
+	sh->flags = le32_to_cpu(sh_le.flags);
+	sh->trap_addr = le32_to_cpu(sh_le.trap_addr);
+	sh->assert_exp_addr = le32_to_cpu(sh_le.assert_exp_addr);
+	sh->assert_file_addr = le32_to_cpu(sh_le.assert_file_addr);
+	sh->assert_line = le32_to_cpu(sh_le.assert_line);
+	sh->console_addr = le32_to_cpu(sh_le.console_addr);
+	sh->msgtrace_addr = le32_to_cpu(sh_le.msgtrace_addr);
+	memcpy(sh->tag, sh_le.tag, sizeof(sh->tag));
 
 	if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
 		brcmf_dbg(ERROR, "sdpcm_shared version %d in brcmf is different than sdpcm_shared version %d in dongle\n",
Signature · 1 line
1.7.1

Franky Lin

author
#0 lore raw

cover staging: brcm80211: 7th reaction for mainline patch #2

Code clean up for fullmac.

Arend van Spriel (1):
staging: brcm80211: remove unconditional code blocks from brcmfmac

Franky Lin (6):
staging: brcm80211: remove event handler thread from fullmac
staging: brcm80211: remove fullmac module_param brcmf_dongle_memsize
staging: brcm80211: remove fullmac module_param
brcmf_sdiod_drive_strength
staging: brcm80211: remove fullmac module_param for watchdog
staging: brcm80211: remove fullmac module_param brcmf_idletime
staging: brcm80211: remove global variables for data frame boundary

Roland Vossen (13):
staging: brcm80211: sparse endianness warnings on dongle events
staging: brcm80211: various fulmac sparse endianness fixes
staging: brcm80211: sparse endianness warnings for struct
brcmf_proto_cdc_ioctl
staging: brcm80211: sparse endianness warnings for struct
sdpcm_shared
staging: brcm80211: more fullmac sparse endianness scan related
changes
staging: brcm80211: removed two fullmac sparse spinlock warnings
staging: brcm80211: added endianness check flag to fullmac Makefile
staging: brcm80211: removed likely/unlikely calls
staging: brcm80211: removed log after kzalloc()/kmalloc() failure
staging: brcm80211: clarified fullmac io and event codes
staging: brcm80211: consistent naming of struct net_device *ndev
staging: brcm80211: simplified internal ioctl function once more
staging: brcm80211: reduced checkpatch warnings to zero

 drivers/staging/brcm80211/brcmfmac/Makefile       |    1 +
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c       |    2 +-
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   33 +-
 drivers/staging/brcm80211/brcmfmac/dhd.h          |   51 +-
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h      |   13 +-
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c      |   47 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c   |  189 +++---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |  309 +++++-----
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |  430 +++++++-------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c  |  678 +++++++++------------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h  |   11 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.c      |   14 +-
 drivers/staging/brcm80211/brcmsmac/ampdu.c        |    8 +-
 drivers/staging/brcm80211/brcmsmac/antsel.c       |    5 +-
 drivers/staging/brcm80211/brcmsmac/channel.c      |    5 +-
 drivers/staging/brcm80211/brcmsmac/dma.c          |   16 +-
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c  |   11 +-
 drivers/staging/brcm80211/brcmsmac/main.c         |    3 +-
 drivers/staging/brcm80211/brcmsmac/nicpci.c       |    6 +-
 drivers/staging/brcm80211/brcmsmac/phy_shim.c     |    7 +-
 drivers/staging/brcm80211/brcmsmac/srom.c         |    3 +-
 21 files changed, 865 insertions(+), 977 deletions(-)
author
#2 lore raw

PATCH 2/20 staging: brcm80211: various fulmac sparse endianness fixes

From: Roland Vossen <[email protected]>

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    6 +++-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |   23 +++++++++++---------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |   19 ++++++++++-------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c  |   12 +++++-----
 4 files changed, 34 insertions(+), 26 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +4 -2
index 443e3a8..1cbdb80 100644
@@ -401,7 +401,9 @@ static int brcmf_sdioh_get_cisaddr(struct brcmf_sdio_dev *sdiodev, u32 regaddr)
 	/* read 24 bits and return valid 17 bit addr */
 	int i;
 	u32 scratch, regdata;
-	u8 *ptr = (u8 *)&scratch;
+	__le32 scratch_le;
+	u8 *ptr = (u8 *)&scratch_le;
+
 	for (i = 0; i < 3; i++) {
 		if ((brcmf_sdioh_card_regread(sdiodev, 0, regaddr, 1,
 				&regdata)) != SUCCESS)
@@ -412,7 +414,7 @@ static int brcmf_sdioh_get_cisaddr(struct brcmf_sdio_dev *sdiodev, u32 regaddr)
 	}
 
 	/* Only the lower 17-bits are valid */
-	scratch = le32_to_cpu(scratch);
+	scratch = le32_to_cpu(scratch_le);
 	scratch &= 0x0001FFFF;
 	return scratch;
 }
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +13 -10
index 9919fa5..e1d7456 100644
@@ -138,6 +138,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 	struct net_device *dev;
 	struct netdev_hw_addr *ha;
 	u32 allmulti, cnt;
+	__le32 cnt_le;
+	__le32 allmulti_le;
 
 	struct brcmf_ioctl ioc;
 	char *buf, *bufp;
@@ -166,9 +168,9 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 	strcpy(bufp, "mcast_list");
 	bufp += strlen("mcast_list") + 1;
 
-	cnt = cpu_to_le32(cnt);
-	memcpy(bufp, &cnt, sizeof(cnt));
-	bufp += sizeof(cnt);
+	cnt_le = cpu_to_le32(cnt);
+	memcpy(bufp, &cnt_le, sizeof(cnt));
+	bufp += sizeof(cnt_le);
 
 	netdev_for_each_mc_addr(ha, dev) {
 		if (!cnt)
@@ -205,10 +207,11 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 			  brcmf_ifname(&drvr_priv->pub, 0));
 		return;
 	}
-	allmulti = cpu_to_le32(allmulti);
+	allmulti_le = cpu_to_le32(allmulti);
 
 	if (!brcmu_mkiovar
-	    ("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
+	    ("allmulti", (void *)&allmulti_le,
+	    sizeof(allmulti_le), buf, buflen)) {
 		brcmf_dbg(ERROR, "%s: mkiovar failed for allmulti, datalen %d buflen %u\n",
 			  brcmf_ifname(&drvr_priv->pub, 0),
 			  (int)sizeof(allmulti), buflen);
@@ -226,7 +229,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 	if (ret < 0) {
 		brcmf_dbg(ERROR, "%s: set allmulti %d failed\n",
 			  brcmf_ifname(&drvr_priv->pub, 0),
-			  le32_to_cpu(allmulti));
+			  le32_to_cpu(allmulti_le));
 	}
 
 	kfree(buf);
@@ -235,19 +238,19 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 		 driver does */
 
 	allmulti = (dev->flags & IFF_PROMISC) ? true : false;
-	allmulti = cpu_to_le32(allmulti);
+	allmulti_le = cpu_to_le32(allmulti);
 
 	memset(&ioc, 0, sizeof(ioc));
 	ioc.cmd = BRCMF_C_SET_PROMISC;
-	ioc.buf = &allmulti;
-	ioc.len = sizeof(allmulti);
+	ioc.buf = &allmulti_le;
+	ioc.len = sizeof(allmulti_le);
 	ioc.set = true;
 
 	ret = brcmf_proto_ioctl(&drvr_priv->pub, 0, &ioc, ioc.len);
 	if (ret < 0) {
 		brcmf_dbg(ERROR, "%s: set promisc %d failed\n",
 			  brcmf_ifname(&drvr_priv->pub, 0),
-			  le32_to_cpu(allmulti));
+			  le32_to_cpu(allmulti_le));
 	}
 }
 
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +11 -8
index fb9b351..57001d4 100644
@@ -2361,8 +2361,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt,
 
 	/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
 	len = (u16) (pkt->len);
-	*(u16 *) frame = cpu_to_le16(len);
-	*(((u16 *) frame) + 1) = cpu_to_le16(~len);
+	*(__le16 *) frame = cpu_to_le16(len);
+	*(((__le16 *) frame) + 1) = cpu_to_le16(~len);
 
 	/* Software tag: channel, sequence number, data offset */
 	swheader =
@@ -2917,16 +2917,17 @@ static int
 brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
 {
 	u32 addr;
+	__le32 addr_le;
 	int rv;
 
 	/* Read last word in memory to determine address of
 			 sdpcm_shared structure */
-	rv = brcmf_sdbrcm_membytes(bus, false, bus->ramsize - 4, (u8 *)&addr,
+	rv = brcmf_sdbrcm_membytes(bus, false, bus->ramsize - 4, (u8 *)&addr_le,
 				   4);
 	if (rv < 0)
 		return rv;
 
-	addr = le32_to_cpu(addr);
+	addr = le32_to_cpu(addr_le);
 
 	brcmf_dbg(INFO, "sdpcm_shared address 0x%08X\n", addr);
 
@@ -3273,8 +3274,8 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
 	brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
 
 	/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
-	*(u16 *) frame = cpu_to_le16((u16) msglen);
-	*(((u16 *) frame) + 1) = cpu_to_le16(~msglen);
+	*(__le16 *) frame = cpu_to_le16((u16) msglen);
+	*(((__le16 *) frame) + 1) = cpu_to_le16(~msglen);
 
 	/* Software tag: channel, sequence number, data offset */
 	swheader =
@@ -3466,6 +3467,7 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
 	u32 varaddr;
 	u8 *vbuffer;
 	u32 varsizew;
+	__le32 varsizew_le;
 #ifdef BCMDBG
 	char *nvram_ularray;
 #endif				/* BCMDBG */
@@ -3529,10 +3531,11 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
 	 */
 	if (bcmerror) {
 		varsizew = 0;
+		varsizew_le = cpu_to_le32(0);
 	} else {
 		varsizew = varsize / 4;
 		varsizew = (~varsizew << 16) | (varsizew & 0x0000FFFF);
-		varsizew = cpu_to_le32(varsizew);
+		varsizew_le = cpu_to_le32(varsizew);
 	}
 
 	brcmf_dbg(INFO, "New varsize is %d, length token=0x%08x\n",
@@ -3540,7 +3543,7 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
 
 	/* Write the length token to the last word */
 	bcmerror = brcmf_sdbrcm_membytes(bus, true, (bus->orig_ramsize - 4),
-				    (u8 *)&varsizew, 4);
+					 (u8 *)&varsizew_le, 4);
 
 	return bcmerror;
 }
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +6 -6
index 9e07f77..b4befec 100644
@@ -378,7 +378,7 @@ brcmf_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
 {
 	union {
 		s8 buf[BRCMF_C_IOCTL_SMLEN];
-		s32 val;
+		__le32 val;
 	} var;
 	u32 len;
 	u32 data_null;
@@ -890,11 +890,11 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
 
 	/* Configure Beacon Interval for starter */
 	if (params->beacon_interval)
-		bcnprd = cpu_to_le32(params->beacon_interval);
+		bcnprd = params->beacon_interval;
 	else
-		bcnprd = cpu_to_le32(100);
+		bcnprd = 100;
 
-	err = brcmf_dev_ioctl(dev, BRCM_SET_BCNPRD, &bcnprd, sizeof(bcnprd));
+	err = brcmf_dev_ioctl_u32(dev, BRCM_SET_BCNPRD, &bcnprd);
 	if (unlikely(err)) {
 		WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err);
 		goto done;
@@ -2029,7 +2029,7 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
 		goto CleanUp;
 	}
 
-	*(u32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);
+	*(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);
 
 	err = brcmf_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
 	if (unlikely(err)) {
@@ -2098,7 +2098,7 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
 
 	ssid = (struct brcmf_ssid *)brcmf_read_prof(cfg_priv, WL_PROF_SSID);
 
-	*(u32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
+	*(__le32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
 	err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
 			cfg_priv->extra_buf, WL_EXTRA_BUF_MAX);
 	if (unlikely(err)) {
Signature · 1 line
1.7.1
author
#3 lore raw

PATCH 3/20 staging: brcm80211: sparse endianness warnings for struct brcmf_proto_cdc_ioctl

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Structure that is send/received to/from dongle has been annotated.

---
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +11 -14
index 6f65683..28bdf9e 100644
@@ -28,11 +28,11 @@
 #include "dhd_dbg.h"
 
 struct brcmf_proto_cdc_ioctl {
-	u32 cmd;	/* ioctl command value */
-	u32 len;	/* lower 16: output buflen;
+	__le32 cmd;	/* ioctl command value */
+	__le32 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 */
+	__le32 flags;	/* flag defns given below */
+	__le32 status;	/* status code returned from the device */
 };
 
 /* Max valid buffer size that can be sent to the dongle */
@@ -47,9 +47,6 @@ struct brcmf_proto_cdc_ioctl {
 #define CDCF_IOC_ID_SHIFT	16		/* ID Mask shift bits */
 #define CDC_IOC_ID(flags)	\
 	(((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
-#define CDC_SET_IF_IDX(hdr, idx) \
-	((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | \
-	((idx) << CDCF_IOC_IF_SHIFT)))
 
 /*
  * BDC header - Broadcom specific extension of CDC.
@@ -144,7 +141,7 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
 	struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
 	void *info;
 	int ret = 0, retries = 0;
-	u32 id, flags = 0;
+	u32 id, flags;
 
 	brcmf_dbg(TRACE, "Enter\n");
 	brcmf_dbg(CTL, "cmd %d len %d\n", cmd, len);
@@ -165,9 +162,9 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
 
 	msg->cmd = cpu_to_le32(cmd);
 	msg->len = cpu_to_le32(len);
-	msg->flags = (++prot->reqid << CDCF_IOC_ID_SHIFT);
-	CDC_SET_IF_IDX(msg, ifidx);
-	msg->flags = cpu_to_le32(msg->flags);
+	flags = (++prot->reqid << CDCF_IOC_ID_SHIFT);
+	flags = (flags & ~CDCF_IOC_IF_MASK) | (ifidx << CDCF_IOC_IF_SHIFT);
+	msg->flags = cpu_to_le32(flags);
 
 	if (buf)
 		memcpy(prot->buf, buf, len);
@@ -233,9 +230,9 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
 
 	msg->cmd = cpu_to_le32(cmd);
 	msg->len = cpu_to_le32(len);
-	msg->flags = (++prot->reqid << CDCF_IOC_ID_SHIFT) | CDCF_IOC_SET;
-	CDC_SET_IF_IDX(msg, ifidx);
-	msg->flags = cpu_to_le32(msg->flags);
+	flags = (++prot->reqid << CDCF_IOC_ID_SHIFT) | CDCF_IOC_SET;
+	flags = (flags & ~CDCF_IOC_IF_MASK) | (ifidx << CDCF_IOC_IF_SHIFT);
+	msg->flags = cpu_to_le32(flags);
 
 	if (buf)
 		memcpy(prot->buf, buf, len);
Signature · 1 line
1.7.1
author
#5 lore raw

PATCH 5/20 staging: brcm80211: more fullmac sparse endianness scan related changes

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Annotated endianness on structures send/received to/from dongle.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |   25 +++++++--
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |   64 +++++++++++-----------
 2 files changed, 52 insertions(+), 37 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +19 -6
index c368f71..1e18ad0 100644
@@ -469,6 +469,13 @@ struct brcmf_scan_results {
 	struct brcmf_bss_info bss_info[1];
 };
 
+struct brcmf_scan_results_le {
+	__le32 buflen;
+	__le32 version;
+	__le32 count;
+	struct brcmf_bss_info bss_info[1];
+};
+
 /* used for association with a specific BSSID and chanspec list */
 struct brcmf_assoc_params_le {
 	/* 00:00:00:00:00:00: broadcast scan */
@@ -492,8 +499,14 @@ struct brcmf_join_params {
 
 /* incremental scan results struct */
 struct brcmf_iscan_results {
-	u32 status;
-	struct brcmf_scan_results results;
+	union {
+		u32 status;
+		__le32 status_le;
+	};
+	union {
+		struct brcmf_scan_results results;
+		struct brcmf_scan_results_le results_le;
+	};
 };
 
 /* size of brcmf_iscan_results not including variable length array */
@@ -549,10 +562,10 @@ struct brcmf_scb_val_le {
 };
 
 /* channel encoding */
-struct brcmf_channel_info {
-	int hw_channel;
-	int target_channel;
-	int scan_channel;
+struct brcmf_channel_info_le {
+	__le32 hw_channel;
+	__le32 target_channel;
+	__le32 scan_channel;
 };
 
 /* Linux network driver ioctl encoding */
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +33 -31

137 lines not on this page · raw message

Signature · 1 line
1.7.1
author
#6 lore raw

PATCH 6/20 staging: brcm80211: remove unconditional code blocks from brcmfmac

In reply to Franky Lin

From: Arend van Spriel <[email protected]>

Using a block statement to scope function variables is not common in linux kernel development. Browsed through the brcmfmac to remove those.

---
 drivers/staging/brcm80211/brcmfmac/dhd_common.c |  132 +++++++++++-----------
 1 files changed, 66 insertions(+), 66 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +66 -66
index c9bf92a..0c41c1c 100644
@@ -198,6 +198,11 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
 		BRCMF_E_PFN_SCAN_COMPLETE, "SCAN_COMPLETE"}
 	};
 	uint event_type, flags, auth_type, datalen;
+	static u32 seqnum_prev;
+	struct msgtrace_hdr hdr;
+	u32 nblost;
+	char *s, *p;
+
 	event_type = be32_to_cpu(event->event_type);
 	flags = be16_to_cpu(event->flags);
 	status = be32_to_cpu(event->status);
@@ -348,55 +353,52 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
 		break;
 
 	case BRCMF_E_TRACE:
-		{
-			static u32 seqnum_prev;
-			struct msgtrace_hdr hdr;
-			u32 nblost;
-			char *s, *p;
-
-			buf = (unsigned char *) event_data;
-			memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));
-
-			if (hdr.version != MSGTRACE_VERSION) {
-				brcmf_dbg(ERROR, "MACEVENT: %s [unsupported version --> brcmf version:%d dongle version:%d]\n",
-					  event_name,
-					  MSGTRACE_VERSION, hdr.version);
-				/* Reset datalen to avoid display below */
-				datalen = 0;
-				break;
-			}
-
-			/* There are 2 bytes available at the end of data */
-			*(buf + sizeof(struct msgtrace_hdr)
-				 + be16_to_cpu(hdr.len)) = '\0';
-
-			if (be32_to_cpu(hdr.discarded_bytes)
-			    || be32_to_cpu(hdr.discarded_printf))
-				brcmf_dbg(ERROR, "WLC_E_TRACE: [Discarded traces in dongle --> discarded_bytes %d discarded_printf %d]\n",
-					  be32_to_cpu(hdr.discarded_bytes),
-					  be32_to_cpu(hdr.discarded_printf));
-
-			nblost = be32_to_cpu(hdr.seqnum) - seqnum_prev - 1;
-			if (nblost > 0)
-				brcmf_dbg(ERROR, "WLC_E_TRACE: [Event lost --> seqnum %d nblost %d\n",
-					  be32_to_cpu(hdr.seqnum), nblost);
-			seqnum_prev = be32_to_cpu(hdr.seqnum);
-
-			/* Display the trace buffer. Advance from \n to \n to
-			 * avoid display big
-			 * printf (issue with Linux printk )
-			 */
-			p = (char *)&buf[sizeof(struct msgtrace_hdr)];
-			while ((s = strstr(p, "\n")) != NULL) {
-				*s = '\0';
-				printk(KERN_DEBUG"%s\n", p);
-				p = s + 1;
-			}
-			printk(KERN_DEBUG "%s\n", p);
+		buf = (unsigned char *) event_data;
+		memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));
 
+		if (hdr.version != MSGTRACE_VERSION) {
+			brcmf_dbg(ERROR,
+				  "MACEVENT: %s [unsupported version --> brcmf"
+				  " version:%d dongle version:%d]\n",
+				  event_name, MSGTRACE_VERSION, hdr.version);
 			/* Reset datalen to avoid display below */
 			datalen = 0;
+			break;
+		}
+
+		/* There are 2 bytes available at the end of data */
+		*(buf + sizeof(struct msgtrace_hdr)
+			 + be16_to_cpu(hdr.len)) = '\0';
+
+		if (be32_to_cpu(hdr.discarded_bytes)
+		    || be32_to_cpu(hdr.discarded_printf))
+			brcmf_dbg(ERROR,
+				  "WLC_E_TRACE: [Discarded traces in dongle -->"
+				  " discarded_bytes %d discarded_printf %d]\n",
+				  be32_to_cpu(hdr.discarded_bytes),
+				  be32_to_cpu(hdr.discarded_printf));
+
+		nblost = be32_to_cpu(hdr.seqnum) - seqnum_prev - 1;
+		if (nblost > 0)
+			brcmf_dbg(ERROR, "WLC_E_TRACE: [Event lost --> seqnum "
+				  " %d nblost %d\n", be32_to_cpu(hdr.seqnum),
+				  nblost);
+		seqnum_prev = be32_to_cpu(hdr.seqnum);
+
+		/* Display the trace buffer. Advance from \n to \n to
+		 * avoid display big
+		 * printf (issue with Linux printk )
+		 */
+		p = (char *)&buf[sizeof(struct msgtrace_hdr)];
+		while ((s = strstr(p, "\n")) != NULL) {
+			*s = '\0';
+			printk(KERN_DEBUG"%s\n", p);
+			p = s + 1;
 		}
+		printk(KERN_DEBUG "%s\n", p);
+
+		/* Reset datalen to avoid display below */
+		datalen = 0;
 		break;
 
 	case BRCMF_E_RSSI:
@@ -405,8 +407,9 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
 		break;
 
 	default:
-		brcmf_dbg(EVENT, "MACEVENT: %s %d, MAC %s, status %d, reason %d, auth %d\n",
-			  event_name, event_type, eabuf,
+		brcmf_dbg(EVENT,
+			  "MACEVENT: %s %d, MAC %s, status %d, reason %d, "
+			  "auth %d\n", event_name, event_type, eabuf,
 			  (int)status, (int)reason, (int)auth_type);
 		break;
 	}
@@ -428,6 +431,7 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
 {
 	/* check whether packet is a BRCM event pkt */
 	struct brcmf_event *pvt_data = (struct brcmf_event *) pktdata;
+	struct brcmf_if_event *ifevent;
 	char *event_data;
 	u32 type, status;
 	u16 flags;
@@ -459,26 +463,22 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
 
 	switch (type) {
 	case BRCMF_E_IF:
-		{
-			struct brcmf_if_event *ifevent =
-					(struct brcmf_if_event *) event_data;
-			brcmf_dbg(TRACE, "if event\n");
-
-			if (ifevent->ifidx > 0 &&
-				 ifevent->ifidx < BRCMF_MAX_IFS) {
-				if (ifevent->action == BRCMF_E_IF_ADD)
-					brcmf_add_if(drvr_priv, ifevent->ifidx,
-						   NULL, event->ifname,
-						   pvt_data->eth.h_dest,
-						   ifevent->flags,
-						   ifevent->bssidx);
-				else
-					brcmf_del_if(drvr_priv, ifevent->ifidx);
-			} else {
-				brcmf_dbg(ERROR, "Invalid ifidx %d for %s\n",
-					  ifevent->ifidx, event->ifname);
-			}
+		ifevent = (struct brcmf_if_event *) event_data;
+		brcmf_dbg(TRACE, "if event\n");
+
+		if (ifevent->ifidx > 0 && ifevent->ifidx < BRCMF_MAX_IFS) {
+			if (ifevent->action == BRCMF_E_IF_ADD)
+				brcmf_add_if(drvr_priv, ifevent->ifidx, NULL,
+					     event->ifname,
+					     pvt_data->eth.h_dest,
+					     ifevent->flags, ifevent->bssidx);
+			else
+				brcmf_del_if(drvr_priv, ifevent->ifidx);
+		} else {
+			brcmf_dbg(ERROR, "Invalid ifidx %d for %s\n",
+				  ifevent->ifidx, event->ifname);
 		}
+
 		/* send up the if event: btamp user needs it */
 		*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
 		break;
Signature · 1 line
1.7.1
author
#7 lore raw

PATCH 7/20 staging: brcm80211: remove event handler thread from fullmac

In reply to Franky Lin

Use work queue to defer cfg80211 event handle jobs

---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |   85 +++++-----------------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |    3 +-
 2 files changed, 21 insertions(+), 67 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +20 -65
index 5e86e21..2dd28a2 100644
@@ -3248,69 +3248,30 @@ static void brcmf_put_event(struct brcmf_cfg80211_event_q *e)
 	kfree(e);
 }
 
-static s32 brcmf_event_handler(void *data)
+static void brcmf_cfg80211_event_handler(struct work_struct *work)
 {
 	struct brcmf_cfg80211_priv *cfg_priv =
-			(struct brcmf_cfg80211_priv *)data;
-	struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
+			container_of(work, struct brcmf_cfg80211_priv,
+				     event_work);
 	struct brcmf_cfg80211_event_q *e;
-	DECLARE_WAITQUEUE(wait, current);
 
-	sched_setscheduler(current, SCHED_FIFO, &param);
-	allow_signal(SIGTERM);
-	add_wait_queue(&cfg_priv->event_waitq, &wait);
-	while (1) {
-		prepare_to_wait(&cfg_priv->event_waitq, &wait,
-				TASK_INTERRUPTIBLE);
-
-		schedule();
-
-		if (kthread_should_stop())
-			break;
-
-		e = brcmf_deq_event(cfg_priv);
-		if (unlikely(!e)) {
-			WL_ERR("event queue empty...\n");
-			continue;
-		}
-
-		do {
-			WL_INFO("event type (%d)\n", e->etype);
-			if (cfg_priv->el.handler[e->etype])
-				cfg_priv->el.handler[e->etype](cfg_priv,
-					cfg_to_ndev(cfg_priv),
-					&e->emsg, e->edata);
-			else
-				WL_INFO("Unknown Event (%d): ignoring\n",
-					e->etype);
-			brcmf_put_event(e);
-		} while ((e = brcmf_deq_event(cfg_priv)));
+	e = brcmf_deq_event(cfg_priv);
+	if (unlikely(!e)) {
+		WL_ERR("event queue empty...\n");
+		return;
 	}
-	finish_wait(&cfg_priv->event_waitq, &wait);
-	WL_INFO("was terminated\n");
-	return 0;
-}
 
-static s32 brcmf_create_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	init_waitqueue_head(&cfg_priv->event_waitq);
-	cfg_priv->event_tsk = kthread_run(brcmf_event_handler, cfg_priv,
-					  "wl_event_handler");
-	if (IS_ERR(cfg_priv->event_tsk)) {
-		cfg_priv->event_tsk = NULL;
-		WL_ERR("failed to create event thread\n");
-		return -ENOMEM;
-	}
-	return 0;
-}
+	do {
+		WL_INFO("event type (%d)\n", e->etype);
+		if (cfg_priv->el.handler[e->etype])
+			cfg_priv->el.handler[e->etype](cfg_priv,
+						       cfg_to_ndev(cfg_priv),
+						       &e->emsg, e->edata);
+		else
+			WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
+		brcmf_put_event(e);
+	} while ((e = brcmf_deq_event(cfg_priv)));
 
-static void brcmf_destroy_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	if (cfg_priv->event_tsk) {
-		send_sig(SIGTERM, cfg_priv->event_tsk, 1);
-		kthread_stop(cfg_priv->event_tsk);
-		cfg_priv->event_tsk = NULL;
-	}
 }
 
 static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv)
@@ -3352,8 +3313,7 @@ static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
 	err = brcmf_init_priv_mem(cfg_priv);
 	if (unlikely(err))
 		return err;
-	if (unlikely(brcmf_create_event_handler(cfg_priv)))
-		return -ENOMEM;
+	INIT_WORK(&cfg_priv->event_work, brcmf_cfg80211_event_handler);
 	brcmf_init_eloop_handler(&cfg_priv->el);
 	mutex_init(&cfg_priv->usr_sync);
 	err = brcmf_init_iscan(cfg_priv);
@@ -3368,7 +3328,7 @@ static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
 
 static void wl_deinit_priv(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	brcmf_destroy_event_handler(cfg_priv);
+	cancel_work_sync(&cfg_priv->event_work);
 	cfg_priv->dongle_up = false;	/* dongle down */
 	brcmf_flush_eq(cfg_priv);
 	brcmf_link_down(cfg_priv);
@@ -3438,11 +3398,6 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_dev *cfg_dev)
 	kfree(cfg_dev);
 }
 
-static void brcmf_wakeup_event(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	wake_up(&cfg_priv->event_waitq);
-}
-
 void
 brcmf_cfg80211_event(struct net_device *ndev,
 		  const struct brcmf_event_msg *e, void *data)
@@ -3451,7 +3406,7 @@ brcmf_cfg80211_event(struct net_device *ndev,
 	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
 
 	if (likely(!brcmf_enq_event(cfg_priv, event_type, e)))
-		brcmf_wakeup_event(cfg_priv);
+		schedule_work(&cfg_priv->event_work);
 }
 
 static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +1 -2
index d27d4e6..79806c0 100644
@@ -298,8 +298,7 @@ struct brcmf_cfg80211_priv {
 	struct brcmf_cfg80211_iscan_ctrl *iscan;	/* iscan controller */
 	struct brcmf_cfg80211_connect_info conn_info; /* association info */
 	struct brcmf_cfg80211_pmk_list *pmk_list;	/* wpa2 pmk list */
-	struct task_struct *event_tsk;	/* task of main event handler thread */
-	wait_queue_head_t event_waitq;	/* wait queue for main event handling */
+	struct work_struct event_work;	/* event handler work struct */
 	unsigned long status;		/* current dongle status */
 	void *pub;
 	u32 channel;		/* current channel */
Signature · 1 line
1.7.1
author
#8 lore raw

PATCH 8/20 staging: brcm80211: remove fullmac module_param brcmf_dongle_memsize

In reply to Franky Lin

remove unused module parameter brcmf_dongle_memsize and related code

---
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h  |    3 --
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   35 +++---------------------
 2 files changed, 5 insertions(+), 33 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +0 -3
index aa05b1c..d02cb10 100644
@@ -24,9 +24,6 @@
  * Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
  */
 
-/* dongle ram module parameter */
-extern int brcmf_dongle_memsize;
-
 /* Tx/Rx bounds module parameters */
 extern uint brcmf_txbound;
 extern uint brcmf_rxbound;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +5 -30
index 9d4850d..7090a36 100644
@@ -568,7 +568,6 @@ struct brcmf_bus {
 	uint varsz;		/* Size of variables buffer */
 
 	u32 ramsize;		/* Size of RAM in SOCRAM (bytes) */
-	u32 orig_ramsize;	/* Size of RAM in SOCRAM (bytes) */
 
 	u32 hostintmask;	/* Copy of Host Interrupt Mask */
 	u32 intstatus;	/* Intstatus bits (events) pending */
@@ -772,11 +771,6 @@ module_param(brcmf_poll, uint, 0);
 uint brcmf_intr = true;
 module_param(brcmf_intr, uint, 0);
 
-/* override the RAM size if possible */
-#define DONGLE_MIN_MEMSIZE (128 * 1024)
-int brcmf_dongle_memsize;
-module_param(brcmf_dongle_memsize, int, 0);
-
 #define RETRYCHAN(chan) ((chan) == SDPCM_EVENT_CHANNEL)
 
 /* Retry count for register access failures */
@@ -857,17 +851,6 @@ static void brcmf_sdbrcm_pktfree2(struct brcmf_bus *bus, struct sk_buff *pkt)
 		brcmu_pkt_buf_free_skb(pkt);
 }
 
-static void brcmf_sdbrcm_setmemsize(struct brcmf_bus *bus, int mem_size)
-{
-	s32 min_size = DONGLE_MIN_MEMSIZE;
-	/* Restrict the memsize to user specified limit */
-	brcmf_dbg(ERROR, "user: Restrict the dongle ram size to %d, min %d\n",
-		  brcmf_dongle_memsize, min_size);
-	if ((brcmf_dongle_memsize > min_size) &&
-	    (brcmf_dongle_memsize < (s32) bus->orig_ramsize))
-		bus->ramsize = brcmf_dongle_memsize;
-}
-
 static void brcmf_sdbrcm_sdlock(struct brcmf_bus *bus)
 {
 	if (bus->threads_only)
@@ -3531,11 +3514,10 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
 	}
 
 	/* adjust to the user specified RAM */
-	brcmf_dbg(INFO, "Physical memory size: %d, usable memory size: %d\n",
-		  bus->orig_ramsize, bus->ramsize);
+	brcmf_dbg(INFO, "Physical memory size: %d\n", bus->ramsize);
 	brcmf_dbg(INFO, "Vars are at %d, orig varsize is %d\n",
 		  varaddr, varsize);
-	varsize = ((bus->orig_ramsize - 4) - varaddr);
+	varsize = ((bus->ramsize - 4) - varaddr);
 
 	/*
 	 * Determine the length token:
@@ -3555,7 +3537,7 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
 		  varsize, varsizew);
 
 	/* Write the length token to the last word */
-	bcmerror = brcmf_sdbrcm_membytes(bus, true, (bus->orig_ramsize - 4),
+	bcmerror = brcmf_sdbrcm_membytes(bus, true, (bus->ramsize - 4),
 					 (u8 *)&varsizew_le, 4);
 
 	return bcmerror;
@@ -4630,17 +4612,11 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, u32 regsva)
 	/* Get info on the ARM and SOCRAM cores... */
 	brcmf_sdcard_reg_read(bus->sdiodev,
 		  CORE_SB(bus->ci->armcorebase, sbidhigh), 4);
-	bus->orig_ramsize = bus->ci->ramsize;
-	if (!(bus->orig_ramsize)) {
+	bus->ramsize = bus->ci->ramsize;
+	if (!(bus->ramsize)) {
 		brcmf_dbg(ERROR, "failed to find SOCRAM memory!\n");
 		goto fail;
 	}
-	bus->ramsize = bus->orig_ramsize;
-	if (brcmf_dongle_memsize)
-		brcmf_sdbrcm_setmemsize(bus, brcmf_dongle_memsize);
-
-	brcmf_dbg(ERROR, "DHD: dongle ram size is set to %d(orig %d)\n",
-		  bus->ramsize, bus->orig_ramsize);
 
 	/* Set core control so an SDIO reset does a backplane reset */
 	reg_addr = bus->ci->buscorebase +
@@ -4819,7 +4795,6 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
 	 */
 	brcmf_txbound = BRCMF_TXBOUND;
 	brcmf_rxbound = BRCMF_RXBOUND;
-	brcmf_dongle_memsize = 0;
 	brcmf_txminmax = BRCMF_TXMINMAX;
 
 	brcmf_c_init();
Signature · 1 line
1.7.1
author
#9 lore raw

PATCH 9/20 staging: brcm80211: remove fullmac module_param brcmf_sdiod_drive_strength

In reply to Franky Lin

Replaced the global variable with constant

---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +2 -4
index 7090a36..53de5a7 100644
@@ -759,9 +759,7 @@ static uint brcmf_txminmax;
 int brcmf_idletime = 1;
 module_param(brcmf_idletime, int, 0);
 
-/* SDIO Drive Strength (in milliamps) */
-uint brcmf_sdiod_drive_strength = 6;
-module_param(brcmf_sdiod_drive_strength, uint, 0);
+#define SDIO_DRIVE_STRENGTH	6	/* in milliamps */
 
 /* Use polling */
 uint brcmf_poll;
@@ -4607,7 +4605,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, u32 regsva)
 		goto fail;
 	}
 
-	brcmf_sdbrcm_sdiod_drive_strength_init(bus, brcmf_sdiod_drive_strength);
+	brcmf_sdbrcm_sdiod_drive_strength_init(bus, SDIO_DRIVE_STRENGTH);
 
 	/* Get info on the ARM and SOCRAM cores... */
 	brcmf_sdcard_reg_read(bus->sdiodev,
Signature · 1 line
1.7.1
author
#11 lore raw

PATCH 11/20 staging: brcm80211: remove fullmac module_param brcmf_idletime

In reply to Franky Lin

Use constant for idle time setting.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h      |    1 +
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |    5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +1 -0
index 1e18ad0..7ca9172 100644
@@ -808,5 +808,6 @@ extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg,
 #define BRCMF_IDLE_IMMEDIATE	(-1)
 #define BRCMF_IDLE_ACTIVE	0	/* Do not request any SD clock change
 				 when idle */
+#define BRCMF_IDLE_INTERVAL	1
 
 #endif				/* _BRCMF_H_ */
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -4
index 4033e73..57049ec 100644
@@ -747,9 +747,6 @@ module_param(brcmf_txbound, uint, 0);
 module_param(brcmf_rxbound, uint, 0);
 static uint brcmf_txminmax;
 
-int brcmf_idletime = 1;
-module_param(brcmf_idletime, int, 0);
-
 #define SDIO_DRIVE_STRENGTH	6	/* in milliamps */
 
 /* Use polling */
@@ -4650,7 +4647,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus)
 
 	/* ...and initialize clock/power states */
 	bus->clkstate = CLK_SDONLY;
-	bus->idletime = (s32) brcmf_idletime;
+	bus->idletime = BRCMF_IDLE_INTERVAL;
 	bus->idleclock = BRCMF_IDLE_ACTIVE;
 
 	/* Query the F2 block size, set roundup accordingly */
Signature · 1 line
1.7.1
author
#12 lore raw

PATCH 12/20 staging: brcm80211: remove global variables for data frame boundary

In reply to Franky Lin

Put boundary settings in brcmf_bus structure

---
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h  |    4 ----
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   24 ++++++++++--------------
 2 files changed, 10 insertions(+), 18 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +0 -4
index 104c0e7..a5064f5 100644
@@ -27,10 +27,6 @@
  * Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
  */
 
-/* Tx/Rx bounds module parameters */
-extern uint brcmf_txbound;
-extern uint brcmf_rxbound;
-
 /* Indicate (dis)interest in finding dongles. */
 extern int brcmf_bus_register(void);
 extern void brcmf_bus_unregister(void);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +10 -14
index 57049ec..66ab752 100644
@@ -588,6 +588,10 @@ struct brcmf_bus {
 	u8 rx_seq;		/* Receive sequence number (expected) */
 	bool rxskip;		/* Skip receive (awaiting NAK ACK) */
 
+	uint rxbound;		/* Rx frames to read before resched */
+	uint txbound;		/* Tx frames to send before resched */
+	uint txminmax;
+
 	struct sk_buff *glomd;	/* Packet containing glomming descriptor */
 	struct sk_buff *glom;	/* Packet chain for glommed superframe */
 	uint glomerr;		/* Glom packet read errors */
@@ -740,13 +744,6 @@ module_param(brcmf_watchdog_prio, int, 0);
 int brcmf_dpc_prio = 98;
 module_param(brcmf_dpc_prio, int, 0);
 
-/* Tx/Rx bounds */
-uint brcmf_txbound;
-uint brcmf_rxbound;
-module_param(brcmf_txbound, uint, 0);
-module_param(brcmf_rxbound, uint, 0);
-static uint brcmf_txminmax;
-
 #define SDIO_DRIVE_STRENGTH	6	/* in milliamps */
 
 /* Use polling */
@@ -2488,8 +2485,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
 {
 	u32 intstatus, newstatus = 0;
 	uint retries = 0;
-	uint rxlimit = brcmf_rxbound;	/* Rx frames to read before resched */
-	uint txlimit = brcmf_txbound;	/* Tx frames to send before resched */
+	uint rxlimit = bus->rxbound;	/* Rx frames to read before resched */
+	uint txlimit = bus->txbound;	/* Tx frames to send before resched */
 	uint framecnt = 0;	/* Temporary counter of tx/rx frames */
 	bool rxdone = true;	/* Flag for no more read data */
 	bool resched = false;	/* Flag indicating resched wanted */
@@ -2690,7 +2687,7 @@ clkwait:
 	else if ((bus->clkstate == CLK_AVAIL) && !bus->fcstate &&
 		 brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && txlimit
 		 && data_ok(bus)) {
-		framecnt = rxdone ? txlimit : min(txlimit, brcmf_txminmax);
+		framecnt = rxdone ? txlimit : min(txlimit, bus->txminmax);
 		framecnt = brcmf_sdbrcm_sendfromq(bus, framecnt);
 		txlimit -= framecnt;
 	}
@@ -4779,10 +4776,6 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
 	 * first time that the driver is initialized vs subsequent
 	 * initializations.
 	 */
-	brcmf_txbound = BRCMF_TXBOUND;
-	brcmf_rxbound = BRCMF_RXBOUND;
-	brcmf_txminmax = BRCMF_TXMINMAX;
-
 	brcmf_c_init();
 
 	brcmf_dbg(TRACE, "Enter\n");
@@ -4798,6 +4791,9 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
 	}
 	bus->sdiodev = sdiodev;
 	sdiodev->bus = bus;
+	bus->txbound = BRCMF_TXBOUND;
+	bus->rxbound = BRCMF_RXBOUND;
+	bus->txminmax = BRCMF_TXMINMAX;
 	bus->tx_seq = SDPCM_SEQUENCE_WRAP - 1;
 	bus->usebufpool = false;	/* Use bufpool if allocated,
 					 else use locally malloced rxbuf */
Signature · 1 line
1.7.1
author
#13 lore raw

PATCH 13/20 staging: brcm80211: removed two fullmac sparse spinlock warnings

In reply to Franky Lin

From: Roland Vossen <[email protected]>

By deleting three redundant functions. The spinlock was related to event queue operation. Event queue data members were also renamed to make their function more clear.

---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |   49 ++++++++--------------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |    6 +-
 2 files changed, 20 insertions(+), 35 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +17 -32
index 2dd28a2..0bda00c 100644
@@ -3181,21 +3181,6 @@ init_priv_mem_out:
 	return -ENOMEM;
 }
 
-static void brcmf_lock_eq(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	spin_lock_irq(&cfg_priv->eq_lock);
-}
-
-static void brcmf_unlock_eq(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	spin_unlock_irq(&cfg_priv->eq_lock);
-}
-
-static void brcmf_init_eq_lock(struct brcmf_cfg80211_priv *cfg_priv)
-{
-	spin_lock_init(&cfg_priv->eq_lock);
-}
-
 /*
 * retrieve first queued event from head
 */
@@ -3205,13 +3190,13 @@ static struct brcmf_cfg80211_event_q *brcmf_deq_event(
 {
 	struct brcmf_cfg80211_event_q *e = NULL;
 
-	brcmf_lock_eq(cfg_priv);
-	if (likely(!list_empty(&cfg_priv->eq_list))) {
-		e = list_first_entry(&cfg_priv->eq_list,
-				     struct brcmf_cfg80211_event_q, eq_list);
-		list_del(&e->eq_list);
+	spin_lock_irq(&cfg_priv->evt_q_lock);
+	if (likely(!list_empty(&cfg_priv->evt_q_list))) {
+		e = list_first_entry(&cfg_priv->evt_q_list,
+				     struct brcmf_cfg80211_event_q, evt_q_list);
+		list_del(&e->evt_q_list);
 	}
-	brcmf_unlock_eq(cfg_priv);
+	spin_unlock_irq(&cfg_priv->evt_q_lock);
 
 	return e;
 }
@@ -3236,9 +3221,9 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
 	e->etype = event;
 	memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));
 
-	brcmf_lock_eq(cfg_priv);
-	list_add_tail(&e->eq_list, &cfg_priv->eq_list);
-	brcmf_unlock_eq(cfg_priv);
+	spin_lock_irq(&cfg_priv->evt_q_lock);
+	list_add_tail(&e->evt_q_list, &cfg_priv->evt_q_list);
+	spin_unlock_irq(&cfg_priv->evt_q_lock);
 
 	return err;
 }
@@ -3276,22 +3261,22 @@ static void brcmf_cfg80211_event_handler(struct work_struct *work)
 
 static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv)
 {
-	brcmf_init_eq_lock(cfg_priv);
-	INIT_LIST_HEAD(&cfg_priv->eq_list);
+	spin_lock_init(&cfg_priv->evt_q_lock);
+	INIT_LIST_HEAD(&cfg_priv->evt_q_list);
 }
 
 static void brcmf_flush_eq(struct brcmf_cfg80211_priv *cfg_priv)
 {
 	struct brcmf_cfg80211_event_q *e;
 
-	brcmf_lock_eq(cfg_priv);
-	while (!list_empty(&cfg_priv->eq_list)) {
-		e = list_first_entry(&cfg_priv->eq_list,
-				     struct brcmf_cfg80211_event_q, eq_list);
-		list_del(&e->eq_list);
+	spin_lock_irq(&cfg_priv->evt_q_lock);
+	while (!list_empty(&cfg_priv->evt_q_list)) {
+		e = list_first_entry(&cfg_priv->evt_q_list,
+				     struct brcmf_cfg80211_event_q, evt_q_list);
+		list_del(&e->evt_q_list);
 		kfree(e);
 	}
-	brcmf_unlock_eq(cfg_priv);
+	spin_unlock_irq(&cfg_priv->evt_q_lock);
 }
 
 static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +3 -3
index 79806c0..14a32e1 100644
@@ -199,7 +199,7 @@ struct brcmf_cfg80211_ie {
 
 /* event queue for cfg80211 main event */
 struct brcmf_cfg80211_event_q {
-	struct list_head eq_list;
+	struct list_head evt_q_list;
 	u32 etype;
 	struct brcmf_event_msg emsg;
 	s8 edata[1];
@@ -282,8 +282,8 @@ struct brcmf_cfg80211_priv {
 	struct cfg80211_scan_request *scan_request;	/* scan request
 							 object */
 	struct brcmf_cfg80211_event_loop el;	/* main event loop */
-	struct list_head eq_list;	/* used for event queue */
-	spinlock_t eq_lock;	/* for event queue synchronization */
+	struct list_head evt_q_list;	/* used for event queue */
+	spinlock_t	 evt_q_lock;	/* for event queue synchronization */
 	struct mutex usr_sync;	/* maily for dongle up/down synchronization */
 	struct brcmf_scan_results *bss_list;	/* bss_list holding scanned
 						 ap information */
Signature · 1 line
1.7.1
author
#14 lore raw

PATCH 14/20 staging: brcm80211: added endianness check flag to fullmac Makefile

In reply to Franky Lin

From: Roland Vossen <[email protected]>

---
 drivers/staging/brcm80211/brcmfmac/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +1 -0
index 3d0878f..a1b7637 100644
@@ -30,3 +30,4 @@ DHDOFILES = \
 
 obj-$(CONFIG_BRCMFMAC) += brcmfmac.o
 brcmfmac-objs += $(DHDOFILES)
+ccflags-y += -D__CHECK_ENDIAN__
Signature · 1 line
1.7.1
author
#15 lore raw

PATCH 15/20 staging: brcm80211: removed likely/unlikely calls

In reply to Franky Lin

From: Roland Vossen <[email protected]>

There was no performance rationale to use these guys.

---
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |    4 +-
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |  211 +++++++++++-----------
 drivers/staging/brcm80211/brcmsmac/ampdu.c       |    2 +-
 3 files changed, 107 insertions(+), 110 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +2 -2
index e1d7456..cc8564a 100644
@@ -944,7 +944,7 @@ static int brcmf_netdev_open(struct net_device *net)
 	/* Allow transmit calls */
 	netif_start_queue(net);
 	drvr_priv->pub.up = 1;
-	if (unlikely(brcmf_cfg80211_up(drvr_priv->pub.config))) {
+	if (brcmf_cfg80211_up(drvr_priv->pub.config)) {
 		brcmf_dbg(ERROR, "failed to bring up cfg80211\n");
 		return -1;
 	}
@@ -1054,7 +1054,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
 			brcmf_cfg80211_attach(net,
 					      brcmf_bus_get_device(bus),
 					      &drvr_priv->pub);
-	if (unlikely(drvr_priv->pub.config == NULL)) {
+	if (drvr_priv->pub.config == NULL) {
 		brcmf_dbg(ERROR, "wl_cfg80211_attach failed\n");
 		goto fail;
 	}
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +104 -107

802 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/ampdu.c +1 -1
index 47dc27a..d221a3a 100644
@@ -1132,7 +1132,7 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
 		s2 = R_REG(&wlc->regs->frmtxstatus2);
 	}
 
-	if (likely(scb)) {
+	if (scb) {
 		scb_ampdu = &scb->scb_ampdu;
 		ini = &scb_ampdu->ini[p->priority];
 		brcms_c_ampdu_dotxstatus_complete(ampdu, scb, p, txs, s1, s2);
Signature · 1 line
1.7.1
author
#16 lore raw

PATCH 16/20 staging: brcm80211: removed log after kzalloc()/kmalloc() failure

In reply to Franky Lin

From: Roland Vossen <[email protected]>

kzalloc/kmalloc already reports an allocation failure themselves.

---
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c     |    4 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c  |   13 ++----
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |   19 ++------
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c    |   26 ++---------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |   50 ++++++----------------
 drivers/staging/brcm80211/brcmsmac/ampdu.c       |    6 +--
 drivers/staging/brcm80211/brcmsmac/antsel.c      |    5 +--
 drivers/staging/brcm80211/brcmsmac/channel.c     |    5 +--
 drivers/staging/brcm80211/brcmsmac/dma.c         |   16 +------
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c |   11 +----
 drivers/staging/brcm80211/brcmsmac/nicpci.c      |    3 +-
 drivers/staging/brcm80211/brcmsmac/phy_shim.c    |    7 +--
 12 files changed, 41 insertions(+), 124 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -3
index 28bdf9e..91b4d3c 100644
@@ -417,10 +417,8 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)
 	struct brcmf_proto *cdc;
 
 	cdc = kzalloc(sizeof(struct brcmf_proto), GFP_ATOMIC);
-	if (!cdc) {
-		brcmf_dbg(ERROR, "kmalloc failed\n");
+	if (!cdc)
 		goto fail;
-	}
 
 	/* ensure that the msg buf directly follows the cdc msg struct */
 	if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
drivers/staging/brcm80211/brcmfmac/dhd_common.c +4 -9
index 0c41c1c..963d1a9 100644
@@ -562,10 +562,9 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
 	struct brcmf_pkt_filter_enable *pkt_filterp;
 
 	arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
-	if (!arg_save) {
-		brcmf_dbg(ERROR, "kmalloc failed\n");
+	if (!arg_save)
 		goto fail;
-	}
+
 	arg_org = arg_save;
 	memcpy(arg_save, arg, strlen(arg) + 1);
 
@@ -635,18 +634,14 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
 	char *arg_save = NULL, *arg_org = NULL;
 
 	arg_save = kstrdup(arg, GFP_ATOMIC);
-	if (!arg_save) {
-		brcmf_dbg(ERROR, "kmalloc failed\n");
+	if (!arg_save)
 		goto fail;
-	}
 
 	arg_org = arg_save;
 
 	buf = kmalloc(PKTFILTER_BUF_SIZE, GFP_ATOMIC);
-	if (!buf) {
-		brcmf_dbg(ERROR, "kmalloc failed\n");
+	if (!buf)
 		goto fail;
-	}
 
 	argv[i] = strsep(&arg_save, " ");
 	while (argv[i++])
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +5 -14
index cc8564a..659a9c2 100644
@@ -159,11 +159,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 
 	buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETH_ALEN);
 	bufp = buf = kmalloc(buflen, GFP_ATOMIC);
-	if (!bufp) {
-		brcmf_dbg(ERROR, "%s: out of memory for mcast_list, cnt %d\n",
-			  brcmf_ifname(&drvr_priv->pub, 0), cnt);
+	if (!bufp)
 		return;
-	}
 
 	strcpy(bufp, "mcast_list");
 	bufp += strlen("mcast_list") + 1;
@@ -202,11 +199,9 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 
 	buflen = sizeof("allmulti") + sizeof(allmulti);
 	buf = kmalloc(buflen, GFP_ATOMIC);
-	if (!buf) {
-		brcmf_dbg(ERROR, "%s: out of memory for allmulti\n",
-			  brcmf_ifname(&drvr_priv->pub, 0));
+	if (!buf)
 		return;
-	}
+
 	allmulti_le = cpu_to_le32(allmulti);
 
 	if (!brcmu_mkiovar
@@ -963,10 +958,8 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, struct net_device *net,
 	ifp = drvr_priv->iflist[ifidx];
 	if (!ifp) {
 		ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
-		if (!ifp) {
-			brcmf_dbg(ERROR, "OOM - struct brcmf_if\n");
+		if (!ifp)
 			return -ENOMEM;
-		}
 	}
 
 	memset(ifp, 0, sizeof(struct brcmf_if));
@@ -1019,10 +1012,8 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
 
 	/* Allocate primary brcmf_info */
 	drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
-	if (!drvr_priv) {
-		brcmf_dbg(ERROR, "OOM - alloc brcmf_info\n");
+	if (!drvr_priv)
 		goto fail;
-	}
 
 	/*
 	 * Save the brcmf_info into the priv
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +5 -21
index 66ab752..9f8bcb3 100644
@@ -2956,10 +2956,8 @@ static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)
 	/* Get full mem size */
 	size = bus->ramsize;
 	buf = kmalloc(size, GFP_ATOMIC);
-	if (!buf) {
-		brcmf_dbg(ERROR, "Out of memory (%d bytes)\n", size);
+	if (!buf)
 		return -1;
-	}
 
 	/* Read mem content */
 	printk(KERN_DEBUG "Dump dongle memory");
@@ -3013,7 +3011,6 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
 		size = msize;
 		mbuffer = data = kmalloc(msize, GFP_ATOMIC);
 		if (mbuffer == NULL) {
-			brcmf_dbg(ERROR, "kmalloc(%d) failed\n", msize);
 			bcmerror = -ENOMEM;
 			goto done;
 		}
@@ -3021,7 +3018,6 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
 
 	str = kmalloc(maxstrlen, GFP_ATOMIC);
 	if (str == NULL) {
-		brcmf_dbg(ERROR, "kmalloc(%d) failed\n", maxstrlen);
 		bcmerror = -ENOMEM;
 		goto done;
 	}
@@ -3737,8 +3733,6 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus)
 
 	memptr = memblock = kmalloc(MEMBLOCK + BRCMF_SDALIGN, GFP_ATOMIC);
 	if (memblock == NULL) {
-		brcmf_dbg(ERROR, "Failed to allocate memory %d bytes\n",
-			  MEMBLOCK);
 		ret = -ENOMEM;
 		goto err;
 	}
@@ -3837,8 +3831,6 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus)
 
 	memblock = kmalloc(MEMBLOCK, GFP_ATOMIC);
 	if (memblock == NULL) {
-		brcmf_dbg(ERROR, "Failed to allocate memory %d bytes\n",
-			  MEMBLOCK);
 		ret = -ENOMEM;
 		goto err;
 	}
@@ -4254,18 +4246,13 @@ static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus)
 		    roundup((bus->drvr->maxctl + SDPCM_HDRLEN),
 			    ALIGNMENT) + BRCMF_SDALIGN;
 		bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC);
-		if (!(bus->rxbuf)) {
-			brcmf_dbg(ERROR, "kmalloc of %d-byte rxbuf failed\n",
-				  bus->rxblen);
+		if (!(bus->rxbuf))
 			goto fail;
-		}
 	}
 
 	/* Allocate buffer to receive glomed packet */
 	bus->databuf = kmalloc(MAX_DATA_BUF, GFP_ATOMIC);
 	if (!(bus->databuf)) {
-		brcmf_dbg(ERROR, "kmalloc of %d-byte databuf failed\n",
-			  MAX_DATA_BUF);
 		/* release rxbuf which was already located as above */
 		if (!bus->rxblen)
 			kfree(bus->rxbuf);
@@ -4457,10 +4444,8 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
 
 	/* alloc chip_info_t */
 	ci = kzalloc(sizeof(struct chip_info), GFP_ATOMIC);
-	if (NULL == ci) {
-		brcmf_dbg(ERROR, "malloc failed!\n");
+	if (NULL == ci)
 		return -ENOMEM;
-	}
 
 	/* bus/core/clk setup for register access */
 	/* Try forcing SDIO core to do ALPAvail request only */
@@ -4785,10 +4770,9 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
 
 	/* Allocate private bus interface state */
 	bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC);
-	if (!bus) {
-		brcmf_dbg(ERROR, "kmalloc of struct dhd_bus failed\n");
+	if (!bus)
 		goto fail;
-	}
+
 	bus->sdiodev = sdiodev;
 	sdiodev->bus = bus;
 	bus->txbound = BRCMF_TXBOUND;
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +13 -37

101 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/ampdu.c +2 -4
index d221a3a..b94d60c 100644
@@ -227,11 +227,9 @@ struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc)
 	int i;
 
 	ampdu = kzalloc(sizeof(struct ampdu_info), GFP_ATOMIC);
-	if (!ampdu) {
-		wiphy_err(wlc->wiphy, "wl%d: brcms_c_ampdu_attach: out of mem"
-			  "\n", wlc->pub->unit);
+	if (!ampdu)
 		return NULL;
-	}
+
 	ampdu->wlc = wlc;
 
 	for (i = 0; i < AMPDU_MAX_SCB_TID; i++)
drivers/staging/brcm80211/brcmsmac/antsel.c +1 -4
index 29b51a1..c61c520 100644
@@ -110,11 +110,8 @@ struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc)
 	struct antsel_info *asi;
 
 	asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC);
-	if (!asi) {
-		wiphy_err(wlc->wiphy, "wl%d: brcms_c_antsel_attach: out of "
-			  "mem\n", wlc->pub->unit);
+	if (!asi)
 		return NULL;
-	}
 
 	asi->wlc = wlc;
 	asi->pub = wlc->pub;
drivers/staging/brcm80211/brcmsmac/channel.c +1 -4
index af01c9d..a9defe2 100644
@@ -1090,11 +1090,8 @@ struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
 	BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
 
 	wlc_cm = kzalloc(sizeof(struct brcms_cm_info), GFP_ATOMIC);
-	if (wlc_cm == NULL) {
-		wiphy_err(wlc->wiphy, "wl%d: %s: out of memory", pub->unit,
-			  __func__);
+	if (wlc_cm == NULL)
 		return NULL;
-	}
 	wlc_cm->pub = pub;
 	wlc_cm->wlc = wlc;
 	wlc->cmi = wlc_cm;
drivers/staging/brcm80211/brcmsmac/dma.c +3 -13
index 06990b3..714c74c 100644
@@ -559,12 +559,8 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
 
 	/* allocate private info structure */
 	di = kzalloc(sizeof(struct dma_info), GFP_ATOMIC);
-	if (di == NULL) {
-#ifdef BCMDBG
-		printk(KERN_ERR "dma_attach: out of memory\n");
-#endif
+	if (di == NULL)
 		return NULL;
-	}
 
 	di->msg_level = msg_level ? msg_level : &dma_msg_level;
 
@@ -651,22 +647,16 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
 	if (ntxd) {
 		size = ntxd * sizeof(void *);
 		di->txp = kzalloc(size, GFP_ATOMIC);
-		if (di->txp == NULL) {
-			DMA_ERROR(("%s: dma_attach: out of tx memory\n",
-				   di->name));
+		if (di->txp == NULL)
 			goto fail;
-		}
 	}
 
 	/* allocate rx packet pointer vector */
 	if (nrxd) {
 		size = nrxd * sizeof(void *);
 		di->rxp = kzalloc(size, GFP_ATOMIC);
-		if (di->rxp == NULL) {
-			DMA_ERROR(("%s: dma_attach: out of rx memory\n",
-				   di->name));
+		if (di->rxp == NULL)
 			goto fail;
-		}
 	}
 
 	/*
drivers/staging/brcm80211/brcmsmac/mac80211_if.c +3 -8
index 65d30b5..32d7abf 100644
@@ -1541,11 +1541,8 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
 	struct brcms_timer *t;
 
 	t = kzalloc(sizeof(struct brcms_timer), GFP_ATOMIC);
-	if (!t) {
-		wiphy_err(wl->wiphy, "wl%d: brcms_init_timer: out of memory\n",
-			  wl->pub->unit);
+	if (!t)
 		return NULL;
-	}
 
 	init_timer(&t->timer);
 	t->timer.data = (unsigned long) t;
@@ -1659,11 +1656,9 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx)
 				pdata = wl->fw.fw_bin[i]->data +
 					le32_to_cpu(hdr->offset);
 				*pbuf = kmalloc(len, GFP_ATOMIC);
-				if (*pbuf == NULL) {
-					wiphy_err(wl->wiphy, "fail to alloc %d"
-						  " bytes\n", len);
+				if (*pbuf == NULL)
 					goto fail;
-				}
+
 				memcpy(*pbuf, pdata, len);
 				return 0;
 			}
drivers/staging/brcm80211/brcmsmac/nicpci.c +1 -2
index a2cab5c..f5a2695 100644
@@ -245,9 +245,8 @@ struct pcicore_info *pcicore_init(struct si_pub *sih, struct pci_dev *pdev,
 
 	/* alloc struct pcicore_info */
 	pi = kzalloc(sizeof(struct pcicore_info), GFP_ATOMIC);
-	if (pi == NULL) {
+	if (pi == NULL)
 		return NULL;
-	}
 
 	pi->sih = sih;
 	pi->dev = pdev;
drivers/staging/brcm80211/brcmsmac/phy_shim.c +2 -5
index 31c9374..e0c19b6 100644
@@ -41,12 +41,9 @@ struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
 	struct phy_shim_info *physhim = NULL;
 
 	physhim = kzalloc(sizeof(struct phy_shim_info), GFP_ATOMIC);
-	if (!physhim) {
-		wiphy_err(wlc_hw->wlc->wiphy,
-			  "wl%d: wlc_phy_shim_attach: out of mem\n",
-			  wlc_hw->unit);
+	if (!physhim)
 		return NULL;
-	}
+
 	physhim->wlc_hw = wlc_hw;
 	physhim->wlc = wlc;
 	physhim->wl = wl;
Signature · 1 line
1.7.1
author
#17 lore raw

PATCH 17/20 staging: brcm80211: clarified fullmac io and event codes

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Added comments to make code more readable.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |    4 ++++
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c     |    5 +++++
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |    2 ++
 3 files changed, 11 insertions(+), 0 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +4 -0
index 7ca9172..7ab45d9 100644
@@ -27,6 +27,9 @@
 #define BRCMF_C_IOCTL_MEDLEN	1536	/* "med" ioctl buffer required */
 #define	BRCMF_C_IOCTL_MAXLEN	8192
 
+/*******************************************************************************
+ * IO codes that are interpreted by dongle firmware
+ ******************************************************************************/
 #define BRCMF_C_UP				2
 #define BRCMF_C_SET_PROMISC			10
 #define BRCMF_C_GET_RATE			12
@@ -171,6 +174,7 @@ struct dngl_stats {
 	unsigned long multicast;	/* multicast packets received */
 };
 
+/* event codes sent by the dongle to this driver */
 #define BRCMF_E_SET_SSID			0
 #define BRCMF_E_JOIN				1
 #define BRCMF_E_START				2
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +5 -0
index 91b4d3c..4c171a3 100644
@@ -14,6 +14,11 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+/*******************************************************************************
+ * Communicates with the dongle by using Broadcom specific ioctl codes.
+ * For certain ioctl codes, the dongle interprets string data from the host.
+ ******************************************************************************/
+
 #include <linux/types.h>
 #include <linux/netdevice.h>
 #include <linux/sched.h>
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +2 -0
index d0ae2b6..45c9e78 100644
@@ -14,6 +14,8 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+/* Toplevel file. Relies on dhd_linux.c to send ioctls to the dongle. */
+
 #include <linux/kernel.h>
 #include <linux/if_arp.h>
 #include <linux/sched.h>
Signature · 1 line
1.7.1
author
#18 lore raw

PATCH 18/20 staging: brcm80211: consistent naming of struct net_device *ndev

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Various names (ndev, net, dev) were used for the same structure. Settled for 'ndev'.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |    6 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |  214 +++++++++++----------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |  219 +++++++++++-----------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h |    2 +-
 4 files changed, 225 insertions(+), 216 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +3 -3
index 7ab45d9..a16f731 100644
@@ -722,9 +722,9 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
 extern struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus,
 				      uint bus_hdrlen);
 extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
-extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
+extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
 
-extern int brcmf_netdev_ioctl_priv(struct net_device *net,
+extern int brcmf_netdev_ioctl_priv(struct net_device *ndev,
 				   struct brcmf_ioctl *ioc);
 
 /* Indication from bus module regarding removal/absence of dongle */
@@ -766,7 +766,7 @@ extern int brcmf_c_host_event(struct brcmf_info *drvr_priv, int *idx,
 extern void brcmf_c_init(void);
 
 extern int brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx,
-			struct net_device *net, char *name, u8 *mac_addr,
+			struct net_device *ndev, char *name, u8 *mac_addr,
 			u32 flags, u8 bssidx);
 extern void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx);
 
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +111 -103

561 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +110 -109

772 lines not on this page · raw message

drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +1 -1
index 14a32e1..afc60d9 100644
@@ -243,7 +243,7 @@ struct brcmf_cfg80211_iscan_eloop {
 
 /* dongle iscan controller */
 struct brcmf_cfg80211_iscan_ctrl {
-	struct net_device *dev;
+	struct net_device *ndev;
 	struct timer_list timer;
 	u32 timer_ms;
 	u32 timer_on;
Signature · 1 line
1.7.1
author
#19 lore raw

PATCH 19/20 staging: brcm80211: simplified internal ioctl function once more

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Code cleanup. Merged two functions.

---
 drivers/staging/brcm80211/brcmfmac/dhd.h         |    3 +-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c   |   40 ++++++++++++---------
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |   16 ---------
 3 files changed, 24 insertions(+), 35 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +1 -2
index a16f731..514f779 100644
@@ -724,8 +724,7 @@ extern struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus,
 extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
 extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
 
-extern int brcmf_netdev_ioctl_priv(struct net_device *ndev,
-				   struct brcmf_ioctl *ioc);
+extern s32 brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len);
 
 /* Indication from bus module regarding removal/absence of dongle */
 extern void brcmf_detach(struct brcmf_pub *drvr);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +23 -17
index 827022e..3ae0d43 100644
@@ -849,30 +849,36 @@ static int brcmf_netdev_ioctl_entry(struct net_device *ndev, struct ifreq *ifr,
 	return -EOPNOTSUPP;
 }
 
-/* called only from within this driver */
-int brcmf_netdev_ioctl_priv(struct net_device *ndev, struct brcmf_ioctl *ioc)
+/* called only from within this driver. Sends an ioctl to the dongle. */
+s32 brcmf_dev_ioctl(struct net_device *ndev, u32 cmd, void *arg, u32 len)
 {
-	int bcmerror = 0;
+	struct brcmf_ioctl ioc;
+	s32 err = 0;
 	int buflen = 0;
 	bool is_set_key_cmd;
 	struct brcmf_info *drvr_priv = *(struct brcmf_info **)
-			  netdev_priv(ndev);
+					netdev_priv(ndev);
 	int ifidx;
 
+	memset(&ioc, 0, sizeof(ioc));
+	ioc.cmd = cmd;
+	ioc.buf = arg;
+	ioc.len = len;
+
 	ifidx = brcmf_net2idx(drvr_priv, ndev);
 
-	if (ioc->buf != NULL)
-		buflen = min_t(uint, ioc->len, BRCMF_IOCTL_MAXLEN);
+	if (ioc.buf != NULL)
+		buflen = min_t(uint, ioc.len, BRCMF_IOCTL_MAXLEN);
 
 	/* send to dongle (must be up, and wl) */
 	if ((drvr_priv->pub.busstate != BRCMF_BUS_DATA)) {
 		brcmf_dbg(ERROR, "DONGLE_DOWN\n");
-		bcmerror = -EIO;
+		err = -EIO;
 		goto done;
 	}
 
 	if (!drvr_priv->pub.iswl) {
-		bcmerror = -EIO;
+		err = -EIO;
 		goto done;
 	}
 
@@ -880,21 +886,21 @@ int brcmf_netdev_ioctl_priv(struct net_device *ndev, struct brcmf_ioctl *ioc)
 	 * Intercept BRCMF_C_SET_KEY IOCTL - serialize M4 send and
 	 * set key IOCTL to prevent M4 encryption.
 	 */
-	is_set_key_cmd = ((ioc->cmd == BRCMF_C_SET_KEY) ||
-			  ((ioc->cmd == BRCMF_C_SET_VAR) &&
-			   !(strncmp("wsec_key", ioc->buf, 9))) ||
-			  ((ioc->cmd == BRCMF_C_SET_VAR) &&
-			   !(strncmp("bsscfg:wsec_key", ioc->buf, 15))));
+	is_set_key_cmd = ((ioc.cmd == BRCMF_C_SET_KEY) ||
+			  ((ioc.cmd == BRCMF_C_SET_VAR) &&
+			   !(strncmp("wsec_key", ioc.buf, 9))) ||
+			  ((ioc.cmd == BRCMF_C_SET_VAR) &&
+			   !(strncmp("bsscfg:wsec_key", ioc.buf, 15))));
 	if (is_set_key_cmd)
 		brcmf_netdev_wait_pend8021x(ndev);
 
-	bcmerror = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, ioc, buflen);
+	err = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, buflen);
 
 done:
-	if (bcmerror > 0)
-		bcmerror = 0;
+	if (err > 0)
+		err = 0;
 
-	return bcmerror;
+	return err;
 }
 
 static int brcmf_netdev_stop(struct net_device *ndev)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +0 -16
index b707bc0..b956c90 100644
@@ -249,22 +249,6 @@ static const u32 __wl_cipher_suites[] = {
 	WLAN_CIPHER_SUITE_AES_CMAC,
 };
 
-static s32
-brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
-{
-	struct brcmf_ioctl ioc;
-	s32 err = 0;
-
-	memset(&ioc, 0, sizeof(ioc));
-	ioc.cmd = cmd;
-	ioc.buf = arg;
-	ioc.len = len;
-
-	err = brcmf_netdev_ioctl_priv(dev, &ioc);
-
-	return err;
-}
-
 /* function for reading/writing a single u32 from/to the dongle */
 static int
 brcmf_dev_ioctl_u32(struct net_device *ndev, u32 cmd, u32 *par)
Signature · 1 line
1.7.1
author
#20 lore raw

PATCH 20/20 staging: brcm80211: reduced checkpatch warnings to zero

In reply to Franky Lin

From: Roland Vossen <[email protected]>

Both community and Broadcom patches introduced checkpatch warnings.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |   27 ++-
 drivers/staging/brcm80211/brcmfmac/dhd_cdc.c      |   10 +-
 drivers/staging/brcm80211/brcmfmac/dhd_common.c   |   23 ++-
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |   15 +-
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |  215 ++++++++++++---------
 drivers/staging/brcm80211/brcmsmac/aiutils.c      |   14 +-
 drivers/staging/brcm80211/brcmsmac/main.c         |    3 +-
 drivers/staging/brcm80211/brcmsmac/nicpci.c       |    3 +-
 drivers/staging/brcm80211/brcmsmac/srom.c         |    3 +-
 9 files changed, 177 insertions(+), 136 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +16 -11
index 1cbdb80..bff5066 100644
@@ -96,7 +96,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 						    (sdiodev->func[2]);
 						if (err_ret)
 							brcmf_dbg(ERROR,
-								  "enable F2 failed:%d\n",
+								  "enable F2 "
+								  "failed:%d\n",
 								  err_ret);
 					} else {
 						/* Disable Function 2 */
@@ -105,7 +106,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 						    (sdiodev->func[2]);
 						if (err_ret)
 							brcmf_dbg(ERROR,
-								  "Disable F2 failed:%d\n",
+								  "Disable F2 "
+								  "failed:%d\n",
 								  err_ret);
 					}
 					sdio_release_host(sdiodev->func[2]);
@@ -124,8 +126,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 					    regaddr, &err_ret);
 				sdio_release_host(sdiodev->func[func]);
 			} else if (regaddr < 0xF0) {
-				brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n",
-					  regaddr);
+				brcmf_dbg(ERROR, "F0 Wr:0x%02x: write "
+					  "disallowed\n", regaddr);
 			} else {
 				/* Claim host controller, perform F0 write,
 				 and release */
@@ -160,7 +162,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 	}
 
 	if (err_ret)
-		brcmf_dbg(ERROR, "Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n",
+		brcmf_dbg(ERROR, "Failed to %s byte F%d:@0x%05x=%02x, "
+			  "Err: %d\n",
 			  rw ? "write" : "read", func, regaddr, *byte, err_ret);
 
 	return err_ret;
@@ -260,11 +263,13 @@ brcmf_sdioh_request_packet(struct brcmf_sdio_dev *sdiodev, uint fix_inc,
 		}
 
 		if (err_ret) {
-			brcmf_dbg(ERROR, "%s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
+			brcmf_dbg(ERROR, "%s FAILED %p[%d], addr=0x%05x, "
+				  "pkt_len=%d, ERR=0x%08x\n",
 				  write ? "TX" : "RX", pnext, SGCount, addr,
 				  pkt_len, err_ret);
 		} else {
-			brcmf_dbg(TRACE, "%s xfr'd %p[%d], addr=0x%05x, len=%d\n",
+			brcmf_dbg(TRACE, "%s xfr'd %p[%d], addr=0x%05x, "
+				  "len=%d\n",
 				  write ? "TX" : "RX", pnext, SGCount, addr,
 				  pkt_len);
 		}
@@ -316,8 +321,8 @@ int brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
 			  write ? "TX" : "RX", buflen_u);
 		mypkt = brcmu_pkt_buf_get_skb(buflen_u);
 		if (!mypkt) {
-			brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
-				  buflen_u);
+			brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len "
+				  "%d\n", buflen_u);
 			return -EIO;
 		}
 
@@ -342,8 +347,8 @@ int brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
 			  write ? "TX" : "RX", pkt->len);
 		mypkt = brcmu_pkt_buf_get_skb(pkt->len);
 		if (!mypkt) {
-			brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
-				  pkt->len);
+			brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: "
+				  "len %d\n", pkt->len);
 			return -EIO;
 		}
 
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +6 -4
index 4c171a3..f9dfd72 100644
@@ -290,7 +290,8 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
 		goto done;
 
 	if (prot->pending == true) {
-		brcmf_dbg(TRACE, "CDC packet is pending!!!! cmd=0x%x (%lu) lastcmd=0x%x (%lu)\n",
+		brcmf_dbg(TRACE, "CDC packet is pending!!!! cmd=0x%x (%lu) "
+			  "lastcmd=0x%x (%lu)\n",
 			  ioc->cmd, (unsigned long)ioc->cmd, prot->lastcmd,
 			  (unsigned long)prot->lastcmd);
 		if ((ioc->cmd == BRCMF_C_SET_VAR) ||
@@ -405,8 +406,8 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, int *ifidx,
 	}
 
 	if (h->flags & BDC_FLAG_SUM_GOOD) {
-		brcmf_dbg(INFO, "%s: BDC packet received with good rx-csum, flags 0x%x\n",
-			  brcmf_ifname(drvr, *ifidx), h->flags);
+		brcmf_dbg(INFO, "%s: BDC packet received with good rx-csum, "
+			  "flags 0x%x\n", brcmf_ifname(drvr, *ifidx), h->flags);
 		pkt_set_sum_good(pktbuf, true);
 	}
 
@@ -427,7 +428,8 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)
 
 	/* ensure that the msg buf directly follows the cdc msg struct */
 	if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
-		brcmf_dbg(ERROR, "struct brcmf_proto is not correctly defined\n");
+		brcmf_dbg(ERROR,
+			  "struct brcmf_proto is not correctly defined\n");
 		goto fail;
 	}
 
drivers/staging/brcm80211/brcmfmac/dhd_common.c +14 -9
index 963d1a9..ee49688 100644
@@ -219,7 +219,8 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
 	}
 
 	brcmf_dbg(EVENT, "EVENT: %s, event ID = %d\n", event_name, event_type);
-	brcmf_dbg(EVENT, "flags 0x%04x, status %d, reason %d, auth_type %d MAC %s\n",
+	brcmf_dbg(EVENT,
+		  "flags 0x%04x, status %d, reason %d, auth_type %d MAC %s\n",
 		  flags, status, reason, auth_type, eabuf);
 
 	if (flags & BRCMF_EVENT_MSG_LINK)
@@ -250,10 +251,12 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
 			brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, TIMEOUT\n",
 				  event_name, eabuf);
 		else if (status == BRCMF_E_STATUS_FAIL)
-			brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, FAILURE, reason %d\n",
+			brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, FAILURE, "
+				  "reason %d\n",
 				  event_name, eabuf, (int)reason);
 		else
-			brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, unexpected status %d\n",
+			brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, unexpected "
+				  "status %d\n",
 				  event_name, eabuf, (int)status);
 		break;
 
@@ -283,7 +286,8 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
 			brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, %s, TIMEOUT\n",
 				  event_name, eabuf, auth_str);
 		else if (status == BRCMF_E_STATUS_FAIL) {
-			brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, %s, FAILURE, reason %d\n",
+			brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, %s, FAILURE, "
+				  "reason %d\n",
 				  event_name, eabuf, auth_str, (int)reason);
 		}
 
@@ -524,7 +528,8 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
 {
 	int i;
 	if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
-		brcmf_dbg(ERROR, "Mask invalid format. Needs to start with 0x\n");
+		brcmf_dbg(ERROR,
+			  "Mask invalid format. Needs to start with 0x\n");
 		return -EINVAL;
 	}
 	src = src + 2;		/* Skip past 0x */
@@ -759,8 +764,8 @@ static void brcmf_c_arp_offload_set(struct brcmf_pub *drvr, int arp_mode)
 				   iovbuf, sizeof(iovbuf));
 	retcode = retcode >= 0 ? 0 : retcode;
 	if (retcode)
-		brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, retcode = %d\n",
-			  arp_mode, retcode);
+		brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, "
+			  "retcode = %d\n", arp_mode, retcode);
 	else
 		brcmf_dbg(TRACE, "successfully set ARP offload mode to 0x%x\n",
 			  arp_mode);
@@ -776,8 +781,8 @@ static void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable)
 				   iovbuf, sizeof(iovbuf));
 	retcode = retcode >= 0 ? 0 : retcode;
 	if (retcode)
-		brcmf_dbg(TRACE, "failed to enable ARP offload to %d, retcode = %d\n",
-			  arp_enable, retcode);
+		brcmf_dbg(TRACE, "failed to enable ARP offload to %d, "
+			  "retcode = %d\n", arp_enable, retcode);
 	else
 		brcmf_dbg(TRACE, "successfully enabled ARP offload to %d\n",
 			  arp_enable);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +8 -7
index 3ae0d43..4c63d22 100644
@@ -207,8 +207,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
 	if (!brcmu_mkiovar
 	    ("allmulti", (void *)&allmulti_le,
 	    sizeof(allmulti_le), buf, buflen)) {
-		brcmf_dbg(ERROR, "%s: mkiovar failed for allmulti, datalen %d buflen %u\n",
-			  brcmf_ifname(&drvr_priv->pub, 0),
+		brcmf_dbg(ERROR, "%s: mkiovar failed for allmulti, datalen %d "
+			  "buflen %u\n", brcmf_ifname(&drvr_priv->pub, 0),
 			  (int)sizeof(allmulti), buflen);
 		kfree(buf);
 		return;
@@ -300,8 +300,8 @@ static void brcmf_op_if(struct brcmf_if *ifp)
 		 * in case we missed the BRCMF_E_IF_DEL event.
 		 */
 		if (ifp->ndev != NULL) {
-			brcmf_dbg(ERROR, "ERROR: netdev:%s already exists, try free & unregister\n",
-				  ifp->ndev->name);
+			brcmf_dbg(ERROR, "ERROR: netdev:%s already exists, try "
+				  "free & unregister\n", ifp->ndev->name);
 			netif_stop_queue(ifp->ndev);
 			unregister_netdev(ifp->ndev);
 			free_netdev(ifp->ndev);
@@ -319,11 +319,12 @@ static void brcmf_op_if(struct brcmf_if *ifp)
 			       sizeof(drvr_priv));
 			err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
 			if (err != 0) {
-				brcmf_dbg(ERROR, "brcmf_net_attach failed, err %d\n",
-					  err);
+				brcmf_dbg(ERROR, "brcmf_net_attach failed, "
+					  "err %d\n", err);
 				ret = -EOPNOTSUPP;
 			} else {
-				brcmf_dbg(TRACE, " ==== pid:%x, net_device for if:%s created ===\n",
+				brcmf_dbg(TRACE, " ==== pid:%x, net_device for "
+					  "if:%s created ===\n",
 					  current->pid, ifp->ndev->name);
 				ifp->state = 0;
 			}
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +124 -91

538 lines not on this page · raw message

drivers/staging/brcm80211/brcmsmac/aiutils.c +6 -8
index b7b0bdf..f0c5639 100644
@@ -1054,9 +1054,8 @@ static struct si_info *ai_doattach(struct si_info *sii,
 	cc = (struct chipcregs *) regs;
 
 	/* bus/core/clk setup for register access */
-	if (!ai_buscore_prep(sii)) {
+	if (!ai_buscore_prep(sii))
 		return NULL;
-	}
 
 	/*
 	 * ChipID recognition.
@@ -1084,19 +1083,18 @@ static struct si_info *ai_doattach(struct si_info *sii,
 		return NULL;
 	}
 	/* no cores found, bail out */
-	if (sii->numcores == 0) {
+	if (sii->numcores == 0)
 		return NULL;
-	}
+
 	/* bus/core/clk setup */
 	origidx = SI_CC_IDX;
-	if (!ai_buscore_setup(sii, savewin, &origidx)) {
+	if (!ai_buscore_setup(sii, savewin, &origidx))
 		goto exit;
-	}
 
 	/* Init nvram from sprom/otp if they exist */
-	if (srom_var_init(&sii->pub, cc, vars, varsz)) {
+	if (srom_var_init(&sii->pub, cc, vars, varsz))
 		goto exit;
-	}
+
 	pvars = vars ? *vars : NULL;
 	ai_nvram_process(sii, pvars);
 
drivers/staging/brcm80211/brcmsmac/main.c +1 -2
index 2c9ac6d..959e90c 100644
@@ -5951,9 +5951,8 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
 	 * If we are switching to gmode == GMODE_LEGACY_B,
 	 * clean up rate info that may refer to OFDM rates.
 	 */
-	if ((gmode == GMODE_LEGACY_B) && (band->gmode != GMODE_LEGACY_B)) {
+	if (gmode == GMODE_LEGACY_B && band->gmode != GMODE_LEGACY_B)
 		band->gmode = gmode;
-	}
 
 	band->gmode = gmode;
 
drivers/staging/brcm80211/brcmsmac/nicpci.c +1 -2
index f5a2695..df39afe 100644
@@ -394,9 +394,8 @@ static bool pcie_mdiosetblock(struct pcicore_info *pi, uint blk)
 		i++;
 	}
 
-	if (i >= pcie_serdes_spinwait) {
+	if (i >= pcie_serdes_spinwait)
 		return false;
-	}
 
 	return true;
 }
drivers/staging/brcm80211/brcmsmac/srom.c +1 -2
index 5bf0732..ece81ad 100644
@@ -1169,8 +1169,7 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
 			if (sromrev == 0x10)
 				sromrev = 1;
 		}
-	}
-	else {
+	} else {
 		/* Use OTP if SPROM not available */
 		err = otp_read_pci(sih, srom, SROM_MAX);
 		if (err == 0)
Signature · 1 line
1.7.1
author
#10 lore raw

PATCH 10/20 staging: brcm80211: remove fullmac module_param for watchdog

In reply to Franky Lin

Use constant to replace global variable used for watchdog polling

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh.c   |    2 +-
 drivers/staging/brcm80211/brcmfmac/dhd_bus.h  |    6 ++--
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   45 +++++++++---------------
 3 files changed, 21 insertions(+), 32 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +1 -1
index d9d1592..5906337 100644
@@ -375,7 +375,7 @@ void brcmf_sdio_unregister(void)
 void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, bool enable)
 {
 	if (enable)
-		brcmf_sdbrcm_wd_timer(sdiodev->bus, brcmf_watchdog_ms);
+		brcmf_sdbrcm_wd_timer(sdiodev->bus, BRCMF_WD_POLL_MS);
 	else
 		brcmf_sdbrcm_wd_timer(sdiodev->bus, 0);
 }
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +3 -3
index d02cb10..104c0e7 100644
@@ -20,6 +20,9 @@
 /* Packet alignment for most efficient SDIO (can change based on platform) */
 #define BRCMF_SDALIGN	(1 << 6)
 
+/* watchdog polling interval in ms */
+#define BRCMF_WD_POLL_MS	10
+
 /*
  * Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
  */
@@ -28,9 +31,6 @@
 extern uint brcmf_txbound;
 extern uint brcmf_rxbound;
 
-/* Watchdog timer interval */
-extern uint brcmf_watchdog_ms;
-
 /* Indicate (dis)interest in finding dongles. */
 extern int brcmf_bus_register(void);
 extern void brcmf_bus_unregister(void);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +17 -28

129 lines not on this page · raw message

Signature · 1 line
1.7.1
#21 lore raw

Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

In reply to Franky Lin

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func, · line 100

Quoted 13 lines · Franky Lin

Both community and Broadcom patches introduced checkpatch warnings.
---

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +2 -1
index 1cbdb80..bff5066 100644
@@ -96,7 +96,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 						    (sdiodev->func[2]);
 						if (err_ret)
 							brcmf_dbg(ERROR,
-								  "enable F2 failed:%d\n",
+								  "enable F2 "
+								  "failed:%d\n",

Just about all of this patch is not good.

Splitting format strings is poor style, makes error messages difficult to find via grep and is error prone.

You should update your checkpatch version. Current checkpatch doesn't warn about this.

It'd be better if you could find some way to reduce the 6 tab indentation rather than split 20 char format strings into pieces.

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func, · line 107

Quoted 4 lines
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +2 -1
@@ -105,7 +106,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
-								  "Disable F2 failed:%d\n",
+								  "Disable F2 "
+								  "failed:%d\n",

etc.

#22 lore raw

Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

Quoted 3 lines · Joe Perches

It'd be better if you could find some way
to reduce the 6 tab indentation rather than
split 20 char format strings into pieces.

Perhaps something like this:

 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |  112 ++++++++++-----------
 1 files changed, 54 insertions(+), 58 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +54 -58
index a15765b..ccba1ce 100644
@@ -240,6 +240,53 @@ brcmf_sdioh_cis_read(struct brcmf_sdio_dev *sdiodev, uint func,
 	return 0;
 }
 
+static void
+brcmf_sdioh_request_byte_func0(struct brcmf_sdio_dev *sdiodev, uint rw,
+			       uint func, uint regaddr, u8 *byte, int *err_ret)
+{
+	/* Can only directly write to some F0 registers.
+	 * Handle F2 enable as a special case.
+	 */
+	if (regaddr == SDIO_CCCR_IOEx) {
+		if (sdiodev->func[2]) {
+			sdio_claim_host(sdiodev->func[2]);
+			if (*byte & SDIO_FUNC_ENABLE_2) {
+				/* Enable Function 2 */
+				*err_ret = sdio_enable_func(sdiodev->func[2]);
+				if (*err_ret)
+					brcmf_dbg(ERROR,
+						  "enable F2 failed:%d\n",
+						  *err_ret);
+			} else {
+				/* Disable Function 2 */
+				*err_ret = sdio_disable_func(sdiodev->func[2]);
+				if (*err_ret)
+					brcmf_dbg(ERROR,
+						  "Disable F2 failed:%d\n",
+						  *err_ret);
+			}
+			sdio_release_host(sdiodev->func[2]);
+		}
+	} else if (regaddr == SDIO_CCCR_ABORT) {
+		/* to allow abort command through F1 */
+		sdio_claim_host(sdiodev->func[func]);
+		/*
+		 * this sdio_f0_writeb() can be replaced with another api
+		 * depending upon MMC driver change.
+		 * As of this time, this is temporary one
+		 */
+		sdio_writeb(sdiodev->func[func], *byte, regaddr, err_ret);
+		sdio_release_host(sdiodev->func[func]);
+	} else if (regaddr < 0xF0) {
+		brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr);
+	} else {
+		/* Claim host controller, perform F0 write, and release */
+		sdio_claim_host(sdiodev->func[func]);
+		sdio_f0_writeb(sdiodev->func[func], *byte, regaddr, err_ret);
+		sdio_release_host(sdiodev->func[func]);
+	}
+}
+
 extern int
 brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 			 uint regaddr, u8 *byte)
@@ -252,58 +299,9 @@ brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 	BRCMF_PM_RESUME_RETURN_ERROR(-EIO, sdiodev);
 	if (rw) {		/* CMD52 Write */
 		if (func == 0) {
-			/* Can only directly write to some F0 registers.
-			 * Handle F2 enable
-			 * as a special case.
-			 */
-			if (regaddr == SDIO_CCCR_IOEx) {
-				if (sdiodev->func[2]) {
-					sdio_claim_host(sdiodev->func[2]);
-					if (*byte & SDIO_FUNC_ENABLE_2) {
-						/* Enable Function 2 */
-						err_ret =
-						    sdio_enable_func
-						    (sdiodev->func[2]);
-						if (err_ret)
-							brcmf_dbg(ERROR,
-								  "enable F2 failed:%d\n",
-								  err_ret);
-					} else {
-						/* Disable Function 2 */
-						err_ret =
-						    sdio_disable_func
-						    (sdiodev->func[2]);
-						if (err_ret)
-							brcmf_dbg(ERROR,
-								  "Disable F2 failed:%d\n",
-								  err_ret);
-					}
-					sdio_release_host(sdiodev->func[2]);
-				}
-			}
-			/* to allow abort command through F1 */
-			else if (regaddr == SDIO_CCCR_ABORT) {
-				sdio_claim_host(sdiodev->func[func]);
-				/*
-				 * this sdio_f0_writeb() can be replaced
-				 * with another api
-				 * depending upon MMC driver change.
-				 * As of this time, this is temporaray one
-				 */
-				sdio_writeb(sdiodev->func[func], *byte,
-					    regaddr, &err_ret);
-				sdio_release_host(sdiodev->func[func]);
-			} else if (regaddr < 0xF0) {
-				brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n",
-					  regaddr);
-			} else {
-				/* Claim host controller, perform F0 write,
-				 and release */
-				sdio_claim_host(sdiodev->func[func]);
-				sdio_f0_writeb(sdiodev->func[func], *byte,
-					       regaddr, &err_ret);
-				sdio_release_host(sdiodev->func[func]);
-			}
+			brcmf_sdioh_request_byte_func0(sdiodev, rw, func,
+						       regaddr, byte,
+						       &err_ret);
 		} else {
 			/* Claim host controller, perform Fn write,
 			 and release */
@@ -317,13 +315,11 @@ brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
 		sdio_claim_host(sdiodev->func[func]);
 
 		if (func == 0) {
-			*byte =
-			    sdio_f0_readb(sdiodev->func[func], regaddr,
-					  &err_ret);
+			*byte = sdio_f0_readb(sdiodev->func[func], regaddr,
+					      &err_ret);
 		} else {
-			*byte =
-			    sdio_readb(sdiodev->func[func], regaddr,
-				       &err_ret);
+			*byte = sdio_readb(sdiodev->func[func], regaddr,
+					   &err_ret);
 		}
 
 		sdio_release_host(sdiodev->func[func]);
author
#24 lore raw

Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

In reply to Joe Perches
Quoted 6 lines · Joe Perches

Splitting format strings is poor style, makes error messages difficult to find via grep and is error prone.

You should update your checkpatch version. Current checkpatch doesn't warn about this.

Thank you for pointing this out.

Quoted 3 lines

It'd be better if you could find some way to reduce the 6 tab indentation rather than split 20 char format strings into pieces.

Greg, could you please drop this one? We will take care of the indentation issue in future patches.

Thanks,
Franky

author
#23 lore raw

Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

In reply to Joe Perches
Quoted 9 lines · Joe Perches
Quoted 3 lines · Joe Perches

It'd be better if you could find some way
to reduce the 6 tab indentation rather than
split 20 char format strings into pieces.

Perhaps something like this:

  drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |  112 ++++++++++-----------
  1 files changed, 54 insertions(+), 58 deletions(-)

Indeed we have too many levels of indentations in some functions of fullmac. Will clean that up.

Thanks,
Franky

#25 lore raw
In reply to Franky Lin
Quoted 1 line · Franky Lin

Code clean up for fullmac.

Ok, this is the 7th patch series since the last round of "how do we get our driver into mainline" happened.

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

So, can you please start answering these questions? I'm loath to keep accepting patches until that all gets straightened out as it potentially wastes my, and your, time by doing so.

In other words, I'm not going to apply any more patches until this gets resolved. Consider this patchset dropped from my to-apply queue for now because of that.

thanks,

greg k-h

#26 lore raw
Quoted 5 lines · Greg KH

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

As a consequence, I don't think there's any sense in saying b43 should be the driver that Broadcom must support upstream. Even we, back then, split b43 into b43 and b43legacy when it wasn't really possible any more to test and maintain a single driver for different devices. Rafal has shown that it is possible today (to some extent) to do that for the newer chips and the older 11g only chips that b43 still supports, but I'm not convinced that with new features like P2P this will be true in the future.

And this is just discussing the technical side -- the support side is an entirely different question.

Now, don't get me wrong -- I don't think the duplication is a good thing. A lot of the PHY code could be shared. However, I think it will probably not be possible for much longer to share the higher level MAC code that programs the SHM etc.

So I don't claim to know what the solution is, but I think simply rejecting the Broadcom effort like most people seem to imply is a good solution at all. It will leave all of us in a bad spot by creating a driver that has to support too many different devices.

johannes

#39 lore raw
In reply to Greg KH
Quoted 12 lines · Greg KH
Quoted 1 line · Franky Lin

Code clean up for fullmac.

Ok, this is the 7th patch series since the last round of "how do we get our driver into mainline" happened.

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Quoted 7 lines

So, can you please start answering these questions? I'm loath to keep accepting patches until that all gets straightened out as it potentially wastes my, and your, time by doing so.

In other words, I'm not going to apply any more patches until this gets resolved. Consider this patchset dropped from my to-apply queue for now because of that.

I think most of the outstanding series from Broadcom are (almost?) exclusively for their fullmac driver, which has not overlap with b43. We should be moving forward toward getting the fullmac driver into wireless-next.

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#27 lore raw
In reply to Johannes Berg
Quoted 4 lines · Johannes Berg

Now, don't get me wrong -- I don't think the duplication is a good thing. A lot of the PHY code could be shared. However, I think it will probably not be possible for much longer to share the higher level MAC code that programs the SHM etc.

It would be nice to see some of this. I don't think anything is stopping either Broadcom _or_ the b43 team from posting such patches.

Quoted 4 lines

So I don't claim to know what the solution is, but I think simply rejecting the Broadcom effort like most people seem to imply is a good solution at all. It will leave all of us in a bad spot by creating a driver that has to support too many different devices.

I'm inclined to agree. Despite recent heroic efforts, b43 remains behind in it's support for current features of Broadcom hardware. As developers find other gainful interests, that gap is sure to widen -- it certainly was quite wide just a few months ago.

As Johannes implies, it seems likely that newer Broadcom hardware will need to be supported by a different/new driver anyway. Is there some reason why that new driver needs to have a b43 pedigree? If we want/expect Broadcom to support that new driver, is it so unreasonable to allow them to start from the codebase they prefer? I don't think it is.

Broadcom has come a long way in the wireless arena. I think we would be better served by bringing them into the fold than by continuing to demand what they don't feel able to provide.

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#29 lore raw
In reply to Johannes Berg

2011/9/20 Johannes Berg <[email protected]>:

Quoted 8 lines · Greg KH
Quoted 6 lines

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Quoted 8 lines

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

It's hard to talk about API compatibility breakage, until it really happens. So far we support all firmwares, I don't have much more to say about that. We can decide about some driver splitting, when API breakage really happens. Now I think that are just thoeritical talks.

Quoted 8 lines

As a consequence, I don't think there's any sense in saying b43 should be the driver that Broadcom must support upstream. Even we, back then, split b43 into b43 and b43legacy when it wasn't really possible any more to test and maintain a single driver for different devices. Rafal has shown that it is possible today (to some extent) to do that for the newer chips and the older 11g only chips that b43 still supports, but I'm not convinced that with new features like P2P this will be true in the future.

That's what we try to discuss with Broadcom. If they really see a requirement to split driver into 2, they have to explain that and discuss it with us.

I'm flexible, I've accepted Michaels' view on SSB & BCMA. We just need to make Broadcom talk with us.

Quoted 8 lines

And this is just discussing the technical side -- the support side is an entirely different question.

Now, don't get me wrong -- I don't think the duplication is a good thing. A lot of the PHY code could be shared. However, I think it will probably not be possible for much longer to share the higher level MAC code that programs the SHM etc.

Quoted 4 lines

So I don't claim to know what the solution is, but I think simply rejecting the Broadcom effort like most people seem to imply is a good solution at all. It will leave all of us in a bad spot by creating a driver that has to support too many different devices.

Having Broadcom ignoring all out questions and just sending more&more patches is not good as well. How differently we can make them talk? I've requested for discussion several times.

Signature · 1 line
Rafał
#28 lore raw
In reply to John W. Linville

2011/9/20 John W. Linville <[email protected]>:

Quoted 15 lines · Johannes Berg
Quoted 5 lines

Now, don't get me wrong -- I don't think the duplication is a good thing. A lot of the PHY code could be shared. However, I think it will probably not be possible for much longer to share the higher level MAC code that programs the SHM etc.

It would be nice to see some of this.  I don't think anything is stopping either Broadcom _or_ the b43 team from posting such patches.

Quoted 4 lines

So I don't claim to know what the solution is, but I think simply rejecting the Broadcom effort like most people seem to imply is a good solution at all. It will leave all of us in a bad spot by creating a driver that has to support too many different devices.

Quoted 4 lines

I'm inclined to agree.  Despite recent heroic efforts, b43 remains behind in it's support for current features of Broadcom hardware. As developers find other gainful interests, that gap is sure to widen -- it certainly was quite wide just a few months ago.

And brcmsmac stays behind b43 if you count feature different than performance. Monitor, RFKILL, Ad-hoc, AP, hw crypt, supported PHYs, etc.

And what if Broadcom decides to abound their brcm80211 project?

I vote for working together, I can not see a better solution.

Quoted 6 lines

As Johannes implies, it seems likely that newer Broadcom hardware will need to be supported by a different/new driver anyway.  Is there some reason why that new driver needs to have a b43 pedigree? If we want/expect Broadcom to support that new driver, is it so unreasonable to allow them to start from the codebase they prefer? I don't think it is.

We still don't have any clue, when is that going to happen.

Quoted 3 lines

Broadcom has come a long way in the wireless arena.  I think we would be better served by bringing them into the fold than by continuing to demand what they don't feel able to provide.

That's why I asked so many times already to discuss future with them.

Signature · 1 line
Rafał
#30 lore raw
In reply to Johannes Berg

2011/9/20 Johannes Berg <[email protected]>:

Quoted 3 lines

I'm actually surprised that b43
works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY).

Have you reported that to b43/me? What issue is that? Please report in separated thread with some description&logs.

Signature · 1 line
Rafał
#40 lore raw
In reply to John W. Linville
Quoted 17 lines · John W. Linville
Quoted 16 lines · Greg KH
Quoted 1 line · Franky Lin

Code clean up for fullmac.

Ok, this is the 7th patch series since the last round of "how do we get our driver into mainline" happened.

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

So, can you please start answering these questions? I'm loath to keep accepting patches until that all gets straightened out as it potentially wastes my, and your, time by doing so.

Quoted 8 lines
Quoted 3 lines

In other words, I'm not going to apply any more patches until this gets resolved. Consider this patchset dropped from my to-apply queue for now because of that.

I think most of the outstanding series from Broadcom are (almost?) exclusively for their fullmac driver, which has not overlap with b43. We should be moving forward toward getting the fullmac driver into wireless-next.

Ok, that's great, but again, no one from Broadcom has said what their plans are, only sent lots of patches, which while wonderful, has caused some confusion on my and other parts.

greg k-h

#31 lore raw
In reply to Johannes Berg

2011/9/20 Johannes Berg <[email protected]>:

Quoted 8 lines · Greg KH
Quoted 6 lines

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Quoted 8 lines

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

Actually, when we got some single response from Broadcom about their relation to b43, they haven't mentioned support for old HW is any problem at all. They just pointed we don't support calibration for N-PHY and we don't support 802.11n feature for a better performance.

I feel we're creating some problems ourself. Just some guessing that support for older HW can be real problem for future development... not confirmed by anyone at all.

Signature · 1 line
Rafał
#32 lore raw

2011/9/20 Rafał Miłecki <[email protected]>:

Quoted 18 lines

2011/9/20 Johannes Berg <[email protected]>:

Quoted 8 lines · Greg KH
Quoted 6 lines

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Quoted 8 lines

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

Quoted 3 lines

Actually, when we got some single response from Broadcom about their relation to b43, they haven't mentioned support for old HW is any problem at all.

If you look at it from the perspective of a hardware manufacturer, supporting EOLed chips is generally not a good return on investment. There is no new revenue associated with them so any work that goes into them stands to return very little.

Alex

#33 lore raw

W dniu 20 września 2011 23:12 użytkownik Alex Deucher

Quoted 19 lines · <[email protected]> napisał:

2011/9/20 Rafał Miłecki <[email protected]>:

Quoted 18 lines

2011/9/20 Johannes Berg <[email protected]>:

Quoted 16 lines · Greg KH
Quoted 6 lines

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

Quoted 8 lines
Quoted 3 lines

Actually, when we got some single response from Broadcom about their relation to b43, they haven't mentioned support for old HW is any problem at all.

If you look at it from the perspective of a hardware manufacturer, supporting EOLed chips is generally not a good return on investment. There is no new revenue associated with them so any work that goes into them stands to return very little.

That's another thing to discuss with Broadcom.

In open source kernel world, we hopefully won't let anyone drop support for older hardware, just because it's not produced anymore. Probably something like forking driver or modularizing it makes more sense to us.

On the other hand we don't want Broadcom to support b43 and all the PHYs it covers. We've already mentioned they could decide to support b43 but limit their official support to selected cards only. They (again) didn't response how they see such an idea.

What we really need is some communication with Broadcom and I guess that's what Greg mostly wanted to achieve.

Signature · 1 line
Rafał
#35 lore raw
In reply to Rafał Miłecki
Quoted 18 lines · Rafał Miłecki

2011/9/20 Johannes Berg <[email protected]>:

Quoted 8 lines · Greg KH
Quoted 6 lines

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Quoted 8 lines

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

Quoted 8 lines

Actually, when we got some single response from Broadcom about their relation to b43, they haven't mentioned support for old HW is any problem at all. They just pointed we don't support calibration for N-PHY and we don't support 802.11n feature for a better performance.

I feel we're creating some problems ourself. Just some guessing that support for older HW can be real problem for future development... not confirmed by anyone at all.

Their new firmware doesn't run on the older hardware, no?

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#36 lore raw

W dniu 21 września 2011 15:40 użytkownik John W. Linville

Quoted 24 lines · <[email protected]> napisał:
Quoted 23 lines · Rafał Miłecki

2011/9/20 Johannes Berg <[email protected]>:

Quoted 8 lines · Greg KH
Quoted 6 lines

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Quoted 8 lines

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

Actually, when we got some single response from Broadcom about their relation to b43, they haven't mentioned support for old HW is any problem at all. They just pointed we don't support calibration for N-PHY and we don't support 802.11n feature for a better performance.

Quoted 5 lines
Quoted 3 lines

I feel we're creating some problems ourself. Just some guessing that support for older HW can be real problem for future development... not confirmed by anyone at all.

Their new firmware doesn't run on the older hardware, no?

AFAIK it does (unless you mean hardware covered by b43legacy).

If you take a look at 666.2 firmware, it's still available for core 5 (and 9, 13, etc.)

Signature · 1 line
Rafał
#37 lore raw

W dniu 21 września 2011 15:52 użytkownik Rafał Miłecki

Quoted 30 lines · <[email protected]> napisał:

W dniu 21 września 2011 15:40 użytkownik John W. Linville

Quoted 28 lines · <[email protected]> napisał:
Quoted 26 lines · Rafał Miłecki

2011/9/20 Johannes Berg <[email protected]>:

Quoted 8 lines · Greg KH
Quoted 6 lines

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Quoted 8 lines

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

Actually, when we got some single response from Broadcom about their relation to b43, they haven't mentioned support for old HW is any problem at all. They just pointed we don't support calibration for N-PHY and we don't support 802.11n feature for a better performance.

I feel we're creating some problems ourself. Just some guessing that support for older HW can be real problem for future development... not confirmed by anyone at all.

Quoted 6 lines
Quoted 1 line

Their new firmware doesn't run on the older hardware, no?

AFAIK it does (unless you mean hardware covered by b43legacy).

If you take a look at 666.2 firmware, it's still available for core 5 (and 9, 13, etc.)

The reason I've added support for new firmware without dropping support for older, was users experience. I didn't want to leave anyone with b43 not working after kernel update (without firmware update).

Signature · 1 line
Rafał
#38 lore raw
Quoted 7 lines · Rafał Miłecki

W dniu 21 września 2011 15:52 użytkownik Rafał Miłecki

Quoted 5 lines · <[email protected]> napisał:

W dniu 21 września 2011 15:40 użytkownik John W. Linville

Quoted 2 lines · <[email protected]> napisał:

Their new firmware doesn't run on the older hardware, no?

Quoted 8 lines
Quoted 4 lines

AFAIK it does (unless you mean hardware covered by b43legacy).

If you take a look at 666.2 firmware, it's still available for core 5 (and 9, 13, etc.)

The reason I've added support for new firmware without dropping support for older, was users experience. I didn't want to leave anyone with b43 not working after kernel update (without firmware update).

That is the correct thing to do. As I see it, this firmware change is a lot less intrusive than the changes that led to the b43/b43legacy split, where keeping the old version working took a lot of bookkeeping.

Perhaps in 2 or 3 years, we might want to deprecate the older firmware and force users to go to the newest style, but there is no rush.

Larry

#41 lore raw
In reply to Greg KH
Quoted 33 lines · John W. Linville
Quoted 5 lines · Greg KH
Quoted 4 lines · Franky Lin
Quoted 1 line

Code clean up for fullmac.

Ok, this is the 7th patch series since the last round of "how do we

get

Quoted 3 lines
Quoted 3 lines

our driver into mainline" happened.

And while code is great and nice, I still haven't seen any real

answers

Quoted 6 lines
Quoted 6 lines

to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

So, can you please start answering these questions? I'm loath to

keep

Quoted 1 line
Quoted 1 line

accepting patches until that all gets straightened out as it

potentially

Quoted 3 lines
Quoted 3 lines

wastes my, and your, time by doing so.

In other words, I'm not going to apply any more patches until this

gets

Quoted 1 line
Quoted 1 line

resolved. Consider this patchset dropped from my to-apply queue for

now

Quoted 6 lines
Quoted 1 line

because of that.

I think most of the outstanding series from Broadcom are (almost?) exclusively for their fullmac driver, which has not overlap with b43. We should be moving forward toward getting the fullmac driver into wireless-next.

Quoted 5 lines

Ok, that's great, but again, no one from Broadcom has said what their plans are, only sent lots of patches, which while wonderful, has caused some confusion on my and other parts.

greg k-h

Our original plan was to remain a separate driver from b43. We were aware of it and all the good work that had been done to create it and we had no intention of interfering with it. At that point there had not been very much recent movement in b43 and it did not support any of our AXI based chips. We figured that ssb vs AXI was a good dividing line and there would be no conflict, and there wasn't initially.

Internally, prior to releasing to staging tree, development had gone quickly and it didn't take long at all to get the driver up and running. We did not anticipate that things would go somewhat slower in the staging tree and a year (and hundreds of patches) later we are still there. During that year b43 got some limited support for the same new chips brcmsmac already had, into its driver. So now, here we are... both drivers supporting the new chips and b43 also supporting the old.

We have seen the requests for us to add AXI based chipset support into b43. I don't think that will happen in a substantial way:
- Our driver is already stable and performance is better than b43 in terms of AXI chips. B43 seems quite raw: its full of TODO and FIXME notes and performance is 1/10th of brcmsmac on our testing. Spending another round of time and effort on b43 to get it to the place where smac already is, seems redundant and unattractive.

- Much of brcmsmac code comes from our internal source which has whole organizations charged with testing it for compliance, compatibility, performance, etc. We understand that that is of no direct consequence but since brcmsmac code is a direct descendent of that code, much of that background still applies. Switching to b43 would mean throwing all that infrastructure and testing away and going with a driver that has none of that (that I know of).

- Most of the recent b43 additions support comes from a single person doing reverse engineering. brcmsmac has a few software people working on it directly and hundreds of people working on it indirectly (through the internal version) including engineers working on firmware, RTL, testing, etc.

- B43 team has made the case several times that it has more features than brcmsmac. A reminder: We were specifically asked NOT to add features while in staging tree and we have held back on features to honor that request. AP, IBSS, 40 Mhz, using bcma, hw crypto and others, are all features we have been waiting to do. We also have a backlog of several new chips we want to add. And of course, we will would be adding future chips and features as they come out.

We invested a year trying to be good Linux citizens, laying out our initial plans, following the rules, working transparently, folding in feedback, submitting hundreds of patches in plain sight of everyone and now folks are asking about our plan. Our plan is get the brcmsmac and brcmfmac into mainline and keep following that up with new features, new chips and continuing support.

Other than barely supporting one of our chips first in mainline, I would really like to understand what are the benefits and justifications of using b43 over brcmsmac for AXI based chips in the long run. Can someone explain them?

Brett

#42 lore raw

2011/9/21 Brett Rudley <[email protected]>:

Quoted 33 lines
Quoted 33 lines · John W. Linville
Quoted 5 lines · Greg KH
Quoted 4 lines · Franky Lin
Quoted 1 line

Code clean up for fullmac.

Ok, this is the 7th patch series since the last round of "how do we

get

Quoted 3 lines
Quoted 3 lines

our driver into mainline" happened.

And while code is great and nice, I still haven't seen any real

answers

Quoted 6 lines
Quoted 6 lines

to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

So, can you please start answering these questions?  I'm loath to

keep

Quoted 1 line
Quoted 1 line

accepting patches until that all gets straightened out as it

potentially

Quoted 3 lines
Quoted 3 lines

wastes my, and your, time by doing so.

In other words, I'm not going to apply any more patches until this

gets

Quoted 1 line
Quoted 1 line

resolved.  Consider this patchset dropped from my to-apply queue for

now

Quoted 6 lines
Quoted 1 line

because of that.

I think most of the outstanding series from Broadcom are (almost?) exclusively for their fullmac driver, which has not overlap with b43.  We should be moving forward toward getting the fullmac driver into wireless-next.

Quoted 7 lines
Quoted 5 lines

Ok, that's great, but again, no one from Broadcom has said what their plans are, only sent lots of patches, which while wonderful, has caused some confusion on my and other parts.

greg k-h

Our original plan was to remain a separate driver from b43. We were aware of it and all the good work that had been done to create it and we had no intention of interfering with it.  At that point there had not been very much recent movement in b43 and it did not support any of our AXI based chips.  We figured that ssb vs AXI was a good dividing line and there would be no conflict, and there wasn't initially.

The first obvious problem is that there are SSB and BCMA (aka AXI) cards using N-PHY. That resulted in PHY code duplication between b43 and brcmsmac. And since we already supported N-PHY in b43, adding bcma support automatically gave us BCM43224 and BCM43225 support. That of course means duplicated supported for the same hardware.

Quoted 4 lines

Internally, prior to releasing to staging tree, development had gone quickly and it didn't take long at all to get the driver up and running.  We did not anticipate that things would go somewhat slower in the staging tree and a year (and hundreds of patches) later we are still there.  During that year b43 got some limited support for the same new chips brcmsmac already had, into its driver.  So now, here we are... both drivers supporting the new chips and b43 also supporting the old.

We have seen the requests for us to add AXI based chipset support into b43.  I don't think that will happen in a substantial way:
- Our driver is already stable and performance is better than b43 in terms of AXI chips.  B43 seems quite raw: its full of TODO and FIXME notes and performance is 1/10th of brcmsmac on our testing. Spending another round of time and effort on b43 to get it to the place where smac already is, seems redundant and unattractive.

Well, I guess you were comparing brcmsmac working in 802.11n mode vs. b43 workin in 802.11g mode? When I was comparing both drivers in 802.11g mode, they were similar in performance. Please see my tests at
http://zajec.net/ . If that's true, we can also say b43 is ∞ faster than brcmsmac... if you compare AP or monitor mode.

Quoted 1 line

- Much of brcmsmac code comes from our internal source which has whole organizations charged with testing it for compliance, compatibility, performance, etc. We understand that that is of no direct consequence but since brcmsmac code is a direct descendent of that code, much of that background still applies. Switching to b43 would mean throwing all that infrastructure and testing away and going with a driver that has none of that (that I know of).

Yes, I'm aware you may be not so comfortable with differences between internal driver and b43.
However you're already at the place, when you can not just copy&paste code from your internal driver to brcmsmac. You have to adopt in anyway. Are there really so many differences if you look at b43? DMA is something you probably don't need to touch. PHY code should be portable to b43 in the same way it is to brcmsmac. The biggest problem is to touch some general things, not PHY-directly-related. And even in that code we share a lot of code. Our code is based on RE of your driver. It has to be similar.

Quoted 1 line

- Most of the recent b43 additions support comes from a single person doing reverse engineering. brcmsmac has a few software people working on it directly and hundreds of people working on it indirectly (through the internal version) including engineers working on firmware, RTL, testing, etc.

You're doing much harder job and obviously you need much more people. I just implement the driver, without testing hardware for various possible configurations, etc. That's the only explanation how we've achieved such a good state. We copied init/config values from your driver, didn't invent them ourself.

Quoted 1 line

- B43 team has made the case several times that it has more features than brcmsmac.  A reminder: We were specifically asked NOT to add features while in staging tree and we have held back on features to honor that request.  AP, IBSS, 40 Mhz, using bcma, hw crypto and others, are all features we have been waiting to do.   We also have a backlog of several new chips we want to add.  And of course, we will would be adding future chips and features as they come out.

Well, you spent a lot of time on cleaning brcmsmac, I spent a lot of time on adding support for new hardware. I believe now we both are at similar stage from reaching fully functional, feature-full driver. 1:1 for both of us ;)

Quoted 1 line

We invested a year trying to be good Linux citizens, laying out our initial plans, following the rules, working transparently, folding in feedback, submitting hundreds of patches in plain sight of everyone and now folks are asking about our plan.  Our plan is get the brcmsmac and brcmfmac into mainline and keep following that up with new features, new chips and continuing support.

Well, you were submitting patches, but you weren't discussing anything with us. That's really important in being a good citizens. How many times have I asked about the firmware? How many times about access to the hardware? How many times about the future? Really, I was trying hard to cooperate, you just were ignoring all of that :| We've now finally made you respond to the questions about the future, but you still ignore my fw questions and hw requests.
This of course resulted in the complex situation we have now.

Quoted 1 line

Other than barely supporting one of our chips first in mainline, I would really like to understand what are the benefits and justifications of using b43 over brcmsmac for AXI based chips in the long run.  Can someone explain them?

What I don't like about brcmsmac?
1) Not modularized, bcma support built in and duplicated with bcma module
2) Poor quality code
3) Duplication of a lot of code with bcma&b43. Not just PHY code, but also more general functions, DMA support, MAC, etc.

I don't know what more I can propose now.

We can of course continue our work without differences. I'll add support for more cards and make it stable, meanwhile you will finally clean your driver. What then? We will have 2 driver supporting same hardware with comparable quality. Having 2 mainline drivers for the same hw is not really a good option. Will we keep brcmsmac in staging just to receive new PHY support from you and keep copying it to b43? Doesn't sound to optimistic. How else do you see the future?

Signature · 1 line
Rafał
#43 lore raw

PiA+IE91ciBvcmlnaW5hbCBwbGFuIHdhcyB0byByZW1haW4gYSBzZXBhcmF0ZSBkcml2ZXIgZnJv bSBiNDMuIFdlIHdlcmUNCj4gYXdhcmUgb2YgaXQgYW5kIGFsbCB0aGUgZ29vZCB3b3JrIHRoYXQg aGFkIGJlZW4gZG9uZSB0byBjcmVhdGUgaXQgYW5kIHdlDQo+IGhhZCBubyBpbnRlbnRpb24gb2Yg aW50ZXJmZXJpbmcgd2l0aCBpdC4gwqBBdCB0aGF0IHBvaW50IHRoZXJlIGhhZCBub3QNCj4gYmVl biB2ZXJ5IG11Y2ggcmVjZW50IG1vdmVtZW50IGluIGI0MyBhbmQgaXQgZGlkIG5vdCBzdXBwb3J0 IGFueSBvZiBvdXINCj4gQVhJIGJ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Ugd2FpdGluZyB0byBiZSByZWxl YXNlZC4gIA0KDQo+IDIpIFBvb3IgcXVhbGl0eSBjb2RlDQoNCj4gMykgRHVwbGljYXRpb24gb2Yg YSBsb3Qgb2YgY29kZSB3aXRoIGJjbWEmYjQzLiBOb3QganVzdCBQSFkgY29kZSwgYnV0DQo+IGFs c28gbW9yZSBnZW5lcmFsIGZ1bmN0aW9ucywgRE1BIHN1cHBvcnQsIE1BQywgZXRjLg0KDQpTZXJp b3VzbHk/IEFnYWluPyBZb3Uga2VlcCBicmluZ2luZyB0aGlzIHVwLiBEbyB5b3UgdW5kZXJzdGFu ZCB0aGF0IHRoZXJlIHdhcyBubyBiY21hIHdoZW4gd2UgcmVsZWFzZWQgdG8gc3RhZ2luZyBhbmQg dGhhdCB3ZQ0Kd2VyZSBhc2tlZCBub3QgdG8gYWRkIG5ldyBmZWF0dXJlcyB3aGlsZSBpbiBzdGFn aW5nPyAgIEl0IHdvdWxkIGJlIG5pY2UgaWYgeW91IGNvdWxkIGFja25vd2xlZGdlIHRoYXQuDQoN CkJ1dCBvdGhlciB0aGFuIHRoZSBvbmUgbGluZSBjb21tZW50IG9uIGNvZGUsIHlvdSBzdGlsbCBo YXZlbid0IGFuc3dlcmVkIHRoZSBxdWVzdGlvbiBvZiB3aHkgeW91IHRoaW5rIGI0MyBpcyBhIGJl dHRlciBkcml2ZXIuDQoNCj4gLS0NCj4gUmFmYcWCDQoNCg==

#44 lore raw
Quoted 1 line · On Wed, 21 Sep 2011 15:12:02 -0700 "Brett Rudley" <[email protected]> wrote:

But other than the one line comment on code, you still haven't answered the question of why you think b43 is a better driver.

I think that is a completely bogus question.
Whether b43 or brcmsmac is better does completely depend on the application. And for that single reason I do not see either b43 or brcmsmac being dropped in favor of the other one any time soon.

You guys obviously don't want to support legacy hardware. So there is absolutely no way to drop b43 in favor of brcmsmac. That is _impossible_.
And I do agree that it would be completely insane for you guys to support the legacy b43 802.11g code.

The other way around, dropping brcmsmac in favor of b43 would be insanely stupid, too. It would basically be dropping broadcom-linux-wlan support. Nobody wants that.

I do, however, think that a separate broadcom-supported PHY module should be created, that is used by both brcmsmac and b43.

Signature · 1 line
Greetings, Michael.
#45 lore raw
Quoted 11 lines

You guys obviously don't want to support legacy hardware. So there is absolutely
no way to drop b43 in favor of brcmsmac. That is _impossible_. And I do agree that it would be completely insane for you guys to support the legacy
b43 802.11g code.

The other way around, dropping brcmsmac in favor of b43 would be insanely stupid, too.
It would basically be dropping broadcom-linux-wlan support. Nobody wants that.

Agree and we are not proposing that.

We did however initially propose (and implement) a dividing line of ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that. I haven't heard any counter-proposal from b43. We would love to hear one.

Quoted 3 lines

I do, however, think that a separate broadcom-supported PHY module should be created,
that is used by both brcmsmac and b43.

I'm not totally opposed to that idea but it does not solve the primary issue of conflicting b43 and brcmsmac modules.

Brett

#34 lore raw
In reply to Alex Deucher

2011/9/20 Alex Deucher <[email protected]>:

Quoted 19 lines

2011/9/20 Rafał Miłecki <[email protected]>:

Quoted 18 lines

2011/9/20 Johannes Berg <[email protected]>:

Quoted 16 lines · Greg KH
Quoted 6 lines

And while code is great and nice, I still haven't seen any real answers to all of the questions that were asked of the Broadcom driver team during that review by the linux-wireless developers about how things will be handled properly due to the overlap in functionality with the existing "real" driver in the tree.

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has always undergone changes over time. I'm actually surprised that b43 works as well as it does (which, tbh, isn't very well at all, at least for me with some 11n PHY). I also don't think that Broadcom are going to maintain compatibility and/or maintain new firmware features for old devices, that just doesn't make any sense.

Quoted 8 lines
Quoted 3 lines

Actually, when we got some single response from Broadcom about their relation to b43, they haven't mentioned support for old HW is any problem at all.

If you look at it from the perspective of a hardware manufacturer, supporting EOLed chips is generally not a good return on investment. There is no new revenue associated with them so any work that goes into them stands to return very little.

Support is one thing, the other is to enable the community. The later can be done while real support goes into the newer chipsets.

Luis

#46 lore raw
In reply to Brett Rudley
Quoted 1 line · On Wed, 21 Sep 2011 16:15:10 -0700 "Brett Rudley" <[email protected]> wrote:

We did however initially propose (and implement) a dividing line of ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that.

Well, what about embedded, for instance?

Quoted 1 line

I'm not totally opposed to that idea but it does not solve the primary issue of conflicting b43 and brcmsmac modules.

I'm not convinced that this is an issue at all and I'm not convinced that it has to be resolved. At least not now.

Signature · 1 line
Greetings, Michael.
#47 lore raw
Quoted 6 lines
Quoted 2 lines

We did however initially propose (and implement) a dividing line of ssb

chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that.

Well, what about embedded, for instance?

I was referring to smac. There isn't any controversy over fmac AFAIK.

Brett

#48 lore raw

W dniu 22 września 2011 04:07 użytkownik Brett Rudley

Quoted 7 lines · <[email protected]> napisał:
Quoted 5 lines
Quoted 1 line

We did however initially propose (and implement) a dividing line of ssb

chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that.

Well, what about embedded, for instance?

I was referring to smac. There isn't any controversy over fmac AFAIK.

I was question about embedded devices like routers I believe.

Signature · 1 line
Rafał
#57 lore raw
In reply to Brett Rudley
Quoted 7 lines · Brett Rudley
Quoted 7 lines
Quoted 1 line

Our original plan was to remain a separate driver from b43. We were

aware of it and all the good work that had been done to create it and we had no intention of interfering with it. At that point there had not been very much recent movement in b43 and it did not support any of our AXI based chips. We figured that ssb vs AXI was a good dividing line and there would be no conflict, and there wasn't initially.

Quoted 7 lines
Quoted 5 lines

The first obvious problem is that there are SSB and BCMA (aka AXI) cards using N-PHY. That resulted in PHY code duplication between b43 and brcmsmac. And since we already supported N-PHY in b43, adding bcma support automatically gave us BCM43224 and BCM43225 support. That of course means duplicated supported for the same hardware.

Agree, when you created bcma, it did duplicate HW support already in brcmsmac. Why didn't you address that then?

bcma is not only used to support the bus on a pci based wireless cards it now also contains support for SoCs like the BCM4718. There it provides a common interface to the hardware for the wireless so that there were no changes in b43 needed to get the wireless core running on this SoC. It also provides some parts needed to get the SoC boot in Linux and so on, some parts are related to the MIPS CPU and not related to the wireless core, so it makes sense to put that into an own module.

Hauke

#61 lore raw
In reply to Brett Rudley

W dniu 22 września 2011 00:12 użytkownik Brett Rudley

Quoted 7 lines · <[email protected]> napisał:
Quoted 7 lines
Quoted 1 line

Our original plan was to remain a separate driver from b43. We were

aware of it and all the good work that had been done to create it and we had no intention of interfering with it.  At that point there had not been very much recent movement in b43 and it did not support any of our AXI based chips.  We figured that ssb vs AXI was a good dividing line and there would be no conflict, and there wasn't initially.

Quoted 7 lines
Quoted 5 lines

The first obvious problem is that there are SSB and BCMA (aka AXI) cards using N-PHY. That resulted in PHY code duplication between b43 and brcmsmac. And since we already supported N-PHY in b43, adding bcma support automatically gave us BCM43224 and BCM43225 support. That of course means duplicated supported for the same hardware.

Agree, when you created bcma, it did duplicate HW support already in brcmsmac.  Why didn't you address that then?

bcma is not the issue, it had to be created anyway. We can not accept one driver handling all the BCMA/AXI cores (80211, ethernet, whatever else). And you, I believe brcmsmac has to switch to bcma.

Quoted 3 lines

Also, brcmsmac realizes that there are tweaks and features specific to each chip and to each revision of each phy.  While they are of the same family, each version has its own feature set and settings.

But b43 got 224/5 so called support 'automaticly' simply by adding AXI access.

Chips tweaks mostly lays in bus code, which is bcma in this case. As for PHY code, you've not even cared to take a look at our phy_n.c! But you're commenting that anyway.
BCM43224 and BCM43225 are nothing special, there are N-PHY rev 6. We've code for revs 1-6 from the beginning. That's how we got support for that cards "automaticly". I was here since "ever", we just got to add BCMA/AXI support.

Quoted 16 lines
Quoted 16 lines
Quoted 1 line

Internally, prior to releasing to staging tree, development had gone

quickly and it didn't take long at all to get the driver up and running. We did not anticipate that things would go somewhat slower in the staging tree and a year (and hundreds of patches) later we are still there.  During that year b43 got some limited support for the same new chips brcmsmac already had, into its driver.  So now, here we are... both drivers supporting the new chips and b43 also supporting the old.

Quoted 2 lines

We have seen the requests for us to add AXI based chipset support into

b43.  I don't think that will happen in a substantial way:

Quoted 1 line

- Our driver is already stable and performance is better than b43 in

terms of AXI chips.  B43 seems quite raw: its full of TODO and FIXME notes and performance is 1/10th of brcmsmac on our testing. Spending another round of time and effort on b43 to get it to the place where smac already is, seems redundant and unattractive.

Quoted 4 lines
Quoted 2 lines

Well, I guess you were comparing brcmsmac working in 802.11n mode vs. b43 workin in 802.11g mode?

I just loaded the two drivers on my machine and ran iperf.  Are users expected to do something else?  802.11N APs are not esoteric equipment anymore, sorry.

[irony, yes]
Monitor mode is nothing esoteric anymore. I've compared b43 with brcmsmac. b43 is 100000000 times faster (compared to 0 b/s).

Quoted 11 lines
Quoted 10 lines

Yes, I'm aware you may be not so comfortable with differences between internal driver and b43.
However you're already at the place, when you can not just copy&paste code from your internal driver to brcmsmac. You have to adopt in anyway. Are there really so many differences if you look at b43? DMA is something you probably don't need to touch. PHY code should be portable to b43 in the same way it is to brcmsmac. The biggest problem is to touch some general things, not PHY-directly-related. And even in that code we share a lot of code. Our code is based on RE of your driver. It has to be similar.

Quoted 1 line

If they are so similar why do you think b43 is better?

I've said what I don't like currently in brcmsmac. I've also said both drivers should be equal in next few months. Nothing really more to add, it's not about flamewar. Plus Michael commented this nicely.

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

- Most of the recent b43 additions support comes from a single person

doing reverse engineering. brcmsmac has a few software people working on it directly and hundreds of people working on it indirectly (through the internal version) including engineers working on firmware, RTL, testing, etc.

Quoted 8 lines
Quoted 5 lines

You're doing much harder job and obviously you need much more people. I just implement the driver, without testing hardware for various possible configurations, etc. That's the only explanation how we've achieved such a good state. We copied init/config values from your driver, didn't invent them ourself.

Speaking of init values, I noticed you have init values but no others after that during runtime.  We don't drive our chips without proper periodic calibrations.

You really got to ignore previous thread about going mainline. That issue was already pointed to me, and I've already started sending patches for that.

Quoted 17 lines
Quoted 7 lines

Well, you spent a lot of time on cleaning brcmsmac, I spent a lot of time on adding support for new hardware. I believe now we both are at similar stage from reaching fully functional, feature-full driver. 1:1 for both of us ;)

Quoted 9 lines

Well, you were submitting patches, but you weren't discussing anything with us. That's really important in being a good citizens. How many times have I asked about the firmware? How many times about access to the hardware? How many times about the future? Really, I was trying hard to cooperate, you just were ignoring all of that :| We've now finally made you respond to the questions about the future, but you still ignore my fw questions and hw requests.
This of course resulted in the complex situation we have now.

Quoted 4 lines

Do you think were in the smokey back room making deals or something?  All our patches are out in the open. We have tried to be as transparent as possible.
We responded and integrated all (almost all?) feedback that we got on our patches.
We published our TODO list and updated it several times throughout devel cycle.

I didn't comment your patches. Maybe I've said sth about amount of them, but it's your choice to spend your time on cleaning, cleaning, cleaning, I'm find with that.

Quoted 2 lines

We helped you with bcma.   You asked us to send you an Arasan board which are hard to get and cost about $1k, I can't do that.  I handed out 4313 and 43224 boards like candy early on to anyone who asked.

I don't remember you saying finally "Sorry, we won't be able to donate you with that". Will re-check.
Still, you refused to share BCM4331 (which is already available on market, and even hackish-supported by b43). Same for BCM43227 and BCM43228. I didn't even care to ask for some SSLPN card (which is also available on the market in some routers, can find proves). Oh, and you still didn't care too much about our firmware requests.

Quoted 10 lines
Quoted 7 lines
Quoted 1 line

Other than barely supporting one of our chips first in mainline, I

would really like to understand what are the benefits and justifications of using b43 over brcmsmac for AXI based chips in the long run.  Can someone explain them?

What I don't like about brcmsmac?
1) Not modularized, bcma support built in and duplicated with bcma module

As discussed numerous times:
We have been in staging and no new features is the rule. We have bcma code waiting to be released.

Please, do this soon. When merge window for 3.2 will open, you'll receive all recent bcma code. If there is anything missing in bcma you need, *please report that* (or provide patches).
I believe this is part of cleaning, nothing like new features. You'll simply drop a lot of duplicated code by switching to bcma.

Quoted 9 lines
Quoted 4 lines

2) Poor quality code

3) Duplication of a lot of code with bcma&b43. Not just PHY code, but also more general functions, DMA support, MAC, etc.

Seriously? Again? You keep bringing this up. Do you understand that there was no bcma when we released to staging and that we were asked not to add new features while in staging?   It would be nice if you could acknowledge that.

But other than the one line comment on code, you still haven't answered the question of why you think b43 is a better driver.

Signature · 1 line
Rafał
#62 lore raw

W dniu 22 września 2011 08:54 użytkownik Rafał Miłecki

Quoted 6 lines · <[email protected]> napisał:

W dniu 22 września 2011 00:12 użytkownik Brett Rudley

Quoted 2 lines

We helped you with bcma.   You asked us to send you an Arasan board which are hard to get and cost about $1k, I can't do that.  I handed out 4313 and 43224 boards like candy early on to anyone who asked.

I don't remember you saying finally "Sorry, we won't be able to donate you with that". Will re-check.

Yup, there is my question and respond from Henry:

W dniu 26 sierpnia 2011 19:31 użytkownik Henry Ptasinski

Quoted 11 lines · <[email protected]> napisał:
Quoted 3 lines
Quoted 1 line

Is there a chance you can donate me with such a adapter and card?

Ping?

Sorry, I meant to respond to this earlier.  The Arasan adapters are in very short supply here, and honestly they have enough issues that we're looking for better options.  A possibly better approach would be a device with a BCM4329 on the motherboard (e.g. table, phone, etc) that can run a relatively stock linux kernel.  However, I don't know of a specific platform at the moment to recommend.

Quoted 3 lines

A second choice would be something with a decent sdio controller built-in. Some older laptops worked ok (e.g. Dell E4100), but they're more and more diffucult to find.

Unfortunately not a word about donating me such a hardware. Plus not a word about the cost.

Signature · 1 line
Rafał
#63 lore raw
In reply to Brett Rudley

W dniu 22 września 2011 00:12 użytkownik Brett Rudley

Quoted 7 lines · <[email protected]> napisał:

Do you think were in the smokey back room making deals or something?  All our patches are out in the open. We have tried to be as transparent as possible.
We responded and integrated all (almost all?) feedback that we got on our patches.
We published our TODO list and updated it several times throughout devel cycle.

We helped you with bcma.   You asked us to send you an Arasan board which are hard to get and cost about $1k, I can't do that.  I handed out 4313 and 43224 boards like candy early on to anyone who asked.

Take a look at "Request for free-distributable Broadcom's (G|LP)-PHY firmware" thread. I've been requesting and pinging you guys several times. The response we got was:

W dniu 20 października 2010 23:50 użytkownik Henry Ptasinski

Quoted 4 lines · <[email protected]> napisał:

Sorry for the delay in responding.  We are exploring what is possible but for the moment the answer is no. At present our focus is on providing the best open source solution we can for 4313, 43224, 43225, 4329 and future chips sets.

That's all. Not really helpful.

Signature · 1 line
Rafał
#49 lore raw
In reply to Michael Büsch
Quoted 10 lines

From: [email protected] [mailto:linux-wireless- [email protected]] On Behalf Of Michael Büsch
Sent: donderdag 22 september 2011 1:29
To: Brett Rudley
Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin; [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

Quoted 8 lines
Quoted 1 line · On Wed, 21 Sep 2011 16:15:10 -0700 "Brett Rudley" <[email protected]> wrote:

We did however initially propose (and implement) a dividing line of

ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that.

Well, what about embedded, for instance?

The brcmsmac driver has been tested on a MIPS platform by Jonas Gorski although only in STA mode (on a bcm63xx). Not having AP mode has been explained in other emails.

Also we fully intend to transition to BCMA but that would also be new feature added. Having AP mode and BCMA would enable you guys for using it in the embedded targets, right?

Quoted 7 lines
Quoted 1 line

I'm not totally opposed to that idea but it does not solve the

primary issue of conflicting b43 and brcmsmac modules.

I'm not convinced that this is an issue at all and I'm not convinced that it has to be resolved.
At least not now.

It never hurts to look ahead. Both drivers have their use in the linux tree and we should align which driver is doing what. Apparently we should have yelled really hard when b43 was adding bcma support, because then it snatched the chipsets we support as well. You learn your lessons the hard way in Linux land, or so it seems ;-)

Gr. AvS

#50 lore raw

W dniu 22 września 2011 10:53 użytkownik Arend Van Spriel

Quoted 35 lines · <[email protected]> napisał:
Quoted 10 lines

From: [email protected] [mailto:linux-wireless- [email protected]] On Behalf Of Michael Büsch
Sent: donderdag 22 september 2011 1:29
To: Brett Rudley
Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin; [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

Quoted 8 lines
Quoted 1 line · On Wed, 21 Sep 2011 16:15:10 -0700 "Brett Rudley" <[email protected]> wrote:

We did however initially propose (and implement) a dividing line of

ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that.

Well, what about embedded, for instance?

The brcmsmac driver has been tested on a MIPS platform by Jonas Gorski although only in STA mode (on a bcm63xx). Not having AP mode has been explained in other emails.

Also we fully intend to transition to BCMA but that would also be new feature added. Having AP mode and BCMA would enable you guys for using it in the embedded targets, right?

Quoted 7 lines
Quoted 1 line

I'm not totally opposed to that idea but it does not solve the

primary issue of conflicting b43 and brcmsmac modules.

I'm not convinced that this is an issue at all and I'm not convinced that it has to be resolved.
At least not now.

Quoted 5 lines

It never hurts to look ahead. Both drivers have their use in the linux tree and we should align which driver is doing what. Apparently we should have yelled really hard when b43 was adding bcma support, because then it snatched the chipsets we support as well. You learn your lessons the hard way in Linux land, or so it seems ;-)

And I should have notice you add code for N-PHY with your initial brcm80211 commit ;) There's always something that you won't notice at the correct time.

Signature · 1 line
Rafał
#58 lore raw
In reply to Hauke Mehrtens

PiBGcm9tOiBsaW51eC13aXJlbGVzcy1vd25lckB2Z2VyLmtlcm5lbC5vcmcgW21haWx0bzpsaW51 eC13aXJlbGVzcy0NCj4gb3duZXJAdmdlci5rZXJuZWwub3JnXSBPbiBCZWhhbGYgT2YgSGF1a2Ug TWVocnRlbnMNCj4gU2VudDogZG9uZGVyZGFnIDIyIHNlcHRlbWJlciAyMDExIDg6NDcNCj4gVG86 IEJyZXR0IFJ1ZGxleQ0KPiBDYzogUmFmYcWCIE1pxYJlY2tpOyBHcmVnIEtIOyBKb2huIFcuIExp bnZpbGxlOyBGcmFua3kgKFpoZW5odWkpIExpbjsNCj4gZ3JlZ2toQHN1c2UuZGU7IGRldmVsQGxp bnV4ZHJpdmVycHJvamVjdC5vcmc7IGxpbnV4LQ0KPiB3aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmcN Cj4gU3ViamVjdDogUmU6IFtQQVRDSCAwMC8yMF0gc3RhZ2luZzogYnJjbTgwMjExOiA3dGggcmVh Y3Rpb24gZm9yDQo+IG1haW5saW5lIHBhdGNoICMyDQo+IA0KPiBPbiAwOS8yMi8yMDExIDEyOjEy IEFNLCBCcmV0dCBSdW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nJjbXNtYWMNCmFuZCBp dHMgZXhpc3RlbmNlIHByb3ZpZGVzIGdvb2QgZnVuY3Rpb25hbCBzZXBhcmF0aW9uLiBUaGF0IGlz IHdoeSB3ZSBmdWxseQ0KaW50ZW5kIHRvIGhhdmUgYnJjbXNtYWMgdXNlIGJjbWEuIEJyZXR0IG1l YW50IHRoYXQgdGhlIGR1cGxpY2F0aW9uIHN0YXJ0ZWQNCndoZW4gYjQzIHdhcyBnZXR0aW5nIHBh dGNoZXMgZm9yIGJjbWEgc3VwcG9ydC4NCg0KUmFmYcWCIGluZGljYXRlZCB0aGF0IGI0MyB0ZWFt IHdhcyB3b3JraW5nIG9uIG4tcGh5IHN1cHBvcnQgd2hlbiB3ZSByZWxlYXNlZA0KdGhlIGJyY204 MDIxMSBkcml2ZXIgKGFrYSBicmNtc21hYykuIE5vIG9uZSBpbmRpY2F0ZWQgdGhpcyBiZWZvcmUg c28gSSBjYW4NCm9ubHkgYXNzdW1lIHRoYXQgYjQzIGRlY2lkZWQgdG8gbW92ZSBvbiBidWlsZGlu ZyBiY21hIGFuZCBoYXZlIG5vIGludGVyZXN0DQppbiBicmNtc21hYyBtb3ZpbmcgaW4gdGhlIGxp bnV4IHRyZWUuDQoNCkdyLiBBdlMNCg==

#59 lore raw

2011/9/22 Arend Van Spriel <[email protected]>:

Quoted 47 lines
Quoted 40 lines

From: [email protected] [mailto:linux-wireless- [email protected]] On Behalf Of Hauke Mehrtens
Sent: donderdag 22 september 2011 8:47
To: Brett Rudley
Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin; [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

Quoted 2 lines · Brett Rudley
Quoted 2 lines
Quoted 1 line

Our original plan was to remain a separate driver from b43. We were

aware of it and all the good work that had been done to create it

and we

Quoted 1 line
Quoted 1 line

had no intention of interfering with it.  At that point there had

not

Quoted 1 line
Quoted 1 line

been very much recent movement in b43 and it did not support any of

our

Quoted 1 line
Quoted 1 line

AXI based chips.  We figured that ssb vs AXI was a good dividing

line and

Quoted 5 lines
Quoted 5 lines

there would be no conflict, and there wasn't initially.

The first obvious problem is that there are SSB and BCMA (aka AXI) cards using N-PHY. That resulted in PHY code duplication between b43 and brcmsmac. And since we already supported N-PHY in b43, adding

bcma

Quoted 4 lines
Quoted 2 lines

support automatically gave us BCM43224 and BCM43225 support. That of course means duplicated supported for the same hardware.

Agree, when you created bcma, it did duplicate HW support already in

brcmsmac.  Why didn't you address that then?

bcma is not only used to support the bus on a pci based wireless cards it now also contains support for SoCs like the BCM4718. There it provides a common interface to the hardware for the wireless so that there were no changes in b43 needed to get the wireless core running on this SoC. It also provides some parts needed to get the SoC boot in Linux and so on, some parts are related to the MIPS CPU and not related to the wireless core, so it makes sense to put that into an own module.

Quoted 1 line

Hauke

You are right. BCMA in itself only duplicates part of what is in brcmsmac and its existence provides good functional separation. That is why we fully intend to have brcmsmac use bcma. Brett meant that the duplication started when b43 was getting patches for bcma support.

Quoted 4 lines

Rafał indicated that b43 team was working on n-phy support when we released the brcm80211 driver (aka brcmsmac). No one indicated this before so I can only assume that b43 decided to move on building bcma and have no interest in brcmsmac moving in the linux tree.

It's not really about seeing interest in that. I just don't see advantages for us from this.

If we assume we will have the same level support in both drivers soon, then what are the differences? brcmsmac seems to be preferred only because Broadcom guys like it.

Signature · 1 line
Rafał
#51 lore raw
In reply to Rafał Miłecki

PiBGcm9tOiBSYWZhxYIgTWnFgmVja2kgW21haWx0bzp6YWplYzVAZ21haWwuY29tXQ0KPiBTZW50 OiBkb25kZXJkYWcgMjIgc2VwdGVtYmVyIDIwMTEgMTA6NTcNCj4gVG86IEFyZW5kIFZhbiBTcHJp ZWwNCj4gQ2M6IE1pY2hhZWwgQsO8c2NoOyBCcmV0dCBSdWRsZXk7IEdyZWcgS0g7IEpvaG4gVy4g TGludmlsbGU7IEZyYW5reQ0KPiAoWmhlbmh1aSkgTGluOyBncmVna2hAc3VzZ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bWFjIHdhcyBzdXBwb3J0aW5nPyBXaGVuIHlvdQ0KV2VyZSB3b3JraW5n IG9uIE4tUEhZIGl0IHdhcyB0byBlbmFibGUgY2VydGFpbiBjaGlwc2V0cywgcmlnaHQ/IFdhcyB0 aGF0DQppbiBzc2IgY29udGV4dD8NCg0KR3IuIEF2Uw0K

#52 lore raw

2011/9/22 Arend Van Spriel <[email protected]>:

Quoted 64 lines
Quoted 64 lines

From: Rafał Miłecki [mailto:[email protected]]
Sent: donderdag 22 september 2011 10:57
To: Arend Van Spriel
Cc: Michael Büsch; Brett Rudley; Greg KH; John W. Linville; Franky (Zhenhui) Lin; [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 22 września 2011 10:53 użytkownik Arend Van Spriel

Quoted 10 lines · <[email protected]> napisał:
Quoted 10 lines

From: [email protected] [mailto:linux-wireless- [email protected]] On Behalf Of Michael Büsch
Sent: donderdag 22 september 2011 1:29
To: Brett Rudley
Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin; [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

Quoted 4 lines
Quoted 4 lines
Quoted 1 line · On Wed, 21 Sep 2011 16:15:10 -0700 "Brett Rudley" <[email protected]> wrote:

We did however initially propose (and implement) a dividing line

of

Quoted 1 line
Quoted 1 line

ssb chips for b43 and AXI based chips for brcmsmac but b43 team

chose

Quoted 5 lines
Quoted 3 lines

to ignore/reject that.

Well, what about embedded, for instance?

The brcmsmac driver has been tested on a MIPS platform by Jonas

Gorski

Quoted 5 lines

although only in STA mode (on a bcm63xx). Not having AP mode has been explained in other emails.

Also we fully intend to transition to BCMA but that would also be new feature added. Having AP mode and BCMA would enable you guys for

using

Quoted 11 lines

it in the embedded targets, right?

Quoted 7 lines
Quoted 1 line

I'm not totally opposed to that idea but it does not solve the

primary issue of conflicting b43 and brcmsmac modules.

I'm not convinced that this is an issue at all and I'm not convinced that it has to be resolved.
At least not now.

It never hurts to look ahead. Both drivers have their use in the

linux

Quoted 1 line

tree and we should align which driver is doing what. Apparently we

should

Quoted 1 line

have yelled really hard when b43 was adding bcma support, because

then

Quoted 1 line

it snatched the chipsets we support as well. You learn your lessons

the

Quoted 1 line

hard way in Linux land, or so it seems ;-)

And I should have notice you add code for N-PHY with your initial brcm80211 commit ;) There's always something that you won't notice at the correct time.

Quoted 6 lines
Quoted 2 lines

--
Rafał

Were you unaware of the chipsets that brcmsmac was supporting? When you Were working on N-PHY it was to enable certain chipsets, right? Was that in ssb context?

I was aware of supported chipsets (by their names), but I got no idea that they (BCM43224 and BCM43225) are N-PHY based ones. I though that that are some totally new PHYs (like SSLPN/HT/LCN/LCNXN/etc.).

Signature · 1 line
Rafał
#55 lore raw
In reply to Michael Büsch
Quoted 10 lines · Michael Büsch

And for that single reason I do not see either b43 or brcmsmac being dropped in favor of the other one any time soon.

You guys obviously don't want to support legacy hardware. So there is absolutely no way to drop b43 in favor of brcmsmac. That is _impossible_.
And I do agree that it would be completely insane for you guys to support the legacy b43 802.11g code.

The other way around, dropping brcmsmac in favor of b43 would be insanely stupid, too. It would basically be dropping broadcom-linux-wlan support. Nobody wants that.

All good points. The most rational I've seen in all of this discussion really.

Quoted 2 lines

I do, however, think that a separate broadcom-supported PHY module should be created, that is used by both brcmsmac and b43.

I agree that would be nice. However, I don't think that it should be required for brcmsmac to get into mainline, nor do I think that there should be a big rearchitecture for this. In fact, brcmsmac has a PHY abstraction layer that looks perfectly usable to me. b43 has one too, but it's nowhere near as fleshed out for all corner cases afaict.

Really the more important issue is support though. Rafal by himself cannot possibly provide the level of support we're hoping to see from Broadcom who I expect will eventually ship this driver to their customers and support it, just like they do now with the driver it is derived from.

Overall, the way I see it this really is a no-brainer. I really don't see why we're even discussing this so much.
brcmsmac should be accepted into mainline as soon as possible (and I think all the recent patchsets go a long way). After that, the Broadcom team can easily port it to bcma, I expect that would happen within a few weeks. Adding features to it should be fairly simple too, and go much faster than adding any features to b43. (*)

b43 is really my child too. I spent a very long time on the reverse engineering. But let's let it "die" peacefully. It has no reason to be competing with a Broadcom-supported driver that supports the same chips.

johannes

(*) Rafal: Also, get a grip. Your much touted "monitor mode" is probably a 50-100 line patch to brcmsmac. You're making yourself look extremely childish by talking about it all the time as if it was the best thing since sliced bread.

#53 lore raw
In reply to Arend Van Spriel

2011/9/22 Arend Van Spriel <[email protected]>:

Quoted 14 lines
Quoted 14 lines

From: [email protected] [mailto:linux-wireless- [email protected]] On Behalf Of Michael Büsch
Sent: donderdag 22 september 2011 1:29
To: Brett Rudley
Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin; [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

Quoted 1 line · On Wed, 21 Sep 2011 16:15:10 -0700 "Brett Rudley" <[email protected]> wrote:

We did however initially propose (and implement) a dividing line of

Quoted 8 lines
Quoted 4 lines

ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that.

Well, what about embedded, for instance?

The brcmsmac driver has been tested on a MIPS platform by Jonas Gorski although only in STA mode (on a bcm63xx). Not having AP mode has been explained in other emails.

This just happened to be a MIPS, but apart from that it was still a mostly standard fare PCIe connected BCM4313, no nothing really embedded. What Michael (and Hauke, and Rafal) is talking about are BCM47xx SoC where AMBA/AXI is the System Bus, and there is no PCI(e) at all (except maybe for connecting a /second/ wifi).

This was one of the main motivations of the bcma driver.

Regards,
Jonas

P.S: Which reminds me, do you plan to (not) support the integrated wifi in the BCM6362? This one seems to be neither bcma nor ssb, but it's definitely Broadcom ;) (Haven't gotten my hands yet on a device though).

#56 lore raw
In reply to Johannes Berg
Quoted 12 lines · On Thu, 22 Sep 2011 11:44:35 +0200 Johannes Berg <[email protected]>…

I agree that would be nice. However, I don't think that it should be required for brcmsmac to get into mainline, nor do I think that there should be a big rearchitecture for this. In fact, brcmsmac has a PHY abstraction layer that looks perfectly usable to me. b43 has one too, but it's nowhere near as fleshed out for all corner cases afaict.

Really the more important issue is support though. Rafal by himself cannot possibly provide the level of support we're hoping to see from Broadcom who I expect will eventually ship this driver to their customers and support it, just like they do now with the driver it is derived from.

Quoted 7 lines

Overall, the way I see it this really is a no-brainer. I really don't see why we're even discussing this so much.
brcmsmac should be accepted into mainline as soon as possible (and I think all the recent patchsets go a long way). After that, the Broadcom team can easily port it to bcma, I expect that would happen within a few weeks. Adding features to it should be fairly simple too, and go much faster than adding any features to b43. (*)

I fully agree with all of that.

It is time to merge the stuff into mainline. There really is no other option.

Quoted 2 lines

b43 is really my child too. I spent a very long time on the reverse engineering. But let's let it "die" peacefully.

We all put a lot of effort into b43, but that does not imply that we have to beat the dead horse.

b43 has to become a second b43legacy. Which means it must go into maintenance-only mode. Features should probably be removed, too. But that has to be done after mainlining of brcmsmac.

Completely dropping either of b43 or brcmsmac is not an option. So, Rafal, you can still continue to work on b43. There are _lots_ of bugs and issues to fix/improve. If you need/want some older b43 devices, I can certainly donate some of mine to you. (I have at least piece one of any flavor of supported 802.11g devices in stock).

Signature · 1 line
Greetings, Michael.
#60 lore raw
In reply to Rafał Miłecki
Quoted 3 lines · On Thu, 22 Sep 2011 11:08:11 +0200 Rafał Miłecki <[email protected]> wrote:

If we assume we will have the same level support in both drivers soon, then what are the differences? brcmsmac seems to be preferred only because Broadcom guys like it.

Guys, can we _please_ get back to a technical discussion?

Signature · 1 line
Greetings, Michael.
#54 lore raw
In reply to Jonas Gorski

PiBGcm9tOiBKb25hcyBHb3Jza2kgW21haWx0bzpqb25hcy5nb3Jza2lAZ21haWwuY29tXQ0KPiBT ZW50OiBkb25kZXJkYWcgMjIgc2VwdGVtYmVyIDIwMTEgMTI6MDgNCj4gVG86IEFyZW5kIFZhbiBT cHJpZWwNCj4gQ2M6IE1pY2hhZWwgQsO8c2NoOyBCcmV0dCBSdWRsZXk7IFJhZmHFgiBNacWCZWNr aTsgR3JlZyBLS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g L3NlY29uZC8gd2lmaSkuDQo+IA0KPiBUaGlzIHdhcyBvbmUgb2YgdGhlIG1haW4gbW90aXZhdGlv bnMgb2YgdGhlIGJjbWEgZHJpdmVyLg0KDQpZZXMuIFRoYXQgaXMgY29ycmVjdC4gVGhleSBjb3Vs ZCBvcHQgZm9yIGJyY21zbWFjK2JjbWEgZm9yIHRoYXQgb25jZQ0KdGhhdCBpcyBhZGRlZC4NCg0K PiBSZWdhcmRzLA0KPiBKb25hcw0KPiANCj4gUC5TOiBXaGljaCByZW1pbmRzIG1lLCBkbyB5b3Ug cGxhbiB0byAobm90KSBzdXBwb3J0IHRoZSBpbnRlZ3JhdGVkDQo+IHdpZmkgaW4gdGhlIEJDTTYz NjI/IFRoaXMgb25lIHNlZW1zIHRvIGJlIG5laXRoZXIgYmNtYSBub3Igc3NiLCBidXQNCj4gaXQn cyBkZWZpbml0ZWx5IEJyb2FkY29tIDspIChIYXZlbid0IGdvdHRlbiBteSBoYW5kcyB5ZXQgb24g YSBkZXZpY2UNCj4gdGhvdWdoKS4NCg0KVGhlcmUgaXMgbm8gcGxhbiBvbiByZWNvcmQgZm9yIHRo YXQuIEkgaGFkIGEgcXVpY2sgbG9vayBhbmQgaXQgaW5kZWVkDQppcyBhbm90aGVyIGZsYXZvciBv ZiBzeXN0ZW0gYnVzLiBJIGRpZCBub3QgZmlndXJlIG91dCB5ZXQgaG93IHRvIGJ1aWxkDQphIHJv dXRlciBpbWFnZSBhbmQgd2hpY2ggc291cmNlIGZpbGVzIHByb3ZpZGUgYnVzIGFjY2VzcyBmb3Ig aXQuIEkgZG8NCm5vdCBoYXZlIGFjY2VzcyB0byBEU0wgc3R1ZmYgb3ZlciBoZXJlLg0KDQpHci4g QXZTDQo=

#64 lore raw
In reply to Brett Rudley
Quoted 7 lines · Brett Rudley
Quoted 7 lines
Quoted 1 line

Our original plan was to remain a separate driver from b43. We were

aware of it and all the good work that had been done to create it and we had no intention of interfering with it. ??At that point there had not been very much recent movement in b43 and it did not support any of our AXI based chips. ??We figured that ssb vs AXI was a good dividing line and there would be no conflict, and there wasn't initially.

Quoted 7 lines
Quoted 5 lines

The first obvious problem is that there are SSB and BCMA (aka AXI) cards using N-PHY. That resulted in PHY code duplication between b43 and brcmsmac. And since we already supported N-PHY in b43, adding bcma support automatically gave us BCM43224 and BCM43225 support. That of course means duplicated supported for the same hardware.

Agree, when you created bcma, it did duplicate HW support already in brcmsmac. Why didn't you address that then?

Because doing inside a driver is wrong. bcma is a separate bus layer and really must stay outside the driver. It can very reasonably argued that the same is true for the PHY support.

Given the arguments from Johannes and other I think the only reasonable outcome here is to make sure the broadcom drivers share

a) the bcma bus support (already done), and
b) the phy layer

and just make them the driver for the newer MAC revisions.

(and stop those fight already, shh..)

#65 lore raw
Quoted 30 lines

From: [email protected] [mailto:linux-wireless- [email protected]] On Behalf Of Christoph Hellwig
Sent: donderdag 22 september 2011 16:31
To: Brett Rudley
Cc: Rafa?? Mi??ecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin; [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

Quoted 1 line · Brett Rudley
Quoted 1 line
Quoted 1 line

Our original plan was to remain a separate driver from b43. We

were

Quoted 1 line
Quoted 1 line

aware of it and all the good work that had been done to create it

and we

Quoted 1 line
Quoted 1 line

had no intention of interfering with it. ??At that point there had

not

Quoted 1 line
Quoted 1 line

been very much recent movement in b43 and it did not support any of

our

Quoted 1 line
Quoted 1 line

AXI based chips. ??We figured that ssb vs AXI was a good dividing

line and

Quoted 4 lines
Quoted 4 lines

there would be no conflict, and there wasn't initially.

The first obvious problem is that there are SSB and BCMA (aka AXI) cards using N-PHY. That resulted in PHY code duplication between

b43

Quoted 1 line
Quoted 1 line

and brcmsmac. And since we already supported N-PHY in b43, adding

bcma

Quoted 1 line
Quoted 1 line

support automatically gave us BCM43224 and BCM43225 support. That

of

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

course means duplicated supported for the same hardware.

Agree, when you created bcma, it did duplicate HW support already in

brcmsmac. Why didn't you address that then?

Because doing inside a driver is wrong. bcma is a separate bus layer and really must stay outside the driver. It can very reasonably argued that the same is true for the PHY support.

I am not disputing that the bcma bus driver was a good move, but there are numerous chip devices out there with an internal bus of some sore and not having a separate bus driver.

Regarding PHY support compared to a system bus on a chip is comparing apples with pears. However, as said earlier we are not opposed to the idea.

Quoted 7 lines

Given the arguments from Johannes and other I think the only reasonable outcome here is to make sure the broadcom drivers share

a) the bcma bus support (already done), and
b) the phy layer

and just make them the driver for the newer MAC revisions.

A BCMA bus driver and PHY layer does not give a wireless driver. Am I missing something?

Quoted 1 line

(and stop those fight already, shh..)

I thought this was just an open and lively discussion ;-)

Gr. AvS