Skip to contentSkip to conversation

What's new in wireless-dev today? (29 September 2006)

PATCH John W. Linville 1 participant 1 message Sep 29, 2006

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

Here is today's batch -- I'm still playing "catch-up" in the wireless-dev tree. Please bear with me...

---

The following changes since commit 0888451bf4108fbaa07b221649b1289d8f79ef0f:
John W. Linville:
Merge branch 'from-linus'

are found in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-dev.git

David Kimdon:
d80211: fix multiple device ap support
d80211: Fix type of prism2_hostapd_param crypt.alg
d80211: allow vlan interfaces to receive ToDS frames

Hong Liu:
d80211: fix wpa_supplicant reassoc problem
d80211: add hardware scan callback
d80211: fix "iwconfig key [x]" behavior

Ivo van Doorn:
rt2x00: remove hardware button support

Jiri Benc:
d80211: fix invalid pointer dereference

Johannes Berg:

      d80211: use BUILD_BUG_ON
      d80211: clean up those huge else if statements
      d80211: use list_for_each_entry{,_safe}
      d80211: LED triggers

John W. Linville:
Merge branch 'fixes-for-linville' of http://bu3sch.de/git/wireless-dev
Merge branch 'up' of rsync://rsync.kernel.org/.../jbenc/dscape

mabbas:
d80211: diplay supported rates in readable format

Michael Buesch:
ssb: fix init sprom read/write race
add bcm43xx-d80211 MAINTAINERS entry

Michael Wu:
d80211: fix WEP on big endian cpus

Mohamed Abbas:
d80211: getting wrong freq value if we did hardware scan

 MAINTAINERS                                        |    8 +
 drivers/misc/ssb.c                                 |   29 +++--
 drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c |    6 +
 drivers/net/wireless/d80211/rt2x00/Kconfig         |   27 -----
 drivers/net/wireless/d80211/rt2x00/rt2400pci.c     |   36 ------
 drivers/net/wireless/d80211/rt2x00/rt2500pci.c     |   36 ------
 drivers/net/wireless/d80211/rt2x00/rt2x00.h        |    8 -
 drivers/net/wireless/d80211/rt2x00/rt2x00pci.h     |  111 --------------------
 drivers/net/wireless/d80211/rt2x00/rt61pci.c       |   36 ------
 include/linux/ssb.h                                |   15 +++
 include/net/d80211.h                               |   46 ++++++--
 net/d80211/Kconfig                                 |    9 ++
 net/d80211/Makefile                                |   10 +-
 net/d80211/hostapd_ioctl.h                         |    2 
 net/d80211/ieee80211.c                             |   73 +++++--------
 net/d80211/ieee80211_dev.c                         |    7 +
 net/d80211/ieee80211_i.h                           |    6 +
 net/d80211/ieee80211_iface.c                       |    2 
 net/d80211/ieee80211_ioctl.c                       |  108 ++++++++++---------
 net/d80211/ieee80211_led.c                         |   93 ++++++++++++++---
 net/d80211/ieee80211_led.h                         |   32 ++++++
 net/d80211/ieee80211_sta.c                         |  107 +++++++++++--------
 net/d80211/sta_info.c                              |   26 ++---
 net/d80211/wep.c                                   |   10 +-
 24 files changed, 371 insertions(+), 472 deletions(-)
 create mode 100644 net/d80211/ieee80211_led.h
MAINTAINERS +8 -0
index 3748cb1..2f06c7c 100644
@@ -464,6 +464,14 @@ L:	[email protected]
 W:	http://www.baycom.org/~tom/ham/ham.html
 S:	Maintained
 
+BCM43XX WIRELESS DRIVER (DEVICESCAPE BASED VERSION)
+P:	Michael Buesch
+M:	[email protected]
+P:	Stefano Brivio
+M:	[email protected]
+W:	http://bcm43xx.berlios.de/
+S:	Maintained
+
 BCM43XX WIRELESS DRIVER (SOFTMAC BASED VERSION)
 P:	Larry Finger
 M:	[email protected]
