linux-old/drivers/usb/dabusb.h
<<
>>
Prefs
   1#define _BULK_DATA_LEN 64
   2typedef struct
   3{
   4        unsigned char data[_BULK_DATA_LEN];
   5        unsigned int size;
   6        unsigned int pipe;
   7}bulk_transfer_t,*pbulk_transfer_t;
   8
   9#define DABUSB_MINOR 240                /* some unassigned USB minor */
  10#define DABUSB_VERSION 0x1000
  11#define IOCTL_DAB_BULK              _IOWR('d', 0x30, bulk_transfer_t)
  12#define IOCTL_DAB_OVERRUNS          _IOR('d',  0x15, int)
  13#define IOCTL_DAB_VERSION           _IOR('d', 0x3f, int) 
  14
  15#ifdef __KERNEL__
  16
  17typedef enum { _stopped=0, _started } driver_state_t;
  18
  19typedef struct
  20{
  21        struct semaphore mutex;
  22        struct usb_device *usbdev;
  23        wait_queue_head_t wait;
  24        wait_queue_head_t remove_ok;
  25        spinlock_t lock;
  26        atomic_t pending_io;
  27        driver_state_t state;
  28        int remove_pending;
  29        int got_mem;
  30        int total_buffer_size;
  31        unsigned int overruns;
  32        int readptr;
  33        int opened;
  34        struct list_head free_buff_list;
  35        struct list_head rec_buff_list;
  36} dabusb_t,*pdabusb_t;
  37
  38typedef struct 
  39{
  40        pdabusb_t s;
  41        struct urb *purb;
  42        struct list_head buff_list;
  43} buff_t,*pbuff_t;
  44
  45typedef struct
  46{
  47        wait_queue_head_t wait;
  48} bulk_completion_context_t, *pbulk_completion_context_t;
  49
  50
  51#define _DABUSB_IF 2
  52#define _DABUSB_ISOPIPE 0x09
  53#define _ISOPIPESIZE    16384
  54
  55#define _BULK_DATA_LEN 64
  56// Vendor specific request code for Anchor Upload/Download
  57// This one is implemented in the core
  58#define ANCHOR_LOAD_INTERNAL  0xA0
  59
  60// EZ-USB Control and Status Register.  Bit 0 controls 8051 reset
  61#define CPUCS_REG    0x7F92
  62#define _TOTAL_BUFFERS 384
  63
  64#define MAX_INTEL_HEX_RECORD_LENGTH 16
  65
  66#ifndef _BYTE_DEFINED
  67#define _BYTE_DEFINED
  68typedef unsigned char BYTE;
  69#endif // !_BYTE_DEFINED
  70
  71#ifndef _WORD_DEFINED
  72#define _WORD_DEFINED
  73typedef unsigned short WORD;
  74#endif // !_WORD_DEFINED
  75
  76typedef struct _INTEL_HEX_RECORD
  77{
  78   BYTE  Length;
  79   WORD  Address;
  80   BYTE  Type;
  81   BYTE  Data[MAX_INTEL_HEX_RECORD_LENGTH];
  82} INTEL_HEX_RECORD, *PINTEL_HEX_RECORD;
  83
  84#endif
  85
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.