aircable.c revision 66afb5b535fe34cd6b33d2ef45aac24fac9370f8
13fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo/* 23fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * AIRcable USB Bluetooth Dongle Driver. 33fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * 44272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold * Copyright (C) 2010 Johan Hovold <jhovold@gmail.com> 53fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * Copyright (C) 2006 Manuel Francisco Naranjo (naranjo.manuel@gmail.com) 64272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold * 73fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * This program is free software; you can redistribute it and/or modify it under 83fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * the terms of the GNU General Public License version 2 as published by the 93fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * Free Software Foundation. 103fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * 113fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * The device works as an standard CDC device, it has 2 interfaces, the first 123fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * one is for firmware access and the second is the serial one. 133fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * The protocol is very simply, there are two posibilities reading or writing. 14beb7dd86a101263bf63a78c7c6d4da3849b35bd6Robert P. J. Day * When writing the first urb must have a Header that starts with 0x20 0x29 the 153fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * next two bytes must say how much data will be sended. 163fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * When reading the process is almost equal except that the header starts with 173fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * 0x00 0x20. 183fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * 1925985edcedea6396277003854657b5f3cb31a628Lucas De Marchi * The device simply need some stuff to understand data coming from the usb 203fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * buffer: The First and Second byte is used for a Header, the Third and Fourth 213fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * tells the device the amount of information the package holds. 223fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * Packages are 60 bytes long Header Stuff. 23beb7dd86a101263bf63a78c7c6d4da3849b35bd6Robert P. J. Day * When writing to the device the first two bytes of the header are 0x20 0x29 243fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * When reading the bytes are 0x00 0x20, or 0x00 0x10, there is an strange 253fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * situation, when too much data arrives to the device because it sends the data 263fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * but with out the header. I will use a simply hack to override this situation, 273fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * if there is data coming that does not contain any header, then that is data 283fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * that must go directly to the tty, as there is no documentation about if there 293fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * is any other control code, I will simply check for the first 303fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * one. 313fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * 323fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * The driver registers himself with the USB-serial core and the USB Core. I had 3325985edcedea6396277003854657b5f3cb31a628Lucas De Marchi * to implement a probe function against USB-serial, because other way, the 343fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * driver was attaching himself to both interfaces. I have tryed with different 353fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * configurations of usb_serial_driver with out exit, only the probe function 363fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * could handle this correctly. 373fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * 383fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * I have taken some info from a Greg Kroah-Hartman article: 393fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * http://www.linuxjournal.com/article/6573 403fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * And from Linux Device Driver Kit CD, which is a great work, the authors taken 413fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * the work to recompile lots of information an knowladge in drivers development 423fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * and made it all avaible inside a cd. 433fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * URL: http://kernel.org/pub/linux/kernel/people/gregkh/ddk/ 443fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * 453fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo */ 463fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 474272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold#include <asm/unaligned.h> 483fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#include <linux/tty.h> 495a0e3ad6af8660be21ca98a971cd00f331318c05Tejun Heo#include <linux/slab.h> 506eb0de827084060e6607c8f8542d9e9566214538Paul Gortmaker#include <linux/module.h> 513fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#include <linux/tty_flip.h> 523fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#include <linux/usb.h> 533fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#include <linux/usb/serial.h> 543fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 5590ab5ee94171b3e28de6bb42ee30b527014e0be7Rusty Russellstatic bool debug; 563fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 573fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo/* Vendor and Product ID */ 583fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define AIRCABLE_VID 0x16CA 593fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define AIRCABLE_USB_PID 0x1502 603fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 613fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo/* Protocol Stuff */ 623fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define HCI_HEADER_LENGTH 0x4 633fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define TX_HEADER_0 0x20 643fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define TX_HEADER_1 0x29 653fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define RX_HEADER_0 0x00 663fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define RX_HEADER_1 0x20 673fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define HCI_COMPLETE_FRAME 64 683fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 693fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo/* rx_flags */ 703fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define THROTTLED 0x01 713fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define ACTUALLY_THROTTLED 0x02 723fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 733fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo/* 743fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo * Version Information 753fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo */ 764272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold#define DRIVER_VERSION "v2.0" 774272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold#define DRIVER_AUTHOR "Naranjo, Manuel Francisco <naranjo.manuel@gmail.com>, Johan Hovold <jhovold@gmail.com>" 783fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo#define DRIVER_DESC "AIRcable USB Driver" 793fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 803fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo/* ID table that will be registered with USB core */ 817d40d7e85a25e01948bcb4dc3eda1355af318337Németh Mártonstatic const struct usb_device_id id_table[] = { 823fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo { USB_DEVICE(AIRCABLE_VID, AIRCABLE_USB_PID) }, 833fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo { }, 843fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo}; 853fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco NaranjoMODULE_DEVICE_TABLE(usb, id_table); 863fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 874272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovoldstatic int aircable_prepare_write_buffer(struct usb_serial_port *port, 88c23e5fc1f7dba228558b4a46e68f7af89515b13cJohan Hovold void *dest, size_t size) 893fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo{ 90c23e5fc1f7dba228558b4a46e68f7af89515b13cJohan Hovold int count; 91c23e5fc1f7dba228558b4a46e68f7af89515b13cJohan Hovold unsigned char *buf = dest; 923fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 934272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold count = kfifo_out_locked(&port->write_fifo, buf + HCI_HEADER_LENGTH, 944272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold size - HCI_HEADER_LENGTH, &port->lock); 953fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo buf[0] = TX_HEADER_0; 963fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo buf[1] = TX_HEADER_1; 974272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold put_unaligned_le16(count, &buf[2]); 983fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 99f26c2889a4d937371e2ec9b5690ac407f0496634Johan Hovold return count + HCI_HEADER_LENGTH; 1003fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo} 1013fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1023fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjostatic int aircable_probe(struct usb_serial *serial, 1033fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo const struct usb_device_id *id) 1043fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo{ 105c4d0f8cbca3a97900f85b082064a63c7a5928bd7Alan Cox struct usb_host_interface *iface_desc = serial->interface-> 106c4d0f8cbca3a97900f85b082064a63c7a5928bd7Alan Cox cur_altsetting; 1073fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo struct usb_endpoint_descriptor *endpoint; 108c4d0f8cbca3a97900f85b082064a63c7a5928bd7Alan Cox int num_bulk_out = 0; 1093fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo int i; 1103fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1113fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) { 1123fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo endpoint = &iface_desc->endpoint[i].desc; 113377f13bf95b64cf5fb0fad0bf2b94106ad868562Luiz Fernando N. Capitulino if (usb_endpoint_is_bulk_out(endpoint)) { 11466afb5b535fe34cd6b33d2ef45aac24fac9370f8Greg Kroah-Hartman dev_dbg(&serial->dev->dev, 11566afb5b535fe34cd6b33d2ef45aac24fac9370f8Greg Kroah-Hartman "found bulk out on endpoint %d\n", i); 1163fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo ++num_bulk_out; 1173fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo } 1183fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo } 1193fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1203fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo if (num_bulk_out == 0) { 12166afb5b535fe34cd6b33d2ef45aac24fac9370f8Greg Kroah-Hartman dev_dbg(&serial->dev->dev, "Invalid interface, discarding\n"); 1223fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo return -ENODEV; 1233fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo } 1243fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1253fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo return 0; 1263fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo} 1273fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1284272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovoldstatic int aircable_process_packet(struct tty_struct *tty, 1294272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold struct usb_serial_port *port, int has_headers, 1304272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold char *packet, int len) 1313fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo{ 1324272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold if (has_headers) { 1334272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold len -= HCI_HEADER_LENGTH; 1344272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold packet += HCI_HEADER_LENGTH; 1353fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo } 1364272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold if (len <= 0) { 13766afb5b535fe34cd6b33d2ef45aac24fac9370f8Greg Kroah-Hartman dev_dbg(&port->dev, "%s - malformed packet\n", __func__); 1384272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold return 0; 1393fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo } 1403fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1414272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold tty_insert_flip_string(tty, packet, len); 1423fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1434272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold return len; 1443fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo} 1453fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1464272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovoldstatic void aircable_process_read_urb(struct urb *urb) 1473fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo{ 1483fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo struct usb_serial_port *port = urb->context; 1494272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold char *data = (char *)urb->transfer_buffer; 1503fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo struct tty_struct *tty; 1514272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold int has_headers; 1524272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold int count; 1534272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold int len; 1544272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold int i; 1553fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1564a90f09b20f4622dcbff1f0e1e6bae1704f8ad8cAlan Cox tty = tty_port_tty_get(&port->port); 1574272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold if (!tty) 1584272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold return; 1593fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1604272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold has_headers = (urb->actual_length > 2 && data[0] == RX_HEADER_0); 1613fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1624272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold count = 0; 1634272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold for (i = 0; i < urb->actual_length; i += HCI_COMPLETE_FRAME) { 1644272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold len = min_t(int, urb->actual_length - i, HCI_COMPLETE_FRAME); 1654272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold count += aircable_process_packet(tty, port, has_headers, 1664272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold &data[i], len); 1673fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo } 1683fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1694272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold if (count) 1704272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold tty_flip_buffer_push(tty); 1714272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold tty_kref_put(tty); 1723fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo} 1733fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1743fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjostatic struct usb_serial_driver aircable_device = { 17552d67f0b5c1b1827cd842020d40bdde4f7d04f59Johannes Hölzl .driver = { 17652d67f0b5c1b1827cd842020d40bdde4f7d04f59Johannes Hölzl .owner = THIS_MODULE, 17752d67f0b5c1b1827cd842020d40bdde4f7d04f59Johannes Hölzl .name = "aircable", 17852d67f0b5c1b1827cd842020d40bdde4f7d04f59Johannes Hölzl }, 1793fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo .id_table = id_table, 1803fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo .num_ports = 1, 1814272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold .bulk_out_size = HCI_COMPLETE_FRAME, 1823fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo .probe = aircable_probe, 1834272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold .process_read_urb = aircable_process_read_urb, 1844272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold .prepare_write_buffer = aircable_prepare_write_buffer, 1854272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold .throttle = usb_serial_generic_throttle, 1864272568b3dd8dbad36014a107c0fbbef6400c917Johan Hovold .unthrottle = usb_serial_generic_unthrottle, 1873fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo}; 1883fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 18908a4f6bc2e7046ce50849d7589b7d0763926d808Alan Sternstatic struct usb_serial_driver * const serial_drivers[] = { 19008a4f6bc2e7046ce50849d7589b7d0763926d808Alan Stern &aircable_device, NULL 19108a4f6bc2e7046ce50849d7589b7d0763926d808Alan Stern}; 19208a4f6bc2e7046ce50849d7589b7d0763926d808Alan Stern 19368e24113457e437b1576670f2419b77ed0531e9eGreg Kroah-Hartmanmodule_usb_serial_driver(serial_drivers, id_table); 1943fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 1953fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco NaranjoMODULE_AUTHOR(DRIVER_AUTHOR); 1963fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco NaranjoMODULE_DESCRIPTION(DRIVER_DESC); 1973fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco NaranjoMODULE_VERSION(DRIVER_VERSION); 1983fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco NaranjoMODULE_LICENSE("GPL"); 1993fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjo 2003fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco Naranjomodule_param(debug, bool, S_IRUGO | S_IWUSR); 2013fe70ba2272c123cf38e4c577bf220f8bcf25366Manuel Francisco NaranjoMODULE_PARM_DESC(debug, "Debug enabled or not"); 202