usb.equ
来自「dos下的USB源码(包括UHCI」· EQU 代码 · 共 1,691 行 · 第 1/5 页
EQU
1,691 行
USB_HOTPLUG_CDROM_AUTO_BIT EQU BIT12 ;12 If set, USB hotplug CDROM support is set to auto
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: HCDriver
;
; Description: This structure holds the address of the host controller
; driver entry point
;
; Fields: Name Type Description
; ------------------------------------------------------------
; pHCAddress HCDHEADER HC driver start address
;
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
HCDriver STRUC
pHCAddress WORD ?
HCDriver ENDS
; Host controller types
;----------------------------------------------------------------------------
USB_UHCI EQU 10h
USB_OHCI EQU 20h
USB_EHCI EQU 30h
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: HC_INFO_STRUC
;
; Description: This structure holds the information needed to identify
; an onboard USB host controller
;
; Fields: Name Type Description
; ------------------------------------------------------------
; wBusDevFuncNumber WORD PCI bus, device and function number
; bHCType BYTE HC type (USB_UHCI, USB_OHCI or USB_EHCI)
; bRoutingRegister BYTE PCI register number to program for IRQ routing
; bIRQMask BYTE This value will be BIT AND with the IRQ number to be programmed
; bIRQShiftValue BYTE After masking this many shift lefts are done to the value and programmed
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
HC_INFO_STRUC STRUC
wBusDevFuncNumber WORD ?
bHCType BYTE ?
bRoutingRegister BYTE ?
bIRQMask BYTE ?
bIRQShiftValue BYTE ?
HC_INFO_STRUC ENDS
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: HCDHEADER
;
; Description: This is a structure data type of all the HC API related parameter
;
; Fields: Name Type Description
; ------------------------------------------------------------
; bHCDType BYTE HCD type (UHCI, OHCI or EHCI)
; bHCDRsrv BYTE Reserved
; wHCDRsrvWord WORD Reserved
; pHCDStart WORD HCD start routine
; pHCDStop WORD HCD stop routine
; pHCDMoveDataArea WORD HCD move data area routine
; pHCDDisableInterrupts WORD HCD disable interrupts routine
; pHCDEnableInterrupts WORD HCD enable interrupts routine
; pHCDProcessInterrupt WORD HCD interrupt processing routine
; pHCDGetRootHubStatus WORD HCD get root hub status routine
; pHCDDisableRootHub WORD HCD disable root hub routine
; pHCDEnableRootHub WORD HCD enable root hub routine
; pHCDControlTransfer WORD HCD control transfer routine
; pHCDBulkTransfer WORD HCD control transfer routine
; pHCDInterruptTransfer WORD HCD control transfer routine
; pHCDDeactivatePolling WORD HCD de-activate polling routine
; pHCDActivatePolling WORD HCD activate polling routine
; pHCDDisableKeyRepeat WORD HCD disables the key repeat logic
; pHCDEnableKeyRepeat WORD HCD enables the key repeat logic
; pHCDPowerManagement WORD HCD arms its wakeup and suspends
; pHCDEnumeratePorts WORD HCD enumerates the ports
; pHCDEnableTrapping WORD HCD enabled the port 60h/64h trapping
; pHCDCheckControlStatus WORD HCD check BIOS control status routine
; pHCDReleasePort WORD HCD releases the particular USB port
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
HCDHEADER STRUC
bHCDType BYTE ?
bHCDReserved BYTE ?
wHCDReservedWord WORD ?
pHCDStart WORD ?
pHCDStop WORD ?
pHCDMoveDataArea WORD ?
pHCDDisableInterrupts WORD ?
pHCDEnableInterrupts WORD ?
pHCDProcessInterrupt WORD ?
pHCDGetRootHubStatus WORD ?
pHCDDisableRootHub WORD ?
pHCDEnableRootHub WORD ?
pHCDControlTransfer WORD ?
pHCDBulkTransfer WORD ?
pHCDInterruptTransfer WORD ?
pHCDDeactivatePolling WORD ?
pHCDActivatePolling WORD ?
pHCDDisableKeyRepeat WORD ?
pHCDEnableKeyRepeat WORD ?
pHCDPowerManagement WORD ?
pHCDEnumeratePorts WORD ?
pHCDEnableTrapping WORD ?
pHCDCheckControlStatus WORD ?
pHCDReleasePort WORD ?
HCDHEADER ENDS
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: BBHCDHEADER
;
; Description: This is a structure data type of all the HC API related
; parameter in boot block
;
; Fields: Name Type Description
; ------------------------------------------------------------
; wHCDType WORD HCD type (UHCI, OHCI or EHCI)
; pHCDConfigureKeyboard WORD Near pointer to the configure key board routine
; pHCDStopHC WORD Near pointer to the stop host controller routine
; pHCDControlTransfer WORD Near pointer to the control transfer routine
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
BBHCDHEADER STRUC
wHCDType WORD ?
pHCDInitializeHC WORD ?
pHCDStopHC WORD ?
pHCDEnablePort WORD ?
pHCDDisablePort WORD ?
pHCDControlTransfer WORD ?
pHCDBulkTransfer WORD ?
pHCDInterruptTransfer WORD ?
pHCDProcessInterrupt WORD ?
pHCDDeActivateKeyboardPolling WORD ?
pHCDActivateKeyboardPolling WORD ?
BBHCDHEADER ENDS
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: BB_HUB_INFO
;
; Description: This structure has the information pertaining to the hub
; device
;
; Fields: Name Type Description
; ------------------------------------------------------------
; bHubDeviceAddress BYTE Holds this hubs device address
; bNumPorts BYTE Number of ports in this device
; bCurrentPort BYTE Port number we are currently processing
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
BB_HUB_INFO STRUC
bHubDeviceAddress BYTE ?
bNumPorts BYTE ?
bCurrentPort BYTE ?
BB_HUB_INFO ENDS
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: HCStruc
;
; Description: This structure holds host controller information. There will
; be a structure for each HC
;
; Fields: Name Type Description
; ------------------------------------------------------------
; bHCNumber BYTE Host controller number (1 based)
; bHCType BYTE Host controller type (non-zero is valid)
; dHcdDataArea DWORD Absolute 32bit address of HC data area
; dBaseAddress DWORD I/O base for UHCI & memory base for OHCI
; bNumPorts BYTE Number of ports in the controller
; bHCFlag BYTE Indicates the state of the host controller
; wBusDevFuncNum WORD Holds HC PCI bus/dev/func number
; pIRQInfoPtr IRQInfo Pointer to IRQ info. structure for this HC
; pDescriptorPtr NEAR Pointer to the descriptors table
; pHCDPointer HCDHEADER Pointer to the host controller driver
; wAsyncListSize WORD Asynchoronous list size (in DWORD)
; dMaxBulkDataSize DWORD Maximum bulk data that can be sent in one transaction
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
HCStruc STRUC
bHCNumber BYTE ? ;0
bHCType BYTE ? ;1
dHcdDataArea DWORD ? ;2
dBaseAddress DWORD ? ;6
bNumPorts BYTE ? ;A
bHCFlag BYTE ? ;B
wBusDevFuncNum WORD ? ;C
pIRQInfoPtr WORD ? ;E
pDescriptorPtr WORD ? ;10
pHCDPointer WORD ? ;12
wAsyncListSize WORD ? ;14
bOpRegOffset BYTE ? ;16
dMaxBulkDataSize DWORD ? ;17
HCStruc ENDS
; Equates related to host controller state
HC_STATE_RUNNING EQU BIT0
HC_STATE_SUSPEND EQU BIT1
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: HCPCIInfo
;
; Description: This structure holds PCI host controller information. There will
; be a structure for each HC
;
; Fields: Name Type Description
; ------------------------------------------------------------
; pHCAddress NEAR HC driver start address
; wBusDevFun WORD Bits 8..15: HC PCI bus number (0..FF), Bits 3..7: HC PCI device number (0..1F), Bits 0..2: HC PCI function number (0..7)
; bValid BYTE Indication that current entry is valid (TRUE/FALSE)
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
HCPCIInfo STRUC
wBusDevFun WORD ?
bAvailable BYTE ?
HCPCIInfo ENDS
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: IRQInfo
;
; Description: This structure holds interrupt information for the
; host controller. There will be a structure for each interrupt
; or SMI hooked
;
; Fields: Name Type Description
; ------------------------------------------------------------
; IRQNumber BYTE IRQ Number
; NextISR DWORD Next ISR address in this interrupt chain
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
IRQInfo STRUC
IRQNumber BYTE ?
NextISR DWORD ?
IRQInfo ENDS
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
; Function prototype for callback routine
;----------------------------------------------------------------------------
FUNCPOLLCALLBK TYPEDEF PROTO NEAR C pHCStruc:NEAR, pDevInfo:NEAR,
pTD:NEAR, pBuffer:NEAR
PTRFUNCPOLLCALLBK TYPEDEF PTR FUNCPOLLCALLBK
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
; USB Device Driver Parameter Structure
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: USB_DEV_HDR
;
; Description: Header for USB device driver
;
; Fields: Name Type Description
; ------------------------------------------------------------
; bDevType BYTE Device type (KBD, Mouse etc)
; pDevInit WORD Device driver initialize function
; pChkDevType WORD Device driver check device type routine
; pCfgDevice WORD Device driver config device routine
; pDisconDevice WORD Device driver device disconnect routine
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
USB_DEV_HDR STRUC
bDevType BYTE ?
pDevInit WORD ?
pChkDevType WORD ?
pCfgDevice WORD ?
pDisconDevice WORD ?
USB_DEV_HDR ENDS
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: CNTRL_XFER
;
; Description: This structure holds the information needed for the control
; transfer
;
; Fields: Name Type Description
; ------------------------------------------------------------
; wRequest WORD Control transfer wRequest field information
; wValue WORD Control transfer wValue field information
; wIndex WORD Control transfer wIndex field information
; wLength WORD Control transfer wLength field information
; fpBuffer DWORD Far buffer pointer for the control transfer data field
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
CNTRL_XFER STRUC
wRequest WORD ?
wValue WORD ?
wIndex WORD ?
wLength WORD ?
; DO NOT CHANGE THE ABOVE ORDER. IT EXACTLY MATCHES THE DEVICE REQUEST
; STRUCTURE SO STRING MOVE OPERATION CAN BE PERFORMED.
fpBuffer DWORD ?
CNTRL_XFER ENDS
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: MASS_XACT_STRUC
;
; Description: This structure holds the information needed for the mass
; transaction (for CBI or BULK)
;
; Fields: Name Type Description
; ------------------------------------------------------------
; pCmdBuffer WORD Pointer to the mass transaction command buffer
; bCmdSize BYTE Size of the command buffer
; bXferDir BYTE Transfer direction (BIT7)
; fpBuffer DWORD Far pointer of the data buffer (IN/OUT)
; dwLength DWORD Length of the data buffer
; wPreSkip WORD Number of bytes to skip before getting actual data
; wPostSkip WORD Number of bytes to skip after getting actual data
; wMiscFlag WORD Flag for special cases refer USBM_XACT_FLAG_XXX
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?