Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
spcp8x5.c File Reference
#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>
#include <linux/usb.h>
#include <linux/usb/serial.h>

Go to the source code of this file.

Data Structures

struct  spcp8x5_usb_ctrl_arg
 
struct  spcp8x5_private
 

Macros

#define DRIVER_VERSION   "v0.10"
 
#define DRIVER_DESC   "SPCP8x5 USB to serial adaptor driver"
 
#define SPCP8x5_007_VID   0x04FC
 
#define SPCP8x5_007_PID   0x0201
 
#define SPCP8x5_008_VID   0x04fc
 
#define SPCP8x5_008_PID   0x0235
 
#define SPCP8x5_PHILIPS_VID   0x0471
 
#define SPCP8x5_PHILIPS_PID   0x081e
 
#define SPCP8x5_INTERMATIC_VID   0x04FC
 
#define SPCP8x5_INTERMATIC_PID   0x0204
 
#define SPCP8x5_835_VID   0x04fc
 
#define SPCP8x5_835_PID   0x0231
 
#define MCR_CONTROL_LINE_RTS   0x02
 
#define MCR_CONTROL_LINE_DTR   0x01
 
#define MCR_DTR   0x01
 
#define MCR_RTS   0x02
 
#define MSR_STATUS_LINE_DCD   0x80
 
#define MSR_STATUS_LINE_RI   0x40
 
#define MSR_STATUS_LINE_DSR   0x20
 
#define MSR_STATUS_LINE_CTS   0x10
 
#define SET_DEFAULT   0x40
 
#define SET_DEFAULT_TYPE   0x20
 
#define SET_UART_FORMAT   0x40
 
#define SET_UART_FORMAT_TYPE   0x21
 
#define SET_UART_FORMAT_SIZE_5   0x00
 
#define SET_UART_FORMAT_SIZE_6   0x01
 
#define SET_UART_FORMAT_SIZE_7   0x02
 
#define SET_UART_FORMAT_SIZE_8   0x03
 
#define SET_UART_FORMAT_STOP_1   0x00
 
#define SET_UART_FORMAT_STOP_2   0x04
 
#define SET_UART_FORMAT_PAR_NONE   0x00
 
#define SET_UART_FORMAT_PAR_ODD   0x10
 
#define SET_UART_FORMAT_PAR_EVEN   0x30
 
#define SET_UART_FORMAT_PAR_MASK   0xD0
 
#define SET_UART_FORMAT_PAR_SPACE   0x90
 
#define GET_UART_STATUS_TYPE   0xc0
 
#define GET_UART_STATUS   0x22
 
#define GET_UART_STATUS_MSR   0x06
 
#define SET_UART_STATUS   0x40
 
#define SET_UART_STATUS_TYPE   0x23
 
#define SET_UART_STATUS_MCR   0x0004
 
#define SET_UART_STATUS_MCR_DTR   0x01
 
#define SET_UART_STATUS_MCR_RTS   0x02
 
#define SET_UART_STATUS_MCR_LOOP   0x10
 
#define SET_WORKING_MODE   0x40
 
#define SET_WORKING_MODE_TYPE   0x24
 
#define SET_WORKING_MODE_U2C   0x00
 
#define SET_WORKING_MODE_RS485   0x01
 
#define SET_WORKING_MODE_PDMA   0x02
 
#define SET_WORKING_MODE_SPP   0x03
 
#define SET_FLOWCTL_CHAR   0x40
 
#define SET_FLOWCTL_CHAR_TYPE   0x25
 
#define GET_VERSION   0xc0
 
#define GET_VERSION_TYPE   0x26
 
#define SET_REGISTER   0x40
 
#define SET_REGISTER_TYPE   0x27
 
#define GET_REGISTER   0xc0
 
#define GET_REGISTER_TYPE   0x28
 
#define SET_RAM   0x40
 
#define SET_RAM_TYPE   0x31
 
#define GET_RAM   0xc0
 
#define GET_RAM_TYPE   0x32
 
#define UART_STATE   0x08
 
#define UART_STATE_TRANSIENT_MASK   0x75
 
#define UART_DCD   0x01
 
#define UART_DSR   0x02
 
#define UART_BREAK_ERROR   0x04
 
#define UART_RING   0x08
 
#define UART_FRAME_ERROR   0x10
 
