/**/ /***************************************************************************/ /** **/ /** © Copyright 2010, Hewlett-Packard Development Company, L.P. **/ /** **/ /** Confidential computer software. Valid license from HP and/or **/ /** its subsidiaries required for possession, use, or copying. **/ /** **/ /** Consistent with FAR 12.211 and 12.212, Commercial Computer Software, **/ /** Computer Software Documentation, and Technical Data for Commercial **/ /** Items are licensed to the U.S. Government under vendor's standard **/ /** commercial license. **/ /** **/ /** Neither HP nor any of its subsidiaries shall be liable for technical **/ /** or editorial errors or omissions contained herein. The information **/ /** in this document is provided "as is" without warranty of any kind and **/ /** is subject to change without notice. The warranties for HP products **/ /** are set forth in the express limited warranty statements accompanying **/ /** such products. Nothing herein should be construed as constituting an **/ /** additional warranty. **/ /** **/ /***************************************************************************/ /********************************************************************************************************************************/ /* Created: 30-Mar-2010 16:33:52 by OpenVMS SDL EV3-3 */ /* Source: 14-APR-2005 19:53:12 $1$DGA7374:[USB.SRC]UGDEF.SDL;1 */ /********************************************************************************************************************************/ /*** MODULE $UGDEF ***/ #ifndef __UGDEF_LOADED #define __UGDEF_LOADED 1 #pragma __nostandard /* This file uses non-ANSI-Standard features */ #pragma __member_alignment __save #pragma __nomember_alignment #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __save /* Save the previously-defined required ptr size */ #pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */ #endif #ifdef __cplusplus extern "C" { #define __unknown_params ... #define __optional_params ... #else #define __unknown_params #define __optional_params ... #endif #ifndef __struct #if !defined(__VAXC) #define __struct struct #else #define __struct variant_struct #endif #endif #ifndef __union #if !defined(__VAXC) #define __union union #else #define __union variant_union #endif #endif /*++ */ /* Define random constants here */ /*-- */ #define UC$C_MAX_RETRY 5 /*++ */ /* Define Pipe state information */ /*-- */ #define UG$_PIPE_STATE_ACTIVE 1 #define UG$_PIPE_STATE_STALLED 2 #define UG$_PIPE_STATE_IDLE 3 /*++ */ /* Define endpoint/pipe type. It is really the endpoint type but we are */ /* not exposing endpoints just their associated pipes. */ /*-- */ #define UG$_PIPE_TYPE_CONTROL 0 #define UG$_PIPE_TYPE_ISOCHRONOUS 1 #define UG$_PIPE_TYPE_BULK 2 #define UG$_PIPE_TYPE_INTERRUPT 3 /*++ */ /* Define the various function options. Most of these should probably be */ /* OpenVMS funstion modifiers but changing adding them means that shipping */ /* without a new version of the O.S. is not possible. */ /*-- */ /* SET OPTIONS */ #define UG$_ENABLE_AST 1 #define UG$_ASSOCIATE 2 #define UG$_DISASSOCIATE 3 #define UG$_SET_PIPE_STATE 4 #define UG$_DEVICE_REQUEST 5 /* SENSE OPTIONS */ #define UG$_GET_PIPE_COUNT 1 #define UG$_GET_PIPE_HANDLES 2 #define UG$_GET_PIPE_TYPE 3 #define UG$_GET_PIPE_STATE 4 #define UG$_GET_PIPE_SIZE 5 #define UG$_GET_PIPE_DIRECTION 6 /*++ */ /* Define constants for pipe direction */ /*-- */ #define USB$_DIRECTION_OUT 1 #define USB$_DIRECTION_IN 2 #define UG$_GET_DEVICE_DESCRIPTOR 7 #define UG$_GET_INTERFACE_DESCRIPTOR 8 /*++ */ /* Define pipe transfer flags only SHORT_XFER_OK should be used at the present */ /* time. */ /*-- */ #define USB$_XFER_SETUP 0 #define USB$_XFER_OUT 1 #define USB$_XFER_IN 2 #define USB$_SHORT_XFER_OK 4 #define USB$_REQUEST_WAIT 8 /*++ */ /* Define the Device request buffer layout */ /*-- */ #define UG$M_RECIPIENT 0x1F #define UG$_RECIPIENT_DEVICE 0 #define UG$_RECIPIENT_INTERFACE 1 #define UG$_RECIPIENT_ENDPOINT 2 #define UG$_RECIPIENT_OTHER 3 #define UG$M_TYPE 0x60 #define UG$_TYPE_STANDARD 0 #define UG$_TYPE_CLASS 1 #define UG$_TYPE_VENDOR 2 #define UG$M_DIRECTION 0x80 #define UG$_HOST_TO_DEVICE 0 #define UG$_DEVICE_TO_HOST 1 #define UG$_REQUEST_GET_STATUS 0 /* bmRequestType can be 0x80, 0x81, 0x82 */ #define UG$_REQUEST_CLEAR_FEATURE 1 /* bmRequestType can be 0x00, 0x01, 0x02 */ #define UG$_REQUEST_SET_FEATURE 3 /* bmRequestType can be 0x00, 0x01, 0x02 */ #define UG$_REQUEST_SET_ADDRESS 5 /* bmRequestType is 0x00 */ #define UG$_REQUEST_GET_DESCRIPTOR 6 /* bmRequestType is 0x80 */ #define UG$_REQUEST_SET_DESCRIPTOR 7 /* bmRequestType is 0x00 */ #define UG$_REQUEST_GET_CONFIGURATION 8 /* bmRequestType is 0x80 */ #define UG$_REQUEST_SET_CONFIGURATION 9 /* bmRequestType is 0x00 */ #define UG$_REQUEST_GET_INTERFACE 10 /* bmRequestType is 0x81 */ #define UG$_REQUEST_SET_INTERFACE 11 /* bmRequestType is 0x01 */ #define UG$_REQUEST_SYNCH_FRAME 12 /* bmRequsType is 0x82 */ typedef struct _device_request { __union { unsigned char ug$b_bmrequesttype; __struct { unsigned ug$v_recipient : 5; unsigned ug$v_type : 2; unsigned ug$v_direction : 1; } ug$r_bmrequesttype_bits; } ug$r_bmrequesttype_overlay; unsigned char ug$b_brequest; unsigned short int ug$w_wvalue; unsigned short int ug$w_windex; unsigned short int ug$w_wlength; } DEVICE_REQUEST; #if !defined(__VAXC) #define ug$b_bmrequesttype ug$r_bmrequesttype_overlay.ug$b_bmrequesttype #define ug$v_recipient ug$r_bmrequesttype_overlay.ug$r_bmrequesttype_bits.ug$v_recipient #define ug$v_type ug$r_bmrequesttype_overlay.ug$r_bmrequesttype_bits.ug$v_type #define ug$v_direction ug$r_bmrequesttype_overlay.ug$r_bmrequesttype_bits.ug$v_direction #endif /* #if !defined(__VAXC) */ /*++ */ /* Define a standard device descriptor */ /*-- */ typedef struct _device_descriptor { unsigned char ug$b_blength; /* Descriptor length in bytes */ unsigned char ug$b_bdescriptortype; /* Descriptor type constant 0X01 */ unsigned short int ug$w_bcdusb; /* BCD encoded specification release number */ unsigned char ug$b_bdeviceclass; /* Device class code */ unsigned char ug$b_bdevicesubclass; /* Device sub class code */ unsigned char ug$b_bdeviceprotocol; /* Device protocol */ unsigned char ug$b_bmaxpacket; /* Maximu packet size for control pipe 8, 16, 32, 64 are valide */ unsigned short int ug$w_idvendor; /* Vendor ID */ unsigned short int ug$w_idproduct; /* Product ID */ unsigned short int ug$w_bcddevice; /* BCD encoded device release number */ unsigned char ug$b_imanufacturer; /* Index of string descriptor describing manufacturer */ unsigned char ug$b_iproduct; /* Index of string descriptor describing product */ unsigned char ug$b_iserailnumber; /* Index of string descriptor of devices serial number */ unsigned char ug$b_bnumconfigurations; /* Number of possible device configurations */ } DEVICE_DESCRIPTOR; /*++ */ /* Define a standard interface descriptor */ /*-- */ typedef struct _interface_descriptor { unsigned char ug$b_blength; /* Descriptor length in bytes */ unsigned char ug$b_bdescriptortype; /* Descriptor type constant 0X04 */ unsigned char ug$b_binterfacenumber; /* zero based count of what interface this is. */ unsigned char ug$b_balternatesetting; /* Used to select alternate setting for interface */ unsigned char ug$b_bnumendpoints; /* Number of endpoints for interface */ unsigned char ug$b_binterfaceclass; /* Interface class code */ unsigned char ug$b_binterfacesubclass; /* Interface sub class code */ unsigned char ug$b_binterfaceprotocol; /* Interface protocol */ unsigned char ug$b_iinterface; /* Index of string descriptor that describes this interface */ } INTERFACE_DESCRIPTOR; #pragma __member_alignment __restore #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __UGDEF_LOADED */