(**) (***************************************************************************) (** **) (** © 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 ; [HIDDEN] TYPE (**** Pre-declared data types ****) $BYTE = [BYTE] -128..127; $WORD = [WORD] -32768..32767; $QUAD = [QUAD,UNSAFE] RECORD L0:UNSIGNED; L1:INTEGER; END; $OCTA = [OCTA,UNSAFE] RECORD L0,L1,L2:UNSIGNED; L3:INTEGER; END; $UBYTE = [BYTE] 0..255; $UWORD = [WORD] 0..65535; $UQUAD = [QUAD,UNSAFE] RECORD L0,L1:UNSIGNED; END; $UOCTA = [OCTA,UNSAFE] RECORD L0,L1,L2,L3:UNSIGNED; END; $UOCTAQUAD = [OCTA(2),UNSAFE] RECORD L0,L1,L2,L3,L4,L5,L6,L7:UNSIGNED; END; $PACKED_DEC = [BIT(4),UNSAFE] 0..15; $DEFTYP = [UNSAFE] INTEGER; $DEFPTR = [UNSAFE] ^$DEFTYP; $BOOL = [BIT(1),UNSAFE] BOOLEAN; $BIT2 = [BIT(2),UNSAFE] 0..3; $BIT3 = [BIT(3),UNSAFE] 0..7; $BIT4 = [BIT(4),UNSAFE] 0..15; $BIT5 = [BIT(5),UNSAFE] 0..31; $BIT6 = [BIT(6),UNSAFE] 0..63; $BIT7 = [BIT(7),UNSAFE] 0..127; $BIT8 = [BIT(8),UNSAFE] 0..255; $BIT9 = [BIT(9),UNSAFE] 0..511; $BIT10 = [BIT(10),UNSAFE] 0..1023; $BIT11 = [BIT(11),UNSAFE] 0..2047; $BIT12 = [BIT(12),UNSAFE] 0..4095; $BIT13 = [BIT(13),UNSAFE] 0..8191; $BIT14 = [BIT(14),UNSAFE] 0..16383; $BIT15 = [BIT(15),UNSAFE] 0..32767; $BIT16 = [BIT(16),UNSAFE] 0..65535; $BIT17 = [BIT(17),UNSAFE] 0..131071; $BIT18 = [BIT(18),UNSAFE] 0..262143; $BIT19 = [BIT(19),UNSAFE] 0..524287; $BIT20 = [BIT(20),UNSAFE] 0..1048575; $BIT21 = [BIT(21),UNSAFE] 0..2097151; $BIT22 = [BIT(22),UNSAFE] 0..4194303; $BIT23 = [BIT(23),UNSAFE] 0..8388607; $BIT24 = [BIT(24),UNSAFE] 0..16777215; $BIT25 = [BIT(25),UNSAFE] 0..33554431; $BIT26 = [BIT(26),UNSAFE] 0..67108863; $BIT27 = [BIT(27),UNSAFE] 0..134217727; $BIT28 = [BIT(28),UNSAFE] 0..268435455; $BIT29 = [BIT(29),UNSAFE] 0..536870911; $BIT30 = [BIT(30),UNSAFE] 0..1073741823; $BIT31 = [BIT(31),UNSAFE] 0..2147483647; $BIT32 = [BIT(32),UNSAFE] UNSIGNED; (*** MODULE $UGDEF ***) (*++ *) (* Define random constants here *) (*-- *) CONST UC$C_MAX_RETRY = 5; (*++ *) (* Define Pipe state information *) (*-- *) CONST UG$_PIPE_STATE_ACTIVE = 1; UG$_PIPE_STATE_STALLED = 2; 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. *) (*-- *) CONST UG$_PIPE_TYPE_CONTROL = 0; UG$_PIPE_TYPE_ISOCHRONOUS = 1; UG$_PIPE_TYPE_BULK = 2; 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 *) CONST UG$_ENABLE_AST = 1; UG$_ASSOCIATE = 2; UG$_DISASSOCIATE = 3; UG$_SET_PIPE_STATE = 4; UG$_DEVICE_REQUEST = 5; (* SENSE OPTIONS *) CONST UG$_GET_PIPE_COUNT = 1; UG$_GET_PIPE_HANDLES = 2; UG$_GET_PIPE_TYPE = 3; UG$_GET_PIPE_STATE = 4; UG$_GET_PIPE_SIZE = 5; UG$_GET_PIPE_DIRECTION = 6; (*++ *) (* Define constants for pipe direction *) (*-- *) CONST USB$_DIRECTION_OUT = 1; USB$_DIRECTION_IN = 2; UG$_GET_DEVICE_DESCRIPTOR = 7; UG$_GET_INTERFACE_DESCRIPTOR = 8; (*++ *) (* Define pipe transfer flags only SHORT_XFER_OK should be used at the present *) (* time. *) (*-- *) CONST USB$_XFER_SETUP = 0; USB$_XFER_OUT = 1; USB$_XFER_IN = 2; USB$_SHORT_XFER_OK = 4; USB$_REQUEST_WAIT = 8; (*++ *) (* Define the Device request buffer layout *) (*-- *) CONST UG$M_RECIPIENT = 31; UG$_RECIPIENT_DEVICE = 0; UG$_RECIPIENT_INTERFACE = 1; UG$_RECIPIENT_ENDPOINT = 2; UG$_RECIPIENT_OTHER = 3; UG$M_TYPE = 96; UG$_TYPE_STANDARD = 0; UG$_TYPE_CLASS = 1; UG$_TYPE_VENDOR = 2; UG$M_DIRECTION = 128; UG$_HOST_TO_DEVICE = 0; UG$_DEVICE_TO_HOST = 1; UG$_REQUEST_GET_STATUS = 0; (* bmRequestType can be 0x80, 0x81, 0x82 *) UG$_REQUEST_CLEAR_FEATURE = 1; (* bmRequestType can be 0x00, 0x01, 0x02 *) UG$_REQUEST_SET_FEATURE = 3; (* bmRequestType can be 0x00, 0x01, 0x02 *) UG$_REQUEST_SET_ADDRESS = 5; (* bmRequestType is 0x00 *) UG$_REQUEST_GET_DESCRIPTOR = 6; (* bmRequestType is 0x80 *) UG$_REQUEST_SET_DESCRIPTOR = 7; (* bmRequestType is 0x00 *) UG$_REQUEST_GET_CONFIGURATION = 8; (* bmRequestType is 0x80 *) UG$_REQUEST_SET_CONFIGURATION = 9; (* bmRequestType is 0x00 *) UG$_REQUEST_GET_INTERFACE = 10; (* bmRequestType is 0x81 *) UG$_REQUEST_SET_INTERFACE = 11; (* bmRequestType is 0x01 *) UG$_REQUEST_SYNCH_FRAME = 12; (* bmRequsType is 0x82 *) TYPE Device_Request$TYPE = RECORD CASE INTEGER OF 1: (UG$r_bmRequestType_overlay : [BYTE(1)] RECORD END; UG$b_bRequest : $UBYTE; UG$w_wValue : $UWORD; UG$w_wIndex : $UWORD; UG$w_wlength : $UWORD; ); 2: (UG$b_bmRequestType : [POS(0)] $UBYTE; ); 3: (); 4: (UG$V_RECIPIENT : [POS(0)] $BIT5; UG$V_TYPE : [POS(5)] $BIT2; UG$V_DIRECTION : [POS(7)] $BOOL; ) END; (*++ *) (* Define a standard device descriptor *) (*-- *) TYPE Device_Descriptor$TYPE = RECORD UG$b_bLength : $UBYTE; (* Descriptor length in bytes *) UG$b_bDescriptorType : $UBYTE; (* Descriptor type constant 0X01 *) UG$w_bcdUSB : $UWORD; (* BCD encoded specification release number *) UG$b_bDeviceClass : $UBYTE; (* Device class code *) UG$b_bDeviceSubClass : $UBYTE; (* Device sub class code *) UG$b_bDeviceProtocol : $UBYTE; (* Device protocol *) UG$b_bMaxPacket : $UBYTE; (* Maximu packet size for control pipe 8, 16, 32, 64 are valide *) UG$w_idVendor : $UWORD; (* Vendor ID *) UG$w_idProduct : $UWORD; (* Product ID *) UG$w_bcdDevice : $UWORD; (* BCD encoded device release number *) UG$b_iManufacturer : $UBYTE; (* Index of string descriptor describing manufacturer *) UG$b_iProduct : $UBYTE; (* Index of string descriptor describing product *) UG$b_iSerailNumber : $UBYTE; (* Index of string descriptor of devices serial number *) UG$b_bNumConfigurations : $UBYTE; (* Number of possible device configurations *) END; (*++ *) (* Define a standard interface descriptor *) (*-- *) TYPE Interface_Descriptor$TYPE = RECORD UG$b_bLength : $UBYTE; (* Descriptor length in bytes *) UG$b_bDescriptorType : $UBYTE; (* Descriptor type constant 0X04 *) UG$b_bInterfaceNumber : $UBYTE; (* zero based count of what interface this is. *) UG$b_bAlternateSetting : $UBYTE; (* Used to select alternate setting for interface *) UG$B_BnumEndpoints : $UBYTE; (* Number of endpoints for interface *) UG$b_bInterfaceClass : $UBYTE; (* Interface class code *) UG$b_bInterfaceSubClass : $UBYTE; (* Interface sub class code *) UG$b_bInterfaceProtocol : $UBYTE; (* Interface protocol *) UG$b_iInterface : $UBYTE; (* Index of string descriptor that describes this interface *) END; END.