cyberjack.c 14.1 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
/*
 *  REINER SCT cyberJack pinpad/e-com USB Chipcard Reader Driver
 *
 *  Copyright (C) 2001  REINER SCT
 *  Author: Matthias Bruestle
 *
 *  Contact: support@reiner-sct.com (see MAINTAINERS)
 *
 *  This program is largely derived from work by the linux-usb group
 *  and associated source files.  Please see the usb/serial files for
 *  individual credits and copyrights.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  Thanks to Greg Kroah-Hartman (greg@kroah.com) for his help and
 *  patience.
 *
 *  In case of problems, please write to the contact e-mail address
 *  mentioned above.
 *
 *  Please note that later models of the cyberjack reader family are
 *  supported by a libusb-based userspace device driver.
 *
 *  Homepage: http://www.reiner-sct.de/support/treiber_cyberjack.php#linux
 */


#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/spinlock.h>
A
Alan Cox 已提交
40
#include <linux/uaccess.h>
L
Linus Torvalds 已提交
41
#include <linux/usb.h>
42
#include <linux/usb/serial.h>
L
Linus Torvalds 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59

#define CYBERJACK_LOCAL_BUF_SIZE 32

static int debug;

/*
 * Version Information
 */
#define DRIVER_VERSION "v1.01"
#define DRIVER_AUTHOR "Matthias Bruestle"
#define DRIVER_DESC "REINER SCT cyberJack pinpad/e-com USB Chipcard Reader Driver"


#define CYBERJACK_VENDOR_ID	0x0C4B
#define CYBERJACK_PRODUCT_ID	0x0100

/* Function prototypes */
A
Alan Cox 已提交
60 61 62 63 64 65 66 67
static int cyberjack_startup(struct usb_serial *serial);
static void cyberjack_shutdown(struct usb_serial *serial);
static int  cyberjack_open(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp);
static void cyberjack_close(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp);
static int cyberjack_write(struct tty_struct *tty,
	struct usb_serial_port *port, const unsigned char *buf, int count);
A
Alan Cox 已提交
68
static int cyberjack_write_room(struct tty_struct *tty);
A
Alan Cox 已提交
69 70 71
static void cyberjack_read_int_callback(struct urb *urb);
static void cyberjack_read_bulk_callback(struct urb *urb);
static void cyberjack_write_bulk_callback(struct urb *urb);
L
Linus Torvalds 已提交
72 73 74 75 76 77

static struct usb_device_id id_table [] = {
	{ USB_DEVICE(CYBERJACK_VENDOR_ID, CYBERJACK_PRODUCT_ID) },
	{ }			/* Terminating entry */
};

A
Alan Cox 已提交
78
MODULE_DEVICE_TABLE(usb, id_table);
L
Linus Torvalds 已提交
79 80 81 82 83 84

static struct usb_driver cyberjack_driver = {
	.name =		"cyberjack",
	.probe =	usb_serial_probe,
	.disconnect =	usb_serial_disconnect,
	.id_table =	id_table,
85
	.no_dynamic_id = 	1,
L
Linus Torvalds 已提交
86 87
};

88
static struct usb_serial_driver cyberjack_device = {
89 90
	.driver = {
		.owner =	THIS_MODULE,
91
		.name =		"cyberjack",
92
	},
93
	.description =		"Reiner SCT Cyberjack USB card reader",
94
	.usb_driver = 		&cyberjack_driver,
L
Linus Torvalds 已提交
95 96 97 98 99 100 101
	.id_table =		id_table,
	.num_ports =		1,
	.attach =		cyberjack_startup,
	.shutdown =		cyberjack_shutdown,
	.open =			cyberjack_open,
	.close =		cyberjack_close,
	.write =		cyberjack_write,
102
	.write_room =		cyberjack_write_room,
L
Linus Torvalds 已提交
103 104 105 106 107 108 109 110 111 112 113 114 115 116
	.read_int_callback =	cyberjack_read_int_callback,
	.read_bulk_callback =	cyberjack_read_bulk_callback,
	.write_bulk_callback =	cyberjack_write_bulk_callback,
};

