! !************************************************************************* !* * !* © 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 !******************************************************************************************************************************** ! *** PREDECLARED TYPES %IF %DECLARED(%BASIC$QUADWORD_DECLARED) = 0 %THEN RECORD BASIC$QUADWORD LONG FILL(2) END RECORD %LET %BASIC$QUADWORD_DECLARED = 1 %END %IF %IF %DECLARED(%BASIC$OCTAWORD_DECLARED) = 0 %THEN RECORD BASIC$OCTAWORD LONG FILL(4) END RECORD %LET %BASIC$OCTAWORD_DECLARED = 1 %END %IF %IF %DECLARED(%BASIC$HFLOAT_AXP_DECLARED) = 0 %THEN RECORD BASIC$HFLOAT_AXP LONG FILL(4) END RECORD %LET %BASIC$HFLOAT_AXP_DECLARED = 1 %END %IF %IF %DECLARED(%BASIC$F_FLOATING_COMPLEX_DECL) = 0 %THEN RECORD BASIC$F_FLOATING_COMPLEX SINGLE REAL_PART SINGLE IMAGINARY_PART END RECORD %LET %BASIC$F_FLOATING_COMPLEX_DECL = 1 %END %IF %IF %DECLARED(%BASIC$D_FLOATING_COMPLEX_DECL) = 0 %THEN RECORD BASIC$D_FLOATING_COMPLEX DOUBLE REAL_PART DOUBLE IMAGINARY_PART END RECORD %LET %BASIC$D_FLOATING_COMPLEX_DECL = 1 %END %IF %IF %DECLARED(%BASIC$G_FLOATING_COMPLEX_DECL) = 0 %THEN RECORD BASIC$G_FLOATING_COMPLEX GFLOAT REAL_PART GFLOAT IMAGINARY_PART END RECORD %LET %BASIC$G_FLOATING_COMPLEX_DECL = 1 %END %IF %IF %DECLARED(%BASIC$H_FLOAT_AXP_CMPLX_DCL) = 0 %THEN RECORD BASIC$H_FLOATING_COMPLEX_AXP BASIC$HFLOAT_AXP REAL_PART BASIC$HFLOAT_AXP IMAGINARY_PART END RECORD %LET %BASIC$H_FLOAT_AXP_CMPLX_DCL = 1 %END %IF !*** MODULE $UGDEF *** ! ++ ! Define random constants here ! -- DECLARE LONG CONSTANT UC$C_MAX_RETRY = 5 ! ++ ! Define Pipe state information ! -- DECLARE LONG CONSTANT UG$_PIPE_STATE_ACTIVE = 1 DECLARE LONG CONSTANT UG$_PIPE_STATE_STALLED = 2 DECLARE LONG CONSTANT 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. ! -- DECLARE LONG CONSTANT UG$_PIPE_TYPE_CONTROL = 0 DECLARE LONG CONSTANT UG$_PIPE_TYPE_ISOCHRONOUS = 1 DECLARE LONG CONSTANT UG$_PIPE_TYPE_BULK = 2 DECLARE LONG CONSTANT 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 DECLARE LONG CONSTANT UG$_ENABLE_AST = 1 DECLARE LONG CONSTANT UG$_ASSOCIATE = 2 DECLARE LONG CONSTANT UG$_DISASSOCIATE = 3 DECLARE LONG CONSTANT UG$_SET_PIPE_STATE = 4 DECLARE LONG CONSTANT UG$_DEVICE_REQUEST = 5 ! SENSE OPTIONS DECLARE LONG CONSTANT UG$_GET_PIPE_COUNT = 1 DECLARE LONG CONSTANT UG$_GET_PIPE_HANDLES = 2 DECLARE LONG CONSTANT UG$_GET_PIPE_TYPE = 3 DECLARE LONG CONSTANT UG$_GET_PIPE_STATE = 4 DECLARE LONG CONSTANT UG$_GET_PIPE_SIZE = 5 DECLARE LONG CONSTANT UG$_GET_PIPE_DIRECTION = 6 ! ++ ! Define constants for pipe direction ! -- DECLARE LONG CONSTANT USB$_DIRECTION_OUT = 1 DECLARE LONG CONSTANT USB$_DIRECTION_IN = 2 DECLARE LONG CONSTANT UG$_GET_DEVICE_DESCRIPTOR = 7 DECLARE LONG CONSTANT UG$_GET_INTERFACE_DESCRIPTOR = 8 ! ++ ! Define pipe transfer flags only SHORT_XFER_OK should be used at the present ! time. ! -- DECLARE LONG CONSTANT USB$_XFER_SETUP = 0 DECLARE LONG CONSTANT USB$_XFER_OUT = 1 DECLARE LONG CONSTANT USB$_XFER_IN = 2 DECLARE LONG CONSTANT USB$_SHORT_XFER_OK = 4 DECLARE LONG CONSTANT USB$_REQUEST_WAIT = 8 ! ++ ! Define the Device request buffer layout ! -- DECLARE LONG CONSTANT UG$M_RECIPIENT = x'0000001F' DECLARE LONG CONSTANT UG$_RECIPIENT_DEVICE = 0 DECLARE LONG CONSTANT UG$_RECIPIENT_INTERFACE = 1 DECLARE LONG CONSTANT UG$_RECIPIENT_ENDPOINT = 2 DECLARE LONG CONSTANT UG$_RECIPIENT_OTHER = 3 DECLARE LONG CONSTANT UG$M_TYPE = x'00000060' DECLARE LONG CONSTANT UG$_TYPE_STANDARD = 0 DECLARE LONG CONSTANT UG$_TYPE_CLASS = 1 DECLARE LONG CONSTANT UG$_TYPE_VENDOR = 2 DECLARE LONG CONSTANT UG$M_DIRECTION = x'00000080' DECLARE LONG CONSTANT UG$_HOST_TO_DEVICE = 0 DECLARE LONG CONSTANT UG$_DEVICE_TO_HOST = 1 DECLARE LONG CONSTANT UG$_REQUEST_GET_STATUS = 0 ! bmRequestType can be 0x80, 0x81, 0x82 DECLARE LONG CONSTANT UG$_REQUEST_CLEAR_FEATURE = 1 ! bmRequestType can be 0x00, 0x01, 0x02 DECLARE LONG CONSTANT UG$_REQUEST_SET_FEATURE = 3 ! bmRequestType can be 0x00, 0x01, 0x02 DECLARE LONG CONSTANT UG$_REQUEST_SET_ADDRESS = 5 ! bmRequestType is 0x00 DECLARE LONG CONSTANT UG$_REQUEST_GET_DESCRIPTOR = 6 ! bmRequestType is 0x80 DECLARE LONG CONSTANT UG$_REQUEST_SET_DESCRIPTOR = 7 ! bmRequestType is 0x00 DECLARE LONG CONSTANT UG$_REQUEST_GET_CONFIGURATION = 8 ! bmRequestType is 0x80 DECLARE LONG CONSTANT UG$_REQUEST_SET_CONFIGURATION = 9 ! bmRequestType is 0x00 DECLARE LONG CONSTANT UG$_REQUEST_GET_INTERFACE = 10 ! bmRequestType is 0x81 DECLARE LONG CONSTANT UG$_REQUEST_SET_INTERFACE = 11 ! bmRequestType is 0x01 DECLARE LONG CONSTANT UG$_REQUEST_SYNCH_FRAME = 12 ! bmRequsType is 0x82 DECLARE LONG CONSTANT UG$S_Device_Request = 8 record Device_Request group UG$r_bmRequestType_overlay variant case BYTE UG$b_bmRequestType case group UG$r_bmRequestType_bits BYTE RECIPIENT_bits ! COMMENT ADDED BY SDL - RECIPIENT_bits contains bits RECIPIENT through DIRECTION end group UG$r_bmRequestType_bits end variant end group UG$r_bmRequestType_overlay BYTE UG$b_bRequest WORD UG$w_wValue WORD UG$w_wIndex WORD UG$w_wlength end record Device_Request ! ++ ! Define a standard device descriptor ! -- DECLARE LONG CONSTANT UG$S_Device_Descriptor = 18 record Device_Descriptor BYTE UG$b_bLength ! Descriptor length in bytes BYTE UG$b_bDescriptorType ! Descriptor type constant 0X01 WORD UG$w_bcdUSB ! BCD encoded specification release number BYTE UG$b_bDeviceClass ! Device class code BYTE UG$b_bDeviceSubClass ! Device sub class code BYTE UG$b_bDeviceProtocol ! Device protocol BYTE UG$b_bMaxPacket ! Maximu packet size for control pipe 8, 16, 32, 64 are valide WORD UG$w_idVendor ! Vendor ID WORD UG$w_idProduct ! Product ID WORD UG$w_bcdDevice ! BCD encoded device release number BYTE UG$b_iManufacturer ! Index of string descriptor describing manufacturer BYTE UG$b_iProduct ! Index of string descriptor describing product BYTE UG$b_iSerailNumber ! Index of string descriptor of devices serial number BYTE UG$b_bNumConfigurations ! Number of possible device configurations end record Device_Descriptor ! ++ ! Define a standard interface descriptor ! -- DECLARE LONG CONSTANT UG$S_Interface_Descriptor = 9 record Interface_Descriptor BYTE UG$b_bLength ! Descriptor length in bytes BYTE UG$b_bDescriptorType ! Descriptor type constant 0X04 BYTE UG$b_bInterfaceNumber ! zero based count of what interface this is. BYTE UG$b_bAlternateSetting ! Used to select alternate setting for interface BYTE UG$B_BnumEndpoints ! Number of endpoints for interface BYTE UG$b_bInterfaceClass ! Interface class code BYTE UG$b_bInterfaceSubClass ! Interface sub class code BYTE UG$b_bInterfaceProtocol ! Interface protocol BYTE UG$b_iInterface ! Index of string descriptor that describes this interface end record Interface_Descriptor