aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap/hostap_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_hw.c')
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index ed00ebb6e7f4..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;
@@ -1645,9 +1641,9 @@ static void prism2_schedule_reset(local_info_t *local)
1645 1641
1646/* Called only as scheduled task after noticing card timeout in interrupt 1642/* Called only as scheduled task after noticing card timeout in interrupt
1647 * context */ 1643 * context */
1648static void handle_reset_queue(void *data) 1644static void handle_reset_queue(struct work_struct *work)
1649{ 1645{
1650 local_info_t *local = (local_info_t *) data; 1646 local_info_t *local = container_of(work, local_info_t, reset_queue);
1651 1647
1652 printk(KERN_DEBUG "%s: scheduled card reset\n", local->dev->name); 1648 printk(KERN_DEBUG "%s: scheduled card reset\n", local->dev->name);
1653 prism2_hw_reset(local->dev); 1649 prism2_hw_reset(local->dev);
@@ -2896,9 +2892,10 @@ static void hostap_passive_scan(unsigned long data)
2896 2892
2897/* Called only as a scheduled task when communications quality values should 2893/* Called only as a scheduled task when communications quality values should
2898 * be updated. */ 2894 * be updated. */
2899static void handle_comms_qual_update(void *data) 2895static void handle_comms_qual_update(struct work_struct *work)
2900{ 2896{
2901 local_info_t *local = data; 2897 local_info_t *local =
2898 container_of(work, local_info_t, comms_qual_update);
2902 prism2_update_comms_qual(local->dev); 2899 prism2_update_comms_qual(local->dev);
2903} 2900}
2904 2901
@@ -3015,14 +3012,12 @@ static int prism2_set_tim(struct net_device *dev, int aid, int set)
3015 iface = netdev_priv(dev); 3012 iface = netdev_priv(dev);
3016 local = iface->local; 3013 local = iface->local;
3017 3014
3018 new_entry = (struct set_tim_data *) 3015 new_entry = kzalloc(sizeof(*new_entry), GFP_ATOMIC);
3019 kmalloc(sizeof(*new_entry), GFP_ATOMIC);
3020 if (new_entry == NULL) { 3016 if (new_entry == NULL) {
3021 printk(KERN_DEBUG "%s: prism2_set_tim: kmalloc failed\n", 3017 printk(KERN_DEBUG "%s: prism2_set_tim: kmalloc failed\n",
3022 local->dev->name); 3018 local->dev->name);
3023 return -ENOMEM; 3019 return -ENOMEM;
3024 } 3020 }
3025 memset(new_entry, 0, sizeof(*new_entry));
3026 new_entry->aid = aid; 3021 new_entry->aid = aid;
3027 new_entry->set = set; 3022 new_entry->set = set;
3028 3023
@@ -3050,9 +3045,9 @@ static int prism2_set_tim(struct net_device *dev, int aid, int set)
3050} 3045}
3051 3046
3052 3047
3053static void handle_set_tim_queue(void *data) 3048static void handle_set_tim_queue(struct work_struct *work)
3054{ 3049{
3055 local_info_t *local = (local_info_t *) data; 3050 local_info_t *local = container_of(work, local_info_t, set_tim_queue);
3056 struct set_tim_data *entry; 3051 struct set_tim_data *entry;
3057 u16 val; 3052 u16 val;
3058 3053
@@ -3209,15 +3204,15 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
3209 local->scan_channel_mask = 0xffff; 3204 local->scan_channel_mask = 0xffff;
3210 3205
3211 /* Initialize task queue structures */ 3206 /* Initialize task queue structures */
3212 INIT_WORK(&local->reset_queue, handle_reset_queue, local); 3207 INIT_WORK(&local->reset_queue, handle_reset_queue);
3213 INIT_WORK(&local->set_multicast_list_queue, 3208 INIT_WORK(&local->set_multicast_list_queue,
3214 hostap_set_multicast_list_queue, local->dev); 3209 hostap_set_multicast_list_queue);
3215 3210
3216 INIT_WORK(&local->set_tim_queue, handle_set_tim_queue, local); 3211 INIT_WORK(&local->set_tim_queue, handle_set_tim_queue);
3217 INIT_LIST_HEAD(&local->set_tim_list); 3212 INIT_LIST_HEAD(&local->set_tim_list);
3218 spin_lock_init(&local->set_tim_lock); 3213 spin_lock_init(&local->set_tim_lock);
3219 3214
3220 INIT_WORK(&local->comms_qual_update, handle_comms_qual_update, local); 3215 INIT_WORK(&local->comms_qual_update, handle_comms_qual_update);
3221 3216
3222 /* Initialize tasklets for handling hardware IRQ related operations 3217 /* Initialize tasklets for handling hardware IRQ related operations
3223 * outside hw IRQ handler */ 3218 * outside hw IRQ handler */