diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-12-07 05:02:40 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-07 05:02:40 -0500 |
commit | 359f2d17e32b32f53577375f83fb06d34e31bfe8 (patch) | |
tree | 2890ffcf40fab2d2c24d2d208814afeb52bb12e5 /drivers | |
parent | 0efdf2626676db4b30d343ff88f8461ad09130da (diff) | |
parent | 720eeb4332e5871c97d390b2fb55a5a74fb18ae6 (diff) |
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream
Conflicts:
drivers/net/wireless/zd1211rw/zd_mac.h
net/ieee80211/softmac/ieee80211softmac_assoc.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_download.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_info.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_pci.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_plx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/isl_ioctl.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/oid_mgt.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_chip.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_chip.h | 43 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 53 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_netdev.c | 2 |
17 files changed, 140 insertions, 57 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 08bc57a4b895..974a8e5bec8b 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -1100,15 +1100,13 @@ static struct sta_info * ap_add_sta(struct ap_data *ap, u8 *addr) | |||
1100 | { | 1100 | { |
1101 | struct sta_info *sta; | 1101 | struct sta_info *sta; |
1102 | 1102 | ||
1103 | sta = (struct sta_info *) | 1103 | sta = kzalloc(sizeof(struct sta_info), GFP_ATOMIC); |
1104 | kmalloc(sizeof(struct sta_info), GFP_ATOMIC); | ||
1105 | if (sta == NULL) { | 1104 | if (sta == NULL) { |
1106 | PDEBUG(DEBUG_AP, "AP: kmalloc failed\n"); | 1105 | PDEBUG(DEBUG_AP, "AP: kmalloc failed\n"); |
1107 | return NULL; | 1106 | return NULL; |
1108 | } | 1107 | } |
1109 | 1108 | ||
1110 | /* initialize STA info data */ | 1109 | /* initialize STA info data */ |
1111 | memset(sta, 0, sizeof(struct sta_info)); | ||
1112 | sta->local = ap->local; | 1110 | sta->local = ap->local; |
1113 | skb_queue_head_init(&sta->tx_buf); | 1111 | skb_queue_head_init(&sta->tx_buf); |
1114 | memcpy(sta->addr, addr, ETH_ALEN); | 1112 | memcpy(sta->addr, addr, ETH_ALEN); |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index ee542ec6d6a8..8d8f4b9b8b07 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -563,12 +563,11 @@ static int prism2_config(struct pcmcia_device *link) | |||
563 | PDEBUG(DEBUG_FLOW, "prism2_config()\n"); | 563 | PDEBUG(DEBUG_FLOW, "prism2_config()\n"); |
564 | 564 | ||
565 | parse = kmalloc(sizeof(cisparse_t), GFP_KERNEL); | 565 | parse = kmalloc(sizeof(cisparse_t), GFP_KERNEL); |
566 | hw_priv = kmalloc(sizeof(*hw_priv), GFP_KERNEL); | 566 | hw_priv = kzalloc(sizeof(*hw_priv), GFP_KERNEL); |
567 | if (parse == NULL || hw_priv == NULL) { | 567 | if (parse == NULL || hw_priv == NULL) { |
568 | ret = -ENOMEM; | 568 | ret = -ENOMEM; |
569 | goto failed; | 569 | goto failed; |
570 | } | 570 | } |
571 | memset(hw_priv, 0, sizeof(*hw_priv)); | ||
572 | 571 | ||
573 | tuple.Attributes = 0; | 572 | tuple.Attributes = 0; |
574 | tuple.TupleData = buf; | 573 | tuple.TupleData = buf; |
diff --git a/drivers/net/wireless/hostap/hostap_download.c b/drivers/net/wireless/hostap/hostap_download.c index ab26b52b3e76..24fc387bba67 100644 --- a/drivers/net/wireless/hostap/hostap_download.c +++ b/drivers/net/wireless/hostap/hostap_download.c | |||
@@ -685,14 +685,12 @@ static int prism2_download(local_info_t *local, | |||
685 | goto out; | 685 | goto out; |
686 | } | 686 | } |
687 | 687 | ||
688 | dl = kmalloc(sizeof(*dl) + param->num_areas * | 688 | dl = kzalloc(sizeof(*dl) + param->num_areas * |
689 | sizeof(struct prism2_download_data_area), GFP_KERNEL); | 689 | sizeof(struct prism2_download_data_area), GFP_KERNEL); |
690 | if (dl == NULL) { | 690 | if (dl == NULL) { |
691 | ret = -ENOMEM; | 691 | ret = -ENOMEM; |
692 | goto out; | 692 | goto out; |
693 | } | 693 | } |
694 | memset(dl, 0, sizeof(*dl) + param->num_areas * | ||
695 | sizeof(struct prism2_download_data_area)); | ||
696 | dl->dl_cmd = param->dl_cmd; | 694 | dl->dl_cmd = param->dl_cmd; |
697 | dl->start_addr = param->start_addr; | 695 | dl->start_addr = param->start_addr; |
698 | dl->num_areas = param->num_areas; | 696 | dl->num_areas = param->num_areas; |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index c19e68636a1c..a394a23b9a20 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -347,14 +347,12 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0, | |||
347 | if (signal_pending(current)) | 347 | if (signal_pending(current)) |
348 | return -EINTR; | 348 | return -EINTR; |
349 | 349 | ||
350 | entry = (struct hostap_cmd_queue *) | 350 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
351 | kmalloc(sizeof(*entry), GFP_ATOMIC); | ||
352 | if (entry == NULL) { | 351 | if (entry == NULL) { |
353 | printk(KERN_DEBUG "%s: hfa384x_cmd - kmalloc failed\n", | 352 | printk(KERN_DEBUG "%s: hfa384x_cmd - kmalloc failed\n", |
354 | dev->name); | 353 | dev->name); |
355 | return -ENOMEM; | 354 | return -ENOMEM; |
356 | } | 355 | } |
357 | memset(entry, 0, sizeof(*entry)); | ||
358 | atomic_set(&entry->usecnt, 1); | 356 | atomic_set(&entry->usecnt, 1); |
359 | entry->type = CMD_SLEEP; | 357 | entry->type = CMD_SLEEP; |
360 | entry->cmd = cmd; | 358 | entry->cmd = cmd; |
@@ -517,14 +515,12 @@ static int hfa384x_cmd_callback(struct net_device *dev, u16 cmd, u16 param0, | |||
517 | return -1; | 515 | return -1; |
518 | } | 516 | } |
519 | 517 | ||
520 | entry = (struct hostap_cmd_queue *) | 518 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
521 | kmalloc(sizeof(*entry), GFP_ATOMIC); | ||
522 | if (entry == NULL) { | 519 | if (entry == NULL) { |
523 | printk(KERN_DEBUG "%s: hfa384x_cmd_callback - kmalloc " | 520 | printk(KERN_DEBUG "%s: hfa384x_cmd_callback - kmalloc " |
524 | "failed\n", dev->name); | 521 | "failed\n", dev->name); |
525 | return -ENOMEM; | 522 | return -ENOMEM; |
526 | } | 523 | } |
527 | memset(entry, 0, sizeof(*entry)); | ||
528 | atomic_set(&entry->usecnt, 1); | 524 | atomic_set(&entry->usecnt, 1); |
529 | entry->type = CMD_CALLBACK; | 525 | entry->type = CMD_CALLBACK; |
530 | entry->cmd = cmd; | 526 | entry->cmd = cmd; |
@@ -3016,14 +3012,12 @@ static int prism2_set_tim(struct net_device *dev, int aid, int set) | |||
3016 | iface = netdev_priv(dev); | 3012 | iface = netdev_priv(dev); |
3017 | local = iface->local; | 3013 | local = iface->local; |
3018 | 3014 | ||
3019 | new_entry = (struct set_tim_data *) | 3015 | new_entry = kzalloc(sizeof(*new_entry), GFP_ATOMIC); |
3020 | kmalloc(sizeof(*new_entry), GFP_ATOMIC); | ||
3021 | if (new_entry == NULL) { | 3016 | if (new_entry == NULL) { |
3022 | printk(KERN_DEBUG "%s: prism2_set_tim: kmalloc failed\n", | 3017 | printk(KERN_DEBUG "%s: prism2_set_tim: kmalloc failed\n", |
3023 | local->dev->name); | 3018 | local->dev->name); |
3024 | return -ENOMEM; | 3019 | return -ENOMEM; |
3025 | } | 3020 | } |
3026 | memset(new_entry, 0, sizeof(*new_entry)); | ||
3027 | new_entry->aid = aid; | 3021 | new_entry->aid = aid; |
3028 | new_entry->set = set; | 3022 | new_entry->set = set; |
3029 | 3023 | ||
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c index 5fd2b1ad7f5e..b6a02a02da74 100644 --- a/drivers/net/wireless/hostap/hostap_info.c +++ b/drivers/net/wireless/hostap/hostap_info.c | |||
@@ -327,11 +327,10 @@ static void prism2_info_hostscanresults(local_info_t *local, | |||
327 | ptr = (u8 *) pos; | 327 | ptr = (u8 *) pos; |
328 | 328 | ||
329 | new_count = left / result_size; | 329 | new_count = left / result_size; |
330 | results = kmalloc(new_count * sizeof(struct hfa384x_hostscan_result), | 330 | results = kcalloc(new_count, sizeof(struct hfa384x_hostscan_result), |
331 | GFP_ATOMIC); | 331 | GFP_ATOMIC); |
332 | if (results == NULL) | 332 | if (results == NULL) |
333 | return; | 333 | return; |
334 | memset(results, 0, new_count * sizeof(struct hfa384x_hostscan_result)); | ||
335 | 334 | ||
336 | for (i = 0; i < new_count; i++) { | 335 | for (i = 0; i < new_count; i++) { |
337 | memcpy(&results[i], ptr, copy_len); | 336 | memcpy(&results[i], ptr, copy_len); |
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index d061fb3443ff..3b7b8063ff1c 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c | |||
@@ -181,12 +181,10 @@ static int prism2_ioctl_siwencode(struct net_device *dev, | |||
181 | struct ieee80211_crypt_data *new_crypt; | 181 | struct ieee80211_crypt_data *new_crypt; |
182 | 182 | ||
183 | /* take WEP into use */ | 183 | /* take WEP into use */ |
184 | new_crypt = (struct ieee80211_crypt_data *) | 184 | new_crypt = kzalloc(sizeof(struct ieee80211_crypt_data), |
185 | kmalloc(sizeof(struct ieee80211_crypt_data), | ||
186 | GFP_KERNEL); | 185 | GFP_KERNEL); |
187 | if (new_crypt == NULL) | 186 | if (new_crypt == NULL) |
188 | return -ENOMEM; | 187 | return -ENOMEM; |
189 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | ||
190 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); | 188 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); |
191 | if (!new_crypt->ops) { | 189 | if (!new_crypt->ops) { |
192 | request_module("ieee80211_crypt_wep"); | 190 | request_module("ieee80211_crypt_wep"); |
@@ -3320,14 +3318,12 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev, | |||
3320 | 3318 | ||
3321 | prism2_crypt_delayed_deinit(local, crypt); | 3319 | prism2_crypt_delayed_deinit(local, crypt); |
3322 | 3320 | ||
3323 | new_crypt = (struct ieee80211_crypt_data *) | 3321 | new_crypt = kzalloc(sizeof(struct ieee80211_crypt_data), |
3324 | kmalloc(sizeof(struct ieee80211_crypt_data), | ||
3325 | GFP_KERNEL); | 3322 | GFP_KERNEL); |
3326 | if (new_crypt == NULL) { | 3323 | if (new_crypt == NULL) { |
3327 | ret = -ENOMEM; | 3324 | ret = -ENOMEM; |
3328 | goto done; | 3325 | goto done; |
3329 | } | 3326 | } |
3330 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | ||
3331 | new_crypt->ops = ops; | 3327 | new_crypt->ops = ops; |
3332 | new_crypt->priv = new_crypt->ops->init(i); | 3328 | new_crypt->priv = new_crypt->ops->init(i); |
3333 | if (new_crypt->priv == NULL) { | 3329 | if (new_crypt->priv == NULL) { |
@@ -3538,14 +3534,12 @@ static int prism2_ioctl_set_encryption(local_info_t *local, | |||
3538 | 3534 | ||
3539 | prism2_crypt_delayed_deinit(local, crypt); | 3535 | prism2_crypt_delayed_deinit(local, crypt); |
3540 | 3536 | ||
3541 | new_crypt = (struct ieee80211_crypt_data *) | 3537 | new_crypt = kzalloc(sizeof(struct ieee80211_crypt_data), |
3542 | kmalloc(sizeof(struct ieee80211_crypt_data), | ||
3543 | GFP_KERNEL); | 3538 | GFP_KERNEL); |
3544 | if (new_crypt == NULL) { | 3539 | if (new_crypt == NULL) { |
3545 | ret = -ENOMEM; | 3540 | ret = -ENOMEM; |
3546 | goto done; | 3541 | goto done; |
3547 | } | 3542 | } |
3548 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | ||
3549 | new_crypt->ops = ops; | 3543 | new_crypt->ops = ops; |
3550 | new_crypt->priv = new_crypt->ops->init(param->u.crypt.idx); | 3544 | new_crypt->priv = new_crypt->ops->init(param->u.crypt.idx); |
3551 | if (new_crypt->priv == NULL) { | 3545 | if (new_crypt->priv == NULL) { |
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index d1de9766c831..c4f6020baa9e 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c | |||
@@ -300,10 +300,9 @@ static int prism2_pci_probe(struct pci_dev *pdev, | |||
300 | struct hostap_interface *iface; | 300 | struct hostap_interface *iface; |
301 | struct hostap_pci_priv *hw_priv; | 301 | struct hostap_pci_priv *hw_priv; |
302 | 302 | ||
303 | hw_priv = kmalloc(sizeof(*hw_priv), GFP_KERNEL); | 303 | hw_priv = kzalloc(sizeof(*hw_priv), GFP_KERNEL); |
304 | if (hw_priv == NULL) | 304 | if (hw_priv == NULL) |
305 | return -ENOMEM; | 305 | return -ENOMEM; |
306 | memset(hw_priv, 0, sizeof(*hw_priv)); | ||
307 | 306 | ||
308 | if (pci_enable_device(pdev)) | 307 | if (pci_enable_device(pdev)) |
309 | goto err_out_free; | 308 | goto err_out_free; |
diff --git a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c index bc81b13a5a2a..e235e0647897 100644 --- a/drivers/net/wireless/hostap/hostap_plx.c +++ b/drivers/net/wireless/hostap/hostap_plx.c | |||
@@ -447,10 +447,9 @@ static int prism2_plx_probe(struct pci_dev *pdev, | |||
447 | int tmd7160; | 447 | int tmd7160; |
448 | struct hostap_plx_priv *hw_priv; | 448 | struct hostap_plx_priv *hw_priv; |
449 | 449 | ||
450 | hw_priv = kmalloc(sizeof(*hw_priv), GFP_KERNEL); | 450 | hw_priv = kzalloc(sizeof(*hw_priv), GFP_KERNEL); |
451 | if (hw_priv == NULL) | 451 | if (hw_priv == NULL) |
452 | return -ENOMEM; | 452 | return -ENOMEM; |
453 | memset(hw_priv, 0, sizeof(*hw_priv)); | ||
454 | 453 | ||
455 | if (pci_enable_device(pdev)) | 454 | if (pci_enable_device(pdev)) |
456 | goto err_out_free; | 455 | goto err_out_free; |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 1bcd352a813b..dd9ba4aad7bb 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -6220,7 +6220,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6220 | /* Allocate and initialize the Tx/Rx queues and lists */ | 6220 | /* Allocate and initialize the Tx/Rx queues and lists */ |
6221 | if (ipw2100_queues_allocate(priv)) { | 6221 | if (ipw2100_queues_allocate(priv)) { |
6222 | printk(KERN_WARNING DRV_NAME | 6222 | printk(KERN_WARNING DRV_NAME |
6223 | "Error calilng ipw2100_queues_allocate.\n"); | 6223 | "Error calling ipw2100_queues_allocate.\n"); |
6224 | err = -ENOMEM; | 6224 | err = -ENOMEM; |
6225 | goto fail; | 6225 | goto fail; |
6226 | } | 6226 | } |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index e82e56bb85e1..22cb3fb7502e 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -70,7 +70,7 @@ | |||
70 | #define VQ | 70 | #define VQ |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | #define IPW2200_VERSION "1.1.4" VK VD VM VP VR VQ | 73 | #define IPW2200_VERSION "1.2.0" VK VD VM VP VR VQ |
74 | #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2200/2915 Network Driver" | 74 | #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2200/2915 Network Driver" |
75 | #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" | 75 | #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" |
76 | #define DRV_VERSION IPW2200_VERSION | 76 | #define DRV_VERSION IPW2200_VERSION |
@@ -7677,7 +7677,8 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv, | |||
7677 | 7677 | ||
7678 | /* Big bitfield of all the fields we provide in radiotap */ | 7678 | /* Big bitfield of all the fields we provide in radiotap */ |
7679 | ipw_rt->rt_hdr.it_present = | 7679 | ipw_rt->rt_hdr.it_present = |
7680 | ((1 << IEEE80211_RADIOTAP_FLAGS) | | 7680 | ((1 << IEEE80211_RADIOTAP_TSFT) | |
7681 | (1 << IEEE80211_RADIOTAP_FLAGS) | | ||
7681 | (1 << IEEE80211_RADIOTAP_RATE) | | 7682 | (1 << IEEE80211_RADIOTAP_RATE) | |
7682 | (1 << IEEE80211_RADIOTAP_CHANNEL) | | 7683 | (1 << IEEE80211_RADIOTAP_CHANNEL) | |
7683 | (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | | 7684 | (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | |
@@ -7686,10 +7687,14 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv, | |||
7686 | 7687 | ||
7687 | /* Zero the flags, we'll add to them as we go */ | 7688 | /* Zero the flags, we'll add to them as we go */ |
7688 | ipw_rt->rt_flags = 0; | 7689 | ipw_rt->rt_flags = 0; |
7689 | ipw_rt->rt_tsf = 0ULL; | 7690 | ipw_rt->rt_tsf = (u64)(frame->parent_tsf[3] << 24 | |
7691 | frame->parent_tsf[2] << 16 | | ||
7692 | frame->parent_tsf[1] << 8 | | ||
7693 | frame->parent_tsf[0]); | ||
7690 | 7694 | ||
7691 | /* Convert signal to DBM */ | 7695 | /* Convert signal to DBM */ |
7692 | ipw_rt->rt_dbmsignal = antsignal; | 7696 | ipw_rt->rt_dbmsignal = antsignal; |
7697 | ipw_rt->rt_dbmnoise = frame->noise; | ||
7693 | 7698 | ||
7694 | /* Convert the channel data and set the flags */ | 7699 | /* Convert the channel data and set the flags */ |
7695 | ipw_rt->rt_channel = cpu_to_le16(ieee80211chan2mhz(received_channel)); | 7700 | ipw_rt->rt_channel = cpu_to_le16(ieee80211chan2mhz(received_channel)); |
@@ -7889,7 +7894,8 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv, | |||
7889 | 7894 | ||
7890 | /* Big bitfield of all the fields we provide in radiotap */ | 7895 | /* Big bitfield of all the fields we provide in radiotap */ |
7891 | ipw_rt->rt_hdr.it_present = | 7896 | ipw_rt->rt_hdr.it_present = |
7892 | ((1 << IEEE80211_RADIOTAP_FLAGS) | | 7897 | ((1 << IEEE80211_RADIOTAP_TSFT) | |
7898 | (1 << IEEE80211_RADIOTAP_FLAGS) | | ||
7893 | (1 << IEEE80211_RADIOTAP_RATE) | | 7899 | (1 << IEEE80211_RADIOTAP_RATE) | |
7894 | (1 << IEEE80211_RADIOTAP_CHANNEL) | | 7900 | (1 << IEEE80211_RADIOTAP_CHANNEL) | |
7895 | (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | | 7901 | (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | |
@@ -7898,7 +7904,10 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv, | |||
7898 | 7904 | ||
7899 | /* Zero the flags, we'll add to them as we go */ | 7905 | /* Zero the flags, we'll add to them as we go */ |
7900 | ipw_rt->rt_flags = 0; | 7906 | ipw_rt->rt_flags = 0; |
7901 | ipw_rt->rt_tsf = 0ULL; | 7907 | ipw_rt->rt_tsf = (u64)(frame->parent_tsf[3] << 24 | |
7908 | frame->parent_tsf[2] << 16 | | ||
7909 | frame->parent_tsf[1] << 8 | | ||
7910 | frame->parent_tsf[0]); | ||
7902 | 7911 | ||
7903 | /* Convert to DBM */ | 7912 | /* Convert to DBM */ |
7904 | ipw_rt->rt_dbmsignal = signal; | 7913 | ipw_rt->rt_dbmsignal = signal; |
@@ -8297,7 +8306,7 @@ static void ipw_rx(struct ipw_priv *priv) | |||
8297 | ("Notification: subtype=%02X flags=%02X size=%d\n", | 8306 | ("Notification: subtype=%02X flags=%02X size=%d\n", |
8298 | pkt->u.notification.subtype, | 8307 | pkt->u.notification.subtype, |
8299 | pkt->u.notification.flags, | 8308 | pkt->u.notification.flags, |
8300 | pkt->u.notification.size); | 8309 | le16_to_cpu(pkt->u.notification.size)); |
8301 | ipw_rx_notification(priv, &pkt->u.notification); | 8310 | ipw_rx_notification(priv, &pkt->u.notification); |
8302 | break; | 8311 | break; |
8303 | } | 8312 | } |
@@ -11145,14 +11154,13 @@ static int ipw_up(struct ipw_priv *priv) | |||
11145 | return -EIO; | 11154 | return -EIO; |
11146 | 11155 | ||
11147 | if (cmdlog && !priv->cmdlog) { | 11156 | if (cmdlog && !priv->cmdlog) { |
11148 | priv->cmdlog = kmalloc(sizeof(*priv->cmdlog) * cmdlog, | 11157 | priv->cmdlog = kcalloc(cmdlog, sizeof(*priv->cmdlog), |
11149 | GFP_KERNEL); | 11158 | GFP_KERNEL); |
11150 | if (priv->cmdlog == NULL) { | 11159 | if (priv->cmdlog == NULL) { |
11151 | IPW_ERROR("Error allocating %d command log entries.\n", | 11160 | IPW_ERROR("Error allocating %d command log entries.\n", |
11152 | cmdlog); | 11161 | cmdlog); |
11153 | return -ENOMEM; | 11162 | return -ENOMEM; |
11154 | } else { | 11163 | } else { |
11155 | memset(priv->cmdlog, 0, sizeof(*priv->cmdlog) * cmdlog); | ||
11156 | priv->cmdlog_len = cmdlog; | 11164 | priv->cmdlog_len = cmdlog; |
11157 | } | 11165 | } |
11158 | } | 11166 | } |
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index a87eb51886c8..96606ed10076 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
@@ -2141,11 +2141,9 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid, | |||
2141 | struct islpci_bss_wpa_ie, list); | 2141 | struct islpci_bss_wpa_ie, list); |
2142 | list_del(&bss->list); | 2142 | list_del(&bss->list); |
2143 | } else { | 2143 | } else { |
2144 | bss = kmalloc(sizeof (*bss), GFP_ATOMIC); | 2144 | bss = kzalloc(sizeof (*bss), GFP_ATOMIC); |
2145 | if (bss != NULL) { | 2145 | if (bss != NULL) |
2146 | priv->num_bss_wpa++; | 2146 | priv->num_bss_wpa++; |
2147 | memset(bss, 0, sizeof (*bss)); | ||
2148 | } | ||
2149 | } | 2147 | } |
2150 | if (bss != NULL) { | 2148 | if (bss != NULL) { |
2151 | memcpy(bss->bssid, bssid, ETH_ALEN); | 2149 | memcpy(bss->bssid, bssid, ETH_ALEN); |
@@ -2686,11 +2684,10 @@ prism2_ioctl_set_generic_element(struct net_device *ndev, | |||
2686 | return -EINVAL; | 2684 | return -EINVAL; |
2687 | 2685 | ||
2688 | alen = sizeof(*attach) + len; | 2686 | alen = sizeof(*attach) + len; |
2689 | attach = kmalloc(alen, GFP_KERNEL); | 2687 | attach = kzalloc(alen, GFP_KERNEL); |
2690 | if (attach == NULL) | 2688 | if (attach == NULL) |
2691 | return -ENOMEM; | 2689 | return -ENOMEM; |
2692 | 2690 | ||
2693 | memset(attach, 0, alen); | ||
2694 | #define WLAN_FC_TYPE_MGMT 0 | 2691 | #define WLAN_FC_TYPE_MGMT 0 |
2695 | #define WLAN_FC_STYPE_ASSOC_REQ 0 | 2692 | #define WLAN_FC_STYPE_ASSOC_REQ 0 |
2696 | #define WLAN_FC_STYPE_REASSOC_REQ 2 | 2693 | #define WLAN_FC_STYPE_REASSOC_REQ 2 |
diff --git a/drivers/net/wireless/prism54/oid_mgt.c b/drivers/net/wireless/prism54/oid_mgt.c index fbc52b6a3024..e6cf9df2c206 100644 --- a/drivers/net/wireless/prism54/oid_mgt.c +++ b/drivers/net/wireless/prism54/oid_mgt.c | |||
@@ -235,12 +235,10 @@ mgt_init(islpci_private *priv) | |||
235 | { | 235 | { |
236 | int i; | 236 | int i; |
237 | 237 | ||
238 | priv->mib = kmalloc(OID_NUM_LAST * sizeof (void *), GFP_KERNEL); | 238 | priv->mib = kcalloc(OID_NUM_LAST, sizeof (void *), GFP_KERNEL); |
239 | if (!priv->mib) | 239 | if (!priv->mib) |
240 | return -ENOMEM; | 240 | return -ENOMEM; |
241 | 241 | ||
242 | memset(priv->mib, 0, OID_NUM_LAST * sizeof (void *)); | ||
243 | |||
244 | /* Alloc the cache */ | 242 | /* Alloc the cache */ |
245 | for (i = 0; i < OID_NUM_LAST; i++) { | 243 | for (i = 0; i < OID_NUM_LAST; i++) { |
246 | if (isl_oid[i].flags & OID_FLAG_CACHED) { | 244 | if (isl_oid[i].flags & OID_FLAG_CACHED) { |
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c index 8be99ebbe1cd..77e11ddad836 100644 --- a/drivers/net/wireless/zd1211rw/zd_chip.c +++ b/drivers/net/wireless/zd1211rw/zd_chip.c | |||
@@ -1673,3 +1673,16 @@ int zd_rfwritev_cr_locked(struct zd_chip *chip, | |||
1673 | 1673 | ||
1674 | return 0; | 1674 | return 0; |
1675 | } | 1675 | } |
1676 | |||
1677 | int zd_chip_set_multicast_hash(struct zd_chip *chip, | ||
1678 | struct zd_mc_hash *hash) | ||
1679 | { | ||
1680 | struct zd_ioreq32 ioreqs[] = { | ||
1681 | { CR_GROUP_HASH_P1, hash->low }, | ||
1682 | { CR_GROUP_HASH_P2, hash->high }, | ||
1683 | }; | ||
1684 | |||
1685 | dev_dbg_f(zd_chip_dev(chip), "hash l 0x%08x h 0x%08x\n", | ||
1686 | ioreqs[0].value, ioreqs[1].value); | ||
1687 | return zd_iowrite32a(chip, ioreqs, ARRAY_SIZE(ioreqs)); | ||
1688 | } | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.h b/drivers/net/wireless/zd1211rw/zd_chip.h index ca892b9a6448..a4e3cee9b59d 100644 --- a/drivers/net/wireless/zd1211rw/zd_chip.h +++ b/drivers/net/wireless/zd1211rw/zd_chip.h | |||
@@ -390,10 +390,19 @@ | |||
390 | #define CR_BSSID_P1 CTL_REG(0x0618) | 390 | #define CR_BSSID_P1 CTL_REG(0x0618) |
391 | #define CR_BSSID_P2 CTL_REG(0x061C) | 391 | #define CR_BSSID_P2 CTL_REG(0x061C) |
392 | #define CR_BCN_PLCP_CFG CTL_REG(0x0620) | 392 | #define CR_BCN_PLCP_CFG CTL_REG(0x0620) |
393 | |||
394 | /* Group hash table for filtering incoming packets. | ||
395 | * | ||
396 | * The group hash table is 64 bit large and split over two parts. The first | ||
397 | * part is the lower part. The upper 6 bits of the last byte of the target | ||
398 | * address are used as index. Packets are received if the hash table bit is | ||
399 | * set. This is used for multicast handling, but for broadcasts (address | ||
400 | * ff:ff:ff:ff:ff:ff) the highest bit in the second table must also be set. | ||
401 | */ | ||
393 | #define CR_GROUP_HASH_P1 CTL_REG(0x0624) | 402 | #define CR_GROUP_HASH_P1 CTL_REG(0x0624) |
394 | #define CR_GROUP_HASH_P2 CTL_REG(0x0628) | 403 | #define CR_GROUP_HASH_P2 CTL_REG(0x0628) |
395 | #define CR_RX_TIMEOUT CTL_REG(0x062C) | ||
396 | 404 | ||
405 | #define CR_RX_TIMEOUT CTL_REG(0x062C) | ||
397 | /* Basic rates supported by the BSS. When producing ACK or CTS messages, the | 406 | /* Basic rates supported by the BSS. When producing ACK or CTS messages, the |
398 | * device will use a rate in this table that is less than or equal to the rate | 407 | * device will use a rate in this table that is less than or equal to the rate |
399 | * of the incoming frame which prompted the response */ | 408 | * of the incoming frame which prompted the response */ |
@@ -864,4 +873,36 @@ u8 zd_rx_strength_percent(u8 rssi); | |||
864 | 873 | ||
865 | u16 zd_rx_rate(const void *rx_frame, const struct rx_status *status); | 874 | u16 zd_rx_rate(const void *rx_frame, const struct rx_status *status); |
866 | 875 | ||
876 | struct zd_mc_hash { | ||
877 | u32 low; | ||
878 | u32 high; | ||
879 | }; | ||
880 | |||
881 | static inline void zd_mc_clear(struct zd_mc_hash *hash) | ||
882 | { | ||
883 | hash->low = 0; | ||
884 | /* The interfaces must always received broadcasts. | ||
885 | * The hash of the broadcast address ff:ff:ff:ff:ff:ff is 63. | ||
886 | */ | ||
887 | hash->high = 0x80000000; | ||
888 | } | ||
889 | |||
890 | static inline void zd_mc_add_all(struct zd_mc_hash *hash) | ||
891 | { | ||
892 | hash->low = hash->high = 0xffffffff; | ||
893 | } | ||
894 | |||
895 | static inline void zd_mc_add_addr(struct zd_mc_hash *hash, u8 *addr) | ||
896 | { | ||
897 | unsigned int i = addr[5] >> 2; | ||
898 | if (i < 32) { | ||
899 | hash->low |= 1 << i; | ||
900 | } else { | ||
901 | hash->high |= 1 << (i-32); | ||
902 | } | ||
903 | } | ||
904 | |||
905 | int zd_chip_set_multicast_hash(struct zd_chip *chip, | ||
906 | struct zd_mc_hash *hash); | ||
907 | |||
867 | #endif /* _ZD_CHIP_H */ | 908 | #endif /* _ZD_CHIP_H */ |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index f1573a9c2336..61c7916b7656 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -39,6 +39,8 @@ static void housekeeping_init(struct zd_mac *mac); | |||
39 | static void housekeeping_enable(struct zd_mac *mac); | 39 | static void housekeeping_enable(struct zd_mac *mac); |
40 | static void housekeeping_disable(struct zd_mac *mac); | 40 | static void housekeeping_disable(struct zd_mac *mac); |
41 | 41 | ||
42 | static void set_multicast_hash_handler(void *mac_ptr); | ||
43 | |||
42 | int zd_mac_init(struct zd_mac *mac, | 44 | int zd_mac_init(struct zd_mac *mac, |
43 | struct net_device *netdev, | 45 | struct net_device *netdev, |
44 | struct usb_interface *intf) | 46 | struct usb_interface *intf) |
@@ -55,6 +57,8 @@ int zd_mac_init(struct zd_mac *mac, | |||
55 | softmac_init(ieee80211_priv(netdev)); | 57 | softmac_init(ieee80211_priv(netdev)); |
56 | zd_chip_init(&mac->chip, netdev, intf); | 58 | zd_chip_init(&mac->chip, netdev, intf); |
57 | housekeeping_init(mac); | 59 | housekeeping_init(mac); |
60 | INIT_WORK(&mac->set_multicast_hash_work, set_multicast_hash_handler, | ||
61 | mac); | ||
58 | return 0; | 62 | return 0; |
59 | } | 63 | } |
60 | 64 | ||
@@ -136,6 +140,7 @@ out: | |||
136 | 140 | ||
137 | void zd_mac_clear(struct zd_mac *mac) | 141 | void zd_mac_clear(struct zd_mac *mac) |
138 | { | 142 | { |
143 | flush_workqueue(zd_workqueue); | ||
139 | zd_chip_clear(&mac->chip); | 144 | zd_chip_clear(&mac->chip); |
140 | ZD_ASSERT(!spin_is_locked(&mac->lock)); | 145 | ZD_ASSERT(!spin_is_locked(&mac->lock)); |
141 | ZD_MEMCLEAR(mac, sizeof(struct zd_mac)); | 146 | ZD_MEMCLEAR(mac, sizeof(struct zd_mac)); |
@@ -256,6 +261,42 @@ int zd_mac_set_mac_address(struct net_device *netdev, void *p) | |||
256 | return 0; | 261 | return 0; |
257 | } | 262 | } |
258 | 263 | ||
264 | static void set_multicast_hash_handler(void *mac_ptr) | ||
265 | { | ||
266 | struct zd_mac *mac = mac_ptr; | ||
267 | struct zd_mc_hash hash; | ||
268 | |||
269 | spin_lock_irq(&mac->lock); | ||
270 | hash = mac->multicast_hash; | ||
271 | spin_unlock_irq(&mac->lock); | ||
272 | |||
273 | zd_chip_set_multicast_hash(&mac->chip, &hash); | ||
274 | } | ||
275 | |||
276 | void zd_mac_set_multicast_list(struct net_device *dev) | ||
277 | { | ||
278 | struct zd_mc_hash hash; | ||
279 | struct zd_mac *mac = zd_netdev_mac(dev); | ||
280 | struct dev_mc_list *mc; | ||
281 | unsigned long flags; | ||
282 | |||
283 | if (dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) { | ||
284 | zd_mc_add_all(&hash); | ||
285 | } else { | ||
286 | zd_mc_clear(&hash); | ||
287 | for (mc = dev->mc_list; mc; mc = mc->next) { | ||
288 | dev_dbg_f(zd_mac_dev(mac), "mc addr " MAC_FMT "\n", | ||
289 | MAC_ARG(mc->dmi_addr)); | ||
290 | zd_mc_add_addr(&hash, mc->dmi_addr); | ||
291 | } | ||
292 | } | ||
293 | |||
294 | spin_lock_irqsave(&mac->lock, flags); | ||
295 | mac->multicast_hash = hash; | ||
296 | spin_unlock_irqrestore(&mac->lock, flags); | ||
297 | queue_work(zd_workqueue, &mac->set_multicast_hash_work); | ||
298 | } | ||
299 | |||
259 | int zd_mac_set_regdomain(struct zd_mac *mac, u8 regdomain) | 300 | int zd_mac_set_regdomain(struct zd_mac *mac, u8 regdomain) |
260 | { | 301 | { |
261 | int r; | 302 | int r; |
@@ -618,6 +659,9 @@ int zd_mac_get_range(struct zd_mac *mac, struct iw_range *range) | |||
618 | range->we_version_compiled = WIRELESS_EXT; | 659 | range->we_version_compiled = WIRELESS_EXT; |
619 | range->we_version_source = 20; | 660 | range->we_version_source = 20; |
620 | 661 | ||
662 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | | ||
663 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; | ||
664 | |||
621 | ZD_ASSERT(!irqs_disabled()); | 665 | ZD_ASSERT(!irqs_disabled()); |
622 | spin_lock_irq(&mac->lock); | 666 | spin_lock_irq(&mac->lock); |
623 | regdomain = mac->regdomain; | 667 | regdomain = mac->regdomain; |
@@ -930,7 +974,8 @@ static int is_data_packet_for_us(struct ieee80211_device *ieee, | |||
930 | } | 974 | } |
931 | 975 | ||
932 | return memcmp(hdr->addr1, netdev->dev_addr, ETH_ALEN) == 0 || | 976 | return memcmp(hdr->addr1, netdev->dev_addr, ETH_ALEN) == 0 || |
933 | is_multicast_ether_addr(hdr->addr1) || | 977 | (is_multicast_ether_addr(hdr->addr1) && |
978 | memcmp(hdr->addr3, netdev->dev_addr, ETH_ALEN) != 0) || | ||
934 | (netdev->flags & IFF_PROMISC); | 979 | (netdev->flags & IFF_PROMISC); |
935 | } | 980 | } |
936 | 981 | ||
@@ -1062,10 +1107,8 @@ int zd_mac_rx(struct zd_mac *mac, const u8 *buffer, unsigned int length) | |||
1062 | memcpy(skb_put(skb, length), buffer, length); | 1107 | memcpy(skb_put(skb, length), buffer, length); |
1063 | 1108 | ||
1064 | r = ieee80211_rx(ieee, skb, &stats); | 1109 | r = ieee80211_rx(ieee, skb, &stats); |
1065 | if (!r) { | 1110 | if (!r) |
1066 | ZD_ASSERT(in_irq()); | 1111 | dev_kfree_skb_any(skb); |
1067 | dev_kfree_skb_irq(skb); | ||
1068 | } | ||
1069 | return 0; | 1112 | return 0; |
1070 | } | 1113 | } |
1071 | 1114 | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h index d4e8b870409d..f0cf05dc7d3e 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.h +++ b/drivers/net/wireless/zd1211rw/zd_mac.h | |||
@@ -133,6 +133,8 @@ struct zd_mac { | |||
133 | struct iw_statistics iw_stats; | 133 | struct iw_statistics iw_stats; |
134 | 134 | ||
135 | struct housekeeping housekeeping; | 135 | struct housekeeping housekeeping; |
136 | struct work_struct set_multicast_hash_work; | ||
137 | struct zd_mc_hash multicast_hash; | ||
136 | struct delayed_work set_rts_cts_work; | 138 | struct delayed_work set_rts_cts_work; |
137 | struct delayed_work set_basic_rates_work; | 139 | struct delayed_work set_basic_rates_work; |
138 | 140 | ||
@@ -189,6 +191,7 @@ int zd_mac_init_hw(struct zd_mac *mac, u8 device_type); | |||
189 | int zd_mac_open(struct net_device *netdev); | 191 | int zd_mac_open(struct net_device *netdev); |
190 | int zd_mac_stop(struct net_device *netdev); | 192 | int zd_mac_stop(struct net_device *netdev); |
191 | int zd_mac_set_mac_address(struct net_device *dev, void *p); | 193 | int zd_mac_set_mac_address(struct net_device *dev, void *p); |
194 | void zd_mac_set_multicast_list(struct net_device *netdev); | ||
192 | 195 | ||
193 | int zd_mac_rx(struct zd_mac *mac, const u8 *buffer, unsigned int length); | 196 | int zd_mac_rx(struct zd_mac *mac, const u8 *buffer, unsigned int length); |
194 | 197 | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_netdev.c b/drivers/net/wireless/zd1211rw/zd_netdev.c index 60f1b0f6d45b..8bda48de31ef 100644 --- a/drivers/net/wireless/zd1211rw/zd_netdev.c +++ b/drivers/net/wireless/zd1211rw/zd_netdev.c | |||
@@ -242,7 +242,7 @@ struct net_device *zd_netdev_alloc(struct usb_interface *intf) | |||
242 | netdev->open = zd_mac_open; | 242 | netdev->open = zd_mac_open; |
243 | netdev->stop = zd_mac_stop; | 243 | netdev->stop = zd_mac_stop; |
244 | /* netdev->get_stats = */ | 244 | /* netdev->get_stats = */ |
245 | /* netdev->set_multicast_list = */ | 245 | netdev->set_multicast_list = zd_mac_set_multicast_list; |
246 | netdev->set_mac_address = zd_mac_set_mac_address; | 246 | netdev->set_mac_address = zd_mac_set_mac_address; |
247 | netdev->wireless_handlers = &iw_handler_def; | 247 | netdev->wireless_handlers = &iw_handler_def; |
248 | /* netdev->ethtool_ops = */ | 248 | /* netdev->ethtool_ops = */ |