blob: e49a9b1d7c3dfe94d3d4ce1e9fd08a73121ca00b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Generic Macintosh NCR5380 driver
3 *
4 * Copyright 1998, Michael Schmitz <mschmitz@lbl.gov>
5 *
6 * derived in part from:
7 */
8/*
9 * Generic Generic NCR5380 driver
10 *
11 * Copyright 1995, Russell King
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 */
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/delay.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#include <linux/ioport.h>
18#include <linux/init.h>
19#include <linux/blkdev.h>
20#include <linux/interrupt.h>
Finn Thaincbad48d2014-11-12 16:12:07 +110021#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Finn Thaincbad48d2014-11-12 16:12:07 +110023#include <asm/hwtest.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#include <asm/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <asm/macints.h>
Finn Thaincbad48d2014-11-12 16:12:07 +110026#include <asm/setup.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include <scsi/scsi_host.h>
Finn Thain92de3832014-11-12 16:12:04 +110029
30/* Definitions for the core NCR5380 driver. */
Boaz Harroshe744fde2007-10-16 10:25:01 +020031
Boaz Harroshe744fde2007-10-16 10:25:01 +020032#define PSEUDO_DMA
33
Finn Thaincbad48d2014-11-12 16:12:07 +110034#define NCR5380_implementation_fields unsigned char *pdma_base
Finn Thain92de3832014-11-12 16:12:04 +110035
Finn Thain54d8fe42016-01-03 16:05:06 +110036#define NCR5380_read(reg) macscsi_read(instance, reg)
37#define NCR5380_write(reg, value) macscsi_write(instance, reg, value)
Finn Thain92de3832014-11-12 16:12:04 +110038
39#define NCR5380_pread macscsi_pread
40#define NCR5380_pwrite macscsi_pwrite
41
42#define NCR5380_intr macscsi_intr
43#define NCR5380_queue_command macscsi_queue_command
44#define NCR5380_abort macscsi_abort
45#define NCR5380_bus_reset macscsi_bus_reset
46#define NCR5380_info macscsi_info
47#define NCR5380_show_info macscsi_show_info
48#define NCR5380_write_info macscsi_write_info
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#include "NCR5380.h"
51
Linus Torvalds1da177e2005-04-16 15:20:36 -070052#define RESET_BOOT
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Linus Torvalds1da177e2005-04-16 15:20:36 -070054static int setup_can_queue = -1;
Finn Thain6e9ae6d2014-11-12 16:12:05 +110055module_param(setup_can_queue, int, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070056static int setup_cmd_per_lun = -1;
Finn Thain6e9ae6d2014-11-12 16:12:05 +110057module_param(setup_cmd_per_lun, int, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070058static int setup_sg_tablesize = -1;
Finn Thain6e9ae6d2014-11-12 16:12:05 +110059module_param(setup_sg_tablesize, int, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070060static int setup_use_pdma = -1;
Finn Thain6e9ae6d2014-11-12 16:12:05 +110061module_param(setup_use_pdma, int, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070062static int setup_use_tagged_queuing = -1;
Finn Thain6e9ae6d2014-11-12 16:12:05 +110063module_param(setup_use_tagged_queuing, int, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070064static int setup_hostid = -1;
Finn Thain6e9ae6d2014-11-12 16:12:05 +110065module_param(setup_hostid, int, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
67/* Time (in jiffies) to wait after a reset; the SCSI standard calls for 250ms,
68 * we usually do 0.5s to be on the safe side. But Toshiba CD-ROMs once more
69 * need ten times the standard value... */
70#define TOSHIBA_DELAY
71
72#ifdef TOSHIBA_DELAY
73#define AFTER_RESET_DELAY (5*HZ/2)
74#else
75#define AFTER_RESET_DELAY (HZ/2)
76#endif
77
Linus Torvalds1da177e2005-04-16 15:20:36 -070078/*
79 * NCR 5380 register access functions
80 */
81
Finn Thaincbad48d2014-11-12 16:12:07 +110082static inline char macscsi_read(struct Scsi_Host *instance, int reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070083{
Finn Thaincbad48d2014-11-12 16:12:07 +110084 return in_8(instance->base + (reg << 4));
Linus Torvalds1da177e2005-04-16 15:20:36 -070085}
86
Finn Thaincbad48d2014-11-12 16:12:07 +110087static inline void macscsi_write(struct Scsi_Host *instance, int reg, int value)
Linus Torvalds1da177e2005-04-16 15:20:36 -070088{
Finn Thaincbad48d2014-11-12 16:12:07 +110089 out_8(instance->base + (reg << 4), value);
Linus Torvalds1da177e2005-04-16 15:20:36 -070090}
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
Finn Thain6e9ae6d2014-11-12 16:12:05 +110092#ifndef MODULE
93static int __init mac_scsi_setup(char *str)
94{
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 int ints[7];
Finn Thain6e9ae6d2014-11-12 16:12:05 +110096
97 (void)get_options(str, ARRAY_SIZE(ints), ints);
98
99 if (ints[0] < 1 || ints[0] > 6) {
100 pr_err("Usage: mac5380=<can_queue>[,<cmd_per_lun>[,<sg_tablesize>[,<hostid>[,<use_tags>[,<use_pdma>]]]]]\n");
101 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 }
Finn Thain6e9ae6d2014-11-12 16:12:05 +1100103 if (ints[0] >= 1)
104 setup_can_queue = ints[1];
105 if (ints[0] >= 2)
106 setup_cmd_per_lun = ints[2];
107 if (ints[0] >= 3)
108 setup_sg_tablesize = ints[3];
109 if (ints[0] >= 4)
110 setup_hostid = ints[4];
111 if (ints[0] >= 5)
112 setup_use_tagged_queuing = ints[5];
113 if (ints[0] >= 6)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 setup_use_pdma = ints[6];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 return 1;
116}
117
118__setup("mac5380=", mac_scsi_setup);
Finn Thain6e9ae6d2014-11-12 16:12:05 +1100119#endif /* !MODULE */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121#ifdef RESET_BOOT
122/*
123 * Our 'bus reset on boot' function
124 */
125
126static void mac_scsi_reset_boot(struct Scsi_Host *instance)
127{
128 unsigned long end;
129
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130 /*
131 * Do a SCSI reset to clean up the bus during initialization. No messing
132 * with the queues, interrupts, or locks necessary here.
133 */
134
135 printk(KERN_INFO "Macintosh SCSI: resetting the SCSI bus..." );
136
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137 /* get in phase */
138 NCR5380_write( TARGET_COMMAND_REG,
139 PHASE_SR_TO_TCR( NCR5380_read(STATUS_REG) ));
140
141 /* assert RST */
142 NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_RST );
143 /* The min. reset hold time is 25us, so 40us should be enough */
144 udelay( 50 );
145 /* reset RST and interrupt */
146 NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE );
147 NCR5380_read( RESET_PARITY_INTERRUPT_REG );
148
149 for( end = jiffies + AFTER_RESET_DELAY; time_before(jiffies, end); )
150 barrier();
151
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 printk(KERN_INFO " done\n" );
153}
154#endif
155
Finn Thainffdede62014-11-12 16:12:06 +1100156#ifdef PSEUDO_DMA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157/*
158 Pseudo-DMA: (Ove Edlund)
159 The code attempts to catch bus errors that occur if one for example
160 "trips over the cable".
161 XXX: Since bus errors in the PDMA routines never happen on my
162 computer, the bus error code is untested.
163 If the code works as intended, a bus error results in Pseudo-DMA
Finn Thain542cb452014-10-03 11:42:17 +1000164 being disabled, meaning that the driver switches to slow handshake.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 If bus errors are NOT extremely rare, this has to be changed.
166*/
167
168#define CP_IO_TO_MEM(s,d,len) \
169__asm__ __volatile__ \
170 (" cmp.w #4,%2\n" \
171 " bls 8f\n" \
172 " move.w %1,%%d0\n" \
173 " neg.b %%d0\n" \
174 " and.w #3,%%d0\n" \
175 " sub.w %%d0,%2\n" \
176 " bra 2f\n" \
177 " 1: move.b (%0),(%1)+\n" \
178 " 2: dbf %%d0,1b\n" \
179 " move.w %2,%%d0\n" \
180 " lsr.w #5,%%d0\n" \
181 " bra 4f\n" \
182 " 3: move.l (%0),(%1)+\n" \
183 "31: move.l (%0),(%1)+\n" \
184 "32: move.l (%0),(%1)+\n" \
185 "33: move.l (%0),(%1)+\n" \
186 "34: move.l (%0),(%1)+\n" \
187 "35: move.l (%0),(%1)+\n" \
188 "36: move.l (%0),(%1)+\n" \
189 "37: move.l (%0),(%1)+\n" \
190 " 4: dbf %%d0,3b\n" \
191 " move.w %2,%%d0\n" \
192 " lsr.w #2,%%d0\n" \
193 " and.w #7,%%d0\n" \
194 " bra 6f\n" \
195 " 5: move.l (%0),(%1)+\n" \
196 " 6: dbf %%d0,5b\n" \
197 " and.w #3,%2\n" \
198 " bra 8f\n" \
199 " 7: move.b (%0),(%1)+\n" \
200 " 8: dbf %2,7b\n" \
201 " moveq.l #0, %2\n" \
202 " 9: \n" \
203 ".section .fixup,\"ax\"\n" \
204 " .even\n" \
205 "90: moveq.l #1, %2\n" \
206 " jra 9b\n" \
207 ".previous\n" \
208 ".section __ex_table,\"a\"\n" \
209 " .align 4\n" \
210 " .long 1b,90b\n" \
211 " .long 3b,90b\n" \
212 " .long 31b,90b\n" \
213 " .long 32b,90b\n" \
214 " .long 33b,90b\n" \
215 " .long 34b,90b\n" \
216 " .long 35b,90b\n" \
217 " .long 36b,90b\n" \
218 " .long 37b,90b\n" \
219 " .long 5b,90b\n" \
220 " .long 7b,90b\n" \
221 ".previous" \
222 : "=a"(s), "=a"(d), "=d"(len) \
223 : "0"(s), "1"(d), "2"(len) \
224 : "d0")
225
Finn Thainffdede62014-11-12 16:12:06 +1100226static int macscsi_pread(struct Scsi_Host *instance,
227 unsigned char *dst, int len)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228{
Finn Thaincbad48d2014-11-12 16:12:07 +1100229 struct NCR5380_hostdata *hostdata = shost_priv(instance);
Finn Thainffdede62014-11-12 16:12:06 +1100230 unsigned char *d;
231 unsigned char *s;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232
Finn Thaincbad48d2014-11-12 16:12:07 +1100233 s = hostdata->pdma_base + (INPUT_DATA_REG << 4);
Finn Thainffdede62014-11-12 16:12:06 +1100234 d = dst;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235
Finn Thainffdede62014-11-12 16:12:06 +1100236 /* These conditions are derived from MacOS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237
Finn Thainffdede62014-11-12 16:12:06 +1100238 while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) &&
239 !(NCR5380_read(STATUS_REG) & SR_REQ))
240 ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241
Finn Thainffdede62014-11-12 16:12:06 +1100242 if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) &&
243 (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)) {
244 pr_err("Error in macscsi_pread\n");
245 return -1;
246 }
247
248 CP_IO_TO_MEM(s, d, len);
249
250 if (len != 0) {
251 pr_notice("Bus error in macscsi_pread\n");
252 return -1;
253 }
254
255 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256}
257
258
259#define CP_MEM_TO_IO(s,d,len) \
260__asm__ __volatile__ \
261 (" cmp.w #4,%2\n" \
262 " bls 8f\n" \
263 " move.w %0,%%d0\n" \
264 " neg.b %%d0\n" \
265 " and.w #3,%%d0\n" \
266 " sub.w %%d0,%2\n" \
267 " bra 2f\n" \
268 " 1: move.b (%0)+,(%1)\n" \
269 " 2: dbf %%d0,1b\n" \
270 " move.w %2,%%d0\n" \
271 " lsr.w #5,%%d0\n" \
272 " bra 4f\n" \
273 " 3: move.l (%0)+,(%1)\n" \
274 "31: move.l (%0)+,(%1)\n" \
275 "32: move.l (%0)+,(%1)\n" \
276 "33: move.l (%0)+,(%1)\n" \
277 "34: move.l (%0)+,(%1)\n" \
278 "35: move.l (%0)+,(%1)\n" \
279 "36: move.l (%0)+,(%1)\n" \
280 "37: move.l (%0)+,(%1)\n" \
281 " 4: dbf %%d0,3b\n" \
282 " move.w %2,%%d0\n" \
283 " lsr.w #2,%%d0\n" \
284 " and.w #7,%%d0\n" \
285 " bra 6f\n" \
286 " 5: move.l (%0)+,(%1)\n" \
287 " 6: dbf %%d0,5b\n" \
288 " and.w #3,%2\n" \
289 " bra 8f\n" \
290 " 7: move.b (%0)+,(%1)\n" \
291 " 8: dbf %2,7b\n" \
292 " moveq.l #0, %2\n" \
293 " 9: \n" \
294 ".section .fixup,\"ax\"\n" \
295 " .even\n" \
296 "90: moveq.l #1, %2\n" \
297 " jra 9b\n" \
298 ".previous\n" \
299 ".section __ex_table,\"a\"\n" \
300 " .align 4\n" \
301 " .long 1b,90b\n" \
302 " .long 3b,90b\n" \
303 " .long 31b,90b\n" \
304 " .long 32b,90b\n" \
305 " .long 33b,90b\n" \
306 " .long 34b,90b\n" \
307 " .long 35b,90b\n" \
308 " .long 36b,90b\n" \
309 " .long 37b,90b\n" \
310 " .long 5b,90b\n" \
311 " .long 7b,90b\n" \
312 ".previous" \
313 : "=a"(s), "=a"(d), "=d"(len) \
314 : "0"(s), "1"(d), "2"(len) \
315 : "d0")
316
Finn Thainffdede62014-11-12 16:12:06 +1100317static int macscsi_pwrite(struct Scsi_Host *instance,
318 unsigned char *src, int len)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319{
Finn Thaincbad48d2014-11-12 16:12:07 +1100320 struct NCR5380_hostdata *hostdata = shost_priv(instance);
Finn Thainffdede62014-11-12 16:12:06 +1100321 unsigned char *s;
322 unsigned char *d;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323
Finn Thainffdede62014-11-12 16:12:06 +1100324 s = src;
Finn Thaincbad48d2014-11-12 16:12:07 +1100325 d = hostdata->pdma_base + (OUTPUT_DATA_REG << 4);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326
Finn Thainffdede62014-11-12 16:12:06 +1100327 /* These conditions are derived from MacOS */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328
Finn Thainffdede62014-11-12 16:12:06 +1100329 while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) &&
330 (!(NCR5380_read(STATUS_REG) & SR_REQ) ||
331 (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)))
332 ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333
Finn Thainffdede62014-11-12 16:12:06 +1100334 if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ)) {
335 pr_err("Error in macscsi_pwrite\n");
336 return -1;
337 }
338
339 CP_MEM_TO_IO(s, d, len);
340
341 if (len != 0) {
342 pr_notice("Bus error in macscsi_pwrite\n");
343 return -1;
344 }
345
346 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347}
Finn Thainffdede62014-11-12 16:12:06 +1100348#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700349
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350#include "NCR5380.c"
351
Finn Thaincbad48d2014-11-12 16:12:07 +1100352#define DRV_MODULE_NAME "mac_scsi"
353#define PFX DRV_MODULE_NAME ": "
354
355static struct scsi_host_template mac_scsi_template = {
356 .module = THIS_MODULE,
357 .proc_name = DRV_MODULE_NAME,
Al Virodd7ab712013-03-31 01:15:54 -0400358 .show_info = macscsi_show_info,
359 .write_info = macscsi_write_info,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360 .name = "Macintosh NCR5380 SCSI",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361 .info = macscsi_info,
362 .queuecommand = macscsi_queue_command,
363 .eh_abort_handler = macscsi_abort,
364 .eh_bus_reset_handler = macscsi_bus_reset,
Finn Thaind572f65f2014-11-12 16:12:00 +1100365 .can_queue = 16,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 .this_id = 7,
367 .sg_tablesize = SG_ALL,
Finn Thaind572f65f2014-11-12 16:12:00 +1100368 .cmd_per_lun = 2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369 .use_clustering = DISABLE_CLUSTERING
370};
371
Finn Thaincbad48d2014-11-12 16:12:07 +1100372static int __init mac_scsi_probe(struct platform_device *pdev)
373{
374 struct Scsi_Host *instance;
375 int error;
376 int host_flags = 0;
377 struct resource *irq, *pio_mem, *pdma_mem = NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700378
Finn Thaincbad48d2014-11-12 16:12:07 +1100379 pio_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
380 if (!pio_mem)
381 return -ENODEV;
Finn Thain6e9ae6d2014-11-12 16:12:05 +1100382
Finn Thaincbad48d2014-11-12 16:12:07 +1100383#ifdef PSEUDO_DMA
384 pdma_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
385#endif
386
387 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
388
389 if (!hwreg_present((unsigned char *)pio_mem->start +
390 (STATUS_REG << 4))) {
391 pr_info(PFX "no device detected at %pap\n", &pio_mem->start);
392 return -ENODEV;
393 }
394
395 if (setup_can_queue > 0)
396 mac_scsi_template.can_queue = setup_can_queue;
397 if (setup_cmd_per_lun > 0)
398 mac_scsi_template.cmd_per_lun = setup_cmd_per_lun;
399 if (setup_sg_tablesize >= 0)
400 mac_scsi_template.sg_tablesize = setup_sg_tablesize;
401 if (setup_hostid >= 0)
402 mac_scsi_template.this_id = setup_hostid & 7;
Finn Thaincbad48d2014-11-12 16:12:07 +1100403 if (setup_use_pdma < 0)
404 setup_use_pdma = 0;
405
406 instance = scsi_host_alloc(&mac_scsi_template,
407 sizeof(struct NCR5380_hostdata));
408 if (!instance)
409 return -ENOMEM;
410
411 instance->base = pio_mem->start;
412 if (irq)
413 instance->irq = irq->start;
414 else
415 instance->irq = NO_IRQ;
416
417 if (pdma_mem && setup_use_pdma) {
418 struct NCR5380_hostdata *hostdata = shost_priv(instance);
419
420 hostdata->pdma_base = (unsigned char *)pdma_mem->start;
421 } else
422 host_flags |= FLAG_NO_PSEUDO_DMA;
423
424#ifdef RESET_BOOT
425 mac_scsi_reset_boot(instance);
426#endif
427
Finn Thainca513fc2014-11-12 16:12:19 +1100428#ifdef SUPPORT_TAGS
429 host_flags |= setup_use_tagged_queuing > 0 ? FLAG_TAGGED_QUEUING : 0;
430#endif
431
Finn Thaincbad48d2014-11-12 16:12:07 +1100432 NCR5380_init(instance, host_flags);
433
434 if (instance->irq != NO_IRQ) {
435 error = request_irq(instance->irq, macscsi_intr, IRQF_SHARED,
436 "NCR5380", instance);
437 if (error)
438 goto fail_irq;
439 }
440
441 error = scsi_add_host(instance, NULL);
442 if (error)
443 goto fail_host;
444
445 platform_set_drvdata(pdev, instance);
446
447 scsi_scan_host(instance);
448 return 0;
449
450fail_host:
451 if (instance->irq != NO_IRQ)
452 free_irq(instance->irq, instance);
453fail_irq:
454 NCR5380_exit(instance);
455 scsi_host_put(instance);
456 return error;
457}
458
459static int __exit mac_scsi_remove(struct platform_device *pdev)
460{
461 struct Scsi_Host *instance = platform_get_drvdata(pdev);
462
463 scsi_remove_host(instance);
464 if (instance->irq != NO_IRQ)
465 free_irq(instance->irq, instance);
466 NCR5380_exit(instance);
467 scsi_host_put(instance);
468 return 0;
469}
470
471static struct platform_driver mac_scsi_driver = {
472 .remove = __exit_p(mac_scsi_remove),
473 .driver = {
474 .name = DRV_MODULE_NAME,
Finn Thaincbad48d2014-11-12 16:12:07 +1100475 },
476};
477
478module_platform_driver_probe(mac_scsi_driver, mac_scsi_probe);
479
480MODULE_ALIAS("platform:" DRV_MODULE_NAME);
Finn Thain6e9ae6d2014-11-12 16:12:05 +1100481MODULE_LICENSE("GPL");