rpms/kernel/devel linux-2.6-b43-rev-d.patch, NONE, 1.1 linux-2.6-rtl8180.patch, NONE, 1.1 linux-2.6-wireless-pending.patch, 1.11, 1.12 config-generic, 1.41, 1.42 kernel.spec, 1.249, 1.250 linux-2.6-at76.patch, 1.4, 1.5 linux-2.6-ath5k.patch, 1.5, 1.6 linux-2.6-wireless.patch, 1.11, 1.12 linux-2.6-zd1211rw-mac80211.patch, 1.5, 1.6 linux-2.6-bcm43xx-pci-neuter.patch, 1.2, NONE linux-2.6-drivers-ssb-debug-revision.patch, 1.1, NONE linux-2.6-rt2x00-updates.patch, 1.1, NONE

John W. Linville (linville) fedora-extras-commits at redhat.com
Wed Nov 21 20:06:49 UTC 2007


Author: linville

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17641

Modified Files:
	config-generic kernel.spec linux-2.6-at76.patch 
	linux-2.6-ath5k.patch linux-2.6-wireless.patch 
	linux-2.6-zd1211rw-mac80211.patch 
Added Files:
	linux-2.6-b43-rev-d.patch linux-2.6-rtl8180.patch 
	linux-2.6-wireless-pending.patch 
Removed Files:
	linux-2.6-bcm43xx-pci-neuter.patch 
	linux-2.6-drivers-ssb-debug-revision.patch 
	linux-2.6-rt2x00-updates.patch 
Log Message:
Resync wireless bits from upstream

linux-2.6-b43-rev-d.patch:

--- NEW FILE linux-2.6-b43-rev-d.patch ---
>From Larry.Finger at lwfinger.net Wed Nov 21 14:32:10 2007
Return-Path: <Larry.Finger at lwfinger.net>
Received: from hrndva-omtalb.mail.rr.com (hrndva-omtalb.mail.rr.com [71.74.56.123])
	by ra.tuxdriver.com (8.14.0/8.13.7) with ESMTP id lALJVxqi008841
	for <linville at tuxdriver.com>; Wed, 21 Nov 2007 14:32:10 -0500
Received: from localhost ([69.76.246.60]) by hrndva-omta02.mail.rr.com
          with SMTP
          id <20071121193154.VQJG9083.hrndva-omta02.mail.rr.com at localhost>;
          Wed, 21 Nov 2007 19:31:54 +0000
Date: Wed, 21 Nov 2007 13:31:53 -0600
From: Larry Finger <Larry.Finger at lwfinger.net>
To: John Linville <linville at tuxdriver.com>, Michael Buesch <mb at bu3sch.de>
Cc: Bcm43xx-dev at lists.berlios.de, linux-wireless at vger.kernel.org
Subject: [PATCH] b43: Changes to enable BCM4311 rev 02 with wireless core
 revision 13
Message-ID: <474487a9.9c54/m97tX72L4+l%Larry.Finger at lwfinger.net>
User-Agent: Heirloom mailx 12.2 01/07/07
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00 autolearn=ham
	version=3.1.8-gr1
X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on ra.tuxdriver.com
Status: RO
X-Status: A
Content-Length: 8397

The BCM94311MCG rev 02 chip has an 802.11 core with revision 13 and
has not been supported until now. The changes include the following:

(1) Add the 802.11 rev 13 device to the ssb_device_id table to load b43.
(2) Add PHY revision 9 to the supported list.
(3) Fix 64-bit addressing errors.
(4) Remove some magic numbers in the DMA setup.

The DMA implementation for this chip supports full 64-bit addressing with
one exception. Whenever the Descriptor Ring Buffer is in high memory, a
fatal DMA error occurs. This problem was not present in 2.6.24-rc2 due
to code to "Bias the placement of kernel pages at lower PFNs". When
commit 44048d70 reverted that code, the DMA error appeared. As a "fix",
use the GFP_DMA flag when allocating the buffer for 64-bit DMA. At present,
this problem is thought to arise from a hardware error. The present driver
allocates one ring buffer for RX and six for TX; however, only one of the
TX buffers is used. To minimize any system impact associated with using low
memory, this patch removes the allocation of the unused buffers.

This patch has been tested by Cédric Caumont <icare40 at hotmail.com>.

Signed-off-by: Larry Finger <Larry.Finger at lwfinger.net>
---

John,

This patch is intended for the everything branch of wireless-2.6.

Larry
---

 dma.c  |   86 ++++++++++++++++++++++++++++++++++-------------------------------
 main.c |    3 +-
 wa.c   |    1
 3 files changed, 49 insertions(+), 41 deletions(-)

Index: wireless-2.6/drivers/net/wireless/b43/dma.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/b43/dma.c
+++ wireless-2.6/drivers/net/wireless/b43/dma.c
@@ -165,7 +165,7 @@ static void op64_fill_descriptor(struct 
 	addrhi = (((u64) dmaaddr >> 32) & ~SSB_DMA_TRANSLATION_MASK);
 	addrext = (((u64) dmaaddr >> 32) & SSB_DMA_TRANSLATION_MASK)
 	    >> SSB_DMA_TRANSLATION_SHIFT;
-	addrhi |= ssb_dma_translation(ring->dev->dev);
+	addrhi |= (ssb_dma_translation(ring->dev->dev) << 1);
 	if (slot == ring->nr_slots - 1)
 		ctl0 |= B43_DMA64_DCTL0_DTABLEEND;
 	if (start)
@@ -426,9 +426,20 @@ static inline
 static int alloc_ringmemory(struct b43_dmaring *ring)
 {
 	struct device *dev = ring->dev->dev->dev;
+	gfp_t flags = GFP_KERNEL;
 
+	/* The specs call for 4K buffers for 30- and 32-bit DMA
+	 * and 8K buffers for 64-bit DMA; however, 4K is sufficient for
+	 * the latter as long as the buffer does not cross an 8K boundary.
+	 *
+	 * For unknown reasons - possibly a hardware error - the BCM4311 rev
+	 * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
+	 * which accounts for the GFP_DMA flag below.
+	 */
+	if (ring->dma64)
+		flags = GFP_DMA;
 	ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE,
-					    &(ring->dmabase), GFP_KERNEL);
+					    &(ring->dmabase), flags);
 	if (!ring->descbase) {
 		b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
 		return -ENOMEM;
@@ -483,7 +494,7 @@ int b43_dmacontroller_rx_reset(struct b4
 	return 0;
 }
 
-/* Reset the RX DMA channel */
+/* Reset the TX DMA channel */
 int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
 {
 	int i;
@@ -636,18 +647,12 @@ static int dmacontroller_setup(struct b4
 		if (ring->dma64) {
 			u64 ringbase = (u64) (ring->dmabase);
 
-			addrext = ((ringbase >> 32) & SSB_DMA_TRANSLATION_MASK)
-			    >> SSB_DMA_TRANSLATION_SHIFT;
-			value = B43_DMA64_TXENABLE;
-			value |= (addrext << B43_DMA64_TXADDREXT_SHIFT)
-			    & B43_DMA64_TXADDREXT_MASK;
-			b43_dma_write(ring, B43_DMA64_TXCTL, value);
+			b43_dma_write(ring, B43_DMA64_TXCTL,
+				      B43_DMA64_TXENABLE);
 			b43_dma_write(ring, B43_DMA64_TXRINGLO,
 				      (ringbase & 0xFFFFFFFF));
 			b43_dma_write(ring, B43_DMA64_TXRINGHI,
-				      ((ringbase >> 32) &
-				       ~SSB_DMA_TRANSLATION_MASK)
-				      | trans);
+				      (ringbase >> 32));
 		} else {
 			u32 ringbase = (u32) (ring->dmabase);
 
@@ -668,20 +673,15 @@ static int dmacontroller_setup(struct b4
 		if (ring->dma64) {
 			u64 ringbase = (u64) (ring->dmabase);
 
-			addrext = ((ringbase >> 32) & SSB_DMA_TRANSLATION_MASK)
-			    >> SSB_DMA_TRANSLATION_SHIFT;
-			value = (ring->frameoffset << B43_DMA64_RXFROFF_SHIFT);
-			value |= B43_DMA64_RXENABLE;
-			value |= (addrext << B43_DMA64_RXADDREXT_SHIFT)
-			    & B43_DMA64_RXADDREXT_MASK;
+			value = (ring->frameoffset << B43_DMA64_RXFROFF_SHIFT)
+				| B43_DMA64_RXENABLE;
 			b43_dma_write(ring, B43_DMA64_RXCTL, value);
 			b43_dma_write(ring, B43_DMA64_RXRINGLO,
 				      (ringbase & 0xFFFFFFFF));
 			b43_dma_write(ring, B43_DMA64_RXRINGHI,
-				      ((ringbase >> 32) &
-				       ~SSB_DMA_TRANSLATION_MASK)
-				      | trans);
-			b43_dma_write(ring, B43_DMA64_RXINDEX, 200);
+				      (ringbase >> 32));
+			b43_dma_write(ring, B43_DMA64_RXINDEX, ring->nr_slots *
+				      sizeof(struct b43_dmadesc64));
 		} else {
 			u32 ringbase = (u32) (ring->dmabase);
 
@@ -695,11 +695,12 @@ static int dmacontroller_setup(struct b4
 			b43_dma_write(ring, B43_DMA32_RXRING,
 				      (ringbase & ~SSB_DMA_TRANSLATION_MASK)
 				      | trans);
-			b43_dma_write(ring, B43_DMA32_RXINDEX, 200);
+			b43_dma_write(ring, B43_DMA32_RXINDEX, ring->nr_slots *
+				      sizeof(struct b43_dmadesc32));
 		}
 	}
 
-      out:
+out:
 	return err;
 }
 
@@ -954,19 +955,21 @@ int b43_dma_init(struct b43_wldev *dev)
 
 	err = -ENOMEM;
 	/* setup TX DMA channels. */
-	ring = b43_setup_dmaring(dev, 0, 1, dma64);
+	ring = b43_setup_dmaring(dev, 1, 1, dma64);
 	if (!ring)
 		goto out;
-	dma->tx_ring0 = ring;
+	dma->tx_ring1 = ring;
 
-	ring = b43_setup_dmaring(dev, 1, 1, dma64);
+	/* The driver only uses ring1 for TX - skip setup for the rest */
+#if 0
+	ring = b43_setup_dmaring(dev, 0, 1, dma64);
 	if (!ring)
-		goto err_destroy_tx0;
-	dma->tx_ring1 = ring;
+		goto err_destroy_tx1;
+	dma->tx_ring0 = ring;
 
 	ring = b43_setup_dmaring(dev, 2, 1, dma64);
 	if (!ring)
-		goto err_destroy_tx1;
+		goto err_destroy_tx0;
 	dma->tx_ring2 = ring;
 
 	ring = b43_setup_dmaring(dev, 3, 1, dma64);
@@ -983,6 +986,7 @@ int b43_dma_init(struct b43_wldev *dev)
 	if (!ring)
 		goto err_destroy_tx4;
 	dma->tx_ring5 = ring;
+#endif
 
 	/* setup RX DMA channels. */
 	ring = b43_setup_dmaring(dev, 0, 0, dma64);
@@ -1001,30 +1005,32 @@ int b43_dma_init(struct b43_wldev *dev)
 	       (dmamask == DMA_64BIT_MASK) ? 64 :
 	       (dmamask == DMA_32BIT_MASK) ? 32 : 30);
 	err = 0;
-      out:
+out:
 	return err;
 
-      err_destroy_rx0:
+err_destroy_rx0:
 	b43_destroy_dmaring(dma->rx_ring0);
 	dma->rx_ring0 = NULL;
-      err_destroy_tx5:
+err_destroy_tx5:
+#if 0
 	b43_destroy_dmaring(dma->tx_ring5);
 	dma->tx_ring5 = NULL;
-      err_destroy_tx4:
+err_destroy_tx4:
 	b43_destroy_dmaring(dma->tx_ring4);
 	dma->tx_ring4 = NULL;
-      err_destroy_tx3:
+err_destroy_tx3:
 	b43_destroy_dmaring(dma->tx_ring3);
 	dma->tx_ring3 = NULL;
-      err_destroy_tx2:
+err_destroy_tx2:
 	b43_destroy_dmaring(dma->tx_ring2);
 	dma->tx_ring2 = NULL;
-      err_destroy_tx1:
-	b43_destroy_dmaring(dma->tx_ring1);
-	dma->tx_ring1 = NULL;
-      err_destroy_tx0:
+err_destroy_tx0:
 	b43_destroy_dmaring(dma->tx_ring0);
 	dma->tx_ring0 = NULL;
+err_destroy_tx1:
+#endif
+	b43_destroy_dmaring(dma->tx_ring1);
+	dma->tx_ring1 = NULL;
 	goto out;
 }
 
Index: wireless-2.6/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/b43/main.c
+++ wireless-2.6/drivers/net/wireless/b43/main.c
@@ -93,6 +93,7 @@ static const struct ssb_device_id b43_ss
 	SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 7),
 	SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 9),
 	SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 10),
+	SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13),
 	SSB_DEVTABLE_END
 };
 
