14 USB_ECM_DRIVER_VERSION,
36 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &InterfaceDescriptor);
37 if (EFI_ERROR (Status)) {
41 if ((InterfaceDescriptor.InterfaceClass == USB_CDC_CLASS) &&
42 (InterfaceDescriptor.InterfaceSubClass == USB_CDC_ECM_SUBCLASS) &&
43 (InterfaceDescriptor.InterfaceProtocol == USB_NO_CLASS_PROTOCOL))
75 Status =
gBS->OpenProtocol (
77 &gEfiUsbIoProtocolGuid,
79 This->DriverBindingHandle,
81 EFI_OPEN_PROTOCOL_BY_DRIVER
83 if (EFI_ERROR (Status)) {
91 &gEfiUsbIoProtocolGuid,
92 This->DriverBindingHandle,
117 return EFI_NOT_FOUND;
123 return EFI_NOT_FOUND;
134 return EFI_NOT_FOUND;
138 return EFI_NOT_FOUND;
172 Status =
gBS->LocateHandleBuffer (
174 &gEfiUsbIoProtocolGuid,
179 if (EFI_ERROR (Status)) {
183 for (Index = 0; Index < HandleCount; Index++) {
184 Status =
gBS->HandleProtocol (
186 &gEfiUsbIoProtocolGuid,
191 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);
194 if ((Interface.InterfaceClass == USB_CDC_DATA_CLASS) &&
195 (Interface.InterfaceSubClass == USB_CDC_DATA_SUBCLASS) &&
196 (Interface.InterfaceProtocol == USB_NO_CLASS_PROTOCOL))
198 Status =
gBS->HandleProtocol (
200 &gEfiDevicePathProtocolGuid,
201 (VOID **)&UsbCdcDataPath
203 if (EFI_ERROR (Status)) {
208 if (!EFI_ERROR (Status)) {
242 Status =
gBS->LocateHandleBuffer (
244 &gEfiUsbIoProtocolGuid,
249 if (EFI_ERROR (Status)) {
253 for (Index = 0; Index < HandleCount; Index++) {
254 Status =
gBS->HandleProtocol (
256 &gEfiUsbIoProtocolGuid,
261 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);
264 if ((Interface.InterfaceClass == USB_CDC_CLASS) &&
265 (Interface.InterfaceSubClass == USB_CDC_ECM_SUBCLASS) &&
266 (Interface.InterfaceProtocol == USB_NO_CLASS_PROTOCOL))
273 gBS->CloseEvent (Event);
307 Status =
gBS->OpenProtocol (
309 &gEfiUsbIoProtocolGuid,
311 This->DriverBindingHandle,
313 EFI_OPEN_PROTOCOL_BY_DRIVER
315 if (EFI_ERROR (Status)) {
319 Status =
gBS->OpenProtocol (
321 &gEfiDevicePathProtocolGuid,
322 (VOID **)&UsbEthPath,
323 This->DriverBindingHandle,
325 EFI_OPEN_PROTOCOL_GET_PROTOCOL
327 if (EFI_ERROR (Status)) {
330 &gEfiUsbIoProtocolGuid,
331 This->DriverBindingHandle,
338 if (EFI_ERROR (Status)) {
341 &gEfiUsbIoProtocolGuid,
342 This->DriverBindingHandle,
347 if (EFI_ERROR (Status)) {
351 Status =
gBS->RegisterProtocolNotify (&gEfiUsbIoProtocolGuid, Event, &Reg);
359 &gEfiUsbIoProtocolGuid,
360 This->DriverBindingHandle,
363 return EFI_OUT_OF_RESOURCES;
371 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);
374 UsbEthDriver->Signature = USB_ETHERNET_SIGNATURE;
375 UsbEthDriver->NumOfInterface = Interface.InterfaceNumber;
376 UsbEthDriver->UsbCdcDataHandle = UsbCdcDataHandle;
377 UsbEthDriver->UsbIo = UsbIo;
392 Status =
gBS->InstallProtocolInterface (
394 &gEdkIIUsbEthProtocolGuid,
396 &(UsbEthDriver->UsbEth)
398 if (EFI_ERROR (Status)) {
401 &gEfiUsbIoProtocolGuid,
402 This->DriverBindingHandle,
438 Status =
gBS->OpenProtocol (
440 &gEdkIIUsbEthProtocolGuid,
441 (VOID **)&UsbEthProtocol,
442 This->DriverBindingHandle,
444 EFI_OPEN_PROTOCOL_GET_PROTOCOL
446 if (EFI_ERROR (Status)) {
450 UsbEthDriver = USB_ETHERNET_DEV_FROM_THIS (UsbEthProtocol);
452 Status =
gBS->UninstallProtocolInterface (
454 &gEdkIIUsbEthProtocolGuid,
457 if (EFI_ERROR (Status)) {
461 Status =
gBS->CloseProtocol (
463 &gEfiUsbIoProtocolGuid,
464 This->DriverBindingHandle,
494 return gBS->InstallMultipleProtocolInterfaces (
496 &gEfiDriverBindingProtocolGuid,
497 &gUsbEcmDriverBinding,
498 &gEfiComponentName2ProtocolGuid,
499 &gUsbEcmComponentName2,
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define HARDWARE_DEVICE_PATH
#define MESSAGING_DEVICE_PATH
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI NextDevicePathNode(IN CONST VOID *Node)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
EFI_STATUS EFIAPI UsbEcmDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI UsbEcmEntry(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI UsbEcmDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
BOOLEAN IsSupportedDevice(IN EFI_USB_IO_PROTOCOL *UsbIo)
EFI_STATUS IsSameDevice(IN EFI_DEVICE_PATH_PROTOCOL *UsbEthPath, IN EFI_DEVICE_PATH_PROTOCOL *UsbCdcDataPath)
EFI_STATUS EFIAPI UsbEcmDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
VOID EFIAPI CallbackFunction(IN EFI_EVENT Event, IN VOID *Context)
BOOLEAN IsUsbCdcData(IN EFI_DEVICE_PATH_PROTOCOL *UsbEthPath, IN OUT EFI_HANDLE *UsbCdcDataHandle)
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)
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 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)
EFI_HANDLE DriverBindingHandle