drivers/misc/ssb.c +19 -10
index 44ab647..6087977 100644
@@ -516,8 +516,6 @@ int ssb_init(struct ssb *ssb,
 	     int (*device_suspend)(struct ssb *ssb),
 	     int (*device_resume)(struct ssb *ssb))
 {
-	int err;
-
 	if (!ssb || !pci_dev || !mmio ||
 	    !device_suspend || !device_resume)
 		return -EINVAL;
@@ -535,19 +533,12 @@ int ssb_init(struct ssb *ssb,
 	list_add(&ssb->list, &ssb_list);
 	mutex_unlock(&ssb_list_mutex);
 
-	err = device_create_file(&pci_dev->dev, &dev_attr_ssb_sprom);
-	if (err)
-		goto out;
-
-out:
-	return err;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(ssb_init);
 
 void ssb_exit(struct ssb *ssb)
 {
-	device_remove_file(&ssb->pci_dev->dev, &dev_attr_ssb_sprom);
-
 	mutex_lock(&ssb_list_mutex);
 	list_del(&ssb->list);
 	mutex_unlock(&ssb_list_mutex);
@@ -558,6 +549,24 @@ void ssb_exit(struct ssb *ssb)
 }
 EXPORT_SYMBOL_GPL(ssb_exit);
 
+int ssb_start(struct ssb *ssb)
+{
+	int err;
+
+	err = device_create_file(&ssb->pci_dev->dev,
+				 &dev_attr_ssb_sprom);
+
+	return err;
+}
+EXPORT_SYMBOL_GPL(ssb_start);
+
+void ssb_stop(struct ssb *ssb)
+{
+	device_remove_file(&ssb->pci_dev->dev,
+			   &dev_attr_ssb_sprom);
+}
+EXPORT_SYMBOL_GPL(ssb_stop);
+
 static int do_switch_core(struct ssb *ssb, u8 coreidx)
 {
 	int err;
drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +6 -0
index d71d797..82f1fd1 100644
@@ -2600,6 +2600,7 @@ static int bcm43xx_shutdown_all_wireless
 /* This is the opposite of bcm43xx_init_board() */
 static void bcm43xx_free_board(struct bcm43xx_private *bcm)
 {
+	ssb_stop(&bcm->ssb);
 	bcm43xx_sysfs_unregister(bcm);
 	bcm43xx_periodic_tasks_delete(bcm);
 
@@ -3189,12 +3190,17 @@ static int bcm43xx_init_board(struct bcm
 	err = bcm43xx_sysfs_register(bcm);
 	if (err)
 		goto err_wlshutdown;
+	err = ssb_start(&bcm->ssb);
+	if (err)
+		goto err_sysfs_unreg;
 	bcm43xx_periodic_tasks_setup(bcm);
 out:
 	mutex_unlock(&bcm->mutex);
 
 	return err;
 
+err_sysfs_unreg:
+	bcm43xx_sysfs_unregister(bcm);
 err_wlshutdown:
 	bcm43xx_shutdown_all_wireless_cores(bcm);
 err_crystal_off:
drivers/net/wireless/d80211/rt2x00/Kconfig +0 -27
index d9b97f1..66bbb16 100644
@@ -15,15 +15,6 @@ config RT2400PCI
 
 	When compiled as a module, this driver will be called "rt2400pci.ko".
 
-config RT2400PCI_BUTTON
-	bool "Ralink rt2400 hardware button support"
-	depends on RT2400PCI && X86
-	---help---
-	In some notebooks the rt2400 chipset is integrated in the machine,
-	with this option enabled the device will periodically poll the
-	the status of this button and will send and ACPI event when
-	the button has been pressed.
-
 config RT2400PCI_DEBUG
 	bool "Ralink rt2400 debug output"
 	depends on RT2400PCI
@@ -38,15 +29,6 @@ config RT2500PCI
 
 	When compiled as a module, this driver will be called "rt2500pci.ko".
 
-config RT2500PCI_BUTTON
-	bool "Ralink rt2500 hardware button support"
-	depends on RT2500PCI && X86
-	---help---
-	In some notebooks the rt2500 chipset is integrated in the machine,
-	with this option enabled the device will periodically poll the
-	the status of this button and will send and ACPI event when
-	the button has been pressed.
-
 config RT2500PCI_DEBUG
 	bool "Ralink rt2500 debug output"
 	depends on RT2500PCI
@@ -61,15 +43,6 @@ config RT61PCI
 
 	When compiled as a module, this driver will be called "rt61pci.ko".
 
-config RT61PCI_BUTTON
-	bool "Ralink rt61 hardware button support"
-	depends on RT61PCI && X86
-	---help---
-	In some notebooks the rt61 chipset is integrated in the machine,
-	with this option enabled the device will periodically poll the
-	the status of this button and will send and ACPI event when
-	the button has been pressed.
-
 config RT61PCI_DEBUG
 	bool "Ralink rt61 debug output"
 	depends on RT61PCI
drivers/net/wireless/d80211/rt2x00/rt2400pci.c +0 -36
index 59163bf..a46b8b8 100644
@@ -51,10 +51,6 @@ #ifdef CONFIG_RT2400PCI_DEBUG
 #define CONFIG_RT2X00_DEBUG
 #endif /* CONFIG_RT2400PCI_DEBUG */
 
-#ifdef CONFIG_RT2400PCI_BUTTON
-#define CONFIG_RT2X00_BUTTON
-#endif /* CONFIG_RT2400PCI_BUTTON */
-
 #include "rt2x00.h"
 #include "rt2x00pci.h"
 #include "rt2400pci.h"
@@ -346,23 +342,6 @@ static void rt2x00_eeprom_multiread(cons
 		rt2x00_eeprom_read(rt2x00dev, word + i, data++);
 }
 
-#ifdef CONFIG_RT2400PCI_BUTTON
-/*
- * Hardware button poll handler.
- */
-static void rt2400pci_button_poll(unsigned long data)
-{
-	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev*)data;
-	u32 reg;
-
-	rt2x00_register_read(rt2x00dev, GPIOCSR, &reg);
-	rt2x00pci_button_status(
-		rt2x00dev, rt2x00_get_field32(reg, GPIOCSR_BIT0));
-}
-#else /* CONFIG_RT2400PCI_BUTTON */
-static void rt2400pci_button_poll(unsigned long data){}
-#endif /* CONFIG_RT2400PCI_BUTTON */
-
 /*
  * Ethtool handlers.
  */
@@ -2750,11 +2729,6 @@ static void rt2400pci_free_dev(struct ne
 	struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
 
 	/*
-	 * Shutdown poll_timer for hardware button.
-	 */
-	rt2x00pci_button_stop(rt2x00dev);
-
-	/*
 	 * Free ring structures.
 	 */
 	kfree(rt2x00dev->ring);
@@ -2838,11 +2812,6 @@ static int rt2400pci_alloc_dev(struct pc
 		goto exit;
 	}
 
-	/*
-	 * If required start hardware button polling.
-	 */
-	rt2x00pci_button_start(rt2x00dev, rt2400pci_button_poll);
-
 	return 0;
 
 exit:
@@ -3048,11 +3017,6 @@ module_param_named(debug, rt2x00_debug_l
 MODULE_PARM_DESC(debug, "Set this parameter to 1 to enable debug output.");
 #endif /* CONFIG_RT2400PCI_DEBUG */
 
-#ifdef CONFIG_RT2400PCI_BUTTON
-module_param_named(poll_delay, rt2x00_poll_delay, short, S_IRUGO);
-MODULE_PARM_DESC(debug, "Delay between WiFi button pollings (in 100ms).");
-#endif /* CONFIG_RT2400PCI_BUTTON */
-
 static struct pci_driver rt2400pci_driver = {
 	.name		= DRV_NAME,
 	.id_table	= rt2400pci_device_table,
drivers/net/wireless/d80211/rt2x00/rt2500pci.c +0 -36
index 651fbec..c08b076 100644
@@ -51,10 +51,6 @@ #ifdef CONFIG_RT2500PCI_DEBUG
 #define CONFIG_RT2X00_DEBUG
 #endif /* CONFIG_RT2500PCI_DEBUG */
 
-#ifdef CONFIG_RT2500PCI_BUTTON
-#define CONFIG_RT2X00_BUTTON
-#endif /* CONFIG_RT2500PCI_BUTTON */
-
 #include "rt2x00.h"
 #include "rt2x00pci.h"
 #include "rt2500pci.h"
@@ -346,23 +342,6 @@ static void rt2x00_eeprom_multiread(cons
 		rt2x00_eeprom_read(rt2x00dev, word + i, data++);
 }
 
-#ifdef CONFIG_RT2500PCI_BUTTON
-/*
- * Hardware button poll handler.
- */
-static void rt2500pci_button_poll(unsigned long data)
-{
-	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev*)data;
-	u32 reg;
-
-	rt2x00_register_read(rt2x00dev, GPIOCSR, &reg);
-	rt2x00pci_button_status(
-		rt2x00dev, rt2x00_get_field32(reg, GPIOCSR_BIT0));
-}
-#else /* CONFIG_RT2500PCI_BUTTON */
-static void rt2500pci_button_poll(unsigned long data){}
-#endif /* CONFIG_RT2500PCI_BUTTON */
-
 /*
  * Ethtool handlers.
  */
@@ -3035,11 +3014,6 @@ static void rt2500pci_free_dev(struct ne
 	struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
 
 	/*
-	 * Shutdown poll_timer for hardware button.
-	 */
-	rt2x00pci_button_stop(rt2x00dev);
-
-	/*
 	 * Free ring structures.
 	 */
 	kfree(rt2x00dev->ring);
@@ -3123,11 +3097,6 @@ static int rt2500pci_alloc_dev(struct pc
 		goto exit;
 	}
 
-	/*
-	 * If required start hardware button polling.
-	 */
-	rt2x00pci_button_start(rt2x00dev, rt2500pci_button_poll);
-
 	return 0;
 
 exit:
@@ -3333,11 +3302,6 @@ module_param_named(debug, rt2x00_debug_l
 MODULE_PARM_DESC(debug, "Set this parameter to 1 to enable debug output.");
 #endif /* CONFIG_RT2500PCI_DEBUG */
 
-#ifdef CONFIG_RT2500PCI_BUTTON
-module_param_named(poll_delay, rt2x00_poll_delay, short, S_IRUGO);
-MODULE_PARM_DESC(debug, "Delay between WiFi button pollings (in 100ms).");
-#endif /* CONFIG_RT2500PCI_BUTTON */
-
 static struct pci_driver rt2500pci_driver = {
 	.name		= DRV_NAME,
 	.id_table	= rt2500pci_device_table,
drivers/net/wireless/d80211/rt2x00/rt2x00.h +0 -8
index e0ae5fe..76845c8 100644
@@ -866,14 +866,6 @@ #define CONFIG_DISABLE_BBP_TUNING	0x0002
 	struct ieee80211_hw hw;
 
 	/*
-	 * If enabled, the structure for the
-	 * hardware button control.
-	 */
-#ifdef CONFIG_RT2X00_BUTTON
-	struct rfkill rfkill;
-#endif /* CONFIG_RT2X00_BUTTON */
-
-	/*
 	 * Queue for deferred work.
 	 */
 	struct workqueue_struct *workqueue;
drivers/net/wireless/d80211/rt2x00/rt2x00pci.h +0 -111

115 lines not on this page · raw message

drivers/net/wireless/d80211/rt2x00/rt61pci.c +0 -36
index 9a0462a..3e1a702 100644
@@ -52,10 +52,6 @@ #ifdef CONFIG_RT61PCI_DEBUG
 #define CONFIG_RT2X00_DEBUG
 #endif /* CONFIG_RT61PCI_DEBUG */
 
-#ifdef CONFIG_RT61PCI_BUTTON
-#define CONFIG_RT2X00_BUTTON
-#endif /* CONFIG_RT61PCI_BUTTON */
-
 #include "rt2x00.h"
 #include "rt2x00pci.h"
 #include "rt2x00crc.h"
@@ -377,23 +373,6 @@ static void rt2x00_eeprom_multiread(cons
 		rt2x00_eeprom_read(rt2x00dev, word + i, data++);
 }
 
-#ifdef CONFIG_RT61PCI_BUTTON
-/*
- * Hardware button poll handler.
- */
-static void rt61pci_button_poll(unsigned long data)
-{
-	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev*)data;
-	u32 reg;
-
-	rt2x00_register_read(rt2x00dev, MAC_CSR13, &reg);
-	rt2x00pci_button_status(
-		rt2x00dev, rt2x00_get_field32(reg, MAC_CSR13_BIT5));
-}
-#else /* CONFIG_RT61PCI_BUTTON */
-static void rt61pci_button_poll(unsigned long data){}
-#endif /* CONFIG_RT61PCI_BUTTON */
-
 /*
  * Ethtool handlers.
  */
@@ -3547,11 +3526,6 @@ static void rt61pci_free_dev(struct net_
 	struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
 
 	/*
-	 * Shutdown poll_timer for hardware button.
-	 */
-	rt2x00pci_button_stop(rt2x00dev);
-
-	/*
 	 * Free ring structures.
 	 */
 	kfree(rt2x00dev->ring);
@@ -3640,11 +3614,6 @@ static int rt61pci_alloc_dev(struct pci_
 		goto exit;
 	}
 
-	/*
-	 * If required start hardware button polling.
-	 */
-	rt2x00pci_button_start(rt2x00dev, rt61pci_button_poll);
-
 	return 0;
 
 exit:
@@ -3856,11 +3825,6 @@ module_param_named(debug, rt2x00_debug_l
 MODULE_PARM_DESC(debug, "Set this parameter to 1 to enable debug output.");
 #endif /* CONFIG_RT61PCI_DEBUG */
 
-#ifdef CONFIG_RT61PCI_BUTTON
-module_param_named(poll_delay, rt2x00_poll_delay, short, S_IRUGO);
-MODULE_PARM_DESC(debug, "Delay between WiFi button pollings (in 100ms).");
-#endif /* CONFIG_RT61PCI_BUTTON */
-
 static struct pci_driver rt61pci_driver = {
 	.name		= DRV_NAME,
 	.id_table	= rt61pci_device_table,
include/linux/ssb.h +14 -1
index a36dd75..09c28a8 100644
@@ -504,7 +504,7 @@ #endif
 
 /**
  * ssb_init - Initialize struct ssb.
- * This does not init hardware. May fail and return NULL.
+ * Call this before initializing the hardware.
  * @ssb:	Pointer to struct ssb to init. This will usually
  * 		be embedded in the device's private struct.
  * @pci_dev:	Pointer to the PCI device.
@@ -521,6 +521,19 @@ int ssb_init(struct ssb *ssb,
 void ssb_exit(struct ssb *ssb);
 
 /**
+ * ssb_start - Start the ssb operation.
+ * Call this after initializing the hardware.
+ * @ssb:	Pointer to struct ssb.
+ */
+int ssb_start(struct ssb *ssb);
+/**
+ * ssb_stop - Stop the ssb operation.
+ * Call this before shutting down the hardware.
+ * @ssb:	Pointer to struct ssb.
+ */
+void ssb_stop(struct ssb *ssb);
+
+/**
  * struct ssb_nrcores_elem - Array element of the
  * "number of cores" fallback array.
  * This array is browsed, if there is no ChipCommon rev >= 4
include/net/d80211.h +36 -10

70 lines not on this page · raw message

net/d80211/Kconfig +9 -0
index 2f3c0a3..0f07d41 100644
@@ -7,6 +7,15 @@ config D80211
 	This option enables the hardware independent IEEE 802.11
 	networking stack.
 
+config D80211_LEDS
+	bool "Enable LED triggers"
+	depends on D80211
+	select NEW_LEDS
+	select LEDS_TRIGGERS
+	---help---
+	This option enables a few LED triggers for different
+	packet receive/transmit events.
+
 config D80211_DEBUG
 	bool "Enable debugging output"
 	depends on D80211
net/d80211/Makefile +4 -6
index c21e882..2a2a0c6 100644
@@ -1,5 +1,7 @@
 obj-$(CONFIG_D80211) += 80211.o rate_control.o
 
+80211-objs-$(CONFIG_D80211_LEDS) += ieee80211_led.o
+
 80211-objs := \
 	ieee80211.o \
 	ieee80211_ioctl.o \
@@ -15,13 +17,9 @@ obj-$(CONFIG_D80211) += 80211.o rate_con
 	michael.o \
 	tkip.o \
 	aes_ccm.o \
-	wme.o
+	wme.o \
+	$(80211-objs-y)
 
 ifeq ($(CONFIG_NET_SCHED),)
   80211-objs += fifo_qdisc.o
 endif
-
-ifeq ($(CONFIG_D80211_LEDS),y)
-  80211-objs += ieee80211_led.o
-endif
-
net/d80211/hostapd_ioctl.h +1 -1
index 7c7305c..d302790 100644
@@ -207,7 +207,7 @@ #define IEEE80211_STA_DYNAMIC_ENC BIT(0)
 			u32 last_ack_rssi;
 		} get_info_sta;
 		struct {
-			u8 alg[HOSTAP_CRYPT_ALG_NAME_LEN];
+			char alg[HOSTAP_CRYPT_ALG_NAME_LEN];
 			u32 flags;
 			u32 err;
 			u8 idx;
net/d80211/ieee80211.c +25 -48

177 lines not on this page · raw message

net/d80211/ieee80211_dev.c +3 -4
index 6c6ca91..48a5e56 100644
@@ -13,6 +13,7 @@ #include <linux/if_ether.h>
 #include <linux/netdevice.h>
 #include <net/d80211.h>
 #include "ieee80211_i.h"
+#include "ieee80211_led.h"
 
 struct ieee80211_dev_list {
 	struct list_head list;
@@ -38,7 +39,6 @@ static struct ieee80211_dev_list *__ieee
 
 int ieee80211_dev_alloc_index(struct ieee80211_local *local)
 {
-	struct list_head *i;
 	struct ieee80211_dev_list *dev_item, *new;
 	int index = 0;
 
@@ -47,14 +47,13 @@ int ieee80211_dev_alloc_index(struct iee
 		return -ENOMEM;
 	new->local = local;
 	spin_lock(&dev_list_lock);
-	list_for_each(i, &dev_list) {
-		dev_item = list_entry(i, struct ieee80211_dev_list, list);
+	list_for_each_entry(dev_item, &dev_list, list) {
 		if (index < dev_item->dev_index)
 			break;
 		index++;
 	}
 	new->dev_index = index;
-	list_add_tail(&new->list, i);
+	list_add_tail(&new->list, &dev_item->list);
 	spin_unlock(&dev_list_lock);
 	local->dev_index = index;
 	return index;
net/d80211/ieee80211_i.h +5 -1
index 0d2d79d..425fc9b 100644
@@ -459,7 +459,11 @@ #endif /* CONFIG_HOSTAPD_WPA_TESTING */
         u32 dot11TransmittedFrameCount;
         u32 dot11WEPUndecryptableCount;
 
-        int tx_led_counter;
+#ifdef CONFIG_D80211_LEDS
+	int tx_led_counter, rx_led_counter;
+	struct led_trigger *tx_led, *rx_led;
+	char tx_led_name[32], rx_led_name[32];
+#endif
 
 	u32 channel_use;
 	u32 channel_use_raw;
net/d80211/ieee80211_iface.c +1 -1
index bdff4cd..0a10c86 100644
@@ -122,7 +122,7 @@ int ieee80211_if_add_mgmt(struct net_dev
 	if (!ndev)
 		return -ENOMEM;
 	ret = dev_alloc_name(ndev, "wmgmt%d");
-	if (ret)
+	if (ret < 0)
 		goto fail;
 
 	ndev->ieee80211_ptr = local;
net/d80211/ieee80211_ioctl.c +54 -54

236 lines not on this page · raw message

net/d80211/ieee80211_led.c +76 -17

108 lines not on this page · raw message

net/d80211/ieee80211_led.h new file +32 -0
new file mode 100644
index 0000000..2a539af
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006, Johannes Berg <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/list.h>
+#include <linux/spinlock.h>
+#include <linux/leds.h>
+#include "ieee80211_i.h"
+
+#ifdef CONFIG_D80211_LEDS
+extern void ieee80211_led_rx(struct ieee80211_local *local);
+extern void ieee80211_led_tx(struct ieee80211_local *local, int q);
+extern void ieee80211_led_init(struct ieee80211_local *local);
+extern void ieee80211_led_exit(struct ieee80211_local *local);
+#else
+static inline void ieee80211_led_rx(struct ieee80211_local *local)
+{
+}
+static inline void ieee80211_led_tx(struct ieee80211_local *local, int q)
+{
+}
+static inline void ieee80211_led_init(struct ieee80211_local *local)
+{
+}
+static inline void ieee80211_led_exit(struct ieee80211_local *local)
+{
+}
+#endif
net/d80211/ieee80211_sta.c +60 -47

214 lines not on this page · raw message

net/d80211/sta_info.c +13 -13
index 622b234..a326c4a 100644
@@ -197,6 +197,12 @@ #ifdef CONFIG_D80211_VERBOSE_DEBUG
 	       local->mdev->name, MAC_ARG(sta->addr));
 #endif /* CONFIG_D80211_VERBOSE_DEBUG */
 
+	if (sta->key) {
+		ieee80211_key_sysfs_remove(sta->key);
+		ieee80211_key_free(sta->key);
+		sta->key = NULL;
+	}
+
 	rate_control_remove_sta_attrs(local, sta->rate_ctrl_priv, &sta->kobj);
 	ieee80211_sta_sysfs_remove(sta);
 
@@ -244,8 +250,6 @@ void sta_info_free(struct sta_info *sta,
 				kfree(key);
 			}
 		}
-		ieee80211_key_free(sta->key);
-		sta->key = NULL;
 	} else if (sta->key_idx_compression != HW_KEY_IDX_INVALID) {
 		struct ieee80211_key_conf conf;
 		memset(&conf, 0, sizeof(conf));
@@ -333,8 +337,7 @@ static void sta_info_cleanup(unsigned lo
 static void sta_info_proc_add_task(void *data)
 {
 	struct ieee80211_local *local = data;
-	struct list_head *ptr;
-	struct sta_info *sta;
+	struct sta_info *sta, *tmp;
 
 	while (1) {
 		spin_lock_bh(&local->sta_lock);
@@ -351,14 +354,14 @@ static void sta_info_proc_add_task(void 
 	}
 
 	while (1) {
+		sta = NULL;
 		spin_lock_bh(&local->sta_lock);
-		list_for_each(ptr, &local->sta_list) {
-			sta = list_entry(ptr, struct sta_info, list);
-			if (!sta->sysfs_registered) {
+		list_for_each_entry(tmp, &local->sta_list, list) {
+			if (!tmp->sysfs_registered) {
+				sta = tmp;
 				__sta_info_get(sta);
 				break;
 			}
-			sta = NULL;
 		}
 		spin_unlock_bh(&local->sta_lock);
 
@@ -441,14 +444,11 @@ void sta_info_remove_aid_ptr(struct sta_
  */
 void sta_info_flush(struct ieee80211_local *local, struct net_device *dev)
 {
-        struct list_head *ptr, *n;
+	struct sta_info *sta, *tmp;
 
 	spin_lock_bh(&local->sta_lock);
-
-	list_for_each_safe(ptr, n, &local->sta_list) {
-		struct sta_info *sta = list_entry(ptr, struct sta_info, list);
+	list_for_each_entry_safe(sta, tmp, &local->sta_list, list)
 		if (!dev || dev == sta->dev)
 			sta_info_free(sta, 1);
-	}
 	spin_unlock_bh(&local->sta_lock);
 }
net/d80211/wep.c +5 -5
index c3e4728..22c2e53 100644
@@ -120,10 +120,10 @@ void ieee80211_wep_encrypt_data(struct c
 				size_t klen, u8 *data, size_t data_len)
 {
 	struct scatterlist sg;
-	u32 *icv;
+	__le32 *icv;
 
-	icv = (u32 *)(data + data_len);
-	*icv = ~crc32_le(~0, data, data_len);
+	icv = (__le32 *)(data + data_len);
+	*icv = cpu_to_le32(~crc32_le(~0, data, data_len));
 
 	crypto_cipher_setkey(tfm, rc4key, klen);
 	sg.page = virt_to_page(data);
@@ -187,7 +187,7 @@ int ieee80211_wep_decrypt_data(struct cr
 			       size_t klen, u8 *data, size_t data_len)
 {
 	struct scatterlist sg;
-	u32 crc;
+	__le32 crc;
 
 	crypto_cipher_setkey(tfm, rc4key, klen);
 	sg.page = virt_to_page(data);
@@ -195,7 +195,7 @@ int ieee80211_wep_decrypt_data(struct cr
 	sg.length = data_len + WEP_ICV_LEN;
 	crypto_cipher_decrypt(tfm, &sg, &sg, sg.length);
 
-	crc = ~crc32_le(~0, data, data_len);
+	crc = cpu_to_le32(~crc32_le(~0, data, data_len));
 	if (memcmp(&crc, data + data_len, WEP_ICV_LEN) != 0)
 		/* ICV mismatch */
 		return -1;
Signature · 2 lines
John W. Linville
[email protected]