struct cyberjack_private {
	spinlock_t	lock;		/* Lock for SMP */
	short		rdtodo;		/* Bytes still to read */
	unsigned char	wrbuf[5*64];	/* Buffer for collecting data to write */
	short		wrfilled;	/* Overall data size we already got */
	short		wrsent;		/* Data already sent */
};

/* do some startup allocations not currently performed by usb_serial_probe() */
A
Alan Cox 已提交
117
static int cyberjack_startup(struct usb_serial *serial)
L
Linus Torvalds 已提交
118 119 120 121
{
	struct cyberjack_private *priv;
	int i;

122
	dbg("%s", __func__);
L
Linus Torvalds 已提交
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140

	/* allocate the private data structure */
	priv = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL);
	if (!priv)
		return -ENOMEM;

	/* set initial values */
	spin_lock_init(&priv->lock);
	priv->rdtodo = 0;
	priv->wrfilled = 0;
	priv->wrsent = 0;
	usb_set_serial_port_data(serial->port[0], priv);

	init_waitqueue_head(&serial->port[0]->write_wait);

	for (i = 0; i < serial->num_ports; ++i) {
		int result;
		serial->port[i]->interrupt_in_urb->dev = serial->dev;
A
Alan Cox 已提交
141
		result = usb_submit_urb(serial->port[i]->interrupt_in_urb,
L
Linus Torvalds 已提交
142 143
					GFP_KERNEL);
		if (result)
144 145
			dev_err(&serial->dev->dev,
				"usb_submit_urb(read int) failed\n");
146
		dbg("%s - usb_submit_urb(int urb)", __func__);
L
Linus Torvalds 已提交
147 148
	}

A
Alan Cox 已提交
149
	return 0;
L
Linus Torvalds 已提交
150 151
}

A
Alan Cox 已提交
152
static void cyberjack_shutdown(struct usb_serial *serial)
L
Linus Torvalds 已提交
153 154
{
	int i;
A
Alan Cox 已提交
155

156
	dbg("%s", __func__);
L
Linus Torvalds 已提交
157

158
	for (i = 0; i < serial->num_ports; ++i) {
L
Linus Torvalds 已提交
159 160 161 162 163 164
		usb_kill_urb(serial->port[i]->interrupt_in_urb);
		/* My special items, the standard routines free my urbs */
		kfree(usb_get_serial_port_data(serial->port[i]));
		usb_set_serial_port_data(serial->port[i], NULL);
	}
}
A
Alan Cox 已提交
165

A
Alan Cox 已提交
166 167
static int  cyberjack_open(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp)
L
Linus Torvalds 已提交
168 169 170 171 172
{
	struct cyberjack_private *priv;
	unsigned long flags;
	int result = 0;

173
	dbg("%s - port %d", __func__, port->number);
L
Linus Torvalds 已提交
174

A
Alan Cox 已提交
175
	dbg("%s - usb_clear_halt", __func__);
L
Linus Torvalds 已提交
176 177 178 179 180 181 182 183 184 185 186 187
	usb_clear_halt(port->serial->dev, port->write_urb->pipe);

	priv = usb_get_serial_port_data(port);
	spin_lock_irqsave(&priv->lock, flags);
	priv->rdtodo = 0;
	priv->wrfilled = 0;
	priv->wrsent = 0;
	spin_unlock_irqrestore(&priv->lock, flags);

	return result;
}

A
Alan Cox 已提交
188 189
static void cyberjack_close(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp)
L
Linus Torvalds 已提交
190
{
191
	dbg("%s - port %d", __func__, port->number);
L
Linus Torvalds 已提交
192 193 194 195 196 197 198 199

	if (port->serial->dev) {
		/* shutdown any bulk reads that might be going on */
		usb_kill_urb(port->write_urb);
		usb_kill_urb(port->read_urb);
	}
}

