Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
redrat3.c File Reference
#include <linux/device.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/usb/input.h>
#include <media/rc-core.h>

Go to the source code of this file.

Data Structures

struct  redrat3_dev
 
struct  redrat3_signal_header
 

Macros

#define DRIVER_VERSION   "0.70"
 
#define DRIVER_AUTHOR   "Jarod Wilson <[email protected]>"
 
#define DRIVER_AUTHOR2   "The Dweller, Stephen Cox"
 
#define DRIVER_DESC   "RedRat3 USB IR Transceiver Driver"
 
#define DRIVER_NAME   "redrat3"
 
#define RR3_DEBUG_STANDARD   0x1
 
#define RR3_DEBUG_FUNCTION_TRACE   0x2
 
#define rr3_dbg(dev, fmt,...)
 
#define rr3_ftr(dev, fmt,...)
 
#define RR3_ERROR   0x01
 
#define RR3_MOD_SIGNAL_IN   0x20
 
#define RR3_MOD_SIGNAL_OUT   0x21
 
#define RR3_FW_VERSION   0xb1
 
#define RR3_FW_VERSION_LEN   64
 
#define RR3_TX_SEND_SIGNAL   0xb3
 
#define RR3_SET_IR_PARAM   0xb7
 
#define RR3_GET_IR_PARAM   0xb8
 
#define RR3_BLINK_LED   0xb9
 
#define RR3_READ_SER_NO   0xba
 
#define RR3_SER_NO_LEN   4
 
#define RR3_RC_DET_ENABLE   0xbb
 
#define RR3_RC_DET_DISABLE   0xbc
 
#define RR3_RC_DET_STATUS   0xbd
 
#define RR3_RESET   0xa0
 
#define RR3_IR_IO_MAX_LENGTHS   0x01
 
#define RR3_IR_IO_PERIODS_MF   0x02
 
#define RR3_IR_IO_SIG_MEM_SIZE   0x03
 
#define RR3_IR_IO_LENGTH_FUZZ   0x04
 
#define RR3_IR_IO_SIG_TIMEOUT   0x05
 
#define RR3_IR_IO_MIN_PAUSE   0x06
 
#define RR3_CLK   24000000
 
#define RR3_CLK_PER_COUNT   12
 
#define RR3_CLK_CONV_FACTOR   2000000
 
#define RR3_BULK_IN_EP_ADDR   0x82
 
#define RR3_PAUSE_OFFSET   0
 
#define RR3_FREQ_COUNT_OFFSET   4
 
#define RR3_NUM_PERIOD_OFFSET   6
 
#define RR3_MAX_LENGTHS_OFFSET   8
 
#define RR3_NUM_LENGTHS_OFFSET   9
 
#define RR3_MAX_SIGS_OFFSET   10
 
#define RR3_NUM_SIGS_OFFSET   12
 
#define RR3_REPEATS_OFFSET   14
 
#define RR3_HEADER_LENGTH   15
 
#define RR3_DRIVER_MAXLENS   128
 
#define RR3_MAX_SIG_SIZE   512
 
#define RR3_MAX_BUF_SIZE   ((2 * RR3_HEADER_LENGTH) + RR3_DRIVER_MAXLENS + RR3_MAX_SIG_SIZE)
 
#define RR3_TIME_UNIT   50
 
#define RR3_END_OF_SIGNAL   0x7f
 
#define RR3_TX_HEADER_OFFSET   4
 
#define RR3_TX_TRAILER_LEN   2
 
#define RR3_RX_MIN_TIMEOUT   5
 
#define RR3_RX_MAX_TIMEOUT   2000
 
#define RR3_CPUCS_REG_ADDR   0x7f92
 
#define USB_RR3USB_VENDOR_ID   0x112a
 
#define USB_RR3USB_PRODUCT_ID   0x0001
 
#define USB_RR3IIUSB_PRODUCT_ID   0x0005
 

Functions

 module_usb_driver (redrat3_dev_driver)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_AUTHOR (DRIVER_AUTHOR2)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DEVICE_TABLE (usb, redrat3_dev_table)
 
 module_param (debug, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug,"Enable module debug spew. 0 = no debugging (default) ""0x1 = standard debug messages, 0x2 = function tracing debug. ""Flag bits are addative (i.e., 0x3 for both debug types).")
 

Macro Definition Documentation

#define DRIVER_AUTHOR   "Jarod Wilson <[email protected]>"

Definition at line 57 of file redrat3.c.

#define DRIVER_AUTHOR2   "The Dweller, Stephen Cox"

Definition at line 58 of file redrat3.c.

#define DRIVER_DESC   "RedRat3 USB IR Transceiver Driver"

Definition at line 59 of file redrat3.c.

#define DRIVER_NAME   "redrat3"

Definition at line 60 of file redrat3.c.

#define DRIVER_VERSION   "0.70"

Definition at line 56 of file redrat3.c.

#define RR3_BLINK_LED   0xb9

Definition at line 97 of file redrat3.c.

#define RR3_BULK_IN_EP_ADDR   0x82

Definition at line 130 of file redrat3.c.

#define RR3_CLK   24000000

Definition at line 124 of file redrat3.c.

#define RR3_CLK_CONV_FACTOR   2000000

Definition at line 128 of file redrat3.c.

#define RR3_CLK_PER_COUNT   12

Definition at line 126 of file redrat3.c.

