Skip to contentSkip to conversation

What's new in wireless-dev?

PATCH John W. Linville 1 participant 1 message Aug 8, 2006

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

The following changes since commit d2970f6c700f2291c1a80b061ebcd6041d2f3f1e:
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

Ivo van Doorn:
rt2x00 - pci request/release regions
rt2x00 - ieee80211_hw->config no longer requires scheduling rt2x00 - optimize MAC reading & initialize perm_addr rt2x00 - txpower limits
rt2x00 - misc fixes
rt2x00 - scan handlers
rfkill - Add rfkill driver to misc input devices rfkill - rt2x00 should use rfkill

Jiri Benc:
d80211: fix wrong logical operations
d80211: more correct WE support on master interface

Jouni Malinen:
d80211: Fix RTS threshold use
d80211: Fix PS-Poll frame dropping
d80211: Fix PLCP header length comment
d80211: Send Layer 2 Update frames in kernel
d80211: Fix ieee80211_remove_tx_extra() if key not configured
d80211: Fix TKIP replay protection

Michael Wu:
d80211: Fix issues with QOS bitwise ops
adm8211: Use ieee80211_*_queue functions d80211 drivers: Use IRQF_SHARED instead of SA_SHIRQ

 drivers/input/misc/Kconfig                         |   15 +
 drivers/input/misc/Makefile                        |    1 
 drivers/input/misc/rfkill.c                        |  210 ++++++++++++++++++++
 drivers/net/wireless/d80211/adm8211/adm8211.c      |   18 +-
 drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c |    2 
 drivers/net/wireless/d80211/rt2x00/Kconfig         |   24 +-
 drivers/net/wireless/d80211/rt2x00/rt2400pci.c     |  193 +++++++++---------
 drivers/net/wireless/d80211/rt2x00/rt2400pci.h     |    4 
 drivers/net/wireless/d80211/rt2x00/rt2500pci.c     |  197 ++++++++++---------
 drivers/net/wireless/d80211/rt2x00/rt2500pci.h     |    4 
 drivers/net/wireless/d80211/rt2x00/rt2500usb.c     |   99 +++------
 drivers/net/wireless/d80211/rt2x00/rt2500usb.h     |    4 
 drivers/net/wireless/d80211/rt2x00/rt2x00.h        |   62 +++++-
 drivers/net/wireless/d80211/rt2x00/rt2x00pci.h     |  111 -----------
 drivers/net/wireless/d80211/rt2x00/rt61pci.c       |  200 +++++++++----------
 drivers/net/wireless/d80211/rt2x00/rt61pci.h       |    4 
 drivers/net/wireless/d80211/rt2x00/rt73usb.c       |   92 +++------
 drivers/net/wireless/d80211/rt2x00/rt73usb.h       |    4 
 include/linux/input.h                              |    1 
 include/linux/rfkill.h                             |   98 +++++++++
 net/d80211/ieee80211.c                             |   26 +-
 net/d80211/ieee80211_i.h                           |    1 
 net/d80211/ieee80211_ioctl.c                       |   87 ++++++++
 net/d80211/tkip.c                                  |    1 
 net/d80211/wme.c                                   |    4 
 net/d80211/wpa.c                                   |    2 
 26 files changed, 868 insertions(+), 596 deletions(-)
 create mode 100644 drivers/input/misc/rfkill.c
 create mode 100644 include/linux/rfkill.h
drivers/input/misc/Kconfig +15 -0
index a6dfc74..ac10c02 100644
@@ -79,4 +79,19 @@ config HP_SDC_RTC
 	  Say Y here if you want to support the built-in real time clock
 	  of the HP SDC controller.
 
+config RFKILL
+	tristate "RF button support"
+	help
+	  If you say yes here, the rfkill driver will be build
+	  which allowed network devices to register their hardware
+	  RF button which controls the radio state. This driver
+	  will then create an input device for it.
+
+	  When the input device is not used, the rfkill driver
+	  will make sure that when the RF button is pressed the radio
+	  is enabled or disabled accordingly. When the input device
+	  has been opened by the user this radio control will be left
+	  to the user, and rfkill will only send the RF button status
+	  change to userspace.
+
 endif