A
Alan Cox 已提交
200 201
static int cyberjack_write(struct tty_struct *tty,
	struct usb_serial_port *port, const unsigned char *buf, int count)
L
Linus Torvalds 已提交
202 203 204 205 206 207 208
{
	struct usb_serial *serial = port->serial;
	struct cyberjack_private *priv = usb_get_serial_port_data(port);
	unsigned long flags;
	int result;
	int wrexpected;

209
	dbg("%s - port %d", __func__, port->number);
L
Linus Torvalds 已提交
210 211

	if (count == 0) {
212
		dbg("%s - write request of 0 bytes", __func__);
213
		return 0;
L
Linus Torvalds 已提交
214 215
	}

216
	spin_lock_bh(&port->lock);
217
	if (port->write_urb_busy) {
218
		spin_unlock_bh(&port->lock);
219
		dbg("%s - already writing", __func__);
220
		return 0;
L
Linus Torvalds 已提交
221
	}
222
	port->write_urb_busy = 1;
223
	spin_unlock_bh(&port->lock);
L
Linus Torvalds 已提交
224 225 226

	spin_lock_irqsave(&priv->lock, flags);

A
Alan Cox 已提交
227
	if (count+priv->wrfilled > sizeof(priv->wrbuf)) {
L
Linus Torvalds 已提交
228
		/* To much data for buffer. Reset buffer. */
229
		priv->wrfilled = 0;
230
		port->write_urb_busy = 0;
231 232
		spin_unlock_irqrestore(&priv->lock, flags);
		return 0;
L
Linus Torvalds 已提交
233 234 235
	}

	/* Copy data */
A
Alan Cox 已提交
236
	memcpy(priv->wrbuf + priv->wrfilled, buf, count);
L
Linus Torvalds 已提交
237

238
	usb_serial_debug_data(debug, &port->dev, __func__, count,
A
Alan Cox 已提交
239
		priv->wrbuf + priv->wrfilled);
L
Linus Torvalds 已提交
240 241
	priv->wrfilled += count;

A
Alan Cox 已提交
242
	if (priv->wrfilled >= 3) {
L
Linus Torvalds 已提交
243
		wrexpected = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;
244
		dbg("%s - expected data: %d", __func__, wrexpected);
A
Alan Cox 已提交
245
	} else
L
Linus Torvalds 已提交
246 247
		wrexpected = sizeof(priv->wrbuf);

A
Alan Cox 已提交
248
	if (priv->wrfilled >= wrexpected) {
L
Linus Torvalds 已提交
249 250 251
		/* We have enough data to begin transmission */
		int length;

252
		dbg("%s - transmitting data (frame 1)", __func__);
A
Alan Cox 已提交
253 254
		length = (wrexpected > port->bulk_out_size) ?
					port->bulk_out_size : wrexpected;
L
Linus Torvalds 已提交
255

A
Alan Cox 已提交
256 257
		memcpy(port->write_urb->transfer_buffer, priv->wrbuf, length);
		priv->wrsent = length;
L
Linus Torvalds 已提交
258 259

		/* set up our urb */
A
Alan Cox 已提交
260
		usb_fill_bulk_urb(port->write_urb, serial->dev,
L
Linus Torvalds 已提交
261 262
			      usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress),
			      port->write_urb->transfer_buffer, length,
A
Alan Cox 已提交
263 264 265
			      ((serial->type->write_bulk_callback) ?
			       serial->type->write_bulk_callback :
			       cyberjack_write_bulk_callback),
L
Linus Torvalds 已提交
266 267 268 269 270
			      port);

		/* send the data out the bulk port */
		result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
		if (result) {
271 272 273
			dev_err(&port->dev,
				"%s - failed submitting write urb, error %d",
				__func__, result);
L
Linus Torvalds 已提交
274
			/* Throw away data. No better idea what to do with it. */
275 276
			priv->wrfilled = 0;
			priv->wrsent = 0;
L
Linus Torvalds 已提交
277
			spin_unlock_irqrestore(&priv->lock, flags);
278
			port->write_urb_busy = 0;
L
Linus Torvalds 已提交
279 280 281
			return 0;
		}

A
Alan Cox 已提交
282 283
		dbg("%s - priv->wrsent=%d", __func__, priv->wrsent);
		dbg("%s - priv->wrfilled=%d", __func__, priv->wrfilled);
L
Linus Torvalds 已提交
284

A
Alan Cox 已提交
285
		if (priv->wrsent >= priv->wrfilled) {
286
			dbg("%s - buffer cleaned", __func__);
A
Alan Cox 已提交
287
			memset(priv->wrbuf, 0, sizeof(priv->wrbuf));
288 289
			priv->wrfilled = 0;
			priv->wrsent = 0;
L
Linus Torvalds 已提交
290 291 292 293 294
		}
	}

	spin_unlock_irqrestore(&priv->lock, flags);

