Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ldusb.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <linux/input.h>
#include <linux/usb.h>
#include <linux/poll.h>

Go to the source code of this file.

Data Structures

struct  ld_usb
 

Macros

#define USB_VENDOR_ID_LD   0x0f11 /* USB Vendor ID of LD Didactic GmbH */
 
#define USB_DEVICE_ID_LD_CASSY   0x1000 /* USB Product ID of CASSY-S modules with 8 bytes endpoint size */
 
#define USB_DEVICE_ID_LD_CASSY2   0x1001 /* USB Product ID of CASSY-S modules with 64 bytes endpoint size */
 
#define USB_DEVICE_ID_LD_POCKETCASSY   0x1010 /* USB Product ID of Pocket-CASSY */
 
#define USB_DEVICE_ID_LD_POCKETCASSY2   0x1011 /* USB Product ID of Pocket-CASSY 2 (reserved) */
 
#define USB_DEVICE_ID_LD_MOBILECASSY   0x1020 /* USB Product ID of Mobile-CASSY */
 
#define USB_DEVICE_ID_LD_MOBILECASSY2   0x1021 /* USB Product ID of Mobile-CASSY 2 (reserved) */
 
#define USB_DEVICE_ID_LD_MICROCASSYVOLTAGE   0x1031 /* USB Product ID of Micro-CASSY Voltage */
 
#define USB_DEVICE_ID_LD_MICROCASSYCURRENT   0x1032 /* USB Product ID of Micro-CASSY Current */
 
#define USB_DEVICE_ID_LD_MICROCASSYTIME   0x1033 /* USB Product ID of Micro-CASSY Time (reserved) */
 
#define USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE   0x1035 /* USB Product ID of Micro-CASSY Temperature */
 
#define USB_DEVICE_ID_LD_MICROCASSYPH   0x1038 /* USB Product ID of Micro-CASSY pH */
 
#define USB_DEVICE_ID_LD_JWM   0x1080 /* USB Product ID of Joule and Wattmeter */
 
#define USB_DEVICE_ID_LD_DMMP   0x1081 /* USB Product ID of Digital Multimeter P (reserved) */
 
#define USB_DEVICE_ID_LD_UMIP   0x1090 /* USB Product ID of UMI P */
 
#define USB_DEVICE_ID_LD_UMIC   0x10A0 /* USB Product ID of UMI C */
 
#define USB_DEVICE_ID_LD_UMIB   0x10B0 /* USB Product ID of UMI B */
 
#define USB_DEVICE_ID_LD_XRAY   0x1100 /* USB Product ID of X-Ray Apparatus 55481 */
 
#define USB_DEVICE_ID_LD_XRAY2   0x1101 /* USB Product ID of X-Ray Apparatus 554800 */
 
#define USB_DEVICE_ID_LD_XRAYCT   0x1110 /* USB Product ID of X-Ray Apparatus CT 554821*/
 
#define USB_DEVICE_ID_LD_VIDEOCOM   0x1200 /* USB Product ID of VideoCom */
 
#define USB_DEVICE_ID_LD_MOTOR   0x1210 /* USB Product ID of Motor (reserved) */
 
#define USB_DEVICE_ID_LD_COM3LAB   0x2000 /* USB Product ID of COM3LAB */
 
#define USB_DEVICE_ID_LD_TELEPORT   0x2010 /* USB Product ID of Terminal Adapter */
 
#define USB_DEVICE_ID_LD_NETWORKANALYSER   0x2020 /* USB Product ID of Network Analyser */
 
#define USB_DEVICE_ID_LD_POWERCONTROL   0x2030 /* USB Product ID of Converter Control Unit */
 
#define USB_DEVICE_ID_LD_MACHINETEST   0x2040 /* USB Product ID of Machine Test System */
 
#define USB_DEVICE_ID_LD_MOSTANALYSER   0x2050 /* USB Product ID of MOST Protocol Analyser */
 
#define USB_DEVICE_ID_LD_MOSTANALYSER2   0x2051 /* USB Product ID of MOST Protocol Analyser 2 */
 
#define USB_DEVICE_ID_LD_ABSESP   0x2060 /* USB Product ID of ABS ESP */
 
#define USB_DEVICE_ID_LD_AUTODATABUS   0x2070 /* USB Product ID of Automotive Data Buses */
 
#define USB_DEVICE_ID_LD_MCT   0x2080 /* USB Product ID of Microcontroller technique */
 
#define USB_DEVICE_ID_LD_HYBRID   0x2090 /* USB Product ID of Automotive Hybrid */
 
#define USB_DEVICE_ID_LD_HEATCONTROL   0x20A0 /* USB Product ID of Heat control */
 
#define USB_VENDOR_ID_VERNIER   0x08f7
 
#define USB_DEVICE_ID_VERNIER_GOTEMP   0x0002
 
#define USB_DEVICE_ID_VERNIER_SKIP   0x0003
 
#define USB_DEVICE_ID_VERNIER_CYCLOPS   0x0004
 
#define USB_DEVICE_ID_VERNIER_LCSPEC   0x0006
 
#define USB_LD_MINOR_BASE   176
 
