Skip to contentSkip to conversation

pull request: wireless-2.6 2008-03-04

PATCH John W. Linville 4 participants 6 messages Mar 4, 2008 – Mar 5, 2008 3 messages not in the archive

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

Dave,

Here is today's round of fixes for the 2.6.25 tree. These are mostly simple fixes, even one-liners. The rc80211-pid patch is, of course, an exception...

conflicts:

net/mac80211/rc80211_pid_algo.c

After pushing to Linus and pulling back into net-2.6.26, simply take all the _first_ blocks (i.e. between "<<<<" and "====") of conflicting lines. This is due to commit "rc80211-pid: fix rate adjustment" being a backport of a change already in net-2.6.26 with the same title.

Please let me know if there are problems!

Thanks,

John

---

Individual patches are available here:

http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/

---

The following changes since commit 976dde010e513a9c7c3117a32b7b015f84b37430:
Linus Torvalds (1):
Merge branch 'slab-linus' of git://git.kernel.org/.../christoph/vm

are available in the git repository at:

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

David Woodhouse (1):
libertas: fix sanity check on sequence number in command response

Johannes Berg (2):
p54: fix EEPROM structure endianness
p54: fix eeprom parser length sanity checks

Jussi Kivilinna (1):
rndis_wlan: fix broken data copy

Michael Buesch (1):
b43legacy: Fix module init message

Sebastian Siewior (1):
libertas: compare the current command with response

Stefano Brivio (1):
rc80211-pid: fix rate adjustment

Yoichi Yuasa (1):
ssb: Add pcibios_enable_device() return value check

 drivers/net/wireless/b43legacy/main.c   |    2 +-
 drivers/net/wireless/libertas/cmdresp.c |    8 +--
 drivers/net/wireless/p54common.c        |   20 ++++---
 drivers/net/wireless/p54common.h        |    8 +-
 drivers/net/wireless/rndis_wlan.c       |    8 +--
 drivers/ssb/driver_pcicore.c            |    5 +-
 net/mac80211/rc80211_pid_algo.c         |   92 ++++++++++++++----------------
 7 files changed, 70 insertions(+), 73 deletions(-)
drivers/net/wireless/b43legacy/main.c +1 -1
index c39de42..5f3f34e 100644
@@ -3829,7 +3829,7 @@ static void b43legacy_print_driverinfo(void)
 #ifdef CONFIG_B43LEGACY_DMA
 	feat_dma = "D";
 #endif
-	printk(KERN_INFO "Broadcom 43xx driver loaded "
+	printk(KERN_INFO "Broadcom 43xx-legacy driver loaded "
 	       "[ Features: %s%s%s%s%s, Firmware-ID: "
 	       B43legacy_SUPPORTED_FIRMWARE_ID " ]\n",
 	       feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma);
drivers/net/wireless/libertas/cmdresp.c +3 -5
index 159216a..bdc6a1c 100644
@@ -562,9 +562,7 @@ int lbs_process_rx_command(struct lbs_private *priv)
 	}
 
 	resp = (void *)priv->upld_buf;
-
-	curcmd = le16_to_cpu(resp->command);
-
+	curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command);
 	respcmd = le16_to_cpu(resp->command);
 	result = le16_to_cpu(resp->result);
 
@@ -572,9 +570,9 @@ int lbs_process_rx_command(struct lbs_private *priv)
 		     respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies);
 	lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len);
 
-	if (resp->seqnum != resp->seqnum) {
+	if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
 		lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
-			    le16_to_cpu(resp->seqnum), le16_to_cpu(resp->seqnum));
+			    le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
 		spin_unlock_irqrestore(&priv->driver_lock, flags);
 		ret = -1;
 		goto done;
drivers/net/wireless/p54common.c +12 -8
index 5cda49a..d191e05 100644
@@ -166,18 +166,23 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
 	struct p54_common *priv = dev->priv;
 	struct eeprom_pda_wrap *wrap = NULL;
 	struct pda_entry *entry;
-	int i = 0;
 	unsigned int data_len, entry_len;
 	void *tmp;
 	int err;
+	u8 *end = (u8 *)eeprom + len;
 
 	wrap = (struct eeprom_pda_wrap *) eeprom;