A
Alan Cox 已提交
295 296
	return count;
}
L
Linus Torvalds 已提交
297

A
Alan Cox 已提交
298
static int cyberjack_write_room(struct tty_struct *tty)
L
Linus Torvalds 已提交
299
{
300
	/* FIXME: .... */
L
Linus Torvalds 已提交
301 302 303
	return CYBERJACK_LOCAL_BUF_SIZE;
}

A
Alan Cox 已提交
304
static void cyberjack_read_int_callback(struct urb *urb)
L
Linus Torvalds 已提交
305
{
306
	struct usb_serial_port *port = urb->context;
L
Linus Torvalds 已提交
307 308
	struct cyberjack_private *priv = usb_get_serial_port_data(port);
	unsigned char *data = urb->transfer_buffer;
309
	int status = urb->status;
L
Linus Torvalds 已提交
310 311
	int result;

312
	dbg("%s - port %d", __func__, port->number);
L
Linus Torvalds 已提交
313 314

	/* the urb might have been killed. */
315
	if (status)
L
Linus Torvalds 已提交
316 317
		return;

A
Alan Cox 已提交
318 319
	usb_serial_debug_data(debug, &port->dev, __func__,
						urb->actual_length, data);
L
Linus Torvalds 已提交
320 321

	/* React only to interrupts signaling a bulk_in transfer */
A
Alan Cox 已提交
322
	if (urb->actual_length == 4 && data[0] == 0x01) {
L
Linus Torvalds 已提交
323 324 325 326 327 328 329 330 331
		short old_rdtodo;

		/* This is a announcement of coming bulk_ins. */
		unsigned short size = ((unsigned short)data[3]<<8)+data[2]+3;

		spin_lock(&priv->lock);

		old_rdtodo = priv->rdtodo;

A
Alan Cox 已提交
332 333
		if (old_rdtodo + size < old_rdtodo) {
			dbg("To many bulk_in urbs to do.");
L
Linus Torvalds 已提交
334 335 336 337 338 339 340
			spin_unlock(&priv->lock);
			goto resubmit;
		}

		/* "+=" is probably more fault tollerant than "=" */
		priv->rdtodo += size;

341
		dbg("%s - rdtodo: %d", __func__, priv->rdtodo);
L
Linus Torvalds 已提交
342 343 344

		spin_unlock(&priv->lock);

A
Alan Cox 已提交
345
		if (!old_rdtodo) {
L
Linus Torvalds 已提交
346 347
			port->read_urb->dev = port->serial->dev;
			result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
A
Alan Cox 已提交
348
			if (result)
349 350 351
				dev_err(&port->dev, "%s - failed resubmitting "
					"read urb, error %d\n",
					__func__, result);
352
			dbg("%s - usb_submit_urb(read urb)", __func__);
L
Linus Torvalds 已提交
353 354 355 356 357 358 359
		}
	}

resubmit:
	port->interrupt_in_urb->dev = port->serial->dev;
	result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
	if (result)
360
		dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
361
	dbg("%s - usb_submit_urb(int urb)", __func__);
L
Linus Torvalds 已提交
362 363
}

