! ! ************************************************************************* ! * * ! * © 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 17:32:20 by OpenVMS SDL EV3-3 ! Source: 14-APR-2005 19:53:12 $1$DGA7274:[USB.SRC]UGDEF.SDL;1 ! ******************************************************************************************************************************** !*** MODULE $UGDEF *** ! ++ ! Define random constants here ! -- literal UC$C_MAX_RETRY = 5; ! ++ ! Define Pipe state information ! -- literal UG$_PIPE_STATE_ACTIVE = 1; literal UG$_PIPE_STATE_STALLED = 2; literal 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. ! -- literal UG$_PIPE_TYPE_CONTROL = 0; literal UG$_PIPE_TYPE_ISOCHRONOUS = 1; literal UG$_PIPE_TYPE_BULK = 2; literal 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 literal UG$_ENABLE_AST = 1; literal UG$_ASSOCIATE = 2; literal UG$_DISASSOCIATE = 3; literal UG$_SET_PIPE_STATE = 4; literal UG$_DEVICE_REQUEST = 5; ! SENSE OPTIONS literal UG$_GET_PIPE_COUNT = 1; literal UG$_GET_PIPE_HANDLES = 2; literal UG$_GET_PIPE_TYPE = 3; literal UG$_GET_PIPE_STATE = 4; literal UG$_GET_PIPE_SIZE = 5; literal UG$_GET_PIPE_DIRECTION = 6; ! ++ ! Define constants for pipe direction ! -- literal USB$_DIRECTION_OUT = 1; literal USB$_DIRECTION_IN = 2; literal UG$_GET_DEVICE_DESCRIPTOR = 7; literal UG$_GET_INTERFACE_DESCRIPTOR = 8; ! ++ ! Define pipe transfer flags only SHORT_XFER_OK should be used at the present ! time. ! -- literal USB$_XFER_SETUP = 0; literal USB$_XFER_OUT = 1; literal USB$_XFER_IN = 2; literal USB$_SHORT_XFER_OK = 4; literal USB$_REQUEST_WAIT = 8; ! ++ ! Define the Device request buffer layout ! -- literal UG$M_RECIPIENT = %X'1F'; literal UG$_RECIPIENT_DEVICE = 0; literal UG$_RECIPIENT_INTERFACE = 1; literal UG$_RECIPIENT_ENDPOINT = 2; literal UG$_RECIPIENT_OTHER = 3; literal UG$M_TYPE = %X'60'; literal UG$_TYPE_STANDARD = 0; literal UG$_TYPE_CLASS = 1; literal UG$_TYPE_VENDOR = 2; literal UG$M_DIRECTION = %X'80'; literal UG$_HOST_TO_DEVICE = 0; literal UG$_DEVICE_TO_HOST = 1; literal UG$_REQUEST_GET_STATUS = 0; ! bmRequestType can be 0x80, 0x81, 0x82 literal UG$_REQUEST_CLEAR_FEATURE = 1; ! bmRequestType can be 0x00, 0x01, 0x02 literal UG$_REQUEST_SET_FEATURE = 3; ! bmRequestType can be 0x00, 0x01, 0x02 literal UG$_REQUEST_SET_ADDRESS = 5; ! bmRequestType is 0x00 literal UG$_REQUEST_GET_DESCRIPTOR = 6; ! bmRequestType is 0x80 literal UG$_REQUEST_SET_DESCRIPTOR = 7; ! bmRequestType is 0x00 literal UG$_REQUEST_GET_CONFIGURATION = 8; ! bmRequestType is 0x80 literal UG$_REQUEST_SET_CONFIGURATION = 9; ! bmRequestType is 0x00 literal UG$_REQUEST_GET_INTERFACE = 10; ! bmRequestType is 0x81 literal UG$_REQUEST_SET_INTERFACE = 11; ! bmRequestType is 0x01 literal UG$_REQUEST_SYNCH_FRAME = 12; ! bmRequsType is 0x82 literal UG$S_Device_Request = 8; macro UG$r_bmRequestType_overlay = 0,0,8,0 %; literal UG$s_bmRequestType_overlay = 1; macro UG$b_bmRequestType = 0,0,8,0 %; macro UG$V_RECIPIENT = 0,0,5,0 %; literal UG$S_RECIPIENT = 5; macro UG$V_TYPE = 0,5,2,0 %; literal UG$S_TYPE = 2; macro UG$V_DIRECTION = 0,7,1,0 %; macro UG$b_bRequest = 1,0,8,0 %; macro UG$w_wValue = 2,0,16,0 %; macro UG$w_wIndex = 4,0,16,0 %; macro UG$w_wlength = 6,0,16,0 %; ! ++ ! Define a standard device descriptor ! -- literal UG$S_Device_Descriptor = 18; macro UG$b_bLength = 0,0,8,0 %; ! Descriptor length in bytes macro UG$b_bDescriptorType = 1,0,8,0 %; ! Descriptor type constant 0X01 macro UG$w_bcdUSB = 2,0,16,0 %; ! BCD encoded specification release number macro UG$b_bDeviceClass = 4,0,8,0 %; ! Device class code macro UG$b_bDeviceSubClass = 5,0,8,0 %; ! Device sub class code macro UG$b_bDeviceProtocol = 6,0,8,0 %; ! Device protocol macro UG$b_bMaxPacket = 7,0,8,0 %; ! Maximu packet size for control pipe 8, 16, 32, 64 are valide macro UG$w_idVendor = 8,0,16,0 %; ! Vendor ID macro UG$w_idProduct = 10,0,16,0 %; ! Product ID macro UG$w_bcdDevice = 12,0,16,0 %; ! BCD encoded device release number macro UG$b_iManufacturer = 14,0,8,0 %; ! Index of string descriptor describing manufacturer macro UG$b_iProduct = 15,0,8,0 %; ! Index of string descriptor describing product macro UG$b_iSerailNumber = 16,0,8,0 %; ! Index of string descriptor of devices serial number macro UG$b_bNumConfigurations = 17,0,8,0 %; ! Number of possible device configurations ! ++ ! Define a standard interface descriptor ! -- literal UG$S_Interface_Descriptor = 9; macro UG$b_bLength = 0,0,8,0 %; ! Descriptor length in bytes macro UG$b_bDescriptorType = 1,0,8,0 %; ! Descriptor type constant 0X04 macro UG$b_bInterfaceNumber = 2,0,8,0 %; ! zero based count of what interface this is. macro UG$b_bAlternateSetting = 3,0,8,0 %; ! Used to select alternate setting for interface macro UG$B_BnumEndpoints = 4,0,8,0 %; ! Number of endpoints for interface macro UG$b_bInterfaceClass = 5,0,8,0 %; ! Interface class code macro UG$b_bInterfaceSubClass = 6,0,8,0 %; ! Interface sub class code macro UG$b_bInterfaceProtocol = 7,0,8,0 %; ! Interface protocol macro UG$b_iInterface = 8,0,8,0 %; ! Index of string descriptor that describes this interface