-	entry = (void *)wrap->data + wrap->len;
-	i += 2;
-	i += le16_to_cpu(entry->len)*2;
-	while (i < len) {
+	entry = (void *)wrap->data + le16_to_cpu(wrap->len);
+
+	/* verify that at least the entry length/code fits */
+	while ((u8 *)entry <= end - sizeof(*entry)) {
 		entry_len = le16_to_cpu(entry->len);
 		data_len = ((entry_len - 1) << 1);
+
+		/* abort if entry exceeds whole structure */
+		if ((u8 *)entry + sizeof(*entry) + data_len > end)
+			break;
+
 		switch (le16_to_cpu(entry->code)) {
 		case PDR_MAC_ADDRESS:
 			SET_IEEE80211_PERM_ADDR(dev, entry->data);
@@ -249,13 +254,12 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
 			priv->version = *(u8 *)(entry->data + 1);
 			break;
 		case PDR_END:
-			i = len;
+			/* make it overrun */
+			entry_len = len;
 			break;
 		}
 
 		entry = (void *)entry + (entry_len + 1)*2;
-		i += 2;
-		i += entry_len*2;
 	}
 
 	if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) {
drivers/net/wireless/p54common.h +4 -4
index a721334..b67ff34 100644
@@ -53,10 +53,10 @@ struct pda_entry {
 } __attribute__ ((packed));
 
 struct eeprom_pda_wrap {
-	u32 magic;
-	u16 pad;
-	u16 len;
-	u32 arm_opcode;
+	__le32 magic;
+	__le16 pad;
+	__le16 len;
+	__le32 arm_opcode;
 	u8 data[0];
 } __attribute__ ((packed));
 
drivers/net/wireless/rndis_wlan.c +3 -5
index d9460ae..10b776c 100644
@@ -260,7 +260,7 @@ struct NDIS_802_11_KEY {
 	__le32 KeyLength;
 	u8 Bssid[6];
 	u8 Padding[6];
-	__le64 KeyRSC;
+	u8 KeyRSC[8];
 	u8 KeyMaterial[32];
 } __attribute__((packed));
 
@@ -1508,7 +1508,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
 	struct usbnet *usbdev = dev->priv;
 	struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
 	struct NDIS_802_11_KEY ndis_key;
-	int i, keyidx, ret;
+	int keyidx, ret;
 	u8 *addr;
 
 	keyidx = wrqu->encoding.flags & IW_ENCODE_INDEX;
@@ -1543,9 +1543,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
 	ndis_key.KeyIndex = cpu_to_le32(keyidx);
 
 	if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
-		for (i = 0; i < 6; i++)
-			ndis_key.KeyRSC |=
-				cpu_to_le64(ext->rx_seq[i] << (i * 8));
+		memcpy(ndis_key.KeyRSC, ext->rx_seq, 6);
 		ndis_key.KeyIndex |= cpu_to_le32(1 << 29);
 	}
 
drivers/ssb/driver_pcicore.c +4 -1
index 07ab48d..74b9a8a 100644
@@ -111,7 +111,10 @@ static void __init ssb_fixup_pcibridge(struct pci_dev *dev)
 
 	/* Enable PCI bridge bus mastering and memory space */
 	pci_set_master(dev);
-	pcibios_enable_device(dev, ~0);
+	if (pcibios_enable_device(dev, ~0) < 0) {
+		ssb_printk(KERN_ERR "PCI: SSB bridge enable failed\n");
+		return;
+	}
 
 	/* Enable PCI bridge BAR1 prefetch and burst */
 	pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3);
net/mac80211/rc80211_pid_algo.c +43 -49

122 lines not on this page · raw message

