Skip to contentSkip to conversation

New patch series for merge

PATCH In review Michael Buesch 3 participants 13 messages Aug 18, 2007 – Aug 24, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover New patch series for merge

Hi John,

This patch series catches wireless-dev up to my
current wireless-development patchset.

Please merge this into wireless-dev.

IMPORTANT: Latest fwcutter from SVN and re-extracting the firmware is needed after applying this.

#1 lore raw

PATCH 1/6 b43: Fix kconfig, SSB autoselect must depend on b43

drivers/net/wireless/b43/Kconfig +2 -2
Index: wireless-dev-new/drivers/net/wireless/b43/Kconfig
===================================================================
@@ -11,14 +11,14 @@ config B43
 # Auto-select SSB PCI-HOST support, if possible
 config B43_PCI_AUTOSELECT
 	bool
-	depends on SSB_PCIHOST_POSSIBLE
+	depends on B43 && SSB_PCIHOST_POSSIBLE
 	select SSB_PCIHOST
 	default y
 
 # Auto-select SSB PCICORE driver, if possible
 config B43_PCICORE_AUTOSELECT
 	bool
-	depends on SSB_DRIVER_PCICORE_POSSIBLE
+	depends on B43 && SSB_DRIVER_PCICORE_POSSIBLE
 	select SSB_DRIVER_PCICORE
 	default y
 
#2 lore raw

PATCH 2/6 ssb: Fix uevent MODALIAS string.

In reply to Michael Buesch

Use the same %-convention as file2alias does.

drivers/ssb/main.c +2 -1
Index: ssb-merge-new/drivers/ssb/main.c
===================================================================
@@ -331,10 +331,11 @@ static int ssb_device_uevent(struct devi
 
 	ret = add_uevent_var(envp, num_envp, &i,
 			     buffer, buffer_size, &length,
-			     "MODALIAS=ssb:v%.4xid%.4xrev%.2x",
+			     "MODALIAS=ssb:v%04Xid%04Xrev%02X",
 			     ssb_dev->id.vendor, ssb_dev->id.coreid,
 			     ssb_dev->id.revision);
 	envp[i] = NULL;
+
 	return ret;
 }
 
#3 lore raw

PATCH 3/6 b43: Rename print functions to b43foobar

In reply to Michael Buesch

Avoid namespace pollution.

drivers/net/wireless/b43/b43.h +5 -5
Index: wireless-dev-new/drivers/net/wireless/b43/b43.h
===================================================================
@@ -773,17 +773,17 @@ static inline void b43_write32(struct b4
 }
 
 /* Message printing */
-void bcminfo(struct b43_wl *wl, const char *fmt, ...)
+void b43info(struct b43_wl *wl, const char *fmt, ...)
     __attribute__ ((format(printf, 2, 3)));
-void bcmerr(struct b43_wl *wl, const char *fmt, ...)
+void b43err(struct b43_wl *wl, const char *fmt, ...)
     __attribute__ ((format(printf, 2, 3)));
-void bcmwarn(struct b43_wl *wl, const char *fmt, ...)
+void b43warn(struct b43_wl *wl, const char *fmt, ...)
     __attribute__ ((format(printf, 2, 3)));
 #if B43_DEBUG
-void bcmdbg(struct b43_wl *wl, const char *fmt, ...)
+void b43dbg(struct b43_wl *wl, const char *fmt, ...)
     __attribute__ ((format(printf, 2, 3)));
 #else /* DEBUG */
