9#ifndef USB_ETHERNET_PROTOCOL_H_
10#define USB_ETHERNET_PROTOCOL_H_
12#define EDKII_USB_ETHERNET_PROTOCOL_GUID \
13 {0x8d8969cc, 0xfeb0, 0x4303, {0xb2, 0x1a, 0x1f, 0x11, 0x6f, 0x38, 0x56, 0x43}}
17#define USB_CDC_CLASS 0x02
18#define USB_CDC_ACM_SUBCLASS 0x02
19#define USB_CDC_ECM_SUBCLASS 0x06
20#define USB_CDC_NCM_SUBCLASS 0x0D
21#define USB_CDC_DATA_CLASS 0x0A
22#define USB_CDC_DATA_SUBCLASS 0x00
23#define USB_NO_CLASS_PROTOCOL 0x00
24#define USB_NCM_NTB_PROTOCOL 0x01
25#define USB_VENDOR_PROTOCOL 0xFF
27#define USB_MISC_CLASS 0xEF
28#define USB_RNDIS_SUBCLASS 0x04
29#define USB_RNDIS_ETHERNET_PROTOCOL 0x01
32#define HEADER_FUN_DESCRIPTOR 0x00
33#define UNION_FUN_DESCRIPTOR 0x06
34#define ETHERNET_FUN_DESCRIPTOR 0x0F
36#define MAX_LAN_INTERFACE 0x10
39#define USB_CDC_NETWORK_CONNECTION 0x00
42#define NETWORK_CONNECTED 0x01
43#define NETWORK_DISCONNECT 0x00
45#define MAC_FILTERS_MASK 0x7FFF
51 UINT8 DescriptorSubtype;
59 UINT8 DescriptorSubtype;
60 UINT8 MasterInterface;
68 UINT8 DescriptorSubtype;
70 UINT32 EthernetStatistics;
71 UINT16 MaxSegmentSize;
72 UINT16 NumberMcFilters;
73 UINT8 NumberPowerFilters;
82#define USB_ETHERNET_GET_REQ_TYPE 0xA1
83#define USB_ETHERNET_SET_REQ_TYPE 0x21
87#define SET_ETH_MULTICAST_FILTERS_REQ 0x40
88#define SET_ETH_POWER_MANAGEMENT_PATTERN_FILTER_REQ 0x41
89#define GET_ETH_POWER_MANAGEMENT_PATTERN_FILTER_REQ 0x42
90#define SET_ETH_PACKET_FILTER_REQ 0x43
91#define GET_ETH_STATISTIC_REQ 0x44
94#define USB_ETH_POWER_FILTER_LENGTH 2
95#define USB_ETH_PACKET_FILTER_LENGTH 0
96#define USB_ETH_STATISTIC 4
100#define USB_ETH_PACKET_TYPE_PROMISCUOUS BIT0
101#define USB_ETH_PACKET_TYPE_ALL_MULTICAST BIT1
102#define USB_ETH_PACKET_TYPE_DIRECTED BIT2
103#define USB_ETH_PACKET_TYPE_BROADCAST BIT3
104#define USB_ETH_PACKET_TYPE_MULTICAST BIT4
108#define USB_ETH_XMIT_OK 0x01
109#define USB_ETH_RCV_OK 0x02
110#define USB_ETH_XMIT_ERROR 0x03
111#define USB_ETH_RCV_ERROR 0x04
112#define USB_ETH_RCV_NO_BUFFER 0x05
113#define USB_ETH_DIRECTED_BYTES_XMIT 0x06
114#define USB_ETH_DIRECTED_FRAMES_XMIT 0x07
115#define USB_ETH_MULTICAST_BYTES_XMIT 0x08
116#define USB_ETH_MULTICAST_FRAMES_XMIT 0x09
117#define USB_ETH_BROADCAST_BYTES_XMIT 0x0A
118#define USB_ETH_BROADCAST_FRAMES_XMIT 0x0B
119#define USB_ETH_DIRECTED_BYTES_RCV 0x0C
120#define USB_ETH_DIRECTED_FRAMES_RCV 0x0D
121#define USB_ETH_MULTICAST_BYTES_RCV 0x0E
122#define USB_ETH_MULTICAST_FRAMES_RCV 0x0F
123#define USB_ETH_BROADCAST_BYTES_RCV 0x10
124#define USB_ETH_BROADCAST_FRAMES_RCV 0x11
125#define USB_ETH_RCV_CRC_ERROR 0x12
126#define USB_ETH_TRANSMIT_QUEUE_LENGTH 0x13
127#define USB_ETH_RCV_ERROR_ALIGNMENT 0x14
128#define USB_ETH_XMIT_ONE_COLLISION 0x15
129#define USB_ETH_XMIT_MORE_COLLISIONS 0x16
130#define USB_ETH_XMIT_DEFERRED 0x17
131#define USB_ETH_XMIT_MAX_COLLISIONS 0x18
132#define USB_ETH_RCV_OVERRUN 0x19
133#define USB_ETH_XMIT_UNDERRUN 0x1A
134#define USB_ETH_XMIT_HEARTBEAT_FAILURE 0x1B
135#define USB_ETH_XMIT_TIMES_CRS_LOST 0x1C
136#define USB_ETH_XMIT_LATE_COLLISIONS 0x1D
142 UINT16 InterrupOpFlag;
144 PXE_MAC_ADDR McastList[MAX_MCAST_ADDRESS_CNT];
150 UINT16 ReceiveStatus;
154 UINT16 NetworkConnect;
156 UINT16 MaxSegmentSize;
160 UINT8 PermNodeAddress[PXE_MAC_LENGTH];
161 UINT8 CurrentNodeAddress[PXE_MAC_LENGTH];
162 UINT8 BroadcastNodeAddress[PXE_MAC_LENGTH];
165 UINT32 RateLimitingCredit;
166 UINT32 RateLimitingCreditCount;
167 UINT32 RateLimitingPollTimer;
168 BOOLEAN RateLimitingEnable;
171#define NIC_DATA_SIGNATURE SIGNATURE_32('n', 'i', 'c', 'd')
172#define NIC_DATA_FROM_EDKII_USB_ETHERNET_PROTOCOL(a) CR (a, NIC_DATA, UsbEth, NIC_DATA_SIGNATURE)
637 IN BOOLEAN IsNewTransfer,
770 IN VOID *PatternFilter
792 OUT BOOLEAN *PatternActive
831 IN UINT16 FeatureSelector,
878extern EFI_GUID gEdkIIUsbEthProtocolGuid;
EFI_STATUS PxeInit(SNP_DRIVER *Snp, UINT16 CableDetectFlag)
EFI_STATUS PxeStart(IN SNP_DRIVER *Snp)
#define MAX_XMIT_BUFFERS
recycling Q length for xmit_done.
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_GET_INIT_INFO)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_RECEIVE_FILTER)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_FUNCTIONAL_DESCRIPTOR)(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_ETHERNET_FUN_DESCRIPTOR *UsbEthFunDescriptor)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_INITIALIZE)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_INTERRUPT)(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN BOOLEAN IsNewTransfer, IN UINTN PollingInterval, IN EFI_USB_DEVICE_REQUEST *Request)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_TRANSMIT)(IN PXE_CDB *Cdb, IN EDKII_USB_ETHERNET_PROTOCOL *This, IN OUT VOID *Packet, IN OUT UINTN *PacketLength)
EFI_STATUS(EFIAPI * EDKII_USB_GET_ETH_MAC_ADDRESS)(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT EFI_MAC_ADDRESS *MacAddress)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_GET_ETH_POWER_MANAGE_PATTERN_FILTER)(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, OUT BOOLEAN *PatternActive)
EFI_STATUS(EFIAPI * EDKII_USB_UNION_FUNCTIONAL_DESCRIPTOR)(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_UNION_FUN_DESCRIPTOR *UsbUnionFunDescriptor)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_GET_STATE)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_STOP)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_RECEIVE)(IN PXE_CDB *Cdb, IN EDKII_USB_ETHERNET_PROTOCOL *This, IN OUT VOID *Packet, IN OUT UINTN *PacketLength)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_SET_ETH_PACKET_FILTER)(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_NV_DATA)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_SET_ETH_MULTICAST_FILTERS)(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, IN VOID *McastAddr)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_START)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_HEADER_FUNCTIONAL_DESCRIPTOR)(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_HEADER_FUN_DESCRIPTOR *UsbHeaderFunDescriptor)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_INITIALIZE)(IN PXE_CDB *Cdb, IN OUT NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETH_MAX_BULK_SIZE)(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT UINTN *BulkSize)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_GET_ETH_STATISTIC)(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 FeatureSelector, OUT VOID *Statistic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_STATION_ADDRESS)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_TRANSMIT)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_RESET)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_GET_CONFIG_INFO)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_SHUTDOWN)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_SET_ETH_POWER_MANAGE_PATTERN_FILTER)(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, IN UINT16 Length, IN VOID *PatternFilter)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_GET_STATUS)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_MCAST_IPTOMAC)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_STATISTICS)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_INTERRUPT_ENABLE)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_STATISTICS)(IN NIC_DATA *Nic, IN UINT64 DbAddr, IN UINT16 DbSize)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_FILL_HEADER)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS(EFIAPI * EDKII_USB_ETHERNET_UNDI_RECEIVE)(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)