rpms/kernel/F-8 kernel.spec, 1.453, 1.454 linux-2.6-at76.patch, 1.9, 1.10 linux-2.6-wireless-fixups.patch, 1.1, 1.2 linux-2.6-wireless-pending.patch, 1.45, 1.46 linux-2.6-wireless.patch, 1.38, 1.39

John W. Linville (linville) fedora-extras-commits at redhat.com
Thu May 29 18:47:05 UTC 2008


Author: linville

Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25635

Modified Files:
	kernel.spec linux-2.6-at76.patch 
	linux-2.6-wireless-fixups.patch 
	linux-2.6-wireless-pending.patch linux-2.6-wireless.patch 
Log Message:
wireless updates from 2008-05-22 ; wireless fixes from 2008-05-28


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.453
retrieving revision 1.454
diff -u -r1.453 -r1.454
--- kernel.spec	28 May 2008 01:39:45 -0000	1.453
+++ kernel.spec	29 May 2008 18:46:09 -0000	1.454
@@ -1824,6 +1824,12 @@
 
 
 %changelog
+* Thu May 29 2008 John W. Linville <linville at redhat.com> 2.6.25.4-14
+- Upstream wireless updates from 2008-05-22
+  (http://marc.info/?l=linux-wireless&m=121146112404515&w=2)
+- Upstream wireless fixes from 2008-05-28
+  (http://marc.info/?l=linux-wireless&m=121201250110162&w=2)
+
 * Tue May 27 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.4-13
 - Remove obsolete unicode patch.
 

linux-2.6-at76.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.9 -r 1.10 linux-2.6-at76.patch
Index: linux-2.6-at76.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-at76.patch,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- linux-2.6-at76.patch	21 May 2008 21:22:40 -0000	1.9
+++ linux-2.6-at76.patch	29 May 2008 18:46:09 -0000	1.10
@@ -1,4 +1,58 @@
-commit 755a49a4b9d296651276ca8ca3ece49ded9ae621
+commit 34f6f7e889723def0ae895ca8aaa0b12e6ee3f6c
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Thu May 15 12:55:29 2008 +0200
+
+    at76_usb: move TX info into skb->cb
+    
+    This patch converts mac80211 and all drivers to have transmit
+    information and status in skb->cb rather than allocating extra
+    memory for it and copying all the data around. To make it fit,
+    a union is used where only data that is necessary for all steps
+    is kept outside of the union.
+    
+    A number of fixes were done by Ivo, as well as the rt2x00 part
+    of this patch.
+    
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Acked-by: David S. Miller <davem at davemloft.net>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 5d77944bc40ebe1b7b1c56fb2f92684b4c29b66b
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Thu May 15 12:55:27 2008 +0200
+
+    at76_usb: use rate index in TX control
+    
+    This patch modifies struct ieee80211_tx_control to give band
+    info and the rate index (instead of rate pointers) to drivers.
+    This mostly serves to reduce the TX control structure size to
+    make it fit into skb->cb so that the fragmentation code can
+    put it there and we can think about passing it to drivers that
+    way in the future.
+    
+    The rt2x00 driver update was done by Ivo, thanks.
+    
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit a7782d1764b316686de4231286c677e230018021
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Thu May 15 12:55:26 2008 +0200
+
+    at76_usb: let drivers wake but not start queues
+    
+    Having drivers start queues is just confusing, their ->start()
+    callback can block and do whatever is necessary, so let mac80211
+    start queues and have drivers wake queues when necessary (to get
+    packets flowing again right away.)
+    
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Acked-by: David S. Miller <davem at davemloft.net>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 761fb2009c498157d653d9aa9dfd8565039aa072
 Author: Bruno Randolf <br1 at einfach.org>
 Date:   Thu May 8 19:15:40 2008 +0200
 
@@ -59,7 +113,7 @@
     Signed-off-by: Bruno Randolf <br1 at einfach.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 644ef9df7c598e369ba1794f65610b1a1e643fca
+commit ace095545ffa056bf906496a7be0808823fa9980
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:01:07 2008 -0500
 
@@ -68,7 +122,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit b226eae4c43640ed83cd8126c11602e230150a56
+commit 590364c5a53756b670dd104e4cddd8e760875e2f
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:01:01 2008 -0500
 
@@ -77,7 +131,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 9eccbe8447a68d649d3ca683193f34b3cb9c7c6c
+commit 00a1912a53673056e06572bfa37f85b8ef65d682
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:00:55 2008 -0500
 
@@ -86,7 +140,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 5a92d66e9642b3a0a8cee6eec7172b65d9c43548
+commit cad8f142e3505c0bf0f70a16c6fd7c441697e9e2
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:00:50 2008 -0500
 
@@ -95,7 +149,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 67c3d5b697774c6fe9a644fa302c82333e1d75e3
+commit 7babe23f68a622c32bbaf6dfaec3d36644eaa946
 Author: Pavel Roskin <proski at gnu.org>
 Date:   Fri Feb 22 00:00:44 2008 -0500
 
@@ -106,7 +160,7 @@
     Signed-off-by: Pavel Roskin <proski at gnu.org>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit b0b7eb18c8233622d1ffdea33814548e286379dd
+commit 0678f4b57e5d832ec56a54830b8dd94692e1f291
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:01:19 2008 +0200
 
@@ -117,7 +171,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 1416847d10d0f9ddee78264dfdf14eab5fff72aa
+commit 5b6e27b59e14602e50f32b82cdb9781535bcbbbc
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:01:11 2008 +0200
 
@@ -128,7 +182,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 3483c0c0779a404e7aa9a5261978a083fbf3aac7
+commit 12189dc89c5b54fa0c48693f853223d738869896
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:01:04 2008 +0200
 
@@ -142,7 +196,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 10a9088fa5d75ca48fbc74108a106430336ab615
+commit 3341952b9aac1be83bbf1e4858220727a138ebfa
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:00:56 2008 +0200
 
@@ -156,7 +210,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit bc12541b59aa1a0b4c58a093195d7ade3ebbbe60
+commit d6703673ea7df77f8651e584b264c4f88e38cafd
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:00:49 2008 +0200
 
@@ -169,7 +223,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit b5415e12ce5552b0b640c83a40fdc806eb130149
+commit 72817d08169e390161aed451baea3eebeb859a77
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:00:41 2008 +0200
 
@@ -178,7 +232,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 82d266cbe56da67064793e1747d12abfe705ffc5
+commit ba52a65debbc5a873cbcdb8f6a5a314f1bba0a44
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:00:34 2008 +0200
 
@@ -187,7 +241,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 4e9c1daf0d0b98af6e4c0b87c299855dd63dec06
+commit d6a316db4a79a216b1cbfee444b92d343c988b5b
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:00:26 2008 +0200
 
@@ -202,7 +256,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 475d2454db1a8a21af2cd06da2e31896b987efe4
+commit 29820bb1c8633fb4ae6eb9df621970074b669450
 Author: Kalle Valo <kalle.valo at iki.fi>
 Date:   Sun Feb 10 17:00:19 2008 +0200
 
@@ -211,7 +265,7 @@
     Signed-off-by: Kalle Valo <kalle.valo at iki.fi>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit adad9eb5df49e8b3848a28d3b865d2e6424f3092
+commit 2b2886cdd58c0351fc6f09d42ed35662a2b59a0b
[...4031 lines suppressed...]
-+			dev_printk(KERN_ERR, &interface->dev,
-+				   "error %d getting firmware version\n", ret);
-+			goto error;
-+		}
-+	}
++	struct mutex mtx;	/* locks this structure */
 +
-+	priv = at76_alloc_new_device(udev);
-+	if (!priv) {
-+		ret = -ENOMEM;
-+		goto error;
-+	}
++	/* work queues */
++	struct work_struct work_set_promisc;
++	struct work_struct work_submit_rx;
++	struct delayed_work dwork_hw_scan;
 +
-+	usb_set_intfdata(interface, priv);
++	struct tasklet_struct rx_tasklet;
 +
-+	memcpy(&priv->fw_version, &fwv, sizeof(struct mib_fw_version));
-+	priv->board_type = board_type;
++	/* the WEP stuff */
++	int wep_enabled;	/* 1 if WEP is enabled */
++	int wep_key_id;		/* key id to be used */
++	u8 wep_keys[WEP_KEYS][WEP_LARGE_KEY_LEN];	/* WEP keys */
++	u8 wep_keys_len[WEP_KEYS];	/* length of WEP keys */
 +
-+	ret = at76_init_new_device(priv, interface);
-+	if (ret < 0)
-+		at76_delete_device(priv);
++	int channel;
++	int iw_mode;
++	u8 bssid[ETH_ALEN];
++	u8 essid[IW_ESSID_MAX_SIZE];
++	int essid_size;
++	int radio_on;
++	int promisc;
 +
-+	return ret;
++	int preamble_type;	/* 0 - long, 1 - short, 2 - auto */
++	int auth_mode;		/* authentication type: 0 open, 1 shared key */
++	int txrate;		/* 0,1,2,3 = 1,2,5.5,11 Mbps, 4 is auto */
++	int frag_threshold;	/* threshold for fragmentation of tx packets */
++	int rts_threshold;	/* threshold for RTS mechanism */
++	int short_retry_limit;
 +
-+error:
-+	usb_put_dev(udev);
-+	return ret;
-+}
++	int scan_min_time;	/* scan min channel time */
++	int scan_max_time;	/* scan max channel time */
++	int scan_mode;		/* SCAN_TYPE_ACTIVE, SCAN_TYPE_PASSIVE */
++	int scan_need_any;	/* if set, need to scan for any ESSID */
 +
-+static void at76_disconnect(struct usb_interface *interface)
-+{
-+	struct at76_priv *priv;
++	u16 assoc_id;		/* current association ID, if associated */
 +
-+	priv = usb_get_intfdata(interface);
-+	usb_set_intfdata(interface, NULL);
++	u8 pm_mode;		/* power management mode */
++	u32 pm_period;		/* power management period in microseconds */
 +
-+	/* Disconnect after loading internal firmware */
-+	if (!priv)
-+		return;
++	struct reg_domain const *domain;	/* reg domain description */
 +
-+	printk(KERN_INFO "%s: disconnecting\n", wiphy_name(priv->hw->wiphy));
-+	at76_delete_device(priv);
-+	dev_printk(KERN_INFO, &interface->dev, "disconnected\n");
-+}
++	/* These fields contain HW config provided by the device (not all of
++	 * these fields are used by all board types) */
++	u8 mac_addr[ETH_ALEN];
++	u8 regulatory_domain;
 +
-+/* 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,
-+};
++	struct at76_card_config card_config;
 +
-+static int __init at76_mod_init(void)
-+{
-+	int result;
++	enum board_type board_type;
++	struct mib_fw_version fw_version;
 +
-+	printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " loading\n");
++	unsigned int device_unplugged:1;
++	unsigned int netdev_registered:1;
++	struct set_mib_buffer mib_buf;	/* global buffer for set_mib calls */
 +
-+	mutex_init(&fw_mutex);
++	int beacon_period;	/* period of mgmt beacons, Kus */
 +
-+	/* 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);
++	struct ieee80211_hw *hw;
++	int mac80211_registered;
++};
 +
-+	led_trigger_register_simple("at76_usb-tx", &ledtrig_tx);
-+	return result;
-+}
++#define AT76_SUPPORTED_FILTERS FIF_PROMISC_IN_BSS
 +
-+static void __exit at76_mod_exit(void)
-+{
-+	int i;
++#define SCAN_POLL_INTERVAL	(HZ / 4)
 +
-+	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 CMD_COMPLETION_TIMEOUT	(5 * HZ)
 +
-+module_param_named(debug, at76_debug, int, 0600);
-+MODULE_PARM_DESC(debug, "Debugging level");
++#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_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_AUTHOR("Guido Guenther <agx at sigxcpu.org>");
-+MODULE_AUTHOR("Kalle Valo <kalle.valo at iki.fi>");
-+MODULE_DESCRIPTION(DRIVER_DESC);
-+MODULE_LICENSE("GPL");
++#endif				/* _AT76_USB_H */
 diff -up linux-2.6.25.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.25.noarch/drivers/net/wireless/Kconfig
---- linux-2.6.25.noarch/drivers/net/wireless/Kconfig.orig	2008-05-19 17:52:43.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/Kconfig	2008-05-19 17:53:24.000000000 -0400
+--- linux-2.6.25.noarch/drivers/net/wireless/Kconfig.orig	2008-05-27 15:31:33.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/Kconfig	2008-05-27 15:31:53.000000000 -0400
 @@ -456,6 +456,14 @@ config PCMCIA_ATMEL
  	  Enable support for PCMCIA cards containing the
  	  Atmel at76c502 and at76c504 chips.
@@ -3993,3 +4012,34 @@
  config AIRO_CS
  	tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards"
  	depends on PCMCIA && (BROKEN || !M32R) && WLAN_80211
+diff -up linux-2.6.25.noarch/drivers/net/wireless/Makefile.orig linux-2.6.25.noarch/drivers/net/wireless/Makefile
+--- linux-2.6.25.noarch/drivers/net/wireless/Makefile.orig	2008-05-27 15:31:33.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/Makefile	2008-05-27 15:31:53.000000000 -0400
+@@ -32,6 +32,8 @@ obj-$(CONFIG_ATMEL)             += atmel
+ obj-$(CONFIG_PCI_ATMEL)         += atmel_pci.o 
+ obj-$(CONFIG_PCMCIA_ATMEL)      += atmel_cs.o
+ 
++obj-$(CONFIG_USB_ATMEL)	        += at76_usb.o
++
+ obj-$(CONFIG_PRISM54)		+= prism54/
+ 
+ obj-$(CONFIG_HOSTAP)		+= hostap/
+diff -up linux-2.6.25.noarch/MAINTAINERS.orig linux-2.6.25.noarch/MAINTAINERS
+--- linux-2.6.25.noarch/MAINTAINERS.orig	2008-05-27 15:31:33.000000000 -0400
++++ linux-2.6.25.noarch/MAINTAINERS	2008-05-27 15:31:53.000000000 -0400
+@@ -740,6 +740,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

linux-2.6-wireless-fixups.patch:

