hostap: Add fixes so it builds correctly for kernels > 2.6.13
authorRichard Purdie <rpurdie@rpsys.net>
Sun, 18 Sep 2005 13:35:19 +0000 (13:35 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Sun, 18 Sep 2005 13:35:19 +0000 (13:35 +0000)
packages/hostap/hostap-modules-0.4.4/kernel_updates.patch [new file with mode: 0644]

diff --git a/packages/hostap/hostap-modules-0.4.4/kernel_updates.patch b/packages/hostap/hostap-modules-0.4.4/kernel_updates.patch
new file mode 100644 (file)
index 0000000..aa8ba3e
--- /dev/null
@@ -0,0 +1,192 @@
+Index: hostap-driver-0.4.4/driver/modules/hostap_cs.c
+===================================================================
+--- hostap-driver-0.4.4.orig/driver/modules/hostap_cs.c        2005-08-21 20:23:21.000000000 +0100
++++ hostap-driver-0.4.4/driver/modules/hostap_cs.c     2005-09-17 17:09:05.000000000 +0100
+@@ -207,12 +207,17 @@
+ #include "hostap_hw.c"
+-
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+ static void prism2_detach(dev_link_t *link);
++#else
++static void prism2_detach(struct pcmcia_device *p_dev);
++#endif
++
+ static void prism2_release(u_long arg);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+ static int prism2_event(event_t event, int priority,
+                       event_callback_args_t *args);
+-
++#endif
+ static int prism2_pccard_card_present(local_info_t *local)
+ {
+@@ -508,25 +513,36 @@
+ }
+ #endif
++static int prism2_config(dev_link_t *link);
+ /* allocate local data and register with CardServices
+  * initialize dev_link structure, but do not configure the card yet */
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+ static dev_link_t *prism2_attach(void)
++#else
++static int prism2_attach(struct pcmcia_device *p_dev)
++#endif
+ {
+       dev_link_t *link;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+       client_reg_t client_reg;
+       int ret;
++#endif
+       link = kmalloc(sizeof(dev_link_t), GFP_KERNEL);
+       if (link == NULL)
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+               return NULL;
+-
++#else
++              return -ENOMEM;
++#endif
+       memset(link, 0, sizeof(dev_link_t));
+       PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info);
+       link->conf.Vcc = 33;
+       link->conf.IntType = INT_MEMORY_AND_IO;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+       /* register with CardServices */
+       link->next = dev_list;
+       dev_list = link;
+@@ -547,12 +563,28 @@
+               prism2_detach(link);
+               return NULL;
+       }
++
+       return link;
+-}
++#else
++      link->handle = p_dev;
++      p_dev->instance = link;
++
++      link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
++      prism2_config(link);
++      return 0;
++#endif
++}
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+ static void prism2_detach(dev_link_t *link)
++#else
++static void prism2_detach(struct pcmcia_device *p_dev)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
++      dev_link_t *link = dev_to_instance(p_dev);
++#endif
+       dev_link_t **linkp;
+       PDEBUG(DEBUG_FLOW, "prism2_detach\n");
+@@ -570,6 +602,7 @@
+               prism2_release((u_long)link);
+       }
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+       if (link->handle) {
+               int res = pcmcia_deregister_client(link->handle);
+               if (res) {
+@@ -577,6 +610,7 @@
+                       cs_error(link->handle, DeregisterClient, res);
+               }
+       }
++#endif
+       *linkp = link->next;
+       /* release net devices */
+@@ -855,7 +889,53 @@
+       PDEBUG(DEBUG_FLOW, "release - done\n");
+ }
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
++static int prism2_suspend1(struct pcmcia_device *dev)
++{
++      dev_link_t *link = dev_to_instance(dev);
++      struct net_device *ndev = (struct net_device *) link->priv;
++
++      PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info);
++      link->state |= DEV_SUSPEND;
++      /* fall through */
++      if (link->state & DEV_CONFIG) {
++              if (link->open) {
++                      netif_stop_queue(ndev);
++                      netif_device_detach(ndev);
++              }
++              prism2_suspend(ndev);
++              pcmcia_release_configuration(link->handle);
++      }
++
++      return 0;
++}
++
++static int prism2_resume1(struct pcmcia_device *dev)
++{
++      dev_link_t *link = dev_to_instance(dev);
++      struct net_device *ndev = (struct net_device *) link->priv;
++
++      PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info);
++
++      link->state &= ~DEV_SUSPEND;
++      /* fall through */
++
++      if (link->state & DEV_CONFIG) {
++              pcmcia_request_configuration(link->handle, &link->conf);
++              prism2_hw_shutdown(ndev, 1);
++              prism2_hw_config(ndev, link->open ? 0 : 1);
++              if (link->open) {
++                      netif_device_attach(ndev);
++                      netif_start_queue(ndev);
++              }
++      }
++
++      return 0;
++}
++#endif
++
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+ static int prism2_event(event_t event, int priority,
+                       event_callback_args_t *args)
+ {
+@@ -924,7 +1004,7 @@
+       }
+       return 0;
+ }
+-
++#endif
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,67)
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13))
+@@ -983,11 +1063,20 @@
+       .drv            = {
+               .name   = "hostap_cs",
+       },
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
++      .probe          = prism2_attach,
++      .remove         = prism2_detach,
++      .suspend        = prism2_suspend1,
++      .resume         = prism2_resume1,
++#else
+       .attach         = prism2_attach,
+       .detach         = prism2_detach,
++#endif
+       .owner          = THIS_MODULE,
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13))
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
+       .event          = prism2_event,
++#endif
+       .id_table       = hostap_cs_ids,
+ #endif
+ };