David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 1 | /* |
| 2 | * IPWireless 3G PCMCIA Network Driver |
| 3 | * |
| 4 | * Original code |
| 5 | * by Stephen Blackheath <stephen@blacksapphire.com>, |
| 6 | * Ben Martel <benm@symmetric.co.nz> |
| 7 | * |
| 8 | * Copyrighted as follows: |
| 9 | * Copyright (C) 2004 by Symmetric Systems Ltd (NZ) |
| 10 | * |
| 11 | * Various driver changes and rewrites, port to new kernels |
| 12 | * Copyright (C) 2006-2007 Jiri Kosina |
| 13 | * |
| 14 | * Misc code cleanups and updates |
| 15 | * Copyright (C) 2007 David Sterba |
| 16 | */ |
| 17 | |
| 18 | #include "hardware.h" |
| 19 | #include "network.h" |
| 20 | #include "main.h" |
| 21 | #include "tty.h" |
| 22 | |
| 23 | #include <linux/delay.h> |
| 24 | #include <linux/init.h> |
| 25 | #include <linux/io.h> |
| 26 | #include <linux/kernel.h> |
| 27 | #include <linux/module.h> |
| 28 | #include <linux/sched.h> |
| 29 | #include <linux/slab.h> |
| 30 | |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 31 | #include <pcmcia/cisreg.h> |
| 32 | #include <pcmcia/device_id.h> |
| 33 | #include <pcmcia/ss.h> |
| 34 | #include <pcmcia/ds.h> |
| 35 | #include <pcmcia/cs.h> |
| 36 | |
| 37 | static struct pcmcia_device_id ipw_ids[] = { |
| 38 | PCMCIA_DEVICE_MANF_CARD(0x02f2, 0x0100), |
| 39 | PCMCIA_DEVICE_MANF_CARD(0x02f2, 0x0200), |
| 40 | PCMCIA_DEVICE_NULL |
| 41 | }; |
| 42 | MODULE_DEVICE_TABLE(pcmcia, ipw_ids); |
| 43 | |
| 44 | static void ipwireless_detach(struct pcmcia_device *link); |
| 45 | |
| 46 | /* |
| 47 | * Module params |
| 48 | */ |
| 49 | /* Debug mode: more verbose, print sent/recv bytes */ |
| 50 | int ipwireless_debug; |
| 51 | int ipwireless_loopback; |
David Sterba | bee9c7c | 2008-07-28 16:53:21 +0200 | [diff] [blame] | 52 | int ipwireless_out_queue = 10; |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 53 | |
| 54 | module_param_named(debug, ipwireless_debug, int, 0); |
| 55 | module_param_named(loopback, ipwireless_loopback, int, 0); |
| 56 | module_param_named(out_queue, ipwireless_out_queue, int, 0); |
| 57 | MODULE_PARM_DESC(debug, "switch on debug messages [0]"); |
| 58 | MODULE_PARM_DESC(loopback, |
| 59 | "debug: enable ras_raw channel [0]"); |
David Sterba | bee9c7c | 2008-07-28 16:53:21 +0200 | [diff] [blame] | 60 | MODULE_PARM_DESC(out_queue, "debug: set size of outgoing PPP queue [10]"); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 61 | |
| 62 | /* Executes in process context. */ |
| 63 | static void signalled_reboot_work(struct work_struct *work_reboot) |
| 64 | { |
| 65 | struct ipw_dev *ipw = container_of(work_reboot, struct ipw_dev, |
| 66 | work_reboot); |
| 67 | struct pcmcia_device *link = ipw->link; |
Dominik Brodowski | cbf624f | 2009-10-24 15:47:29 +0200 | [diff] [blame^] | 68 | pcmcia_reset_card(link->socket); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | static void signalled_reboot_callback(void *callback_data) |
| 72 | { |
| 73 | struct ipw_dev *ipw = (struct ipw_dev *) callback_data; |
| 74 | |
| 75 | /* Delegate to process context. */ |
| 76 | schedule_work(&ipw->work_reboot); |
| 77 | } |
| 78 | |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 79 | static int ipwireless_probe(struct pcmcia_device *p_dev, |
| 80 | cistpl_cftable_entry_t *cfg, |
| 81 | cistpl_cftable_entry_t *dflt, |
| 82 | unsigned int vcc, |
| 83 | void *priv_data) |
Dominik Brodowski | aaa8cfd | 2009-10-18 18:28:39 +0200 | [diff] [blame] | 84 | { |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 85 | struct ipw_dev *ipw = priv_data; |
| 86 | struct resource *io_resource; |
| 87 | memreq_t memreq_attr_memory; |
| 88 | memreq_t memreq_common_memory; |
| 89 | int ret; |
| 90 | |
Dominik Brodowski | aaa8cfd | 2009-10-18 18:28:39 +0200 | [diff] [blame] | 91 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
| 92 | p_dev->io.BasePort1 = cfg->io.win[0].base; |
| 93 | p_dev->io.NumPorts1 = cfg->io.win[0].len; |
| 94 | p_dev->io.IOAddrLines = 16; |
| 95 | |
| 96 | p_dev->irq.IRQInfo1 = cfg->irq.IRQInfo1; |
| 97 | |
| 98 | /* 0x40 causes it to generate level mode interrupts. */ |
| 99 | /* 0x04 enables IREQ pin. */ |
| 100 | p_dev->conf.ConfigIndex = cfg->index | 0x44; |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 101 | ret = pcmcia_request_io(p_dev, &p_dev->io); |
| 102 | if (ret) |
| 103 | return ret; |
| 104 | |
| 105 | io_resource = request_region(p_dev->io.BasePort1, p_dev->io.NumPorts1, |
| 106 | IPWIRELESS_PCCARD_NAME); |
| 107 | |
| 108 | if (cfg->mem.nwin == 0) |
| 109 | return 0; |
| 110 | |
| 111 | ipw->request_common_memory.Attributes = |
| 112 | WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE; |
| 113 | ipw->request_common_memory.Base = cfg->mem.win[0].host_addr; |
| 114 | ipw->request_common_memory.Size = cfg->mem.win[0].len; |
| 115 | if (ipw->request_common_memory.Size < 0x1000) |
| 116 | ipw->request_common_memory.Size = 0x1000; |
| 117 | ipw->request_common_memory.AccessSpeed = 0; |
| 118 | |
| 119 | ret = pcmcia_request_window(&p_dev, &ipw->request_common_memory, |
| 120 | &ipw->handle_common_memory); |
| 121 | |
Dominik Brodowski | cbf624f | 2009-10-24 15:47:29 +0200 | [diff] [blame^] | 122 | if (ret != 0) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 123 | goto exit1; |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 124 | |
| 125 | memreq_common_memory.CardOffset = cfg->mem.win[0].card_addr; |
| 126 | memreq_common_memory.Page = 0; |
| 127 | |
| 128 | ret = pcmcia_map_mem_page(ipw->handle_common_memory, |
| 129 | &memreq_common_memory); |
| 130 | |
Dominik Brodowski | cbf624f | 2009-10-24 15:47:29 +0200 | [diff] [blame^] | 131 | if (ret != 0) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 132 | goto exit2; |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 133 | |
| 134 | ipw->is_v2_card = cfg->mem.win[0].len == 0x100; |
| 135 | |
| 136 | ipw->common_memory = ioremap(ipw->request_common_memory.Base, |
| 137 | ipw->request_common_memory.Size); |
| 138 | request_mem_region(ipw->request_common_memory.Base, |
| 139 | ipw->request_common_memory.Size, |
| 140 | IPWIRELESS_PCCARD_NAME); |
| 141 | |
| 142 | ipw->request_attr_memory.Attributes = |
| 143 | WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | WIN_ENABLE; |
| 144 | ipw->request_attr_memory.Base = 0; |
| 145 | ipw->request_attr_memory.Size = 0; /* this used to be 0x1000 */ |
| 146 | ipw->request_attr_memory.AccessSpeed = 0; |
| 147 | |
| 148 | ret = pcmcia_request_window(&p_dev, &ipw->request_attr_memory, |
| 149 | &ipw->handle_attr_memory); |
| 150 | |
Dominik Brodowski | cbf624f | 2009-10-24 15:47:29 +0200 | [diff] [blame^] | 151 | if (ret != 0) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 152 | goto exit2; |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 153 | |
| 154 | memreq_attr_memory.CardOffset = 0; |
| 155 | memreq_attr_memory.Page = 0; |
| 156 | |
| 157 | ret = pcmcia_map_mem_page(ipw->handle_attr_memory, |
| 158 | &memreq_attr_memory); |
| 159 | |
Dominik Brodowski | cbf624f | 2009-10-24 15:47:29 +0200 | [diff] [blame^] | 160 | if (ret != 0) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 161 | goto exit3; |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 162 | |
| 163 | ipw->attr_memory = ioremap(ipw->request_attr_memory.Base, |
| 164 | ipw->request_attr_memory.Size); |
| 165 | request_mem_region(ipw->request_attr_memory.Base, |
| 166 | ipw->request_attr_memory.Size, IPWIRELESS_PCCARD_NAME); |
| 167 | |
| 168 | return 0; |
| 169 | |
| 170 | exit3: |
| 171 | pcmcia_release_window(ipw->handle_attr_memory); |
| 172 | exit2: |
| 173 | if (ipw->common_memory) { |
| 174 | release_mem_region(ipw->request_common_memory.Base, |
| 175 | ipw->request_common_memory.Size); |
| 176 | iounmap(ipw->common_memory); |
| 177 | pcmcia_release_window(ipw->handle_common_memory); |
| 178 | } else |
| 179 | pcmcia_release_window(ipw->handle_common_memory); |
| 180 | exit1: |
| 181 | release_resource(io_resource); |
| 182 | pcmcia_disable_device(p_dev); |
| 183 | return -1; |
Dominik Brodowski | aaa8cfd | 2009-10-18 18:28:39 +0200 | [diff] [blame] | 184 | } |
| 185 | |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 186 | static int config_ipwireless(struct ipw_dev *ipw) |
| 187 | { |
| 188 | struct pcmcia_device *link = ipw->link; |
Dominik Brodowski | aaa8cfd | 2009-10-18 18:28:39 +0200 | [diff] [blame] | 189 | int ret = 0; |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 190 | |
| 191 | ipw->is_v2_card = 0; |
| 192 | |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 193 | ret = pcmcia_loop_config(link, ipwireless_probe, ipw); |
Dominik Brodowski | cbf624f | 2009-10-24 15:47:29 +0200 | [diff] [blame^] | 194 | if (ret != 0) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 195 | return ret; |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 196 | |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 197 | link->conf.Attributes = CONF_ENABLE_IRQ; |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 198 | link->conf.IntType = INT_MEMORY_AND_IO; |
| 199 | |
| 200 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; |
| 201 | link->irq.Handler = ipwireless_interrupt; |
| 202 | link->irq.Instance = ipw->hardware; |
| 203 | |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 204 | INIT_WORK(&ipw->work_reboot, signalled_reboot_work); |
| 205 | |
| 206 | ipwireless_init_hardware_v1(ipw->hardware, link->io.BasePort1, |
| 207 | ipw->attr_memory, ipw->common_memory, |
| 208 | ipw->is_v2_card, signalled_reboot_callback, |
| 209 | ipw); |
| 210 | |
| 211 | ret = pcmcia_request_irq(link, &link->irq); |
| 212 | |
Dominik Brodowski | cbf624f | 2009-10-24 15:47:29 +0200 | [diff] [blame^] | 213 | if (ret != 0) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 214 | goto exit; |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 215 | |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 216 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": Card type %s\n", |
| 217 | ipw->is_v2_card ? "V2/V3" : "V1"); |
| 218 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME |
| 219 | ": I/O ports 0x%04x-0x%04x, irq %d\n", |
| 220 | (unsigned int) link->io.BasePort1, |
| 221 | (unsigned int) (link->io.BasePort1 + |
| 222 | link->io.NumPorts1 - 1), |
| 223 | (unsigned int) link->irq.AssignedIRQ); |
| 224 | if (ipw->attr_memory && ipw->common_memory) |
| 225 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME |
David Sterba | 622e713 | 2008-07-28 16:52:55 +0200 | [diff] [blame] | 226 | ": attr memory 0x%08lx-0x%08lx, common memory 0x%08lx-0x%08lx\n", |
David Sterba | 09e491e | 2008-07-28 16:53:16 +0200 | [diff] [blame] | 227 | ipw->request_attr_memory.Base, |
| 228 | ipw->request_attr_memory.Base |
| 229 | + ipw->request_attr_memory.Size - 1, |
| 230 | ipw->request_common_memory.Base, |
| 231 | ipw->request_common_memory.Base |
| 232 | + ipw->request_common_memory.Size - 1); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 233 | |
| 234 | ipw->network = ipwireless_network_create(ipw->hardware); |
| 235 | if (!ipw->network) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 236 | goto exit; |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 237 | |
| 238 | ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network, |
| 239 | ipw->nodes); |
| 240 | if (!ipw->tty) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 241 | goto exit; |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 242 | |
| 243 | ipwireless_init_hardware_v2_v3(ipw->hardware); |
| 244 | |
| 245 | /* |
| 246 | * Do the RequestConfiguration last, because it enables interrupts. |
| 247 | * Then we don't get any interrupts before we're ready for them. |
| 248 | */ |
| 249 | ret = pcmcia_request_configuration(link, &link->conf); |
| 250 | |
Dominik Brodowski | cbf624f | 2009-10-24 15:47:29 +0200 | [diff] [blame^] | 251 | if (ret != 0) |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 252 | goto exit; |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 253 | |
| 254 | link->dev_node = &ipw->nodes[0]; |
| 255 | |
| 256 | return 0; |
| 257 | |
Dominik Brodowski | af757923 | 2009-10-18 19:48:39 +0200 | [diff] [blame] | 258 | exit: |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 259 | if (ipw->attr_memory) { |
David Sterba | 09e491e | 2008-07-28 16:53:16 +0200 | [diff] [blame] | 260 | release_mem_region(ipw->request_attr_memory.Base, |
| 261 | ipw->request_attr_memory.Size); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 262 | iounmap(ipw->attr_memory); |
| 263 | pcmcia_release_window(ipw->handle_attr_memory); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 264 | } |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 265 | if (ipw->common_memory) { |
David Sterba | 09e491e | 2008-07-28 16:53:16 +0200 | [diff] [blame] | 266 | release_mem_region(ipw->request_common_memory.Base, |
| 267 | ipw->request_common_memory.Size); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 268 | iounmap(ipw->common_memory); |
| 269 | pcmcia_release_window(ipw->handle_common_memory); |
| 270 | } |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 271 | pcmcia_disable_device(link); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 272 | return -1; |
| 273 | } |
| 274 | |
| 275 | static void release_ipwireless(struct ipw_dev *ipw) |
| 276 | { |
David Sterba | 09e491e | 2008-07-28 16:53:16 +0200 | [diff] [blame] | 277 | pcmcia_disable_device(ipw->link); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 278 | |
David Sterba | 09e491e | 2008-07-28 16:53:16 +0200 | [diff] [blame] | 279 | if (ipw->common_memory) { |
| 280 | release_mem_region(ipw->request_common_memory.Base, |
| 281 | ipw->request_common_memory.Size); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 282 | iounmap(ipw->common_memory); |
David Sterba | 09e491e | 2008-07-28 16:53:16 +0200 | [diff] [blame] | 283 | } |
| 284 | if (ipw->attr_memory) { |
| 285 | release_mem_region(ipw->request_attr_memory.Base, |
| 286 | ipw->request_attr_memory.Size); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 287 | iounmap(ipw->attr_memory); |
David Sterba | 09e491e | 2008-07-28 16:53:16 +0200 | [diff] [blame] | 288 | } |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 289 | if (ipw->common_memory) |
| 290 | pcmcia_release_window(ipw->handle_common_memory); |
| 291 | if (ipw->attr_memory) |
| 292 | pcmcia_release_window(ipw->handle_attr_memory); |
David Sterba | 09e491e | 2008-07-28 16:53:16 +0200 | [diff] [blame] | 293 | |
| 294 | /* Break the link with Card Services */ |
| 295 | pcmcia_disable_device(ipw->link); |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | /* |
| 299 | * ipwireless_attach() creates an "instance" of the driver, allocating |
| 300 | * local data structures for one device (one interface). The device |
| 301 | * is registered with Card Services. |
| 302 | * |
| 303 | * The pcmcia_device structure is initialized, but we don't actually |
| 304 | * configure the card at this point -- we wait until we receive a |
| 305 | * card insertion event. |
| 306 | */ |
| 307 | static int ipwireless_attach(struct pcmcia_device *link) |
| 308 | { |
| 309 | struct ipw_dev *ipw; |
| 310 | int ret; |
| 311 | |
| 312 | ipw = kzalloc(sizeof(struct ipw_dev), GFP_KERNEL); |
| 313 | if (!ipw) |
| 314 | return -ENOMEM; |
| 315 | |
| 316 | ipw->link = link; |
| 317 | link->priv = ipw; |
| 318 | link->irq.Instance = ipw; |
| 319 | |
| 320 | /* Link this device into our device list. */ |
| 321 | link->dev_node = &ipw->nodes[0]; |
| 322 | |
| 323 | ipw->hardware = ipwireless_hardware_create(); |
| 324 | if (!ipw->hardware) { |
| 325 | kfree(ipw); |
| 326 | return -ENOMEM; |
| 327 | } |
| 328 | /* RegisterClient will call config_ipwireless */ |
| 329 | |
| 330 | ret = config_ipwireless(ipw); |
| 331 | |
| 332 | if (ret != 0) { |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 333 | ipwireless_detach(link); |
| 334 | return ret; |
| 335 | } |
| 336 | |
| 337 | return 0; |
| 338 | } |
| 339 | |
| 340 | /* |
| 341 | * This deletes a driver "instance". The device is de-registered with |
| 342 | * Card Services. If it has been released, all local data structures |
| 343 | * are freed. Otherwise, the structures will be freed when the device |
| 344 | * is released. |
| 345 | */ |
| 346 | static void ipwireless_detach(struct pcmcia_device *link) |
| 347 | { |
| 348 | struct ipw_dev *ipw = link->priv; |
| 349 | |
| 350 | release_ipwireless(ipw); |
| 351 | |
David Sterba | 099dc4f | 2008-02-07 10:57:12 +0100 | [diff] [blame] | 352 | if (ipw->tty != NULL) |
| 353 | ipwireless_tty_free(ipw->tty); |
| 354 | if (ipw->network != NULL) |
| 355 | ipwireless_network_free(ipw->network); |
| 356 | if (ipw->hardware != NULL) |
| 357 | ipwireless_hardware_free(ipw->hardware); |
| 358 | kfree(ipw); |
| 359 | } |
| 360 | |
| 361 | static struct pcmcia_driver me = { |
| 362 | .owner = THIS_MODULE, |
| 363 | .probe = ipwireless_attach, |
| 364 | .remove = ipwireless_detach, |
| 365 | .drv = { .name = IPWIRELESS_PCCARD_NAME }, |
| 366 | .id_table = ipw_ids |
| 367 | }; |
| 368 | |
| 369 | /* |
| 370 | * Module insertion : initialisation of the module. |
| 371 | * Register the card with cardmgr... |
| 372 | */ |
| 373 | static int __init init_ipwireless(void) |
| 374 | { |
| 375 | int ret; |
| 376 | |
| 377 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME " " |
| 378 | IPWIRELESS_PCMCIA_VERSION " by " IPWIRELESS_PCMCIA_AUTHOR "\n"); |
| 379 | |
| 380 | ret = ipwireless_tty_init(); |
| 381 | if (ret != 0) |
| 382 | return ret; |
| 383 | |
| 384 | ret = pcmcia_register_driver(&me); |
| 385 | if (ret != 0) |
| 386 | ipwireless_tty_release(); |
| 387 | |
| 388 | return ret; |
| 389 | } |
| 390 | |
| 391 | /* |
| 392 | * Module removal |
| 393 | */ |
| 394 | static void __exit exit_ipwireless(void) |
| 395 | { |
| 396 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME " " |
| 397 | IPWIRELESS_PCMCIA_VERSION " removed\n"); |
| 398 | |
| 399 | pcmcia_unregister_driver(&me); |
| 400 | ipwireless_tty_release(); |
| 401 | } |
| 402 | |
| 403 | module_init(init_ipwireless); |
| 404 | module_exit(exit_ipwireless); |
| 405 | |
| 406 | MODULE_AUTHOR(IPWIRELESS_PCMCIA_AUTHOR); |
| 407 | MODULE_DESCRIPTION(IPWIRELESS_PCCARD_NAME " " IPWIRELESS_PCMCIA_VERSION); |
| 408 | MODULE_LICENSE("GPL"); |