@@ -3064,7 +3065,7 @@ static int b43_phy_versioning(struct b43
 			unsupported = 1;
 		break;
 	case B43_PHYTYPE_G:
-		if (phy_rev > 8)
+		if (phy_rev > 9)
 			unsupported = 1;
 		break;
 	default:
Index: wireless-2.6/drivers/net/wireless/b43/wa.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/b43/wa.c
+++ wireless-2.6/drivers/net/wireless/b43/wa.c
@@ -642,6 +642,7 @@ void b43_wa_all(struct b43_wldev *dev)
 		case 6:
 		case 7:
 		case 8:
+		case 9:
 			b43_wa_tr_ltov(dev);
 			b43_wa_crs_ed(dev);
 			b43_wa_rssi_lt(dev);


linux-2.6-rtl8180.patch:

--- NEW FILE linux-2.6-rtl8180.patch ---
diff -up linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.23.noarch/drivers/net/wireless/Kconfig
--- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-11-21 14:22:57.000000000 -0500
+++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-11-21 14:23:21.000000000 -0500
@@ -552,6 +552,11 @@ config USB_ZD1201
 	  To compile this driver as a module, choose M here: the
 	  module will be called zd1201.
 
+config RTL8180
+	tristate "Realtek 8185 PCI support"
+	depends on MAC80211 && PCI && WLAN_80211 && EXPERIMENTAL
+	select EEPROM_93CX6
+
 config RTL8187
 	tristate "Realtek 8187 USB support"
 	depends on MAC80211 && USB && WLAN_80211 && EXPERIMENTAL
diff -up linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig linux-2.6.23.noarch/drivers/net/wireless/Makefile
--- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-11-21 14:22:57.000000000 -0500
+++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-11-21 14:23:21.000000000 -0500
@@ -49,7 +49,10 @@ obj-$(CONFIG_PCMCIA_WL3501)	+= wl3501_cs
 obj-$(CONFIG_USB_ZD1201)	+= zd1201.o
 obj-$(CONFIG_LIBERTAS)		+= libertas/
 
+rtl8180-objs		:= rtl8180_dev.o rtl8180_rtl8225.o
 rtl8187-objs		:= rtl8187_dev.o rtl8187_rtl8225.o
+
+obj-$(CONFIG_RTL8180)	+= rtl8180.o
 obj-$(CONFIG_RTL8187)	+= rtl8187.o
 
 obj-$(CONFIG_ADM8211)	+= adm8211.o
diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180_dev.c
--- /dev/null	2007-11-12 23:12:46.917997680 -0500
+++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180_dev.c	2007-11-21 14:23:21.000000000 -0500
@@ -0,0 +1,1019 @@
+
+/*
+ * Linux device driver for RTL8180 / RTL8185
+ *
+ * Copyright 2007 Michael Wu <flamingice at sourmilk.net>
+ * Copyright 2007 Andrea Merello <andreamrl at tiscali.it>
+ *
+ * Based on the r8180 driver, which is:
+ * Copyright 2004-2005 Andrea Merello <andreamrl at tiscali.it>, et al.
+ *
+ * Thanks to Realtek for their support!
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/delay.h>
+#include <linux/etherdevice.h>
+#include <linux/eeprom_93cx6.h>
+#include <net/mac80211.h>
+
+#include "rtl8180.h"
+#include "rtl8180_rtl8225.h"
+
+MODULE_AUTHOR("Michael Wu <flamingice at sourmilk.net>");
+MODULE_AUTHOR("Andrea Merello <andreamrl at tiscali.it>");
+MODULE_DESCRIPTION("RTL8180 / RTL8185 PCI wireless driver");
+MODULE_LICENSE("GPL");
+
+static struct pci_device_id rtl8180_table[] __devinitdata = {
+	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8185) },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(pci, rtl8180_table);
+
+void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data)
+{
+	struct rtl8180_priv *priv = dev->priv;
+	int i = 10;
+	u32 buf;
+
+	buf = (data << 8) | addr;
+
+	rtl818x_iowrite32(priv, (__le32 __iomem *)&priv->map->PHY[0], buf | 0x80);
+	while (i--) {
+		rtl818x_iowrite32(priv, (__le32 __iomem *)&priv->map->PHY[0], buf);
+		if (rtl818x_ioread8(priv, &priv->map->PHY[2]) == (data & 0xFF))
+			return;
+	}
+}
+
+static void rtl8180_handle_rx(struct ieee80211_hw *dev)
+{
+	struct rtl8180_priv *priv = dev->priv;
+	unsigned int count = 32;
+
+	while (count--) {
+		struct rtl8180_rx_desc *entry = &priv->rx_ring[priv->rx_idx];
+		struct sk_buff *skb = priv->rx_buf[priv->rx_idx];
+		u32 flags = le32_to_cpu(entry->flags);
+
+		if (flags & RTL8180_RX_DESC_FLAG_OWN)
+			return;
+
+		if (unlikely(flags & (RTL8180_RX_DESC_FLAG_DMA_FAIL |
+				      RTL8180_RX_DESC_FLAG_FOF |
+				      RTL8180_RX_DESC_FLAG_RX_ERR)))
+			goto done;
+		else {
+			u32 flags2 = le32_to_cpu(entry->flags2);
+			struct ieee80211_rx_status rx_status = {0};
+			struct sk_buff *new_skb = dev_alloc_skb(MAX_RX_SIZE);
+			int rate;
+
+			if (unlikely(!new_skb))
+				goto done;
+
+			pci_unmap_single(priv->pdev,
+					 *((dma_addr_t *)skb->cb),
+					 MAX_RX_SIZE, PCI_DMA_FROMDEVICE);
+			skb_put(skb, flags & 0xFFF);
+
+			rate = (flags >> 20) & 0xF;
+			rx_status.antenna = (flags2 >> 15) & 1;
+			/* TODO: improve signal/rssi reporting */
+			rx_status.signal = flags2 & 0xFF;
+			rx_status.ssi = (flags2 >> 8) & 0x7F;
+			rx_status.rate = priv->rates[rate].rate;
+			rx_status.freq = dev->conf.freq;
+			rx_status.channel = dev->conf.channel;
+			rx_status.phymode = dev->conf.phymode;
+			rx_status.mactime = le64_to_cpu(entry->tsft);
+			ieee80211_rx_irqsafe(dev, skb, &rx_status);
+
+			skb = new_skb;
+			priv->rx_buf[priv->rx_idx] = skb;
+			*((dma_addr_t *) skb->cb) =
+				pci_map_single(priv->pdev, skb_tail_pointer(skb),
+					       MAX_RX_SIZE, PCI_DMA_FROMDEVICE);
+		}
+
+	done:
+		entry->rx_buf = cpu_to_le32(*((dma_addr_t *)skb->cb));
+		entry->flags = cpu_to_le32(RTL8180_RX_DESC_FLAG_OWN |
+					   MAX_RX_SIZE);
+		if (priv->rx_idx == 31)
+			entry->flags |= cpu_to_le32(RTL8180_RX_DESC_FLAG_EOR);
+		priv->rx_idx = (priv->rx_idx + 1) % 32;
+	}
+}
+
+static void rtl8180_handle_tx(struct ieee80211_hw *dev, unsigned int prio)
+{
+	struct rtl8180_priv *priv = dev->priv;
+	struct rtl8180_tx_ring *ring = &priv->tx_ring[prio];
+
+	while (skb_queue_len(&ring->queue)) {
+		struct rtl8180_tx_desc *entry = &ring->desc[ring->idx];
+		struct sk_buff *skb;
+		struct ieee80211_tx_status status = { {0} };
+		struct ieee80211_tx_control *control;
+		u32 flags = le32_to_cpu(entry->flags);
+
+		if (flags & RTL8180_TX_DESC_FLAG_OWN)
+			return;
+
+		ring->idx = (ring->idx + 1) % ring->entries;
+		skb = __skb_dequeue(&ring->queue);
+		pci_unmap_single(priv->pdev, le32_to_cpu(entry->tx_buf),
+				 skb->len, PCI_DMA_TODEVICE);
+
+		control = *((struct ieee80211_tx_control **)skb->cb);
+		if (control)
+			memcpy(&status.control, control, sizeof(*control));
+		kfree(control);
+
+		if (!(status.control.flags & IEEE80211_TXCTL_NO_ACK)) {
+			if (flags & RTL8180_TX_DESC_FLAG_TX_OK)
+				status.flags = IEEE80211_TX_STATUS_ACK;
+			else
+				status.excessive_retries = 1;
+		}
+		status.retry_count = flags & 0xFF;
+
+		ieee80211_tx_status_irqsafe(dev, skb, &status);
+		if (ring->entries - skb_queue_len(&ring->queue) == 2)
+			ieee80211_wake_queue(dev, prio);
+	}
+}
+
+static irqreturn_t rtl8180_interrupt(int irq, void *dev_id)
+{
+	struct ieee80211_hw *dev = dev_id;
+	struct rtl8180_priv *priv = dev->priv;
+	u16 reg;
+
+	spin_lock(&priv->lock);
+	reg = rtl818x_ioread16(priv, &priv->map->INT_STATUS);
+	if (unlikely(reg == 0xFFFF)) {
+		spin_unlock(&priv->lock);
+		return IRQ_HANDLED;
+	}
[...1673 lines suppressed...]
+
+	rtl818x_iowrite8(priv, (u8 __iomem *)((void __iomem *)priv->map + 0x5B), 0x0D); msleep(1);
+
+	rtl8225z2_rf_set_tx_power(dev, 1);
+
+	/* RX antenna default to A */
+	rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1);	/* B: 0xDB */
+	rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1);	/* B: 0x10 */
+
+	rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03);	/* B: 0x00 */
+	msleep(1);
+	rtl818x_iowrite32(priv, (__le32 __iomem *)((void __iomem *)priv->map + 0x94), 0x15c00002);
+	rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF);
+}
+
+void rtl8225_rf_stop(struct ieee80211_hw *dev)
+{
+	struct rtl8180_priv *priv = dev->priv;
+	u8 reg;
+
+	rtl8225_write(dev, 0x4, 0x1f); msleep(1);
+
+	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
+	reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
+	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | RTL818X_CONFIG3_ANAPARAM_WRITE);
+	rtl818x_iowrite32(priv, &priv->map->ANAPARAM2, RTL8225_ANAPARAM2_OFF);
+	rtl818x_iowrite32(priv, &priv->map->ANAPARAM, RTL8225_ANAPARAM_OFF);
+	rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE);
+	rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
+}
+
+void rtl8225_rf_set_channel(struct ieee80211_hw *dev,
+			    struct ieee80211_conf *conf)
+{
+	struct rtl8180_priv *priv = dev->priv;
+
+	if (priv->rf_init == rtl8225_rf_init)
+		rtl8225_rf_set_tx_power(dev, conf->channel);
+	else
+		rtl8225z2_rf_set_tx_power(dev, conf->channel);
+
+	rtl8225_write(dev, 0x7, rtl8225_chan[conf->channel - 1]);
+	msleep(10);
+
+	if (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) {
+		rtl818x_iowrite8(priv, &priv->map->SLOT, 0x9);
+		rtl818x_iowrite8(priv, &priv->map->SIFS, 0x22);
+		rtl818x_iowrite8(priv, &priv->map->DIFS, 0x14);
+		rtl818x_iowrite8(priv, &priv->map->EIFS, 81);
+		rtl818x_iowrite8(priv, &priv->map->CW_VAL, 0x73);
+	} else {
+		rtl818x_iowrite8(priv, &priv->map->SLOT, 0x14);
+		rtl818x_iowrite8(priv, &priv->map->SIFS, 0x44);
+		rtl818x_iowrite8(priv, &priv->map->DIFS, 0x24);
+		rtl818x_iowrite8(priv, &priv->map->EIFS, 81);
+		rtl818x_iowrite8(priv, &priv->map->CW_VAL, 0xa5);
+	}
+}
diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/rtl8180.h
--- /dev/null	2007-11-12 23:12:46.917997680 -0500
+++ linux-2.6.23.noarch/drivers/net/wireless/rtl8180.h	2007-11-21 14:23:21.000000000 -0500
@@ -0,0 +1,138 @@
+#ifndef RTL8180_H
+#define RTL8180_H
+
+#include "rtl818x.h"
+
+#define MAX_RX_SIZE IEEE80211_MAX_RTS_THRESHOLD
+
+#define RF_PARAM_DIGPHY		(1 << 0)
+#define RF_PARAM_ANTBDEFAULT	(1 << 1)
+#define RF_PARAM_CARRIERSENSE1	(1 << 2)
+#define RF_PARAM_CARRIERSENSE2	(1 << 3)
+
+enum rtl8180_tx_desc_flags {
+	RTL8180_TX_DESC_FLAG_NO_ENC	= (1 << 15),
+	RTL8180_TX_DESC_FLAG_TX_OK	= (1 << 15),
+	RTL8180_TX_DESC_FLAG_SPLCP	= (1 << 16),
+	RTL8180_TX_DESC_FLAG_RX_UNDER	= (1 << 16),
+	RTL8180_TX_DESC_FLAG_MOREFRAG	= (1 << 17),
+	RTL8180_TX_DESC_FLAG_CTS	= (1 << 18),
+	RTL8180_TX_DESC_FLAG_RTS	= (1 << 23),
+	RTL8180_TX_DESC_FLAG_LS		= (1 << 28),
+	RTL8180_TX_DESC_FLAG_FS		= (1 << 29),
+	RTL8180_TX_DESC_FLAG_DMA	= (1 << 30),
+	RTL8180_TX_DESC_FLAG_OWN	= (1 << 31)
+};
+
+struct rtl8180_tx_desc {
+	__le32 flags;
+	__le16 rts_duration;
+	__le16 plcp_len;
+	__le32 tx_buf;
+	__le32 frame_len;
+	__le32 next_tx_desc;
+	u8 cw;
+	u8 retry_limit;
+	u8 agc;
+	u8 flags2;
+	u32 reserved[2];
+} __attribute__ ((packed));
+
+enum rtl8180_rx_desc_flags {
+	RTL8180_RX_DESC_FLAG_ICV_ERR	= (1 << 12),
+	RTL8180_RX_DESC_FLAG_CRC32_ERR	= (1 << 13),
+	RTL8180_RX_DESC_FLAG_PM		= (1 << 14),
+	RTL8180_RX_DESC_FLAG_RX_ERR	= (1 << 15),
+	RTL8180_RX_DESC_FLAG_BCAST	= (1 << 16),
+	RTL8180_RX_DESC_FLAG_PAM	= (1 << 17),
+	RTL8180_RX_DESC_FLAG_MCAST	= (1 << 18),
+	RTL8180_RX_DESC_FLAG_SPLCP	= (1 << 25),
+	RTL8180_RX_DESC_FLAG_FOF	= (1 << 26),
+	RTL8180_RX_DESC_FLAG_DMA_FAIL	= (1 << 27),
+	RTL8180_RX_DESC_FLAG_LS		= (1 << 28),
+	RTL8180_RX_DESC_FLAG_FS		= (1 << 29),
+	RTL8180_RX_DESC_FLAG_EOR	= (1 << 30),
+	RTL8180_RX_DESC_FLAG_OWN	= (1 << 31)
+};
+
+struct rtl8180_rx_desc {
+	__le32 flags;
+	__le32 flags2;
+	union {
+		__le32 rx_buf;
+		__le64 tsft;
+	};
+} __attribute__ ((packed));
+
+struct rtl8180_tx_ring {
+	struct rtl8180_tx_desc *desc;
+	dma_addr_t dma;
+	unsigned int idx;
+	unsigned int entries;
+	struct sk_buff_head queue;
+};
+
+struct rtl8180_priv {
+	/* common between rtl818x drivers */
+	struct rtl818x_csr __iomem *map;
+	void (*rf_init)(struct ieee80211_hw *);
+	void (*rf_stop)(struct ieee80211_hw *);
+	void (*rf_set_chan)(struct ieee80211_hw *, struct ieee80211_conf *);
+	int mode;
+	int if_id;
+
+	/* rtl8180 driver specific */
+	spinlock_t lock;
+	struct rtl8180_rx_desc *rx_ring;
+	dma_addr_t rx_ring_dma;
+	unsigned int rx_idx;
+	struct sk_buff *rx_buf[32];
+	struct rtl8180_tx_ring tx_ring[4];
+	struct ieee80211_channel channels[14];
+	struct ieee80211_rate rates[12];
+	struct ieee80211_hw_mode modes[2];
+	struct pci_dev *pdev;
+	u32 rx_conf;
+
+	int r8185;
+	u32 anaparam;
+	u16 rfparam;
+	u8 csthreshold;
+};
+
+void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);
+
+static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr)
+{
+	return ioread8(addr);
+}
+
+static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, __le16 __iomem *addr)
+{
+	return ioread16(addr);
+}
+
+static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, __le32 __iomem *addr)
+{
+	return ioread32(addr);
+}
+
+static inline void rtl818x_iowrite8(struct rtl8180_priv *priv,
+				    u8 __iomem *addr, u8 val)
+{
+	iowrite8(val, addr);
+}
+
+static inline void rtl818x_iowrite16(struct rtl8180_priv *priv,
+				     __le16 __iomem *addr, u16 val)
+{
+	iowrite16(val, addr);
+}
+
+static inline void rtl818x_iowrite32(struct rtl8180_priv *priv,
+				     __le32 __iomem *addr, u32 val)
+{
+	iowrite32(val, addr);
+}
+
+#endif /* RTL8180_H */