A
Alan Cox 已提交
364
static void cyberjack_read_bulk_callback(struct urb *urb)
L
Linus Torvalds 已提交
365
{
366
	struct usb_serial_port *port = urb->context;
L
Linus Torvalds 已提交
367 368 369 370 371
	struct cyberjack_private *priv = usb_get_serial_port_data(port);
	struct tty_struct *tty;
	unsigned char *data = urb->transfer_buffer;
	short todo;
	int result;
372
	int status = urb->status;
L
Linus Torvalds 已提交
373

374
	dbg("%s - port %d", __func__, port->number);
375

A
Alan Cox 已提交
376 377
	usb_serial_debug_data(debug, &port->dev, __func__,
						urb->actual_length, data);
378 379
	if (status) {
		dbg("%s - nonzero read bulk status received: %d",
380
		    __func__, status);
L
Linus Torvalds 已提交
381 382 383
		return;
	}

A
Alan Cox 已提交
384
	tty = tty_port_tty_get(&port->port);
L
Linus Torvalds 已提交
385
	if (!tty) {
386
		dbg("%s - ignoring since device not open\n", __func__);
L
Linus Torvalds 已提交
387 388 389
		return;
	}
	if (urb->actual_length) {
A
Alan Cox 已提交
390 391
		tty_buffer_request_room(tty, urb->actual_length);
		tty_insert_flip_string(tty, data, urb->actual_length);
A
Alan Cox 已提交
392
		tty_flip_buffer_push(tty);
L
Linus Torvalds 已提交
393
	}
A
Alan Cox 已提交
394
	tty_kref_put(tty);
L
Linus Torvalds 已提交
395 396 397 398

	spin_lock(&priv->lock);

	/* Reduce urbs to do by one. */
A
Alan Cox 已提交
399
	priv->rdtodo -= urb->actual_length;
L
Linus Torvalds 已提交
400
	/* Just to be sure */
A
Alan Cox 已提交
401 402
	if (priv->rdtodo < 0)
		priv->rdtodo = 0;
L
Linus Torvalds 已提交
403 404 405 406
	todo = priv->rdtodo;

	spin_unlock(&priv->lock);

407
	dbg("%s - rdtodo: %d", __func__, todo);
L
Linus Torvalds 已提交
408 409

	/* Continue to read if we have still urbs to do. */
A
Alan Cox 已提交
410
	if (todo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/) {
L
Linus Torvalds 已提交
411 412 413
		port->read_urb->dev = port->serial->dev;
		result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
		if (result)
414 415
			dev_err(&port->dev, "%s - failed resubmitting read "
				"urb, error %d\n", __func__, result);
416
		dbg("%s - usb_submit_urb(read urb)", __func__);
L
Linus Torvalds 已提交
417 418 419
	}
}