#define UART_PARITY_ERROR   0x20
 
#define UART_OVERRUN_ERROR   0x40
 
#define UART_CTS   0x80
 

Enumerations

enum  spcp8x5_type {
  SPCP825_007_TYPE, SPCP825_008_TYPE, SPCP825_PHILIP_TYPE, SPCP825_INTERMATIC_TYPE,
  SPCP835_TYPE
}
 

Functions

 MODULE_DEVICE_TABLE (usb, id_table)
 
 module_usb_serial_driver (serial_drivers, id_table)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_VERSION (DRIVER_VERSION)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DRIVER_DESC   "SPCP8x5 USB to serial adaptor driver"

Definition at line 34 of file spcp8x5.c.

#define DRIVER_VERSION   "v0.10"

Definition at line 33 of file spcp8x5.c.

#define GET_RAM   0xc0

Definition at line 129 of file spcp8x5.c.

#define GET_RAM_TYPE   0x32

Definition at line 130 of file spcp8x5.c.

#define GET_REGISTER   0xc0

Definition at line 123 of file spcp8x5.c.

#define GET_REGISTER_TYPE   0x28

Definition at line 124 of file spcp8x5.c.

#define GET_UART_STATUS   0x22

Definition at line 97 of file spcp8x5.c.

#define GET_UART_STATUS_MSR   0x06

Definition at line 98 of file spcp8x5.c.

#define GET_UART_STATUS_TYPE   0xc0

Definition at line 96 of file spcp8x5.c.

#define GET_VERSION   0xc0

Definition at line 117 of file spcp8x5.c.

#define GET_VERSION_TYPE   0x26

Definition at line 118 of file spcp8x5.c.

#define MCR_CONTROL_LINE_DTR   0x01

Definition at line 69 of file spcp8x5.c.

#define MCR_CONTROL_LINE_RTS   0x02

Definition at line 68 of file spcp8x5.c.

#define MCR_DTR   0x01

Definition at line 70 of file spcp8x5.c.

#define MCR_RTS   0x02

Definition at line 71 of file spcp8x5.c.

#define MSR_STATUS_LINE_CTS   0x10

Definition at line 76 of file spcp8x5.c.

#define MSR_STATUS_LINE_DCD   0x80

Definition at line 73 of file spcp8x5.c.

#define MSR_STATUS_LINE_DSR   0x20

Definition at line 75 of file spcp8x5.c.

#define MSR_STATUS_LINE_RI   0x40

Definition at line 74 of file spcp8x5.c.

#define SET_DEFAULT   0x40

Definition at line 79 of file spcp8x5.c.

#define SET_DEFAULT_TYPE   0x20

Definition at line 80 of file spcp8x5.c.

#define SET_FLOWCTL_CHAR   0x40

Definition at line 114 of file spcp8x5.c.

#define SET_FLOWCTL_CHAR_TYPE   0x25

Definition at line 115 of file spcp8x5.c.

#define SET_RAM   0x40

Definition at line 126 of file spcp8x5.c.

#define SET_RAM_TYPE   0x31

Definition at line 127 of file spcp8x5.c.

#define SET_REGISTER   0x40

Definition at line 120 of file spcp8x5.c.

#define SET_REGISTER_TYPE   0x27

Definition at line 121 of file spcp8x5.c.

#define SET_UART_FORMAT   0x40

Definition at line 82 of file spcp8x5.c.

#define SET_UART_FORMAT_PAR_EVEN   0x30

Definition at line 92 of file spcp8x5.c.

#define SET_UART_FORMAT_PAR_MASK   0xD0

Definition at line 93 of file spcp8x5.c.

#define SET_UART_FORMAT_PAR_NONE   0x00

Definition at line 90 of file spcp8x5.c.

#define SET_UART_FORMAT_PAR_ODD   0x10

Definition at line 91 of file spcp8x5.c.

#define SET_UART_FORMAT_PAR_SPACE   0x90

Definition at line 94 of file spcp8x5.c.

#define SET_UART_FORMAT_SIZE_5   0x00

Definition at line 84 of file spcp8x5.c.

#define SET_UART_FORMAT_SIZE_6   0x01

Definition at line 85 of file spcp8x5.c.

#define SET_UART_FORMAT_SIZE_7   0x02