linux-2.6-wireless-pending.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.11 -r 1.12 linux-2.6-wireless-pending.patch
Index: linux-2.6-wireless-pending.patch
===================================================================
RCS file: linux-2.6-wireless-pending.patch
diff -N linux-2.6-wireless-pending.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ linux-2.6-wireless-pending.patch	21 Nov 2007 20:06:41 -0000	1.12
@@ -0,0 +1,46945 @@
+diff -up linux-2.6.23.noarch/drivers/ssb/b43_pci_bridge.c.orig linux-2.6.23.noarch/drivers/ssb/b43_pci_bridge.c
+--- linux-2.6.23.noarch/drivers/ssb/b43_pci_bridge.c.orig	2007-11-21 13:41:18.000000000 -0500
++++ linux-2.6.23.noarch/drivers/ssb/b43_pci_bridge.c	2007-11-21 14:05:54.000000000 -0500
+@@ -27,6 +27,7 @@ static const struct pci_device_id b43_pc
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4321) },
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
+ 	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4325) },
++	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4328) },
+ 	{ 0, },
+ };
+ MODULE_DEVICE_TABLE(pci, b43_pci_bridge_tbl);
+diff -up linux-2.6.23.noarch/drivers/ssb/pci.c.orig linux-2.6.23.noarch/drivers/ssb/pci.c
+--- linux-2.6.23.noarch/drivers/ssb/pci.c.orig	2007-11-21 13:41:18.000000000 -0500
++++ linux-2.6.23.noarch/drivers/ssb/pci.c	2007-11-21 14:05:54.000000000 -0500
+@@ -212,29 +212,29 @@ static inline u8 ssb_crc8(u8 crc, u8 dat
+ 	return t[crc ^ data];
+ }
+ 
+-static u8 ssb_sprom_crc(const u16 *sprom)
++static u8 ssb_sprom_crc(const u16 *sprom, u16 size)
+ {
+ 	int word;
+ 	u8 crc = 0xFF;
+ 
+-	for (word = 0; word < SSB_SPROMSIZE_WORDS - 1; word++) {
++	for (word = 0; word < size - 1; word++) {
+ 		crc = ssb_crc8(crc, sprom[word] & 0x00FF);
+ 		crc = ssb_crc8(crc, (sprom[word] & 0xFF00) >> 8);
+ 	}
+-	crc = ssb_crc8(crc, sprom[SPOFF(SSB_SPROM_REVISION)] & 0x00FF);
++	crc = ssb_crc8(crc, sprom[size - 1] & 0x00FF);
+ 	crc ^= 0xFF;
+ 
+ 	return crc;
+ }
+ 
+-static int sprom_check_crc(const u16 *sprom)
++static int sprom_check_crc(const u16 *sprom, u16 size)
+ {
+ 	u8 crc;
+ 	u8 expected_crc;
+ 	u16 tmp;
+ 
+-	crc = ssb_sprom_crc(sprom);
+-	tmp = sprom[SPOFF(SSB_SPROM_REVISION)] & SSB_SPROM_REVISION_CRC;
++	crc = ssb_sprom_crc(sprom, size);
++	tmp = sprom[size - 1] & SSB_SPROM_REVISION_CRC;
+ 	expected_crc = tmp >> SSB_SPROM_REVISION_CRC_SHIFT;
+ 	if (crc != expected_crc)
+ 		return -EPROTO;
+@@ -246,7 +246,7 @@ static void sprom_do_read(struct ssb_bus
+ {
+ 	int i;
+ 
+-	for (i = 0; i < SSB_SPROMSIZE_WORDS; i++)
++	for (i = 0; i < bus->sprom_size; i++)
+ 		sprom[i] = readw(bus->mmio + SSB_SPROM_BASE + (i * 2));
+ }
+ 
+@@ -255,6 +255,7 @@ static int sprom_do_write(struct ssb_bus
+ 	struct pci_dev *pdev = bus->host_pci;
+ 	int i, err;
+ 	u32 spromctl;
++	u16 size = bus->sprom_size;
+ 
+ 	ssb_printk(KERN_NOTICE PFX "Writing SPROM. Do NOT turn off the power! Please stand by...\n");
+ 	err = pci_read_config_dword(pdev, SSB_SPROMCTL, &spromctl);
+@@ -266,12 +267,12 @@ static int sprom_do_write(struct ssb_bus
+ 		goto err_ctlreg;
+ 	ssb_printk(KERN_NOTICE PFX "[ 0%%");
+ 	msleep(500);
+-	for (i = 0; i < SSB_SPROMSIZE_WORDS; i++) {
+-		if (i == SSB_SPROMSIZE_WORDS / 4)
++	for (i = 0; i < size; i++) {
++		if (i == size / 4)
+ 			ssb_printk("25%%");
+-		else if (i == SSB_SPROMSIZE_WORDS / 2)
++		else if (i == size / 2)
+ 			ssb_printk("50%%");
+-		else if (i == (SSB_SPROMSIZE_WORDS / 4) * 3)
++		else if (i == (size * 3) / 4)
+ 			ssb_printk("75%%");
+ 		else if (i % 2)
+ 			ssb_printk(".");
+@@ -296,38 +297,38 @@ err_ctlreg:
+ 	return err;
+ }
+ 
+-static void sprom_extract_r1(struct ssb_sprom_r1 *out, const u16 *in)
++static void sprom_extract_r123(struct ssb_sprom *out, const u16 *in)
+ {
+ 	int i;
+ 	u16 v;
++	u16 loc[3];
+ 
+-	SPEX(pci_spid, SSB_SPROM1_SPID, 0xFFFF, 0);
+-	SPEX(pci_svid, SSB_SPROM1_SVID, 0xFFFF, 0);
+-	SPEX(pci_pid, SSB_SPROM1_PID, 0xFFFF, 0);
++	if (out->revision == 3) {			/* rev 3 moved MAC */
++		loc[0] = SSB_SPROM3_IL0MAC;
++		loc[1] = SSB_SPROM3_ET0MAC;
++		loc[2] = SSB_SPROM3_ET1MAC;
++	} else {
++		loc[0] = SSB_SPROM1_IL0MAC;
++		loc[1] = SSB_SPROM1_ET0MAC;
++		loc[2] = SSB_SPROM1_ET1MAC;
++	}
+ 	for (i = 0; i < 3; i++) {
+-		v = in[SPOFF(SSB_SPROM1_IL0MAC) + i];
++		v = in[SPOFF(loc[0]) + i];
+ 		*(((__be16 *)out->il0mac) + i) = cpu_to_be16(v);
+ 	}
+ 	for (i = 0; i < 3; i++) {
+-		v = in[SPOFF(SSB_SPROM1_ET0MAC) + i];
++		v = in[SPOFF(loc[1]) + i];
+ 		*(((__be16 *)out->et0mac) + i) = cpu_to_be16(v);
+ 	}
+ 	for (i = 0; i < 3; i++) {
+-		v = in[SPOFF(SSB_SPROM1_ET1MAC) + i];
++		v = in[SPOFF(loc[2]) + i];
+ 		*(((__be16 *)out->et1mac) + i) = cpu_to_be16(v);
+ 	}
+ 	SPEX(et0phyaddr, SSB_SPROM1_ETHPHY, SSB_SPROM1_ETHPHY_ET0A, 0);
+ 	SPEX(et1phyaddr, SSB_SPROM1_ETHPHY, SSB_SPROM1_ETHPHY_ET1A,
+ 	     SSB_SPROM1_ETHPHY_ET1A_SHIFT);
+-	SPEX(et0mdcport, SSB_SPROM1_ETHPHY, SSB_SPROM1_ETHPHY_ET0M, 14);
+-	SPEX(et1mdcport, SSB_SPROM1_ETHPHY, SSB_SPROM1_ETHPHY_ET1M, 15);
+-	SPEX(board_rev, SSB_SPROM1_BINF, SSB_SPROM1_BINF_BREV, 0);
+ 	SPEX(country_code, SSB_SPROM1_BINF, SSB_SPROM1_BINF_CCODE,
+ 	     SSB_SPROM1_BINF_CCODE_SHIFT);
+-	SPEX(antenna_a, SSB_SPROM1_BINF, SSB_SPROM1_BINF_ANTA,
+-	     SSB_SPROM1_BINF_ANTA_SHIFT);
+-	SPEX(antenna_bg, SSB_SPROM1_BINF, SSB_SPROM1_BINF_ANTBG,
+-	     SSB_SPROM1_BINF_ANTBG_SHIFT);
+ 	SPEX(pa0b0, SSB_SPROM1_PA0B0, 0xFFFF, 0);
+ 	SPEX(pa0b1, SSB_SPROM1_PA0B1, 0xFFFF, 0);
+ 	SPEX(pa0b2, SSB_SPROM1_PA0B2, 0xFFFF, 0);
+@@ -350,97 +351,75 @@ static void sprom_extract_r1(struct ssb_
+ 	SPEX(antenna_gain_a, SSB_SPROM1_AGAIN, SSB_SPROM1_AGAIN_A, 0);
+ 	SPEX(antenna_gain_bg, SSB_SPROM1_AGAIN, SSB_SPROM1_AGAIN_BG,
+ 	     SSB_SPROM1_AGAIN_BG_SHIFT);
+-	for (i = 0; i < 4; i++) {
+-		v = in[SPOFF(SSB_SPROM1_OEM) + i];
+-		*(((__le16 *)out->oem) + i) = cpu_to_le16(v);
+-	}
+ }
+ 
+-static void sprom_extract_r2(struct ssb_sprom_r2 *out, const u16 *in)
++static void sprom_extract_r4(struct ssb_sprom *out, const u16 *in)
+ {
+ 	int i;
+ 	u16 v;
+ 
+-	SPEX(boardflags_hi, SSB_SPROM2_BFLHI,  0xFFFF, 0);
+-	SPEX(maxpwr_a_hi, SSB_SPROM2_MAXP_A, SSB_SPROM2_MAXP_A_HI, 0);
+-	SPEX(maxpwr_a_lo, SSB_SPROM2_MAXP_A, SSB_SPROM2_MAXP_A_LO,
+-	     SSB_SPROM2_MAXP_A_LO_SHIFT);
+-	SPEX(pa1lob0, SSB_SPROM2_PA1LOB0, 0xFFFF, 0);
+-	SPEX(pa1lob1, SSB_SPROM2_PA1LOB1, 0xFFFF, 0);
+-	SPEX(pa1lob2, SSB_SPROM2_PA1LOB2, 0xFFFF, 0);
+-	SPEX(pa1hib0, SSB_SPROM2_PA1HIB0, 0xFFFF, 0);
+-	SPEX(pa1hib1, SSB_SPROM2_PA1HIB1, 0xFFFF, 0);
+-	SPEX(pa1hib2, SSB_SPROM2_PA1HIB2, 0xFFFF, 0);
+-	SPEX(ofdm_pwr_off, SSB_SPROM2_OPO, SSB_SPROM2_OPO_VALUE, 0);
+-	for (i = 0; i < 4; i++) {
+-		v = in[SPOFF(SSB_SPROM2_CCODE) + i];
+-		*(((__le16 *)out->country_str) + i) = cpu_to_le16(v);
++	/* extract the equivalent of the r1 variables */
++	for (i = 0; i < 3; i++) {
++		v = in[SPOFF(SSB_SPROM4_IL0MAC) + i];
++		*(((__be16 *)out->il0mac) + i) = cpu_to_be16(v);
+ 	}
++	for (i = 0; i < 3; i++) {
++		v = in[SPOFF(SSB_SPROM4_ET0MAC) + i];
++		*(((__be16 *)out->et0mac) + i) = cpu_to_be16(v);
++	}
++	for (i = 0; i < 3; i++) {
++		v = in[SPOFF(SSB_SPROM4_ET1MAC) + i];
++		*(((__be16 *)out->et1mac) + i) = cpu_to_be16(v);
++	}
++	SPEX(et0phyaddr, SSB_SPROM4_ETHPHY, SSB_SPROM4_ETHPHY_ET0A, 0);
++	SPEX(et1phyaddr, SSB_SPROM4_ETHPHY, SSB_SPROM4_ETHPHY_ET1A,
++	     SSB_SPROM4_ETHPHY_ET1A_SHIFT);
++	SPEX(country_code, SSB_SPROM4_CCODE, 0xFFFF, 0);
++	SPEX(boardflags_lo, SSB_SPROM4_BFLLO, 0xFFFF, 0);
++	SPEX(antenna_gain_a, SSB_SPROM4_AGAIN, SSB_SPROM4_AGAIN_0, 0);
++	SPEX(antenna_gain_bg, SSB_SPROM4_AGAIN, SSB_SPROM4_AGAIN_1,
++	     SSB_SPROM4_AGAIN_1_SHIFT);
++	SPEX(maxpwr_bg, SSB_SPROM4_MAXP_BG, SSB_SPROM4_MAXP_BG_MASK, 0);
++	SPEX(itssi_bg, SSB_SPROM4_MAXP_BG, SSB_SPROM4_ITSSI_BG,
++	     SSB_SPROM4_ITSSI_BG_SHIFT);
++	SPEX(maxpwr_a, SSB_SPROM4_MAXP_A, SSB_SPROM4_MAXP_A_MASK, 0);
++	SPEX(itssi_a, SSB_SPROM4_MAXP_A, SSB_SPROM4_ITSSI_A,
[...46552 lines suppressed...]
++/* SPROM Revision 3 (inherits most data from rev 2) */
++#define SSB_SPROM3_IL0MAC		0x104A	/* 6 bytes MAC address for 802.11b/g */
++#define SSB_SPROM3_ET0MAC		0x1050	/* 6 bytes MAC address for Ethernet ?? */
++#define SSB_SPROM3_ET1MAC		0x1050	/* 6 bytes MAC address for 802.11a ?? */
+ #define SSB_SPROM3_OFDMAPO		0x102C	/* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */
+ #define SSB_SPROM3_OFDMALPO		0x1030	/* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */
+ #define SSB_SPROM3_OFDMAHPO		0x1034	/* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */
+@@ -251,6 +264,48 @@
+ #define  SSB_SPROM3_CCKPO_11M_SHIFT	12
+ #define  SSB_SPROM3_OFDMGPO		0x107A	/* G-PHY OFDM Power Offset (4 bytes, BigEndian) */
+ 
++/* SPROM Revision 4 		entries with ?? in comment are unknown */
++#define SSB_SPROM4_IL0MAC		0x104C	/* 6 byte MAC address for a/b/g/n */
++#define SSB_SPROM4_ET0MAC		0x1018	/* 6 bytes MAC address for Ethernet ?? */
++#define SSB_SPROM4_ET1MAC		0x1018	/* 6 bytes MAC address for 802.11a ?? */
++#define SSB_SPROM4_ETHPHY		0x105A	/* Ethernet PHY settings ?? */
++#define  SSB_SPROM4_ETHPHY_ET0A		0x001F	/* MII Address for enet0 */
++#define  SSB_SPROM4_ETHPHY_ET1A		0x03E0	/* MII Address for enet1 */
++#define  SSB_SPROM4_ETHPHY_ET1A_SHIFT	5
++#define  SSB_SPROM4_ETHPHY_ET0M		(1<<14)	/* MDIO for enet0 */
++#define  SSB_SPROM4_ETHPHY_ET1M		(1<<15)	/* MDIO for enet1 */
++#define SSB_SPROM4_CCODE		0x1052	/* Country Code (2 bytes) */
++#define SSB_SPROM4_ANT_A		0x105D  /* A Antennas */
++#define SSB_SPROM4_ANT_BG		0x105C  /* B/G Antennas */
++#define SSB_SPROM4_BFLLO		0x1044	/* Boardflags (low 16 bits) */
++#define SSB_SPROM4_AGAIN		0x105E	/* Antenna Gain (in dBm Q5.2) */
++#define  SSB_SPROM4_AGAIN_0		0x00FF	/* Antenna 0 */
++#define  SSB_SPROM4_AGAIN_1		0xFF00	/* Antenna 1 */
++#define  SSB_SPROM4_AGAIN_1_SHIFT	8
++#define SSB_SPROM4_BFLHI		0x1046  /* Board Flags Hi */
++#define SSB_SPROM4_MAXP_BG		0x1080  /* Max Power BG in path 1 */
++#define  SSB_SPROM4_MAXP_BG_MASK	0x00FF  /* Mask for Max Power BG */
++#define  SSB_SPROM4_ITSSI_BG		0xFF00	/* Mask for path 1 itssi_bg */
++#define  SSB_SPROM4_ITSSI_BG_SHIFT	8
++#define SSB_SPROM4_MAXP_A		0x108A  /* Max Power A in path 1 */
++#define  SSB_SPROM4_MAXP_A_MASK		0x00FF  /* Mask for Max Power A */
++#define  SSB_SPROM4_ITSSI_A		0xFF00	/* Mask for path 1 itssi_a */
++#define  SSB_SPROM4_ITSSI_A_SHIFT	8
++#define SSB_SPROM4_GPIOA		0x1056	/* Gen. Purpose IO # 0 and 1 */
++#define  SSB_SPROM4_GPIOA_P0		0x00FF	/* Pin 0 */
++#define  SSB_SPROM4_GPIOA_P1		0xFF00	/* Pin 1 */
++#define  SSB_SPROM4_GPIOA_P1_SHIFT	8
++#define SSB_SPROM4_GPIOB		0x1058	/* Gen. Purpose IO # 2 and 3 */
++#define  SSB_SPROM4_GPIOB_P2		0x00FF	/* Pin 2 */
++#define  SSB_SPROM4_GPIOB_P3		0xFF00	/* Pin 3 */
++#define  SSB_SPROM4_GPIOB_P3_SHIFT	8
++#define SSB_SPROM4_PA0B0		0x1082	/* The paXbY locations are */
++#define SSB_SPROM4_PA0B1		0x1084	/*   only guesses */
++#define SSB_SPROM4_PA0B2		0x1086
++#define SSB_SPROM4_PA1B0		0x108E
++#define SSB_SPROM4_PA1B1		0x1090
++#define SSB_SPROM4_PA1B2		0x1092
++
+ /* Values for SSB_SPROM1_BINF_CCODE */
+ enum {
+ 	SSB_SPROM1CCODE_WORLD = 0,
+diff -up linux-2.6.23.noarch/include/linux/ssb/ssb.h.orig linux-2.6.23.noarch/include/linux/ssb/ssb.h
+--- linux-2.6.23.noarch/include/linux/ssb/ssb.h.orig	2007-11-21 13:41:23.000000000 -0500
++++ linux-2.6.23.noarch/include/linux/ssb/ssb.h	2007-11-21 14:05:54.000000000 -0500
+@@ -15,22 +15,14 @@ struct pcmcia_device;
+ struct ssb_bus;
+ struct ssb_driver;
+ 
+-
+-struct ssb_sprom_r1 {
+-	u16 pci_spid;		/* Subsystem Product ID for PCI */
+-	u16 pci_svid;		/* Subsystem Vendor ID for PCI */
+-	u16 pci_pid;		/* Product ID for PCI */
++struct ssb_sprom {
++	u8 revision;
+ 	u8 il0mac[6];		/* MAC address for 802.11b/g */
+ 	u8 et0mac[6];		/* MAC address for Ethernet */
+ 	u8 et1mac[6];		/* MAC address for 802.11a */
+-	u8 et0phyaddr:5;	/* MII address for enet0 */
+-	u8 et1phyaddr:5;	/* MII address for enet1 */
+-	u8 et0mdcport:1;	/* MDIO for enet0 */
+-	u8 et1mdcport:1;	/* MDIO for enet1 */
+-	u8 board_rev;		/* Board revision */
+-	u8 country_code:4;	/* Country Code */
+-	u8 antenna_a:2;		/* Antenna 0/1 available for A-PHY */
+-	u8 antenna_bg:2;	/* Antenna 0/1 available for B-PHY and G-PHY */
++	u8 et0phyaddr;		/* MII address for enet0 */
++	u8 et1phyaddr;		/* MII address for enet1 */
++	u8 country_code;	/* Country Code */
+ 	u16 pa0b0;
+ 	u16 pa0b1;
+ 	u16 pa0b2;
+@@ -41,61 +33,15 @@ struct ssb_sprom_r1 {
+ 	u8 gpio1;		/* GPIO pin 1 */
+ 	u8 gpio2;		/* GPIO pin 2 */
+ 	u8 gpio3;		/* GPIO pin 3 */
+-	u16 maxpwr_a;		/* A-PHY Power Amplifier Max Power (in dBm Q5.2) */
+-	u16 maxpwr_bg;		/* B/G-PHY Power Amplifier Max Power (in dBm Q5.2) */
++	u16 maxpwr_a;		/* A-PHY Amplifier Max Power (in dBm Q5.2) */
++	u16 maxpwr_bg;		/* B/G-PHY Amplifier Max Power (in dBm Q5.2) */
+ 	u8 itssi_a;		/* Idle TSSI Target for A-PHY */
+ 	u8 itssi_bg;		/* Idle TSSI Target for B/G-PHY */
+ 	u16 boardflags_lo;	/* Boardflags (low 16 bits) */
+ 	u8 antenna_gain_a;	/* A-PHY Antenna gain (in dBm Q5.2) */
+ 	u8 antenna_gain_bg;	/* B/G-PHY Antenna gain (in dBm Q5.2) */
+-	u8 oem[8];		/* OEM string (rev 1 only) */
+-};
+-
+-struct ssb_sprom_r2 {
+-	u16 boardflags_hi;	/* Boardflags (high 16 bits) */
+-	u8 maxpwr_a_lo;		/* A-PHY Max Power Low */
+-	u8 maxpwr_a_hi;		/* A-PHY Max Power High */
+-	u16 pa1lob0;		/* A-PHY PA Low Settings */
+-	u16 pa1lob1;		/* A-PHY PA Low Settings */
+-	u16 pa1lob2;		/* A-PHY PA Low Settings */
+-	u16 pa1hib0;		/* A-PHY PA High Settings */
+-	u16 pa1hib1;		/* A-PHY PA High Settings */
+-	u16 pa1hib2;		/* A-PHY PA High Settings */
+-	u8 ofdm_pwr_off;	/* OFDM Power Offset from CCK Level */
+-	u8 country_str[2];	/* Two char Country Code */
+-};
+ 
+-struct ssb_sprom_r3 {
+-	u32 ofdmapo;		/* A-PHY OFDM Mid Power Offset */
+-	u32 ofdmalpo;		/* A-PHY OFDM Low Power Offset */
+-	u32 ofdmahpo;		/* A-PHY OFDM High Power Offset */
+-	u8 gpioldc_on_cnt;	/* GPIO LED Powersave Duty Cycle ON count */
+-	u8 gpioldc_off_cnt;	/* GPIO LED Powersave Duty Cycle OFF count */
+-	u8 cckpo_1M:4;		/* CCK Power Offset for Rate 1M */
+-	u8 cckpo_2M:4;		/* CCK Power Offset for Rate 2M */
+-	u8 cckpo_55M:4;		/* CCK Power Offset for Rate 5.5M */
+-	u8 cckpo_11M:4;		/* CCK Power Offset for Rate 11M */
+-	u32 ofdmgpo;		/* G-PHY OFDM Power Offset */
+-};
+-
+-struct ssb_sprom_r4 {
+-	/* TODO */
+-};
+-
+-struct ssb_sprom {
+-	u8 revision;
+-	u8 crc;
+-	/* The valid r# fields are selected by the "revision".
+-	 * Revision 3 and lower inherit from lower revisions.
+-	 */
+-	union {
+-		struct {
+-			struct ssb_sprom_r1 r1;
+-			struct ssb_sprom_r2 r2;
+-			struct ssb_sprom_r3 r3;
+-		};
+-		struct ssb_sprom_r4 r4;
+-	};
++	/* TODO - add any parameters needed from rev 2, 3, or 4 SPROMs */
+ };
+ 
+ /* Information about the PCB the circuitry is soldered on. */
+@@ -288,6 +234,7 @@ struct ssb_bus {
+ 	/* ID information about the Chip. */
+ 	u16 chip_id;
+ 	u16 chip_rev;
++	u16 sprom_size;		/* number of words in sprom */
+ 	u8 chip_package;
+ 
+ 	/* List of devices (cores) on the backplane. */
+diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
+--- linux-2.6.23.noarch/MAINTAINERS.orig	2007-11-21 13:40:21.000000000 -0500
++++ linux-2.6.23.noarch/MAINTAINERS	2007-11-21 14:05:54.000000000 -0500
+@@ -2029,10 +2029,12 @@ W:	http://sourceforge.net/projects/e1000
+ S:	Supported
+ 
+ INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
+-P:	Yi Zhu
++P:	Zhu Yi
+ M:	yi.zhu at intel.com
+ P:	James Ketrenos
+ M:	jketreno at linux.intel.com
++P:	Reinette Chatre
++M:	reinette.chatre at intel.com
+ L:	linux-wireless at vger.kernel.org
+ L:	ipw2100-devel at lists.sourceforge.net
+ L:	http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
+@@ -2040,10 +2042,12 @@ W:	http://ipw2100.sourceforge.net
+ S:	Supported
+ 
+ INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
+-P:	Yi Zhu
++P:	Zhu Yi
+ M:	yi.zhu at intel.com
+ P:	James Ketrenos
+ M:	jketreno at linux.intel.com
++P:	Reinette Chatre
++M:	reinette.chatre at intel.com
+ L:	linux-wireless at vger.kernel.org
+ L:	ipw2100-devel at lists.sourceforge.net
+ L:	http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
+@@ -2053,6 +2057,8 @@ S:	Supported
+ INTEL WIRELESS WIFI LINK (iwlwifi)
+ P:	Zhu Yi
+ M:	yi.zhu at intel.com
++P:	Reinette Chatre
++M:	reinette.chatre at intel.com
+ L:	linux-wireless at vger.kernel.org
+ L:	ipw3945-devel at lists.sourceforge.net
+ W:	http://intellinuxwireless.org


Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- config-generic	16 Nov 2007 16:35:04 -0000	1.41
+++ config-generic	21 Nov 2007 20:06:41 -0000	1.42
@@ -1281,14 +1281,17 @@
 # CONFIG_IPW2200_DEBUG is not set
 # CONFIG_LIBERTAS is not set
 
-CONFIG_IWLWIFI=y
-CONFIG_IWLWIFI_DEBUG=y
-CONFIG_IWLWIFI_SENSITIVITY=y
-CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT=y
-CONFIG_IWLWIFI_QOS=y
-CONFIG_IWLWIFI_HT=y
 CONFIG_IWL4965=m
+CONFIG_IWL4965_DEBUG=y
+CONFIG_IWL4965_SENSITIVITY=y
+CONFIG_IWL4965_SPECTRUM_MEASUREMENT=y
+CONFIG_IWL4965_QOS=y
+CONFIG_IWL4965_HT=y
 CONFIG_IWL3945=m
+CONFIG_IWL3945_DEBUG=y
+CONFIG_IWL3945_SENSITIVITY=y
+CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y
+CONFIG_IWL3945_QOS=y
 # CONFIG_NL80211 is not set
 CONFIG_NORTEL_HERMES=m
 CONFIG_P54_COMMON=m
@@ -1312,7 +1315,7 @@
 CONFIG_RT61PCI_RFKILL=y
 CONFIG_RT2500USB=m
 CONFIG_RT73USB=m
-CONFIG_RTL818X=y
+CONFIG_RTL8180=m
 CONFIG_RTL8187=m
 CONFIG_TMD_HERMES=m
 CONFIG_USB_ATMEL=m


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.249
retrieving revision 1.250
diff -u -r1.249 -r1.250
--- kernel.spec	21 Nov 2007 19:24:08 -0000	1.249
+++ kernel.spec	21 Nov 2007 20:06:41 -0000	1.250
@@ -606,12 +606,12 @@
 Patch660: linux-2.6-libata-ali-atapi-dma.patch
 Patch670: linux-2.6-ata-quirk.patch
 Patch680: linux-2.6-wireless.patch
-Patch681: linux-2.6-rt2x00-updates.patch
+Patch681: linux-2.6-wireless-pending.patch
 Patch690: linux-2.6-at76.patch
 Patch691: linux-2.6-ath5k.patch
 Patch692: linux-2.6-zd1211rw-mac80211.patch
-Patch700: linux-2.6-bcm43xx-pci-neuter.patch
-Patch701: linux-2.6-drivers-ssb-debug-revision.patch
+Patch693: linux-2.6-rtl8180.patch
+Patch694: linux-2.6-b43-rev-d.patch
 Patch801: linux-2.6-wakeups.patch
 Patch820: linux-2.6-compile-fixes.patch
 Patch1101: linux-2.6-default-mmf_dump_elf_headers.patch
@@ -1092,20 +1092,16 @@
 ApplyPatch linux-2.6-ata-quirk.patch
 
 # wireless patches headed for 2.6.24
-#ApplyPatch linux-2.6-wireless.patch
+ApplyPatch linux-2.6-wireless.patch
 # wireless patches headed for 2.6.25
-#ApplyPatch linux-2.6-rt2x00-updates.patch
+ApplyPatch linux-2.6-wireless-pending.patch
 
 # Add misc wireless bits from upstream wireless tree
 ApplyPatch linux-2.6-at76.patch
 ApplyPatch linux-2.6-ath5k.patch
 ApplyPatch linux-2.6-zd1211rw-mac80211.patch
-
-# avoid bcm3xx vs bcm43xx-mac80211 PCI ID conflicts
-ApplyPatch linux-2.6-bcm43xx-pci-neuter.patch
-
-# debug the SSB driver
-ApplyPatch linux-2.6-drivers-ssb-debug-revision.patch
+ApplyPatch linux-2.6-rtl8180.patch
+ApplyPatch linux-2.6-b43-rev-d.patch
 
 ApplyPatch linux-2.6-wakeups.patch
 
@@ -1699,6 +1695,9 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL} -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf %{with_xen} xen
 
 %changelog
+* Wed Nov 21 2007 John W. Linville <linville at redhat.com>
+- Resync wireless bits from upstream
+
 * Wed Nov 21 2007 David Woodhouse <dwmw2 at redhat.com>
 - Fix <linux/kd.h> in userspace.
 

linux-2.6-at76.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.4 -r 1.5 linux-2.6-at76.patch
Index: linux-2.6-at76.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-at76.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-at76.patch	19 Oct 2007 01:16:55 -0000	1.4
+++ linux-2.6-at76.patch	21 Nov 2007 20:06:41 -0000	1.5
@@ -1,767 +1,113 @@
-diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
---- linux-2.6.23.noarch/MAINTAINERS.orig	2007-10-18 20:25:58.000000000 -0400
-+++ linux-2.6.23.noarch/MAINTAINERS	2007-10-18 20:35:49.000000000 -0400
-@@ -698,6 +698,15 @@ W:	http://www.thekelleys.org.uk/atmel
- W:	http://atmelwlandriver.sourceforge.net/
- S:	Maintained
- 
-+ATMEL USB WIRELESS DRIVER
-+P:	Pavel Roskin
-+M:	proski at gnu.org
-+L:	linux-wireless at vger.kernel.org
-+L:	at76c503a-user at lists.berlios.de
-+L:	at76c503a-develop at lists.berlios.de
-+W:	http://at76c503a.berlios.de/
-+S:	Maintained
-+
- AUDIT SUBSYSTEM
- P:	David Woodhouse
- M:	dwmw2 at infradead.org
-diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/at76_usb.h
---- /dev/null	2007-10-18 19:53:46.790244324 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/at76_usb.h	2007-10-18 20:35:49.000000000 -0400
-@@ -0,0 +1,619 @@
+diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/at76_usb.c
+--- /dev/null	2007-11-12 23:12:46.917997680 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/at76_usb.c	2007-11-21 14:20:33.000000000 -0500
+@@ -0,0 +1,5556 @@
 +/*
-+ * Copyright (c) 2002,2003 Oliver Kurth
-+ *	     (c) 2003,2004 Joerg Albert <joerg.albert at gmx.de>
-+ *	     (c) 2007 Guido Guenther <agx at sigxcpu.org>
++ * at76c503/at76c505 USB driver
++ *
++ * Copyright (c) 2002 - 2003 Oliver Kurth
++ * Copyright (c) 2004 Joerg Albert <joerg.albert at gmx.de>
++ * Copyright (c) 2004 Nick Jones
++ * Copyright (c) 2004 Balint Seeber <n0_5p4m_p13453 at hotmail.com>
++ * Copyright (c) 2007 Guido Guenther <agx at sigxcpu.org>
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
-+ * This driver was based on information from the Sourceforge driver
-+ * released and maintained by Atmel:
-+ *
-+ *  http://sourceforge.net/projects/atmelwlandriver/
++ * This file is part of the Berlios driver for WLAN USB devices based on the
++ * Atmel AT76C503A/505/505A.
 + *
-+ * Although the code was completely re-written,
-+ * it would have been impossible without Atmel's decision to
-+ * release an Open Source driver (unfortunately the firmware was
-+ * kept binary only). Thanks for that decision to Atmel!
++ * Some iw_handler code was taken from airo.c, (C) 1999 Benjamin Reed
 + */
 +
-+#ifndef _AT76_USB_H
-+#define _AT76_USB_H
-+
-+/* Board types */
-+enum board_type {
-+	BOARD_503_ISL3861 = 1,
-+	BOARD_503_ISL3863 = 2,
-+	BOARD_503 = 3,
-+	BOARD_503_ACC = 4,
-+	BOARD_505 = 5,
-+	BOARD_505_2958 = 6,
-+	BOARD_505A = 7,
-+	BOARD_505AMX = 8
-+};
-+
-+/* our private ioctl's */
-+/* preamble length (0 - long, 1 - short, 2 - auto) */
-+#define AT76_SET_SHORT_PREAMBLE		(SIOCIWFIRSTPRIV + 0)
-+#define AT76_GET_SHORT_PREAMBLE		(SIOCIWFIRSTPRIV + 1)
-+/* which debug channels are enabled */
-+#define AT76_SET_DEBUG			(SIOCIWFIRSTPRIV + 2)
-+#define AT76_GET_DEBUG			(SIOCIWFIRSTPRIV + 3)
-+/* power save mode (incl. the Atmel proprietary smart save mode) */
-+#define AT76_SET_POWERSAVE_MODE		(SIOCIWFIRSTPRIV + 4)
-+#define AT76_GET_POWERSAVE_MODE		(SIOCIWFIRSTPRIV + 5)
-+/* min and max channel times for scan */
-+#define AT76_SET_SCAN_TIMES		(SIOCIWFIRSTPRIV + 6)
-+#define AT76_GET_SCAN_TIMES		(SIOCIWFIRSTPRIV + 7)
-+/* scan mode (0 - active, 1 - passive) */
-+#define AT76_SET_SCAN_MODE		(SIOCIWFIRSTPRIV + 8)
-+#define AT76_GET_SCAN_MODE		(SIOCIWFIRSTPRIV + 9)
-+
-+#define CMD_STATUS_IDLE				0x00
-+#define CMD_STATUS_COMPLETE			0x01
-+#define CMD_STATUS_UNKNOWN			0x02
-+#define CMD_STATUS_INVALID_PARAMETER		0x03
-+#define CMD_STATUS_FUNCTION_NOT_SUPPORTED	0x04
-+#define CMD_STATUS_TIME_OUT			0x07
-+#define CMD_STATUS_IN_PROGRESS			0x08
-+#define CMD_STATUS_HOST_FAILURE			0xff
-+#define CMD_STATUS_SCAN_FAILED			0xf0
-+
-+/* answers to get op mode */
-+#define OPMODE_NONE				0x00
-+#define OPMODE_NORMAL_NIC_WITH_FLASH		0x01
-+#define OPMODE_HW_CONFIG_MODE			0x02
-+#define OPMODE_DFU_MODE_WITH_FLASH		0x03
-+#define OPMODE_NORMAL_NIC_WITHOUT_FLASH		0x04
-+
-+#define CMD_SET_MIB		0x01
-+#define CMD_GET_MIB		0x02
-+#define CMD_SCAN		0x03
-+#define CMD_JOIN		0x04
-+#define CMD_START_IBSS		0x05
-+#define CMD_RADIO_ON		0x06
-+#define CMD_RADIO_OFF		0x07
-+#define CMD_STARTUP		0x0B
-+
-+#define MIB_LOCAL		0x01
-+#define MIB_MAC_ADDR		0x02
-+#define MIB_MAC			0x03
-+#define MIB_MAC_MGMT		0x05
-+#define MIB_MAC_WEP		0x06
-+#define MIB_PHY			0x07
-+#define MIB_FW_VERSION		0x08
-+#define MIB_MDOMAIN		0x09
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/errno.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <linux/spinlock.h>
++#include <linux/list.h>
++#include <linux/usb.h>
++#include <linux/netdevice.h>
++#include <linux/if_arp.h>
++#include <linux/etherdevice.h>
++#include <linux/ethtool.h>
++#include <linux/wireless.h>
++#include <net/iw_handler.h>
++#include <net/ieee80211_radiotap.h>
++#include <linux/firmware.h>
++#include <linux/leds.h>
++#include <net/ieee80211.h>
 +
-+#define ADHOC_MODE		1
-+#define INFRASTRUCTURE_MODE	2
++#include "at76_usb.h"
 +
-+/* values for struct mib_local, field preamble_type */
-+#define PREAMBLE_TYPE_LONG	0
-+#define PREAMBLE_TYPE_SHORT	1
-+#define PREAMBLE_TYPE_AUTO	2
++/* Version information */
++#define DRIVER_NAME "at76_usb"
++#define DRIVER_VERSION	"0.17"
++#define DRIVER_DESC "Atmel at76x USB Wireless LAN Driver"
 +
-+/* values for tx_rate */
-+#define TX_RATE_1MBIT		0
-+#define TX_RATE_2MBIT		1
-+#define TX_RATE_5_5MBIT 	2
-+#define TX_RATE_11MBIT		3
-+#define TX_RATE_AUTO		4
++/* at76_debug bits */
++#define DBG_PROGRESS		0x00000001	/* authentication/accociation */
++#define DBG_BSS_TABLE		0x00000002	/* show BSS table after scans */
++#define DBG_IOCTL		0x00000004	/* ioctl calls / settings */
++#define DBG_MAC_STATE		0x00000008	/* MAC state transitions */
++#define DBG_TX_DATA		0x00000010	/* tx header */
++#define DBG_TX_DATA_CONTENT	0x00000020	/* tx content */
++#define DBG_TX_MGMT		0x00000040	/* tx management */
++#define DBG_RX_DATA		0x00000080	/* rx data header */
++#define DBG_RX_DATA_CONTENT	0x00000100	/* rx data content */
++#define DBG_RX_MGMT		0x00000200	/* rx mgmt frame headers */
++#define DBG_RX_BEACON		0x00000400	/* rx beacon */
++#define DBG_RX_CTRL		0x00000800	/* rx control */
++#define DBG_RX_MGMT_CONTENT	0x00001000	/* rx mgmt content */
++#define DBG_RX_FRAGS		0x00002000	/* rx data fragment handling */
++#define DBG_DEVSTART		0x00004000	/* fw download, device start */
++#define DBG_URB			0x00008000	/* rx urb status, ... */
++#define DBG_RX_ATMEL_HDR	0x00010000	/* Atmel-specific Rx headers */
++#define DBG_PROC_ENTRY		0x00020000	/* procedure entries/exits */
++#define DBG_PM			0x00040000	/* power management settings */
++#define DBG_BSS_MATCH		0x00080000	/* BSS match failures */
++#define DBG_PARAMS		0x00100000	/* show configured parameters */
++#define DBG_WAIT_COMPLETE	0x00200000	/* command completion */
++#define DBG_RX_FRAGS_SKB	0x00400000	/* skb header of Rx fragments */
++#define DBG_BSS_TABLE_RM	0x00800000	/* purging bss table entries */
++#define DBG_MONITOR_MODE	0x01000000	/* monitor mode */
++#define DBG_MIB			0x02000000	/* dump all MIBs on startup */
++#define DBG_MGMT_TIMER		0x04000000	/* dump mgmt_timer ops */
[...6118 lines suppressed...]
++	u8 regulatory_domain;
 +
-+	priv = at76_alloc_new_device(udev);
-+	if (!priv) {
-+		ret = -ENOMEM;
-+		goto error;
-+	}
++	struct at76_card_config card_config;
 +
-+	SET_NETDEV_DEV(priv->netdev, &interface->dev);
-+	usb_set_intfdata(interface, priv);
++	/* store rx fragments until complete */
++	struct rx_data_buf rx_data[NR_RX_DATA_BUF];
 +
-+	memcpy(&priv->fw_version, &fwv, sizeof(struct mib_fw_version));
-+	priv->board_type = board_type;
++	enum board_type board_type;
++	struct mib_fw_version fw_version;
 +
-+	ret = at76_init_new_device(priv, interface);
-+	if (ret < 0)
-+		at76_delete_device(priv);
++	unsigned int device_unplugged:1;
++	unsigned int netdev_registered:1;
++	struct set_mib_buffer mib_buf;	/* global buffer for set_mib calls */
 +
-+	return ret;
++	/* beacon counting */
++	int beacon_period;	/* period of mgmt beacons, Kus */
++	int beacons_received;
++	unsigned long beacons_last_qual;	/* time we restarted counting
++						   beacons */
++};
 +
-+error:
-+	usb_put_dev(udev);
-+	return ret;
-+}
++struct at76_rx_radiotap {
++	struct ieee80211_radiotap_header rt_hdr;
++	__le64 rt_tsft;
++	u8 rt_flags;
++	u8 rt_rate;
++	s8 rt_signal;
++	s8 rt_noise;
++};
 +
-+static void at76_disconnect(struct usb_interface *interface)
-+{
-+	struct at76_priv *priv;
++#define AT76_RX_RADIOTAP_PRESENT		  \
++	((1 << IEEE80211_RADIOTAP_TSFT)		| \
++	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
++	(1 << IEEE80211_RADIOTAP_RATE)		| \
++	(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL)	| \
++	(1 << IEEE80211_RADIOTAP_DB_ANTNOISE))
 +
-+	priv = usb_get_intfdata(interface);
-+	usb_set_intfdata(interface, NULL);
++#define BEACON_MAX_DATA_LENGTH	1500
 +
-+	/* Disconnect after loading internal firmware */
-+	if (!priv)
-+		return;
++/* the maximum size of an AssocReq packet */
++#define ASSOCREQ_MAX_SIZE \
++  (AT76_TX_HDRLEN + sizeof(struct ieee80211_assoc_request) + \
++   1 + 1 + IW_ESSID_MAX_SIZE + 1 + 1 + 4)
 +
-+	printk(KERN_INFO "%s: disconnecting\n", priv->netdev->name);
-+	at76_delete_device(priv);
-+	dev_printk(KERN_INFO, &interface->dev, "disconnected\n");
-+}
++/* for shared secret auth, add the challenge text size */
++#define AUTH_FRAME_SIZE (AT76_TX_HDRLEN + sizeof(struct ieee80211_auth))
 +
-+/* Structure for registering this driver with the USB subsystem */
-+static struct usb_driver at76_driver = {
-+	.name = DRIVER_NAME,
-+	.probe = at76_probe,
-+	.disconnect = at76_disconnect,
-+	.id_table = dev_table,
-+};
++/* Maximal number of AuthReq retries */
++#define AUTH_RETRIES		3
 +
-+static int __init at76_mod_init(void)
-+{
-+	int result;
++/* Maximal number of AssocReq retries */
++#define ASSOC_RETRIES		3
 +
-+	printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " loading\n");
++/* Beacon timeout in managed mode when we are connected */
++#define BEACON_TIMEOUT		(10 * HZ)
 +
-+	mutex_init(&fw_mutex);
++/* Timeout for authentication response */
++#define AUTH_TIMEOUT		(1 * HZ)
 +
-+	/* register this driver with the USB subsystem */
-+	result = usb_register(&at76_driver);
-+	if (result < 0)
-+		printk(KERN_ERR DRIVER_NAME
-+		       ": usb_register failed (status %d)\n", result);
++/* Timeout for association response */
++#define ASSOC_TIMEOUT		(1 * HZ)
 +
-+	led_trigger_register_simple("at76_usb-tx", &ledtrig_tx);
-+	return result;
-+}
++/* Polling interval when scan is running */
++#define SCAN_POLL_INTERVAL	(HZ / 4)
 +
-+static void __exit at76_mod_exit(void)
-+{
-+	int i;
++/* Command completion timeout */
++#define CMD_COMPLETION_TIMEOUT	(5 * HZ)
 +
-+	printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " unloading\n");
-+	usb_deregister(&at76_driver);
-+	for (i = 0; i < ARRAY_SIZE(firmwares); i++) {
-+		if (firmwares[i].fw)
-+			release_firmware(firmwares[i].fw);
-+	}
-+	led_trigger_unregister_simple(ledtrig_tx);
-+}
++#define DEF_RTS_THRESHOLD	1536
++#define DEF_FRAG_THRESHOLD	1536
++#define DEF_SHORT_RETRY_LIMIT	8
++#define DEF_CHANNEL		10
++#define DEF_SCAN_MIN_TIME	10
++#define DEF_SCAN_MAX_TIME	120
 +
-+module_param_named(debug, at76_debug, int, 0600);
-+MODULE_PARM_DESC(debug, "Debugging level");
++#define MAX_RTS_THRESHOLD	(MAX_FRAG_THRESHOLD + 1)
 +
-+module_init(at76_mod_init);
-+module_exit(at76_mod_exit);
++/* the max padding size for tx in bytes (see calc_padding) */
++#define MAX_PADDING_SIZE	53
 +
-+MODULE_AUTHOR("Oliver Kurth <oku at masqmail.cx>");
-+MODULE_AUTHOR("Joerg Albert <joerg.albert at gmx.de>");
-+MODULE_AUTHOR("Alex <alex at foogod.com>");
-+MODULE_AUTHOR("Nick Jones");
-+MODULE_AUTHOR("Balint Seeber <n0_5p4m_p13453 at hotmail.com>");
-+MODULE_AUTHOR("Pavel Roskin <proski at gnu.org>");
-+MODULE_DESCRIPTION(DRIVER_DESC);
-+MODULE_LICENSE("GPL");
-diff -up linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.23.noarch/drivers/net/wireless/Kconfig
---- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-10-18 20:26:02.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-10-18 20:35:49.000000000 -0400
-@@ -381,6 +381,14 @@ config PCI_HERMES
- 	  common.  Some of the built-in wireless adaptors in laptops are of
- 	  this variety.
++#endif				/* _AT76_USB_H */
+diff -up linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig linux-2.6.23.noarch/drivers/net/wireless/Makefile
+--- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-11-21 14:11:39.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-11-21 14:20:33.000000000 -0500
+@@ -32,6 +32,8 @@ obj-$(CONFIG_ATMEL)             += atmel
+ obj-$(CONFIG_PCI_ATMEL)         += atmel_pci.o 
+ obj-$(CONFIG_PCMCIA_ATMEL)      += atmel_cs.o
  
-+config USB_ATMEL
-+	tristate "Atmel at76c503/at76c505/at76c505a USB cards"
-+	depends on WLAN_80211 && USB
-+	select FW_LOADER
-+	---help---
-+	  Enable support for USB Wireless devices using Atmel at76c503,
-+	  at76c505 or at76c505a chips.
++obj-$(CONFIG_USB_ATMEL)	        += at76_usb.o
++
+ obj-$(CONFIG_PRISM54)		+= prism54/
+ 
+ obj-$(CONFIG_HOSTAP)		+= hostap/
+diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
+--- linux-2.6.23.noarch/MAINTAINERS.orig	2007-11-21 14:11:39.000000000 -0500
++++ linux-2.6.23.noarch/MAINTAINERS	2007-11-21 14:20:33.000000000 -0500
+@@ -699,6 +699,15 @@ W:	http://www.thekelleys.org.uk/atmel
+ W:	http://atmelwlandriver.sourceforge.net/
+ S:	Maintained
+ 
++ATMEL USB WIRELESS DRIVER
++P:	Pavel Roskin
++M:	proski at gnu.org
++L:	linux-wireless at vger.kernel.org
++L:	at76c503a-user at lists.berlios.de
++L:	at76c503a-develop at lists.berlios.de
++W:	http://at76c503a.berlios.de/
++S:	Maintained
 +
- config PCMCIA_HERMES
- 	tristate "Hermes PCMCIA card support"
- 	depends on PCMCIA && HERMES
+ AUDIT SUBSYSTEM
+ P:	David Woodhouse
+ M:	dwmw2 at infradead.org

linux-2.6-ath5k.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.5 -r 1.6 linux-2.6-ath5k.patch
Index: linux-2.6-ath5k.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-ath5k.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-ath5k.patch	19 Oct 2007 01:16:55 -0000	1.5
+++ linux-2.6-ath5k.patch	21 Nov 2007 20:06:41 -0000	1.6
@@ -1,34 +1,7 @@
-diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
---- linux-2.6.23.noarch/MAINTAINERS.orig	2007-10-18 20:38:51.000000000 -0400
-+++ linux-2.6.23.noarch/MAINTAINERS	2007-10-18 20:39:58.000000000 -0400
-@@ -648,6 +648,14 @@ M:	ecashin at coraid.com
- W:	http://www.coraid.com/support/linux
- S:	Supported
- 
-+ATHEROS ATH5K WIRELESS DRIVER
-+P:	Jiri Slaby
-+M:	jirislaby at gmail.com
-+P:	Luis R. Rodriguez
-+M:	mcgrof at gmail.com
-+L:	linux-wireless at vger.kernel.org
-+S:	Maintained
-+
- ATL1 ETHERNET DRIVER
- P:	Jay Cliburn
- M:	jcliburn at gmail.com
-diff -up linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig linux-2.6.23.noarch/drivers/net/wireless/Makefile
---- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-10-18 20:38:51.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-10-18 20:41:31.000000000 -0400
-@@ -60,3 +60,5 @@ obj-$(CONFIG_RT2X00)	+= rt2x00/
- obj-$(CONFIG_P54_COMMON)	+= p54common.o
- obj-$(CONFIG_P54_USB)		+= p54usb.o
- obj-$(CONFIG_P54_PCI)		+= p54pci.o
-+
-+obj-$(CONFIG_ATH5K)	+= ath5k/
 diff -up linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.23.noarch/drivers/net/wireless/Kconfig
---- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-10-18 20:38:51.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-10-18 20:40:51.000000000 -0400
-@@ -598,6 +598,19 @@ config P54_PCI
+--- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-11-21 14:21:34.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-11-21 14:22:18.000000000 -0500
+@@ -604,6 +604,24 @@ config P54_PCI
  	tristate "Prism54 PCI support"
  	depends on P54_COMMON && PCI
  
@@ -37,8 +10,13 @@
 +	depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
 +	default m
 +	---help---
-+	  This module adds support for atheros 5xxx (e.g. 5212) wireless
-+	  cards. If you have this card in your PC, select this to be build.
++	  This module adds support for wireless adapters based on
++	  Atheros 5xxx chipset.
++
++	  Currently the following chip versions are supported:
++
++	  MAC: AR5211 AR5212
++	  PHY: RF5111/2111 RF5112/2112 RF5413/2413
 +
 +	  This driver uses the kernel's mac80211 subsystem.
 +
@@ -48,12 +26,21 @@
  source "drivers/net/wireless/iwlwifi/Kconfig"
  source "drivers/net/wireless/hostap/Kconfig"
  source "drivers/net/wireless/bcm43xx/Kconfig"
-diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/ath5k/phy.c
---- /dev/null	2007-10-18 19:53:46.790244324 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/phy.c	2007-10-18 20:39:58.000000000 -0400
-@@ -0,0 +1,1686 @@
+diff -up linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig linux-2.6.23.noarch/drivers/net/wireless/Makefile
+--- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-11-21 14:21:34.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-11-21 14:22:18.000000000 -0500
+@@ -61,3 +61,5 @@ obj-$(CONFIG_RT2X00)	+= rt2x00/
+ obj-$(CONFIG_P54_COMMON)	+= p54common.o
+ obj-$(CONFIG_P54_USB)		+= p54usb.o
+ obj-$(CONFIG_P54_PCI)		+= p54pci.o
++
++obj-$(CONFIG_ATH5K)	+= ath5k/
+diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/ath5k/initvals.c
+--- /dev/null	2007-11-12 23:12:46.917997680 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/ath5k/initvals.c	2007-11-21 14:22:18.000000000 -0500
+@@ -0,0 +1,1332 @@
 +/*
-+ * PHY functions
++ * Initial register settings functions
 + *
 + * Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk at openbsd.org>
 + * Copyright (c) 2006, 2007 Nick Kossifidis <mickflemm at gmail.com>
@@ -73,1678 +60,1328 @@
 + *
 + */
 +
-+#include <linux/delay.h>
-+
 +#include "ath5k.h"
 +#include "reg.h"
 +
-+/* Struct to hold initial RF register values (RF Banks) */
-+struct ath5k_ini_rf {
-+	u8	rf_bank;	/* check out ath5k_reg.h */
-+	u16	rf_register;	/* register address */
-+	u32	rf_value[5];	/* register value for different modes (above) */
-+};
++/*
++ * MAC/PHY REGISTERS
++ */
++
 +
 +/*
-+ * Mode-specific RF Gain table (64bytes) for RF5111/5112
-+ * (RF5110 only comes with AR5210 and only supports a/turbo a mode so initial
-+ * RF Gain values are included in AR5K_AR5210_INI)
++ * Mode-independent initial register writes
 + */
-+struct ath5k_ini_rfgain {
-+	u16	rfg_register;	/* RF Gain register address */
-+	u32	rfg_value[2];	/* [freq (see below)] */
-+};
 +
-+struct ath5k_gain_opt {
-+	u32			go_default;
-+	u32			go_steps_count;
-+	const struct ath5k_gain_opt_step	go_step[AR5K_GAIN_STEP_COUNT];
-+};
++struct ath5k_ini {
++	u16	ini_register;
++	u32	ini_value;
 +
-+/* RF5111 mode-specific init registers */
-+static const struct ath5k_ini_rf rfregs_5111[] = {
-+	{ 0, 0x989c,
-+	/*    mode a/XR   mode aTurbo mode b      mode g      mode gTurbo */
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00380000, 0x00380000, 0x00380000, 0x00380000, 0x00380000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 0, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x000000c0, 0x00000080, 0x00000080 } },
-+	{ 0, 0x989c,
-+	    { 0x000400f9, 0x000400f9, 0x000400ff, 0x000400fd, 0x000400fd } },
-+	{ 0, 0x98d4,
-+	    { 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000004 } },
-+	{ 1, 0x98d4,
-+	    { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
-+	{ 2, 0x98d4,
-+	    { 0x00000010, 0x00000014, 0x00000010, 0x00000010, 0x00000014 } },
-+	{ 3, 0x98d8,
-+	    { 0x00601068, 0x00601068, 0x00601068, 0x00601068, 0x00601068 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000 } },
-+	{ 6, 0x989c,
-+	    { 0x04000000, 0x04000000, 0x04000000, 0x04000000, 0x04000000 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x00000000, 0x00000000, 0x0a000000, 0x00000000, 0x00000000 } },
-+	{ 6, 0x989c,
-+	    { 0x003800c0, 0x00380080, 0x023800c0, 0x003800c0, 0x003800c0 } },
-+	{ 6, 0x989c,
-+	    { 0x00020006, 0x00020006, 0x00000006, 0x00020006, 0x00020006 } },
-+	{ 6, 0x989c,
-+	    { 0x00000089, 0x00000089, 0x00000089, 0x00000089, 0x00000089 } },
[...27141 lines suppressed...]
++extern void ath5k_hw_set_associd(struct ath5k_hw *ah, const u8 *bssid, u16 assoc_id);
++extern int ath5k_hw_set_bssid_mask(struct ath5k_hw *ah, const u8 *mask);
++/* Receive start/stop functions */
++extern void ath5k_hw_start_rx_pcu(struct ath5k_hw *ah);
++extern void ath5k_hw_stop_pcu_recv(struct ath5k_hw *ah);
++/* RX Filter functions */
++extern void ath5k_hw_set_mcast_filter(struct ath5k_hw *ah, u32 filter0, u32 filter1);
++extern int ath5k_hw_set_mcast_filterindex(struct ath5k_hw *ah, u32 index);
++extern int ath5k_hw_clear_mcast_filter_idx(struct ath5k_hw *ah, u32 index);
++extern u32 ath5k_hw_get_rx_filter(struct ath5k_hw *ah);
++extern void ath5k_hw_set_rx_filter(struct ath5k_hw *ah, u32 filter);
++/* Beacon related functions */
++extern u32 ath5k_hw_get_tsf32(struct ath5k_hw *ah);
++extern u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah);
++extern void ath5k_hw_reset_tsf(struct ath5k_hw *ah);
++extern void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval);
++extern int ath5k_hw_set_beacon_timers(struct ath5k_hw *ah, const struct ath5k_beacon_state *state);
++extern void ath5k_hw_reset_beacon(struct ath5k_hw *ah);
++extern int ath5k_hw_wait_for_beacon(struct ath5k_hw *ah, unsigned long phys_addr);
++extern void ath5k_hw_update_mib_counters(struct ath5k_hw *ah, struct ath5k_mib_stats *statistics);
++/* ACK bit rate */
++void ath5k_hw_set_ack_bitrate_high(struct ath5k_hw *ah, bool high);
++/* ACK/CTS Timeouts */
++extern int ath5k_hw_set_ack_timeout(struct ath5k_hw *ah, unsigned int timeout);
++extern unsigned int ath5k_hw_get_ack_timeout(struct ath5k_hw *ah);
++extern int ath5k_hw_set_cts_timeout(struct ath5k_hw *ah, unsigned int timeout);
++extern unsigned int ath5k_hw_get_cts_timeout(struct ath5k_hw *ah);
++/* Key table (WEP) functions */
++extern int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry);
++extern int ath5k_hw_is_key_valid(struct ath5k_hw *ah, u16 entry);
++extern int ath5k_hw_set_key(struct ath5k_hw *ah, u16 entry, const struct ieee80211_key_conf *key, const u8 *mac);
++extern int ath5k_hw_set_key_lladdr(struct ath5k_hw *ah, u16 entry, const u8 *mac);
++/* Queue Control Unit, DFS Control Unit Functions */
++extern int ath5k_hw_setup_tx_queue(struct ath5k_hw *ah, enum ath5k_tx_queue queue_type, struct ath5k_txq_info *queue_info);
++extern int ath5k_hw_setup_tx_queueprops(struct ath5k_hw *ah, int queue, const struct ath5k_txq_info *queue_info);
++extern int ath5k_hw_get_tx_queueprops(struct ath5k_hw *ah, int queue, struct ath5k_txq_info *queue_info);
++extern void ath5k_hw_release_tx_queue(struct ath5k_hw *ah, unsigned int queue);
++extern int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue);
++extern u32 ath5k_hw_num_tx_pending(struct ath5k_hw *ah, unsigned int queue);
++extern int ath5k_hw_set_slot_time(struct ath5k_hw *ah, unsigned int slot_time);
++extern unsigned int ath5k_hw_get_slot_time(struct ath5k_hw *ah);
++/* Hardware Descriptor Functions */
++extern int ath5k_hw_setup_rx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, u32 size, unsigned int flags);
++/* GPIO Functions */
++extern void ath5k_hw_set_ledstate(struct ath5k_hw *ah, unsigned int state);
++extern int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio);
++extern int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio);
++extern u32 ath5k_hw_get_gpio(struct ath5k_hw *ah, u32 gpio);
++extern int ath5k_hw_set_gpio(struct ath5k_hw *ah, u32 gpio, u32 val);
++extern void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio, u32 interrupt_level);
++/* Regulatory Domain/Channels Setup */
++extern u16 ath5k_get_regdomain(struct ath5k_hw *ah);
++/* Misc functions */
++extern void ath5k_hw_dump_state(struct ath5k_hw *ah);
++extern int ath5k_hw_get_capability(struct ath5k_hw *ah, enum ath5k_capability_type cap_type, u32 capability, u32 *result);
 +
-+#include "regdom.h"
 +
-+static const struct ath5k_regdommap {
-+	enum ath5k_regdom dmn;
-+	enum ath5k_regdom dmn5;
-+	enum ath5k_regdom dmn2;
-+} r_map[] = {
-+	{ DMN_DEFAULT,		DMN_DEBUG,	DMN_DEBUG },
-+	{ DMN_NULL_WORLD,	DMN_NULL,	DMN_WORLD },
-+	{ DMN_NULL_ETSIB,	DMN_NULL,	DMN_ETSIB },
-+	{ DMN_NULL_ETSIC,	DMN_NULL,	DMN_ETSIC },
-+	{ DMN_FCC1_FCCA,	DMN_FCC1,	DMN_FCCA },
-+	{ DMN_FCC1_WORLD,	DMN_FCC1,	DMN_WORLD },
-+	{ DMN_FCC2_FCCA,	DMN_FCC2,	DMN_FCCA },
-+	{ DMN_FCC2_WORLD,	DMN_FCC2,	DMN_WORLD },
-+	{ DMN_FCC2_ETSIC,	DMN_FCC2,	DMN_ETSIC },
-+	{ DMN_FRANCE_NULL,	DMN_ETSI3,	DMN_ETSI3 },
-+	{ DMN_FCC3_FCCA,	DMN_FCC3,	DMN_WORLD },
-+	{ DMN_ETSI1_WORLD,	DMN_ETSI1,	DMN_WORLD },
-+	{ DMN_ETSI3_ETSIA,	DMN_ETSI3,	DMN_WORLD },
-+	{ DMN_ETSI2_WORLD,	DMN_ETSI2,	DMN_WORLD },
-+	{ DMN_ETSI3_WORLD,	DMN_ETSI3,	DMN_WORLD },
-+	{ DMN_ETSI4_WORLD,	DMN_ETSI4,	DMN_WORLD },
-+	{ DMN_ETSI4_ETSIC,	DMN_ETSI4,	DMN_ETSIC },
-+	{ DMN_ETSI5_WORLD,	DMN_ETSI5,	DMN_WORLD },
-+	{ DMN_ETSI6_WORLD,	DMN_ETSI6,	DMN_WORLD },
-+	{ DMN_ETSI_NULL,	DMN_ETSI1,	DMN_ETSI1 },
-+	{ DMN_MKK1_MKKA,	DMN_MKK1,	DMN_MKKA },
-+	{ DMN_MKK1_MKKB,	DMN_MKK1,	DMN_MKKA },
-+	{ DMN_APL4_WORLD,	DMN_APL4,	DMN_WORLD },
-+	{ DMN_MKK2_MKKA,	DMN_MKK2,	DMN_MKKA },
-+	{ DMN_APL_NULL,		DMN_APL1,	DMN_NULL },
-+	{ DMN_APL2_WORLD,	DMN_APL2,	DMN_WORLD },
-+	{ DMN_APL2_APLC,	DMN_APL2,	DMN_WORLD },
-+	{ DMN_APL3_WORLD,	DMN_APL3,	DMN_WORLD },
-+	{ DMN_MKK1_FCCA,	DMN_MKK1,	DMN_FCCA },
-+	{ DMN_APL2_APLD,	DMN_APL2,	DMN_APLD },
-+	{ DMN_MKK1_MKKA1,	DMN_MKK1,	DMN_MKKA },
-+	{ DMN_MKK1_MKKA2,	DMN_MKK1,	DMN_MKKA },
-+	{ DMN_APL1_WORLD,	DMN_APL1,	DMN_WORLD },
-+	{ DMN_APL1_FCCA,	DMN_APL1,	DMN_FCCA },
-+	{ DMN_APL1_APLA,	DMN_APL1,	DMN_WORLD },
-+	{ DMN_APL1_ETSIC,	DMN_APL1,	DMN_ETSIC },
-+	{ DMN_APL2_ETSIC,	DMN_APL2,	DMN_ETSIC },
-+	{ DMN_APL5_WORLD,	DMN_APL5,	DMN_WORLD },
-+	{ DMN_WOR0_WORLD,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_WOR1_WORLD,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_WOR2_WORLD,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_WOR3_WORLD,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_WOR4_WORLD,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_WOR5_ETSIC,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_WOR01_WORLD,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_WOR02_WORLD,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_EU1_WORLD,	DMN_ETSI1,	DMN_WORLD },
-+	{ DMN_WOR9_WORLD,	DMN_WORLD,	DMN_WORLD },
-+	{ DMN_WORA_WORLD,	DMN_WORLD,	DMN_WORLD },
-+};
++/* Initial register settings functions */
++extern int ath5k_hw_write_initvals(struct ath5k_hw *ah, u8 mode, bool change_channel);
++/* Initialize RF */
++extern int ath5k_hw_rfregs(struct ath5k_hw *ah, struct ieee80211_channel *channel, unsigned int mode);
++extern int ath5k_hw_rfgain(struct ath5k_hw *ah, unsigned int freq);
++extern enum ath5k_rfgain ath5k_hw_get_rf_gain(struct ath5k_hw *ah);
++extern int ath5k_hw_set_rfgain_opt(struct ath5k_hw *ah);
 +
-+enum ath5k_regdom ath5k_regdom2flag(enum ath5k_regdom dmn, u16 mhz)
-+{
-+	unsigned int i;
 +
-+	for (i = 0; i < ARRAY_SIZE(r_map); i++) {
-+		if (r_map[i].dmn == dmn) {
-+			if (mhz >= 2000 && mhz <= 3000)
-+				return r_map[i].dmn2;
-+			if (mhz >= IEEE80211_CHANNELS_5GHZ_MIN &&
-+					mhz <= IEEE80211_CHANNELS_5GHZ_MAX)
-+				return r_map[i].dmn5;
-+		}
-+	}
++/* PHY/RF channel functions */
++extern bool ath5k_channel_ok(struct ath5k_hw *ah, u16 freq, unsigned int flags);
++extern int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel);
++/* PHY calibration */
++extern int ath5k_hw_phy_calibrate(struct ath5k_hw *ah, struct ieee80211_channel *channel);
++extern int ath5k_hw_phy_disable(struct ath5k_hw *ah);
++/* Misc PHY functions */
++extern u16 ath5k_hw_radio_revision(struct ath5k_hw *ah, unsigned int chan);
++extern void ath5k_hw_set_def_antenna(struct ath5k_hw *ah, unsigned int ant);
++extern unsigned int ath5k_hw_get_def_antenna(struct ath5k_hw *ah);
++/* TX power setup */
++extern int ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel, unsigned int txpower);
++extern int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, unsigned int power);
 +
-+	return DMN_DEBUG;
-+}
 +
-+u16 ath5k_regdom_from_ieee(enum ath5k_regdom ieee)
++static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
 +{
-+	u32 regdomain = (u32)ieee;
-+
-+	/*
-+	 * Use the default regulation domain if the value is empty
-+	 * or not supported by the net80211 regulation code.
-+	 */
-+	if (ath5k_regdom2flag(regdomain, IEEE80211_CHANNELS_5GHZ_MIN) ==
-+			DMN_DEBUG)
-+		return (u16)AR5K_TUNE_REGDOMAIN;
-+
-+	/* It is supported, just return the value */
-+	return regdomain;
++	return ioread32(ah->ah_iobase + reg);
 +}
 +
-+enum ath5k_regdom ath5k_regdom_to_ieee(u16 regdomain)
++static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
 +{
-+	enum ath5k_regdom ieee = (enum ath5k_regdom)regdomain;
-+
-+	return ieee;
++	iowrite32(val, ah->ah_iobase + reg);
 +}
 +
++#endif
+diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
+--- linux-2.6.23.noarch/MAINTAINERS.orig	2007-11-21 14:21:34.000000000 -0500
++++ linux-2.6.23.noarch/MAINTAINERS	2007-11-21 14:22:18.000000000 -0500
+@@ -649,6 +649,17 @@ M:	ecashin at coraid.com
+ W:	http://www.coraid.com/support/linux
+ S:	Supported
+ 
++ATHEROS ATH5K WIRELESS DRIVER
++P:	Jiri Slaby
++M:	jirislaby at gmail.com
++P:	Nick Kossifidis
++M:	mickflemm at gmail.com
++P:	Luis R. Rodriguez
++M:	mcgrof at gmail.com
++L:	linux-wireless at vger.kernel.org
++L:	ath5k-devel at lists.ath5k.org
++S:	Maintained
++
+ ATL1 ETHERNET DRIVER
+ P:	Jay Cliburn
+ M:	jcliburn at gmail.com

linux-2.6-wireless.patch:

Index: linux-2.6-wireless.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-wireless.patch,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- linux-2.6-wireless.patch	19 Oct 2007 01:16:55 -0000	1.11
+++ linux-2.6-wireless.patch	21 Nov 2007 20:06:42 -0000	1.12
@@ -1,1029 +1,232 @@
-diff -up linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_tkip.c.orig linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_tkip.c
---- linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_tkip.c.orig	2007-10-18 20:13:58.000000000 -0400
-+++ linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_tkip.c	2007-10-18 20:19:09.000000000 -0400
-@@ -586,7 +586,7 @@ static void michael_mic_hdr(struct sk_bu
- 	if (stype & IEEE80211_STYPE_QOS_DATA) {
- 		const struct ieee80211_hdr_3addrqos *qoshdr =
- 			(struct ieee80211_hdr_3addrqos *)skb->data;
--		hdr[12] = qoshdr->qos_ctl & cpu_to_le16(IEEE80211_QCTL_TID);
-+		hdr[12] = le16_to_cpu(qoshdr->qos_ctl) & IEEE80211_QCTL_TID;
- 	} else
- 		hdr[12] = 0;		/* priority */
- 
-diff -up linux-2.6.23.noarch/net/mac80211/ieee80211_ioctl.c.orig linux-2.6.23.noarch/net/mac80211/ieee80211_ioctl.c
---- linux-2.6.23.noarch/net/mac80211/ieee80211_ioctl.c.orig	2007-10-18 20:13:58.000000000 -0400
-+++ linux-2.6.23.noarch/net/mac80211/ieee80211_ioctl.c	2007-10-18 20:19:09.000000000 -0400
-@@ -306,9 +306,12 @@ int ieee80211_set_channel(struct ieee802
- 			    ((chan->chan == channel) || (chan->freq == freq))) {
- 				local->oper_channel = chan;
- 				local->oper_hw_mode = mode;
--				set++;
-+				set = 1;
-+				break;
- 			}
- 		}
-+		if (set)
-+			break;
- 	}
- 
- 	if (set) {
-@@ -508,10 +511,11 @@ static int ieee80211_ioctl_giwap(struct 
- 
- static int ieee80211_ioctl_siwscan(struct net_device *dev,
- 				   struct iw_request_info *info,
--				   struct iw_point *data, char *extra)
-+				   union iwreq_data *wrqu, char *extra)
- {
- 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-+	struct iw_scan_req *req = NULL;
- 	u8 *ssid = NULL;
- 	size_t ssid_len = 0;
- 
-@@ -536,6 +540,14 @@ static int ieee80211_ioctl_siwscan(struc
- 		return -EOPNOTSUPP;
- 	}
- 
-+	/* if SSID was specified explicitly then use that */
-+	if (wrqu->data.length == sizeof(struct iw_scan_req) &&
-+	    wrqu->data.flags & IW_SCAN_THIS_ESSID) {
-+		req = (struct iw_scan_req *)extra;
-+		ssid = req->essid;
-+		ssid_len = req->essid_len;
-+	}
-+
- 	return ieee80211_sta_req_scan(dev, ssid, ssid_len);
+diff -up linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt73usb.c.orig linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt73usb.c
+--- linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt73usb.c.orig	2007-11-21 13:41:14.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt73usb.c	2007-11-21 14:02:49.000000000 -0500
+@@ -1251,7 +1251,7 @@ static void rt73usb_write_tx_desc(struct
  }
  
-diff -up linux-2.6.23.noarch/net/mac80211/ieee80211_sta.c.orig linux-2.6.23.noarch/net/mac80211/ieee80211_sta.c
---- linux-2.6.23.noarch/net/mac80211/ieee80211_sta.c.orig	2007-10-18 20:13:58.000000000 -0400
-+++ linux-2.6.23.noarch/net/mac80211/ieee80211_sta.c	2007-10-18 20:22:54.000000000 -0400
-@@ -12,7 +12,6 @@
-  */
- 
- /* TODO:
-- * BSS table: use <BSSID,SSID> as the key to support multi-SSID APs
-  * order BSS list by RSSI(?) ("quality of AP")
-  * scan result table filtering (by capability (privacy, IBSS/BSS, WPA/RSN IE,
-  *    SSID)
-@@ -61,7 +60,8 @@
- static void ieee80211_send_probe_req(struct net_device *dev, u8 *dst,
- 				     u8 *ssid, size_t ssid_len);
- static struct ieee80211_sta_bss *
--ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid);
-+ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid, int channel,
-+		     u8 *ssid, u8 ssid_len);
- static void ieee80211_rx_bss_put(struct net_device *dev,
- 				 struct ieee80211_sta_bss *bss);
- static int ieee80211_sta_find_ibss(struct net_device *dev,
-@@ -108,14 +108,11 @@ struct ieee802_11_elems {
- 	u8 wmm_param_len;
- };
- 
--enum ParseRes { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 };
--
--static enum ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
--					    struct ieee802_11_elems *elems)
-+static void ieee802_11_parse_elems(u8 *start, size_t len,
-+				   struct ieee802_11_elems *elems)
- {
- 	size_t left = len;
- 	u8 *pos = start;
--	int unknown = 0;
- 
- 	memset(elems, 0, sizeof(*elems));
- 
-@@ -126,15 +123,8 @@ static enum ParseRes ieee802_11_parse_el
- 		elen = *pos++;
- 		left -= 2;
- 
--		if (elen > left) {
--#if 0
--			if (net_ratelimit())
--				printk(KERN_DEBUG "IEEE 802.11 element parse "
--				       "failed (id=%d elen=%d left=%d)\n",
--				       id, elen, left);
--#endif
--			return ParseFailed;
--		}
-+		if (elen > left)
-+			return;
- 
- 		switch (id) {
- 		case WLAN_EID_SSID:
-@@ -201,28 +191,15 @@ static enum ParseRes ieee802_11_parse_el
- 			elems->ext_supp_rates_len = elen;
- 			break;
- 		default:
--#if 0
--			printk(KERN_DEBUG "IEEE 802.11 element parse ignored "
--				      "unknown element (id=%d elen=%d)\n",
--				      id, elen);
--#endif
--			unknown++;
- 			break;
- 		}
+ static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
+-				   int maxpacket, struct sk_buff *skb)
++				   struct sk_buff *skb)
+ {
+ 	int length;
+ 
+@@ -1260,7 +1260,7 @@ static int rt73usb_get_tx_data_len(struc
+ 	 * but it must _not_ be a multiple of the USB packet size.
+ 	 */
+ 	length = roundup(skb->len, 4);
+-	length += (4 * !(length % maxpacket));
++	length += (4 * !(length % rt2x00dev->usb_maxpacket));
  
- 		left -= elen;
- 		pos += elen;
- 	}
--
--	/* Do not trigger error if left == 1 as Apple Airport base stations
--	 * send AssocResps that are one spurious byte too long. */
--
--	return unknown ? ParseUnknown : ParseOK;
+ 	return length;
  }