drivers/input/misc/Makefile +1 -0
index 415c491..e788a1b 100644
@@ -11,3 +11,4 @@ obj-$(CONFIG_INPUT_UINPUT)		+= uinput.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)	+= wistron_btns.o
 obj-$(CONFIG_HP_SDC_RTC)		+= hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)	+= ixp4xx-beeper.o
+obj-$(CONFIG_RFKILL)			+= rfkill.o
drivers/input/misc/rfkill.c new file +210 -0

210 lines not on this page · raw message

drivers/net/wireless/d80211/adm8211/adm8211.c +7 -11
index 748eb26..dcabeab 100644
@@ -452,7 +452,7 @@ static void adm8211_interrupt_tci(struct
 	}
 
 	if (priv->cur_tx - dirty_tx < priv->tx_ring_size - 2)
-		netif_wake_queue(dev);
+		ieee80211_wake_queue(dev, 0);
 
 	priv->dirty_tx = dirty_tx;
 	spin_unlock(&priv->lock);
@@ -1627,7 +1627,7 @@ static int adm8211_open(struct net_devic
 	adm8211_rf_set_channel(dev, priv->channel);
 
 	retval = request_irq(dev->irq, &adm8211_interrupt,
-			     SA_SHIRQ, dev->name, dev);
+			     IRQF_SHARED, dev->name, dev);
 	if (retval) {
 		printk(KERN_ERR "%s: failed to register IRQ handler\n",
 		       dev->name);
@@ -1765,17 +1765,13 @@ static void adm8211_tx_raw(struct net_de
 
 	spin_lock_irqsave(&priv->lock, flags);
 
-	if (priv->cur_tx - priv->dirty_tx < priv->tx_ring_size / 2)
+	if (priv->cur_tx - priv->dirty_tx == priv->tx_ring_size / 2)
 		flag = TDES1_CONTROL_IC | TDES1_CONTROL_LS | TDES1_CONTROL_FS;
-	else if (priv->cur_tx - priv->dirty_tx == priv->tx_ring_size / 2)
-		flag = TDES1_CONTROL_IC | TDES1_CONTROL_LS | TDES1_CONTROL_FS;
-	else if (priv->cur_tx - priv->dirty_tx < priv->tx_ring_size - 2)
+	else
 		flag = TDES1_CONTROL_LS | TDES1_CONTROL_FS;
-	else {
-		flag = TDES1_CONTROL_IC | TDES1_CONTROL_LS | TDES1_CONTROL_FS;
-		printk(KERN_DEBUG "%s: Yikes, this shouldn't happen!\n", dev->name);
-		netif_stop_queue(dev);
-	}
+
+	if (priv->cur_tx - priv->dirty_tx == priv->tx_ring_size - 2)
+		ieee80211_stop_queue(dev, 0);
 
 	entry = priv->cur_tx % priv->tx_ring_size;
 
drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +1 -1
index 59d137b..6366020 100644
@@ -2295,7 +2295,7 @@ #ifdef CONFIG_BCM947XX
 	}
 #endif
 	err = request_irq(bcm->irq, bcm43xx_interrupt_handler,
-			  SA_SHIRQ, KBUILD_MODNAME, bcm);
+			  IRQF_SHARED, KBUILD_MODNAME, bcm);
 	if (err)
 		printk(KERN_ERR PFX "Cannot register IRQ%d\n", bcm->irq);
 
drivers/net/wireless/d80211/rt2x00/Kconfig +12 -12
index d9b97f1..9e91fd6 100644
@@ -17,12 +17,12 @@ config RT2400PCI
 
 config RT2400PCI_BUTTON
 	bool "Ralink rt2400 hardware button support"
-	depends on RT2400PCI && X86
+	depends on RT2400PCI && RFKILL
 	---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.
+	with this option enabled the driver will register itself to the
+	rfkill driver for periodical polling of the hardware button
+	status, and the correct handling of button press events.
 
 config RT2400PCI_DEBUG
 	bool "Ralink rt2400 debug output"