#define RR3_CPUCS_REG_ADDR   0x7f92

Definition at line 156 of file redrat3.c.

#define rr3_dbg (   dev,
  fmt,
  ... 
)
Value:
do { \
dev_info(dev, fmt, ## __VA_ARGS__); \
} while (0)

Definition at line 72 of file redrat3.c.

#define RR3_DEBUG_FUNCTION_TRACE   0x2

Definition at line 70 of file redrat3.c.

#define RR3_DEBUG_STANDARD   0x1

Definition at line 69 of file redrat3.c.

#define RR3_DRIVER_MAXLENS   128

Definition at line 144 of file redrat3.c.

#define RR3_END_OF_SIGNAL   0x7f

Definition at line 149 of file redrat3.c.

#define RR3_ERROR   0x01

Definition at line 85 of file redrat3.c.

#define RR3_FREQ_COUNT_OFFSET   4

Definition at line 134 of file redrat3.c.

#define rr3_ftr (   dev,
  fmt,
  ... 
)
Value:
do { \
dev_info(dev, fmt, ## __VA_ARGS__); \
} while (0)

Definition at line 78 of file redrat3.c.

#define RR3_FW_VERSION   0xb1

Definition at line 90 of file redrat3.c.

#define RR3_FW_VERSION_LEN   64

Definition at line 91 of file redrat3.c.

#define RR3_GET_IR_PARAM   0xb8

Definition at line 95 of file redrat3.c.

#define RR3_HEADER_LENGTH   15

Definition at line 143 of file redrat3.c.

#define RR3_IR_IO_LENGTH_FUZZ   0x04

Definition at line 117 of file redrat3.c.

#define RR3_IR_IO_MAX_LENGTHS   0x01

Definition at line 111 of file redrat3.c.

#define RR3_IR_IO_MIN_PAUSE   0x06

Definition at line 121 of file redrat3.c.

#define RR3_IR_IO_PERIODS_MF   0x02

Definition at line 113 of file redrat3.c.

#define RR3_IR_IO_SIG_MEM_SIZE   0x03

Definition at line 115 of file redrat3.c.

#define RR3_IR_IO_SIG_TIMEOUT   0x05

Definition at line 119 of file redrat3.c.

#define RR3_MAX_BUF_SIZE   ((2 * RR3_HEADER_LENGTH) + RR3_DRIVER_MAXLENS + RR3_MAX_SIG_SIZE)

Definition at line 146 of file redrat3.c.

#define RR3_MAX_LENGTHS_OFFSET   8

Definition at line 136 of file redrat3.c.

#define RR3_MAX_SIG_SIZE   512

Definition at line 145 of file redrat3.c.

#define RR3_MAX_SIGS_OFFSET   10

Definition at line 138 of file redrat3.c.

#define RR3_MOD_SIGNAL_IN   0x20

Definition at line 86 of file redrat3.c.

#define RR3_MOD_SIGNAL_OUT   0x21

Definition at line 87 of file redrat3.c.

#define RR3_NUM_LENGTHS_OFFSET   9

Definition at line 137 of file redrat3.c.

#define RR3_NUM_PERIOD_OFFSET   6

Definition at line 135 of file redrat3.c.

#define RR3_NUM_SIGS_OFFSET   12

Definition at line 139 of file redrat3.c.

#define RR3_PAUSE_OFFSET   0

Definition at line 133 of file redrat3.c.

#define RR3_RC_DET_DISABLE   0xbc

Definition at line 104 of file redrat3.c.

#define RR3_RC_DET_ENABLE   0xbb

Definition at line 102 of file redrat3.c.

#define RR3_RC_DET_STATUS   0xbd

Definition at line 106 of file redrat3.c.

#define RR3_READ_SER_NO   0xba

Definition at line 99 of file redrat3.c.

#define RR3_REPEATS_OFFSET   14

Definition at line 140 of file redrat3.c.

#define RR3_RESET   0xa0

Definition at line 108 of file redrat3.c.

#define RR3_RX_MAX_TIMEOUT   2000

Definition at line 153 of file redrat3.c.

#define RR3_RX_MIN_TIMEOUT   5

Definition at line 152 of file redrat3.c.

#define RR3_SER_NO_LEN   4

Definition at line 100 of file redrat3.c.

#define RR3_SET_IR_PARAM   0xb7

Definition at line 94 of file redrat3.c.

#define RR3_TIME_UNIT   50

Definition at line 148 of file redrat3.c.

#define RR3_TX_HEADER_OFFSET   4

Definition at line 150 of file redrat3.c.

#define RR3_TX_SEND_SIGNAL   0xb3

Definition at line 93 of file redrat3.c.

#define RR3_TX_TRAILER_LEN   2

Definition at line 151 of file redrat3.c.

#define USB_RR3IIUSB_PRODUCT_ID   0x0005

Definition at line 160 of file redrat3.c.

#define USB_RR3USB_PRODUCT_ID   0x0001

Definition at line 159 of file redrat3.c.

#define USB_RR3USB_VENDOR_ID   0x112a

Definition at line 158 of file redrat3.c.

Function Documentation

MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_AUTHOR ( DRIVER_AUTHOR2  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( usb  ,
redrat3_dev_table   
)
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( debug  ,
"Enable module debug spew.  0 = no debugging (default) ""0x1 = standard debug messages 
)
module_usb_driver ( redrat3_dev_driver  )