debug: remove roaming events
[pandora-wifi.git] / patches / 19-kfifo.patch
1 These parts of the new generic kernel FIFO implementation (kfifo) can
2 not be backported easily with defines in the compat module.
3
4 --- a/drivers/net/wireless/libertas/dev.h
5 +++ b/drivers/net/wireless/libertas/dev.h
6 @@ -118,7 +118,11 @@ struct lbs_private {
7         u32 resp_len[2];
8  
9         /* Events sent from hardware to driver */
10 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
11         struct kfifo event_fifo;
12 +#else
13 +       struct kfifo *event_fifo;
14 +#endif
15  
16         /** thread to service interrupts */
17         struct task_struct *main_thread;
18 --- a/drivers/net/wireless/libertas/main.c
19 +++ b/drivers/net/wireless/libertas/main.c
20 @@ -855,8 +855,14 @@ static int lbs_init_adapter(struct lbs_p
21         priv->resp_len[0] = priv->resp_len[1] = 0;
22  
23         /* Create the event FIFO */
24 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
25         ret = kfifo_alloc(&priv->event_fifo, sizeof(u32) * 16, GFP_KERNEL);
26         if (ret) {
27 +#else
28 +       priv->event_fifo = kfifo_alloc(sizeof(u32) * 16, GFP_KERNEL, NULL);
29 +       if (IS_ERR(priv->event_fifo)) {
30 +               ret = -ENOMEM;
31 +#endif
32                 lbs_pr_err("Out of memory allocating event FIFO buffer\n");
33                 goto out;
34         }
35 @@ -872,7 +878,12 @@ static void lbs_free_adapter(struct lbs_
36         lbs_deb_enter(LBS_DEB_MAIN);
37  
38         lbs_free_cmd_buffer(priv);
39 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
40         kfifo_free(&priv->event_fifo);
41 +#else
42 +       if (priv->event_fifo)
43 +               kfifo_free(priv->event_fifo);
44 +#endif
45         del_timer(&priv->command_timer);
46         del_timer(&priv->auto_deepsleep_timer);
47         kfree(priv->networks);