A
Alan Cox 已提交
420
static void cyberjack_write_bulk_callback(struct urb *urb)
L
Linus Torvalds 已提交
421
{
422
	struct usb_serial_port *port = urb->context;
L
Linus Torvalds 已提交
423
	struct cyberjack_private *priv = usb_get_serial_port_data(port);
424
	int status = urb->status;
L
Linus Torvalds 已提交
425

426
	dbg("%s - port %d", __func__, port->number);
427 428

	port->write_urb_busy = 0;
429 430
	if (status) {
		dbg("%s - nonzero write bulk status received: %d",
431
		    __func__, status);
L
Linus Torvalds 已提交
432 433 434 435 436 437
		return;
	}

	spin_lock(&priv->lock);

	/* only do something if we have more data to send */
A
Alan Cox 已提交
438
	if (priv->wrfilled) {
L
Linus Torvalds 已提交
439 440
		int length, blksize, result;

441
		dbg("%s - transmitting data (frame n)", __func__);
L
Linus Torvalds 已提交
442 443 444 445

		length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ?
			port->bulk_out_size : (priv->wrfilled - priv->wrsent);

A
Alan Cox 已提交
446 447 448
		memcpy(port->write_urb->transfer_buffer,
					priv->wrbuf + priv->wrsent, length);
		priv->wrsent += length;
L
Linus Torvalds 已提交
449 450

		/* set up our urb */
A
Alan Cox 已提交
451
		usb_fill_bulk_urb(port->write_urb, port->serial->dev,
L
Linus Torvalds 已提交
452 453
			      usb_sndbulkpipe(port->serial->dev, port->bulk_out_endpointAddress),
			      port->write_urb->transfer_buffer, length,
A
Alan Cox 已提交
454 455 456
			      ((port->serial->type->write_bulk_callback) ?
			       port->serial->type->write_bulk_callback :
			       cyberjack_write_bulk_callback),
L
Linus Torvalds 已提交
457 458 459 460 461
			      port);

		/* send the data out the bulk port */
		result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
		if (result) {
462 463 464
			dev_err(&port->dev,
				"%s - failed submitting write urb, error %d\n",
				__func__, result);
L
Linus Torvalds 已提交
465
			/* Throw away data. No better idea what to do with it. */
466 467
			priv->wrfilled = 0;
			priv->wrsent = 0;
L
Linus Torvalds 已提交
468 469 470
			goto exit;
		}

A
Alan Cox 已提交
471 472
		dbg("%s - priv->wrsent=%d", __func__, priv->wrsent);
		dbg("%s - priv->wrfilled=%d", __func__, priv->wrfilled);
L
Linus Torvalds 已提交
473 474 475

		blksize = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;

A
Alan Cox 已提交
476 477
		if (priv->wrsent >= priv->wrfilled ||
					priv->wrsent >= blksize) {
478
			dbg("%s - buffer cleaned", __func__);
A
Alan Cox 已提交
479
			memset(priv->wrbuf, 0, sizeof(priv->wrbuf));
480 481
			priv->wrfilled = 0;
			priv->wrsent = 0;
L
Linus Torvalds 已提交
482 483 484 485 486
		}
	}

exit:
	spin_unlock(&priv->lock);
487
	usb_serial_port_softint(port);
L
Linus Torvalds 已提交
488 489
}

A
Alan Cox 已提交
490
static int __init cyberjack_init(void)
L
Linus Torvalds 已提交
491 492 493 494 495 496
{
	int retval;
	retval  = usb_serial_register(&cyberjack_device);
	if (retval)
		goto failed_usb_serial_register;
	retval = usb_register(&cyberjack_driver);
A
Alan Cox 已提交
497
	if (retval)
L
Linus Torvalds 已提交
498 499
		goto failed_usb_register;

500 501 502
	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION " "
	       DRIVER_AUTHOR "\n");
	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n");
L
Linus Torvalds 已提交
503 504 505 506 507 508 509 510

	return 0;
failed_usb_register:
	usb_serial_deregister(&cyberjack_device);
failed_usb_serial_register:
	return retval;
}

A
Alan Cox 已提交
511
static void __exit cyberjack_exit(void)
L
Linus Torvalds 已提交
512
{
A
Alan Cox 已提交
513 514
	usb_deregister(&cyberjack_driver);
	usb_serial_deregister(&cyberjack_device);
L
Linus Torvalds 已提交
515 516 517 518 519
}

module_init(cyberjack_init);
module_exit(cyberjack_exit);

A
Alan Cox 已提交
520 521 522
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_VERSION(DRIVER_VERSION);
L
Linus Torvalds 已提交
523 524 525 526
MODULE_LICENSE("GPL");

module_param(debug, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug enabled or not");