@@ -40,12 +40,12 @@ config RT2500PCI
 
 config RT2500PCI_BUTTON
 	bool "Ralink rt2500 hardware button support"
-	depends on RT2500PCI && X86
+	depends on RT2500PCI && RFKILL
 	---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.
+	with this option enabled the driver will register itself to the
+	rfkill driver for periodical polling of the hardware button
+	status, and the correct handling of button press events.
 
 config RT2500PCI_DEBUG
 	bool "Ralink rt2500 debug output"
@@ -63,12 +63,12 @@ config RT61PCI
 
 config RT61PCI_BUTTON
 	bool "Ralink rt61 hardware button support"
-	depends on RT61PCI && X86
+	depends on RT61PCI && RFKILL
 	---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.
+	with this option enabled the driver will register itself to the
+	rfkill driver for periodical polling of the hardware button
+	status, and the correct handling of button press events.
 
 config RT61PCI_DEBUG
 	bool "Ralink rt61 debug output"
drivers/net/wireless/d80211/rt2x00/rt2400pci.c +98 -95

325 lines not on this page · raw message

drivers/net/wireless/d80211/rt2x00/rt2400pci.h +2 -2
index b592eef..ae0ea54 100644
@@ -881,8 +881,8 @@ #define TXPOWER_FROM_DEV(__txpower) \
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
 		(__txpower) += MIN_TXPOWER; \
-		((__txpower) < MIN_TXPOWER) ? MAX_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MIN_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MAX_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MIN_TXPOWER : \
 		(MAX_TXPOWER - ((__txpower) - MIN_TXPOWER))); \
 	})
 
drivers/net/wireless/d80211/rt2x00/rt2500pci.c +100 -97

341 lines not on this page · raw message

drivers/net/wireless/d80211/rt2x00/rt2500pci.h +2 -2
index 671265b..8ef5ae5 100644
@@ -1142,8 +1142,8 @@ #define TXPOWER_FROM_DEV(__txpower) \
 
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
-		((__txpower) < MIN_TXPOWER) ? MIN_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MAX_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
 		(__txpower)); \
 	})
 
drivers/net/wireless/d80211/rt2x00/rt2500usb.c +33 -66

189 lines not on this page · raw message

drivers/net/wireless/d80211/rt2x00/rt2500usb.h +2 -2
index 42d44aa..917ba4c 100644
@@ -679,8 +679,8 @@ #define TXPOWER_FROM_DEV(__txpower) \
 
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
-		((__txpower) < MIN_TXPOWER) ? MIN_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MAX_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
 		(__txpower)); \
 	})
 
drivers/net/wireless/d80211/rt2x00/rt2x00.h +55 -7

92 lines not on this page · raw message

drivers/net/wireless/d80211/rt2x00/rt2x00pci.h +0 -111

115 lines not on this page · raw message

drivers/net/wireless/d80211/rt2x00/rt61pci.c +97 -103

339 lines not on this page · raw message

drivers/net/wireless/d80211/rt2x00/rt61pci.h +2 -2
index d334390..2c5065b 100644
@@ -1360,8 +1360,8 @@ #define TXPOWER_FROM_DEV(__txpower) \
 
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
-		((__txpower) < MIN_TXPOWER) ? MIN_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MAX_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
 		(__txpower)); \
 	})
 
drivers/net/wireless/d80211/rt2x00/rt73usb.c +29 -63

170 lines not on this page · raw message