-# define bcmdbg(wl, fmt...) do { /* nothing */ } while (0)
+# define b43dbg(wl, fmt...) do { /* nothing */ } while (0)
 #endif /* DEBUG */
 
 /* A WARN_ON variant that vanishes when b43 debugging is disabled.
drivers/net/wireless/b43/debugfs.c +10 -10
Index: wireless-dev-new/drivers/net/wireless/b43/debugfs.c
===================================================================
@@ -126,12 +126,12 @@ static ssize_t tsf_write_file(struct fil
 	mutex_lock(&dev->wl->mutex);
 	spin_lock_irqsave(&dev->wl->irq_lock, flags);
 	if (b43_status(dev) < B43_STAT_STARTED) {
-		bcmerr(dev->wl, "debugfs: Board not initialized.\n");
+		b43err(dev->wl, "debugfs: Board not initialized.\n");
 		res = -EFAULT;
 		goto out_unlock;
 	}
 	if (sscanf(buf, "%llu", (unsigned long long *)(&tsf)) != 1) {
-		bcmerr(dev->wl, "debugfs: invalid values for \"tsf\"\n");
+		b43err(dev->wl, "debugfs: invalid values for \"tsf\"\n");
 		res = -EINVAL;
 		goto out_unlock;
 	}
@@ -234,7 +234,7 @@ static ssize_t restart_write_file(struct
 	mutex_lock(&dev->wl->mutex);
 	spin_lock_irqsave(&dev->wl->irq_lock, flags);
 	if (b43_status(dev) < B43_STAT_INITIALIZED) {
-		bcmerr(dev->wl, "debugfs: Board not initialized.\n");
+		b43err(dev->wl, "debugfs: Board not initialized.\n");
 		res = -EFAULT;
 		goto out_unlock;
 	}
@@ -323,12 +323,12 @@ static ssize_t txpower_g_write_file(stru
 	mutex_lock(&dev->wl->mutex);
 	spin_lock_irqsave(&dev->wl->irq_lock, flags);
 	if (b43_status(dev) < B43_STAT_STARTED) {
-		bcmerr(dev->wl, "debugfs: Board not initialized.\n");
+		b43err(dev->wl, "debugfs: Board not initialized.\n");
 		res = -ENODEV;
 		goto out_unlock;
 	}
 	if (dev->phy.type != B43_PHYTYPE_G) {
-		bcmerr(dev->wl, "debugfs: Device is not a G-PHY\n");
+		b43err(dev->wl, "debugfs: Device is not a G-PHY\n");
 		res = -ENODEV;
 		goto out_unlock;
 	}
@@ -341,7 +341,7 @@ static ssize_t txpower_g_write_file(stru
 		/* Manual control */
 		if (sscanf(buf, "%d %d %d %d %d", &bbatt, &rfatt,
 			   &txmix, &pa2db, &pa3db) != 5) {
-			bcmerr(dev->wl,
+			b43err(dev->wl,
 			       "debugfs: invalid value for \"tx_power_g\"\n");
 			res = -EINVAL;
 			goto out_unlock;
@@ -450,7 +450,7 @@ void b43_debugfs_add_device(struct b43_w
 	B43_WARN_ON(!dev);
 	e = kzalloc(sizeof(*e), GFP_KERNEL);
 	if (!e) {
-		bcmerr(dev->wl, "debugfs: add device OOM\n");
+		b43err(dev->wl, "debugfs: add device OOM\n");
 		return;
 	}
 	e->dev = dev;
@@ -458,7 +458,7 @@ void b43_debugfs_add_device(struct b43_w
 	log->log = kcalloc(B43_NR_LOGGED_TXSTATUS,
 			   sizeof(struct b43_txstatus), GFP_KERNEL);
 	if (!log->log) {
-		bcmerr(dev->wl, "debugfs: add device txstatus OOM\n");
+		b43err(dev->wl, "debugfs: add device txstatus OOM\n");
 		kfree(e);
 		return;
 	}
@@ -471,10 +471,10 @@ void b43_debugfs_add_device(struct b43_w
 	e->subdir = debugfs_create_dir(devdir, fs.root);
 	if (!e->subdir || IS_ERR(e->subdir)) {
 		if (e->subdir == ERR_PTR(-ENODEV)) {
-			bcmdbg(dev->wl, "DebugFS (CONFIG_DEBUG_FS) not "
+			b43dbg(dev->wl, "DebugFS (CONFIG_DEBUG_FS) not "
 			       "enabled in kernel config\n");
 		} else {
-			bcmerr(dev->wl, "debugfs: cannot create %s directory\n",
+			b43err(dev->wl, "debugfs: cannot create %s directory\n",
 			       devdir);
 		}
 		dev->dfsentry = NULL;
drivers/net/wireless/b43/debugfs.h +2 -2
Index: wireless-dev-new/drivers/net/wireless/b43/debugfs.h
===================================================================
@@ -92,7 +92,7 @@ static inline
 #endif
 #define TODO()  \
 	do {									\
-		bcminfo(NULL, "TODO: Incomplete code in %s() at %s:%d\n",	\
+		b43info(NULL, "TODO: Incomplete code in %s() at %s:%d\n",	\
 			__FUNCTION__, __FILE__, __LINE__);			\
 	} while (0)
 
@@ -101,7 +101,7 @@ static inline
 #endif
 #define FIXME()  \
 	do {									\
-		bcminfo(NULL, "FIXME: Possibly broken code in %s() at %s:%d\n",	\
+		b43info(NULL, "FIXME: Possibly broken code in %s() at %s:%d\n",	\
 			__FUNCTION__, __FILE__, __LINE__);			\
 	} while (0)
 
drivers/net/wireless/b43/dma.c +16 -16
Index: wireless-dev-new/drivers/net/wireless/b43/dma.c
===================================================================
@@ -258,7 +258,7 @@ static void update_max_used_slots(struct
 		return;
 	ring->max_used_slots = current_used_slots;
 	if (b43_debug(ring->dev, B43_DBG_DMAVERBOSE)) {
-		bcmdbg(ring->dev->wl,
+		b43dbg(ring->dev->wl,
 		       "max_used_slots increased to %d on %s ring %d\n",
 		       ring->max_used_slots,
 		       ring->tx ? "TX" : "RX", ring->index);
@@ -430,7 +430,7 @@ static int alloc_ringmemory(struct b43_d
 	ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE,
 					    &(ring->dmabase), GFP_KERNEL);
 	if (!ring->descbase) {
-		bcmerr(ring->dev->wl, "DMA ringmemory allocation failed\n");
+		b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
 		return -ENOMEM;
 	}
 	memset(ring->descbase, 0, B43_DMA_RINGMEMSIZE);
@@ -476,7 +476,7 @@ int b43_dmacontroller_rx_reset(struct b4
 		msleep(1);
 	}
 	if (i != -1) {
-		bcmerr(dev->wl, "DMA RX reset timed out\n");
+		b43err(dev->wl, "DMA RX reset timed out\n");
 		return -ENODEV;
 	}
 
@@ -531,7 +531,7 @@ int b43_dmacontroller_tx_reset(struct b4
 		msleep(1);
 	}
 	if (i != -1) {
-		bcmerr(dev->wl, "DMA TX reset timed out\n");
+		b43err(dev->wl, "DMA TX reset timed out\n");
 		return -ENODEV;
 	}
 	/* ensure the reset is completed. */
@@ -600,7 +600,7 @@ static int alloc_initial_descbuffers(str
 
 		err = setup_rx_descbuffer(ring, desc, meta, GFP_KERNEL);
 		if (err) {
-			bcmerr(ring->dev->wl,
+			b43err(ring->dev->wl,
 			       "Failed to allocate initial descbuffers\n");
 			goto err_unwind;
 		}
@@ -883,7 +883,7 @@ static void b43_destroy_dmaring(struct b
 	if (!ring)
 		return;
 
-	bcmdbg(ring->dev->wl, "DMA-%s 0x%04X (%s) max used slots: %d/%d\n",
+	b43dbg(ring->dev->wl, "DMA-%s 0x%04X (%s) max used slots: %d/%d\n",
 	       (ring->dma64) ? "64" : "32",
 	       ring->mmio_base,
 	       (ring->tx) ? "TX" : "RX", ring->max_used_slots, ring->nr_slots);
@@ -941,12 +941,12 @@ int b43_dma_init(struct b43_wldev *dev)
 	err = ssb_dma_set_mask(dev->dev, dmamask);
 	if (err) {
 #ifdef B43_PIO
-		bcmwarn(dev->wl, "DMA for this device not supported. "
+		b43warn(dev->wl, "DMA for this device not supported. "
 			"Falling back to PIO\n");
 		dev->__using_pio = 1;
 		return -EAGAIN;
 #else
-		bcmerr(dev->wl, "DMA for this device not supported and "
+		b43err(dev->wl, "DMA for this device not supported and "
 		       "no PIO support compiled in\n");
 		return -EOPNOTSUPP;
 #endif
@@ -997,7 +997,7 @@ int b43_dma_init(struct b43_wldev *dev)
 		dma->rx_ring3 = ring;
 	}
 
-	bcmdbg(dev->wl, "%d-bit DMA initialized\n",
+	b43dbg(dev->wl, "%d-bit DMA initialized\n",
 	       (dmamask == DMA_64BIT_MASK) ? 64 :
 	       (dmamask == DMA_32BIT_MASK) ? 32 : 30);
 	err = 0;
@@ -1188,7 +1188,7 @@ static inline int should_inject_overflow
 		next_overflow = ring->last_injected_overflow + HZ;
 		if (time_after(jiffies, next_overflow)) {
 			ring->last_injected_overflow = jiffies;
-			bcmdbg(ring->dev->wl,
+			b43dbg(ring->dev->wl,
 			       "Injecting TX ring overflow on "
 			       "DMA controller %d\n", ring->index);
 			return 1;
@@ -1209,7 +1209,7 @@ int b43_dma_tx(struct b43_wldev *dev,
 	spin_lock_irqsave(&ring->lock, flags);
 	B43_WARN_ON(!ring->tx);
 	if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) {
-		bcmwarn(dev->wl, "DMA queue overflow\n");
+		b43warn(dev->wl, "DMA queue overflow\n");
 		err = -ENOSPC;
 		goto out_unlock;
 	}
@@ -1220,7 +1220,7 @@ int b43_dma_tx(struct b43_wldev *dev,
 
 	err = dma_tx_fragment(ring, skb, ctl);
 	if (unlikely(err)) {
-		bcmerr(dev->wl, "DMA tx mapping failure\n");
+		b43err(dev->wl, "DMA tx mapping failure\n");
 		goto out_unlock;
 	}
 	ring->nr_tx_packets++;
@@ -1230,7 +1230,7 @@ int b43_dma_tx(struct b43_wldev *dev,
 		ieee80211_stop_queue(dev->wl->hw, txring_to_priority(ring));
 		ring->stopped = 1;
 		if (b43_debug(dev, B43_DBG_DMAVERBOSE)) {
-			bcmdbg(dev->wl, "Stopped TX ring %d\n", ring->index);
+			b43dbg(dev->wl, "Stopped TX ring %d\n", ring->index);
 		}
 	}
       out_unlock:
@@ -1309,7 +1309,7 @@ void b43_dma_handle_txstatus(struct b43_
 		ieee80211_wake_queue(dev->wl->hw, txring_to_priority(ring));
 		ring->stopped = 0;
 		if (b43_debug(dev, B43_DBG_DMAVERBOSE)) {
-			bcmdbg(dev->wl, "Woke up TX ring %d\n", ring->index);
+			b43dbg(dev->wl, "Woke up TX ring %d\n", ring->index);
 		}
 	}
 
@@ -1409,7 +1409,7 @@ static void dma_rx(struct b43_dmaring *r
 			if (tmp <= 0)
 				break;
 		}
-		bcmerr(ring->dev->wl, "DMA RX buffer too small "
+		b43err(ring->dev->wl, "DMA RX buffer too small "
 		       "(len: %u, buffer: %u, nr-dropped: %d)\n",
 		       len, ring->rx_buffersize, cnt);
 		goto drop;
@@ -1418,7 +1418,7 @@ static void dma_rx(struct b43_dmaring *r
 	dmaaddr = meta->dmaaddr;
 	err = setup_rx_descbuffer(ring, desc, meta, GFP_ATOMIC);
 	if (unlikely(err)) {
-		bcmdbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n");
+		b43dbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n");
 		sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize);
 		goto drop;
 	}
drivers/net/wireless/b43/lo.c +5 -5
Index: wireless-dev-new/drivers/net/wireless/b43/lo.c
===================================================================
@@ -44,7 +44,7 @@ static void b43_lo_write(struct b43_wlde
 
 	if (B43_DEBUG) {
 		if (unlikely(abs(control->i) > 16 || abs(control->q) > 16)) {
-			bcmdbg(dev->wl, "Invalid LO control pair "
+			b43dbg(dev->wl, "Invalid LO control pair "
 			       "(I: %d, Q: %d)\n", control->i, control->q);
 			dump_stack();
 			return;
@@ -66,11 +66,11 @@ static int assert_rfatt_and_bbatt(const 
 
 	/* Check the attenuation values against the LO control array sizes. */
 	if (unlikely(rfatt->att >= B43_NR_RF)) {
-		bcmerr(dev->wl, "rfatt(%u) >= size of LO array\n", rfatt->att);
+		b43err(dev->wl, "rfatt(%u) >= size of LO array\n", rfatt->att);
 		err = -EINVAL;
 	}
 	if (unlikely(bbatt->att >= B43_NR_BB)) {
-		bcmerr(dev->wl, "bbatt(%u) >= size of LO array\n", bbatt->att);
+		b43err(dev->wl, "bbatt(%u) >= size of LO array\n", bbatt->att);
 		err = -EINVAL;
 	}
 
@@ -1038,7 +1038,7 @@ static void do_validate_loctl(struct b43
 
 	return;
 error:
-	bcmerr(dev->wl, "LO control pair validation failed "
+	b43err(dev->wl, "LO control pair validation failed "
 	       "(I: %d, Q: %d, used %u, calib: %u, initing: %d)\n",
 	       i, q, control->used,
 	       b43_loctl_is_calibrated(control),
@@ -1103,7 +1103,7 @@ static void validate_loctl_calibration(s
 		 * calibrated the LO. I guess that's OK. */
 		return;
 	}
-	bcmerr(dev->wl, "Adjusting Local Oscillator to an uncalibrated "
+	b43err(dev->wl, "Adjusting Local Oscillator to an uncalibrated "
 	       "control pair: rfatt=%u,%spadmix bbatt=%u\n",
 	       rfatt->att,
 	       (rfatt->with_padmix) ? "" : "no-",
drivers/net/wireless/b43/main.c +55 -55

419 lines not on this page · raw message

drivers/net/wireless/b43/phy.c +11 -11
Index: wireless-dev-new/drivers/net/wireless/b43/phy.c
===================================================================
@@ -275,7 +275,7 @@ static inline u16 adjust_phyreg_for_phyt
 	if (offset & B43_PHYROUTE_EXT_GPHY) {
 		/* Ext-G registers are only available on G-PHYs */
 		if (phy->type != B43_PHYTYPE_G) {
-			bcmdbg(dev->wl, "EXT-G PHY access at "
+			b43dbg(dev->wl, "EXT-G PHY access at "
 			       "0x%04X on %u type PHY\n", offset, phy->type);
 		}
 	}
@@ -327,7 +327,7 @@ void b43_set_txpower_g(struct b43_wldev 
 	memcpy(&phy->bbatt, bbatt, sizeof(*bbatt));
 
 	if (b43_debug(dev, B43_DBG_XMITPOWER)) {
-		bcmdbg(dev->wl, "Tuning TX-power to bbatt(%u), "
+		b43dbg(dev->wl, "Tuning TX-power to bbatt(%u), "
 		       "rfatt(%u), tx_control(0x%02X), "
 		       "tx_bias(0x%02X), tx_magn(0x%02X)\n",
 		       bb, rf, tx_control, tx_bias, tx_magn);
@@ -741,7 +741,7 @@ static void b43_phy_init_pctl(struct b43
 		if (B43_DEBUG) {
 			/* Current-Idle-TSSI sanity check. */
 			if (abs(phy->cur_idle_tssi - phy->tgt_idle_tssi) >= 20) {
-				bcmdbg(dev->wl,
+				b43dbg(dev->wl,
 				       "!WARNING! Idle-TSSI phy->cur_idle_tssi "
 				       "measuring failed. (cur=%d, tgt=%d). Disabling TX power "
 				       "adjustment.\n", phy->cur_idle_tssi,
@@ -2047,7 +2047,7 @@ void b43_phy_xmitpower(struct b43_wldev 
 			    && (phy->type == B43_PHYTYPE_G))
 				max_pwr -= 0x3;
 			if (unlikely(max_pwr <= 0)) {
-				bcmwarn(dev->wl,
+				b43warn(dev->wl,
 					"Invalid max-TX-power value in SPROM.\n");
 				max_pwr = 60;	/* fake it */
 				dev->dev->bus->sprom.r1.maxpwr_bg = max_pwr;
@@ -2063,7 +2063,7 @@ void b43_phy_xmitpower(struct b43_wldev 
 			/* And limit it. max_pwr already is Q5.2 */
 			desired_pwr = limit_value(desired_pwr, 0, max_pwr);
 			if (b43_debug(dev, B43_DBG_XMITPOWER)) {
-				bcmdbg(dev->wl,
+				b43dbg(dev->wl,
 				       "Current TX power output: " Q52_FMT
 				       " dBm, " "Desired TX power output: "
 				       Q52_FMT " dBm\n", Q52_ARG(estimated_pwr),
@@ -2219,7 +2219,7 @@ int b43_phy_init_tssi2dbm_table(struct b
 		}
 		dyn_tssi2dbm = kmalloc(64, GFP_KERNEL);
 		if (dyn_tssi2dbm == NULL) {
-			bcmerr(dev->wl, "Could not allocate memory"
+			b43err(dev->wl, "Could not allocate memory"
 			       "for tssi2dbm table\n");
 			return -ENOMEM;
 		}
@@ -2227,7 +2227,7 @@ int b43_phy_init_tssi2dbm_table(struct b
 			if (b43_tssi2dbm_entry
 			    (dyn_tssi2dbm, idx, pab0, pab1, pab2)) {
 				phy->tssi2dbm = NULL;
-				bcmerr(dev->wl, "Could not generate "
+				b43err(dev->wl, "Could not generate "
 				       "tssi2dBm table\n");
 				kfree(dyn_tssi2dbm);
 				return -ENODEV;
@@ -2240,7 +2240,7 @@ int b43_phy_init_tssi2dbm_table(struct b
 		case B43_PHYTYPE_A:
 			/* APHY needs a generated table. */
 			phy->tssi2dbm = NULL;
-			bcmerr(dev->wl, "Could not generate tssi2dBm "
+			b43err(dev->wl, "Could not generate tssi2dBm "
 			       "table (wrong SPROM info)!\n");
 			return -ENODEV;
 		case B43_PHYTYPE_B:
@@ -2295,7 +2295,7 @@ int b43_phy_init(struct b43_wldev *dev)
 		break;
 	}
 	if (err)
-		bcmerr(dev->wl, "Unknown PHYTYPE found\n");
+		b43err(dev->wl, "Unknown PHYTYPE found\n");
 
 	return err;
 }
@@ -4329,7 +4329,7 @@ void b43_radio_turn_on(struct b43_wldev 
 		B43_WARN_ON(1);
 	}
 	phy->radio_on = 1;
-	bcmdbg(dev->wl, "Radio turned on\n");
+	b43dbg(dev->wl, "Radio turned on\n");
 }
 
 void b43_radio_turn_off(struct b43_wldev *dev)
@@ -4348,5 +4348,5 @@ void b43_radio_turn_off(struct b43_wldev
 	} else
 		b43_phy_write(dev, 0x0015, 0xAA00);
 	phy->radio_on = 0;
-	bcmdbg(dev->wl, "Radio turned off\n");
+	b43dbg(dev->wl, "Radio turned off\n");
 }
drivers/net/wireless/b43/pio.c +6 -6
Index: wireless-dev-new/drivers/net/wireless/b43/pio.c
===================================================================
@@ -210,7 +210,7 @@ static int pio_tx_packet(struct b43_pio_
 
 	octets = (u16) skb->len + sizeof(struct b43_txhdr_fw4);
 	if (queue->tx_devq_size < octets) {
-		bcmwarn(queue->dev->wl, "PIO queue too small. "
+		b43warn(queue->dev->wl, "PIO queue too small. "
 			"Dropping packet.\n");
 		/* Drop it silently (return success) */
 		free_txpacket(packet);
@@ -316,13 +316,13 @@ struct b43_pioqueue *b43_setup_pioqueue(
 
 	qsize = b43_read16(dev, queue->mmio_base + B43_PIO_TXQBUFSIZE);
 	if (qsize == 0) {
-		bcmerr(dev->wl, "This card does not support PIO "
+		b43err(dev->wl, "This card does not support PIO "
 		       "operation mode. Please use DMA mode "
 		       "(module parameter pio=0).\n");
 		goto err_freequeue;
 	}
 	if (qsize <= B43_PIO_TXQADJUST) {
-		bcmerr(dev->wl, "PIO tx device-queue too small (%u)\n", qsize);
+		b43err(dev->wl, "PIO tx device-queue too small (%u)\n", qsize);
 		goto err_freequeue;
 	}
 	qsize -= B43_PIO_TXQADJUST;
@@ -407,7 +407,7 @@ int b43_pio_init(struct b43_wldev *dev)
 	if (dev->dev->id.revision < 3)
 		dev->irq_savedstate |= B43_IRQ_PIO_WORKAROUND;
 
-	bcmdbg(dev->wl, "PIO initialized\n");
+	b43dbg(dev->wl, "PIO initialized\n");
 	err = 0;
       out:
 	return err;
@@ -505,7 +505,7 @@ static void pio_rx_error(struct b43_pioq
 {
 	int i;
 
-	bcmerr(queue->dev->wl, "PIO RX error: %s\n", error);
+	b43err(queue->dev->wl, "PIO RX error: %s\n", error);
 	b43_pio_write(queue, B43_PIO_RXCTL, B43_PIO_RXCTL_READY);
 	if (clear_buffers) {
 		B43_WARN_ON(queue->mmio_base != B43_MMIO_PIO1_BASE);
@@ -535,7 +535,7 @@ void b43_pio_rx(struct b43_pioqueue *que
 			goto data_ready;
 		udelay(10);
 	}
-	bcmdbg(queue->dev->wl, "PIO RX timed out\n");
+	b43dbg(queue->dev->wl, "PIO RX timed out\n");
 	return;
       data_ready:
 
drivers/net/wireless/b43/sysfs.c +1 -1
Index: wireless-dev-new/drivers/net/wireless/b43/sysfs.c
===================================================================
@@ -141,7 +141,7 @@ static ssize_t b43_attr_interfmode_store
 
 	err = b43_radio_set_interference_mitigation(wldev, mode);
 	if (err) {
-		bcmerr(wldev->wl, "Interference Mitigation not "
+		b43err(wldev->wl, "Interference Mitigation not "
 		       "supported by device\n");
 	}
 	mmiowb();
drivers/net/wireless/b43/xmit.c +5 -5
Index: wireless-dev-new/drivers/net/wireless/b43/xmit.c
===================================================================
@@ -472,14 +472,14 @@ void b43_rx(struct b43_wldev *dev, struc
 	/* Skip PLCP and padding */
 	padding = (macstat & B43_RX_MAC_PADDING) ? 2 : 0;
 	if (unlikely(skb->len < (sizeof(struct b43_plcp_hdr6) + padding))) {
-		bcmdbg(dev->wl, "RX: Packet size underrun (1)\n");
+		b43dbg(dev->wl, "RX: Packet size underrun (1)\n");
 		goto drop;
 	}
 	plcp = (struct b43_plcp_hdr6 *)(skb->data + padding);
 	skb_pull(skb, sizeof(struct b43_plcp_hdr6) + padding);
 	/* The skb contains the Wireless Header + payload data now */
 	if (unlikely(skb->len < (2 + 2 + 6 /*minimum hdr */  + FCS_LEN))) {
-		bcmdbg(dev->wl, "RX: Packet size underrun (2)\n");
+		b43dbg(dev->wl, "RX: Packet size underrun (2)\n");
 		goto drop;
 	}
 	wlhdr = (struct ieee80211_hdr *)(skb->data);
@@ -508,7 +508,7 @@ void b43_rx(struct b43_wldev *dev, struc
 
 			wlhdr_len = ieee80211_get_hdrlen(fctl);
 			if (unlikely(skb->len < (wlhdr_len + 3))) {
-				bcmdbg(dev->wl,
+				b43dbg(dev->wl,
 				       "RX: Packet size underrun (3)\n");
 				goto drop;
 			}
@@ -523,7 +523,7 @@ void b43_rx(struct b43_wldev *dev, struc
 				icv_len = 4;
 			}
 			if (unlikely(skb->len < (wlhdr_len + iv_len + icv_len))) {
-				bcmdbg(dev->wl,
+				b43dbg(dev->wl,
 				       "RX: Packet size underrun (4)\n");
 				goto drop;
 			}
@@ -577,7 +577,7 @@ void b43_rx(struct b43_wldev *dev, struc
 
 	return;
       drop:
-	bcmdbg(dev->wl, "RX: Packet dropped\n");
+	b43dbg(dev->wl, "RX: Packet dropped\n");
 	dev_kfree_skb_any(skb);
 }
 
#4 lore raw

PATCH 4/6 b43: Update Kconfig help text

In reply to Michael Buesch

From: Larry Finger <[email protected]>

The help text in Kconfig for b43 is updated to indicate the devices that it does not support and to note that it can coexist with b43legacy.

drivers/net/wireless/b43/Kconfig +10 -1
Index: wireless-dev-new/drivers/net/wireless/b43/Kconfig
===================================================================
@@ -6,7 +6,16 @@ config B43
 	select HW_RANDOM
 	---help---
 	  This is an experimental driver for the Broadcom 43xx wireless chip,
-	  found in the Apple Airport Extreme and various other devices.
+	  found in the Apple Airport Extreme and various other devices. This
+	  driver supports 802.11a and 802.11g, but not 802.11b. As a result,
+	  BCM4301 and BCM4303 are not supported - use b43legacy instead.
+	  It is safe to include both b43 and b43legacy as the ssb driver will
+	  load the correct version for your device.
+
+	  This driver uses V4 firmware, which must be installed separately using
+	  b43-fwcutter.
+
+	  This driver can be built as a module (recommended) that will be called "b43".
 
 # Auto-select SSB PCI-HOST support, if possible
 config B43_PCI_AUTOSELECT
#5 lore raw

PATCH 5/6 b43: Use new firmware file naming scheme

In reply to Michael Buesch

Use a sane firmware file naming scheme and also move the firmware files into a subdir.
This avoids conflicts with bcm43xx and b43legacy.

drivers/net/wireless/b43/b43.h +7 -7
Index: wireless-dev-new/drivers/net/wireless/b43/b43.h
===================================================================
@@ -406,9 +406,9 @@ struct b43_dmaring;
 struct b43_pioqueue;
 
 struct b43_initval {
-	u16 offset;
-	u16 size;
-	u32 value;
+	__be16 offset;
+	__be16 size;
+	__be32 value;
 } __attribute__ ((__packed__));
 
 #define B43_PHYMODE(phytype)		(1 << (phytype))
@@ -609,10 +609,10 @@ struct b43_firmware {
 	const struct firmware *ucode;
 	/* PCM code */
 	const struct firmware *pcm;
-	/* Initial MMIO values 0 */
-	const struct firmware *initvals0;
-	/* Initial MMIO values 1 */
-	const struct firmware *initvals1;
+	/* Initial MMIO values for the firmware */
+	const struct firmware *initvals;
+	/* Initial MMIO values for the firmware, band-specific */
+	const struct firmware *initvals_band;
 	/* Firmware revision */
 	u16 rev;
 	/* Firmware patchlevel */
drivers/net/wireless/b43/main.c +154 -135

349 lines not on this page · raw message

#6 lore raw

PATCH 6/6 b43: New firmware file format

In reply to Michael Buesch
drivers/net/wireless/b43/b43.h +26 -5
Index: wireless-dev-new/drivers/net/wireless/b43/b43.h
===================================================================
@@ -405,11 +405,32 @@ enum {
 struct b43_dmaring;
 struct b43_pioqueue;
 
-struct b43_initval {
-	__be16 offset;
-	__be16 size;
-	__be32 value;
-} __attribute__ ((__packed__));
+/* The firmware file header */
+#define B43_FW_TYPE_UCODE	'u'
+#define B43_FW_TYPE_PCM		'p'
+#define B43_FW_TYPE_IV		'i'
+struct b43_fw_header {
+	/* File type */
+	u8 type;
+	/* File format version */
+	u8 ver;
+	u8 __padding[2];
+	/* Size of the data. For ucode and PCM this is in bytes.
+	 * For IV this is number-of-ivs. */
+	__be32 size;
+} __attribute__((__packed__));
+
+/* Initial Value file format */
+#define B43_IV_OFFSET_MASK	0x7FFF
+#define B43_IV_32BIT		0x8000
+struct b43_iv {
+	__be16 offset_size;
+	union {
+		__be16 d16;
+		__be32 d32;
+	} data __attribute__((__packed__));
+} __attribute__((__packed__));
+
 
 #define B43_PHYMODE(phytype)		(1 << (phytype))
 #define B43_PHYMODE_A			B43_PHYMODE(B43_PHYTYPE_A)
drivers/net/wireless/b43/main.c +97 -35

201 lines not on this page · raw message

maintainer
#7 lore raw

Re: [patch 6/6] b43: New firmware file format

drivers/net/wireless/b43/main.c static int do_request_fw(struct b43_wlde · line 1602

Quoted 3 lines · Michael Buesch
drivers/net/wireless/b43/main.c +0 -0
@@ -1598,8 +1601,29 @@ static int do_request_fw(struct b43_wlde
 		b43err(dev->wl, "Firmware file \"%s\" not found "
 		       "or load failed.\n", path);

+ return err;

drivers/net/wireless/b43/main.c static int do_request_fw(struct b43_wlde · line 1605

Quoted 3 lines
drivers/net/wireless/b43/main.c +2 -0
 	}
+	if ((*fw)->size < sizeof(struct b43_fw_header))
+		goto err_format;

otherwise it oopses when the file can't be loaded.

johannes

#8 lore raw

Re: [patch 6/6] b43: New firmware file format

Quoted 8 lines · Johannes Berg
Quoted 3 lines · Michael Buesch
(quoted diff) +0 -0
@@ -1598,8 +1601,29 @@ static int do_request_fw(struct b43_wlde
 		b43err(dev->wl, "Firmware file \"%s\" not found "
 		       "or load failed.\n", path);
(quoted diff) +1 -0
+		return err;
Quoted 5 lines

Review static int do_request_fw(struct b43_wlde · line 1605

Quoted 3 lines
(quoted diff) +2 -0
 	}
+	if ((*fw)->size < sizeof(struct b43_fw_header))
+		goto err_format;

otherwise it oopses when the file can't be loaded.

ACK...here is a patch, in case you are lazy... :-)

drivers/net/wireless/b43/main.c +1 -0
index dcf7edc..d8693cf 100644
@@ -1600,6 +1600,7 @@ static int do_request_fw(struct b43_wldev *dev,
 	if (err) {
 		b43err(dev->wl, "Firmware file \"%s\" not found "
 		       "or load failed.\n", path);
+		return err;
 	}
 	if ((*fw)->size < sizeof(struct b43_fw_header))
 		goto err_format;
Signature · 2 lines
John W. Linville
[email protected]
#9 lore raw

Re: [patch 6/6] b43: New firmware file format

Quoted 9 lines · On Tuesday 21 August 2007 22:13:36 John W. Linville wrote:
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Michael Buesch
drivers/net/wireless/b43/main.c +0 -0
@@ -1598,8 +1601,29 @@ static int do_request_fw(struct b43_wlde
 		b43err(dev->wl, "Firmware file \"%s\" not found "
 		       "or load failed.\n", path);
drivers/net/wireless/b43/main.c +1 -0
+		return err;
Quoted 7 lines
Quoted 5 lines

Review static int do_request_fw(struct b43_wlde · line 1605

Quoted 3 lines
(quoted diff) +2 -0
 	}
+	if ((*fw)->size < sizeof(struct b43_fw_header))
+		goto err_format;

otherwise it oopses when the file can't be loaded.

ACK...here is a patch, in case you are lazy... :-)

Whoops, thanks :)

Quoted 12 lines
drivers/net/wireless/b43/main.c +1 -0
index dcf7edc..d8693cf 100644
@@ -1600,6 +1600,7 @@ static int do_request_fw(struct b43_wldev *dev,
 	if (err) {
 		b43err(dev->wl, "Firmware file \"%s\" not found "
 		       "or load failed.\n", path);
+		return err;
 	}
 	if ((*fw)->size < sizeof(struct b43_fw_header))
 		goto err_format;
Signature · 1 line
Greetings Michael.
maintainer
#10 lore raw

Re: [patch 6/6] b43: New firmware file format

In reply to John W. Linville
Quoted 3 lines · John W. Linville
Quoted 1 line

otherwise it oopses when the file can't be loaded.

ACK...here is a patch, in case you are lazy... :-)

Any reason you didn't push this fix this along with the patch?

johannes

#11 lore raw

Re: [patch 6/6] b43: New firmware file format

Quoted 7 lines · On Thursday 23 August 2007 22:49:46 Johannes Berg wrote:
Quoted 3 lines · John W. Linville
Quoted 1 line

otherwise it oopses when the file can't be loaded.

ACK...here is a patch, in case you are lazy... :-)

Any reason you didn't push this fix this along with the patch?

Hm? This fix is on its way into the tree.

Signature · 1 line
Greetings Michael.
maintainer
#12 lore raw

Re: [patch 6/6] b43: New firmware file format

Quoted 10 lines · Michael Buesch
Quoted 7 lines · On Thursday 23 August 2007 22:49:46 Johannes Berg wrote:
Quoted 3 lines · John W. Linville
Quoted 1 line

otherwise it oopses when the file can't be loaded.

ACK...here is a patch, in case you are lazy... :-)

Any reason you didn't push this fix this along with the patch?

Hm? This fix is on its way into the tree.

Yeah, never mind.

johannes