- 
- 
--
--
- static int ecw2cw(int ecw)
- {
- 	int cw = 1;
-@@ -427,7 +404,9 @@ static void ieee80211_set_associated(str
- 		if (sdata->type != IEEE80211_IF_TYPE_STA)
- 			return;
- 
--		bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
-+		bss = ieee80211_rx_bss_get(dev, ifsta->bssid,
-+					   local->hw.conf.channel,
-+					   ifsta->ssid, ifsta->ssid_len);
- 		if (bss) {
- 			if (bss->has_erp_value)
- 				ieee80211_handle_erp_ie(dev, bss->erp_value);
-@@ -574,7 +553,8 @@ static void ieee80211_send_assoc(struct 
- 		capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME |
- 			WLAN_CAPABILITY_SHORT_PREAMBLE;
- 	}
--	bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
-+	bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel,
-+				   ifsta->ssid, ifsta->ssid_len);
- 	if (bss) {
- 		if (bss->capability & WLAN_CAPABILITY_PRIVACY)
- 			capab |= WLAN_CAPABILITY_PRIVACY;
-@@ -722,6 +702,7 @@ static void ieee80211_send_disassoc(stru
- static int ieee80211_privacy_mismatch(struct net_device *dev,
- 				      struct ieee80211_if_sta *ifsta)
- {
-+	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- 	struct ieee80211_sta_bss *bss;
- 	int res = 0;
- 
-@@ -729,7 +710,8 @@ static int ieee80211_privacy_mismatch(st
- 	    ifsta->key_management_enabled)
- 		return 0;
- 
--	bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
-+	bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel,
-+				   ifsta->ssid, ifsta->ssid_len);
- 	if (!bss)
- 		return 0;
- 
-@@ -926,12 +908,7 @@ static void ieee80211_auth_challenge(str
- 
- 	printk(KERN_DEBUG "%s: replying to auth challenge\n", dev->name);
- 	pos = mgmt->u.auth.variable;
--	if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems)
--	    == ParseFailed) {
--		printk(KERN_DEBUG "%s: failed to parse Auth(challenge)\n",
--		       dev->name);
--		return;
--	}
-+	ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);
- 	if (!elems.challenge) {
- 		printk(KERN_DEBUG "%s: no challenge IE in shared key auth "
- 		       "frame\n", dev->name);
-@@ -1203,15 +1180,11 @@ static void ieee80211_rx_mgmt_assoc_resp
- 	capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info);
- 	status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code);
- 	aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
--	if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14)))
--		printk(KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not "
--		       "set\n", dev->name, aid);
--	aid &= ~(BIT(15) | BIT(14));
- 
- 	printk(KERN_DEBUG "%s: RX %sssocResp from %s (capab=0x%x "
- 	       "status=%d aid=%d)\n",
- 	       dev->name, reassoc ? "Rea" : "A", print_mac(mac, mgmt->sa),
--	       capab_info, status_code, aid);
-+	       capab_info, status_code, aid & ~(BIT(15) | BIT(14)));
- 
- 	if (status_code != WLAN_STATUS_SUCCESS) {
- 		printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
-@@ -1223,13 +1196,13 @@ static void ieee80211_rx_mgmt_assoc_resp
- 		return;
- 	}
- 
-+	if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14)))
-+		printk(KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not "
-+		       "set\n", dev->name, aid);
-+	aid &= ~(BIT(15) | BIT(14));
-+
- 	pos = mgmt->u.assoc_resp.variable;
--	if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems)
--	    == ParseFailed) {
--		printk(KERN_DEBUG "%s: failed to parse AssocResp\n",
--		       dev->name);
--		return;
--	}
-+	ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);
- 
- 	if (!elems.supp_rates) {
- 		printk(KERN_DEBUG "%s: no SuppRates element in AssocResp\n",
-@@ -1241,7 +1214,9 @@ static void ieee80211_rx_mgmt_assoc_resp
- 	 * update our stored copy */
- 	if (elems.erp_info && elems.erp_info_len >= 1) {
- 		struct ieee80211_sta_bss *bss
--			= ieee80211_rx_bss_get(dev, ifsta->bssid);
-+			= ieee80211_rx_bss_get(dev, ifsta->bssid,
-+					       local->hw.conf.channel,
-+					       ifsta->ssid, ifsta->ssid_len);
- 		if (bss) {
- 			bss->erp_value = elems.erp_info[0];
- 			bss->has_erp_value = 1;
-@@ -1271,7 +1246,9 @@ static void ieee80211_rx_mgmt_assoc_resp
- 			       " AP\n", dev->name);
- 			return;
- 		}
--		bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
-+		bss = ieee80211_rx_bss_get(dev, ifsta->bssid,
-+					   local->hw.conf.channel,
-+					   ifsta->ssid, ifsta->ssid_len);
- 		if (bss) {
- 			sta->last_rssi = bss->rssi;
- 			sta->last_signal = bss->signal;
-@@ -1347,7 +1324,8 @@ static void __ieee80211_rx_bss_hash_del(
- 
- 
- static struct ieee80211_sta_bss *
--ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
-+ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid, int channel,
-+		     u8 *ssid, u8 ssid_len)
- {
- 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- 	struct ieee80211_sta_bss *bss;
-@@ -1358,6 +1336,11 @@ ieee80211_rx_bss_add(struct net_device *
- 	atomic_inc(&bss->users);
- 	atomic_inc(&bss->users);
- 	memcpy(bss->bssid, bssid, ETH_ALEN);
-+	bss->channel = channel;
-+	if (ssid && ssid_len <= IEEE80211_MAX_SSID_LEN) {
-+		memcpy(bss->ssid, ssid, ssid_len);
-+		bss->ssid_len = ssid_len;
-+	}
- 
- 	spin_lock_bh(&local->sta_bss_lock);
- 	/* TODO: order by RSSI? */
-@@ -1369,7 +1352,8 @@ ieee80211_rx_bss_add(struct net_device *
- 
- 
- static struct ieee80211_sta_bss *
--ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid)
-+ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid, int channel,
-+		     u8 *ssid, u8 ssid_len)
- {
- 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- 	struct ieee80211_sta_bss *bss;
-@@ -1377,7 +1361,10 @@ ieee80211_rx_bss_get(struct net_device *
- 	spin_lock_bh(&local->sta_bss_lock);
- 	bss = local->sta_bss_hash[STA_HASH(bssid)];
- 	while (bss) {
--		if (memcmp(bss->bssid, bssid, ETH_ALEN) == 0) {
-+		if (!memcmp(bss->bssid, bssid, ETH_ALEN) &&
-+		    bss->channel == channel &&
-+		    bss->ssid_len == ssid_len &&
-+		    (ssid_len == 0 || !memcmp(bss->ssid, ssid, ssid_len))) {
- 			atomic_inc(&bss->users);
- 			break;
- 		}
-@@ -1439,7 +1426,7 @@ static void ieee80211_rx_bss_info(struct
- 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- 	struct ieee802_11_elems elems;
- 	size_t baselen;
--	int channel, invalid = 0, clen;
-+	int channel, clen;
- 	struct ieee80211_sta_bss *bss;
- 	struct sta_info *sta;
- 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-@@ -1485,9 +1472,7 @@ static void ieee80211_rx_bss_info(struct
- #endif /* CONFIG_MAC80211_IBSS_DEBUG */
- 	}
- 
--	if (ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen,
--				   &elems) == ParseFailed)
--		invalid = 1;
-+	ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems);
- 
- 	if (sdata->type == IEEE80211_IF_TYPE_IBSS && elems.supp_rates &&
- 	    memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0 &&
-@@ -1545,9 +1530,11 @@ static void ieee80211_rx_bss_info(struct
- 	else
- 		channel = rx_status->channel;
- 
--	bss = ieee80211_rx_bss_get(dev, mgmt->bssid);
-+	bss = ieee80211_rx_bss_get(dev, mgmt->bssid, channel,
-+				   elems.ssid, elems.ssid_len);
- 	if (!bss) {
--		bss = ieee80211_rx_bss_add(dev, mgmt->bssid);
-+		bss = ieee80211_rx_bss_add(dev, mgmt->bssid, channel,
-+					   elems.ssid, elems.ssid_len);
- 		if (!bss)
- 			return;
- 	} else {
-@@ -1573,10 +1560,6 @@ static void ieee80211_rx_bss_info(struct
- 
- 	bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int);
- 	bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info);
--	if (elems.ssid && elems.ssid_len <= IEEE80211_MAX_SSID_LEN) {
--		memcpy(bss->ssid, elems.ssid, elems.ssid_len);
--		bss->ssid_len = elems.ssid_len;
--	}
- 
- 	bss->supp_rates_len = 0;
- 	if (elems.supp_rates) {
-@@ -1647,7 +1630,6 @@ static void ieee80211_rx_bss_info(struct
- 
- 
- 	bss->hw_mode = rx_status->phymode;
--	bss->channel = channel;
- 	bss->freq = rx_status->freq;
- 	if (channel != rx_status->channel &&
- 	    (bss->hw_mode == MODE_IEEE80211G ||
-@@ -1707,9 +1689,7 @@ static void ieee80211_rx_mgmt_beacon(str
- 	if (baselen > len)
- 		return;
- 
--	if (ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen,
--				   &elems) == ParseFailed)
--		return;
-+	ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems);
- 
- 	if (elems.erp_info && elems.erp_info_len >= 1)
- 		ieee80211_handle_erp_ie(dev, elems.erp_info[0]);
-@@ -2375,7 +2355,7 @@ static int ieee80211_sta_create_ibss(str
- {
- 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- 	struct ieee80211_sta_bss *bss;
--	struct ieee80211_sub_if_data *sdata;
-+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- 	struct ieee80211_hw_mode *mode;
- 	u8 bssid[ETH_ALEN], *pos;
- 	int i;
-@@ -2398,18 +2378,17 @@ static int ieee80211_sta_create_ibss(str
- 	printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %s\n",
- 	       dev->name, print_mac(mac, bssid));
- 
--	bss = ieee80211_rx_bss_add(dev, bssid);
-+	bss = ieee80211_rx_bss_add(dev, bssid, local->hw.conf.channel,
-+				   sdata->u.sta.ssid, sdata->u.sta.ssid_len);
- 	if (!bss)
- 		return -ENOMEM;
- 
--	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- 	mode = local->oper_hw_mode;
- 
- 	if (local->hw.conf.beacon_int == 0)
- 		local->hw.conf.beacon_int = 100;
- 	bss->beacon_int = local->hw.conf.beacon_int;
- 	bss->hw_mode = local->hw.conf.phymode;
--	bss->channel = local->hw.conf.channel;
- 	bss->freq = local->hw.conf.freq;
- 	bss->last_update = jiffies;
- 	bss->capability = WLAN_CAPABILITY_IBSS;
-@@ -2469,7 +2448,8 @@ static int ieee80211_sta_find_ibss(struc
- 	       "%s\n", print_mac(mac, bssid), print_mac(mac2, ifsta->bssid));
- #endif /* CONFIG_MAC80211_IBSS_DEBUG */
- 	if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 &&
--	    (bss = ieee80211_rx_bss_get(dev, bssid))) {
-+	    (bss = ieee80211_rx_bss_get(dev, bssid, local->hw.conf.channel,
-+					ifsta->ssid, ifsta->ssid_len))) {
- 		printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"
- 		       " based on configured SSID\n",
- 		       dev->name, print_mac(mac, bssid));
-diff -up linux-2.6.23.noarch/drivers/net/wireless/ipw2100.h.orig linux-2.6.23.noarch/drivers/net/wireless/ipw2100.h
---- linux-2.6.23.noarch/drivers/net/wireless/ipw2100.h.orig	2007-10-09 16:31:38.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/ipw2100.h	2007-10-18 20:22:45.000000000 -0400
-@@ -588,6 +588,10 @@ struct ipw2100_priv {
- 	struct delayed_work wx_event_work;
- 	struct delayed_work hang_check;
- 	struct delayed_work rf_kill;
-+	struct work_struct scan_event_now;
-+	struct delayed_work scan_event_later;
-+
-+	int user_requested_scan;
- 
- 	u32 interrupts;
- 	int tx_interrupts;
-diff -up linux-2.6.23.noarch/drivers/net/wireless/p54common.c.orig linux-2.6.23.noarch/drivers/net/wireless/p54common.c
---- linux-2.6.23.noarch/drivers/net/wireless/p54common.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/p54common.c	2007-10-18 20:22:45.000000000 -0400
-@@ -577,7 +577,7 @@ static int p54_set_filter(struct ieee802
- 	struct p54_tx_control_filter *filter;
- 
- 	hdr = kzalloc(sizeof(*hdr) + sizeof(*filter) +
--		      priv->tx_hdr_len, GFP_KERNEL);
-+		      priv->tx_hdr_len, GFP_ATOMIC);
- 	if (!hdr)
- 		return -ENOMEM;
- 
-diff -up linux-2.6.23.noarch/drivers/net/wireless/b43/main.c.orig linux-2.6.23.noarch/drivers/net/wireless/b43/main.c
---- linux-2.6.23.noarch/drivers/net/wireless/b43/main.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/b43/main.c	2007-10-18 20:22:45.000000000 -0400
-@@ -49,7 +49,6 @@
- #include "pio.h"
- #include "sysfs.h"
- #include "xmit.h"
--#include "sysfs.h"
- #include "lo.h"
- #include "pcmcia.h"
- 
-@@ -3495,7 +3494,7 @@ static int b43_start(struct ieee80211_hw
- 	struct b43_wl *wl = hw_to_b43_wl(hw);
- 	struct b43_wldev *dev = wl->current_dev;
- 	int did_init = 0;
--	int err;
-+	int err = 0;
- 
- 	mutex_lock(&wl->mutex);
- 
-@@ -3521,7 +3520,7 @@ static int b43_start(struct ieee80211_hw
- 	return err;
+diff -up linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00.h.orig linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00.h
+--- linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00.h.orig	2007-11-21 13:41:14.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00.h	2007-11-21 14:02:49.000000000 -0500
+@@ -418,7 +418,7 @@ struct rt2x00lib_ops {
+ 	int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
+ 			      struct data_ring *ring, struct sk_buff *skb,
+ 			      struct ieee80211_tx_control *control);
+-	int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, int maxpacket,
++	int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,
+ 				struct sk_buff *skb);
+ 	void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
+ 			       unsigned int queue);
+@@ -599,6 +599,11 @@ struct rt2x00_dev {
+ 	u32 *rf;
+ 
+ 	/*
++	 * USB Max frame size (for rt2500usb & rt73usb).
++	 */
++	u16 usb_maxpacket;
++
++	/*
+ 	 * Current TX power value.
+ 	 */
+ 	u16 tx_power;
+diff -up linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00usb.c.orig linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00usb.c
+--- linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00usb.c.orig	2007-11-21 13:41:14.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00usb.c	2007-11-21 14:02:49.000000000 -0500
+@@ -159,7 +159,6 @@ int rt2x00usb_write_tx_data(struct rt2x0
+ 	    interface_to_usbdev(rt2x00dev_usb(rt2x00dev));
+ 	struct data_entry *entry = rt2x00_get_data_entry(ring);
+ 	int pipe = usb_sndbulkpipe(usb_dev, 1);
+-	int max_packet = usb_maxpacket(usb_dev, pipe, 1);
+ 	u32 length;
+ 
+ 	if (rt2x00_ring_full(ring)) {
+@@ -194,8 +193,7 @@ int rt2x00usb_write_tx_data(struct rt2x0
+ 	 * length of the data to usb_fill_bulk_urb. Pass the skb
+ 	 * to the driver to determine what the length should be.
+ 	 */
+-	length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev,
+-						      max_packet, skb);
++	length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev, skb);
+ 
+ 	/*
+ 	 * Initialize URB and send the frame to the device.
+@@ -490,6 +488,11 @@ int rt2x00usb_probe(struct usb_interface
+ 	rt2x00dev->ops = ops;
+ 	rt2x00dev->hw = hw;
+ 
++	rt2x00dev->usb_maxpacket =
++	    usb_maxpacket(usb_dev, usb_sndbulkpipe(usb_dev, 1), 1);
++	if (!rt2x00dev->usb_maxpacket)
++		rt2x00dev->usb_maxpacket = 1;
++
+ 	retval = rt2x00usb_alloc_reg(rt2x00dev);
+ 	if (retval)
+ 		goto exit_free_device;
+diff -up linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2500usb.c.orig linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2500usb.c
+--- linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2500usb.c.orig	2007-11-21 13:41:14.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2500usb.c	2007-11-21 14:02:49.000000000 -0500
+@@ -1032,7 +1032,7 @@ static void rt2500usb_write_tx_desc(stru
  }
  
--void b43_stop(struct ieee80211_hw *hw)
-+static void b43_stop(struct ieee80211_hw *hw)
- {
- 	struct b43_wl *wl = hw_to_b43_wl(hw);
- 	struct b43_wldev *dev = wl->current_dev;
-diff -up linux-2.6.23.noarch/drivers/net/wireless/zd1211rw/zd_usb.c.orig linux-2.6.23.noarch/drivers/net/wireless/zd1211rw/zd_usb.c
---- linux-2.6.23.noarch/drivers/net/wireless/zd1211rw/zd_usb.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/zd1211rw/zd_usb.c	2007-10-18 20:22:45.000000000 -0400
-@@ -1044,14 +1044,17 @@ error:
- static void disconnect(struct usb_interface *intf)
- {
- 	struct net_device *netdev = zd_intf_to_netdev(intf);
--	struct zd_mac *mac = zd_netdev_mac(netdev);
--	struct zd_usb *usb = &mac->chip.usb;
-+	struct zd_mac *mac;
-+	struct zd_usb *usb;
- 
- 	/* Either something really bad happened, or we're just dealing with
- 	 * a DEVICE_INSTALLER. */
- 	if (netdev == NULL)
- 		return;
+ static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
+-				     int maxpacket, struct sk_buff *skb)
++				     struct sk_buff *skb)
+ {
+ 	int length;
+ 
+@@ -1041,7 +1041,7 @@ static int rt2500usb_get_tx_data_len(str
+ 	 * but it must _not_ be a multiple of the USB packet size.
+ 	 */
+ 	length = roundup(skb->len, 2);
+-	length += (2 * !(length % maxpacket));
++	length += (2 * !(length % rt2x00dev->usb_maxpacket));
  
-+	mac = zd_netdev_mac(netdev);
-+	usb = &mac->chip.usb;
-+
- 	dev_dbg_f(zd_usb_dev(usb), "\n");
- 
- 	zd_netdev_disconnect(netdev);
-diff -up linux-2.6.23.noarch/drivers/net/wireless/b43legacy/main.c.orig linux-2.6.23.noarch/drivers/net/wireless/b43legacy/main.c
---- linux-2.6.23.noarch/drivers/net/wireless/b43legacy/main.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/b43legacy/main.c	2007-10-18 20:22:45.000000000 -0400
-@@ -3306,7 +3306,7 @@ static int b43legacy_start(struct ieee80
- 	struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
- 	struct b43legacy_wldev *dev = wl->current_dev;
- 	int did_init = 0;
--	int err;
-+	int err = 0;
- 
- 	mutex_lock(&wl->mutex);
- 
-diff -up linux-2.6.23.noarch/drivers/net/wireless/rtl8187_dev.c.orig linux-2.6.23.noarch/drivers/net/wireless/rtl8187_dev.c
---- linux-2.6.23.noarch/drivers/net/wireless/rtl8187_dev.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/rtl8187_dev.c	2007-10-18 20:22:45.000000000 -0400
-@@ -131,7 +131,8 @@ static int rtl8187_tx(struct ieee80211_h
- 	struct rtl8187_tx_hdr *hdr;
- 	struct rtl8187_tx_info *info;
- 	struct urb *urb;
--	u32 tmp;
-+	__le16 rts_dur = 0;
-+	u32 flags;
- 
- 	urb = usb_alloc_urb(0, GFP_ATOMIC);
- 	if (!urb) {
-@@ -139,24 +140,24 @@ static int rtl8187_tx(struct ieee80211_h
- 		return 0;
- 	}
- 
--	hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
--	tmp = skb->len - sizeof(*hdr);
--	tmp |= RTL8187_TX_FLAG_NO_ENCRYPT;
--	tmp |= control->rts_cts_rate << 19;
--	tmp |= control->tx_rate << 24;
--	if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb))
--		tmp |= RTL8187_TX_FLAG_MORE_FRAG;
-+	flags = skb->len;
-+	flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
-+	flags |= control->rts_cts_rate << 19;
-+	flags |= control->tx_rate << 24;
-+	if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
-+		flags |= RTL8187_TX_FLAG_MORE_FRAG;
- 	if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
--		tmp |= RTL8187_TX_FLAG_RTS;
--		hdr->rts_duration =
--			ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
-+		flags |= RTL8187_TX_FLAG_RTS;
-+		rts_dur = ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
- 	}
- 	if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)
--		tmp |= RTL8187_TX_FLAG_CTS;
--	hdr->flags = cpu_to_le32(tmp);
-+		flags |= RTL8187_TX_FLAG_CTS;
-+
-+	hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
-+	hdr->flags = cpu_to_le32(flags);
- 	hdr->len = 0;
--	tmp = control->retry_limit << 8;
--	hdr->retry = cpu_to_le32(tmp);
-+	hdr->rts_duration = rts_dur;
-+	hdr->retry = cpu_to_le32(control->retry_limit << 8);
- 
- 	info = (struct rtl8187_tx_info *)skb->cb;
- 	info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC);
-@@ -587,8 +588,6 @@ static void rtl8187_configure_filter(str
- 
- 	*total_flags = 0;
- 
--	if (changed_flags & FIF_PROMISC_IN_BSS)
--		priv->rx_conf ^= RTL818X_RX_CONF_NICMAC;
- 	if (changed_flags & FIF_ALLMULTI)
- 		priv->rx_conf ^= RTL818X_RX_CONF_MULTICAST;
- 	if (changed_flags & FIF_FCSFAIL)
-@@ -601,8 +600,6 @@ static void rtl8187_configure_filter(str
- 	if (mc_count > 0)
- 		priv->rx_conf |= RTL818X_RX_CONF_MULTICAST;
- 
--	if (priv->rx_conf & RTL818X_RX_CONF_NICMAC)
--		*total_flags |= FIF_PROMISC_IN_BSS;
- 	if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST)
- 		*total_flags |= FIF_ALLMULTI;
- 	if (priv->rx_conf & RTL818X_RX_CONF_FCS)
-diff -up linux-2.6.23.noarch/drivers/net/wireless/ipw2100.c.orig linux-2.6.23.noarch/drivers/net/wireless/ipw2100.c
---- linux-2.6.23.noarch/drivers/net/wireless/ipw2100.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/ipw2100.c	2007-10-18 20:22:45.000000000 -0400
-@@ -2105,12 +2105,46 @@ static void isr_indicate_rf_kill(struct 
- 	queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
+ 	return length;
  }
+@@ -1643,7 +1643,6 @@ static int rt2500usb_beacon_update(struc
+ 	struct data_entry *beacon;
+ 	struct data_entry *guardian;
+ 	int pipe = usb_sndbulkpipe(usb_dev, 1);
+-	int max_packet = usb_maxpacket(usb_dev, pipe, 1);
+ 	int length;
+ 
+ 	/*
+@@ -1672,7 +1671,7 @@ static int rt2500usb_beacon_update(struc
+ 							 ring->desc_size),
+ 				skb->len - ring->desc_size, control);
  
-+static void send_scan_event(void *data)
-+{
-+	struct ipw2100_priv *priv = data;
-+	union iwreq_data wrqu;
-+
-+	wrqu.data.length = 0;
-+	wrqu.data.flags = 0;
-+	wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL);
-+}
-+
-+static void ipw2100_scan_event_later(struct work_struct *work)
+-	length = rt2500usb_get_tx_data_len(rt2x00dev, max_packet, skb);
++	length = rt2500usb_get_tx_data_len(rt2x00dev, skb);
+ 
+ 	usb_fill_bulk_urb(beacon->priv, usb_dev, pipe,
+ 			  skb->data, length, rt2500usb_beacondone, beacon);
+diff -up linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_tkip.c.orig linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_tkip.c
+--- linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_tkip.c.orig	2007-11-21 14:02:25.000000000 -0500
++++ linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_tkip.c	2007-11-21 14:02:29.000000000 -0500
+@@ -464,7 +464,7 @@ static int ieee80211_tkip_decrypt(struct
+ 	pos += 8;
+ 
+ 	if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
+-		if (net_ratelimit()) {
++		if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
+ 			IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s"
+ 			       " previous TSC %08x%04x received TSC "
+ 			       "%08x%04x\n", print_mac(mac, hdr->addr2),
+@@ -504,7 +504,7 @@ static int ieee80211_tkip_decrypt(struct
+ 			 * it needs to be recalculated for the next packet. */
+ 			tkey->rx_phase1_done = 0;
+ 		}
+-		if (net_ratelimit()) {
++		if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
+ 			IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA="
+ 			       "%s\n", print_mac(mac, hdr->addr2));
+ 		}
+diff -up linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_ccmp.c.orig linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_ccmp.c
+--- linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_ccmp.c.orig	2007-11-21 14:02:25.000000000 -0500
++++ linux-2.6.23.noarch/net/ieee80211/ieee80211_crypt_ccmp.c	2007-11-21 14:02:29.000000000 -0500
+@@ -338,7 +338,7 @@ static int ieee80211_ccmp_decrypt(struct
+ 	pos += 8;
+ 
+ 	if (ccmp_replay_check(pn, key->rx_pn)) {
+-		if (net_ratelimit()) {
++		if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
+ 			IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s "
+ 				 "previous PN %02x%02x%02x%02x%02x%02x "
+ 				 "received PN %02x%02x%02x%02x%02x%02x\n",
+diff -up linux-2.6.23.noarch/net/mac80211/ieee80211_sta.c.orig linux-2.6.23.noarch/net/mac80211/ieee80211_sta.c
+--- linux-2.6.23.noarch/net/mac80211/ieee80211_sta.c.orig	2007-11-21 14:02:25.000000000 -0500
++++ linux-2.6.23.noarch/net/mac80211/ieee80211_sta.c	2007-11-21 14:02:29.000000000 -0500
+@@ -2647,7 +2647,7 @@ void ieee80211_scan_completed(struct iee
+ 	local->sta_scanning = 0;
+ 
+ 	if (ieee80211_hw_config(local))
+-		printk(KERN_DEBUG "%s: failed to restore operational"
++		printk(KERN_DEBUG "%s: failed to restore operational "
+ 		       "channel after scan\n", dev->name);
+ 
+ 
+diff -up linux-2.6.23.noarch/net/mac80211/ieee80211.c.orig linux-2.6.23.noarch/net/mac80211/ieee80211.c
+--- linux-2.6.23.noarch/net/mac80211/ieee80211.c.orig	2007-11-21 14:02:25.000000000 -0500
++++ linux-2.6.23.noarch/net/mac80211/ieee80211.c	2007-11-21 14:02:29.000000000 -0500
+@@ -267,6 +267,17 @@ static int ieee80211_open(struct net_dev
+ 		tasklet_enable(&local->tasklet);
+ 	}
+ 
++	/*
++	 * set_multicast_list will be invoked by the networking core
++	 * which will check whether any increments here were done in
++	 * error and sync them down to the hardware as filter flags.
++	 */
++	if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
++		atomic_inc(&local->iff_allmultis);
++
++	if (sdata->flags & IEEE80211_SDATA_PROMISC)
++		atomic_inc(&local->iff_promiscs);
++
+ 	local->open_count++;
+ 
+ 	netif_start_queue(dev);
+@@ -284,6 +295,18 @@ static int ieee80211_stop(struct net_dev
+ 
+ 	netif_stop_queue(dev);
+ 
++	/*
++	 * Don't count this interface for promisc/allmulti while it
++	 * is down. dev_mc_unsync() will invoke set_multicast_list
++	 * on the master interface which will sync these down to the
++	 * hardware as filter flags.
++	 */
++	if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
++		atomic_dec(&local->iff_allmultis);
++
++	if (sdata->flags & IEEE80211_SDATA_PROMISC)
++		atomic_dec(&local->iff_promiscs);
++
+ 	dev_mc_unsync(local->mdev, dev);
+ 
+ 	/* down all dependent devices, that is VLANs */
+@@ -366,8 +389,8 @@ static void ieee80211_set_multicast_list
+ 
+ 	allmulti = !!(dev->flags & IFF_ALLMULTI);
+ 	promisc = !!(dev->flags & IFF_PROMISC);
+-	sdata_allmulti = sdata->flags & IEEE80211_SDATA_ALLMULTI;
+-	sdata_promisc = sdata->flags & IEEE80211_SDATA_PROMISC;
++	sdata_allmulti = !!(sdata->flags & IEEE80211_SDATA_ALLMULTI);
++	sdata_promisc = !!(sdata->flags & IEEE80211_SDATA_PROMISC);
+ 
+ 	if (allmulti != sdata_allmulti) {
+ 		if (dev->flags & IFF_ALLMULTI)
+diff -up linux-2.6.23.noarch/include/net/ieee80211.h.orig linux-2.6.23.noarch/include/net/ieee80211.h
+--- linux-2.6.23.noarch/include/net/ieee80211.h.orig	2007-11-21 14:02:25.000000000 -0500
++++ linux-2.6.23.noarch/include/net/ieee80211.h	2007-11-21 14:02:29.000000000 -0500
+@@ -115,8 +115,16 @@ extern u32 ieee80211_debug_level;
+ do { if (ieee80211_debug_level & (level)) \
+   printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
+          in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
++static inline bool ieee80211_ratelimit_debug(u32 level)
 +{
-+	send_scan_event(container_of(work, struct ipw2100_priv,
-+					scan_event_later.work));
++	return (ieee80211_debug_level & level) && net_ratelimit();
 +}
-+
-+static void ipw2100_scan_event_now(struct work_struct *work)
+ #else
+ #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
++static inline bool ieee80211_ratelimit_debug(u32 level)
 +{
-+	send_scan_event(container_of(work, struct ipw2100_priv,
-+					scan_event_now));
++	return false;
 +}
-+
- static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)
- {
- 	IPW_DEBUG_SCAN("scan complete\n");
- 	/* Age the scan results... */
- 	priv->ieee->scans++;
- 	priv->status &= ~STATUS_SCANNING;
-+
-+	/* Only userspace-requested scan completion events go out immediately */
-+	if (!priv->user_requested_scan) {
-+		if (!delayed_work_pending(&priv->scan_event_later))
-+			queue_delayed_work(priv->workqueue,
-+					&priv->scan_event_later,
-+					round_jiffies(msecs_to_jiffies(4000)));
-+	} else {
-+		priv->user_requested_scan = 0;
-+		cancel_delayed_work(&priv->scan_event_later);
-+		queue_work(priv->workqueue, &priv->scan_event_now);
-+	}
- }
- 
- #ifdef CONFIG_IPW2100_DEBUG
-@@ -4378,6 +4412,7 @@ static void ipw2100_kill_workqueue(struc
- 		cancel_delayed_work(&priv->wx_event_work);
- 		cancel_delayed_work(&priv->hang_check);
- 		cancel_delayed_work(&priv->rf_kill);
-+		cancel_delayed_work(&priv->scan_event_later);
- 		destroy_workqueue(priv->workqueue);
- 		priv->workqueue = NULL;
- 	}
-@@ -6121,6 +6156,8 @@ static struct net_device *ipw2100_alloc_
- 	INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work);
- 	INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check);
- 	INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
-+	INIT_WORK(&priv->scan_event_now, ipw2100_scan_event_now);
-+	INIT_DELAYED_WORK(&priv->scan_event_later, ipw2100_scan_event_later);
- 
- 	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
- 		     ipw2100_irq_tasklet, (unsigned long)priv);
-@@ -7425,6 +7462,8 @@ static int ipw2100_wx_set_scan(struct ne
- 	}
- 
- 	IPW_DEBUG_WX("Initiating scan...\n");
-+
-+	priv->user_requested_scan = 1;
- 	if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) {
- 		IPW_DEBUG_WX("Start scan failed.\n");
- 
-diff -up linux-2.6.23.noarch/drivers/net/wireless/zd1201.c.orig linux-2.6.23.noarch/drivers/net/wireless/zd1201.c
---- linux-2.6.23.noarch/drivers/net/wireless/zd1201.c.orig	2007-10-09 16:31:38.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/zd1201.c	2007-10-18 20:22:45.000000000 -0400
-@@ -327,8 +327,8 @@ static void zd1201_usbrx(struct urb *urb
- 			memcpy(skb_put(skb, 6), &data[datalen-8], 6);
- 			memcpy(skb_put(skb, 2), &data[datalen-24], 2);
- 			memcpy(skb_put(skb, len), data, len);
--			skb->dev->last_rx = jiffies;
- 			skb->protocol = eth_type_trans(skb, zd->dev);
-+			skb->dev->last_rx = jiffies;
- 			zd->stats.rx_packets++;
- 			zd->stats.rx_bytes += skb->len;
- 			netif_rx(skb);
-@@ -384,8 +384,8 @@ static void zd1201_usbrx(struct urb *urb
- 			memcpy(skb_put(skb, 2), &data[6], 2);
- 			memcpy(skb_put(skb, len), data+8, len);
- 		}
--		skb->dev->last_rx = jiffies;
- 		skb->protocol = eth_type_trans(skb, zd->dev);
-+		skb->dev->last_rx = jiffies;
- 		zd->stats.rx_packets++;
- 		zd->stats.rx_bytes += skb->len;
- 		netif_rx(skb);
-diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
---- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c	2007-10-18 20:22:45.000000000 -0400
-@@ -36,9 +36,6 @@
- 
- #include <linux/workqueue.h>
- 
--#include <net/mac80211.h>
--#include <linux/wireless.h>
--
- #define IWL 4965
- 
- #include "../net/mac80211/ieee80211_rate.h"
-@@ -2024,12 +2021,18 @@ static int open_file_generic(struct inod
- static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
- 				struct iwl_rate *mcs, int index)
- {
--	const u32 cck_rate = 0x820A;
-+	u32 base_rate;
-+
-+	if (rs_priv->phymode == (u8) MODE_IEEE80211A)
-+		base_rate = 0x800D;
-+	else
-+		base_rate = 0x820A;
-+
- 	if (rs_priv->dbg_fixed.rate_n_flags) {
- 		if (index < 12)
- 			mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags;
- 		else
--			mcs->rate_n_flags = cck_rate;
-+			mcs->rate_n_flags = base_rate;
- 		IWL_DEBUG_RATE("Fixed rate ON\n");
- 		return;
- 	}
-diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c
---- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c	2007-10-18 20:22:45.000000000 -0400
-@@ -38,7 +38,6 @@
- #include <net/mac80211.h>
- 
- #include <linux/etherdevice.h>
--#include <linux/delay.h>
- 
- #define IWL 3945
- 
-diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c
---- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c	2007-10-18 20:22:45.000000000 -0400
-@@ -48,8 +48,6 @@
- #include <linux/netdevice.h>
- #include <linux/wireless.h>
- #include <linux/firmware.h>
--#include <linux/skbuff.h>
--#include <linux/netdevice.h>
- #include <linux/etherdevice.h>
- #include <linux/if_arp.h>
- 
-@@ -1802,21 +1800,22 @@ static void iwl_unset_hw_setting(struct 
-  * return : set the bit for each supported rate insert in ie
-  */
- static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
--				    u16 basic_rate, int max_count)
-+				    u16 basic_rate, int *left)
- {
- 	u16 ret_rates = 0, bit;
- 	int i;
--	u8 *rates;
--
--	rates = &(ie[1]);
-+	u8 *cnt = ie;
-+	u8 *rates = ie + 1;
- 
- 	for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
- 		if (bit & supported_rate) {
- 			ret_rates |= bit;
--			rates[*ie] = iwl_rates[i].ieee |
--			    ((bit & basic_rate) ? 0x80 : 0x00);
--			*ie = *ie + 1;
--			if (*ie >= max_count)
-+			rates[*cnt] = iwl_rates[i].ieee |
-+				((bit & basic_rate) ? 0x80 : 0x00);
-+			(*cnt)++;
-+			(*left)--;
-+			if ((*left <= 0) ||
-+			    (*cnt >= IWL_SUPPORTED_RATES_IE_LEN))
- 				break;
- 		}
- 	}
-@@ -1839,7 +1838,7 @@ static u16 iwl_fill_probe_req(struct iwl
- {
- 	int len = 0;
- 	u8 *pos = NULL;
--	u16 ret_rates;
-+	u16 active_rates, ret_rates, cck_rates;
- 
- 	/* Make sure there is enough space for the probe request,
- 	 * two mandatory IEs and the data */
-@@ -1884,19 +1883,27 @@ static u16 iwl_fill_probe_req(struct iwl
- 	left -= 2;
- 	if (left < 0)
- 		return 0;
-+
- 	/* ... fill it in... */
- 	*pos++ = WLAN_EID_SUPP_RATES;
- 	*pos = 0;
--	ret_rates = priv->active_rate = priv->rates_mask;
-+
-+	priv->active_rate = priv->rates_mask;
-+	active_rates = priv->active_rate;
- 	priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
- 
--	iwl_supported_rate_to_ie(pos, priv->active_rate,
--				 priv->active_rate_basic, left);
-+	cck_rates = IWL_CCK_RATES_MASK & active_rates;
-+	ret_rates = iwl_supported_rate_to_ie(pos, cck_rates,
-+			priv->active_rate_basic, &left);
-+	active_rates &= ~ret_rates;
-+
-+	ret_rates = iwl_supported_rate_to_ie(pos, active_rates,
-+				 priv->active_rate_basic, &left);
-+	active_rates &= ~ret_rates;
-+
- 	len += 2 + *pos;
- 	pos += (*pos) + 1;
--	ret_rates = ~ret_rates & priv->active_rate;
--
--	if (ret_rates == 0)
-+	if (active_rates == 0)
- 		goto fill_end;
- 
- 	/* fill in supported extended rate */
-@@ -1907,7 +1914,8 @@ static u16 iwl_fill_probe_req(struct iwl
- 	/* ... fill it in... */
- 	*pos++ = WLAN_EID_EXT_SUPP_RATES;
- 	*pos = 0;
--	iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left);
-+	iwl_supported_rate_to_ie(pos, active_rates,
-+				 priv->active_rate_basic, &left);
- 	if (*pos > 0)
- 		len += 2 + *pos;
- 
-@@ -4494,13 +4502,13 @@ static u8 ratio2dB[100] = {
-  * Conversion assumes that levels are voltages (20*log), not powers (10*log). */
- int iwl_calc_db_from_ratio(int sig_ratio)
- {
--	/* Anything above 1000:1 just report as 60 dB */
--	if (sig_ratio > 1000)
-+	/* 1000:1 or higher just report as 60 dB */
-+	if (sig_ratio >= 1000)
- 		return 60;
- 
--	/* Above 100:1, divide by 10 and use table,
-+	/* 100:1 or higher, divide by 10 and use table,
- 	 *   add 20 dB to make up for divide by 10 */
--	if (sig_ratio > 100)
-+	if (sig_ratio >= 100)
- 		return (20 + (int)ratio2dB[sig_ratio/10]);
- 
- 	/* We shouldn't see this */
-diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c
---- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c	2007-10-18 20:22:45.000000000 -0400
-@@ -35,9 +35,7 @@
- #include <linux/netdevice.h>
- #include <linux/wireless.h>
- #include <net/mac80211.h>
--#include <linux/netdevice.h>
- #include <linux/etherdevice.h>
--#include <linux/delay.h>
- 
- #define IWL 4965
- 
-diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwlwifi.h.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwlwifi.h
---- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwlwifi.h.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwlwifi.h	2007-10-18 20:22:45.000000000 -0400
-@@ -39,18 +39,13 @@ struct iwl_priv;
- /* Hardware specific file defines the PCI IDs table for that hardware module */
- extern struct pci_device_id iwl_hw_card_ids[];
- 
-+#include "iwl-hw.h"
- #if IWL == 3945
--
- #define DRV_NAME	"iwl3945"
--#include "iwl-hw.h"
- #include "iwl-3945-hw.h"
--
- #elif IWL == 4965
--
- #define DRV_NAME        "iwl4965"
--#include "iwl-hw.h"
- #include "iwl-4965-hw.h"
--
- #endif
- 
- #include "iwl-prph.h"
-diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c
---- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c	2007-10-18 20:22:45.000000000 -0400
-@@ -48,8 +48,6 @@
- #include <linux/netdevice.h>
- #include <linux/wireless.h>
- #include <linux/firmware.h>
--#include <linux/skbuff.h>
--#include <linux/netdevice.h>
- #include <linux/etherdevice.h>
- #include <linux/if_arp.h>
- 
-@@ -1749,21 +1747,22 @@ static void iwl_unset_hw_setting(struct 
-  * return : set the bit for each supported rate insert in ie
-  */
- static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
--				    u16 basic_rate, int max_count)
-+				    u16 basic_rate, int *left)
- {
- 	u16 ret_rates = 0, bit;
- 	int i;
--	u8 *rates;
--
--	rates = &(ie[1]);
-+	u8 *cnt = ie;
-+	u8 *rates = ie + 1;
- 
- 	for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
- 		if (bit & supported_rate) {
- 			ret_rates |= bit;
--			rates[*ie] = iwl_rates[i].ieee |
--			    ((bit & basic_rate) ? 0x80 : 0x00);
--			*ie = *ie + 1;
--			if (*ie >= max_count)
-+			rates[*cnt] = iwl_rates[i].ieee |
-+				((bit & basic_rate) ? 0x80 : 0x00);
-+			(*cnt)++;
-+			(*left)--;
-+			if ((*left <= 0) ||
-+			    (*cnt >= IWL_SUPPORTED_RATES_IE_LEN))
- 				break;
- 		}
- 	}
-@@ -1780,7 +1779,7 @@ static u16 iwl_fill_probe_req(struct iwl
- {
- 	int len = 0;
- 	u8 *pos = NULL;
--	u16 ret_rates;
-+	u16 active_rates, ret_rates, cck_rates;
- 
- 	/* Make sure there is enough space for the probe request,
- 	 * two mandatory IEs and the data */
-@@ -1825,19 +1824,27 @@ static u16 iwl_fill_probe_req(struct iwl
- 	left -= 2;
- 	if (left < 0)
- 		return 0;
-+
- 	/* ... fill it in... */
- 	*pos++ = WLAN_EID_SUPP_RATES;
- 	*pos = 0;
--	ret_rates = priv->active_rate = priv->rates_mask;
-+
-+	priv->active_rate = priv->rates_mask;
-+	active_rates = priv->active_rate;
- 	priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
- 
--	iwl_supported_rate_to_ie(pos, priv->active_rate,
--				 priv->active_rate_basic, left);
-+	cck_rates = IWL_CCK_RATES_MASK & active_rates;
-+	ret_rates = iwl_supported_rate_to_ie(pos, cck_rates,
-+			priv->active_rate_basic, &left);
-+	active_rates &= ~ret_rates;
-+
-+	ret_rates = iwl_supported_rate_to_ie(pos, active_rates,
-+				 priv->active_rate_basic, &left);
-+	active_rates &= ~ret_rates;
-+
- 	len += 2 + *pos;
- 	pos += (*pos) + 1;
--	ret_rates = ~ret_rates & priv->active_rate;
--
--	if (ret_rates == 0)
-+	if (active_rates == 0)
- 		goto fill_end;
- 
- 	/* fill in supported extended rate */
-@@ -1848,7 +1855,8 @@ static u16 iwl_fill_probe_req(struct iwl
- 	/* ... fill it in... */
- 	*pos++ = WLAN_EID_EXT_SUPP_RATES;
- 	*pos = 0;
--	iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left);
-+	iwl_supported_rate_to_ie(pos, active_rates,
-+				 priv->active_rate_basic, &left);
- 	if (*pos > 0)
- 		len += 2 + *pos;
- 
-diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-3945-rs.c.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
---- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-3945-rs.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl-3945-rs.c	2007-10-18 20:22:45.000000000 -0400
-@@ -37,9 +37,6 @@
- 
- #include <linux/workqueue.h>
- 
--#include <net/mac80211.h>
--#include <linux/wireless.h>
--
- #define IWL 3945
- 
- #include "../net/mac80211/ieee80211_rate.h"
-diff -up linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00dev.c.orig linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00dev.c
---- linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00dev.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt2x00dev.c	2007-10-18 20:22:45.000000000 -0400
-@@ -550,7 +550,7 @@ void rt2x00lib_write_tx_desc(struct rt2x
- 			/*
- 			 * Check if we need to set the Length Extension
- 			 */
--			if (bitrate == 110 && residual <= 3)
-+			if (bitrate == 110 && residual <= 30)
- 				desc.service |= 0x80;
- 		}
- 
-diff -up linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt73usb.c.orig linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt73usb.c
---- linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt73usb.c.orig	2007-10-18 20:13:55.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/rt2x00/rt73usb.c	2007-10-18 20:22:45.000000000 -0400
-@@ -2029,6 +2029,7 @@ static struct usb_device_id rt73usb_devi
- 	{ USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt73usb_ops) },
- 	{ USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) },
- 	{ USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) },
-+	{ USB_DEVICE(0x050d, 0x905c), USB_DEVICE_DATA(&rt73usb_ops) },
- 	/* Billionton */
- 	{ USB_DEVICE(0x1631, 0xc019), USB_DEVICE_DATA(&rt73usb_ops) },
- 	/* Buffalo */
-diff -up linux-2.6.23.noarch/drivers/ssb/driver_mipscore.c.orig linux-2.6.23.noarch/drivers/ssb/driver_mipscore.c
---- linux-2.6.23.noarch/drivers/ssb/driver_mipscore.c.orig	2007-10-18 20:13:56.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/ssb/driver_mipscore.c	2007-10-18 20:19:09.000000000 -0400
-@@ -173,7 +173,7 @@ u32 ssb_cpu_clock(struct ssb_mipscore *m
- 
- void ssb_mipscore_init(struct ssb_mipscore *mcore)
- {
--	struct ssb_bus *bus = mcore->dev->bus;
-+	struct ssb_bus *bus;
- 	struct ssb_device *dev;
- 	unsigned long hz, ns;
- 	unsigned int irq, i;
-@@ -183,6 +183,7 @@ void ssb_mipscore_init(struct ssb_mipsco
- 
- 	ssb_dprintk(KERN_INFO PFX "Initializing MIPS core...\n");
- 
-+	bus = mcore->dev->bus;
- 	hz = ssb_clockspeed(bus);
- 	if (!hz)
- 		hz = 100000000;
-diff -up linux-2.6.23.noarch/drivers/ssb/Kconfig.orig linux-2.6.23.noarch/drivers/ssb/Kconfig
---- linux-2.6.23.noarch/drivers/ssb/Kconfig.orig	2007-10-18 20:13:56.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/ssb/Kconfig	2007-10-18 20:19:09.000000000 -0400
-@@ -22,7 +22,7 @@ config SSB
- 
- config SSB_PCIHOST_POSSIBLE
- 	bool
--	depends on SSB && PCI
-+	depends on SSB && (PCI = y || PCI = SSB)
- 	default y
- 
- config SSB_PCIHOST
-@@ -37,7 +37,7 @@ config SSB_PCIHOST
- 
- config SSB_PCMCIAHOST_POSSIBLE
- 	bool
--	depends on SSB && PCMCIA && EXPERIMENTAL
-+	depends on SSB && (PCMCIA = y || PCMCIA = SSB) && EXPERIMENTAL
- 	default y
+ #endif				/* CONFIG_IEEE80211_DEBUG */
  
- config SSB_PCMCIAHOST
+ /* escape_essid() is intended to be used in debug (and possibly error)

linux-2.6-zd1211rw-mac80211.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.5 -r 1.6 linux-2.6-zd1211rw-mac80211.patch
Index: linux-2.6-zd1211rw-mac80211.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-zd1211rw-mac80211.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-zd1211rw-mac80211.patch	19 Oct 2007 01:16:55 -0000	1.5
+++ linux-2.6-zd1211rw-mac80211.patch	21 Nov 2007 20:06:42 -0000	1.6
@@ -1,27 +1,16 @@
-diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
---- linux-2.6.23.noarch/MAINTAINERS.orig	2007-10-18 20:45:39.000000000 -0400
-+++ linux-2.6.23.noarch/MAINTAINERS	2007-10-18 20:46:43.000000000 -0400
-@@ -4317,6 +4317,16 @@ W:	http://www.qsl.net/dl1bke/
- L:	linux-hams at vger.kernel.org
- S:	Maintained
+diff -up linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.23.noarch/drivers/net/wireless/Kconfig
+--- linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig	2007-11-21 14:26:06.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Kconfig	2007-11-21 14:26:32.000000000 -0500
+@@ -634,5 +634,6 @@ source "drivers/net/wireless/b43/Kconfig
+ source "drivers/net/wireless/b43legacy/Kconfig"
+ source "drivers/net/wireless/zd1211rw/Kconfig"
+ source "drivers/net/wireless/rt2x00/Kconfig"
++source "drivers/net/wireless/zd1211rw-mac80211/Kconfig"
  
-+ZD1211-MAC80211 WIRELESS DRIVER
-+P:	Daniel Drake
-+M:	dsd at gentoo.org
-+P:	Ulrich Kunitz
-+M:	kune at deine-taler.de
-+W:	http://zd1211.ath.cx/wiki/DriverRewrite
-+L:	linux-wireless at vger.kernel.org
-+L:	zd1211-devs at lists.sourceforge.net (subscribers-only)
-+S:	Maintained
-+
- ZD1211RW WIRELESS DRIVER
- P:	Daniel Drake
- M:	dsd at gentoo.org
-diff -up linux-2.6.23.noarch/drivers/net/wireless/zd1211rw/zd_def.h.orig linux-2.6.23.noarch/drivers/net/wireless/zd1211rw/zd_def.h
+ endmenu
 diff -up linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig linux-2.6.23.noarch/drivers/net/wireless/Makefile
---- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-10-18 20:45:39.000000000 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-10-18 20:46:43.000000000 -0400
+--- linux-2.6.23.noarch/drivers/net/wireless/Makefile.orig	2007-11-21 14:26:06.000000000 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/Makefile	2007-11-21 14:26:32.000000000 -0500
 @@ -41,6 +41,7 @@ obj-$(CONFIG_BCM43XX)		+= bcm43xx/
  obj-$(CONFIG_B43)		+= b43/
  obj-$(CONFIG_B43LEGACY)		+= b43legacy/
@@ -30,11 +19,11 @@
  
  # 16-bit wireless PCMCIA client drivers
  obj-$(CONFIG_PCMCIA_RAYCS)	+= ray_cs.o
-diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_chip.c
---- /dev/null	2007-10-18 19:53:46.790244324 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_chip.c	2007-10-18 20:46:43.000000000 -0400
-@@ -0,0 +1,1622 @@
-+/* zd_chip.c
+diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_rf.c
+--- /dev/null	2007-11-12 23:12:46.917997680 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_rf.c	2007-11-21 14:26:32.000000000 -0500
+@@ -0,0 +1,178 @@
++/* zd_rf.c
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
@@ -51,2747 +40,2868 @@
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + */
 +
-+/* This file implements all the hardware specific functions for the ZD1211
-+ * and ZD1211B chips. Support for the ZD1211B was possible after Timothy
-+ * Legge sent me a ZD1211B device. Thank you Tim. -- Uli
-+ */
-+
-+#include <linux/kernel.h>
 +#include <linux/errno.h>
++#include <linux/string.h>
 +
 +#include "zd_def.h"
-+#include "zd_chip.h"
-+#include "zd_ieee80211.h"
-+#include "zd_mac.h"
 +#include "zd_rf.h"
++#include "zd_ieee80211.h"
++#include "zd_chip.h"
 +
-+void zd_chip_init(struct zd_chip *chip,
-+	         struct ieee80211_hw *hw,
-+		 struct usb_interface *intf)
++static const char * const rfs[] = {
++	[0]		= "unknown RF0",
++	[1]		= "unknown RF1",
++	[UW2451_RF]	= "UW2451_RF",
++	[UCHIP_RF]	= "UCHIP_RF",
++	[AL2230_RF]	= "AL2230_RF",
++	[AL7230B_RF]	= "AL7230B_RF",
++	[THETA_RF]	= "THETA_RF",
++	[AL2210_RF]	= "AL2210_RF",
++	[MAXIM_NEW_RF]	= "MAXIM_NEW_RF",
++	[UW2453_RF]	= "UW2453_RF",
++	[AL2230S_RF]	= "AL2230S_RF",
++	[RALINK_RF]	= "RALINK_RF",
++	[INTERSIL_RF]	= "INTERSIL_RF",
++	[RF2959_RF]	= "RF2959_RF",
++	[MAXIM_NEW2_RF]	= "MAXIM_NEW2_RF",
++	[PHILIPS_RF]	= "PHILIPS_RF",
++};
++
++const char *zd_rf_name(u8 type)
 +{
-+	memset(chip, 0, sizeof(*chip));
-+	mutex_init(&chip->mutex);
-+	zd_usb_init(&chip->usb, hw, intf);
-+	zd_rf_init(&chip->rf);
++	if (type & 0xf0)
++		type = 0;
++	return rfs[type];
 +}
 +
-+void zd_chip_clear(struct zd_chip *chip)
++void zd_rf_init(struct zd_rf *rf)
 +{
-+	ZD_ASSERT(!mutex_is_locked(&chip->mutex));
-+	zd_usb_clear(&chip->usb);
-+	zd_rf_clear(&chip->rf);
-+	mutex_destroy(&chip->mutex);
-+	ZD_MEMCLEAR(chip, sizeof(*chip));
++	memset(rf, 0, sizeof(*rf));
++
++	/* default to update channel integration, as almost all RF's do want
++	 * this */
++	rf->update_channel_int = 1;
 +}
 +
-+static int scnprint_mac_oui(struct zd_chip *chip, char *buffer, size_t size)
++void zd_rf_clear(struct zd_rf *rf)
 +{
-+	u8 *addr = zd_mac_get_perm_addr(zd_chip_to_mac(chip));
-+	return scnprintf(buffer, size, "%02x-%02x-%02x",
-+		         addr[0], addr[1], addr[2]);
++	if (rf->clear)
++		rf->clear(rf);
++	ZD_MEMCLEAR(rf, sizeof(*rf));
 +}
 +
-+/* Prints an identifier line, which will support debugging. */
-+static int scnprint_id(struct zd_chip *chip, char *buffer, size_t size)
++int zd_rf_init_hw(struct zd_rf *rf, u8 type)
 +{
-+	int i = 0;
++	int r = 0;
++	int t;
++	struct zd_chip *chip = zd_rf_to_chip(rf);
 +
-+	i = scnprintf(buffer, size, "zd1211%s chip ",
-+		      zd_chip_is_zd1211b(chip) ? "b" : "");
-+	i += zd_usb_scnprint_id(&chip->usb, buffer+i, size-i);
-+	i += scnprintf(buffer+i, size-i, " ");
-+	i += scnprint_mac_oui(chip, buffer+i, size-i);
-+	i += scnprintf(buffer+i, size-i, " ");
-+	i += zd_rf_scnprint_id(&chip->rf, buffer+i, size-i);
-+	i += scnprintf(buffer+i, size-i, " pa%1x %c%c%c%c%c", chip->pa_type,
-+		chip->patch_cck_gain ? 'g' : '-',
-+		chip->patch_cr157 ? '7' : '-',
-+		chip->patch_6m_band_edge ? '6' : '-',
-+		chip->new_phy_layout ? 'N' : '-',
-+		chip->al2230s_bit ? 'S' : '-');
-+	return i;
-+}
++	ZD_ASSERT(mutex_is_locked(&chip->mutex));
++	switch (type) {
++	case RF2959_RF:
++		r = zd_rf_init_rf2959(rf);
++		break;
++	case AL2230_RF:
++	case AL2230S_RF:
++		r = zd_rf_init_al2230(rf);
++		break;
++	case AL7230B_RF:
++		r = zd_rf_init_al7230b(rf);
++		break;
++	case UW2453_RF:
++		r = zd_rf_init_uw2453(rf);
++		break;
++	default:
++		dev_err(zd_chip_dev(chip),
++			"RF %s %#x is not supported\n", zd_rf_name(type), type);
++		rf->type = 0;
++		return -ENODEV;
++	}
 +
-+static void print_id(struct zd_chip *chip)
-+{
-+	char buffer[80];
++	if (r)
++		return r;
 +
-+	scnprint_id(chip, buffer, sizeof(buffer));
-+	buffer[sizeof(buffer)-1] = 0;
-+	dev_info(zd_chip_dev(chip), "%s\n", buffer);
++	rf->type = type;
[...12049 lines suppressed...]
++}
 +
-+	req_len = sizeof(struct usb_req_write_regs) +
-+		  count * sizeof(struct reg_data);
-+	req = kmalloc(req_len, GFP_KERNEL);
-+	if (!req)
-+		return -ENOMEM;
++int zd_chip_set_basic_rates(struct zd_chip *chip, u16 cr_rates);
 +
-+	req->id = cpu_to_le16(USB_REQ_WRITE_REGS);
-+	for (i = 0; i < count; i++) {
-+		struct reg_data *rw  = &req->reg_writes[i];
-+		rw->addr = cpu_to_le16((u16)ioreqs[i].addr);
-+		rw->value = cpu_to_le16(ioreqs[i].value);
-+	}
++int zd_chip_lock_phy_regs(struct zd_chip *chip);
++int zd_chip_unlock_phy_regs(struct zd_chip *chip);
 +
-+	udev = zd_usb_to_usbdev(usb);
-+	r = usb_bulk_msg(udev, usb_sndbulkpipe(udev, EP_REGS_OUT),
-+		         req, req_len, &actual_req_len, 1000 /* ms */);
-+	if (r) {
-+		dev_dbg_f(zd_usb_dev(usb),
-+			"error in usb_bulk_msg(). Error number %d\n", r);
-+		goto error;
-+	}
-+	if (req_len != actual_req_len) {
-+		dev_dbg_f(zd_usb_dev(usb),
-+			"error in usb_bulk_msg()"
-+			" req_len %d != actual_req_len %d\n",
-+			req_len, actual_req_len);
-+		r = -EIO;
-+		goto error;
-+	}
++enum led_status {
++	LED_OFF = 0,
++	LED_SCANNING = 1,
++	LED_ASSOCIATED = 2,
++};
 +
-+	/* FALL-THROUGH with r == 0 */
-+error:
-+	kfree(req);
-+	return r;
-+}
++int zd_chip_control_leds(struct zd_chip *chip, enum led_status status);
 +
-+int zd_usb_rfwrite(struct zd_usb *usb, u32 value, u8 bits)
++int zd_set_beacon_interval(struct zd_chip *chip, u32 interval);
++
++static inline int zd_get_beacon_interval(struct zd_chip *chip, u32 *interval)
 +{
-+	int r;
-+	struct usb_device *udev;
-+	struct usb_req_rfwrite *req = NULL;
-+	int i, req_len, actual_req_len;
-+	u16 bit_value_template;
++	return zd_ioread32(chip, CR_BCN_INTERVAL, interval);
++}
 +
-+	if (in_atomic()) {
-+		dev_dbg_f(zd_usb_dev(usb),
-+			"error: io in atomic context not supported\n");
-+		return -EWOULDBLOCK;
-+	}
-+	if (bits < USB_MIN_RFWRITE_BIT_COUNT) {
-+		dev_dbg_f(zd_usb_dev(usb),
-+			"error: bits %d are smaller than"
-+			" USB_MIN_RFWRITE_BIT_COUNT %d\n",
-+			bits, USB_MIN_RFWRITE_BIT_COUNT);
-+		return -EINVAL;
-+	}
-+	if (bits > USB_MAX_RFWRITE_BIT_COUNT) {
-+		dev_dbg_f(zd_usb_dev(usb),
-+			"error: bits %d exceed USB_MAX_RFWRITE_BIT_COUNT %d\n",
-+			bits, USB_MAX_RFWRITE_BIT_COUNT);
-+		return -EINVAL;
-+	}
-+#ifdef DEBUG
-+	if (value & (~0UL << bits)) {
-+		dev_dbg_f(zd_usb_dev(usb),
-+			"error: value %#09x has bits >= %d set\n",
-+			value, bits);
-+		return -EINVAL;
-+	}
-+#endif /* DEBUG */
++struct rx_status;
 +
-+	dev_dbg_f(zd_usb_dev(usb), "value %#09x bits %d\n", value, bits);
++u8 zd_rx_qual_percent(const void *rx_frame, unsigned int size,
++	               const struct rx_status *status);
 +
-+	r = zd_usb_ioread16(usb, &bit_value_template, CR203);
-+	if (r) {
-+		dev_dbg_f(zd_usb_dev(usb),
-+			"error %d: Couldn't read CR203\n", r);
-+		goto out;
-+	}
-+	bit_value_template &= ~(RF_IF_LE|RF_CLK|RF_DATA);
++u8 zd_rx_rate(const void *rx_frame, const struct rx_status *status);
 +
-+	req_len = sizeof(struct usb_req_rfwrite) + bits * sizeof(__le16);
-+	req = kmalloc(req_len, GFP_KERNEL);
-+	if (!req)
-+		return -ENOMEM;
++struct zd_mc_hash {
++	u32 low;
++	u32 high;
++};
 +
-+	req->id = cpu_to_le16(USB_REQ_WRITE_RF);
-+	/* 1: 3683a, but not used in ZYDAS driver */
-+	req->value = cpu_to_le16(2);
-+	req->bits = cpu_to_le16(bits);
++static inline void zd_mc_clear(struct zd_mc_hash *hash)
++{
++	hash->low = 0;
++	/* The interfaces must always received broadcasts.
++	 * The hash of the broadcast address ff:ff:ff:ff:ff:ff is 63.
++	 */
++	hash->high = 0x80000000;
++}
 +
-+	for (i = 0; i < bits; i++) {
-+		u16 bv = bit_value_template;
-+		if (value & (1 << (bits-1-i)))
-+			bv |= RF_DATA;
-+		req->bit_values[i] = cpu_to_le16(bv);
-+	}
++static inline void zd_mc_add_all(struct zd_mc_hash *hash)
++{
++	hash->low = hash->high = 0xffffffff;
++}
 +
-+	udev = zd_usb_to_usbdev(usb);
-+	r = usb_bulk_msg(udev, usb_sndbulkpipe(udev, EP_REGS_OUT),
-+		         req, req_len, &actual_req_len, 1000 /* ms */);
-+	if (r) {
-+		dev_dbg_f(zd_usb_dev(usb),
-+			"error in usb_bulk_msg(). Error number %d\n", r);
-+		goto out;
-+	}
-+	if (req_len != actual_req_len) {
-+		dev_dbg_f(zd_usb_dev(usb), "error in usb_bulk_msg()"
-+			" req_len %d != actual_req_len %d\n",
-+			req_len, actual_req_len);
-+		r = -EIO;
-+		goto out;
++static inline void zd_mc_add_addr(struct zd_mc_hash *hash, u8 *addr)
++{
++	unsigned int i = addr[5] >> 2;
++	if (i < 32) {
++		hash->low |= 1 << i;
++	} else {
++		hash->high |= 1 << (i-32);
 +	}
-+
-+	/* FALL-THROUGH with r == 0 */
-+out:
-+	kfree(req);
-+	return r;
 +}
++
++int zd_chip_set_multicast_hash(struct zd_chip *chip,
++	                       struct zd_mc_hash *hash);
++
++#endif /* _ZD_CHIP_H */
 diff -up /dev/null linux-2.6.23.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_mac.c
---- /dev/null	2007-10-18 19:53:46.790244324 -0400
-+++ linux-2.6.23.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_mac.c	2007-10-18 20:46:43.000000000 -0400
+--- /dev/null	2007-11-12 23:12:46.917997680 -0500
++++ linux-2.6.23.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_mac.c	2007-11-21 14:26:32.000000000 -0500
 @@ -0,0 +1,978 @@
 +/* zd_mac.c
 + *
@@ -7959,4 +7948,23 @@
 +		&mac->housekeeping.link_led_work);
 +	zd_chip_control_leds(&mac->chip, LED_OFF);
 +}
-diff -up linux-2.6.23.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.23.noarch/drivers/net/wireless/Kconfig
+diff -up linux-2.6.23.noarch/MAINTAINERS.orig linux-2.6.23.noarch/MAINTAINERS
+--- linux-2.6.23.noarch/MAINTAINERS.orig	2007-11-21 14:26:06.000000000 -0500
++++ linux-2.6.23.noarch/MAINTAINERS	2007-11-21 14:26:32.000000000 -0500
+@@ -4323,6 +4323,16 @@ W:	http://www.qsl.net/dl1bke/
+ L:	linux-hams at vger.kernel.org
+ S:	Maintained
+ 
++ZD1211-MAC80211 WIRELESS DRIVER
++P:	Daniel Drake
++M:	dsd at gentoo.org
++P:	Ulrich Kunitz
++M:	kune at deine-taler.de
++W:	http://zd1211.ath.cx/wiki/DriverRewrite
++L:	linux-wireless at vger.kernel.org
++L:	zd1211-devs at lists.sourceforge.net (subscribers-only)
++S:	Maintained
++
+ ZD1211RW WIRELESS DRIVER
+ P:	Daniel Drake
+ M:	dsd at gentoo.org


--- linux-2.6-bcm43xx-pci-neuter.patch DELETED ---


--- linux-2.6-drivers-ssb-debug-revision.patch DELETED ---


--- linux-2.6-rt2x00-updates.patch DELETED ---




More information about the fedora-extras-commits mailing list