Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
tranzport.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 <linux/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  tranzport_cmd
 
struct  usb_tranzport
 

Macros

#define VENDOR_ID   0x165b
 
#define PRODUCT_ID   0x8101
 
#define USB_TRANZPORT_MINOR_BASE   177
 
#define SUPPRESS_EXTRA_OFFLINE_EVENTS   1
 
#define COMPRESS_WHEEL_EVENTS   1
 
#define BUFFERED_READS   1
 
#define RING_BUFFER_SIZE   1000
 
#define WRITE_BUFFER_SIZE   34
 
#define TRANZPORT_USB_TIMEOUT   10
 
#define TRANZPORT_DEBUG   0
 
#define dbg_info(dev, format, arg...)
 
#define show_int(value)
 
#define show_set_int(value)
 

Functions

 MODULE_DEVICE_TABLE (usb, usb_tranzport_table)
 
 MODULE_VERSION ("0.35")
 
 MODULE_AUTHOR ("Mike Taht <m@taht.net>")
 
 MODULE_DESCRIPTION ("Tranzport USB Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("Frontier Designs Tranzport Control Surface")
 
 module_param (debug, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug,"Debug enabled or not")
 
 module_param (ring_buffer_size, int, S_IRUGO)
 
 MODULE_PARM_DESC (ring_buffer_size,"Read ring buffer size in reports")
 
 module_param (write_buffer_size, int, S_IRUGO)
 
 MODULE_PARM_DESC (write_buffer_size,"Write buffer size")
 
 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")
 
 show_int (enable)
 
 show_int (offline)
 
 show_set_int (compress_wheel)
 
 module_usb_driver (usb_tranzport_driver)
 

Macro Definition Documentation

#define BUFFERED_READS   1

Definition at line 72 of file tranzport.c.

#define COMPRESS_WHEEL_EVENTS   1

Definition at line 71 of file tranzport.c.

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

Definition at line 81 of file tranzport.c.

#define PRODUCT_ID   0x8101

Definition at line 49 of file tranzport.c.

#define RING_BUFFER_SIZE   1000

Definition at line 73 of file tranzport.c.

#define show_int (   value)
Value:
static ssize_t show_##value(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usb_tranzport *t = usb_get_intfdata(intf); \
return sprintf(buf, "%d\n", t->value); \
} \
static DEVICE_ATTR(value, S_IRUGO, show_##value, NULL);

Definition at line 177 of file tranzport.c.

#define show_set_int (   value)
Value:
static ssize_t show_##value(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usb_tranzport *t = usb_get_intfdata(intf); \
return sprintf(buf, "%d\n", t->value); \
} \
static ssize_t set_##value(struct device *dev, \
const char *buf, size_t count) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usb_tranzport *t = usb_get_intfdata(intf); \
unsigned long temp; \
if (kstrtoul(buf, 10, &temp)) \
return -EINVAL; \
t->value = temp; \
return count; \
} \
static DEVICE_ATTR(value, S_IWUSR | S_IRUGO, show_##value, set_##value);

Definition at line 187 of file tranzport.c.

#define SUPPRESS_EXTRA_OFFLINE_EVENTS   1

Definition at line 70 of file tranzport.c.

#define TRANZPORT_DEBUG   0

Definition at line 76 of file tranzport.c.

#define TRANZPORT_USB_TIMEOUT   10

Definition at line 75 of file tranzport.c.

#define USB_TRANZPORT_MINOR_BASE   177

Definition at line 54 of file tranzport.c.

#define VENDOR_ID   0x165b

Definition at line 48 of file tranzport.c.

#define WRITE_BUFFER_SIZE   34

Definition at line 74 of file tranzport.c.

Function Documentation

MODULE_AUTHOR ( "Mike Taht <m@taht.net>"  )
MODULE_DESCRIPTION ( "Tranzport USB Driver"  )
MODULE_DEVICE_TABLE ( usb  ,
usb_tranzport_table   
)
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( ring_buffer_size  ,
int  ,
S_IRUGO   
)
module_param ( write_buffer_size  ,
int  ,
S_IRUGO   
)
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  
)
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 ( "Frontier Designs Tranzport Control Surface"  )
module_usb_driver ( usb_tranzport_driver  )
MODULE_VERSION ( "0.35"  )
show_int ( enable  )
show_int ( offline  )
show_set_int ( compress_wheel  )