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

📄 usb.equ

📁 AMI 主板的BIOS源码。
💻 EQU
📖 第 1 页 / 共 2 页
字号:
;*****************************************************************;
;*****************************************************************;
;**                                                             **;
;**      (C)Copyright 1985-1996, American Megatrends, Inc.      **;
;**                                                             **;
;**                     All Rights Reserved.                    **;
;**                                                             **;
;**           6145-F Northbelt Pkwy, Norcross, GA 30071         **;
;**                                                             **;
;**                     Phone (770)-246-8600                    **;
;**                                                             **;
;*****************************************************************;
;*****************************************************************;
;****************************************************************************;

USB_BIOS_MAJOR_VERSION	equ 01h		;Major version (02h means 2.XX)
USB_BIOS_MINOR_VERSION	equ 30h		;Minor version (13h means X.13)

;-----------------------------------------------------------------------------
; Set this flag to -1 if ALPS early keyboard dated Aug 1996 to be supported.
; PLEASE NOTE THAT setting this flag to -1 MAY CAUSE OTHER COMPLIANT USB
;					   DEVICES MALFUNCTION
ALPS_KBD_0896		equ 00		;-1 = ALPS Keyboard dated Aug 1996 support
;-----------------------------------------------------------------------------

ifdef DOS_DEBUG
DOS_DEBUG_DATA_AREA	equ 8000h
endif

MAX_CONTROL_DATA_SIZE	equ 100h	;Maximum amount of data to transfer in
					; one control transaction


; USB Initialization Flags - passed in when USB is initialized
;-------------------------------------------------------------------------------
INIT_FLAG_MANUAL	equ 07h		;Bit 2-0: 000 = Auto enum
					;         001 = KB on port 1
					;         ...   ...          
					;         111 = KB on port 7
INIT_FLAG_ENUM_DISABLE	equ 08h		;Bit 3: If set, do not enum the USB
INIT_FLAG_BEEP_DISABLE	equ 10h		;Bit 4: If set, do not beep on new devices


; DeviceTableEntry Structure (one for each device that is given an address)
;-------------------------------------------------------------------------------
DeviceTableEntry	struc

	Present		db ?	;Set to: TRUE if this entry is used
				;        FALSE if this entry is free
	LowSpeedFlag	db ?	;Device's speed (01h/00h for low/high)

	VendorId	dw ?	;Device's vendor ID
	DeviceId	dw ?	;Device's product ID

	HubDeviceNumber	db ?	;Device address of hub that device is connected to
	HubPortNumber	db ?	;Port number within the hub that device is connected to

	Endp0MaxPacket	dw ?	;End point 0's max packet size (8/16/32/64)

	NumConfigs	db ?	;Number of configurations supported by device
	ConfigNum	db ?	;Configuration number in use by BIOS
	InterfaceNum	db ?	;Interface number in use by BIOS
	AltSettingNum	db ?	;Interface alternate setting number in use by BIOS
	EndpointNum	db ?	;Endpoint number in use by BIOS by polling
	pDeviceCallback	dw ?	;Offset of routine to call with polling data

	BiosDeviceType	db ?	;Set to one of BIOS_DEV_TYPE_xxx
	DeviceAddress	db ?	;Device address assigned to this device
	TdPoolPtr	dw ?	;Ptr to this device's entry in TdPool array
	EdPoolPtr	dw ?	;Ptr to this device's entry in EdPool array (OHCI only)

				;Fields below are valid only for hubs
	HubNumPorts	db ?	;  Number of ports on this hub
	HubPowerOnDelay	db ?	;  Time to delay after turning on power to port (in 2ms units)
	HubEnumFlag	db ?	;Set to TRUE if hub has been enumerated
DeviceTableEntry	ends


; Device Type Constants for BIOS internal use
;-------------------------------------------------------------------------------
BIOS_DEV_TYPE_KEYBOARD		equ 01h	;HID Boot keyboard
BIOS_DEV_TYPE_MOUSE		equ 02h	;HID Boot mouse
BIOS_DEV_TYPE_HUB		equ 03h	;Downstream hub
BIOS_DEV_TYPE_FLOPPY		equ 04h	;USB floppy


; DeviceRequest Structure
;-------------------------------------------------------------------------------
DeviceRequest	struc

	RequestType	db ?	;See USB_RQ_xxx constants below that
	RequestCode	db ?	; combine these two bytes
	
	Value		dw ?	;Meaning varies with request type
	Index		dw ?	;Meaning varies with request type
	DataLength	dw ?	;Number of bytes of data to transfer

DeviceRequest	ends


; Bit definitions for DeviceRequest.RequestType
;-------------------------------------------------------------------------------
				; Bit 7:   Data direction
USB_REQ_TYPE_OUTPUT	equ 00h	;            0 = Host sending data to device
USB_REQ_TYPE_INPUT	equ 80h	;            1 = Device sending data to host

				; Bit 6-5: Type
