diff options
Diffstat (limited to 'openembedded/packages/hostap/hostap-modules/kernel_updates.patch')
| -rw-r--r-- | openembedded/packages/hostap/hostap-modules/kernel_updates.patch | 192 |
1 files changed, 192 insertions, 0 deletions
diff --git a/openembedded/packages/hostap/hostap-modules/kernel_updates.patch b/openembedded/packages/hostap/hostap-modules/kernel_updates.patch new file mode 100644 index 0000000000..70487a96f8 --- /dev/null +++ b/openembedded/packages/hostap/hostap-modules/kernel_updates.patch | |||
| @@ -0,0 +1,192 @@ | |||
| 1 | Index: hostap-driver-0.4.4/driver/modules/hostap_cs.c | ||
| 2 | =================================================================== | ||
| 3 | --- hostap-driver-0.4.4.orig/driver/modules/hostap_cs.c 2005-08-21 20:23:21.000000000 +0100 | ||
| 4 | +++ hostap-driver-0.4.4/driver/modules/hostap_cs.c 2005-09-17 17:09:05.000000000 +0100 | ||
| 5 | @@ -207,12 +207,17 @@ | ||
| 6 | #include "hostap_hw.c" | ||
| 7 | |||
| 8 | |||
| 9 | - | ||
| 10 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 11 | static void prism2_detach(dev_link_t *link); | ||
| 12 | +#else | ||
| 13 | +static void prism2_detach(struct pcmcia_device *p_dev); | ||
| 14 | +#endif | ||
| 15 | + | ||
| 16 | static void prism2_release(u_long arg); | ||
| 17 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 18 | static int prism2_event(event_t event, int priority, | ||
| 19 | event_callback_args_t *args); | ||
| 20 | - | ||
| 21 | +#endif | ||
| 22 | |||
| 23 | static int prism2_pccard_card_present(local_info_t *local) | ||
| 24 | { | ||
| 25 | @@ -508,25 +513,36 @@ | ||
| 26 | } | ||
| 27 | #endif | ||
| 28 | |||
| 29 | +static int prism2_config(dev_link_t *link); | ||
| 30 | |||
| 31 | /* allocate local data and register with CardServices | ||
| 32 | * initialize dev_link structure, but do not configure the card yet */ | ||
| 33 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 34 | static dev_link_t *prism2_attach(void) | ||
| 35 | +#else | ||
| 36 | +static int prism2_attach(struct pcmcia_device *p_dev) | ||
| 37 | +#endif | ||
| 38 | { | ||
| 39 | dev_link_t *link; | ||
| 40 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 41 | client_reg_t client_reg; | ||
| 42 | int ret; | ||
| 43 | +#endif | ||
| 44 | |||
| 45 | link = kmalloc(sizeof(dev_link_t), GFP_KERNEL); | ||
| 46 | if (link == NULL) | ||
| 47 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 48 | return NULL; | ||
| 49 | - | ||
| 50 | +#else | ||
| 51 | + return -ENOMEM; | ||
| 52 | +#endif | ||
| 53 | memset(link, 0, sizeof(dev_link_t)); | ||
| 54 | |||
| 55 | PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info); | ||
| 56 | link->conf.Vcc = 33; | ||
| 57 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
| 58 | |||
| 59 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 60 | /* register with CardServices */ | ||
| 61 | link->next = dev_list; | ||
| 62 | dev_list = link; | ||
| 63 | @@ -547,12 +563,28 @@ | ||
| 64 | prism2_detach(link); | ||
| 65 | return NULL; | ||
| 66 | } | ||
| 67 | + | ||
| 68 | return link; | ||
| 69 | -} | ||
| 70 | +#else | ||
| 71 | + link->handle = p_dev; | ||
| 72 | + p_dev->instance = link; | ||
| 73 | + | ||
| 74 | + link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
| 75 | + prism2_config(link); | ||
| 76 | |||
| 77 | + return 0; | ||
| 78 | +#endif | ||
| 79 | +} | ||
| 80 | |||
| 81 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 82 | static void prism2_detach(dev_link_t *link) | ||
| 83 | +#else | ||
| 84 | +static void prism2_detach(struct pcmcia_device *p_dev) | ||
| 85 | +#endif | ||
| 86 | { | ||
| 87 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) | ||
| 88 | + dev_link_t *link = dev_to_instance(p_dev); | ||
| 89 | +#endif | ||
| 90 | dev_link_t **linkp; | ||
| 91 | |||
| 92 | PDEBUG(DEBUG_FLOW, "prism2_detach\n"); | ||
| 93 | @@ -570,6 +602,7 @@ | ||
| 94 | prism2_release((u_long)link); | ||
| 95 | } | ||
| 96 | |||
| 97 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 98 | if (link->handle) { | ||
| 99 | int res = pcmcia_deregister_client(link->handle); | ||
| 100 | if (res) { | ||
| 101 | @@ -577,6 +610,7 @@ | ||
| 102 | cs_error(link->handle, DeregisterClient, res); | ||
| 103 | } | ||
| 104 | } | ||
| 105 | +#endif | ||
| 106 | |||
| 107 | *linkp = link->next; | ||
| 108 | /* release net devices */ | ||
| 109 | @@ -855,7 +889,53 @@ | ||
| 110 | PDEBUG(DEBUG_FLOW, "release - done\n"); | ||
| 111 | } | ||
| 112 | |||
| 113 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) | ||
| 114 | +static int prism2_suspend1(struct pcmcia_device *dev) | ||
| 115 | +{ | ||
| 116 | + dev_link_t *link = dev_to_instance(dev); | ||
| 117 | + struct net_device *ndev = (struct net_device *) link->priv; | ||
| 118 | + | ||
| 119 | + PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info); | ||
| 120 | + link->state |= DEV_SUSPEND; | ||
| 121 | + /* fall through */ | ||
| 122 | |||
| 123 | + if (link->state & DEV_CONFIG) { | ||
| 124 | + if (link->open) { | ||
| 125 | + netif_stop_queue(ndev); | ||
| 126 | + netif_device_detach(ndev); | ||
| 127 | + } | ||
| 128 | + prism2_suspend(ndev); | ||
| 129 | + pcmcia_release_configuration(link->handle); | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + return 0; | ||
| 133 | +} | ||
| 134 | + | ||
| 135 | +static int prism2_resume1(struct pcmcia_device *dev) | ||
| 136 | +{ | ||
| 137 | + dev_link_t *link = dev_to_instance(dev); | ||
| 138 | + struct net_device *ndev = (struct net_device *) link->priv; | ||
| 139 | + | ||
| 140 | + PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info); | ||
| 141 | + | ||
| 142 | + link->state &= ~DEV_SUSPEND; | ||
| 143 | + /* fall through */ | ||
| 144 | + | ||
| 145 | + if (link->state & DEV_CONFIG) { | ||
| 146 | + pcmcia_request_configuration(link->handle, &link->conf); | ||
| 147 | + prism2_hw_shutdown(ndev, 1); | ||
| 148 | + prism2_hw_config(ndev, link->open ? 0 : 1); | ||
| 149 | + if (link->open) { | ||
| 150 | + netif_device_attach(ndev); | ||
| 151 | + netif_start_queue(ndev); | ||
| 152 | + } | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + return 0; | ||
| 156 | +} | ||
| 157 | +#endif | ||
| 158 | + | ||
| 159 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 160 | static int prism2_event(event_t event, int priority, | ||
| 161 | event_callback_args_t *args) | ||
| 162 | { | ||
| 163 | @@ -924,7 +1004,7 @@ | ||
| 164 | } | ||
| 165 | return 0; | ||
| 166 | } | ||
| 167 | - | ||
| 168 | +#endif | ||
| 169 | |||
| 170 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,67) | ||
| 171 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)) | ||
| 172 | @@ -983,11 +1063,20 @@ | ||
| 173 | .drv = { | ||
| 174 | .name = "hostap_cs", | ||
| 175 | }, | ||
| 176 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) | ||
| 177 | + .probe = prism2_attach, | ||
| 178 | + .remove = prism2_detach, | ||
| 179 | + .suspend = prism2_suspend1, | ||
| 180 | + .resume = prism2_resume1, | ||
| 181 | +#else | ||
| 182 | .attach = prism2_attach, | ||
| 183 | .detach = prism2_detach, | ||
| 184 | +#endif | ||
| 185 | .owner = THIS_MODULE, | ||
| 186 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)) | ||
| 187 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)) | ||
| 188 | .event = prism2_event, | ||
| 189 | +#endif | ||
| 190 | .id_table = hostap_cs_ids, | ||
| 191 | #endif | ||
| 192 | }; | ||
