diff options
author | David S. Miller <davem@davemloft.net> | 2008-03-05 15:26:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-05 15:26:41 -0500 |
commit | 255333c1db3ec63921de29b134418a4e56e5921e (patch) | |
tree | b1cd99373cabfa6fed020496d4d74500e7bc7e92 /drivers/net/wireless | |
parent | 9a43b709a230705ca40a6f854a334a02334a3c1c (diff) | |
parent | 0d66afe7805b169b6bf3c7a88cf8163298b8ef05 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
net/mac80211/rc80211_pid_algo.c
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/p54common.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/p54common.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 8 |
5 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 82953dd0bae0..f518e796bdec 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -3870,7 +3870,7 @@ static void b43legacy_print_driverinfo(void) | |||
3870 | #ifdef CONFIG_B43LEGACY_DMA | 3870 | #ifdef CONFIG_B43LEGACY_DMA |
3871 | feat_dma = "D"; | 3871 | feat_dma = "D"; |
3872 | #endif | 3872 | #endif |
3873 | printk(KERN_INFO "Broadcom 43xx driver loaded " | 3873 | printk(KERN_INFO "Broadcom 43xx-legacy driver loaded " |
3874 | "[ Features: %s%s%s%s%s, Firmware-ID: " | 3874 | "[ Features: %s%s%s%s%s, Firmware-ID: " |
3875 | B43legacy_SUPPORTED_FIRMWARE_ID " ]\n", | 3875 | B43legacy_SUPPORTED_FIRMWARE_ID " ]\n", |
3876 | feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma); | 3876 | feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma); |
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index a0a5dbe81b3b..5d90b83f28eb 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -562,9 +562,7 @@ int lbs_process_rx_command(struct lbs_private *priv) | |||
562 | } | 562 | } |
563 | 563 | ||
564 | resp = (void *)priv->upld_buf; | 564 | resp = (void *)priv->upld_buf; |
565 | 565 | curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command); | |
566 | curcmd = le16_to_cpu(resp->command); | ||
567 | |||
568 | respcmd = le16_to_cpu(resp->command); | 566 | respcmd = le16_to_cpu(resp->command); |
569 | result = le16_to_cpu(resp->result); | 567 | result = le16_to_cpu(resp->result); |
570 | 568 | ||
@@ -572,9 +570,9 @@ int lbs_process_rx_command(struct lbs_private *priv) | |||
572 | respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies); | 570 | respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies); |
573 | lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, priv->upld_len); | 571 | lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, priv->upld_len); |
574 | 572 | ||
575 | if (resp->seqnum != resp->seqnum) { | 573 | if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) { |
576 | lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", | 574 | lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", |
577 | le16_to_cpu(resp->seqnum), le16_to_cpu(resp->seqnum)); | 575 | le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum)); |
578 | spin_unlock_irqrestore(&priv->driver_lock, flags); | 576 | spin_unlock_irqrestore(&priv->driver_lock, flags); |
579 | ret = -1; | 577 | ret = -1; |
580 | goto done; | 578 | goto done; |
diff --git a/drivers/net/wireless/p54common.c b/drivers/net/wireless/p54common.c index 84cc000e71aa..63f9badf3f52 100644 --- a/drivers/net/wireless/p54common.c +++ b/drivers/net/wireless/p54common.c | |||
@@ -206,18 +206,23 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
206 | struct p54_common *priv = dev->priv; | 206 | struct p54_common *priv = dev->priv; |
207 | struct eeprom_pda_wrap *wrap = NULL; | 207 | struct eeprom_pda_wrap *wrap = NULL; |
208 | struct pda_entry *entry; | 208 | struct pda_entry *entry; |
209 | int i = 0; | ||
210 | unsigned int data_len, entry_len; | 209 | unsigned int data_len, entry_len; |
211 | void *tmp; | 210 | void *tmp; |
212 | int err; | 211 | int err; |
212 | u8 *end = (u8 *)eeprom + len; | ||
213 | 213 | ||
214 | wrap = (struct eeprom_pda_wrap *) eeprom; | 214 | wrap = (struct eeprom_pda_wrap *) eeprom; |
215 | entry = (void *)wrap->data + wrap->len; | 215 | entry = (void *)wrap->data + le16_to_cpu(wrap->len); |
216 | i += 2; | 216 | |
217 | i += le16_to_cpu(entry->len)*2; | 217 | /* verify that at least the entry length/code fits */ |
218 | while (i < len) { | 218 | while ((u8 *)entry <= end - sizeof(*entry)) { |
219 | entry_len = le16_to_cpu(entry->len); | 219 | entry_len = le16_to_cpu(entry->len); |
220 | data_len = ((entry_len - 1) << 1); | 220 | data_len = ((entry_len - 1) << 1); |
221 | |||
222 | /* abort if entry exceeds whole structure */ | ||
223 | if ((u8 *)entry + sizeof(*entry) + data_len > end) | ||
224 | break; | ||
225 | |||
221 | switch (le16_to_cpu(entry->code)) { | 226 | switch (le16_to_cpu(entry->code)) { |
222 | case PDR_MAC_ADDRESS: | 227 | case PDR_MAC_ADDRESS: |
223 | SET_IEEE80211_PERM_ADDR(dev, entry->data); | 228 | SET_IEEE80211_PERM_ADDR(dev, entry->data); |
@@ -289,7 +294,8 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
289 | priv->version = *(u8 *)(entry->data + 1); | 294 | priv->version = *(u8 *)(entry->data + 1); |
290 | break; | 295 | break; |
291 | case PDR_END: | 296 | case PDR_END: |
292 | i = len; | 297 | /* make it overrun */ |
298 | entry_len = len; | ||
293 | break; | 299 | break; |
294 | default: | 300 | default: |
295 | printk(KERN_INFO "p54: unknown eeprom code : 0x%x\n", | 301 | printk(KERN_INFO "p54: unknown eeprom code : 0x%x\n", |
@@ -298,8 +304,6 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
298 | } | 304 | } |
299 | 305 | ||
300 | entry = (void *)entry + (entry_len + 1)*2; | 306 | entry = (void *)entry + (entry_len + 1)*2; |
301 | i += 2; | ||
302 | i += entry_len*2; | ||
303 | } | 307 | } |
304 | 308 | ||
305 | if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) { | 309 | if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) { |
diff --git a/drivers/net/wireless/p54common.h b/drivers/net/wireless/p54common.h index dc9f4cef585e..c15b56e1d75e 100644 --- a/drivers/net/wireless/p54common.h +++ b/drivers/net/wireless/p54common.h | |||
@@ -53,10 +53,10 @@ struct pda_entry { | |||
53 | } __attribute__ ((packed)); | 53 | } __attribute__ ((packed)); |
54 | 54 | ||
55 | struct eeprom_pda_wrap { | 55 | struct eeprom_pda_wrap { |
56 | u32 magic; | 56 | __le32 magic; |
57 | u16 pad; | 57 | __le16 pad; |
58 | u16 len; | 58 | __le16 len; |
59 | u32 arm_opcode; | 59 | __le32 arm_opcode; |
60 | u8 data[0]; | 60 | u8 data[0]; |
61 | } __attribute__ ((packed)); | 61 | } __attribute__ ((packed)); |
62 | 62 | ||
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index d9460aed1f22..10b776c1adc5 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -260,7 +260,7 @@ struct NDIS_802_11_KEY { | |||
260 | __le32 KeyLength; | 260 | __le32 KeyLength; |
261 | u8 Bssid[6]; | 261 | u8 Bssid[6]; |
262 | u8 Padding[6]; | 262 | u8 Padding[6]; |
263 | __le64 KeyRSC; | 263 | u8 KeyRSC[8]; |
264 | u8 KeyMaterial[32]; | 264 | u8 KeyMaterial[32]; |
265 | } __attribute__((packed)); | 265 | } __attribute__((packed)); |
266 | 266 | ||
@@ -1508,7 +1508,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev, | |||
1508 | struct usbnet *usbdev = dev->priv; | 1508 | struct usbnet *usbdev = dev->priv; |
1509 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); | 1509 | struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); |
1510 | struct NDIS_802_11_KEY ndis_key; | 1510 | struct NDIS_802_11_KEY ndis_key; |
1511 | int i, keyidx, ret; | 1511 | int keyidx, ret; |
1512 | u8 *addr; | 1512 | u8 *addr; |
1513 | 1513 | ||
1514 | keyidx = wrqu->encoding.flags & IW_ENCODE_INDEX; | 1514 | keyidx = wrqu->encoding.flags & IW_ENCODE_INDEX; |
@@ -1543,9 +1543,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev, | |||
1543 | ndis_key.KeyIndex = cpu_to_le32(keyidx); | 1543 | ndis_key.KeyIndex = cpu_to_le32(keyidx); |
1544 | 1544 | ||
1545 | if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { | 1545 | if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { |
1546 | for (i = 0; i < 6; i++) | 1546 | memcpy(ndis_key.KeyRSC, ext->rx_seq, 6); |
1547 | ndis_key.KeyRSC |= | ||
1548 | cpu_to_le64(ext->rx_seq[i] << (i * 8)); | ||
1549 | ndis_key.KeyIndex |= cpu_to_le32(1 << 29); | 1547 | ndis_key.KeyIndex |= cpu_to_le32(1 << 29); |
1550 | } | 1548 | } |
1551 | 1549 | ||