⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb.equ

📁 dos下的USB源码(包括UHCI
💻 EQU
📖 第 1 页 / 共 5 页
字号:
	ECHO	-- Including: USB.EQU

;***************************************************************************;
;***************************************************************************;
;**                                                                       **;
;**           (C)Copyright 1985-2003, American Megatrends, Inc.           **;
;**                                                                       **;
;**                          All Rights Reserved.                         **;
;**                                                                       **;
;**                6145-F Northbelt Pkwy, Norcross, GA 30071              **;
;**                                                                       **;
;**                          Phone (770)-246-8600                         **;
;**                                                                       **;
;***************************************************************************;
;***************************************************************************;
;***************************************************************************;
; $Header: /BIOS/Corebin/800/Modules/USB2/Template/Core/USB.EQU 18    3/25/03 5:39p Sivagarn $
;
; $Revision: 18 $
;
; $Date: 3/25/03 5:39p $
;***************************************************************************;
; Revision History
; ----------------
; $Log: /BIOS/Corebin/800/Modules/USB2/Template/Core/USB.EQU $
; 
; 18    3/25/03 5:39p Sivagarn
; Bug release number changed to '05'
;
; 17    3/17/03 5:51p Sivagarn
;   - Equates related to SMRAM CPU dump area are added
;   - Equates related to port 60h/64h trap clear/enable routines are
; added
;   - Byte mask 'bSetMask' is changed to double word 'dSetMask' in the
; structure
;
; USB_CMOS_INIT_STRUC
;   - Two new incompatibility flags for keeping a hi-speed device as a
; hi-speed
;
; device or a full speed device, irrelevant of setup option are added
;   - New initialization flags are added (based on new setup options)
;   - 'pHCDReleasePort' routine is added to host controller driver. This
; routine
;
; is used to release a hi-speed device to USB 1.1 controller
;   - An equate to group all the unsupported USB devices is added
;   - A new bit is defined in USB mouse status flag to send 4-byte mouse
; data
;
; 16    1/27/03 8:48p Sivagarn
;  - A new call is added to HC drivers to return the ownership status of
; the host controller
;  - Wrong declaration of a field in the READ_FMT_CAPACITY structure was
; corrected
;
; 15    1/24/03 7:05p Sivagarn
;  - New field is added for extended memory support
;  - New structures to define read format capacity command data structure
; is added
;
; 14    1/09/03 6:27p Sivagarn
; - New incompatibility flag bit for read format capacity command is
; added
;
; 13    1/06/03 5:30p Sivagarn
; - Bug fix version number is incremented to '04'
; - New HC state HC_STATE_SUSPEND is defined
;
; 12    1/03/03 7:01p Sivagarn
; - Bug fix release number incremented to 03
; - 'bLastBulkCommandStatus' variable name changed to
; 'bLastCommandStatus' as it stores status of control transfer also
; - Control transfer stall condition is recorded in the
; 'bLastCommandStatus' variable
;
; 11    12/20/02 6:03p Sivagarn
; Updated the bug release version number for the new label
;
; 10    12/19/02 6:00p Sivagarn
; New flag is added to the HCStruc structure to indicate the state of the
; host controller. Currently only running/stopped condition is tracked.
;
; 9     12/17/02 3:16p Sivagarn
; - Changed copyright message year to 2003
; - Security interface related structures and equates are removed
; - Code clean up:
;       - Unused type definitions are removed
;       - Structure headers are updated
;       - Changed the old C-type calling convention function definitions
; - Support for 32bit linear buffer address in mass transaction is added
; - Equates for max LBA size for 1.44MB & 720KB floppy drives are changed
; - Read format capacity structure and equates are added
;
; 8     11/27/02 6:10p Sivagarn
;  - New fields are added to the CK_PRESENCE structure to return number
; of USB devices present by device type
;  - Bug release number is added and Minor version number incremented to
; '22'
;  - Security API equates are removed and generic extended API equates
; are added.  Support for Security & CDROM extended API are added
;
; 7     11/20/02 6:10p Sivagarn
; - Two error codes are added into the USB error table
;
; 6     11/17/02 8:05p Sivagarn
; - Equates for CPU SMRAM dump area are added
;
; 5     11/08/02 10:50a Sivagarn
; USB minor version number is incremented to '21'
;
; 4     10/29/02 6:51p Sivagarn
; - Structure definition are changed as per coding standard
; - New flag is added for port 60h/64h trapping
; - New flags are introduced for tracking bulk transfer time out and
; stalled condition
;
; 3     10/14/02 8:56p Sivagarn
;  * Code cleanup
;  * Structure headers are updated
;  * New structures related to boot block are added
;
; 2     9/18/02 11:59a Sivagarn
; Changed the beep flag name from INIT_FLAG_BEEP_DISABLE to
; INIT_FLAG_BEEP_ENABLE
;
; 1     9/15/02 5:39p Sivagarn
; Initial AMIUSB 2.20 check-in
;
;***************************************************************************;

IFNDEF	__USB_EQU
__USB_EQU	EQU	1


;----------------------------------------------------------------------------
;	USB BIOS Version Number - 2.22.05 (AMI-Internal)
;----------------------------------------------------------------------------
USB_BIOS_MAJOR_VERSION		EQU	02h	; Major (02h means 2.XX.XX)
USB_BIOS_MINOR_VERSION		EQU	22h	; Minor (20h means X.20.XX)
USB_BIOS_BUG_RELEASE_VERSION	EQU	05h	; Bug   (00h means X.XX.00)
;----------------------------------------------------------------------------
; Compatibility section
IFNDEF	MKF_USB_KBC_EMULATION
MKF_USB_KBC_EMULATION		EQU	0
ENDIF
IFNDEF	MKF_EHCI_ASYNC_BELL_SUPPORT
MKF_EHCI_ASYNC_BELL_SUPPORT	EQU	0
ENDIF
;----------------------------------------------------------------------------
; 	General Coding standard equates for bit position
;----------------------------------------------------------------------------
	BIT0		EQU		001h
	BIT1		EQU		002h
	BIT2		EQU		004h
	BIT3		EQU		008h
	BIT4		EQU		010h
	BIT5		EQU		020h
	BIT6		EQU		040h
	BIT7		EQU		080h
	BIT8		EQU		0100h
	BIT9		EQU		0200h
	BIT10		EQU		0400h
	BIT11		EQU		0800h
	BIT12		EQU		01000h
	BIT13		EQU		02000h
	BIT14		EQU		04000h
	BIT15		EQU		08000h

;----------------------------------------------------------------------------
; Equates to access data from SMRAM dump area
SMRAM_CPU_DUMP_CR4		EQU	00F0h
SMRAM_CPU_DUMP_VER		EQU	00FCh
SMRAM_CPU_DUMP_GDTBASE_P4	EQU	014Ch
SMRAM_CPU_DUMP_LDTBASE_P4	EQU	015Ch
SMRAM_CPU_DUMP_IO_EIP		EQU	017Ch
SMRAM_CPU_DUMP_GDTBASE		EQU	0188h
SMRAM_CPU_DUMP_IO_MEM_ADDR	EQU	01A0h
SMRAM_CPU_DUMP_IO_MISC_INFO	EQU	01A4h
SMRAM_CPU_DUMP_CS		EQU	01ACh
SMRAM_CPU_DUMP_LDTBASE		EQU	01C0h
SMRAM_CPU_DUMP_EAX		EQU	01D0h
SMRAM_CPU_DUMP_EDX		EQU	01D8h
SMRAM_CPU_DUMP_EIP		EQU	01F0h
SMRAM_CPU_DUMP_EFLAGS		EQU	01F4h
SMRAM_CPU_DUMP_CR3		EQU	01F8h
SMRAM_CPU_DUMP_CR0		EQU	01FCh

;----------------------------------------------------------------------------
;			USB API equates
;----------------------------------------------------------------------------
USB_NEW_API_START_FUNC		EQU	20h

USB_API_CHECK_PRESENCE		EQU	00h
USB_API_START			EQU	20h
USB_API_STOP			EQU	21h
USB_API_DISABLE_INTERRUPTS	EQU	22h
USB_API_ENABLE_INTERRUPTS	EQU	23h
USB_API_MOVE_DATA_AREA		EQU	24h
USB_API_GET_DEVICE_INFO		EQU	25h
USB_API_CHECK_DEVICE_PRESENCE	EQU	26h
USB_API_MASS_DEVICE_REQUEST	EQU	27h
USB_API_POWER_MANAGEMENT	EQU	28h
USB_API_PREPARE_FOR_OS		EQU	29h
;;USB_API_SECURITY_INTERFACE      EQU     2Ah

USB_EXT_API_START_FUNC		EQU	40h
USB_EXT_API_FINGER_PRINT	EQU     USB_EXT_API_START_FUNC
USB_EXT_API_CDROM		EQU     USB_EXT_API_FINGER_PRINT+1
USB_EXT_API_END_FUNC		EQU	USB_EXT_API_CDROM

USB_MASSAPI_GET_DEVICE_INFO	EQU	000h
USB_MASSAPI_GET_DEVICE_GEOMETRY	EQU	001h
USB_MASSAPI_RESET_DEVICE 	EQU	002h
USB_MASSAPI_READ_DEVICE 	EQU	003h
USB_MASSAPI_WRITE_DEVICE 	EQU	004h
USB_MASSAPI_VERIFY_DEVICE 	EQU	005h
USB_MASSAPI_FORMAT_DEVICE 	EQU	006h
USB_MASSAPI_CMD_PASS_THRU	EQU	007h
USB_MASSAPI_ASSIGN_DRIVE_NUMBER	EQU	008h

USB_PM_SUSPEND			EQU	010h
USB_PM_RESUME			EQU	020h

; Error returned from API handler
USB_SUCCESS			EQU	000h
USB_PARAMETER_ERROR		EQU	010h
USBAPI_INVALID_FUNCTION		EQU	0F0h
USB_ERROR			EQU	0FFh

; Equates regarding USB device info structure search parameter
USB_SRCH_DEV_ADDR		EQU	010h
USB_SRCH_DEV_TYPE		EQU	020h
USB_SRCH_DRV_NUM		EQU	030h
USB_SRCH_HC_STRUC		EQU	040h

; Equates to disable/enable USB port interrupt generation and
; 060/064h trapping
USB_DISABLE_INTERRUPT		EQU	000h
USB_ENABLE_INTERRUPT		EQU	00Fh
TRAP_REQUEST_CLEAR		EQU	000h
TRAP_REQUEST_DISABLE		EQU	0FFh


;----------------------------------------------------------------------------
; Equates for Global USB flags (DWORD - 32bits)
;----------------------------------------------------------------------------
USBGFLAG_UHCI_DISABLE_ROOTHUB_POLLING	EQU	BIT0
USBGFLAG_OHCI_DISABLE_32MS_POLLING	EQU	BIT1

;----------------------------------------------------------------------------
; Equates for Generic USB specific registers in the PCI config space
;----------------------------------------------------------------------------
USB_REG_COMMAND			EQU	004h
USB_MEM_BASE_ADDRESS		EQU	010h	; Offset 10-13h
USB_IO_BASE_ADDRESS		EQU	020h
USB_IRQ_LEVEL			EQU	03Ch
USB_RELEASE_NUM			EQU	060h

USB_BIOS_ACTIVE			EQU		0FFh
;----------------------------------------------------------------------------

;----------------------------------------------------------------------------
;		Equates common to all host controllers
;----------------------------------------------------------------------------
USB_PORT_STAT_DEV_CONNECTED		EQU	BIT0
USB_PORT_STAT_DEV_LOWSPEED		EQU	BIT1
USB_PORT_STAT_DEV_FULLSPEED		EQU	BIT2
USB_PORT_STAT_DEV_HISPEED		EQU	0
USB_PORT_STAT_DEV_SPEED_MASK		EQU	(BIT1 + BIT2)
USB_PORT_STAT_DEV_SPEED_MASK_SHIFT	EQU	1
USB_PORT_STAT_DEV_CONNECT_CHANGED	EQU	BIT3

; (DeviceInfo) bEndpointSpeed equates
USB_EPSPEED_LOWSPEED		EQU	BIT0	; 01
USB_EPSPEED_FULLSPEED		EQU	BIT1	; 10
USB_EPSPEED_HISPEED		EQU	0	; 00

;----------------------------------------------------------------------------

;----------------------------------------------------------------------------
;		Equates related to USB equipment list
;----------------------------------------------------------------------------
USB_TYPE_KEYBOARD		EQU	BIT0
USB_TYPE_MOUSE			EQU	BIT1
USB_TYPE_HUB			EQU	BIT2
USB_TYPE_MASS_STORAGE		EQU	BIT3
;----------------------------------------------------------------------------


USB_MASS_HOTPLUG_FDD_DEVICE	EQU	020h
USB_MASS_HOTPLUG_CDROM_DEVICE	EQU	021h

;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name:		USB_CMOS_INIT_STRUC
;
; Description:	This structure is used to read the CMOS values and store
;		them in the local value
;
; Fields:	 Name		Type		Description
;		------------------------------------------------------------
;		wQuestionNumber	WORD	CMOS question number
;		dSetMask	DWORD	Mask to be set in the bInitFlag
;
;----------------------------------------------------------------------------
;<AMI_SHDR_END>

USB_CMOS_INIT_STRUC	STRUC
	wQuestionNumber	WORD	?
	dSetMask	DWORD	?
USB_CMOS_INIT_STRUC	ENDS

;----------------------------------------------------------------------------
MAX_SIZE_FOR_FLOPPY_EMULATION	EQU	530	; 530MB
MAX_LBA_FOR_FLOPPY_EMULATION	EQU	109000h	; 530MB

;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name:		stBadUSBDevice
;
; Description:	This structure is used to define a non-compliant USB device
;
; Fields:	 Name		Type		Description
;		------------------------------------------------------------
;		wVendorID	WORD		Vendor ID of the device
;		wDeviceID	WORD		Device ID of the device
;		bBaseClass	BYTE		Base class of the device
;		bSubClass	BYTE		Sub class of the device
;		bProtocol	BYTE		Protocol used by the device
;		wFlags		INCMPT_FLAGS	Incompatibility flags
;
;----------------------------------------------------------------------------
;<AMI_SHDR_END>

stBadUSBDevice		STRUC
	wVendorID	WORD	?
	wDeviceID	WORD	?
	bBaseClass	BYTE	?

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -