rpms/kernel/F-9 kernel.spec, 1.652, 1.653 linux-2.6-at76.patch, 1.10, 1.11 linux-2.6-wireless-fixups.patch, 1.3, 1.4 linux-2.6-wireless-pending.patch, 1.47, 1.48
John W. Linville (linville)
fedora-extras-commits at redhat.com
Tue May 27 20:04:45 UTC 2008
Author: linville
Update of /cvs/pkgs/rpms/kernel/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28750
Modified Files:
kernel.spec linux-2.6-at76.patch
linux-2.6-wireless-fixups.patch
linux-2.6-wireless-pending.patch
Log Message:
wireless updates from 2008-05-22
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-9/kernel.spec,v
retrieving revision 1.652
retrieving revision 1.653
diff -u -r1.652 -r1.653
--- kernel.spec 27 May 2008 18:09:52 -0000 1.652
+++ kernel.spec 27 May 2008 20:03:45 -0000 1.653
@@ -1831,11 +1831,15 @@
%kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
%changelog
+* Tue May 27 2008 John W. Linville <linville at redhat.com> 2.6.25.4-34
+- Upstream wireless updates from 2008-05-22
+ (http://marc.info/?l=linux-wireless&m=121146112404515&w=2)
+
* Tue May 27 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.4-33
- libata: fix hangs on undock (#439197)
- libata: fix problems with some old/broken CF hardware (F8 #224005)
-* Thu May 22 2008 Dave Jones <davej at redhat.com>
+* Thu May 22 2008 Dave Jones <davej at redhat.com> 2.6.25.4-32
- Disable CONFIG_DMAR. This is terminally broken in the presence of a broken BIOS
* Wed May 21 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.25.4-31
linux-2.6-at76.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.10 -r 1.11 linux-2.6-at76.patch
Index: linux-2.6-at76.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-9/linux-2.6-at76.patch,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- linux-2.6-at76.patch 19 May 2008 22:15:18 -0000 1.10
+++ linux-2.6-at76.patch 27 May 2008 20:03:45 -0000 1.11
@@ -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-9/linux-2.6-wireless-fixups.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6-wireless-fixups.patch 19 May 2008 22:15:18 -0000 1.3
+++ linux-2.6-wireless-fixups.patch 27 May 2008 20:03:45 -0000 1.4
@@ -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.47 -r 1.48 linux-2.6-wireless-pending.patch
Index: linux-2.6-wireless-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-9/linux-2.6-wireless-pending.patch,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- linux-2.6-wireless-pending.patch 21 May 2008 20:52:41 -0000 1.47
+++ linux-2.6-wireless-pending.patch 27 May 2008 20:03:45 -0000 1.48
@@ -1,19162 +1,8065 @@
-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
[...74776 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-27 12:59:05.000000000 -0400
++++ linux-2.6.25.noarch/net/wireless/radiotap.c 2008-05-27 12:59:23.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 */
More information about the fedora-extras-commits
mailing list