Signature · 2 lines
John W. Linville
[email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

From: "John W. Linville" <[email protected]>
Date: Tue, 4 Mar 2008 16:29:53 -0500

Quoted 3 lines

Here is today's round of fixes for the 2.6.25 tree. These are mostly simple fixes, even one-liners. The rc80211-pid patch is, of course, an exception...

Please don't just clone Linus's tree, pull net-2.6, and then stuff things on top of that and ask me to pull. I end up being forced to end up with a merge of Linus's current tree as a result, and that's not how this is supposed to work.

I keep net-2.6 stable for a reason. Jeff did what you're doing right now the other week and now you're doing it too.

There is zero point in my keeping net-2.6 clean and not rebasing it constantly if people are going to use it like this.

You should just have a clone of net-2.6 sitting around as your wireless fixes tree, and you simply add wireless patches and ask me to pull whenever it is appropriate.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20080304.134003.223058560.davem-fT/PcQaiUtIeIZ0/[email protected]

#4 lore raw
Quoted 7 lines · David Miller

From: "John W. Linville" <[email protected]>
Date: Tue, 4 Mar 2008 16:29:53 -0500

Quoted 3 lines

Here is today's round of fixes for the 2.6.25 tree. These are mostly simple fixes, even one-liners. The rc80211-pid patch is, of course, an exception...

Quoted 7 lines

Please don't just clone Linus's tree, pull net-2.6, and then stuff things on top of that and ask me to pull. I end up being forced to end up with a merge of Linus's current tree as a result, and that's not how this is supposed to work.

I keep net-2.6 stable for a reason. Jeff did what you're doing right now the other week and now you're doing it too.

Sorry, Dave. I'll fix it up and post a new request.

John

Signature · 6 lines
John W. Linville
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

pull request (2nd try): wireless-2.6 2008-03-04

Quoted 6 lines · David Miller

From: "John W. Linville" <[email protected]>
Date: Tue, 4 Mar 2008 17:16:41 -0500

Quoted 1 line

I'll fix it up and post a new request.

Thank you.

2nd attempt, same as before except for the base...sorry about the confusion!

---

Dave,

Here is today's round of fixes for the 2.6.25 tree. These are mostly simple fixes, even one-liners. The rc80211-pid patch is, of course, an exception...

conflicts:

net/mac80211/rc80211_pid_algo.c

After pushing to Linus and pulling back into net-2.6.26, simply take all the _first_ blocks (i.e. between "<<<<" and "====") of conflicting lines. This is due to commit "rc80211-pid: fix rate adjustment" being a backport of a change already in net-2.6.26 with the same title.

Please let me know if there are problems!

Thanks,

John

---

Individual patches are available here:

http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/

---

The following changes since commit ec9b6add7d81f902f6094e71f595da4a362f3348:
Jarek Poplawski (1):
[PPPOL2TP]: Add missing sock_put() in pppol2tp_tunnel_closeall()

are available in the git repository at:

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

David Woodhouse (1):
libertas: fix sanity check on sequence number in command response

Johannes Berg (2):
p54: fix EEPROM structure endianness
p54: fix eeprom parser length sanity checks

Jussi Kivilinna (1):
rndis_wlan: fix broken data copy

Michael Buesch (1):
b43legacy: Fix module init message

Sebastian Siewior (1):
libertas: compare the current command with response

Stefano Brivio (1):
rc80211-pid: fix rate adjustment

Yoichi Yuasa (1):
ssb: Add pcibios_enable_device() return value check

 drivers/net/wireless/b43legacy/main.c   |    2 +-
 drivers/net/wireless/libertas/cmdresp.c |    8 +--
 drivers/net/wireless/p54common.c        |   20 ++++---
 drivers/net/wireless/p54common.h        |    8 +-
 drivers/net/wireless/rndis_wlan.c       |    8 +--
 drivers/ssb/driver_pcicore.c            |    5 +-
 net/mac80211/rc80211_pid_algo.c         |   92 ++++++++++++++----------------
 7 files changed, 70 insertions(+), 73 deletions(-)
drivers/net/wireless/b43legacy/main.c +1 -1
index c39de42..5f3f34e 100644
@@ -3829,7 +3829,7 @@ static void b43legacy_print_driverinfo(void)
 #ifdef CONFIG_B43LEGACY_DMA
 	feat_dma = "D";
 #endif
-	printk(KERN_INFO "Broadcom 43xx driver loaded "
+	printk(KERN_INFO "Broadcom 43xx-legacy driver loaded "
 	       "[ Features: %s%s%s%s%s, Firmware-ID: "
 	       B43legacy_SUPPORTED_FIRMWARE_ID " ]\n",
 	       feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma);
drivers/net/wireless/libertas/cmdresp.c +3 -5
index 159216a..bdc6a1c 100644
@@ -562,9 +562,7 @@ int lbs_process_rx_command(struct lbs_private *priv)
 	}
 
 	resp = (void *)priv->upld_buf;
-
-	curcmd = le16_to_cpu(resp->command);
-
+	curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command);
 	respcmd = le16_to_cpu(resp->command);
 	result = le16_to_cpu(resp->result);
 
@@ -572,9 +570,9 @@ int lbs_process_rx_command(struct lbs_private *priv)
 		     respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies);
 	lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len);
 
-	if (resp->seqnum != resp->seqnum) {
+	if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
 		lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
-			    le16_to_cpu(resp->seqnum), le16_to_cpu(resp->seqnum));
+			    le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
 		spin_unlock_irqrestore(&priv->driver_lock, flags);
 		ret = -1;
 		goto done;
drivers/net/wireless/p54common.c +12 -8
index 5cda49a..d191e05 100644
@@ -166,18 +166,23 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
 	struct p54_common *priv = dev->priv;
 	struct eeprom_pda_wrap *wrap = NULL;
 	struct pda_entry *entry;