USB_REQ_TYPE_STANDARD	equ 00h	;            00 = Standard USB request
USB_REQ_TYPE_CLASS	equ 20h	;            01 = Class specific
USB_REQ_TYPE_VENDOR	equ 40h	;            10 = Vendor specific

				; Bit 4-0: Recipient
USB_REQ_TYPE_DEVICE	equ 00h	;            00000 = Device
USB_REQ_TYPE_INTERFACE	equ 01h	;            00001 = Interface
USB_REQ_TYPE_ENDPOINT	equ 02h	;            00010 = Endpoint
USB_REQ_TYPE_OTHER	equ 03h	;            00011 = Other


; Values for DeviceRequest.RequestType and DeviceRequest.RequestCode fields
; combined as a word value.
;-------------------------------------------------------------------------------
USB_RQ_SET_ADDRESS		equ (05d shl 8) or USB_REQ_TYPE_OUTPUT or USB_REQ_TYPE_STANDARD or USB_REQ_TYPE_DEVICE
USB_RQ_GET_DESCRIPTOR		equ (06d shl 8) or USB_REQ_TYPE_INPUT  or USB_REQ_TYPE_STANDARD or USB_REQ_TYPE_DEVICE
USB_RQ_GET_CONFIGURATION	equ (08d shl 8) or USB_REQ_TYPE_INPUT  or USB_REQ_TYPE_STANDARD or USB_REQ_TYPE_DEVICE
USB_RQ_SET_CONFIGURATION	equ (09d shl 8) or USB_REQ_TYPE_OUTPUT or USB_REQ_TYPE_STANDARD or USB_REQ_TYPE_DEVICE
USB_RQ_SET_INTERFACE		equ (11d shl 8) or USB_REQ_TYPE_OUTPUT or USB_REQ_TYPE_STANDARD or USB_REQ_TYPE_INTERFACE

USB_RQ_GET_CLASS_DESCRIPTOR	equ (06d shl 8) or USB_REQ_TYPE_INPUT  or USB_REQ_TYPE_CLASS or USB_REQ_TYPE_DEVICE
HID_RQ_SET_PROTOCOL		equ (11d shl 8) or USB_REQ_TYPE_OUTPUT or USB_REQ_TYPE_CLASS or USB_REQ_TYPE_ENDPOINT
HID_RQ_SET_REPORT		equ (09d shl 8) or USB_REQ_TYPE_OUTPUT or USB_REQ_TYPE_CLASS or USB_REQ_TYPE_ENDPOINT
HUB_RQ_GET_PORT_STATUS		equ (00d shl 8) or USB_REQ_TYPE_INPUT  or USB_REQ_TYPE_CLASS or USB_REQ_TYPE_OTHER
HUB_RQ_SET_PORT_FEATURE		equ (03d shl 8) or USB_REQ_TYPE_OUTPUT or USB_REQ_TYPE_CLASS or USB_REQ_TYPE_OTHER
HUB_RQ_CLEAR_PORT_FEATURE	equ (01d shl 8) or USB_REQ_TYPE_OUTPUT or USB_REQ_TYPE_CLASS or USB_REQ_TYPE_OTHER


; Descriptor Type Values
;-------------------------------------------------------------------------------
DESC_TYPE_DEVICE	equ 1	;Device Descriptor (Type 1)
DESC_TYPE_CONFIG	equ 2	;Configuration Descriptor (Type 2)
DESC_TYPE_STRING	equ 3	;String Descriptor (Type 3)
DESC_TYPE_INTERFACE	equ 4	;Interface Descriptor (Type 4)
DESC_TYPE_ENDPOINT	equ 5	;Endpoint Descriptor (Type 5)

DESC_TYPE_CLASS_HUB	equ 0	;Hub Class Descriptor (Type 0)


; DeviceDescriptor structure
;-------------------------------------------------------------------------------
DeviceDescriptor	struc

	DescLength	db ?	;Length of this descriptor (12h bytes)
	DescType	db ?	;Type code of this descriptor (01h)

	UsbSpecVersion	dw ?	;Release of USB spec (0210h = rev 2.10)

	BaseClass	db ?	;Device's base class code
	SubClass	db ?	;Device's sub class code
	Protocol	db ?	;Device's protocol type code

	Endp0MaxPacket	db ?	;End point 0's max packet size (8/16/32/64)

	VendorId	dw ?	;Vendor ID for device
	DeviceId	dw ?	;Product ID for device
	DeviceRev	dw ?	;Revision level of device
	MfgStr		db ?	;Index of manufacturer name string desc
	ProductStr	db ?	;Index of product name string desc
	SerialStr	db ?	;Index of serial number string desc

	NumConfigs	db ?	;Number of configurations supported

DeviceDescriptor	ends


; ConfigDescriptor structure
;-------------------------------------------------------------------------------
ConfigDescriptor	struc

	DescLength	db ?	;Length of this descriptor (9h bytes)
	DescType	db ?	;Type code of this descriptor (02h)

	TotalLength	dw ?	;Size of this config desc plus all interface,
				; endpoint, class, and vendor descriptors

⌨️ 快捷键说明

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