TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbEcmFunction.c
Go to the documentation of this file.
1
9#include "UsbCdcEcm.h"
10
30 )
31{
32 EFI_STATUS Status;
33 UINT32 TransStatus;
35
36 Status = UsbIo->UsbGetConfigDescriptor (UsbIo, &Tmp);
37 ASSERT_EFI_ERROR (Status);
38
39 Status = gBS->AllocatePool (EfiBootServicesData, Tmp.TotalLength, (VOID **)ConfigDesc);
40 ASSERT_EFI_ERROR (Status);
41
42 Status = UsbGetDescriptor (
43 UsbIo,
44 USB_DESC_TYPE_CONFIG << 8 | (Tmp.ConfigurationValue - 1), // zero based
45 0,
46 Tmp.TotalLength,
47 *ConfigDesc,
48 &TransStatus
49 );
50 return Status;
51}
52
64BOOLEAN
67 IN OUT UINTN *Offset
68 )
69{
70 if ((Desc == NULL) || (*Offset >= Desc->TotalLength)) {
71 return FALSE;
72 }
73
74 if (((EFI_USB_CONFIG_DESCRIPTOR *)((char *)Desc+*Offset))->Length == 0) {
75 return FALSE;
76 }
77
78 *Offset += ((EFI_USB_CONFIG_DESCRIPTOR *)((char *)Desc+*Offset))->Length;
79 if ( *Offset >= Desc->TotalLength ) {
80 return FALSE;
81 }
82
83 return TRUE;
84}
85
102 IN UINT8 FunDescriptorType,
103 OUT VOID *DataBuffer
104 )
105{
106 EFI_STATUS Status;
107 UINTN Offset;
109
110 Status = EFI_NOT_FOUND;
111
112 for (Offset = 0; NextDescriptor (Config, &Offset);) {
113 Interface = (EFI_USB_INTERFACE_DESCRIPTOR *)((UINT8 *)Config + Offset);
114 if (Interface->DescriptorType == USB_DESC_TYPE_CS_INTERFACE) {
115 if (((USB_HEADER_FUN_DESCRIPTOR *)Interface)->DescriptorSubtype == FunDescriptorType) {
116 switch (FunDescriptorType) {
117 case HEADER_FUN_DESCRIPTOR:
118 CopyMem (
119 DataBuffer,
120 (USB_HEADER_FUN_DESCRIPTOR *)Interface,
122 );
123 return EFI_SUCCESS;
124 case UNION_FUN_DESCRIPTOR:
125 CopyMem (
126 DataBuffer,
127 (USB_UNION_FUN_DESCRIPTOR *)Interface,
128 ((USB_UNION_FUN_DESCRIPTOR *)Interface)->FunctionLength
129 );
130 return EFI_SUCCESS;
131 case ETHERNET_FUN_DESCRIPTOR:
132 CopyMem (
133 DataBuffer,
134 (USB_ETHERNET_FUN_DESCRIPTOR *)Interface,
136 );
137 return EFI_SUCCESS;
138 default:
139 Status = EFI_UNSUPPORTED;
140 break;
141 }
142 }
143 }
144 }
145
146 return Status;
147}
148
156VOID
158 IN EFI_USB_IO_PROTOCOL *UsbIo,
159 IN OUT USB_ETHERNET_DRIVER *UsbEthDriver
160 )
161{
162 EFI_STATUS Status;
163 UINT8 Index;
164 UINT32 Result;
167
168 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);
169 ASSERT_EFI_ERROR (Status);
170
171 if (Interface.NumEndpoints == 0) {
172 Status = UsbSetInterface (UsbIo, Interface.InterfaceNumber, 1, &Result);
173 ASSERT_EFI_ERROR (Status);
174
175 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);
176 ASSERT_EFI_ERROR (Status);
177 }
178
179 for (Index = 0; Index < Interface.NumEndpoints; Index++) {
180 Status = UsbIo->UsbGetEndpointDescriptor (UsbIo, Index, &Endpoint);
181 ASSERT_EFI_ERROR (Status);
182
183 switch ((Endpoint.Attributes & (BIT0 | BIT1))) {
184 case USB_ENDPOINT_BULK:
185 if (Endpoint.EndpointAddress & BIT7) {
186 UsbEthDriver->BulkInEndpoint = Endpoint.EndpointAddress;
187 } else {
188 UsbEthDriver->BulkOutEndpoint = Endpoint.EndpointAddress;
189 }
190
191 break;
192 case USB_ENDPOINT_INTERRUPT:
193 UsbEthDriver->InterruptEndpoint = Endpoint.EndpointAddress;
194 break;
195 }
196 }
197}
198
216EFIAPI
218 IN PXE_CDB *Cdb,
220 IN OUT VOID *Packet,
221 IN OUT UINTN *PacketLength
222 )
223{
224 EFI_STATUS Status;
225 USB_ETHERNET_DRIVER *UsbEthDriver;
226 EFI_USB_IO_PROTOCOL *UsbIo;
227 UINT32 TransStatus;
228
229 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
230
231 Status = gBS->HandleProtocol (
232 UsbEthDriver->UsbCdcDataHandle,
233 &gEfiUsbIoProtocolGuid,
234 (VOID **)&UsbIo
235 );
236 if (EFI_ERROR (Status)) {
237 return Status;
238 }
239
240 if (UsbEthDriver->BulkInEndpoint == 0) {
241 GetEndpoint (UsbIo, UsbEthDriver);
242 }
243
244 Status = UsbIo->UsbBulkTransfer (
245 UsbIo,
246 UsbEthDriver->BulkInEndpoint,
247 Packet,
248 PacketLength,
249 USB_ETHERNET_BULK_TIMEOUT,
250 &TransStatus
251 );
252 return Status;
253}
254
272EFIAPI
274 IN PXE_CDB *Cdb,
276 IN VOID *Packet,
277 IN OUT UINTN *PacketLength
278 )
279{
280 EFI_STATUS Status;
281 USB_ETHERNET_DRIVER *UsbEthDriver;
282 EFI_USB_IO_PROTOCOL *UsbIo;
283 UINT32 TransStatus;
284
285 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
286
287 Status = gBS->HandleProtocol (
288 UsbEthDriver->UsbCdcDataHandle,
289 &gEfiUsbIoProtocolGuid,
290 (VOID **)&UsbIo
291 );
292 if (EFI_ERROR (Status)) {
293 return Status;
294 }
295
296 if (UsbEthDriver->BulkOutEndpoint == 0) {
297 GetEndpoint (UsbIo, UsbEthDriver);
298 }
299
300 Status = UsbIo->UsbBulkTransfer (
301 UsbIo,
302 UsbEthDriver->BulkOutEndpoint,
303 Packet,
304 PacketLength,
305 USB_ETHERNET_BULK_TIMEOUT,
306 &TransStatus
307 );
308 return Status;
309}
310
326EFIAPI
328 IN VOID *Data,
329 IN UINTN DataLength,
330 IN VOID *Context,
331 IN UINT32 Status
332 )
333{
334 if ((Data == NULL) || (Context == NULL)) {
335 return EFI_INVALID_PARAMETER;
336 }
337
338 if (((EFI_USB_DEVICE_REQUEST *)Data)->Request == USB_CDC_NETWORK_CONNECTION) {
339 CopyMem (
340 (EFI_USB_DEVICE_REQUEST *)Context,
343 );
344 }
345
346 return EFI_SUCCESS;
347}
348
367EFIAPI
370 IN BOOLEAN IsNewTransfer,
371 IN UINTN PollingInterval,
373 )
374{
375 EFI_STATUS Status;
376 USB_ETHERNET_DRIVER *UsbEthDriver;
377 UINTN DataLength;
378
379 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
380 DataLength = 0;
381
382 if (IsNewTransfer) {
383 DataLength = sizeof (EFI_USB_DEVICE_REQUEST) + sizeof (USB_CONNECT_SPEED_CHANGE);
384 Status = UsbEthDriver->UsbIo->UsbAsyncInterruptTransfer (
385 UsbEthDriver->UsbIo,
386 UsbEthDriver->InterruptEndpoint,
387 IsNewTransfer,
388 PollingInterval,
389 DataLength,
391 Request
392 );
393 } else {
394 Status = UsbEthDriver->UsbIo->UsbAsyncInterruptTransfer (
395 UsbEthDriver->UsbIo,
396 UsbEthDriver->InterruptEndpoint,
397 IsNewTransfer,
398 0,
399 0,
400 NULL,
401 NULL
402 );
403 }
404
405 return Status;
406}
407
420EFIAPI
423 OUT EFI_MAC_ADDRESS *MacAddress
424 )
425{
426 EFI_STATUS Status;
427 USB_ETHERNET_DRIVER *UsbEthDriver;
428 USB_ETHERNET_FUN_DESCRIPTOR UsbEthDescriptor;
429 CHAR16 *Data;
430 CHAR16 *DataPtr;
431 CHAR16 TmpStr[1];
432 UINT8 Index;
433 UINT8 Hi;
434 UINT8 Low;
435
436 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
437
438 Status = This->UsbEthFunDescriptor (This, &UsbEthDescriptor);
439 if (EFI_ERROR (Status)) {
440 DEBUG ((DEBUG_ERROR, "%a:UsbEthFunDescriptor status = %r\n", __func__, Status));
441 return Status;
442 }
443
444 Status = UsbEthDriver->UsbIo->UsbGetStringDescriptor (
445 UsbEthDriver->UsbIo,
446 0x409, // English-US Language ID
447 UsbEthDescriptor.MacAddress,
448 &Data
449 );
450 if (EFI_ERROR (Status)) {
451 DEBUG ((DEBUG_ERROR, "%a:UsbGetStringDescriptor status = %r\n", __func__, Status));
452 return Status;
453 }
454
455 DataPtr = Data;
456 for (Index = 0; Index < PXE_HWADDR_LEN_ETHER; Index++) {
457 CopyMem (TmpStr, DataPtr, sizeof (CHAR16));
458 DataPtr++;
459 Hi = (UINT8)StrHexToUintn (TmpStr);
460 CopyMem (TmpStr, DataPtr, sizeof (CHAR16));
461 DataPtr++;
462 Low = (UINT8)StrHexToUintn (TmpStr);
463 MacAddress->Addr[Index] = (Hi << 4) | Low;
464 }
465
466 return Status;
467}
468
480EFIAPI
483 OUT UINTN *BulkSize
484 )
485{
486 EFI_STATUS Status;
487 USB_ETHERNET_FUN_DESCRIPTOR UsbEthFunDescriptor;
488
489 Status = This->UsbEthFunDescriptor (This, &UsbEthFunDescriptor);
490 if (EFI_ERROR (Status)) {
491 return Status;
492 }
493
494 *BulkSize = (UINTN)UsbEthFunDescriptor.MaxSegmentSize;
495 return Status;
496}
497
510EFIAPI
513 OUT USB_HEADER_FUN_DESCRIPTOR *UsbHeaderFunDescriptor
514 )
515{
516 EFI_STATUS Status;
517 USB_ETHERNET_DRIVER *UsbEthDriver;
518
519 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
520
521 if (UsbHeaderFunDescriptor == NULL) {
522 return EFI_INVALID_PARAMETER;
523 }
524
525 Status = GetFunctionalDescriptor (UsbEthDriver->Config, HEADER_FUN_DESCRIPTOR, UsbHeaderFunDescriptor);
526 return Status;
527}
528
541EFIAPI
544 OUT USB_UNION_FUN_DESCRIPTOR *UsbUnionFunDescriptor
545 )
546{
547 EFI_STATUS Status;
548 USB_ETHERNET_DRIVER *UsbEthDriver;
549
550 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
551
552 if (UsbUnionFunDescriptor == NULL) {
553 return EFI_INVALID_PARAMETER;
554 }
555
556 Status = GetFunctionalDescriptor (UsbEthDriver->Config, UNION_FUN_DESCRIPTOR, UsbUnionFunDescriptor);
557 return Status;
558}
559
576EFIAPI
579 OUT USB_ETHERNET_FUN_DESCRIPTOR *UsbEthFunDescriptor
580 )
581{
582 EFI_STATUS Status;
583 USB_ETHERNET_DRIVER *UsbEthDriver;
584
585 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
586
587 if (UsbEthFunDescriptor == NULL) {
588 return EFI_INVALID_PARAMETER;
589 }
590
591 Status = GetFunctionalDescriptor (UsbEthDriver->Config, ETHERNET_FUN_DESCRIPTOR, UsbEthFunDescriptor);
592 return Status;
593}
594
611EFIAPI
614 IN UINT16 Value,
615 IN VOID *McastAddr
616 )
617{
618 EFI_STATUS Status;
620 UINT32 TransStatus;
621 USB_ETHERNET_FUN_DESCRIPTOR UsbEthFunDescriptor;
622 USB_ETHERNET_DRIVER *UsbEthDriver;
623
624 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
625
626 Status = This->UsbEthFunDescriptor (This, &UsbEthFunDescriptor);
627 if (EFI_ERROR (Status)) {
628 return Status;
629 }
630
631 if ((UsbEthFunDescriptor.NumberMcFilters & MAC_FILTERS_MASK) == 0) {
632 return EFI_UNSUPPORTED;
633 }
634
635 Request.RequestType = USB_ETHERNET_SET_REQ_TYPE;
636 Request.Request = SET_ETH_MULTICAST_FILTERS_REQ;
637 Request.Value = Value;
638 Request.Index = UsbEthDriver->NumOfInterface;
639 Request.Length = Value * 6;
640
641 return UsbEthDriver->UsbIo->UsbControlTransfer (
642 UsbEthDriver->UsbIo,
643 &Request,
644 EfiUsbDataOut,
645 USB_ETHERNET_TRANSFER_TIMEOUT,
646 McastAddr,
647 Request.Length,
648 &TransStatus
649 );
650}
651
669EFIAPI
672 IN UINT16 Value,
673 IN UINT16 Length,
674 IN VOID *PatternFilter
675 )
676{
678 UINT32 TransStatus;
679 USB_ETHERNET_DRIVER *UsbEthDriver;
680
681 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
682
683 Request.RequestType = USB_ETHERNET_SET_REQ_TYPE;
684 Request.Request = SET_ETH_POWER_MANAGEMENT_PATTERN_FILTER_REQ;
685 Request.Value = Value;
686 Request.Index = UsbEthDriver->NumOfInterface;
687 Request.Length = Length;
688
689 return UsbEthDriver->UsbIo->UsbControlTransfer (
690 UsbEthDriver->UsbIo,
691 &Request,
692 EfiUsbDataOut,
693 USB_ETHERNET_TRANSFER_TIMEOUT,
694 PatternFilter,
695 Length,
696 &TransStatus
697 );
698}
699
716EFIAPI
719 IN UINT16 Value,
720 OUT BOOLEAN *PatternActive
721 )
722{
724 UINT32 TransStatus;
725 USB_ETHERNET_DRIVER *UsbEthDriver;
726
727 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
728
729 Request.RequestType = USB_ETHERNET_GET_REQ_TYPE;
730 Request.Request = GET_ETH_POWER_MANAGEMENT_PATTERN_FILTER_REQ;
731 Request.Value = Value;
732 Request.Index = UsbEthDriver->NumOfInterface;
733 Request.Length = USB_ETH_POWER_FILTER_LENGTH;
734
735 return UsbEthDriver->UsbIo->UsbControlTransfer (
736 UsbEthDriver->UsbIo,
737 &Request,
738 EfiUsbDataIn,
739 USB_ETHERNET_TRANSFER_TIMEOUT,
740 PatternActive,
741 USB_ETH_POWER_FILTER_LENGTH,
742 &TransStatus
743 );
744}
745
746BIT_MAP gTable[] = {
747 { PXE_OPFLAGS_RECEIVE_FILTER_UNICAST, USB_ETH_PACKET_TYPE_DIRECTED },
748 { PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST, USB_ETH_PACKET_TYPE_BROADCAST },
749 { PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST, USB_ETH_PACKET_TYPE_MULTICAST },
750 { PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS, USB_ETH_PACKET_TYPE_PROMISCUOUS },
751 { PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST, USB_ETH_PACKET_TYPE_ALL_MULTICAST },
752};
753
761VOID
763 IN UINT16 Value,
764 OUT UINT16 *CdcFilter
765 )
766{
767 UINT32 Index;
768 UINT32 Count;
769
770 Count = sizeof (gTable)/sizeof (gTable[0]);
771
772 for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
773 if (gTable[Index].Src & Value) {
774 *CdcFilter |= gTable[Index].Dst;
775 }
776 }
777}
778
793EFIAPI
796 IN UINT16 Value
797 )
798{
800 UINT32 TransStatus;
801 USB_ETHERNET_DRIVER *UsbEthDriver;
802 UINT16 CommandFilter;
803
804 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
805 CommandFilter = 0;
806
807 ConvertFilter (Value, &CommandFilter);
808
809 Request.RequestType = USB_ETHERNET_SET_REQ_TYPE;
810 Request.Request = SET_ETH_PACKET_FILTER_REQ;
811 Request.Value = CommandFilter;
812 Request.Index = UsbEthDriver->NumOfInterface;
813 Request.Length = USB_ETH_PACKET_FILTER_LENGTH;
814
815 return UsbEthDriver->UsbIo->UsbControlTransfer (
816 UsbEthDriver->UsbIo,
817 &Request,
818 EfiUsbNoData,
819 USB_ETHERNET_TRANSFER_TIMEOUT,
820 NULL,
821 USB_ETH_PACKET_FILTER_LENGTH,
822 &TransStatus
823 );
824}
825
841EFIAPI
844 IN UINT16 FeatureSelector,
845 OUT VOID *Statistic
846 )
847{
848 EFI_STATUS Status;
850 UINT32 TransStatus;
851 USB_ETHERNET_FUN_DESCRIPTOR UsbEthFunDescriptor;
852 USB_ETHERNET_DRIVER *UsbEthDriver;
853
854 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (This);
855
856 Status = This->UsbEthFunDescriptor (This, &UsbEthFunDescriptor);
857 if (EFI_ERROR (Status)) {
858 return Status;
859 }
860
861 if (UsbEthFunDescriptor.EthernetStatistics == 0) {
862 return EFI_UNSUPPORTED;
863 }
864
865 Request.RequestType = USB_ETHERNET_GET_REQ_TYPE;
866 Request.Request = GET_ETH_STATISTIC_REQ;
867 Request.Value = FeatureSelector;
868 Request.Index = UsbEthDriver->NumOfInterface;
869 Request.Length = USB_ETH_STATISTIC;
870
871 return UsbEthDriver->UsbIo->UsbControlTransfer (
872 UsbEthDriver->UsbIo,
873 &Request,
874 EfiUsbDataIn,
875 USB_ETHERNET_TRANSFER_TIMEOUT,
876 Statistic,
877 USB_ETH_STATISTIC,
878 &TransStatus
879 );
880}
UINT64 UINTN
UINTN EFIAPI StrHexToUintn(IN CONST CHAR16 *String)
Definition: String.c:508
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS(EFIAPI * EFI_ASYNC_USB_TRANSFER_CALLBACK)(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
Definition: UsbIo.h:80
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
@ EfiBootServicesData
#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST
Definition: UefiPxe.h:284
#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS
Definition: UefiPxe.h:302
#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST
Definition: UefiPxe.h:297
#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST
Definition: UefiPxe.h:308
#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST
Definition: UefiPxe.h:290
EFI_STATUS EFIAPI UsbSetInterface(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Interface, IN UINT16 AlternateSetting, OUT UINT32 *Status)
Definition: UsbDxeLib.c:212
EFI_STATUS EFIAPI UsbGetDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Value, IN UINT16 Index, IN UINT16 DescriptorLength, OUT VOID *Descriptor, OUT UINT32 *Status)
Definition: UsbDxeLib.c:41
EFI_STATUS EFIAPI GetUsbEthMacAddress(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT EFI_MAC_ADDRESS *MacAddress)
EFI_STATUS EFIAPI SetUsbEthPowerFilter(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, IN UINT16 Length, IN VOID *PatternFilter)
EFI_STATUS EFIAPI SetUsbEthPacketFilter(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value)
EFI_STATUS EFIAPI UsbEthEcmInterrupt(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN BOOLEAN IsNewTransfer, IN UINTN PollingInterval, IN EFI_USB_DEVICE_REQUEST *Request)
EFI_STATUS EFIAPI InterruptCallback(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
VOID GetEndpoint(IN EFI_USB_IO_PROTOCOL *UsbIo, IN OUT USB_ETHERNET_DRIVER *UsbEthDriver)
EFI_STATUS EFIAPI UsbEthEcmBulkSize(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT UINTN *BulkSize)
EFI_STATUS GetFunctionalDescriptor(IN EFI_USB_CONFIG_DESCRIPTOR *Config, IN UINT8 FunDescriptorType, OUT VOID *DataBuffer)
EFI_STATUS EFIAPI GetUsbEthFunDescriptor(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_ETHERNET_FUN_DESCRIPTOR *UsbEthFunDescriptor)
EFI_STATUS EFIAPI GetUsbEthPowerFilter(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, OUT BOOLEAN *PatternActive)
EFI_STATUS LoadAllDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, OUT EFI_USB_CONFIG_DESCRIPTOR **ConfigDesc)
EFI_STATUS EFIAPI UsbEthEcmTransmit(IN PXE_CDB *Cdb, IN EDKII_USB_ETHERNET_PROTOCOL *This, IN VOID *Packet, IN OUT UINTN *PacketLength)
EFI_STATUS EFIAPI GetUsbEthStatistic(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 FeatureSelector, OUT VOID *Statistic)
EFI_STATUS EFIAPI SetUsbEthMcastFilter(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, IN VOID *McastAddr)
EFI_STATUS EFIAPI GetUsbHeaderFunDescriptor(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_HEADER_FUN_DESCRIPTOR *UsbHeaderFunDescriptor)
EFI_STATUS EFIAPI UsbEthEcmReceive(IN PXE_CDB *Cdb, IN EDKII_USB_ETHERNET_PROTOCOL *This, IN OUT VOID *Packet, IN OUT UINTN *PacketLength)
EFI_STATUS EFIAPI GetUsbUnionFunDescriptor(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_UNION_FUN_DESCRIPTOR *UsbUnionFunDescriptor)
VOID ConvertFilter(IN UINT16 Value, OUT UINT16 *CdcFilter)
BOOLEAN NextDescriptor(IN EFI_USB_CONFIG_DESCRIPTOR *Desc, IN OUT UINTN *Offset)