-	int i = 0;
 	unsigned int data_len, entry_len;
 	void *tmp;
 	int err;
+	u8 *end = (u8 *)eeprom + len;
 
 	wrap = (struct eeprom_pda_wrap *) eeprom;
-	entry = (void *)wrap->data + wrap->len;
-	i += 2;
-	i += le16_to_cpu(entry->len)*2;
-	while (i < len) {
+	entry = (void *)wrap->data + le16_to_cpu(wrap->len);
+
+	/* verify that at least the entry length/code fits */
+	while ((u8 *)entry <= end - sizeof(*entry)) {
 		entry_len = le16_to_cpu(entry->len);
 		data_len = ((entry_len - 1) << 1);
+
+		/* abort if entry exceeds whole structure */
+		if ((u8 *)entry + sizeof(*entry) + data_len > end)
+			break;
+
 		switch (le16_to_cpu(entry->code)) {
 		case PDR_MAC_ADDRESS:
 			SET_IEEE80211_PERM_ADDR(dev, entry->data);
@@ -249,13 +254,12 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
 			priv->version = *(u8 *)(entry->data + 1);
 			break;
 		case PDR_END:
-			i = len;
+			/* make it overrun */
+			entry_len = len;
 			break;
 		}
 
 		entry = (void *)entry + (entry_len + 1)*2;
-		i += 2;
-		i += entry_len*2;
 	}
 
 	if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) {
drivers/net/wireless/p54common.h +4 -4
index a721334..b67ff34 100644
@@ -53,10 +53,10 @@ struct pda_entry {
 } __attribute__ ((packed));
 
 struct eeprom_pda_wrap {
-	u32 magic;
-	u16 pad;
-	u16 len;
-	u32 arm_opcode;
+	__le32 magic;
+	__le16 pad;
+	__le16 len;
+	__le32 arm_opcode;
 	u8 data[0];
 } __attribute__ ((packed));
 
drivers/net/wireless/rndis_wlan.c +3 -5
index d9460ae..10b776c 100644
@@ -260,7 +260,7 @@ struct NDIS_802_11_KEY {
 	__le32 KeyLength;
 	u8 Bssid[6];
 	u8 Padding[6];
-	__le64 KeyRSC;
+	u8 KeyRSC[8];
 	u8 KeyMaterial[32];
 } __attribute__((packed));
 
@@ -1508,7 +1508,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
 	struct usbnet *usbdev = dev->priv;
 	struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
 	struct NDIS_802_11_KEY ndis_key;
-	int i, keyidx, ret;
+	int keyidx, ret;
 	u8 *addr;
 
 	keyidx = wrqu->encoding.flags & IW_ENCODE_INDEX;
@@ -1543,9 +1543,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
 	ndis_key.KeyIndex = cpu_to_le32(keyidx);
 
 	if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
-		for (i = 0; i < 6; i++)
-			ndis_key.KeyRSC |=
-				cpu_to_le64(ext->rx_seq[i] << (i * 8));
+		memcpy(ndis_key.KeyRSC, ext->rx_seq, 6);
 		ndis_key.KeyIndex |= cpu_to_le32(1 << 29);
 	}
 
drivers/ssb/driver_pcicore.c +4 -1
index 07ab48d..74b9a8a 100644
@@ -111,7 +111,10 @@ static void __init ssb_fixup_pcibridge(struct pci_dev *dev)
 
 	/* Enable PCI bridge bus mastering and memory space */
 	pci_set_master(dev);
-	pcibios_enable_device(dev, ~0);
+	if (pcibios_enable_device(dev, ~0) < 0) {
+		ssb_printk(KERN_ERR "PCI: SSB bridge enable failed\n");
+		return;
+	}
 
 	/* Enable PCI bridge BAR1 prefetch and burst */
 	pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3);
net/mac80211/rc80211_pid_algo.c +43 -49

122 lines not on this page · raw message

Signature · 2 lines
John W. Linville
[email protected]
maintainer
#8 lore raw

Re: pull request (2nd try): wireless-2.6 2008-03-04

From: "John W. Linville" <[email protected]>
Date: Tue, 4 Mar 2008 19:23:09 -0500

Quoted 10 lines · David Miller
Quoted 6 lines

From: "John W. Linville" <[email protected]>
Date: Tue, 4 Mar 2008 17:16:41 -0500

Quoted 1 line

I'll fix it up and post a new request.

Thank you.

2nd attempt, same as before except for the base...sorry about the confusion!

Pulled and pushed back out to net-2.6, thanks John!