Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
safe_serial.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/gfp.h>
#include <linux/init.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define CONFIG_USB_SERIAL_SAFE_PADDED   0
 
#define DRIVER_AUTHOR   "[email protected], tbr@lineo.com, Johan Hovold <[email protected]>"
 
#define DRIVER_DESC   "USB Safe Encapsulated Serial"
 
#define CDC_DEVICE_CLASS   0x02
 
#define CDC_INTERFACE_CLASS   0x02
 
#define CDC_INTERFACE_SUBCLASS   0x06
 
#define LINEO_INTERFACE_CLASS   0xff
 
#define LINEO_INTERFACE_SUBCLASS_SAFENET   0x01
 
#define LINEO_SAFENET_CRC   0x01
 
#define LINEO_SAFENET_CRC_PADDED   0x02
 
#define LINEO_INTERFACE_SUBCLASS_SAFESERIAL   0x02
 
#define LINEO_SAFESERIAL_CRC   0x01
 
#define LINEO_SAFESERIAL_CRC_PADDED   0x02
 
#define MY_USB_DEVICE(vend, prod, dc, ic, isc)
 
#define CRC10_INITFCS   0x000 /* Initial FCS value */
 
#define CRC10_GOODFCS   0x000 /* Good final FCS value */
 
#define CRC10_FCS(fcs, c)   ((((fcs) << 8) & 0x3ff) ^ crc10_table[((fcs) >> 2) & 0xff] ^ (c))
 

Functions

 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL")
 
 module_param (vendor, ushort, 0)
 
 MODULE_PARM_DESC (vendor,"User specified USB idVendor (required)")
 
 module_param (product, ushort, 0)
 
 MODULE_PARM_DESC (product,"User specified USB idProduct (required)")
 
 module_param (safe, bool, 0)
 
 MODULE_PARM_DESC (safe,"Turn Safe Encapsulation On/Off")
 
 module_param (padded, bool, 0)
 
 MODULE_PARM_DESC (padded,"Pad to full wMaxPacketSize On/Off")
 
 MODULE_DEVICE_TABLE (usb, id_table)
 
 module_init (safe_init)
 
 module_exit (safe_exit)
 

Macro Definition Documentation

#define CDC_DEVICE_CLASS   0x02

Definition at line 108 of file safe_serial.c.

#define CDC_INTERFACE_CLASS   0x02

Definition at line 110 of file safe_serial.c.

#define CDC_INTERFACE_SUBCLASS   0x06

Definition at line 111 of file safe_serial.c.

#define CONFIG_USB_SERIAL_SAFE_PADDED   0

Definition at line 82 of file safe_serial.c.

#define CRC10_FCS (   fcs,
  c 
)    ((((fcs) << 8) & 0x3ff) ^ crc10_table[((fcs) >> 2) & 0xff] ^ (c))

Definition at line 187 of file safe_serial.c.

#define CRC10_GOODFCS   0x000 /* Good final FCS value */

Definition at line 186 of file safe_serial.c.

#define CRC10_INITFCS   0x000 /* Initial FCS value */

Definition at line 185 of file safe_serial.c.

#define DRIVER_AUTHOR   "[email protected], tbr@lineo.com, Johan Hovold <[email protected]>"

Definition at line 88 of file safe_serial.c.

#define DRIVER_DESC   "USB Safe Encapsulated Serial"

Definition at line 89 of file safe_serial.c.

#define LINEO_INTERFACE_CLASS   0xff

Definition at line 113 of file safe_serial.c.

#define LINEO_INTERFACE_SUBCLASS_SAFENET   0x01

Definition at line 115 of file safe_serial.c.

#define LINEO_INTERFACE_SUBCLASS_SAFESERIAL   0x02

Definition at line 119 of file safe_serial.c.

#define LINEO_SAFENET_CRC   0x01

Definition at line 116 of file safe_serial.c.

#define LINEO_SAFENET_CRC_PADDED   0x02

Definition at line 117 of file safe_serial.c.

#define LINEO_SAFESERIAL_CRC   0x01

Definition at line 120 of file safe_serial.c.

#define LINEO_SAFESERIAL_CRC_PADDED   0x02

Definition at line 121 of file safe_serial.c.

#define MY_USB_DEVICE (   vend,
  prod,
  dc,
  ic,
  isc 
)
Value:
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
USB_DEVICE_ID_MATCH_DEV_CLASS | \
USB_DEVICE_ID_MATCH_INT_CLASS | \
USB_DEVICE_ID_MATCH_INT_SUBCLASS, \
.idVendor = (vend), \
.idProduct = (prod),\
.bDeviceClass = (dc),\
.bInterfaceClass = (ic), \
.bInterfaceSubClass = (isc),

Definition at line 124 of file safe_serial.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 65 of file safe_serial.c.

Function Documentation

MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( usb  ,
id_table   
)
module_exit ( safe_exit  )
module_init ( safe_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( vendor  ,
ushort  ,
 
)
module_param ( product  ,
ushort  ,
 
)
module_param ( safe  ,
bool  ,
 
)
module_param ( padded  ,
bool  ,
 
)
MODULE_PARM_DESC ( vendor  ,
"User specified USB idVendor (required)"   
)
MODULE_PARM_DESC ( product  ,
"User specified USB idProduct (required)"   
)
MODULE_PARM_DESC ( safe  ,
"Turn Safe Encapsulation On/Off"   
)
MODULE_PARM_DESC ( padded  ,
"Pad to full wMaxPacketSize On/Off"   
)