#define dbg_info(dev, format, arg...)   do { if (debug) dev_info(dev , format , ## arg); } while (0)
 

Functions

 MODULE_DEVICE_TABLE (usb, ld_usb_table)
 
 MODULE_VERSION ("V0.14")
 
 MODULE_AUTHOR ("Michael Hund <mhund@ld-didactic.de>")
 
 MODULE_DESCRIPTION ("LD USB Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("LD USB Devices")
 
 module_param (debug, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug,"Debug enabled or not")
 
 module_param (ring_buffer_size, int, 0)
 
 MODULE_PARM_DESC (ring_buffer_size,"Read ring buffer size in reports")
 
 module_param (write_buffer_size, int, 0)
 
 MODULE_PARM_DESC (write_buffer_size,"Write buffer size in reports")
 
 module_param (min_interrupt_in_interval, int, 0)
 
 MODULE_PARM_DESC (min_interrupt_in_interval,"Minimum interrupt in interval in ms")
 
 module_param (min_interrupt_out_interval, int, 0)
 
 MODULE_PARM_DESC (min_interrupt_out_interval,"Minimum interrupt out interval in ms")
 
 module_usb_driver (ld_usb_driver)
 

Macro Definition Documentation

#define dbg_info (   dev,
  format,
  arg... 
)    do { if (debug) dev_info(dev , format , ## arg); } while (0)

Definition at line 139 of file ldusb.c.

#define USB_DEVICE_ID_LD_ABSESP   0x2060 /* USB Product ID of ABS ESP */

Definition at line 67 of file ldusb.c.

#define USB_DEVICE_ID_LD_AUTODATABUS   0x2070 /* USB Product ID of Automotive Data Buses */

Definition at line 68 of file ldusb.c.

#define USB_DEVICE_ID_LD_CASSY   0x1000 /* USB Product ID of CASSY-S modules with 8 bytes endpoint size */

Definition at line 39 of file ldusb.c.

#define USB_DEVICE_ID_LD_CASSY2   0x1001 /* USB Product ID of CASSY-S modules with 64 bytes endpoint size */

Definition at line 40 of file ldusb.c.

#define USB_DEVICE_ID_LD_COM3LAB   0x2000 /* USB Product ID of COM3LAB */

Definition at line 60 of file ldusb.c.

#define USB_DEVICE_ID_LD_DMMP   0x1081 /* USB Product ID of Digital Multimeter P (reserved) */

Definition at line 51 of file ldusb.c.

#define USB_DEVICE_ID_LD_HEATCONTROL   0x20A0 /* USB Product ID of Heat control */

Definition at line 71 of file ldusb.c.

#define USB_DEVICE_ID_LD_HYBRID   0x2090 /* USB Product ID of Automotive Hybrid */

Definition at line 70 of file ldusb.c.

#define USB_DEVICE_ID_LD_JWM   0x1080 /* USB Product ID of Joule and Wattmeter */

Definition at line 50 of file ldusb.c.

#define USB_DEVICE_ID_LD_MACHINETEST   0x2040 /* USB Product ID of Machine Test System */

Definition at line 64 of file ldusb.c.

#define USB_DEVICE_ID_LD_MCT   0x2080 /* USB Product ID of Microcontroller technique */

Definition at line 69 of file ldusb.c.

#define USB_DEVICE_ID_LD_MICROCASSYCURRENT   0x1032 /* USB Product ID of Micro-CASSY Current */

Definition at line 46 of file ldusb.c.

#define USB_DEVICE_ID_LD_MICROCASSYPH   0x1038 /* USB Product ID of Micro-CASSY pH */

Definition at line 49 of file ldusb.c.

#define USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE   0x1035 /* USB Product ID of Micro-CASSY Temperature */

Definition at line 48 of file ldusb.c.

#define USB_DEVICE_ID_LD_MICROCASSYTIME   0x1033 /* USB Product ID of Micro-CASSY Time (reserved) */

Definition at line 47 of file ldusb.c.

#define USB_DEVICE_ID_LD_MICROCASSYVOLTAGE   0x1031 /* USB Product ID of Micro-CASSY Voltage */

Definition at line 45 of file ldusb.c.

#define USB_DEVICE_ID_LD_MOBILECASSY   0x1020 /* USB Product ID of Mobile-CASSY */

Definition at line 43 of file ldusb.c.

#define USB_DEVICE_ID_LD_MOBILECASSY2   0x1021 /* USB Product ID of Mobile-CASSY 2 (reserved) */

Definition at line 44 of file ldusb.c.

#define USB_DEVICE_ID_LD_MOSTANALYSER   0x2050 /* USB Product ID of MOST Protocol Analyser */

Definition at line 65 of file ldusb.c.

#define USB_DEVICE_ID_LD_MOSTANALYSER2   0x2051 /* USB Product ID of MOST Protocol Analyser 2 */

Definition at line 66 of file ldusb.c.

#define USB_DEVICE_ID_LD_MOTOR   0x1210 /* USB Product ID of Motor (reserved) */

Definition at line 59 of file ldusb.c.

#define USB_DEVICE_ID_LD_NETWORKANALYSER   0x2020 /* USB Product ID of Network Analyser */

Definition at line 62 of file ldusb.c.

#define USB_DEVICE_ID_LD_POCKETCASSY   0x1010 /* USB Product ID of Pocket-CASSY */

Definition at line 41 of file ldusb.c.

#define USB_DEVICE_ID_LD_POCKETCASSY2   0x1011 /* USB Product ID of Pocket-CASSY 2 (reserved) */

Definition at line 42 of file ldusb.c.

#define USB_DEVICE_ID_LD_POWERCONTROL   0x2030 /* USB Product ID of Converter Control Unit */

Definition at line 63 of file ldusb.c.

#define USB_DEVICE_ID_LD_TELEPORT   0x2010 /* USB Product ID of Terminal Adapter */

Definition at line 61 of file ldusb.c.

#define USB_DEVICE_ID_LD_UMIB   0x10B0 /* USB Product ID of UMI B */

Definition at line 54 of file ldusb.c.

#define USB_DEVICE_ID_LD_UMIC   0x10A0 /* USB Product ID of UMI C */

Definition at line 53 of file ldusb.c.

#define USB_DEVICE_ID_LD_UMIP   0x1090 /* USB Product ID of UMI P */

Definition at line 52 of file ldusb.c.

#define USB_DEVICE_ID_LD_VIDEOCOM   0x1200 /* USB Product ID of VideoCom */

Definition at line 58 of file ldusb.c.

#define USB_DEVICE_ID_LD_XRAY   0x1100 /* USB Product ID of X-Ray Apparatus 55481 */

Definition at line 55 of file ldusb.c.

#define USB_DEVICE_ID_LD_XRAY2   0x1101 /* USB Product ID of X-Ray Apparatus 554800 */

Definition at line 56 of file ldusb.c.

#define USB_DEVICE_ID_LD_XRAYCT   0x1110 /* USB Product ID of X-Ray Apparatus CT 554821*/

Definition at line 57 of file ldusb.c.

#define USB_DEVICE_ID_VERNIER_CYCLOPS   0x0004

Definition at line 76 of file ldusb.c.

#define USB_DEVICE_ID_VERNIER_GOTEMP   0x0002

Definition at line 74 of file ldusb.c.

#define USB_DEVICE_ID_VERNIER_LCSPEC   0x0006

Definition at line 77 of file ldusb.c.

#define USB_DEVICE_ID_VERNIER_SKIP   0x0003

Definition at line 75 of file ldusb.c.

#define USB_LD_MINOR_BASE   176

Definition at line 82 of file ldusb.c.

#define USB_VENDOR_ID_LD   0x0f11 /* USB Vendor ID of LD Didactic GmbH */

Generic USB driver for report based interrupt in/out devices like LD Didactic's USB devices. LD Didactic's USB devices are HID devices which do not use HID report definitons (they use raw interrupt in and our reports only for communication).

This driver uses a ring buffer for time critical reading of interrupt in reports and provides read and write methods for raw interrupt reports (similar to the Windows HID driver). Devices based on the book USB COMPLETE by Jan Axelson may need such a compatibility to the Windows HID driver.

Copyright (C) 2005 Michael Hund mhund.nosp@m.@ld-.nosp@m.didac.nosp@m.tic..nosp@m.de

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.

Derived from Lego USB Tower driver Copyright (C) 2003 David Glance advid.nosp@m.gsf@.nosp@m.sourc.nosp@m.efor.nosp@m.ge.ne.nosp@m.t 2001-2004 Juergen Stuber starb.nosp@m.lue@.nosp@m.users.nosp@m..sou.nosp@m.rcefo.nosp@m.rge..nosp@m.net

Definition at line 38 of file ldusb.c.

#define USB_VENDOR_ID_VERNIER   0x08f7

Definition at line 73 of file ldusb.c.

Function Documentation

MODULE_AUTHOR ( "Michael Hund <mhund@ld-didactic.de>"  )
MODULE_DESCRIPTION ( "LD USB Driver"  )
MODULE_DEVICE_TABLE ( usb  ,
ld_usb_table   
)
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( ring_buffer_size  ,
int  ,
 
)
module_param ( write_buffer_size  ,
int  ,
 
)
module_param ( min_interrupt_in_interval  ,
int  ,
 
)
module_param ( min_interrupt_out_interval  ,
int  ,
 
)
MODULE_PARM_DESC ( debug  ,
"Debug enabled or not"   
)
MODULE_PARM_DESC ( ring_buffer_size  ,
"Read ring buffer size in reports"   
)
MODULE_PARM_DESC ( write_buffer_size  ,
"Write buffer size in reports"   
)
MODULE_PARM_DESC ( min_interrupt_in_interval  ,
"Minimum interrupt in interval in ms  
)
MODULE_PARM_DESC ( min_interrupt_out_interval  ,
"Minimum interrupt out interval in ms  
)
MODULE_SUPPORTED_DEVICE ( "LD USB Devices"  )
module_usb_driver ( ld_usb_driver  )
MODULE_VERSION ( "V0.14"  )