blob: 88805a4c29f11af77b3ad567c4f54318b07aa3b8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*======================================================================
2
3 Aironet driver for 4500 and 4800 series cards
4
5 This code is released under both the GPL version 2 and BSD licenses.
6 Either license may be used. The respective licenses are found at
7 the end of this file.
8
9 This code was developed by Benjamin Reed <breed@users.sourceforge.net>
10 including portions of which come from the Aironet PC4500
11 Developer's Reference Manual and used with permission. Copyright
12 (C) 1999 Benjamin Reed. All Rights Reserved. Permission to use
13 code in the Developer's manual was granted for this driver by
14 Aironet.
15
16 In addition this module was derived from dummy_cs.
17 The initial developer of dummy_cs is David A. Hinds
18 <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
19 are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
20
21======================================================================*/
22
23#include <linux/config.h>
24#ifdef __IN_PCMCIA_PACKAGE__
25#include <pcmcia/k_compat.h>
26#endif
27#include <linux/init.h>
28#include <linux/kernel.h>
29#include <linux/module.h>
30#include <linux/ptrace.h>
31#include <linux/slab.h>
32#include <linux/string.h>
33#include <linux/timer.h>
34#include <linux/netdevice.h>
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036#include <pcmcia/cs_types.h>
37#include <pcmcia/cs.h>
38#include <pcmcia/cistpl.h>
39#include <pcmcia/cisreg.h>
40#include <pcmcia/ds.h>
41
42#include <asm/io.h>
43#include <asm/system.h>
44
Adrian Bunkd3808762005-11-05 17:42:27 +010045#include "airo.h"
46
Linus Torvalds1da177e2005-04-16 15:20:36 -070047/*
48 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
49 you do not define PCMCIA_DEBUG at all, all the debug code will be
50 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
51 be present but disabled -- but it can then be enabled for specific
52 modules at load time with a 'pc_debug=#' option to insmod.
53*/
54#ifdef PCMCIA_DEBUG
55static int pc_debug = PCMCIA_DEBUG;
56module_param(pc_debug, int, 0);
57static char *version = "$Revision: 1.2 $";
58#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
59#else
60#define DEBUG(n, args...)
61#endif
62
63/*====================================================================*/
64
65MODULE_AUTHOR("Benjamin Reed");
66MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet \
67 cards. This is the module that links the PCMCIA card \
68 with the airo module.");
69MODULE_LICENSE("Dual BSD/GPL");
70MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340 PCMCIA cards");
71
72/*====================================================================*/
73
74/*
75 The event() function is this driver's Card Services event handler.
76 It will be called by Card Services when an appropriate card status
77 event is received. The config() and release() entry points are
78 used to configure or release a socket, in response to card
79 insertion and ejection events. They are invoked from the airo_cs
80 event handler.
81*/
82
Linus Torvalds1da177e2005-04-16 15:20:36 -070083static void airo_config(dev_link_t *link);
84static void airo_release(dev_link_t *link);
85static int airo_event(event_t event, int priority,
86 event_callback_args_t *args);
87
88/*
89 The attach() and detach() entry points are used to create and destroy
90 "instances" of the driver, where each instance represents everything
91 needed to manage one actual PCMCIA card.
92*/
93
94static dev_link_t *airo_attach(void);
Dominik Brodowskicc3b4862005-11-14 21:23:14 +010095static void airo_detach(struct pcmcia_device *p_dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070096
97/*
98 You'll also need to prototype all the functions that will actually
99 be used to talk to your device. See 'pcmem_cs' for a good example
100 of a fully self-sufficient driver; the other drivers rely more or
101 less on other parts of the kernel.
102*/
103
104/*
105 The dev_info variable is the "key" that is used to match up this
106 device driver with appropriate cards, through the card configuration
107 database.
108*/
109
110static dev_info_t dev_info = "airo_cs";
111
112/*
113 A linked list of "instances" of the aironet device. Each actual
114 PCMCIA card corresponds to one device instance, and is described
115 by one dev_link_t structure (defined in ds.h).
116
117 You may not want to use a linked list for this -- for example, the
118 memory card driver uses an array of dev_link_t pointers, where minor
119 device numbers are used to derive the corresponding array index.
120*/
121
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 A driver needs to provide a dev_node_t structure for each device
124 on a card. In some cases, there is only one device per card (for
125 example, ethernet cards, modems). In other cases, there may be
126 many actual or logical devices (SCSI adapters, memory cards with
127 multiple partitions). The dev_node_t structures need to be kept
128 in a linked list starting at the 'dev' field of a dev_link_t
129 structure. We allocate them in the card's private data structure,
130 because they generally shouldn't be allocated dynamically.
131
132 In this case, we also provide a flag to indicate if a device is
133 "stopped" due to a power management event, or card ejection. The
134 device IO routines can use a flag like this to throttle IO to a
135 card that is not ready to accept it.
136*/
137
138typedef struct local_info_t {
139 dev_node_t node;
140 struct net_device *eth_dev;
141} local_info_t;
142
143/*======================================================================
144
145 airo_attach() creates an "instance" of the driver, allocating
146 local data structures for one device. The device is registered
147 with Card Services.
148
149 The dev_link structure is initialized, but we don't actually
150 configure the card at this point -- we wait until we receive a
151 card insertion event.
152
153 ======================================================================*/
154
155static dev_link_t *airo_attach(void)
156{
157 client_reg_t client_reg;
158 dev_link_t *link;
159 local_info_t *local;
160 int ret;
161
162 DEBUG(0, "airo_attach()\n");
163
164 /* Initialize the dev_link_t structure */
Panagiotis Issarisb69a3aa2005-11-08 00:03:15 +0100165 link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166 if (!link) {
167 printk(KERN_ERR "airo_cs: no memory for new device\n");
168 return NULL;
169 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170
171 /* Interrupt setup */
172 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
173 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
174 link->irq.Handler = NULL;
175
176 /*
177 General socket configuration defaults can go here. In this
178 client, we assume very little, and rely on the CIS for almost
179 everything. In most clients, many details (i.e., number, sizes,
180 and attributes of IO windows) are fixed by the nature of the
181 device, and can be hard-wired here.
182 */
183 link->conf.Attributes = 0;
184 link->conf.Vcc = 50;
185 link->conf.IntType = INT_MEMORY_AND_IO;
186
187 /* Allocate space for private device-specific data */
Panagiotis Issarisb69a3aa2005-11-08 00:03:15 +0100188 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189 if (!local) {
190 printk(KERN_ERR "airo_cs: no memory for new device\n");
191 kfree (link);
192 return NULL;
193 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194 link->priv = local;
195
196 /* Register with Card Services */
Dominik Brodowskib4635812005-11-14 21:25:35 +0100197 link->next = NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198 client_reg.dev_info = &dev_info;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199 client_reg.Version = 0x0210;
200 client_reg.event_callback_args.client_data = link;
201 ret = pcmcia_register_client(&link->handle, &client_reg);
202 if (ret != 0) {
203 cs_error(link->handle, RegisterClient, ret);
Dominik Brodowskicc3b4862005-11-14 21:23:14 +0100204 airo_detach(link->handle);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205 return NULL;
206 }
207
208 return link;
209} /* airo_attach */
210
211/*======================================================================
212
213 This deletes a driver "instance". The device is de-registered
214 with Card Services. If it has been released, all local data
215 structures are freed. Otherwise, the structures will be freed
216 when the device is released.
217
218 ======================================================================*/
219
Dominik Brodowskicc3b4862005-11-14 21:23:14 +0100220static void airo_detach(struct pcmcia_device *p_dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221{
Dominik Brodowskicc3b4862005-11-14 21:23:14 +0100222 dev_link_t *link = dev_to_instance(p_dev);
Dominik Brodowskib4635812005-11-14 21:25:35 +0100223
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224 DEBUG(0, "airo_detach(0x%p)\n", link);
Dominik Brodowskib4635812005-11-14 21:25:35 +0100225
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226 if (link->state & DEV_CONFIG)
227 airo_release(link);
Dominik Brodowskib4635812005-11-14 21:25:35 +0100228
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229 if ( ((local_info_t*)link->priv)->eth_dev ) {
230 stop_airo_card( ((local_info_t*)link->priv)->eth_dev, 0 );
231 }
Dominik Brodowskicc3b4862005-11-14 21:23:14 +0100232 ((local_info_t*)link->priv)->eth_dev = NULL;
233
Jesper Juhlb4558ea2005-10-28 16:53:13 -0400234 kfree(link->priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235 kfree(link);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236} /* airo_detach */
237
238/*======================================================================
239
240 airo_config() is scheduled to run after a CARD_INSERTION event
241 is received, to configure the PCMCIA socket, and to make the
242 device available to the system.
243
244 ======================================================================*/
245
246#define CS_CHECK(fn, ret) \
247do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
248
249static void airo_config(dev_link_t *link)
250{
251 client_handle_t handle;
252 tuple_t tuple;
253 cisparse_t parse;
254 local_info_t *dev;
255 int last_fn, last_ret;
256 u_char buf[64];
257 win_req_t req;
258 memreq_t map;
259
260 handle = link->handle;
261 dev = link->priv;
262
263 DEBUG(0, "airo_config(0x%p)\n", link);
264
265 /*
266 This reads the card's CONFIG tuple to find its configuration
267 registers.
268 */
269 tuple.DesiredTuple = CISTPL_CONFIG;
270 tuple.Attributes = 0;
271 tuple.TupleData = buf;
272 tuple.TupleDataMax = sizeof(buf);
273 tuple.TupleOffset = 0;
274 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
275 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
276 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
277 link->conf.ConfigBase = parse.config.base;
278 link->conf.Present = parse.config.rmask[0];
279
280 /* Configure card */
281 link->state |= DEV_CONFIG;
282
283 /*
284 In this loop, we scan the CIS for configuration table entries,
285 each of which describes a valid card configuration, including
286 voltage, IO window, memory window, and interrupt settings.
287
288 We make no assumptions about the card to be configured: we use
289 just the information available in the CIS. In an ideal world,
290 this would work for any PCMCIA card, but it requires a complete
291 and accurate CIS. In practice, a driver usually "knows" most of
292 these things without consulting the CIS, and most client drivers
293 will only use the CIS to fill in implementation-defined details.
294 */
295 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
296 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
297 while (1) {
298 cistpl_cftable_entry_t dflt = { 0 };
299 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
300 if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||
301 pcmcia_parse_tuple(handle, &tuple, &parse) != 0)
302 goto next_entry;
303
304 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
305 if (cfg->index == 0) goto next_entry;
306 link->conf.ConfigIndex = cfg->index;
307
308 /* Does this card need audio output? */
309 if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
310 link->conf.Attributes |= CONF_ENABLE_SPKR;
311 link->conf.Status = CCSR_AUDIO_ENA;
312 }
313
314 /* Use power settings for Vcc and Vpp if present */
315 /* Note that the CIS values need to be rescaled */
316 if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM))
317 link->conf.Vcc = cfg->vcc.param[CISTPL_POWER_VNOM]/10000;
318 else if (dflt.vcc.present & (1<<CISTPL_POWER_VNOM))
319 link->conf.Vcc = dflt.vcc.param[CISTPL_POWER_VNOM]/10000;
320
321 if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM))
322 link->conf.Vpp1 = link->conf.Vpp2 =
323 cfg->vpp1.param[CISTPL_POWER_VNOM]/10000;
324 else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM))
325 link->conf.Vpp1 = link->conf.Vpp2 =
326 dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;
327
328 /* Do we need to allocate an interrupt? */
329 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
330 link->conf.Attributes |= CONF_ENABLE_IRQ;
331
332 /* IO window settings */
333 link->io.NumPorts1 = link->io.NumPorts2 = 0;
334 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
335 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
336 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
337 if (!(io->flags & CISTPL_IO_8BIT))
338 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
339 if (!(io->flags & CISTPL_IO_16BIT))
340 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
341 link->io.BasePort1 = io->win[0].base;
342 link->io.NumPorts1 = io->win[0].len;
343 if (io->nwin > 1) {
344 link->io.Attributes2 = link->io.Attributes1;
345 link->io.BasePort2 = io->win[1].base;
346 link->io.NumPorts2 = io->win[1].len;
347 }
348 }
349
350 /* This reserves IO space but doesn't actually enable it */
351 if (pcmcia_request_io(link->handle, &link->io) != 0)
352 goto next_entry;
353
354 /*
355 Now set up a common memory window, if needed. There is room
356 in the dev_link_t structure for one memory window handle,
357 but if the base addresses need to be saved, or if multiple
358 windows are needed, the info should go in the private data
359 structure for this device.
360
361 Note that the memory window base is a physical address, and
362 needs to be mapped to virtual space with ioremap() before it
363 is used.
364 */
365 if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) {
366 cistpl_mem_t *mem =
367 (cfg->mem.nwin) ? &cfg->mem : &dflt.mem;
368 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
369 req.Base = mem->win[0].host_addr;
370 req.Size = mem->win[0].len;
371 req.AccessSpeed = 0;
372 if (pcmcia_request_window(&link->handle, &req, &link->win) != 0)
373 goto next_entry;
374 map.Page = 0; map.CardOffset = mem->win[0].card_addr;
375 if (pcmcia_map_mem_page(link->win, &map) != 0)
376 goto next_entry;
377 }
378 /* If we got this far, we're cool! */
379 break;
380
381 next_entry:
382 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
383 }
384
385 /*
386 Allocate an interrupt line. Note that this does not assign a
387 handler to the interrupt, unless the 'Handler' member of the
388 irq structure is initialized.
389 */
390 if (link->conf.Attributes & CONF_ENABLE_IRQ)
391 CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));
392
393 /*
394 This actually configures the PCMCIA socket -- setting up
395 the I/O windows and the interrupt mapping, and putting the
396 card and host interface into "Memory and IO" mode.
397 */
398 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
399 ((local_info_t*)link->priv)->eth_dev =
400 init_airo_card( link->irq.AssignedIRQ,
401 link->io.BasePort1, 1, &handle_to_dev(handle) );
402 if (!((local_info_t*)link->priv)->eth_dev) goto cs_failed;
403
404 /*
405 At this point, the dev_node_t structure(s) need to be
406 initialized and arranged in a linked list at link->dev.
407 */
408 strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name );
409 dev->node.major = dev->node.minor = 0;
410 link->dev = &dev->node;
411
412 /* Finally, report what we've done */
413 printk(KERN_INFO "%s: index 0x%02x: Vcc %d.%d",
414 dev->node.dev_name, link->conf.ConfigIndex,
415 link->conf.Vcc/10, link->conf.Vcc%10);
416 if (link->conf.Vpp1)
417 printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
418 if (link->conf.Attributes & CONF_ENABLE_IRQ)
419 printk(", irq %d", link->irq.AssignedIRQ);
420 if (link->io.NumPorts1)
421 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
422 link->io.BasePort1+link->io.NumPorts1-1);
423 if (link->io.NumPorts2)
424 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
425 link->io.BasePort2+link->io.NumPorts2-1);
426 if (link->win)
427 printk(", mem 0x%06lx-0x%06lx", req.Base,
428 req.Base+req.Size-1);
429 printk("\n");
430
431 link->state &= ~DEV_CONFIG_PENDING;
432 return;
433
434 cs_failed:
435 cs_error(link->handle, last_fn, last_ret);
436 airo_release(link);
437
438} /* airo_config */
439
440/*======================================================================
441
442 After a card is removed, airo_release() will unregister the
443 device, and release the PCMCIA configuration. If the device is
444 still open, this will be postponed until it is closed.
445
446 ======================================================================*/
447
448static void airo_release(dev_link_t *link)
449{
450 DEBUG(0, "airo_release(0x%p)\n", link);
451
452 /* Unlink the device chain */
453 link->dev = NULL;
454
455 /*
456 In a normal driver, additional code may be needed to release
457 other kernel data structures associated with this device.
458 */
459
460 /* Don't bother checking to see if these succeed or not */
461 if (link->win)
462 pcmcia_release_window(link->win);
463 pcmcia_release_configuration(link->handle);
464 if (link->io.NumPorts1)
465 pcmcia_release_io(link->handle, &link->io);
466 if (link->irq.AssignedIRQ)
467 pcmcia_release_irq(link->handle, &link->irq);
468 link->state &= ~DEV_CONFIG;
469}
470
Dominik Brodowski98e4c282005-11-14 21:21:18 +0100471static int airo_suspend(struct pcmcia_device *p_dev)
472{
473 dev_link_t *link = dev_to_instance(p_dev);
474 local_info_t *local = link->priv;
475
476 link->state |= DEV_SUSPEND;
477 if (link->state & DEV_CONFIG) {
478 netif_device_detach(local->eth_dev);
479 pcmcia_release_configuration(link->handle);
480 }
481
482 return 0;
483}
484
485static int airo_resume(struct pcmcia_device *p_dev)
486{
487 dev_link_t *link = dev_to_instance(p_dev);
488 local_info_t *local = link->priv;
489
490 link->state &= ~DEV_SUSPEND;
491 if (link->state & DEV_CONFIG) {
492 pcmcia_request_configuration(link->handle, &link->conf);
493 reset_airo_card(local->eth_dev);
494 netif_device_attach(local->eth_dev);
495 }
496
497 return 0;
498}
499
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500/*======================================================================
501
502 The card status event handler. Mostly, this schedules other
503 stuff to run after an event is received.
504
505 When a CARD_REMOVAL event is received, we immediately set a
506 private flag to block future accesses to this device. All the
507 functions that actually access the device should check this flag
508 to make sure the card is still present.
509
510 ======================================================================*/
511
512static int airo_event(event_t event, int priority,
513 event_callback_args_t *args)
514{
515 dev_link_t *link = args->client_data;
Dominik Brodowskicc3b4862005-11-14 21:23:14 +0100516
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517 DEBUG(1, "airo_event(0x%06x)\n", event);
Dominik Brodowskicc3b4862005-11-14 21:23:14 +0100518
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 switch (event) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520 case CS_EVENT_CARD_INSERTION:
521 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
522 airo_config(link);
523 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700524 }
525 return 0;
526} /* airo_event */
527
Dominik Brodowski7018d062005-06-27 16:28:20 -0700528static struct pcmcia_device_id airo_ids[] = {
529 PCMCIA_DEVICE_MANF_CARD(0x015f, 0x000a),
530 PCMCIA_DEVICE_MANF_CARD(0x015f, 0x0005),
531 PCMCIA_DEVICE_MANF_CARD(0x015f, 0x0007),
532 PCMCIA_DEVICE_MANF_CARD(0x0105, 0x0007),
533 PCMCIA_DEVICE_NULL,
534};
535MODULE_DEVICE_TABLE(pcmcia, airo_ids);
536
Linus Torvalds1da177e2005-04-16 15:20:36 -0700537static struct pcmcia_driver airo_driver = {
538 .owner = THIS_MODULE,
539 .drv = {
540 .name = "airo_cs",
541 },
542 .attach = airo_attach,
Dominik Brodowski1e212f32005-07-07 17:59:00 -0700543 .event = airo_event,
Dominik Brodowskicc3b4862005-11-14 21:23:14 +0100544 .remove = airo_detach,
Dominik Brodowski7018d062005-06-27 16:28:20 -0700545 .id_table = airo_ids,
Dominik Brodowski98e4c282005-11-14 21:21:18 +0100546 .suspend = airo_suspend,
547 .resume = airo_resume,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700548};
549
550static int airo_cs_init(void)
551{
552 return pcmcia_register_driver(&airo_driver);
553}
554
555static void airo_cs_cleanup(void)
556{
557 pcmcia_unregister_driver(&airo_driver);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700558}
559
560/*
561 This program is free software; you can redistribute it and/or
562 modify it under the terms of the GNU General Public License
563 as published by the Free Software Foundation; either version 2
564 of the License, or (at your option) any later version.
565
566 This program is distributed in the hope that it will be useful,
567 but WITHOUT ANY WARRANTY; without even the implied warranty of
568 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
569 GNU General Public License for more details.
570
571 In addition:
572
573 Redistribution and use in source and binary forms, with or without
574 modification, are permitted provided that the following conditions
575 are met:
576
577 1. Redistributions of source code must retain the above copyright
578 notice, this list of conditions and the following disclaimer.
579 2. Redistributions in binary form must reproduce the above copyright
580 notice, this list of conditions and the following disclaimer in the
581 documentation and/or other materials provided with the distribution.
582 3. The name of the author may not be used to endorse or promote
583 products derived from this software without specific prior written
584 permission.
585
586 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
587 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
588 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
589 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
590 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
591 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
592 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
593 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
594 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
595 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
596 POSSIBILITY OF SUCH DAMAGE.
597*/
598
599module_init(airo_cs_init);
600module_exit(airo_cs_cleanup);