Index: linux-2.6-wireless-fixups.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-wireless-fixups.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-wireless-fixups.patch	21 May 2008 21:22:40 -0000	1.1
+++ linux-2.6-wireless-fixups.patch	29 May 2008 18:46:09 -0000	1.2
@@ -1,406 +1,390 @@
-diff -up linux-2.6.25.noarch/net/mac80211/iface.c.orig linux-2.6.25.noarch/net/mac80211/iface.c
---- linux-2.6.25.noarch/net/mac80211/iface.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/net/mac80211/iface.c	2008-05-19 17:31:10.000000000 -0400
-@@ -53,15 +53,6 @@ int ieee80211_if_add(struct net_device *
- 	if (!ndev)
- 		return -ENOMEM;
- 
--	ndev->needed_headroom = local->tx_headroom +
--				4*6 /* four MAC addresses */
--				+ 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
--				+ 6 /* mesh */
--				+ 8 /* rfc1042/bridge tunnel */
--				- ETH_HLEN /* ethernet hard_header_len */
--				+ IEEE80211_ENCRYPT_HEADROOM;
--	ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
--
- 	ret = dev_alloc_name(ndev, ndev->name);
- 	if (ret < 0)
- 		goto fail;
-diff -up linux-2.6.25.noarch/net/mac80211/tkip.c.orig linux-2.6.25.noarch/net/mac80211/tkip.c
---- linux-2.6.25.noarch/net/mac80211/tkip.c.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/net/mac80211/tkip.c	2008-05-19 17:40:15.000000000 -0400
-@@ -8,22 +8,23 @@
-  */
- 
- #include <linux/kernel.h>
--#include <linux/bitops.h>
- #include <linux/types.h>
- #include <linux/netdevice.h>
--#include <asm/unaligned.h>
- 
- #include <net/mac80211.h>
- #include "key.h"
- #include "tkip.h"
- #include "wep.h"
- 
-+
-+/* TKIP key mixing functions */
-+
-+
- #define PHASE1_LOOP_COUNT 8
+diff -up linux-2.6.25.noarch/drivers/net/wireless/airo.c.orig linux-2.6.25.noarch/drivers/net/wireless/airo.c
+--- linux-2.6.25.noarch/drivers/net/wireless/airo.c.orig	2008-05-27 14:51:16.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/airo.c	2008-05-27 14:51:25.000000000 -0400
+@@ -3659,7 +3659,7 @@ void mpi_receive_802_11 (struct airo_inf
+ 	ptr += hdrlen;
+ 	if (hdrlen == 24)
+ 		ptr += 6;
+-	gap = get_unaligned_le16(ptr);
++	gap = le16_to_cpu(get_unaligned((__le16 *)ptr));
+ 	ptr += sizeof(__le16);
+ 	if (gap) {
+ 		if (gap <= 8)
+@@ -4349,28 +4349,24 @@ static int proc_config_open( struct inod
+ static int proc_wepkey_open( struct inode *inode, struct file *file );
  
--/*
-- * 2-byte by 2-byte subset of the full AES S-box table; second part of this
-- * table is identical to first part but byte-swapped
-- */
-+
-+/* 2-byte by 2-byte subset of the full AES S-box table; second part of this
-+ * table is identical to first part but byte-swapped */
- static const u16 tkip_sbox[256] =
- {
- 	0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154,
-@@ -60,13 +61,53 @@ static const u16 tkip_sbox[256] =
- 	0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A,
+ static const struct file_operations proc_statsdelta_ops = {
+-	.owner		= THIS_MODULE,
+ 	.read		= proc_read,
+ 	.open		= proc_statsdelta_open,
+ 	.release	= proc_close
  };
  
--static u16 tkipS(u16 val)
-+
-+static inline u16 Mk16(u8 x, u8 y)
-+{
-+	return ((u16) x << 8) | (u16) y;
-+}
-+
-+
-+static inline u8 Hi8(u16 v)
-+{
-+	return v >> 8;
-+}
-+
-+
-+static inline u8 Lo8(u16 v)
-+{
-+	return v & 0xff;
-+}
-+
-+
-+static inline u16 Hi16(u32 v)
-+{
-+	return v >> 16;
-+}
-+
-+
-+static inline u16 Lo16(u32 v)
-+{
-+	return v & 0xffff;
-+}
-+
-+
-+static inline u16 RotR1(u16 v)
-+{
-+	return (v >> 1) | ((v & 0x0001) << 15);
-+}
-+
-+
-+static inline u16 tkip_S(u16 val)
- {
--	return tkip_sbox[val & 0xff] ^ swab16(tkip_sbox[val >> 8]);
-+	u16 a = tkip_sbox[Hi8(val)];
-+
-+	return tkip_sbox[Lo8(val)] ^ Hi8(a) ^ (Lo8(a) << 8);
- }
- 
--/*
-- * P1K := Phase1(TA, TK, TSC)
-+
-+
-+/* P1K := Phase1(TA, TK, TSC)
-  * TA = transmitter address (48 bits)
-  * TK = dot11DefaultKeyValue or dot11KeyMappingValue (128 bits)
-  * TSC = TKIP sequence counter (48 bits, only 32 msb bits used)
-@@ -77,22 +118,23 @@ static void tkip_mixing_phase1(const u8 
- {
- 	int i, j;
- 
--	p1k[0] = tsc_IV32 & 0xFFFF;
--	p1k[1] = tsc_IV32 >> 16;
--	p1k[2] = get_unaligned_le16(ta + 0);
--	p1k[3] = get_unaligned_le16(ta + 2);
--	p1k[4] = get_unaligned_le16(ta + 4);
-+	p1k[0] = Lo16(tsc_IV32);
-+	p1k[1] = Hi16(tsc_IV32);
-+	p1k[2] = Mk16(ta[1], ta[0]);
-+	p1k[3] = Mk16(ta[3], ta[2]);
-+	p1k[4] = Mk16(ta[5], ta[4]);
- 
- 	for (i = 0; i < PHASE1_LOOP_COUNT; i++) {
- 		j = 2 * (i & 1);
--		p1k[0] += tkipS(p1k[4] ^ get_unaligned_le16(tk + 0 + j));
--		p1k[1] += tkipS(p1k[0] ^ get_unaligned_le16(tk + 4 + j));
--		p1k[2] += tkipS(p1k[1] ^ get_unaligned_le16(tk + 8 + j));
--		p1k[3] += tkipS(p1k[2] ^ get_unaligned_le16(tk + 12 + j));
--		p1k[4] += tkipS(p1k[3] ^ get_unaligned_le16(tk + 0 + j)) + i;
-+		p1k[0] += tkip_S(p1k[4] ^ Mk16(tk[ 1 + j], tk[ 0 + j]));
-+		p1k[1] += tkip_S(p1k[0] ^ Mk16(tk[ 5 + j], tk[ 4 + j]));
-+		p1k[2] += tkip_S(p1k[1] ^ Mk16(tk[ 9 + j], tk[ 8 + j]));
-+		p1k[3] += tkip_S(p1k[2] ^ Mk16(tk[13 + j], tk[12 + j]));
-+		p1k[4] += tkip_S(p1k[3] ^ Mk16(tk[ 1 + j], tk[ 0 + j])) + i;
- 	}
- }
+ static const struct file_operations proc_stats_ops = {
+-	.owner		= THIS_MODULE,
+ 	.read		= proc_read,
+ 	.open		= proc_stats_open,
+ 	.release	= proc_close
+ };
  
-+
- static void tkip_mixing_phase2(const u16 *p1k, const u8 *tk, u16 tsc_IV16,
- 			       u8 *rc4key)
- {
-@@ -106,29 +148,31 @@ static void tkip_mixing_phase2(const u16
- 	ppk[4] = p1k[4];
- 	ppk[5] = p1k[4] + tsc_IV16;
+ static const struct file_operations proc_status_ops = {
+-	.owner		= THIS_MODULE,
+ 	.read		= proc_read,
+ 	.open		= proc_status_open,
+ 	.release	= proc_close
+ };
  
--	ppk[0] += tkipS(ppk[5] ^ get_unaligned_le16(tk + 0));
--	ppk[1] += tkipS(ppk[0] ^ get_unaligned_le16(tk + 2));
--	ppk[2] += tkipS(ppk[1] ^ get_unaligned_le16(tk + 4));
--	ppk[3] += tkipS(ppk[2] ^ get_unaligned_le16(tk + 6));
--	ppk[4] += tkipS(ppk[3] ^ get_unaligned_le16(tk + 8));
--	ppk[5] += tkipS(ppk[4] ^ get_unaligned_le16(tk + 10));
--	ppk[0] += ror16(ppk[5] ^ get_unaligned_le16(tk + 12), 1);
--	ppk[1] += ror16(ppk[0] ^ get_unaligned_le16(tk + 14), 1);
--	ppk[2] += ror16(ppk[1], 1);
--	ppk[3] += ror16(ppk[2], 1);
--	ppk[4] += ror16(ppk[3], 1);
--	ppk[5] += ror16(ppk[4], 1);
--
--	rc4key[0] = tsc_IV16 >> 8;
--	rc4key[1] = ((tsc_IV16 >> 8) | 0x20) & 0x7f;
--	rc4key[2] = tsc_IV16 & 0xFF;
--	rc4key[3] = ((ppk[5] ^ get_unaligned_le16(tk)) >> 1) & 0xFF;
--
--	rc4key += 4;
--	for (i = 0; i < 6; i++)
--		put_unaligned_le16(ppk[i], rc4key + 2 * i);
-+	ppk[0] += tkip_S(ppk[5] ^ Mk16(tk[ 1], tk[ 0]));
-+	ppk[1] += tkip_S(ppk[0] ^ Mk16(tk[ 3], tk[ 2]));
-+	ppk[2] += tkip_S(ppk[1] ^ Mk16(tk[ 5], tk[ 4]));
-+	ppk[3] += tkip_S(ppk[2] ^ Mk16(tk[ 7], tk[ 6]));
-+	ppk[4] += tkip_S(ppk[3] ^ Mk16(tk[ 9], tk[ 8]));
-+	ppk[5] += tkip_S(ppk[4] ^ Mk16(tk[11], tk[10]));
-+	ppk[0] +=  RotR1(ppk[5] ^ Mk16(tk[13], tk[12]));
-+	ppk[1] +=  RotR1(ppk[0] ^ Mk16(tk[15], tk[14]));
-+	ppk[2] +=  RotR1(ppk[1]);
-+	ppk[3] +=  RotR1(ppk[2]);
-+	ppk[4] +=  RotR1(ppk[3]);
-+	ppk[5] +=  RotR1(ppk[4]);
-+
-+	rc4key[0] = Hi8(tsc_IV16);
-+	rc4key[1] = (Hi8(tsc_IV16) | 0x20) & 0x7f;
-+	rc4key[2] = Lo8(tsc_IV16);
-+	rc4key[3] = Lo8((ppk[5] ^ Mk16(tk[1], tk[0])) >> 1);
-+
-+	for (i = 0; i < 6; i++) {
-+		rc4key[4 + 2 * i] = Lo8(ppk[i]);
-+		rc4key[5 + 2 * i] = Hi8(ppk[i]);
-+	}
- }
+ static const struct file_operations proc_SSID_ops = {
+-	.owner		= THIS_MODULE,
+ 	.read		= proc_read,
+ 	.write		= proc_write,
+ 	.open		= proc_SSID_open,
+@@ -4378,7 +4374,6 @@ static const struct file_operations proc
+ };
  
-+
- /* Add TKIP IV and Ext. IV at @pos. @iv0, @iv1, and @iv2 are the first octets
-  * of the IV. Returns pointer to the octet following IVs (i.e., beginning of
-  * the packet payload). */
-@@ -139,10 +183,14 @@ u8 * ieee80211_tkip_add_iv(u8 *pos, stru
- 	*pos++ = iv1;
- 	*pos++ = iv2;
- 	*pos++ = (key->conf.keyidx << 6) | (1 << 5) /* Ext IV */;
--	put_unaligned_le32(key->u.tkip.iv32, pos);
--	return pos + 4;
-+	*pos++ = key->u.tkip.iv32 & 0xff;
-+	*pos++ = (key->u.tkip.iv32 >> 8) & 0xff;
-+	*pos++ = (key->u.tkip.iv32 >> 16) & 0xff;
-+	*pos++ = (key->u.tkip.iv32 >> 24) & 0xff;
-+	return pos;
- }
+ static const struct file_operations proc_BSSList_ops = {
+-	.owner		= THIS_MODULE,
+ 	.read		= proc_read,
+ 	.write		= proc_write,
+ 	.open		= proc_BSSList_open,
+@@ -4386,7 +4381,6 @@ static const struct file_operations proc
+ };
  
-+
- void ieee80211_tkip_gen_phase1key(struct ieee80211_key *key, u8 *ta,
- 				  u16 *phase1key)
- {
-@@ -180,8 +228,10 @@ void ieee80211_get_tkip_key(struct ieee8
- 	u16 iv16;
- 	u32 iv32;
+ static const struct file_operations proc_APList_ops = {
+-	.owner		= THIS_MODULE,
+ 	.read		= proc_read,
+ 	.write		= proc_write,
+ 	.open		= proc_APList_open,
+@@ -4394,7 +4388,6 @@ static const struct file_operations proc
+ };
  
--	iv16 = data[hdr_len + 2] | (data[hdr_len] << 8);
--	iv32 = get_unaligned_le32(data + hdr_len + 4);
-+	iv16 = data[hdr_len] << 8;
-+	iv16 += data[hdr_len + 2];
-+	iv32 = data[hdr_len + 4] | (data[hdr_len + 5] << 8) |
-+	       (data[hdr_len + 6] << 16) | (data[hdr_len + 7] << 24);
+ static const struct file_operations proc_config_ops = {
+-	.owner		= THIS_MODULE,
+ 	.read		= proc_read,
+ 	.write		= proc_write,
+ 	.open		= proc_config_open,
+@@ -4402,7 +4395,6 @@ static const struct file_operations proc
+ };
  
- #ifdef CONFIG_TKIP_DEBUG
- 	printk(KERN_DEBUG "TKIP encrypt: iv16 = 0x%04x, iv32 = 0x%08x\n",
-@@ -231,6 +281,7 @@ void ieee80211_tkip_encrypt_data(struct 
- 	ieee80211_wep_encrypt_data(tfm, rc4key, 16, pos, payload_len);
- }
+ static const struct file_operations proc_wepkey_ops = {
+-	.owner		= THIS_MODULE,
+ 	.read		= proc_read,
+ 	.write		= proc_write,
+ 	.open		= proc_wepkey_open,
+@@ -4421,6 +4413,10 @@ struct proc_data {
+ 	void (*on_close) (struct inode *, struct file *);
+ };
  
++#ifndef SETPROC_OPS
++#define SETPROC_OPS(entry, ops) (entry)->proc_fops = &(ops)
++#endif
 +
- /* Decrypt packet payload with TKIP using @key. @pos is a pointer to the
-  * beginning of the buffer containing IEEE 802.11 header payload, i.e.,
-  * including IV, Ext. IV, real data, Michael MIC, ICV. @payload_len is the
-@@ -251,7 +302,7 @@ int ieee80211_tkip_decrypt_data(struct c
+ static int setup_proc_entry( struct net_device *dev,
+ 			     struct airo_info *apriv ) {
+ 	struct proc_dir_entry *entry;
+@@ -4436,76 +4432,100 @@ static int setup_proc_entry( struct net_
+ 	apriv->proc_entry->owner = THIS_MODULE;
  
- 	iv16 = (pos[0] << 8) | pos[2];
- 	keyid = pos[3];
--	iv32 = get_unaligned_le32(pos + 4);
-+	iv32 = pos[4] | (pos[5] << 8) | (pos[6] << 16) | (pos[7] << 24);
- 	pos += 8;
- #ifdef CONFIG_TKIP_DEBUG
- 	{
-@@ -358,3 +409,5 @@ int ieee80211_tkip_decrypt_data(struct c
+ 	/* Setup the StatsDelta */
+-	entry = proc_create_data("StatsDelta",
+-				 S_IFREG | (S_IRUGO&proc_perm),
+-				 apriv->proc_entry, &proc_statsdelta_ops, dev);
++	entry = create_proc_entry("StatsDelta",
++				  S_IFREG | (S_IRUGO&proc_perm),
++				  apriv->proc_entry);
+ 	if (!entry)
+ 		goto fail_stats_delta;
+ 	entry->uid = proc_uid;
+ 	entry->gid = proc_gid;
++	entry->data = dev;
++	entry->owner = THIS_MODULE;
++	SETPROC_OPS(entry, proc_statsdelta_ops);
  
- 	return res;
- }
-+
-+
-diff -up linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c.orig linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c
---- linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c	2008-05-19 17:38:26.000000000 -0400
-@@ -26,7 +26,7 @@ static inline u32 u32_field_get(u8 *preq
- {
- 	if (ae)
- 		offset += 6;
--	return get_unaligned_le32(preq_elem + offset);
-+	return le32_to_cpu(get_unaligned((__le32 *) (preq_elem + offset)));
- }
+ 	/* Setup the Stats */
+-	entry = proc_create_data("Stats",
+-				 S_IFREG | (S_IRUGO&proc_perm),
+-				 apriv->proc_entry, &proc_stats_ops, dev);
++	entry = create_proc_entry("Stats",
++				  S_IFREG | (S_IRUGO&proc_perm),
++				  apriv->proc_entry);
+ 	if (!entry)
+ 		goto fail_stats;
+ 	entry->uid = proc_uid;
+ 	entry->gid = proc_gid;
++	entry->data = dev;
++	entry->owner = THIS_MODULE;
++	SETPROC_OPS(entry, proc_stats_ops);
  
- /* HWMP IE processing macros */
-diff -up linux-2.6.25.noarch/net/wireless/wext.c.orig linux-2.6.25.noarch/net/wireless/wext.c
---- linux-2.6.25.noarch/net/wireless/wext.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/net/wireless/wext.c	2008-05-19 17:31:10.000000000 -0400
-@@ -1157,7 +1157,7 @@ static void rtmsg_iwinfo(struct net_devi
- 	struct sk_buff *skb;
- 	int err;
+ 	/* Setup the Status */
+-	entry = proc_create_data("Status",
+-				 S_IFREG | (S_IRUGO&proc_perm),
+-				 apriv->proc_entry, &proc_status_ops, dev);
++	entry = create_proc_entry("Status",
++				  S_IFREG | (S_IRUGO&proc_perm),
++				  apriv->proc_entry);
+ 	if (!entry)
+ 		goto fail_status;
+ 	entry->uid = proc_uid;
+ 	entry->gid = proc_gid;
++	entry->data = dev;
++	entry->owner = THIS_MODULE;
++	SETPROC_OPS(entry, proc_status_ops);
  
--	if (dev_net(dev) != &init_net)
-+	if (dev->nd_net != &init_net)
- 		return;
+ 	/* Setup the Config */
+-	entry = proc_create_data("Config",
+-				 S_IFREG | proc_perm,
+-				 apriv->proc_entry, &proc_config_ops, dev);
++	entry = create_proc_entry("Config",
++				  S_IFREG | proc_perm,
++				  apriv->proc_entry);
+ 	if (!entry)
+ 		goto fail_config;
+ 	entry->uid = proc_uid;
+ 	entry->gid = proc_gid;
++	entry->data = dev;
++	entry->owner = THIS_MODULE;
++	SETPROC_OPS(entry, proc_config_ops);
  
- 	skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
-diff -up linux-2.6.25.noarch/net/wireless/radiotap.c.orig linux-2.6.25.noarch/net/wireless/radiotap.c
---- linux-2.6.25.noarch/net/wireless/radiotap.c.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/net/wireless/radiotap.c	2008-05-19 17:38:26.000000000 -0400
-@@ -59,21 +59,23 @@ int ieee80211_radiotap_iterator_init(
- 		return -EINVAL;
+ 	/* Setup the SSID */
+-	entry = proc_create_data("SSID",
+-				 S_IFREG | proc_perm,
+-				 apriv->proc_entry, &proc_SSID_ops, dev);
++	entry = create_proc_entry("SSID",
++				  S_IFREG | proc_perm,
++				  apriv->proc_entry);
+ 	if (!entry)
+ 		goto fail_ssid;
+ 	entry->uid = proc_uid;
+ 	entry->gid = proc_gid;
++	entry->data = dev;
++	entry->owner = THIS_MODULE;
++	SETPROC_OPS(entry, proc_SSID_ops);
  
- 	/* sanity check for allowed length and radiotap length field */
--	if (max_length < get_unaligned_le16(&radiotap_header->it_len))
-+	if (max_length < le16_to_cpu(get_unaligned(&radiotap_header->it_len)))
- 		return -EINVAL;
+ 	/* Setup the APList */
+-	entry = proc_create_data("APList",
+-				 S_IFREG | proc_perm,
+-				 apriv->proc_entry, &proc_APList_ops, dev);
++	entry = create_proc_entry("APList",
++				  S_IFREG | proc_perm,
++				  apriv->proc_entry);
+ 	if (!entry)
+ 		goto fail_aplist;
+ 	entry->uid = proc_uid;
+ 	entry->gid = proc_gid;
++	entry->data = dev;
++	entry->owner = THIS_MODULE;
++	SETPROC_OPS(entry, proc_APList_ops);
  
- 	iterator->rtheader = radiotap_header;
--	iterator->max_length = get_unaligned_le16(&radiotap_header->it_len);
-+	iterator->max_length = le16_to_cpu(get_unaligned(
-+						&radiotap_header->it_len));
- 	iterator->arg_index = 0;
--	iterator->bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present);
-+	iterator->bitmap_shifter = le32_to_cpu(get_unaligned(
-+						&radiotap_header->it_present));
- 	iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header);
- 	iterator->this_arg = NULL;
+ 	/* Setup the BSSList */
+-	entry = proc_create_data("BSSList",
+-				 S_IFREG | proc_perm,
+-				 apriv->proc_entry, &proc_BSSList_ops, dev);
++	entry = create_proc_entry("BSSList",
++				  S_IFREG | proc_perm,
++				  apriv->proc_entry);
+ 	if (!entry)
+ 		goto fail_bsslist;
+ 	entry->uid = proc_uid;
+ 	entry->gid = proc_gid;
++	entry->data = dev;
++	entry->owner = THIS_MODULE;
++	SETPROC_OPS(entry, proc_BSSList_ops);
  
- 	/* find payload start allowing for extended bitmap(s) */
+ 	/* Setup the WepKey */
+-	entry = proc_create_data("WepKey",
+-				 S_IFREG | proc_perm,
+-				 apriv->proc_entry, &proc_wepkey_ops, dev);
++	entry = create_proc_entry("WepKey",
++				  S_IFREG | proc_perm,
++				  apriv->proc_entry);
+ 	if (!entry)
+ 		goto fail_wepkey;
+ 	entry->uid = proc_uid;
+ 	entry->gid = proc_gid;
++	entry->data = dev;
++	entry->owner = THIS_MODULE;
++	SETPROC_OPS(entry, proc_wepkey_ops);
  
- 	if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) {
--		while (get_unaligned_le32(iterator->arg) &
--		       (1 << IEEE80211_RADIOTAP_EXT)) {
-+		while (le32_to_cpu(get_unaligned((__le32 *)iterator->arg)) &
-+				   (1<<IEEE80211_RADIOTAP_EXT)) {
- 			iterator->arg += sizeof(u32);
+ 	return 0;
  
- 			/*
-@@ -239,8 +241,8 @@ int ieee80211_radiotap_iterator_next(
- 			if (iterator->bitmap_shifter & 1) {
- 				/* b31 was set, there is more */
- 				/* move to next u32 bitmap */
--				iterator->bitmap_shifter =
--				    get_unaligned_le32(iterator->next_bitmap);
-+				iterator->bitmap_shifter = le32_to_cpu(
-+					get_unaligned(iterator->next_bitmap));
- 				iterator->next_bitmap++;
- 			} else
- 				/* no more bitmaps: end */
-diff -up linux-2.6.25.noarch/net/wireless/core.c.orig linux-2.6.25.noarch/net/wireless/core.c
---- linux-2.6.25.noarch/net/wireless/core.c.orig	2008-05-19 17:32:53.000000000 -0400
-+++ linux-2.6.25.noarch/net/wireless/core.c	2008-05-19 17:37:18.000000000 -0400
-@@ -167,13 +167,13 @@ int cfg80211_dev_rename(struct cfg80211_
+diff -up linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c.orig linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c
+--- linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c.orig	2008-05-27 14:51:16.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c	2008-05-27 14:51:25.000000000 -0400
+@@ -58,6 +58,10 @@
+ #include "reg.h"
+ #include "debug.h"
  
- 	/* Ignore nop renames */
- 	result = 0;
--	if (strcmp(newname, dev_name(&rdev->wiphy.dev)) == 0)
-+	if (strcmp(newname, rdev->wiphy.dev.bus_id) == 0)
- 		goto out_unlock;
++/* unaligned little endian access */
++#define LE_READ_2(_p) (le16_to_cpu(get_unaligned((__le16 *)(_p))))
++#define LE_READ_4(_p) (le32_to_cpu(get_unaligned((__le32 *)(_p))))
++
+ enum {
+ 	ATH_LED_TX,
+ 	ATH_LED_RX,
+@@ -2891,9 +2895,9 @@ static void ath5k_configure_filter(struc
+ 			if (!mclist)
+ 				break;
+ 			/* calculate XOR of eight 6-bit values */
+-			val = get_unaligned_le32(mclist->dmi_addr + 0);
++			val = LE_READ_4(mclist->dmi_addr + 0);
+ 			pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
+-			val = get_unaligned_le32(mclist->dmi_addr + 3);
++			val = LE_READ_4(mclist->dmi_addr + 3);
+ 			pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
+ 			pos &= 0x3f;
+ 			mfilt[pos / 32] |= (1 << (pos % 32));
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h.orig linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h
+--- linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h.orig	2008-05-27 14:51:16.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h	2008-05-27 14:51:25.000000000 -0400
+@@ -965,6 +965,22 @@ static inline bool __b43_warn_on_dummy(b
+ # define B43_WARN_ON(x)	__b43_warn_on_dummy(unlikely(!!(x)))
+ #endif
+ 
++/** Limit a value between two limits */
++#ifdef limit_value
++# undef limit_value
++#endif
++#define limit_value(value, min, max)  \
++	({						\
++		typeof(value) __value = (value);	\
++		typeof(value) __min = (min);		\
++		typeof(value) __max = (max);		\
++		if (__value < __min)			\
++			__value = __min;		\
++		else if (__value > __max)		\
++			__value = __max;		\
++		__value;				\
++	})
++
+ /* Convert an integer to a Q5.2 value */
+ #define INT_TO_Q52(i)	((i) << 2)
+ /* Convert a Q5.2 value to an integer (precision loss!) */
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h
+--- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h	2008-05-27 14:51:25.000000000 -0400
+@@ -823,6 +823,23 @@ void b43legacydbg(struct b43legacy_wl *w
+ # define b43legacydbg(wl, fmt...) do { /* nothing */ } while (0)
+ #endif /* DEBUG */
+ 
++
++/** Limit a value between two limits */
++#ifdef limit_value
++# undef limit_value
++#endif
++#define limit_value(value, min, max)  \
++	({						\
++		typeof(value) __value = (value);	\
++		typeof(value) __min = (min);		\
++		typeof(value) __max = (max);		\
++		if (__value < __min)			\
++			__value = __min;		\
++		else if (__value > __max)		\
++			__value = __max;		\
++		__value;				\
++	})
++
+ /* Macros for printing a value in Q5.2 format */
+ #define Q52_FMT		"%u.%u"
+ #define Q52_ARG(q52)	((q52) / 4), (((q52) & 3) * 100 / 4)
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c
+--- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c	2008-05-27 14:51:25.000000000 -0400
+@@ -846,10 +846,10 @@ static void handle_irq_noise(struct b43l
+ 	/* Get the noise samples. */
+ 	B43legacy_WARN_ON(dev->noisecalc.nr_samples >= 8);
+ 	i = dev->noisecalc.nr_samples;
+-	noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
+-	noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
+-	noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
+-	noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
++	noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
++	noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
++	noise[2] = limit_value(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
++	noise[3] = limit_value(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
+ 	dev->noisecalc.samples[i][0] = phy->nrssi_lt[noise[0]];
+ 	dev->noisecalc.samples[i][1] = phy->nrssi_lt[noise[1]];
+ 	dev->noisecalc.samples[i][2] = phy->nrssi_lt[noise[2]];
+@@ -1720,7 +1720,7 @@ static int b43legacy_write_initvals(stru
+ 				goto err_format;
+ 			array_size -= sizeof(iv->data.d32);
  
- 	/* Ensure another device does not already have this name. */
- 	list_for_each_entry(drv, &cfg80211_drv_list, list) {
- 		result = -EINVAL;
--		if (strcmp(newname, dev_name(&drv->wiphy.dev)) == 0)
-+		if (strcmp(newname, drv->wiphy.dev.bus_id) == 0)
- 			goto out_unlock;
- 	}
+-			value = get_unaligned_be32(&iv->data.d32);
++			value = be32_to_cpu(get_unaligned(&iv->data.d32));
+ 			b43legacy_write32(dev, offset, value);
  
-diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c
---- linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c	2008-05-19 17:42:19.000000000 -0400
-@@ -1400,7 +1400,7 @@ static void b43_phy_initg(struct b43_wld
+ 			iv = (const struct b43legacy_iv *)((const uint8_t *)iv +
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c
+--- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c	2008-05-27 14:51:25.000000000 -0400
+@@ -1088,7 +1088,7 @@ static void b43legacy_phy_initg(struct b
  		 * the value 0x7FFFFFFF here. I think that is some weird
  		 * compiler optimization in the original driver.
  		 * Essentially, what we do here is resetting all NRSSI LT
 -		 * entries to -32 (see the clamp_val() in nrssi_hw_update())
 +		 * entries to -32 (see the limit_value() in nrssi_hw_update())
  		 */
- 		b43_nrssi_hw_update(dev, 0xFFFF);	//FIXME?
- 		b43_calc_nrssi_threshold(dev);
-@@ -1462,13 +1462,13 @@ static s8 b43_phy_estimate_power_out(str
+ 		b43legacy_nrssi_hw_update(dev, 0xFFFF);
+ 		b43legacy_calc_nrssi_threshold(dev);
+@@ -1756,7 +1756,7 @@ static s8 b43legacy_phy_estimate_power_o
  	switch (phy->type) {
- 	case B43_PHYTYPE_A:
- 		tmp += 0x80;
--		tmp = clamp_val(tmp, 0x00, 0xFF);
-+		tmp = limit_value(tmp, 0x00, 0xFF);
- 		dbm = phy->tssi2dbm[tmp];
- 		//TODO: There's a FIXME on the specs
- 		break;
- 	case B43_PHYTYPE_B:
- 	case B43_PHYTYPE_G:
+ 	case B43legacy_PHYTYPE_B:
+ 	case B43legacy_PHYTYPE_G:
 -		tmp = clamp_val(tmp, 0x00, 0x3F);
 +		tmp = limit_value(tmp, 0x00, 0x3F);
  		dbm = phy->tssi2dbm[tmp];
  		break;
  	default:
-@@ -1527,8 +1527,8 @@ void b43_put_attenuation_into_ranges(str
- 		break;
+@@ -1859,7 +1859,7 @@ void b43legacy_phy_xmitpower(struct b43l
+ 
+ 	/* find the desired power in Q5.2 - power_level is in dBm
+ 	 * and limit it - max_pwr is already in Q5.2 */
+-	desired_pwr = clamp_val(phy->power_level << 2, 0, max_pwr);
++	desired_pwr = limit_value(phy->power_level << 2, 0, max_pwr);
+ 	if (b43legacy_debug(dev, B43legacy_DBG_XMITPOWER))
+ 		b43legacydbg(dev->wl, "Current TX power output: " Q52_FMT
+ 		       " dBm, Desired TX power output: " Q52_FMT
+@@ -1905,7 +1905,7 @@ void b43legacy_phy_xmitpower(struct b43l
+ 			radio_attenuation++;
+ 		}
  	}
+-	baseband_attenuation = clamp_val(baseband_attenuation, 0, 11);
++	baseband_attenuation = limit_value(baseband_attenuation, 0, 11);
  
--	*_rfatt = clamp_val(rfatt, rf_min, rf_max);
--	*_bbatt = clamp_val(bbatt, bb_min, bb_max);
-+	*_rfatt = limit_value(rfatt, rf_min, rf_max);
-+	*_bbatt = limit_value(bbatt, bb_min, bb_max);
- }
+ 	txpower = phy->txctl1;
+ 	if ((phy->radio_ver == 0x2050) && (phy->radio_rev == 2)) {
+@@ -1933,8 +1933,8 @@ void b43legacy_phy_xmitpower(struct b43l
+ 	}
+ 	/* Save the control values */
+ 	phy->txctl1 = txpower;
+-	baseband_attenuation = clamp_val(baseband_attenuation, 0, 11);
+-	radio_attenuation = clamp_val(radio_attenuation, 0, 9);
++	baseband_attenuation = limit_value(baseband_attenuation, 0, 11);
++	radio_attenuation = limit_value(radio_attenuation, 0, 9);
+ 	phy->rfatt = radio_attenuation;
+ 	phy->bbatt = baseband_attenuation;
  
- /* http://bcm-specs.sipsolutions.net/RecalculateTransmissionPower */
-@@ -1623,7 +1623,7 @@ void b43_phy_xmitpower(struct b43_wldev 
- 			/* Get desired power (in Q5.2) */
- 			desired_pwr = INT_TO_Q52(phy->power_level);
- 			/* And limit it. max_pwr already is Q5.2 */
--			desired_pwr = clamp_val(desired_pwr, 0, max_pwr);
-+			desired_pwr = limit_value(desired_pwr, 0, max_pwr);
- 			if (b43_debug(dev, B43_DBG_XMITPOWER)) {
- 				b43dbg(dev->wl,
- 				       "Current TX power output: " Q52_FMT
-@@ -1733,7 +1733,7 @@ static inline
+@@ -1979,7 +1979,7 @@ s8 b43legacy_tssi2dbm_entry(s8 entry [],
  		f = q;
  		i++;
  	} while (delta >= 2);
--	entry[index] = clamp_val(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128);
-+	entry[index] = limit_value(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128);
+-	entry[index] = clamp_val(b43legacy_tssi2dbm_ad(m1 * f, 8192),
++	entry[index] = limit_value(b43legacy_tssi2dbm_ad(m1 * f, 8192),
+ 				   -127, 128);
  	return 0;
  }
- 
-@@ -2259,7 +2259,7 @@ void b43_nrssi_hw_update(struct b43_wlde
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c
+--- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c	2008-05-27 14:51:25.000000000 -0400
+@@ -357,7 +357,7 @@ void b43legacy_nrssi_hw_update(struct b4
  	for (i = 0; i < 64; i++) {
- 		tmp = b43_nrssi_hw_read(dev, i);
+ 		tmp = b43legacy_nrssi_hw_read(dev, i);
  		tmp -= val;
 -		tmp = clamp_val(tmp, -32, 31);
 +		tmp = limit_value(tmp, -32, 31);
- 		b43_nrssi_hw_write(dev, i, tmp);
+ 		b43legacy_nrssi_hw_write(dev, i, tmp);
  	}
  }
-@@ -2276,7 +2276,7 @@ void b43_nrssi_mem_update(struct b43_wld
+@@ -375,7 +375,7 @@ void b43legacy_nrssi_mem_update(struct b
  		tmp = (i - delta) * phy->nrssislope;
  		tmp /= 0x10000;
  		tmp += 0x3A;
@@ -409,16 +393,16 @@
  		phy->nrssi_lt[i] = tmp;
  	}
  }
-@@ -2713,7 +2713,7 @@ void b43_calc_nrssi_threshold(struct b43
- 			} else
- 				threshold = phy->nrssi[1] - 5;
+@@ -839,7 +839,7 @@ void b43legacy_calc_nrssi_threshold(stru
+ 		} else
+ 			threshold = phy->nrssi[1] - 5;
  
--			threshold = clamp_val(threshold, 0, 0x3E);
-+			threshold = limit_value(threshold, 0, 0x3E);
- 			b43_phy_read(dev, 0x0020);	/* dummy read */
- 			b43_phy_write(dev, 0x0020,
- 				      (((u16) threshold) << 8) | 0x001C);
-@@ -2764,7 +2764,7 @@ void b43_calc_nrssi_threshold(struct b43
+-		threshold = clamp_val(threshold, 0, 0x3E);
++		threshold = limit_value(threshold, 0, 0x3E);
+ 		b43legacy_phy_read(dev, 0x0020); /* dummy read */
+ 		b43legacy_phy_write(dev, 0x0020, (((u16)threshold) << 8)
+ 				    | 0x001C);
+@@ -892,7 +892,7 @@ void b43legacy_calc_nrssi_threshold(stru
  			else
  				a += 32;
  			a = a >> 6;
@@ -427,18 +411,27 @@
  
  			b = b * (phy->nrssi[1] - phy->nrssi[0]);
  			b += (phy->nrssi[0] << 6);
-@@ -2773,7 +2773,7 @@ void b43_calc_nrssi_threshold(struct b43
+@@ -901,7 +901,7 @@ void b43legacy_calc_nrssi_threshold(stru
  			else
  				b += 32;
  			b = b >> 6;
 -			b = clamp_val(b, -31, 31);
 +			b = limit_value(b, -31, 31);
  
- 			tmp_u16 = b43_phy_read(dev, 0x048A) & 0xF000;
- 			tmp_u16 |= ((u32) b & 0x0000003F);
+ 			tmp_u16 = b43legacy_phy_read(dev, 0x048A) & 0xF000;
+ 			tmp_u16 |= ((u32)b & 0x0000003F);
+@@ -1905,7 +1905,7 @@ void b43legacy_radio_set_txpower_a(struc
+ 	u16 dac;
+ 	u16 ilt;
+ 
+-	txpower = clamp_val(txpower, 0, 63);
++	txpower = limit_value(txpower, 0, 63);
+ 
+ 	pamp = b43legacy_get_txgain_freq_power_amp(txpower);
+ 	pamp <<= 5;
 diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c
---- linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c	2008-05-19 17:42:19.000000000 -0400
+--- linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c	2008-05-27 14:51:25.000000000 -0400
 @@ -199,7 +199,7 @@ static void lo_measure_txctl_values(stru
  		if (lb_gain > 10) {
  			radio_pctl_reg = 0;
@@ -458,8 +451,8 @@
  		if (phy->pga_gain >= 5) {
  			phy->pga_gain -= 5;
 diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/main.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/main.c
---- linux-2.6.25.noarch/drivers/net/wireless/b43/main.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/b43/main.c	2008-05-19 17:42:19.000000000 -0400
+--- linux-2.6.25.noarch/drivers/net/wireless/b43/main.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43/main.c	2008-05-27 14:51:25.000000000 -0400
 @@ -1182,10 +1182,10 @@ static void handle_irq_noise(struct b43_
  	/* Get the noise samples. */
  	B43_WARN_ON(dev->noisecalc.nr_samples >= 8);
@@ -475,7 +468,7 @@
  	dev->noisecalc.samples[i][0] = phy->nrssi_lt[noise[0]];
  	dev->noisecalc.samples[i][1] = phy->nrssi_lt[noise[1]];
  	dev->noisecalc.samples[i][2] = phy->nrssi_lt[noise[2]];
-@@ -2178,7 +2178,7 @@ static int b43_write_initvals(struct b43
+@@ -2293,7 +2293,7 @@ static int b43_write_initvals(struct b43
  				goto err_format;
  			array_size -= sizeof(iv->data.d32);
  
@@ -484,245 +477,182 @@
  			b43_write32(dev, offset, value);
  
  			iv = (const struct b43_iv *)((const uint8_t *)iv +
-diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h.orig linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h
---- linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h	2008-05-19 17:42:19.000000000 -0400
-@@ -939,6 +939,22 @@ static inline bool __b43_warn_on_dummy(b
- # define B43_WARN_ON(x)	__b43_warn_on_dummy(unlikely(!!(x)))
- #endif
- 
-+/** Limit a value between two limits */
-+#ifdef limit_value
-+# undef limit_value
-+#endif
-+#define limit_value(value, min, max)  \
-+	({						\
-+		typeof(value) __value = (value);	\
-+		typeof(value) __min = (min);		\
-+		typeof(value) __max = (max);		\
-+		if (__value < __min)			\
-+			__value = __min;		\
-+		else if (__value > __max)		\
-+			__value = __max;		\
-+		__value;				\
-+	})
-+
- /* Convert an integer to a Q5.2 value */
- #define INT_TO_Q52(i)	((i) << 2)
- /* Convert a Q5.2 value to an integer (precision loss!) */
-diff -up linux-2.6.25.noarch/drivers/net/wireless/airo.c.orig linux-2.6.25.noarch/drivers/net/wireless/airo.c
---- linux-2.6.25.noarch/drivers/net/wireless/airo.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/airo.c	2008-05-19 17:31:10.000000000 -0400
-@@ -3659,7 +3659,7 @@ void mpi_receive_802_11 (struct airo_inf
- 	ptr += hdrlen;
- 	if (hdrlen == 24)
- 		ptr += 6;
--	gap = get_unaligned_le16(ptr);
-+	gap = le16_to_cpu(get_unaligned((__le16 *)ptr));
- 	ptr += sizeof(__le16);
- 	if (gap) {
- 		if (gap <= 8)
-@@ -4349,28 +4349,24 @@ static int proc_config_open( struct inod
- static int proc_wepkey_open( struct inode *inode, struct file *file );
- 
- static const struct file_operations proc_statsdelta_ops = {
--	.owner		= THIS_MODULE,
- 	.read		= proc_read,
- 	.open		= proc_statsdelta_open,
- 	.release	= proc_close
- };
- 
- static const struct file_operations proc_stats_ops = {
--	.owner		= THIS_MODULE,
- 	.read		= proc_read,
- 	.open		= proc_stats_open,
- 	.release	= proc_close
- };
- 
- static const struct file_operations proc_status_ops = {
--	.owner		= THIS_MODULE,
- 	.read		= proc_read,
- 	.open		= proc_status_open,
- 	.release	= proc_close
- };
- 
- static const struct file_operations proc_SSID_ops = {
--	.owner		= THIS_MODULE,
- 	.read		= proc_read,
- 	.write		= proc_write,
- 	.open		= proc_SSID_open,
-@@ -4378,7 +4374,6 @@ static const struct file_operations proc
- };
- 
- static const struct file_operations proc_BSSList_ops = {
--	.owner		= THIS_MODULE,
- 	.read		= proc_read,
- 	.write		= proc_write,
- 	.open		= proc_BSSList_open,
-@@ -4386,7 +4381,6 @@ static const struct file_operations proc
- };
+diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c
+--- linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c	2008-05-27 14:51:25.000000000 -0400
+@@ -1400,7 +1400,7 @@ static void b43_phy_initg(struct b43_wld
+ 		 * the value 0x7FFFFFFF here. I think that is some weird
+ 		 * compiler optimization in the original driver.
+ 		 * Essentially, what we do here is resetting all NRSSI LT
+-		 * entries to -32 (see the clamp_val() in nrssi_hw_update())
++		 * entries to -32 (see the limit_value() in nrssi_hw_update())
+ 		 */
+ 		b43_nrssi_hw_update(dev, 0xFFFF);	//FIXME?
+ 		b43_calc_nrssi_threshold(dev);
+@@ -1462,13 +1462,13 @@ static s8 b43_phy_estimate_power_out(str
+ 	switch (phy->type) {
+ 	case B43_PHYTYPE_A:
+ 		tmp += 0x80;
+-		tmp = clamp_val(tmp, 0x00, 0xFF);
++		tmp = limit_value(tmp, 0x00, 0xFF);
+ 		dbm = phy->tssi2dbm[tmp];
+ 		//TODO: There's a FIXME on the specs
+ 		break;
+ 	case B43_PHYTYPE_B:
+ 	case B43_PHYTYPE_G:
+-		tmp = clamp_val(tmp, 0x00, 0x3F);
++		tmp = limit_value(tmp, 0x00, 0x3F);
+ 		dbm = phy->tssi2dbm[tmp];
+ 		break;
+ 	default:
+@@ -1527,8 +1527,8 @@ void b43_put_attenuation_into_ranges(str
+ 		break;
+ 	}
  
- static const struct file_operations proc_APList_ops = {
--	.owner		= THIS_MODULE,
- 	.read		= proc_read,
- 	.write		= proc_write,
- 	.open		= proc_APList_open,
-@@ -4394,7 +4388,6 @@ static const struct file_operations proc
- };
+-	*_rfatt = clamp_val(rfatt, rf_min, rf_max);
+-	*_bbatt = clamp_val(bbatt, bb_min, bb_max);
++	*_rfatt = limit_value(rfatt, rf_min, rf_max);
++	*_bbatt = limit_value(bbatt, bb_min, bb_max);
+ }
  
- static const struct file_operations proc_config_ops = {
--	.owner		= THIS_MODULE,
- 	.read		= proc_read,
- 	.write		= proc_write,
- 	.open		= proc_config_open,
-@@ -4402,7 +4395,6 @@ static const struct file_operations proc
- };
+ /* http://bcm-specs.sipsolutions.net/RecalculateTransmissionPower */
+@@ -1623,7 +1623,7 @@ void b43_phy_xmitpower(struct b43_wldev 
+ 			/* Get desired power (in Q5.2) */
+ 			desired_pwr = INT_TO_Q52(phy->power_level);
+ 			/* And limit it. max_pwr already is Q5.2 */
+-			desired_pwr = clamp_val(desired_pwr, 0, max_pwr);
++			desired_pwr = limit_value(desired_pwr, 0, max_pwr);
+ 			if (b43_debug(dev, B43_DBG_XMITPOWER)) {
+ 				b43dbg(dev->wl,
+ 				       "Current TX power output: " Q52_FMT
+@@ -1733,7 +1733,7 @@ static inline
+ 		f = q;
+ 		i++;
+ 	} while (delta >= 2);
+-	entry[index] = clamp_val(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128);
++	entry[index] = limit_value(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128);
+ 	return 0;
+ }
  
- static const struct file_operations proc_wepkey_ops = {
--	.owner		= THIS_MODULE,
- 	.read		= proc_read,
- 	.write		= proc_write,
- 	.open		= proc_wepkey_open,
-@@ -4421,6 +4413,10 @@ struct proc_data {
- 	void (*on_close) (struct inode *, struct file *);
- };
+@@ -2259,7 +2259,7 @@ void b43_nrssi_hw_update(struct b43_wlde
+ 	for (i = 0; i < 64; i++) {
+ 		tmp = b43_nrssi_hw_read(dev, i);
+ 		tmp -= val;
+-		tmp = clamp_val(tmp, -32, 31);
++		tmp = limit_value(tmp, -32, 31);
+ 		b43_nrssi_hw_write(dev, i, tmp);
+ 	}
+ }
+@@ -2276,7 +2276,7 @@ void b43_nrssi_mem_update(struct b43_wld
+ 		tmp = (i - delta) * phy->nrssislope;
+ 		tmp /= 0x10000;
+ 		tmp += 0x3A;
+-		tmp = clamp_val(tmp, 0, 0x3F);
++		tmp = limit_value(tmp, 0, 0x3F);
+ 		phy->nrssi_lt[i] = tmp;
+ 	}
+ }
+@@ -2713,7 +2713,7 @@ void b43_calc_nrssi_threshold(struct b43
+ 			} else
+ 				threshold = phy->nrssi[1] - 5;
  
-+#ifndef SETPROC_OPS
-+#define SETPROC_OPS(entry, ops) (entry)->proc_fops = &(ops)
-+#endif
-+
- static int setup_proc_entry( struct net_device *dev,
- 			     struct airo_info *apriv ) {
- 	struct proc_dir_entry *entry;
-@@ -4436,76 +4432,100 @@ static int setup_proc_entry( struct net_
- 	apriv->proc_entry->owner = THIS_MODULE;
+-			threshold = clamp_val(threshold, 0, 0x3E);
++			threshold = limit_value(threshold, 0, 0x3E);
+ 			b43_phy_read(dev, 0x0020);	/* dummy read */
+ 			b43_phy_write(dev, 0x0020,
+ 				      (((u16) threshold) << 8) | 0x001C);
+@@ -2764,7 +2764,7 @@ void b43_calc_nrssi_threshold(struct b43
+ 			else
+ 				a += 32;
+ 			a = a >> 6;
+-			a = clamp_val(a, -31, 31);
++			a = limit_value(a, -31, 31);
  
- 	/* Setup the StatsDelta */
--	entry = proc_create_data("StatsDelta",
--				 S_IFREG | (S_IRUGO&proc_perm),
--				 apriv->proc_entry, &proc_statsdelta_ops, dev);
-+	entry = create_proc_entry("StatsDelta",
-+				  S_IFREG | (S_IRUGO&proc_perm),
-+				  apriv->proc_entry);
- 	if (!entry)
- 		goto fail_stats_delta;
- 	entry->uid = proc_uid;
- 	entry->gid = proc_gid;
-+	entry->data = dev;
-+	entry->owner = THIS_MODULE;
-+	SETPROC_OPS(entry, proc_statsdelta_ops);
+ 			b = b * (phy->nrssi[1] - phy->nrssi[0]);
+ 			b += (phy->nrssi[0] << 6);
+@@ -2773,7 +2773,7 @@ void b43_calc_nrssi_threshold(struct b43
+ 			else
+ 				b += 32;
+ 			b = b >> 6;
+-			b = clamp_val(b, -31, 31);
++			b = limit_value(b, -31, 31);
  
- 	/* Setup the Stats */
--	entry = proc_create_data("Stats",
--				 S_IFREG | (S_IRUGO&proc_perm),
--				 apriv->proc_entry, &proc_stats_ops, dev);
-+	entry = create_proc_entry("Stats",
-+				  S_IFREG | (S_IRUGO&proc_perm),
-+				  apriv->proc_entry);
- 	if (!entry)
- 		goto fail_stats;
- 	entry->uid = proc_uid;
- 	entry->gid = proc_gid;
-+	entry->data = dev;
-+	entry->owner = THIS_MODULE;
-+	SETPROC_OPS(entry, proc_stats_ops);
+ 			tmp_u16 = b43_phy_read(dev, 0x048A) & 0xF000;
+ 			tmp_u16 |= ((u32) b & 0x0000003F);
+diff -up linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c.orig linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c
+--- linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c	2008-05-27 14:51:25.000000000 -0400
+@@ -556,36 +556,40 @@ static void iwl3945_add_radiotap(struct 
+ 	iwl3945_rt->rt_hdr.it_pad = 0;
  
- 	/* Setup the Status */
--	entry = proc_create_data("Status",
--				 S_IFREG | (S_IRUGO&proc_perm),
--				 apriv->proc_entry, &proc_status_ops, dev);
-+	entry = create_proc_entry("Status",
-+				  S_IFREG | (S_IRUGO&proc_perm),
-+				  apriv->proc_entry);
- 	if (!entry)
- 		goto fail_status;
- 	entry->uid = proc_uid;
- 	entry->gid = proc_gid;
-+	entry->data = dev;
-+	entry->owner = THIS_MODULE;
-+	SETPROC_OPS(entry, proc_status_ops);
+ 	/* total header + data */
+-	put_unaligned_le16(sizeof(*iwl3945_rt), &iwl3945_rt->rt_hdr.it_len);
++	put_unaligned(cpu_to_le16(sizeof(*iwl3945_rt)),
++		      &iwl3945_rt->rt_hdr.it_len);
  
- 	/* Setup the Config */
--	entry = proc_create_data("Config",
--				 S_IFREG | proc_perm,
--				 apriv->proc_entry, &proc_config_ops, dev);
-+	entry = create_proc_entry("Config",
-+				  S_IFREG | proc_perm,
-+				  apriv->proc_entry);
- 	if (!entry)
- 		goto fail_config;
- 	entry->uid = proc_uid;
- 	entry->gid = proc_gid;
-+	entry->data = dev;
-+	entry->owner = THIS_MODULE;
-+	SETPROC_OPS(entry, proc_config_ops);
+ 	/* Indicate all the fields we add to the radiotap header */
+-	put_unaligned_le32((1 << IEEE80211_RADIOTAP_TSFT) |
+-			   (1 << IEEE80211_RADIOTAP_FLAGS) |
+-			   (1 << IEEE80211_RADIOTAP_RATE) |
+-			   (1 << IEEE80211_RADIOTAP_CHANNEL) |
+-			   (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
+-			   (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
+-			   (1 << IEEE80211_RADIOTAP_ANTENNA),
+-			&iwl3945_rt->rt_hdr.it_present);
++	put_unaligned(cpu_to_le32((1 << IEEE80211_RADIOTAP_TSFT) |
++				  (1 << IEEE80211_RADIOTAP_FLAGS) |
++				  (1 << IEEE80211_RADIOTAP_RATE) |
++				  (1 << IEEE80211_RADIOTAP_CHANNEL) |
++				  (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
++				  (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
++				  (1 << IEEE80211_RADIOTAP_ANTENNA)),
++		      &iwl3945_rt->rt_hdr.it_present);
  
- 	/* Setup the SSID */
--	entry = proc_create_data("SSID",
--				 S_IFREG | proc_perm,
--				 apriv->proc_entry, &proc_SSID_ops, dev);
-+	entry = create_proc_entry("SSID",
-+				  S_IFREG | proc_perm,
-+				  apriv->proc_entry);
- 	if (!entry)
- 		goto fail_ssid;
- 	entry->uid = proc_uid;
- 	entry->gid = proc_gid;
-+	entry->data = dev;
-+	entry->owner = THIS_MODULE;
-+	SETPROC_OPS(entry, proc_SSID_ops);
+ 	/* Zero the flags, we'll add to them as we go */
+ 	iwl3945_rt->rt_flags = 0;
  
- 	/* Setup the APList */
--	entry = proc_create_data("APList",
--				 S_IFREG | proc_perm,
--				 apriv->proc_entry, &proc_APList_ops, dev);
-+	entry = create_proc_entry("APList",
-+				  S_IFREG | proc_perm,
-+				  apriv->proc_entry);
- 	if (!entry)
- 		goto fail_aplist;
- 	entry->uid = proc_uid;
- 	entry->gid = proc_gid;
-+	entry->data = dev;
-+	entry->owner = THIS_MODULE;
-+	SETPROC_OPS(entry, proc_APList_ops);
+-	put_unaligned_le64(tsf, &iwl3945_rt->rt_tsf);
++	put_unaligned(cpu_to_le64(tsf), &iwl3945_rt->rt_tsf);
  
- 	/* Setup the BSSList */
--	entry = proc_create_data("BSSList",
--				 S_IFREG | proc_perm,
--				 apriv->proc_entry, &proc_BSSList_ops, dev);
-+	entry = create_proc_entry("BSSList",
-+				  S_IFREG | proc_perm,
-+				  apriv->proc_entry);
- 	if (!entry)
- 		goto fail_bsslist;
- 	entry->uid = proc_uid;
- 	entry->gid = proc_gid;
-+	entry->data = dev;
-+	entry->owner = THIS_MODULE;
-+	SETPROC_OPS(entry, proc_BSSList_ops);
+ 	iwl3945_rt->rt_dbmsignal = signal;
+ 	iwl3945_rt->rt_dbmnoise = noise;
  
- 	/* Setup the WepKey */
--	entry = proc_create_data("WepKey",
--				 S_IFREG | proc_perm,
--				 apriv->proc_entry, &proc_wepkey_ops, dev);
-+	entry = create_proc_entry("WepKey",
-+				  S_IFREG | proc_perm,
-+				  apriv->proc_entry);
- 	if (!entry)
- 		goto fail_wepkey;
- 	entry->uid = proc_uid;
- 	entry->gid = proc_gid;
-+	entry->data = dev;
-+	entry->owner = THIS_MODULE;
-+	SETPROC_OPS(entry, proc_wepkey_ops);
+ 	/* Convert the channel frequency and set the flags */
+-	put_unaligned_le16(stats->freq, &iwl3945_rt->rt_channelMHz);
++	put_unaligned(cpu_to_le16(stats->freq), &iwl3945_rt->rt_channelMHz);
+ 	if (!(phy_flags_hw & RX_RES_PHY_FLAGS_BAND_24_MSK))
+-		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ,
++		put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM |
++					  IEEE80211_CHAN_5GHZ),
+ 			      &iwl3945_rt->rt_chbitmask);
+ 	else if (phy_flags_hw & RX_RES_PHY_FLAGS_MOD_CCK_MSK)
+-		put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
++		put_unaligned(cpu_to_le16(IEEE80211_CHAN_CCK |
++					  IEEE80211_CHAN_2GHZ),
+ 			      &iwl3945_rt->rt_chbitmask);
+ 	else	/* 802.11g */
+-		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
++		put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM |
++					  IEEE80211_CHAN_2GHZ),
+ 			      &iwl3945_rt->rt_chbitmask);
  
- 	return 0;
+ 	if (rate == -1)
+diff -up linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c.orig linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c
+--- linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c	2008-05-27 14:51:25.000000000 -0400
+@@ -523,7 +523,7 @@ static int lbs_process_bss(struct bss_de
  
+ 	if (*bytesleft >= sizeof(beaconsize)) {
+ 		/* Extract & convert beacon size from the command buffer */
+-		beaconsize = get_unaligned_le16(*pbeaconinfo);
++		beaconsize = le16_to_cpu(get_unaligned((__le16 *)*pbeaconinfo));
+ 		*bytesleft -= sizeof(beaconsize);
+ 		*pbeaconinfo += sizeof(beaconsize);
+ 	}
 diff -up linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c.orig linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c
---- linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c	2008-05-19 17:31:10.000000000 -0400
-@@ -545,11 +545,11 @@ static void handle_rx_packet(struct zd_u
+--- linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c	2008-05-27 14:51:25.000000000 -0400
+@@ -556,11 +556,11 @@ static void handle_rx_packet(struct zd_u
  	 * be padded. Unaligned access might also happen if the length_info
  	 * structure is not present.
  	 */
@@ -736,269 +666,384 @@
  			if (k == 0)
  				return;
  			n = l+k;
-diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c
---- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c	2008-05-19 17:43:33.000000000 -0400
-@@ -1088,7 +1088,7 @@ static void b43legacy_phy_initg(struct b
- 		 * the value 0x7FFFFFFF here. I think that is some weird
- 		 * compiler optimization in the original driver.
- 		 * Essentially, what we do here is resetting all NRSSI LT
--		 * entries to -32 (see the clamp_val() in nrssi_hw_update())
-+		 * entries to -32 (see the limit_value() in nrssi_hw_update())
- 		 */
- 		b43legacy_nrssi_hw_update(dev, 0xFFFF);
- 		b43legacy_calc_nrssi_threshold(dev);
-@@ -1756,7 +1756,7 @@ static s8 b43legacy_phy_estimate_power_o
- 	switch (phy->type) {
- 	case B43legacy_PHYTYPE_B:
- 	case B43legacy_PHYTYPE_G:
--		tmp = clamp_val(tmp, 0x00, 0x3F);
-+		tmp = limit_value(tmp, 0x00, 0x3F);
- 		dbm = phy->tssi2dbm[tmp];
- 		break;
- 	default:
-@@ -1859,7 +1859,7 @@ void b43legacy_phy_xmitpower(struct b43l
+diff -up linux-2.6.25.noarch/net/mac80211/iface.c.orig linux-2.6.25.noarch/net/mac80211/iface.c
+--- linux-2.6.25.noarch/net/mac80211/iface.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/net/mac80211/iface.c	2008-05-27 14:51:25.000000000 -0400
+@@ -53,15 +53,6 @@ int ieee80211_if_add(struct net_device *
+ 	if (!ndev)
+ 		return -ENOMEM;
  
- 	/* find the desired power in Q5.2 - power_level is in dBm
- 	 * and limit it - max_pwr is already in Q5.2 */
--	desired_pwr = clamp_val(phy->power_level << 2, 0, max_pwr);
-+	desired_pwr = limit_value(phy->power_level << 2, 0, max_pwr);
- 	if (b43legacy_debug(dev, B43legacy_DBG_XMITPOWER))
- 		b43legacydbg(dev->wl, "Current TX power output: " Q52_FMT
- 		       " dBm, Desired TX power output: " Q52_FMT
-@@ -1905,7 +1905,7 @@ void b43legacy_phy_xmitpower(struct b43l
- 			radio_attenuation++;
- 		}
- 	}
--	baseband_attenuation = clamp_val(baseband_attenuation, 0, 11);
-+	baseband_attenuation = limit_value(baseband_attenuation, 0, 11);
+-	ndev->needed_headroom = local->tx_headroom +
+-				4*6 /* four MAC addresses */
+-				+ 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
+-				+ 6 /* mesh */
+-				+ 8 /* rfc1042/bridge tunnel */
+-				- ETH_HLEN /* ethernet hard_header_len */
+-				+ IEEE80211_ENCRYPT_HEADROOM;
+-	ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
+-
+ 	ret = dev_alloc_name(ndev, ndev->name);
+ 	if (ret < 0)
+ 		goto fail;
+diff -up linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c.orig linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c
+--- linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c	2008-05-27 14:51:25.000000000 -0400
+@@ -26,7 +26,7 @@ static inline u32 u32_field_get(u8 *preq
+ {
+ 	if (ae)
+ 		offset += 6;
+-	return get_unaligned_le32(preq_elem + offset);
++	return le32_to_cpu(get_unaligned((__le32 *) (preq_elem + offset)));
+ }
  
- 	txpower = phy->txctl1;
- 	if ((phy->radio_ver == 0x2050) && (phy->radio_rev == 2)) {
-@@ -1933,8 +1933,8 @@ void b43legacy_phy_xmitpower(struct b43l
- 	}
- 	/* Save the control values */
- 	phy->txctl1 = txpower;
--	baseband_attenuation = clamp_val(baseband_attenuation, 0, 11);
--	radio_attenuation = clamp_val(radio_attenuation, 0, 9);
-+	baseband_attenuation = limit_value(baseband_attenuation, 0, 11);
-+	radio_attenuation = limit_value(radio_attenuation, 0, 9);
- 	phy->rfatt = radio_attenuation;
- 	phy->bbatt = baseband_attenuation;
+ /* HWMP IE processing macros */
+diff -up linux-2.6.25.noarch/net/mac80211/michael.c.orig linux-2.6.25.noarch/net/mac80211/michael.c
+--- linux-2.6.25.noarch/net/mac80211/michael.c.orig	2008-05-27 15:04:36.000000000 -0400
++++ linux-2.6.25.noarch/net/mac80211/michael.c	2008-05-27 15:22:30.000000000 -0400
+@@ -29,17 +29,16 @@ static void michael_block(struct michael
+ static void michael_mic_hdr(struct michael_mic_ctx *mctx,
+ 			const u8 *key, const u8 *da, const u8 *sa, u8 priority)
+ {
+-	mctx->l = get_unaligned_le32(key);
+-	mctx->r = get_unaligned_le32(key + 4);
++	mctx->l = key[0] | key[1] << 8 | key[2] << 16 | key[3] << 24;
++	mctx->r = key[4] | key[5] << 8 | key[6] << 16 | key[7] << 24;
+ 
+ 	/*
+ 	 * A pseudo header (DA, SA, Priority, 0, 0, 0) is used in Michael MIC
+ 	 * calculation, but it is _not_ transmitted
+ 	 */
+-	michael_block(mctx, get_unaligned_le32(da));
+-	michael_block(mctx, get_unaligned_le16(&da[4]) |
+-			    (get_unaligned_le16(sa) << 16));
+-	michael_block(mctx, get_unaligned_le32(&sa[2]));
++	michael_block(mctx, da[0] | da[1] << 8 | da[2] << 16 | da[3] << 24);
++	michael_block(mctx, da[4] | da[5] << 8 | sa[0] << 16 | sa[1] << 24);
++	michael_block(mctx, sa[2] | sa[3] << 8 | sa[4] << 16 | sa[5] << 24);
+ 	michael_block(mctx, priority);
+ }
  
-@@ -1979,7 +1979,7 @@ s8 b43legacy_tssi2dbm_entry(s8 entry [],
- 		f = q;
- 		i++;
- 	} while (delta >= 2);
--	entry[index] = clamp_val(b43legacy_tssi2dbm_ad(m1 * f, 8192),
-+	entry[index] = limit_value(b43legacy_tssi2dbm_ad(m1 * f, 8192),
- 				   -127, 128);
- 	return 0;
+@@ -57,7 +56,9 @@ void michael_mic(const u8 *key, const u8
+ 	left = data_len % 4;
+ 
+ 	for (block = 0; block < blocks; block++)
+-		michael_block(&mctx, get_unaligned_le32(&data[block * 4]));
++		michael_block(&mctx,
++			data[block * 4] | data[block * 4 + 1] << 8 |
++			data[block * 4 + 2] << 16 | data[block * 4 + 3] << 24);
+ 
+ 	/* Partial block of 0..3 bytes and padding: 0x5a + 4..7 zeros to make
+ 	 * total length a multiple of 4. */
+@@ -71,6 +72,12 @@ void michael_mic(const u8 *key, const u8
+ 	michael_block(&mctx, val);
+ 	michael_block(&mctx, 0);
+ 
+-	put_unaligned_le32(mctx.l, mic);
+-	put_unaligned_le32(mctx.r, mic + 4);
++	mic[0] = mctx.l & 0xff;
++	mic[1] = (mctx.l >> 8) & 0xff;
++	mic[2] = (mctx.l >> 16) & 0xff;
++	mic[3] = (mctx.l >> 24) & 0xff;
++	mic[4] = mctx.r & 0xff;
++	mic[5] = (mctx.r >> 8) & 0xff;
++	mic[6] = (mctx.r >> 16) & 0xff;
++	mic[7] = (mctx.r >> 24) & 0xff;
  }
-diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c
---- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c	2008-05-19 17:43:33.000000000 -0400
-@@ -357,7 +357,7 @@ void b43legacy_nrssi_hw_update(struct b4
- 	for (i = 0; i < 64; i++) {
- 		tmp = b43legacy_nrssi_hw_read(dev, i);
- 		tmp -= val;
--		tmp = clamp_val(tmp, -32, 31);
-+		tmp = limit_value(tmp, -32, 31);
- 		b43legacy_nrssi_hw_write(dev, i, tmp);
- 	}
+diff -up linux-2.6.25.noarch/net/mac80211/tkip.c.orig linux-2.6.25.noarch/net/mac80211/tkip.c
+--- linux-2.6.25.noarch/net/mac80211/tkip.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/net/mac80211/tkip.c	2008-05-27 15:23:42.000000000 -0400
+@@ -7,22 +7,23 @@
+  * published by the Free Software Foundation.
+  */
+ #include <linux/kernel.h>
+-#include <linux/bitops.h>
+ #include <linux/types.h>
+ #include <linux/netdevice.h>
+-#include <asm/unaligned.h>
+ 
+ #include <net/mac80211.h>
+ #include "key.h"
+ #include "tkip.h"
+ #include "wep.h"
+ 
++
++/* TKIP key mixing functions */
++
++
+ #define PHASE1_LOOP_COUNT 8
+ 
+-/*
+- * 2-byte by 2-byte subset of the full AES S-box table; second part of this
+- * table is identical to first part but byte-swapped
+- */
++
++/* 2-byte by 2-byte subset of the full AES S-box table; second part of this
++ * table is identical to first part but byte-swapped */
+ static const u16 tkip_sbox[256] =
+ {
+ 	0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154,
+@@ -59,13 +60,53 @@ static const u16 tkip_sbox[256] =
+ 	0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A,
+ };
+ 
+-static u16 tkipS(u16 val)
++
++static inline u16 Mk16(u8 x, u8 y)
++{
++	return ((u16) x << 8) | (u16) y;
++}
++
++
++static inline u8 Hi8(u16 v)
++{
++	return v >> 8;
++}
++
++
++static inline u8 Lo8(u16 v)
++{
++	return v & 0xff;
++}
++
++
++static inline u16 Hi16(u32 v)
++{
++	return v >> 16;
++}
++
++
++static inline u16 Lo16(u32 v)
++{
++	return v & 0xffff;
++}
++
++
++static inline u16 RotR1(u16 v)
+ {
+-	return tkip_sbox[val & 0xff] ^ swab16(tkip_sbox[val >> 8]);
++	return (v >> 1) | ((v & 0x0001) << 15);
  }
-@@ -375,7 +375,7 @@ void b43legacy_nrssi_mem_update(struct b
- 		tmp = (i - delta) * phy->nrssislope;
- 		tmp /= 0x10000;
- 		tmp += 0x3A;
--		tmp = clamp_val(tmp, 0, 0x3F);
-+		tmp = limit_value(tmp, 0, 0x3F);
- 		phy->nrssi_lt[i] = tmp;
+ 
+-/*
+- * P1K := Phase1(TA, TK, TSC)
++
++static inline u16 tkip_S(u16 val)
++{
++	u16 a = tkip_sbox[Hi8(val)];
++
++	return tkip_sbox[Lo8(val)] ^ Hi8(a) ^ (Lo8(a) << 8);
++}
++
++
++
++/* P1K := Phase1(TA, TK, TSC)
+  * TA = transmitter address (48 bits)
+  * TK = dot11DefaultKeyValue or dot11KeyMappingValue (128 bits)
+  * TSC = TKIP sequence counter (48 bits, only 32 msb bits used)
+@@ -78,19 +119,19 @@ static void tkip_mixing_phase1(struct ie
+ 	const u8 *tk = &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY];
+ 	u16 *p1k = ctx->p1k;
+ 
+-	p1k[0] = tsc_IV32 & 0xFFFF;
+-	p1k[1] = tsc_IV32 >> 16;
+-	p1k[2] = get_unaligned_le16(ta + 0);
+-	p1k[3] = get_unaligned_le16(ta + 2);
+-	p1k[4] = get_unaligned_le16(ta + 4);
++	p1k[0] = Lo16(tsc_IV32);
++	p1k[1] = Hi16(tsc_IV32);
++	p1k[2] = Mk16(ta[1], ta[0]);
++	p1k[3] = Mk16(ta[3], ta[2]);
++	p1k[4] = Mk16(ta[5], ta[4]);
+ 
+ 	for (i = 0; i < PHASE1_LOOP_COUNT; i++) {
+ 		j = 2 * (i & 1);
+-		p1k[0] += tkipS(p1k[4] ^ get_unaligned_le16(tk + 0 + j));
+-		p1k[1] += tkipS(p1k[0] ^ get_unaligned_le16(tk + 4 + j));
+-		p1k[2] += tkipS(p1k[1] ^ get_unaligned_le16(tk + 8 + j));
+-		p1k[3] += tkipS(p1k[2] ^ get_unaligned_le16(tk + 12 + j));
+-		p1k[4] += tkipS(p1k[3] ^ get_unaligned_le16(tk + 0 + j)) + i;
++		p1k[0] += tkip_S(p1k[4] ^ Mk16(tk[ 1 + j], tk[ 0 + j]));
++		p1k[1] += tkip_S(p1k[0] ^ Mk16(tk[ 5 + j], tk[ 4 + j]));
++		p1k[2] += tkip_S(p1k[1] ^ Mk16(tk[ 9 + j], tk[ 8 + j]));
++		p1k[3] += tkip_S(p1k[2] ^ Mk16(tk[13 + j], tk[12 + j]));
++		p1k[4] += tkip_S(p1k[3] ^ Mk16(tk[ 1 + j], tk[ 0 + j])) + i;
  	}
+ 	ctx->initialized = 1;
+ }
+@@ -110,29 +151,31 @@ static void tkip_mixing_phase2(struct ie
+ 	ppk[4] = p1k[4];
+ 	ppk[5] = p1k[4] + tsc_IV16;
+ 
+-	ppk[0] += tkipS(ppk[5] ^ get_unaligned_le16(tk + 0));
+-	ppk[1] += tkipS(ppk[0] ^ get_unaligned_le16(tk + 2));
+-	ppk[2] += tkipS(ppk[1] ^ get_unaligned_le16(tk + 4));
+-	ppk[3] += tkipS(ppk[2] ^ get_unaligned_le16(tk + 6));
+-	ppk[4] += tkipS(ppk[3] ^ get_unaligned_le16(tk + 8));
+-	ppk[5] += tkipS(ppk[4] ^ get_unaligned_le16(tk + 10));
+-	ppk[0] += ror16(ppk[5] ^ get_unaligned_le16(tk + 12), 1);
+-	ppk[1] += ror16(ppk[0] ^ get_unaligned_le16(tk + 14), 1);
+-	ppk[2] += ror16(ppk[1], 1);
+-	ppk[3] += ror16(ppk[2], 1);
+-	ppk[4] += ror16(ppk[3], 1);
+-	ppk[5] += ror16(ppk[4], 1);
+-
+-	rc4key[0] = tsc_IV16 >> 8;
+-	rc4key[1] = ((tsc_IV16 >> 8) | 0x20) & 0x7f;
+-	rc4key[2] = tsc_IV16 & 0xFF;
+-	rc4key[3] = ((ppk[5] ^ get_unaligned_le16(tk)) >> 1) & 0xFF;
+-
+-	rc4key += 4;
+-	for (i = 0; i < 6; i++)
+-		put_unaligned_le16(ppk[i], rc4key + 2 * i);
++	ppk[0] += tkip_S(ppk[5] ^ Mk16(tk[ 1], tk[ 0]));
++	ppk[1] += tkip_S(ppk[0] ^ Mk16(tk[ 3], tk[ 2]));
++	ppk[2] += tkip_S(ppk[1] ^ Mk16(tk[ 5], tk[ 4]));
++	ppk[3] += tkip_S(ppk[2] ^ Mk16(tk[ 7], tk[ 6]));
++	ppk[4] += tkip_S(ppk[3] ^ Mk16(tk[ 9], tk[ 8]));
++	ppk[5] += tkip_S(ppk[4] ^ Mk16(tk[11], tk[10]));
++	ppk[0] +=  RotR1(ppk[5] ^ Mk16(tk[13], tk[12]));
++	ppk[1] +=  RotR1(ppk[0] ^ Mk16(tk[15], tk[14]));
++	ppk[2] +=  RotR1(ppk[1]);
++	ppk[3] +=  RotR1(ppk[2]);
++	ppk[4] +=  RotR1(ppk[3]);
++	ppk[5] +=  RotR1(ppk[4]);
++
++	rc4key[0] = Hi8(tsc_IV16);
++	rc4key[1] = (Hi8(tsc_IV16) | 0x20) & 0x7f;
++	rc4key[2] = Lo8(tsc_IV16);
++	rc4key[3] = Lo8((ppk[5] ^ Mk16(tk[1], tk[0])) >> 1);
++
++	for (i = 0; i < 6; i++) {
++		rc4key[4 + 2 * i] = Lo8(ppk[i]);
++		rc4key[5 + 2 * i] = Hi8(ppk[i]);
++	}
  }
-@@ -839,7 +839,7 @@ void b43legacy_calc_nrssi_threshold(stru
- 		} else
- 			threshold = phy->nrssi[1] - 5;
- 
--		threshold = clamp_val(threshold, 0, 0x3E);
-+		threshold = limit_value(threshold, 0, 0x3E);
- 		b43legacy_phy_read(dev, 0x0020); /* dummy read */
- 		b43legacy_phy_write(dev, 0x0020, (((u16)threshold) << 8)
- 				    | 0x001C);
-@@ -892,7 +892,7 @@ void b43legacy_calc_nrssi_threshold(stru
- 			else
- 				a += 32;
- 			a = a >> 6;
--			a = clamp_val(a, -31, 31);
-+			a = limit_value(a, -31, 31);
  
- 			b = b * (phy->nrssi[1] - phy->nrssi[0]);
- 			b += (phy->nrssi[0] << 6);
-@@ -901,7 +901,7 @@ void b43legacy_calc_nrssi_threshold(stru
- 			else
- 				b += 32;
- 			b = b >> 6;
--			b = clamp_val(b, -31, 31);
-+			b = limit_value(b, -31, 31);
++
+ /* Add TKIP IV and Ext. IV at @pos. @iv0, @iv1, and @iv2 are the first octets
+  * of the IV. Returns pointer to the octet following IVs (i.e., beginning of
+  * the packet payload). */
+@@ -143,8 +186,11 @@ u8 *ieee80211_tkip_add_iv(u8 *pos, struc
+ 	*pos++ = iv1;
+ 	*pos++ = iv2;
+ 	*pos++ = (key->conf.keyidx << 6) | (1 << 5) /* Ext IV */;
+-	put_unaligned_le32(key->u.tkip.tx.iv32, pos);
+-	return pos + 4;
++	*pos++ = key->u.tkip.tx.iv32 & 0xff;
++	*pos++ = (key->u.tkip.tx.iv32 >> 8) & 0xff;
++	*pos++ = (key->u.tkip.tx.iv32 >> 16) & 0xff;
++	*pos++ = (key->u.tkip.tx.iv32 >> 24) & 0xff;
++	return pos;
+ }
  
- 			tmp_u16 = b43legacy_phy_read(dev, 0x048A) & 0xF000;
- 			tmp_u16 |= ((u32)b & 0x0000003F);
-@@ -1905,7 +1905,7 @@ void b43legacy_radio_set_txpower_a(struc
- 	u16 dac;
- 	u16 ilt;
+ static void ieee80211_tkip_gen_rc4key(struct ieee80211_key *key, u8 *ta,
+@@ -171,8 +217,10 @@ void ieee80211_get_tkip_key(struct ieee8
+ 	u16 iv16;
+ 	u32 iv32;
  
--	txpower = clamp_val(txpower, 0, 63);
-+	txpower = limit_value(txpower, 0, 63);
+-	iv16 = data[hdr_len + 2] | (data[hdr_len] << 8);
+-	iv32 = get_unaligned_le32(data + hdr_len + 4);
++	iv16 = data[hdr_len] << 8;
++	iv16 += data[hdr_len + 2];
++	iv32 = data[hdr_len + 4] | (data[hdr_len + 5] << 8) |
++	       (data[hdr_len + 6] << 16) | (data[hdr_len + 7] << 24);
  
- 	pamp = b43legacy_get_txgain_freq_power_amp(txpower);
- 	pamp <<= 5;
-diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c
---- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c	2008-05-19 17:43:33.000000000 -0400
-@@ -846,10 +846,10 @@ static void handle_irq_noise(struct b43l
- 	/* Get the noise samples. */
- 	B43legacy_WARN_ON(dev->noisecalc.nr_samples >= 8);
- 	i = dev->noisecalc.nr_samples;
--	noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
--	noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
--	noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
--	noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
-+	noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
-+	noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
-+	noise[2] = limit_value(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
-+	noise[3] = limit_value(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1);
- 	dev->noisecalc.samples[i][0] = phy->nrssi_lt[noise[0]];
- 	dev->noisecalc.samples[i][1] = phy->nrssi_lt[noise[1]];
- 	dev->noisecalc.samples[i][2] = phy->nrssi_lt[noise[2]];
-@@ -1720,7 +1720,7 @@ static int b43legacy_write_initvals(stru
- 				goto err_format;
- 			array_size -= sizeof(iv->data.d32);
+ #ifdef CONFIG_TKIP_DEBUG
+ 	printk(KERN_DEBUG "TKIP encrypt: iv16 = 0x%04x, iv32 = 0x%08x\n",
+@@ -217,6 +265,7 @@ void ieee80211_tkip_encrypt_data(struct 
+ 	ieee80211_wep_encrypt_data(tfm, rc4key, 16, pos, payload_len);
+ }
  
--			value = get_unaligned_be32(&iv->data.d32);
-+			value = be32_to_cpu(get_unaligned(&iv->data.d32));
- 			b43legacy_write32(dev, offset, value);
++
+ /* Decrypt packet payload with TKIP using @key. @pos is a pointer to the
+  * beginning of the buffer containing IEEE 802.11 header payload, i.e.,
+  * including IV, Ext. IV, real data, Michael MIC, ICV. @payload_len is the
+@@ -237,7 +286,7 @@ int ieee80211_tkip_decrypt_data(struct c
  
- 			iv = (const struct b43legacy_iv *)((const uint8_t *)iv +
-diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h
---- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h.orig	2008-05-19 17:29:38.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h	2008-05-19 17:43:33.000000000 -0400
-@@ -823,6 +823,23 @@ void b43legacydbg(struct b43legacy_wl *w
- # define b43legacydbg(wl, fmt...) do { /* nothing */ } while (0)
- #endif /* DEBUG */
+ 	iv16 = (pos[0] << 8) | pos[2];
+ 	keyid = pos[3];
+-	iv32 = get_unaligned_le32(pos + 4);
++	iv32 = pos[4] | (pos[5] << 8) | (pos[6] << 16) | (pos[7] << 24);
+ 	pos += 8;
+ #ifdef CONFIG_TKIP_DEBUG
+ 	{
+@@ -340,3 +389,5 @@ int ieee80211_tkip_decrypt_data(struct c
  
+ 	return res;
+ }
 +
-+/** Limit a value between two limits */
-+#ifdef limit_value
-+# undef limit_value
-+#endif
-+#define limit_value(value, min, max)  \
-+	({						\
-+		typeof(value) __value = (value);	\
-+		typeof(value) __min = (min);		\
-+		typeof(value) __max = (max);		\
-+		if (__value < __min)			\
-+			__value = __min;		\
-+		else if (__value > __max)		\
-+			__value = __max;		\
-+		__value;				\
-+	})
 +
- /* Macros for printing a value in Q5.2 format */
- #define Q52_FMT		"%u.%u"
- #define Q52_ARG(q52)	((q52) / 4), (((q52) & 3) * 100 / 4)
-diff -up linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c.orig linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c
---- linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c	2008-05-19 17:31:10.000000000 -0400
-@@ -523,7 +523,7 @@ static int lbs_process_bss(struct bss_de
+diff -up linux-2.6.25.noarch/net/wireless/core.c.orig linux-2.6.25.noarch/net/wireless/core.c
+--- linux-2.6.25.noarch/net/wireless/core.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/net/wireless/core.c	2008-05-27 14:51:25.000000000 -0400
+@@ -167,13 +167,13 @@ int cfg80211_dev_rename(struct cfg80211_
  
- 	if (*bytesleft >= sizeof(beaconsize)) {
- 		/* Extract & convert beacon size from the command buffer */
--		beaconsize = get_unaligned_le16(*pbeaconinfo);
-+		beaconsize = le16_to_cpu(get_unaligned((__le16 *)*pbeaconinfo));
- 		*bytesleft -= sizeof(beaconsize);
- 		*pbeaconinfo += sizeof(beaconsize);
+ 	/* Ignore nop renames */
+ 	result = 0;
+-	if (strcmp(newname, dev_name(&rdev->wiphy.dev)) == 0)
++	if (strcmp(newname, rdev->wiphy.dev.bus_id) == 0)
+ 		goto out_unlock;
+ 
+ 	/* Ensure another device does not already have this name. */
+ 	list_for_each_entry(drv, &cfg80211_drv_list, list) {
+ 		result = -EINVAL;
+-		if (strcmp(newname, dev_name(&drv->wiphy.dev)) == 0)
++		if (strcmp(newname, drv->wiphy.dev.bus_id) == 0)
+ 			goto out_unlock;
  	}
-diff -up linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c.orig linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c
---- linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c	2008-05-19 17:31:10.000000000 -0400
-@@ -554,36 +554,40 @@ static void iwl3945_add_radiotap(struct 
- 	iwl3945_rt->rt_hdr.it_pad = 0;
  
- 	/* total header + data */
--	put_unaligned_le16(sizeof(*iwl3945_rt), &iwl3945_rt->rt_hdr.it_len);
-+	put_unaligned(cpu_to_le16(sizeof(*iwl3945_rt)),
-+		      &iwl3945_rt->rt_hdr.it_len);
+diff -up linux-2.6.25.noarch/net/wireless/radiotap.c.orig linux-2.6.25.noarch/net/wireless/radiotap.c
+--- linux-2.6.25.noarch/net/wireless/radiotap.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/net/wireless/radiotap.c	2008-05-27 14:51:25.000000000 -0400
+@@ -59,21 +59,23 @@ int ieee80211_radiotap_iterator_init(
+ 		return -EINVAL;
  
- 	/* Indicate all the fields we add to the radiotap header */
--	put_unaligned_le32((1 << IEEE80211_RADIOTAP_TSFT) |
--			   (1 << IEEE80211_RADIOTAP_FLAGS) |
--			   (1 << IEEE80211_RADIOTAP_RATE) |
--			   (1 << IEEE80211_RADIOTAP_CHANNEL) |
--			   (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
--			   (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
--			   (1 << IEEE80211_RADIOTAP_ANTENNA),
--			&iwl3945_rt->rt_hdr.it_present);
-+	put_unaligned(cpu_to_le32((1 << IEEE80211_RADIOTAP_TSFT) |
-+				  (1 << IEEE80211_RADIOTAP_FLAGS) |
-+				  (1 << IEEE80211_RADIOTAP_RATE) |
-+				  (1 << IEEE80211_RADIOTAP_CHANNEL) |
-+				  (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
-+				  (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
-+				  (1 << IEEE80211_RADIOTAP_ANTENNA)),
-+		      &iwl3945_rt->rt_hdr.it_present);
+ 	/* sanity check for allowed length and radiotap length field */
+-	if (max_length < get_unaligned_le16(&radiotap_header->it_len))
++	if (max_length < le16_to_cpu(get_unaligned(&radiotap_header->it_len)))
+ 		return -EINVAL;
  
- 	/* Zero the flags, we'll add to them as we go */
- 	iwl3945_rt->rt_flags = 0;
+ 	iterator->rtheader = radiotap_header;
+-	iterator->max_length = get_unaligned_le16(&radiotap_header->it_len);
++	iterator->max_length = le16_to_cpu(get_unaligned(
++						&radiotap_header->it_len));
+ 	iterator->arg_index = 0;
+-	iterator->bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present);
++	iterator->bitmap_shifter = le32_to_cpu(get_unaligned(
++						&radiotap_header->it_present));
+ 	iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header);
+ 	iterator->this_arg = NULL;
  
--	put_unaligned_le64(tsf, &iwl3945_rt->rt_tsf);
-+	put_unaligned(cpu_to_le64(tsf), &iwl3945_rt->rt_tsf);
+ 	/* find payload start allowing for extended bitmap(s) */
  
- 	iwl3945_rt->rt_dbmsignal = signal;
- 	iwl3945_rt->rt_dbmnoise = noise;
+ 	if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) {
+-		while (get_unaligned_le32(iterator->arg) &
+-		       (1 << IEEE80211_RADIOTAP_EXT)) {
++		while (le32_to_cpu(get_unaligned((__le32 *)iterator->arg)) &
++				   (1<<IEEE80211_RADIOTAP_EXT)) {
+ 			iterator->arg += sizeof(u32);
  
- 	/* Convert the channel frequency and set the flags */
--	put_unaligned_le16(stats->freq, &iwl3945_rt->rt_channelMHz);
-+	put_unaligned(cpu_to_le16(stats->freq), &iwl3945_rt->rt_channelMHz);
- 	if (!(phy_flags_hw & RX_RES_PHY_FLAGS_BAND_24_MSK))
--		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ,
-+		put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM |
-+					  IEEE80211_CHAN_5GHZ),
- 			      &iwl3945_rt->rt_chbitmask);
- 	else if (phy_flags_hw & RX_RES_PHY_FLAGS_MOD_CCK_MSK)
--		put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
-+		put_unaligned(cpu_to_le16(IEEE80211_CHAN_CCK |
-+					  IEEE80211_CHAN_2GHZ),
- 			      &iwl3945_rt->rt_chbitmask);
- 	else	/* 802.11g */
--		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
-+		put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM |
-+					  IEEE80211_CHAN_2GHZ),
- 			      &iwl3945_rt->rt_chbitmask);
+ 			/*
+@@ -239,8 +241,8 @@ int ieee80211_radiotap_iterator_next(
+ 			if (iterator->bitmap_shifter & 1) {
+ 				/* b31 was set, there is more */
+ 				/* move to next u32 bitmap */
+-				iterator->bitmap_shifter =
+-				    get_unaligned_le32(iterator->next_bitmap);
++				iterator->bitmap_shifter = le32_to_cpu(
++					get_unaligned(iterator->next_bitmap));
+ 				iterator->next_bitmap++;
+ 			} else
+ 				/* no more bitmaps: end */
+diff -up linux-2.6.25.noarch/net/wireless/wext.c.orig linux-2.6.25.noarch/net/wireless/wext.c
+--- linux-2.6.25.noarch/net/wireless/wext.c.orig	2008-05-27 14:51:17.000000000 -0400
++++ linux-2.6.25.noarch/net/wireless/wext.c	2008-05-27 14:51:25.000000000 -0400
+@@ -1157,7 +1157,7 @@ static void rtmsg_iwinfo(struct net_devi
+ 	struct sk_buff *skb;
+ 	int err;
  
- 	if (rate == -1)
-diff -up linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c.orig linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c
---- linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c.orig	2008-05-19 17:31:02.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c	2008-05-19 17:31:10.000000000 -0400
-@@ -58,6 +58,10 @@
- #include "reg.h"
- #include "debug.h"
+-	if (dev_net(dev) != &init_net)
++	if (dev->nd_net != &init_net)
+ 		return;
  
-+/* unaligned little endian access */
-+#define LE_READ_2(_p) (le16_to_cpu(get_unaligned((__le16 *)(_p))))
-+#define LE_READ_4(_p) (le32_to_cpu(get_unaligned((__le32 *)(_p))))
-+
- enum {
- 	ATH_LED_TX,
- 	ATH_LED_RX,
-@@ -2894,9 +2898,9 @@ static void ath5k_configure_filter(struc
- 			if (!mclist)
- 				break;
- 			/* calculate XOR of eight 6-bit values */
--			val = get_unaligned_le32(mclist->dmi_addr + 0);
-+			val = LE_READ_4(mclist->dmi_addr + 0);
- 			pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
--			val = get_unaligned_le32(mclist->dmi_addr + 3);
-+			val = LE_READ_4(mclist->dmi_addr + 3);
- 			pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
- 			pos &= 0x3f;
- 			mfilt[pos / 32] |= (1 << (pos % 32));
+ 	skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);

linux-2.6-wireless-pending.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.45 -r 1.46 linux-2.6-wireless-pending.patch
Index: linux-2.6-wireless-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-wireless-pending.patch,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- linux-2.6-wireless-pending.patch	22 May 2008 01:40:01 -0000	1.45
+++ linux-2.6-wireless-pending.patch	29 May 2008 18:46:09 -0000	1.46
@@ -1,33251 +1,48521 @@
-commit 297c3669dd481e977927dc123ed3deed10833e2a
-Author: Holger Schurig <hs4233 at mail.mn-solutions.de>
-Date:   Wed May 14 16:27:18 2008 +0200
+commit 9e72ebd686a7f39facdfff639386055f1ad7dc88
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Wed May 21 17:33:42 2008 +0200
 
-    libertas: remove lbs_get_data_rate()
+    mac80211: remove channel use statistics
     
-    lbs_get_data_rate() gets called, but no-one uses it's result.
+    The useless channel use statistics are quite a lot of code, currently
+    use integer divisions in the packet fast path, are rather inaccurate
+    since they do not account for retries and finally nobody even cares.
+    Hence, remove them completely.
     
-    Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 7cb92ee3af4f32ae278c6aad4d9c49fb52a99a66
-Author: Harvey Harrison <harvey.harrison at gmail.com>
-Date:   Tue May 13 18:13:35 2008 -0700
+commit 53c068566dde708cb28a4dfc06ae3d7fd7434397
+Author: Michael Buesch <mb at bu3sch.de>
+Date:   Tue May 20 00:24:36 2008 +0200
 
-    b43: use the bitrev helpers rather than rolling a private one
+    b43: Add firmware markers support
     
-    The 4-bit reversal flip_4bit is replaced with the bitrev helper
-    bitrev8 and a 4-bit shift.  The B43_WARN is moved to the location
-    where a register is read from for checking there.  The other caller
-    explicitly passes an array index which is guaranteed to be within range
-    and so a B43_WARN is not added there.
+    This adds support for firmware markers.
+    With firmware markers it's easily possible to check whether the
+    firmware runs some codepath or not. The driver will throw a message
+    when the firmware executes a MARKER(x).
     
-    Signed-off-by: Harvey Harrison <harvey.harrison at gmail.com>
-    Reviewed-by: Michael Buesch <mb at bu3sch.de>
+    Signed-off-by: Michael Buesch <mb at bu3sch.de>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 8c122e14ca821402b9181f16494d9f11169deeae
-Author: Bob Copeland <me at bobcopeland.com>
-Date:   Mon May 12 21:16:44 2008 -0400
+commit afa83e239af58a93eddd10a7a43ac5618884db15
+Author: Michael Buesch <mb at bu3sch.de>
+Date:   Mon May 19 23:51:37 2008 +0200
 
-    ath5k: Fix loop variable initializations
-    
-    In ath5k_tasklet_rx, both status structures 'rxs' and 'rs' are
-    initialized at the top of the tasklet, but not within the loop.
-    If the loop is executed multiple times in the tasklet then the
-    variables may see changes from previous packets.
-    
-    For TKIP, this results in 'Invalid Michael MIC' errors if two packets
-    are processed in the tasklet: rxs.flag gets set to RX_DECRYPTED by
-    mac80211 when it decrypts the first encrypted packet.  The subsequent
-    packet will have RX_DECRYPTED set upon entry to mac80211, so mac80211
-    will not try to decrypt it.
+    b43: Add panic reason code that doesn't trigger restart
     
-    We currently initialize all but two fields in the structures, so fix
-    the other two.
+    Add a firmware panic reason code that doesn't trigger a restart.
+    This is useful for firmware debugging and avoiding endless
+    restart loops. We can use FWPANIC_DIE to halt the firmware at a
+    well defined point.
     
-    Signed-off-by: Bob Copeland <me at bobcopeland.com>
+    Signed-off-by: Michael Buesch <mb at bu3sch.de>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 01669110ba331be385af8d5310ff6c3b93b09620
-Author: Ivo van Doorn <ivdoorn at gmail.com>
-Date:   Tue May 13 15:03:02 2008 +0200
+commit 6821783271aaf541504ff8a138184fcc83fa282b
+Author: Michael Buesch <mb at bu3sch.de>
+Date:   Sat May 17 23:43:57 2008 +0200
 
-    mac80211: Set IEEE80211_TXPD_REQ_TX_STATUS for all TX frames
-    
-    All interfaces should set the IEEE80211_TXPD_REQ_TX_STATUS flag for all TX frames
-    which will force the master interface to set the IEEE80211_TX_CTL_REQ_TX_STATUS
-    flag. This in turn will allow drivers to check for that flag before reporting
-    the TX status to mac80211.
-    
-    This is very usefull when frames (like beacons, RTS and CTS-to-self) should not
-    be reported back to mac80211. Later we could add more extensive checks to
-    exclude more frames from being reported, or let mac80211 decide if it wants
-    the frame for status reporting or not.
+    b43: Allow running without PCM firmware
     
-    v2: Monitor interfaces should also set IEEE80211_TXPD_REQ_TX_STATUS
+    This patch adds code to allow running the device without PCM firmware loaded.
+    Without PCM firmware we don't have hardware accelerated crypto on
+    devices with a core rev <= 10.
     
-    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
-    Acked-by: Johannes Berg <johannes at sipsolutions.net>
+    Signed-off-by: Michael Buesch <mb at bu3sch.de>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 5e15aedb1d67c2d31643edc3fa282647b0f3befb
-Author: Huang Weiyi <weiyi.huang at gmail.com>
-Date:   Sat May 10 11:12:31 2008 +0200
+commit e48b0eeb0ab508021b654a45f332b30cac2163b9
+Author: Michael Buesch <mb at bu3sch.de>
+Date:   Sat May 17 22:44:35 2008 +0200
 
-    b43: nphy.c remove duplicated include
+    b43: Add hooks for firmware debugging
     
-    Remove duplicated include <linux/delay.h> in
-    drivers/net/wireless/b43/nphy.c
+    This patch adds some hooks for firmware debugging.
     
-    Signed-off-by: Huang Weiyi <weiyi.huang at gmail.com>
     Signed-off-by: Michael Buesch <mb at bu3sch.de>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 7ce2d429578b4e32ea68d60e7f16a2a7bb17dada
-Author: Eric W. Biederman <ebiederm at xmission.com>
-Date:   Thu May 8 14:30:18 2008 -0700
+commit e2530083609148a7835b54c431f6b8956407c1f6
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Sat May 17 00:57:14 2008 +0200
 
-    wireless: Add missing locking to cfg80211_dev_rename
-    
-    device_rename only performs useful and race free validity
-    checking at the optional sysfs level so depending on it
-    for all of the validity checking in cfg80211_dev_rename
-    is racy.
+    mac80211: use multi-queue master netdevice
     
-    Instead implement all of the needed validity checking
-    and locking in cfg80211_dev_rename.
+    This patch updates mac80211 and drivers to be multi-queue aware and
+    use that instead of the internal queue mapping. Also does a number
+    of cleanups in various pieces of the code that fall out and reduces
+    internal mac80211 state size.
     
-    Signed-off-by: Eric W. Biederman <ebiederm at xmission.com>
-    Acked-by: Johannes Berg <johannes at sipsolutions.net>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 54a5c8046dce102c1a435ca5a95f5c0699662d21
-Author: Bruno Randolf <br1 at einfach.org>
-Date:   Thu May 8 19:22:43 2008 +0200
+commit eefce91a384a64c7bbf913eb08c4adfb911c3639
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date:   Sat May 17 00:57:13 2008 +0200
 
-    mac80211: make rx radiotap header more flexible
+    mac80211: dont allow fragmentation and requeuing on A-MPDU queues
     
-    use hw flags and rx flags to determine which fields are present in the header
-    and use all available information from the driver.
-    
-    make sure radiotap header starts at a naturally aligned address (mod 8) for
-    all radiotap fields.
+    There really is no reason for a driver to reject a frame on
+    an A-MPDU queue when it can stop that queue for any period
+    of time and is given frames one by one. Hence, disallow it
+    with a big warning and reduce mac80211-internal state.
+    
+    Also add a warning when we try to fragment a frame destined
+    for an A-MPDU queue and drop it, the actual bug needs to be
+    fixed elsewhere but I'm not exactly sure how to yet.
     
-    Signed-off-by: Bruno Randolf <br1 at einfach.org>
+    Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+    Cc: Ron Rindjunsky <ron.rindjunsky at intel.com>
     Signed-off-by: John W. Linville <linville at tuxdriver.com>
 
-commit 7ccf488058d5539b1145c1605a5574ce90b68460
-Author: Bruno Randolf <br1 at einfach.org>
-Date:   Thu May 8 19:15:40 2008 +0200
+commit e93048825face354ecb0cb3ac00190c764a44f45
+Author: Larry.Finger at lwfinger.net <Larry.Finger at lwfinger.net>
+Date:   Thu May 15 14:07:36 2008 -0500
 
-    mac80211: use hardware flags for signal/noise units
-    
-    trying to clean up the signal/noise code. the previous code in mac80211 had
[...79230 lines suppressed...]
+@@ -143,8 +143,11 @@ void cfg80211_put_dev(struct cfg80211_re
+ int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
+ 			char *newname)
+ {
++	struct cfg80211_registered_device *drv;
+ 	int idx, taken = -1, result, digits;
  
- 		ieee80211_tx_status(sc->hw, skb, &txs);
--		sc->tx_stats.data[txq->qnum].count++;
-+		sc->tx_stats[txq->qnum].count++;
++	mutex_lock(&cfg80211_drv_mutex);
++
+ 	/* prohibit calling the thing phy%d when %d is not its number */
+ 	sscanf(newname, PHY_NAME "%d%n", &idx, &taken);
+ 	if (taken == strlen(newname) && idx != rdev->idx) {
+@@ -156,14 +159,30 @@ int cfg80211_dev_rename(struct cfg80211_
+ 		 * deny the name if it is phy<idx> where <idx> is printed
+ 		 * without leading zeroes. taken == strlen(newname) here
+ 		 */
++		result = -EINVAL;
+ 		if (taken == strlen(PHY_NAME) + digits)
+-			return -EINVAL;
++			goto out_unlock;
++	}
++
++
++	/* Ignore nop renames */
++	result = 0;
++	if (strcmp(newname, dev_name(&rdev->wiphy.dev)) == 0)
++		goto out_unlock;
++
++	/* Ensure another device does not already have this name. */
++	list_for_each_entry(drv, &cfg80211_drv_list, list) {
++		result = -EINVAL;
++		if (strcmp(newname, dev_name(&drv->wiphy.dev)) == 0)
++			goto out_unlock;
+ 	}
  
- 		spin_lock(&sc->txbuflock);
--		sc->tx_stats.data[txq->qnum].len--;
-+		sc->tx_stats[txq->qnum].len--;
- 		list_move_tail(&bf->list, &sc->txbuf);
- 		sc->txbuf_len++;
- 		spin_unlock(&sc->txbuflock);
-diff -up linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.h.orig linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.h
---- linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.h.orig	2008-05-21 16:15:37.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.h	2008-05-21 16:18:07.000000000 -0400
-@@ -92,7 +92,8 @@ struct ath5k_softc {
- 	struct pci_dev		*pdev;		/* for dma mapping */
- 	void __iomem		*iobase;	/* address of the device */
- 	struct mutex		lock;		/* dev-level lock */
--	struct ieee80211_tx_queue_stats tx_stats;
-+	/* FIXME: how many does it really need? */
-+	struct ieee80211_tx_queue_stats tx_stats[16];
- 	struct ieee80211_low_level_stats ll_stats;
- 	struct ieee80211_hw	*hw;		/* IEEE 802.11 common */
- 	struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
-diff -up linux-2.6.25.noarch/drivers/net/wireless/arlan.h.orig linux-2.6.25.noarch/drivers/net/wireless/arlan.h
---- linux-2.6.25.noarch/drivers/net/wireless/arlan.h.orig	2008-04-16 22:49:44.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/arlan.h	2008-05-21 16:18:07.000000000 -0400
-@@ -330,7 +330,6 @@ struct TxParam
- #define TX_RING_SIZE 2
- /* Information that need to be kept for each board. */
- struct arlan_private {
--      struct net_device_stats stats;
-       struct arlan_shmem __iomem * card;
-       struct arlan_shmem * conf;
+-	/* this will check for collisions */
++	/* this will only check for collisions in sysfs
++	 * which is not even always compiled in.
++	 */
+ 	result = device_rename(&rdev->wiphy.dev, newname);
+ 	if (result)
+-		return result;
++		goto out_unlock;
  
-diff -up linux-2.6.25.noarch/drivers/net/wireless/adm8211.c.orig linux-2.6.25.noarch/drivers/net/wireless/adm8211.c
---- linux-2.6.25.noarch/drivers/net/wireless/adm8211.c.orig	2008-05-21 16:15:37.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/net/wireless/adm8211.c	2008-05-21 16:18:07.000000000 -0400
-@@ -306,11 +306,10 @@ static int adm8211_get_tx_stats(struct i
- 				struct ieee80211_tx_queue_stats *stats)
- {
- 	struct adm8211_priv *priv = dev->priv;
--	struct ieee80211_tx_queue_stats_data *data = &stats->data[0];
+ 	if (!debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
+ 			    rdev->wiphy.debugfsdir,
+@@ -172,9 +191,13 @@ int cfg80211_dev_rename(struct cfg80211_
+ 		printk(KERN_ERR "cfg80211: failed to rename debugfs dir to %s!\n",
+ 		       newname);
  
--	data->len = priv->cur_tx - priv->dirty_tx;
--	data->limit = priv->tx_ring_size - 2;
--	data->count = priv->dirty_tx;
-+	stats[0].len = priv->cur_tx - priv->dirty_tx;
-+	stats[0].limit = priv->tx_ring_size - 2;
-+	stats[0].count = priv->dirty_tx;
+-	nl80211_notify_dev_rename(rdev);
++	result = 0;
++out_unlock:
++	mutex_unlock(&cfg80211_drv_mutex);
++	if (result == 0)
++		nl80211_notify_dev_rename(rdev);
  
- 	return 0;
+-	return 0;
++	return result;
  }
-@@ -446,9 +445,9 @@ static void adm8211_interrupt_rci(struct
- 			struct ieee80211_rx_status rx_status = {0};
  
- 			if (priv->pdev->revision < ADM8211_REV_CA)
--				rx_status.ssi = rssi;
-+				rx_status.signal = rssi;
- 			else
--				rx_status.ssi = 100 - rssi;
-+				rx_status.signal = 100 - rssi;
- 
- 			rx_status.rate_idx = rate;
+ /* exported functions */
+diff -up linux-2.6.25.noarch/net/wireless/radiotap.c.orig linux-2.6.25.noarch/net/wireless/radiotap.c
+--- linux-2.6.25.noarch/net/wireless/radiotap.c.orig	2008-05-29 14:16:26.000000000 -0400
++++ linux-2.6.25.noarch/net/wireless/radiotap.c	2008-05-29 14:19:53.000000000 -0400
+@@ -59,23 +59,21 @@ int ieee80211_radiotap_iterator_init(
+ 		return -EINVAL;
  
-@@ -1894,9 +1893,10 @@ static int __devinit adm8211_probe(struc
+ 	/* sanity check for allowed length and radiotap length field */
+-	if (max_length < le16_to_cpu(get_unaligned(&radiotap_header->it_len)))
++	if (max_length < get_unaligned_le16(&radiotap_header->it_len))
+ 		return -EINVAL;
  
- 	dev->extra_tx_headroom = sizeof(struct adm8211_tx_hdr);
- 	/* dev->flags = IEEE80211_HW_RX_INCLUDES_FCS in promisc mode */
-+	dev->flags = IEEE80211_HW_SIGNAL_UNSPEC;
+ 	iterator->rtheader = radiotap_header;
+-	iterator->max_length = le16_to_cpu(get_unaligned(
+-						&radiotap_header->it_len));
++	iterator->max_length = get_unaligned_le16(&radiotap_header->it_len);
+ 	iterator->arg_index = 0;
+-	iterator->bitmap_shifter = le32_to_cpu(get_unaligned(
+-						&radiotap_header->it_present));
++	iterator->bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present);
+ 	iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header);
+ 	iterator->this_arg = NULL;
  
- 	dev->channel_change_time = 1000;
--	dev->max_rssi = 100;	/* FIXME: find better value */
-+	dev->max_signal = 100;    /* FIXME: find better value */
+ 	/* find payload start allowing for extended bitmap(s) */
  
- 	dev->queues = 1; /* ADM8211C supports more, maybe ADM8211B too */
+ 	if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) {
+-		while (le32_to_cpu(get_unaligned((__le32 *)iterator->arg)) &
+-				   (1<<IEEE80211_RADIOTAP_EXT)) {
++		while (get_unaligned_le32(iterator->arg) &
++		       (1 << IEEE80211_RADIOTAP_EXT)) {
+ 			iterator->arg += sizeof(u32);
  
-diff -up linux-2.6.25.noarch/drivers/ssb/pci.c.orig linux-2.6.25.noarch/drivers/ssb/pci.c
---- linux-2.6.25.noarch/drivers/ssb/pci.c.orig	2008-05-21 16:15:37.000000000 -0400
-+++ linux-2.6.25.noarch/drivers/ssb/pci.c	2008-05-21 16:18:07.000000000 -0400
-@@ -510,17 +510,15 @@ static int ssb_pci_sprom_get(struct ssb_
- 	sprom_do_read(bus, buf);
- 	err = sprom_check_crc(buf, bus->sprom_size);
- 	if (err) {
--		/* check for rev 4 sprom - has special signature */
--		if (buf[32] == 0x5372) {
--			kfree(buf);
--			buf = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
--				      GFP_KERNEL);
--			if (!buf)
--				goto out;
--			bus->sprom_size = SSB_SPROMSIZE_WORDS_R4;
--			sprom_do_read(bus, buf);
--			err = sprom_check_crc(buf, bus->sprom_size);
--		}
-+		/* try for a 440 byte SPROM - revision 4 and higher */
-+		kfree(buf);
-+		buf = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
-+			      GFP_KERNEL);
-+		if (!buf)
-+			goto out;
-+		bus->sprom_size = SSB_SPROMSIZE_WORDS_R4;
-+		sprom_do_read(bus, buf);
-+		err = sprom_check_crc(buf, bus->sprom_size);
- 		if (err)
- 			ssb_printk(KERN_WARNING PFX "WARNING: Invalid"
- 				   " SPROM CRC (corrupt SPROM)\n");
+ 			/*
+@@ -241,8 +239,8 @@ int ieee80211_radiotap_iterator_next(
+ 			if (iterator->bitmap_shifter & 1) {
+ 				/* b31 was set, there is more */
+ 				/* move to next u32 bitmap */
+-				iterator->bitmap_shifter = le32_to_cpu(
+-					get_unaligned(iterator->next_bitmap));
++				iterator->bitmap_shifter =
++				    get_unaligned_le32(iterator->next_bitmap);
+ 				iterator->next_bitmap++;
+ 			} else
+ 				/* no more bitmaps: end */

linux-2.6-wireless.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.38 -r 1.39 linux-2.6-wireless.patch
Index: linux-2.6-wireless.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-wireless.patch,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- linux-2.6-wireless.patch	22 May 2008 01:40:01 -0000	1.38
+++ linux-2.6-wireless.patch	29 May 2008 18:46:10 -0000	1.39
@@ -1,3 +1,330 @@
+commit c97c23e38625f59e3e9869664eeeb0cab1822948
+Author: Senthil Balasubramanian <senthilkumar at atheros.com>
+Date:   Wed May 28 23:15:32 2008 +0530
+
+    mac80211: fix alignment issue with compare_ether_addr()
+    
+    This addresses an alignment issue with compare_ether_addr().
+    The addresses passed to compare_ether_addr should be two bytes aligned.
+    It may function properly in x86 platform. However may not work properly
+    on IA-64 or ARM processor.
+    
+    This also fixes a typo in mlme.c where the sk_buff struct name is incorect.
+    Though sizeof() works for any incorrect structure pointer name as its just
+    a pointer length that we want, lets just fix it.
+    
+    Signed-off-by: Senthil Balasubramanian <senthilkumar at atheros.com>
+    Signed-off-by: Luis R. Rodriguez <lrodriguez at atheros.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 70d251b24c44ab2fcba1807a5206e844cf10eb38
+Author: Senthil Balasubramanian <senthilkumar at atheros.com>
+Date:   Wed May 28 20:08:12 2008 +0530
+
+    mac80211: Fix for NULL pointer dereference in sta_info_get()
+    
+    This addresses a NULL pointer dereference in sta_info_get().
+    TID and sta_info are extracted in ADDBA Timer expiry function
+    through the timer handler's argument.
+    
+    The problem is extracging the TID (which was stored in
+    timer_to_tid[] array of type "u8") through "int *" typecast which
+    may also yield unwanted bytes for the MSB of TID that results
+    in incorrect sta_info and ieee80211_local pointers.
+    
+    ieee80211_local pointer is NULL as illustrated below, it crashes in
+    sta_info_get(). The problem started when extracting ieee80211_local
+    pointer out of sta_info iteself and eventually crashed in
+    stat_info_get().
+    
+    The proper way to fix is to change the data type of TID to u8
+    instead of u16. However changing all the occurences requires
+    some prototype changes as well. We should fix this in upcoming
+    patches.
+    
+    Signed-off-by: Senthil Balasubramanian <senthilkumar at atheros.com>
+    Signed-off-by: Luis Rodriguez <lrodriguez at atheros.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit f6d97104890203ba9c2cf8e34894c4c8e64cb880
+Author: Yi Zhu <yi.zhu at intel.com>
+Date:   Tue May 27 17:50:50 2008 +0300
+
+    mac80211: fix a typo in ieee80211_handle_filtered_frame comment
+    
+    fix a typo in ieee80211_handle_filtered_frame comment
+    
+    Signed-off-by: Yi Zhu <yi.zhu at intel.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit a7624837261b55259d4a88309fd88529643fbb80
+Author: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
+Date:   Tue May 27 11:15:08 2008 +0300
+
+    rndis_wlan: add missing range check for power_output modparam
+    
+    Range check for power_output were missing.
+    
+    Signed-off-by: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 135a5484c3e0c6710035630b630cef3c856b78e2
+Author: Guy Cohen <guy.cohen at intel.com>
+Date:   Tue May 27 11:29:35 2008 +0800
+
+    iwlwifi: fix rate scale TLC column selection bug
+    
+    This patch fixes a case that a wrong maximal rate is selected when
+    searching for better configurations.
+    
+    Signed-off-by: Guy Cohen <guy.cohen at intel.com>
+    Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 47cfd463962ab0748ecbad761ff6ef2916b54aac
+Author: Guy Cohen <guy.cohen at intel.com>
+Date:   Tue May 27 11:29:34 2008 +0800
+
+    iwlwifi: fix exit from stay_in_table state
+    
+    When exiting from stay in table state (e.g. timer expiration),
+    all the statistics are reset and the RS flow should not continue
+    but only after enough statistics are collected again.
+    
+    Signed-off-by: Guy Cohen <guy.cohen at intel.com>
+    Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 4364623cb79d02945ace7a4faa1f11e617dde198
+Author: Scott Ashcroft <scott.ashcroft at talk21.com>
+Date:   Tue May 27 00:06:15 2008 +0300
+
+    rndis_wlan: Make connections to TKIP PSK networks work
+    
+    This patch allows the rndis_wlan driver to connect to TKIP PSK
+    networks.  It uses the ASSOCIATION_INFORMATION RNDIS call to pull back
+    the IEs and sends them back to userspace using wireless events. Tested
+    on a few wireless networks I have access to. Based on the similar
+    code in ndiswrapper.
+    
+    Signed-off-by: Scott Ashcroft <scott.ashcroft at talk21.com>
+    [edit: cleanups]
+    Signed-off-by: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit d4231ca3e162387a2b6964dacaa83604e065c4e9
+Author: Abhijeet Kolekar <abhijeet.kolekar at intel.com>
+Date:   Fri May 23 10:15:26 2008 -0700
+
+    mac80211 : Fixes the status message for iwconfig
+    
+    iwconfig was showing incorrect status messages when disassociated.
+    Patch fixes this by always checking for association status in
+    ioctl calls for getting ap address.
+    
+    Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar at intel.com>
+    Acked-by: Dan Williams <dcbw at redhat.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 633257d3db547e7553500f05e0aa2692c876d7a5
+Author: Ivo van Doorn <ivdoorn at gmail.com>
+Date:   Fri May 23 18:14:02 2008 +0200
+
+    rt2x00: Use atomic interface iteration in irq context
+    
+    rt2x00lib_beacondone() is called from interrupt context,
+    this means we cannot use the mac80211 interface iterator
+    that uses the rtnl lock (since that uses a mutex which can sleep).
+    Instead we should use the atomic mac80211 interface iterator.
+    
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit f06a0f486dc8bbe8808f46b81fbfd73241529fae
+Author: Ivo van Doorn <ivdoorn at gmail.com>
+Date:   Fri May 23 18:13:56 2008 +0200
+
+    rt2x00: Reset antenna RSSI after switch
+    
+    When the antenna configuration has changed we should reset
+    the antenna RSSI value. Otherwise the value will be influenced
+    by the previous configuration quality which in turn will affect
+    the antenna diversity.
+    
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 2088d4174e4292aef892bb7095fc3c3ea5bd117c
+Author: Ivo van Doorn <ivdoorn at gmail.com>
+Date:   Fri May 23 18:13:49 2008 +0200
+
+    rt2x00: Don't count retries as failure
+    
+    Link quality estimation became quite low for all rt2x00 drivers
+    because the number of retries it took to send the frame were
+    counted as failure.
+    This does not correspond to the legacy driver link quality calculation,
+    by not counting it we will send somewhat more optimistic values to
+    mac80211.
+    
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 0f3e63a55b1a7b695a79bf3eec2ff5ab6b336037
+Author: Ivo van Doorn <ivdoorn at gmail.com>
+Date:   Fri May 23 18:13:41 2008 +0200
+
+    rt2x00: Fix memleak in tx() path
+    
+    When the tx() handler runs while the device has disapeared,
+    we did return NETDEV_TX_OK but didn't free the skb.
+    
+    Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
+    Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 9381be059bf5831d259e8735005cfa35b7488543
+Author: Tomas Winkler <tomas.winkler at intel.com>
+Date:   Fri May 23 01:36:36 2008 +0300
+
+    mac80211: reorder channel and freq reporting in wext scan report
+    
+    This patch switch order of channel and freq (SIOCGIWFREQ) reports
[...229964 lines suppressed...]
 +
-+	for (i = 0; i < sprom_size_words; i++)
-+		pos += snprintf(buf + pos, buf_len - pos - 1,
-+				"%04X", swab16(sprom[i]) & 0xFFFF);
-+	pos += snprintf(buf + pos, buf_len - pos - 1, "\n");
++	if (freq < 2484)
++		return (freq - 2407) / 5;
 +
-+	return pos + 1;
++	/* FIXME: 802.11j 17.3.8.3.2 */
++	return freq/5 - 1000;
 +}
++EXPORT_SYMBOL(ieee80211_frequency_to_channel);
 +
-+static int hex2sprom(u16 *sprom, const char *dump, size_t len,
-+		     size_t sprom_size_words)
++struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
++						  int freq)
 +{
-+	char tmp[5] = { 0 };
-+	int cnt = 0;
-+	unsigned long parsed;
++	enum ieee80211_band band;
++	struct ieee80211_supported_band *sband;
++	int i;
 +
-+	if (len < sprom_size_words * 2)
-+		return -EINVAL;
++	for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
++		sband = wiphy->bands[band];
 +
-+	while (cnt < sprom_size_words) {
-+		memcpy(tmp, dump, 4);
-+		dump += 4;
-+		parsed = simple_strtoul(tmp, NULL, 16);
-+		sprom[cnt++] = swab16((u16)parsed);
++		if (!sband)
++			continue;
++
++		for (i = 0; i < sband->n_channels; i++) {
++			if (sband->channels[i].center_freq == freq)
++				return &sband->channels[i];
++		}
 +	}
 +
-+	return 0;
++	return NULL;
 +}
++EXPORT_SYMBOL(__ieee80211_get_channel);
 +
-+/* Common sprom device-attribute show-handler */
-+ssize_t ssb_attr_sprom_show(struct ssb_bus *bus, char *buf,
-+			    int (*sprom_read)(struct ssb_bus *bus, u16 *sprom))
++static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
++				     enum ieee80211_band band)
 +{
-+	u16 *sprom;
-+	int err = -ENOMEM;
-+	ssize_t count = 0;
-+	size_t sprom_size_words = bus->sprom_size;
-+
-+	sprom = kcalloc(sprom_size_words, sizeof(u16), GFP_KERNEL);
-+	if (!sprom)
-+		goto out;
++	int i, want;
 +
-+	/* Use interruptible locking, as the SPROM write might
-+	 * be holding the lock for several seconds. So allow userspace
-+	 * to cancel operation. */
-+	err = -ERESTARTSYS;
-+	if (mutex_lock_interruptible(&bus->sprom_mutex))
-+		goto out_kfree;
-+	err = sprom_read(bus, sprom);
-+	mutex_unlock(&bus->sprom_mutex);
++	switch (band) {
++	case IEEE80211_BAND_5GHZ:
++		want = 3;
++		for (i = 0; i < sband->n_bitrates; i++) {
++			if (sband->bitrates[i].bitrate == 60 ||
++			    sband->bitrates[i].bitrate == 120 ||
++			    sband->bitrates[i].bitrate == 240) {
++				sband->bitrates[i].flags |=
++					IEEE80211_RATE_MANDATORY_A;
++				want--;
++			}
++		}
++		WARN_ON(want);
++		break;
++	case IEEE80211_BAND_2GHZ:
++		want = 7;
++		for (i = 0; i < sband->n_bitrates; i++) {
++			if (sband->bitrates[i].bitrate == 10) {
++				sband->bitrates[i].flags |=
++					IEEE80211_RATE_MANDATORY_B |
++					IEEE80211_RATE_MANDATORY_G;
++				want--;
++			}
 +
-+	if (!err)
-+		count = sprom2hex(sprom, buf, PAGE_SIZE, sprom_size_words);
++			if (sband->bitrates[i].bitrate == 20 ||
++			    sband->bitrates[i].bitrate == 55 ||
++			    sband->bitrates[i].bitrate == 110 ||
++			    sband->bitrates[i].bitrate == 60 ||
++			    sband->bitrates[i].bitrate == 120 ||
++			    sband->bitrates[i].bitrate == 240) {
++				sband->bitrates[i].flags |=
++					IEEE80211_RATE_MANDATORY_G;
++				want--;
++			}
 +
-+out_kfree:
-+	kfree(sprom);
-+out:
-+	return err ? err : count;
++			if (sband->bitrates[i].bitrate != 10 &&
++			    sband->bitrates[i].bitrate != 20 &&
++			    sband->bitrates[i].bitrate != 55 &&
++			    sband->bitrates[i].bitrate != 110)
++				sband->bitrates[i].flags |=
++					IEEE80211_RATE_ERP_G;
++		}
++		WARN_ON(want != 0 && want != 3 && want != 6);
++		break;
++	case IEEE80211_NUM_BANDS:
++		WARN_ON(1);
++		break;
++	}
 +}
 +
-+/* Common sprom device-attribute store-handler */
-+ssize_t ssb_attr_sprom_store(struct ssb_bus *bus,
-+			     const char *buf, size_t count,
-+			     int (*sprom_check_crc)(const u16 *sprom, size_t size),
-+			     int (*sprom_write)(struct ssb_bus *bus, const u16 *sprom))
++void ieee80211_set_bitrate_flags(struct wiphy *wiphy)
 +{
-+	u16 *sprom;
-+	int res = 0, err = -ENOMEM;
-+	size_t sprom_size_words = bus->sprom_size;
-+
-+	sprom = kcalloc(bus->sprom_size, sizeof(u16), GFP_KERNEL);
-+	if (!sprom)
-+		goto out;
-+	err = hex2sprom(sprom, buf, count, sprom_size_words);
-+	if (err) {
-+		err = -EINVAL;
-+		goto out_kfree;
-+	}
-+	err = sprom_check_crc(sprom, sprom_size_words);
-+	if (err) {
-+		err = -EINVAL;
-+		goto out_kfree;
-+	}
++	enum ieee80211_band band;
 +
-+	/* Use interruptible locking, as the SPROM write might
-+	 * be holding the lock for several seconds. So allow userspace
-+	 * to cancel operation. */
-+	err = -ERESTARTSYS;
-+	if (mutex_lock_interruptible(&bus->sprom_mutex))
-+		goto out_kfree;
-+	err = ssb_devices_freeze(bus);
-+	if (err == -EOPNOTSUPP) {
-+		ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze devices. "
-+			   "No suspend support. Is CONFIG_PM enabled?\n");
-+		goto out_unlock;
-+	}
-+	if (err) {
-+		ssb_printk(KERN_ERR PFX "SPROM write: Could not freeze all devices\n");
-+		goto out_unlock;
-+	}
-+	res = sprom_write(bus, sprom);
-+	err = ssb_devices_thaw(bus);
-+	if (err)
-+		ssb_printk(KERN_ERR PFX "SPROM write: Could not thaw all devices\n");
-+out_unlock:
-+	mutex_unlock(&bus->sprom_mutex);
-+out_kfree:
-+	kfree(sprom);
-+out:
-+	if (res)
-+		return res;
-+	return err ? err : count;
++	for (band = 0; band < IEEE80211_NUM_BANDS; band++)
++		if (wiphy->bands[band])
++			set_mandatory_flags_band(wiphy->bands[band], band);
 +}
+diff -up linux-2.6.25.noarch/net/wireless/wext.c.orig linux-2.6.25.noarch/net/wireless/wext.c
+--- linux-2.6.25.noarch/net/wireless/wext.c.orig	2008-05-29 14:16:32.000000000 -0400
++++ linux-2.6.25.noarch/net/wireless/wext.c	2008-05-29 14:16:46.000000000 -0400
+@@ -1157,7 +1157,7 @@ static void rtmsg_iwinfo(struct net_devi
+ 	struct sk_buff *skb;
+ 	int err;
+ 
+-	if (dev->nd_net != &init_net)
++	if (dev_net(dev) != &init_net)
+ 		return;
+ 
+ 	skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);




More information about the fedora-extras-commits mailing list