Definition at line 86 of file spcp8x5.c.

#define SET_UART_FORMAT_SIZE_8   0x03

Definition at line 87 of file spcp8x5.c.

#define SET_UART_FORMAT_STOP_1   0x00

Definition at line 88 of file spcp8x5.c.

#define SET_UART_FORMAT_STOP_2   0x04

Definition at line 89 of file spcp8x5.c.

#define SET_UART_FORMAT_TYPE   0x21

Definition at line 83 of file spcp8x5.c.

#define SET_UART_STATUS   0x40

Definition at line 100 of file spcp8x5.c.

#define SET_UART_STATUS_MCR   0x0004

Definition at line 102 of file spcp8x5.c.

#define SET_UART_STATUS_MCR_DTR   0x01

Definition at line 103 of file spcp8x5.c.

#define SET_UART_STATUS_MCR_LOOP   0x10

Definition at line 105 of file spcp8x5.c.

#define SET_UART_STATUS_MCR_RTS   0x02

Definition at line 104 of file spcp8x5.c.

#define SET_UART_STATUS_TYPE   0x23

Definition at line 101 of file spcp8x5.c.

#define SET_WORKING_MODE   0x40

Definition at line 107 of file spcp8x5.c.

#define SET_WORKING_MODE_PDMA   0x02

Definition at line 111 of file spcp8x5.c.

#define SET_WORKING_MODE_RS485   0x01

Definition at line 110 of file spcp8x5.c.

#define SET_WORKING_MODE_SPP   0x03

Definition at line 112 of file spcp8x5.c.

#define SET_WORKING_MODE_TYPE   0x24

Definition at line 108 of file spcp8x5.c.

#define SET_WORKING_MODE_U2C   0x00

Definition at line 109 of file spcp8x5.c.

#define SPCP8x5_007_PID   0x0201

Definition at line 37 of file spcp8x5.c.

#define SPCP8x5_007_VID   0x04FC

Definition at line 36 of file spcp8x5.c.

#define SPCP8x5_008_PID   0x0235

Definition at line 39 of file spcp8x5.c.

#define SPCP8x5_008_VID   0x04fc

Definition at line 38 of file spcp8x5.c.

#define SPCP8x5_835_PID   0x0231

Definition at line 45 of file spcp8x5.c.

#define SPCP8x5_835_VID   0x04fc

Definition at line 44 of file spcp8x5.c.

#define SPCP8x5_INTERMATIC_PID   0x0204

Definition at line 43 of file spcp8x5.c.

#define SPCP8x5_INTERMATIC_VID   0x04FC

Definition at line 42 of file spcp8x5.c.

#define SPCP8x5_PHILIPS_PID   0x081e

Definition at line 41 of file spcp8x5.c.

#define SPCP8x5_PHILIPS_VID   0x0471

Definition at line 40 of file spcp8x5.c.

#define UART_BREAK_ERROR   0x04

Definition at line 137 of file spcp8x5.c.

#define UART_CTS   0x80

Definition at line 142 of file spcp8x5.c.

#define UART_DCD   0x01

Definition at line 135 of file spcp8x5.c.

#define UART_DSR   0x02

Definition at line 136 of file spcp8x5.c.

#define UART_FRAME_ERROR   0x10

Definition at line 139 of file spcp8x5.c.

#define UART_OVERRUN_ERROR   0x40

Definition at line 141 of file spcp8x5.c.

#define UART_PARITY_ERROR   0x20

Definition at line 140 of file spcp8x5.c.

#define UART_RING   0x08

Definition at line 138 of file spcp8x5.c.

#define UART_STATE   0x08

Definition at line 133 of file spcp8x5.c.

#define UART_STATE_TRANSIENT_MASK   0x75

Definition at line 134 of file spcp8x5.c.

Enumeration Type Documentation

Enumerator:
SPCP825_007_TYPE 
SPCP825_008_TYPE 
SPCP825_PHILIP_TYPE 
SPCP825_INTERMATIC_TYPE 
SPCP835_TYPE 

Definition at line 144 of file spcp8x5.c.

Function Documentation

MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( usb  ,
id_table   
)
MODULE_LICENSE ( "GPL"  )
module_usb_serial_driver ( serial_drivers  ,
id_table   
)
MODULE_VERSION ( DRIVER_VERSION  )