drivers/net/wireless/d80211/rt2x00/rt73usb.h +2 -2
index 662ca30..5be5e14 100644
@@ -939,8 +939,8 @@ #define TXPOWER_FROM_DEV(__txpower) \
 
 #define TXPOWER_TO_DEV(__txpower) \
 	({ \
-		((__txpower) < MIN_TXPOWER) ? MIN_TXPOWER : \
-		(((__txpower) > MAX_TXPOWER) ? MAX_TXPOWER : \
+		((__txpower) <= MIN_TXPOWER) ? MIN_TXPOWER : \
+		(((__txpower) >= MAX_TXPOWER) ? MAX_TXPOWER : \
 		(__txpower)); \
 	})
 
include/linux/input.h +1 -0
index b3253ab..f16da66 100644
@@ -488,6 +488,7 @@ #define KEY_PREVIOUS		0x19c
 #define KEY_DIGITS		0x19d
 #define KEY_TEEN		0x19e
 #define KEY_TWEN		0x19f
+#define KEY_RFKILL		0x1a0
 
 #define KEY_DEL_EOL		0x1c0
 #define KEY_DEL_EOS		0x1c1
include/linux/rfkill.h new file +98 -0

98 lines not on this page · raw message

net/d80211/ieee80211.c +14 -12
index 60eca90..11804d5 100644
@@ -250,7 +250,7 @@ int ieee80211_get_hdrlen(u16 fc)
 	case IEEE80211_FTYPE_DATA:
 		if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
 			hdrlen = 30; /* Addr4 */
-		if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_QOS_DATA)
+		if (fc & IEEE80211_STYPE_QOS_DATA)
 			hdrlen += 2; /* QoS Control Field */
 		break;
 	case IEEE80211_FTYPE_CTL:
@@ -637,7 +637,7 @@ static int ieee80211_frame_duration(stru
 		 * 802.11 (DS): 15.3.3, 802.11b: 18.3.4
 		 * aSIFSTime = 10 usec
 		 * aPreambleLength = 144 usec or 72 usec with short preamble
-		 * aPLCPHeaderLength = 48 ms or 24 ms with short preamble
+		 * aPLCPHeaderLength = 48 usec or 24 usec with short preamble
 		 */
 		dur = 10; /* aSIFSTime = 10 usec */
 		dur += short_preamble ? (72 + 24) : (144 + 48);
@@ -762,7 +762,7 @@ ieee80211_tx_h_misc(struct ieee80211_txr
 	struct ieee80211_tx_control *control = tx->u.tx.control;
 
 	if (!is_multicast_ether_addr(hdr->addr1)) {
-		if (tx->skb->len >= tx->local->rts_threshold &&
+		if (tx->skb->len + FCS_LEN > tx->local->rts_threshold &&
 		    tx->local->rts_threshold < IEEE80211_MAX_RTS_THRESHOLD) {
 			control->use_rts_cts = 1;
 			control->retry_limit =
@@ -1519,7 +1519,7 @@ static int ieee80211_subif_start_xmit(st
 	sta = sta_info_get(local, hdr.addr1);
 	if (sta) {
 		if (sta->flags & WLAN_STA_WME) {
-			fc |= IEEE80211_STYPE_QOS_DATA << 4;
+			fc |= IEEE80211_STYPE_QOS_DATA;
 			hdrlen += 2;
 		}
 		sta_info_put(sta);
@@ -3074,8 +3074,9 @@ ieee80211_rx_h_check(struct ieee80211_tx
 		     rx->sdata->type != IEEE80211_IF_TYPE_IBSS &&
 		     (!rx->sta || !(rx->sta->flags & WLAN_STA_ASSOC)))) {
 		if ((!(rx->fc & IEEE80211_FCTL_FROMDS) &&
-		     !(rx->fc & IEEE80211_FCTL_TODS)) ||
-		    !rx->u.rx.ra_match) {
+		     !(rx->fc & IEEE80211_FCTL_TODS) &&
+		     (rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)
+		    || !rx->u.rx.ra_match) {
 			/* Drop IBSS frames and frames for other hosts
 			 * silently. */
 			return TXRX_DROP;
@@ -3976,11 +3977,11 @@ static void ieee80211_remove_tx_extra(st
 	pkt_data->requeue = control->requeue;
 	pkt_data->queue = control->queue;
 
-	if (key == NULL)
-		return;
-
 	hdrlen = ieee80211_get_hdrlen_from_skb(skb);
 
+	if (key == NULL)
+		goto no_key;
+
 	switch (key->alg) {
 	case ALG_WEP:
 		iv_len = WEP_IV_LEN;
@@ -3995,7 +3996,7 @@ static void ieee80211_remove_tx_extra(st
 		mic_len = CCMP_MIC_LEN;
 		break;
 	default:
-		return;
+		goto no_key;
 	}
 
 	if (skb->len >= mic_len && key->force_sw_encrypt)
@@ -4005,11 +4006,12 @@ static void ieee80211_remove_tx_extra(st
 		skb_pull(skb, iv_len);
 	}
 
+no_key:
 	{
 		struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
 		u16 fc = le16_to_cpu(hdr->frame_control);
 		if ((fc & 0x8C) == 0x88) /* QoS Control Field */ {
-			fc &= ~(IEEE80211_STYPE_QOS_DATA << 4);
+			fc &= ~IEEE80211_STYPE_QOS_DATA;
 			hdr->frame_control = cpu_to_le16(fc);
 			memmove(skb->data + 2, skb->data, hdrlen - 2);
 			skb_pull(skb, 2);
@@ -4379,7 +4381,7 @@ struct net_device *ieee80211_alloc_hw(si
 
 	mdev->hard_start_xmit = ieee80211_master_start_xmit;
 	mdev->wireless_handlers =
-		(struct iw_handler_def *) &ieee80211_iw_handler_def;
+		(struct iw_handler_def *) &ieee80211_iw_master_handler_def;
         mdev->do_ioctl = ieee80211_ioctl;
 	mdev->change_mtu = ieee80211_change_mtu;
         mdev->tx_timeout = ieee80211_tx_timeout;
net/d80211/ieee80211_i.h +1 -0
index 7e021ec..bdaaf5e 100644
@@ -569,6 +569,7 @@ void ieee80211_if_mgmt_setup(struct net_
 /* ieee80211_ioctl.c */
 int ieee80211_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 extern const struct iw_handler_def ieee80211_iw_handler_def;
+extern const struct iw_handler_def ieee80211_iw_master_handler_def;
 
 /* Set hw encryption from ieee80211 */
 int ieee80211_set_hw_encryption(struct net_device *dev,
net/d80211/ieee80211_ioctl.c +82 -5

144 lines not on this page · raw message

net/d80211/tkip.c +1 -0
index 3f0cf57..c27a7fe 100644
@@ -286,6 +286,7 @@ #endif /* CONFIG_TKIP_DEBUG */
 
 	if (only_iv) {
 		res = TKIP_DECRYPT_OK;
+		key->u.tkip.rx_initialized[queue] = 1;
 		goto done;
 	}
 
net/d80211/wme.c +2 -2
index c3c961d..fc2a113 100644
@@ -76,7 +76,7 @@ ieee80211_rx_h_remove_qos_control(struct
 	memmove(data + 2, data, ieee80211_get_hdrlen(fc) - 2);
 	hdr = (struct ieee80211_hdr *) skb_pull(rx->skb, 2);
 	/* change frame type to non QOS */
-	rx->fc = fc &= ~(IEEE80211_STYPE_QOS_DATA << 4);
+	rx->fc = fc &= ~IEEE80211_STYPE_QOS_DATA;
 	hdr->frame_control = cpu_to_le16(fc);
 
 	return TXRX_CONTINUE;
@@ -199,7 +199,7 @@ static inline int classify80211(struct s
 	}
 
 	/* is this a QoS frame? */
-	qos = fc & (IEEE80211_STYPE_QOS_DATA << 4);
+	qos = fc & IEEE80211_STYPE_QOS_DATA;
 
 	if (!qos) {
 		skb->priority = 0; /* required for correct WPA/11i MIC */
net/d80211/wpa.c +1 -1
index 7919620..fe5861f 100644
@@ -70,7 +70,7 @@ int ieee80211_get_hdr_info(const struct 
 	a4_included = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
 		(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS);
 	if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA &&
-	    (fc & IEEE80211_FCTL_STYPE) & IEEE80211_STYPE_QOS_DATA) {
+	    fc & IEEE80211_STYPE_QOS_DATA) {
 		pos = (u8 *) &hdr->addr4;
 		if (a4_included)
 			pos += 6;
Signature · 2 lines
John W. Linville
[email protected]