Contiki 2.6

cdc.h

00001 #ifndef __CDC_H__K1Q26ESJOC__
00002 #define __CDC_H__K1Q26ESJOC__
00003 #include <usb.h>
00004 /*  Communication Class */
00005 /* Class code */
00006 #define CDC                     0x02
00007 
00008 /* Interface subclass codes */
00009 #define CDC_RESERVED            0x00
00010 #define DIRECT_LINE_CONTROL_MODEL 0x01
00011 #define ABSTRACT_CONTROL_MODEL  0x02
00012 #define TELEPHONE_CONTROL_MODEL 0x03
00013 #define MULTI_CHANNEL_CONTROL_MODEL 0x04
00014 #define CAPI_CONTROL_MODEL      0x05
00015 #define ETHERNET_NETWORKING_CONTROL_MODEL 0x06
00016 #define ATM_NETWORKING_CONTROL_MODEL 0x07
00017 
00018 /* Protocols */
00019 #define V_25TER_PROTOCOL        0x01
00020 
00021 /* Requests */
00022 #define SEND_ENCAPSULATED_COMMAND 0x00
00023 #define GET_ENCAPSULATED_RESPONSE 0x01
00024 #define SET_COMM_FEATURE        0x02
00025 #define GET_COMM_FEATURE        0x03
00026 #define CLEAR_COMM_FEATURE      0x04
00027 
00028 #define SET_AUX_LINE_STATE      0x10
00029 #define SET_HOOK_STATE          0x11
00030 #define PULSE_SETUP             0x12
00031 #define SEND_PULSE              0x13
00032 #define SET_PULSE_TIME          0x14
00033 #define RING_AUX_JACK           0x15
00034 
00035 #define SET_LINE_CODING         0x20
00036 #define GET_LINE_CODING         0x21
00037 #define SET_CONTROL_LINE_STATE  0x22
00038 #define SEND_BREAK              0x23
00039 
00040 #define SET_RINGER_PARMS        0x30
00041 #define GET_RINGER_PARMS        0x31
00042 #define SET_OPERATION_PARMS     0x32
00043 #define GET_OPERATION_PARMS     0x33
00044 #define SET_LINE_PARMS          0x34
00045 #define GET_LINE_PARMS          0x35
00046 #define DIAL_DIGITS             0x36
00047 
00048 #define SET_UNIT_PARAMETER      0x37
00049 #define GET_UNIT_PARAMETER      0x38
00050 #define CLEAR_UNIT_PARAMETER    0x39
00051 
00052 #define GET_PROFILE             0x3a
00053 
00054 #define SET_ETHERNET_MULTICAST_FILTERS 0x40
00055 #define GET_ETHERNET_MULTICAST_FILTERS 0x41
00056 #define GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x42
00057 #define SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x43
00058 #define GET_ETHERNET_STATISTIC 0x44
00059 
00060 #define SET_ATM_D ATA_FORMAT    0x50
00061 #define GET_ATM_DEVICE_STATISTICS 0x51
00062 #define SET_ATM_DEFAULT_VC      0x52
00063 #define GET_ATM_VC_STATISTICS   0x53
00064 
00065 
00066 /* Notifications */
00067 #define NETWORK_CONNECTION      0x00
00068 #define RESPONSE_AVAILABLE      0x01
00069 
00070 #define AUX_JACK_HOOK_STATE     0x08
00071 #define RING_DETECT             0x09
00072 
00073 #define SERIAL_STATE            0x20
00074 
00075 #define CALL_STATE_CHANGE       0x28
00076 #define LINE_STATE_CHANGE       0x29
00077 #define CONNECTION_SPEED_CHANGE 0x2a
00078 
00079 /* Data interface */
00080 
00081 /* Class code */
00082 #define CDC_DATA                0x0a
00083 
00084 /* Protocols */
00085 #define I_430_PROTOCOL          0x30
00086 #define ISO_IEC_3_1993_PROTOCOL 0x31
00087 #define TRANSPARENT_PROTOCOL    0x32
00088 #define Q_921M_PROTOCOL         0x50
00089 #define Q_921_PROTOCOL          0x51
00090 #define Q_921TM_PROTOCOL        0x52
00091 #define V_42BIS_PROTOCOL        0x90
00092 #define Q_931_PROTOCOL          0x91
00093 #define V_120_PROTOCOL          0x93
00094 #define CDC_PROTOCOL            0xfe
00095 
00096 /* Descriptor subtypes */
00097 
00098 #define CDC_FUNC_DESCR_HEADER   0x00
00099 #define CDC_FUNC_DESCR_CALL_MGMNT 0x01
00100 #define CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT 0x02
00101 #define CDC_FUNC_DESCR_DIRECT_LINE_MGMNT 0x03
00102 #define CDC_FUNC_DESCR_RINGER_MGMNT 0x04
00103 #define CDC_FUNC_DESCR_TEL_STATE 0x05
00104 #define CDC_FUNC_DESCR_UNION    0x06
00105 #define CDC_FUNC_DESCR_COUNTRY  0x07
00106 #define CDC_FUNC_DESCR_TEL_MODE 0x08
00107 #define CDC_FUNC_DESCR_USB_TERM 0x09
00108 #define CDC_FUNC_DESCR_NET_TERM 0x0a
00109 #define CDC_FUNC_DESCR_PROTOCOL_UNIT 0x0b
00110 #define CDC_FUNC_DESCR_EXTENSION_UNIT 0x0c
00111 #define CDC_FUNC_DESCR_MULTICH_MGMNT 0x0d
00112 #define CDC_FUNC_DESCR_CAPI_MGMNT 0x0e
00113 #define CDC_FUNC_DESCR_ETHERNET 0x0f
00114 #define CDC_FUNC_DESCR_ATM      0x10
00115 
00116 
00117 
00118 struct usb_cdc_header_func_descriptor
00119 {
00120   Uchar  bLength;               /* Size of this descriptor in bytes */
00121   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00122   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_HEADER subtype */
00123   Uint16 bcdCDC;                /* Revision of class specification */
00124 } BYTE_ALIGNED;
00125 
00126 struct usb_cdc_call_mgmnt_func_descriptor
00127 {
00128   Uchar  bLength;               /* Size of this descriptor in bytes */
00129   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00130   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_CALL_MGMNT subtype */
00131   Uchar  bmCapabilities;        /* Capabilities */
00132   Uchar  bDataInterface;        /* Management data interface */
00133 } BYTE_ALIGNED;
00134 
00135 struct usb_cdc_abstract_ctrl_mgmnt_func_descriptor
00136 {
00137   Uchar  bLength;               /* Size of this descriptor in bytes */
00138   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00139   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT subtype*/
00140   Uchar  bmCapabilities;        /* Capabilities */
00141 } BYTE_ALIGNED;
00142 
00143 struct usb_cdc_direct_line_mgmnt_func_descriptor
00144 {
00145   Uchar  bLength;               /* Size of this descriptor in bytes */
00146   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00147   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_DIRECT_LINE_MGMNT subtype*/
00148   Uchar  bmCapabilities;        /* Capabilities */
00149 } BYTE_ALIGNED;
00150 
00151 struct usb_cdc_ringer_mgmnt_func_descriptor
00152 {
00153   Uchar  bLength;               /* Size of this descriptor in bytes */
00154   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00155   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_RINGER_MGMNT subtype*/
00156   Uchar  bRingerVolSteps;       /* Ringer volume steps */
00157   Uchar  bNumRingerPatterns;    /* Number of ringer patterns supported */
00158 } BYTE_ALIGNED;
00159 
00160 struct usb_cdc_tel_mode_func_descriptor
00161 {
00162   Uchar  bLength;               /* Size of this descriptor in bytes */
00163   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00164   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_TEL_MODE subtype*/
00165   Uchar  bmCapabilities;        /* Capabilities */
00166 } BYTE_ALIGNED;
00167 
00168 struct usb_cdc_tel_state_func_descriptor
00169 {
00170   Uchar  bLength;               /* Size of this descriptor in bytes */
00171   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00172   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_TEL_STATE subtype*/
00173   Uchar  bmCapabilities;        /* Capabilities */
00174 } BYTE_ALIGNED;
00175 
00176 struct usb_cdc_union_func_descriptor
00177 {
00178   Uchar  bLength;               /* Size of this descriptor in bytes */
00179   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00180   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_UNION subtype*/
00181   Uchar  bMasterInterface;      /* Master interface for union */
00182   Uchar  bSlaveInterface[1];    /* Slave interfaces in union */
00183 } BYTE_ALIGNED;
00184 
00185 struct usb_cdc_country_func_descriptor
00186 {
00187   Uchar  bLength;               /* Size of this descriptor in bytes */
00188   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00189   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_COUNTRY subtype*/
00190   Uchar  iCountryCodeRelDate;   /* Release date for country codes */
00191   Uint16 wCountryCode[1];       /* Country codes */
00192 } BYTE_ALIGNED;
00193 
00194 struct usb_cdc_ethernet_func_descriptor
00195 {
00196   Uchar  bLength;               /* Size of this descriptor in bytes */
00197   Uchar  bDescriptorType;       /* CS_INTERFACE descriptor type */
00198   Uchar  bDescriptorSubtype;    /* CDC_FUNC_DESCR_ETHERNET subtype*/
00199   Uchar  iMACAddress;           /* MAC address string descriptor */
00200   Uint32 bmEthernetStatistics;  /* Supported statistics */
00201   Uint16 wMaxSegmentSize;
00202   Uint16 wNumberMCFilters;      /* Number of multicast filters */
00203   Uchar  bNumberPowerFilters;   /* Number of wake-up pattern filters */;
00204 } BYTE_ALIGNED;
00205 
00206 struct usb_cdc_line_coding
00207 {
00208   Uint32 dwDTERate;
00209   Uchar  bCharFormat;
00210   Uchar  bParityType;
00211   Uchar  bDataBits;
00212 } BYTE_ALIGNED;
00213 
00214 #endif /* __CDC_H__K1Q26ESJOC__ */