TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbCdcEcm.c File Reference
#include "UsbCdcEcm.h"

Go to the source code of this file.

Functions

BOOLEAN IsSupportedDevice (IN EFI_USB_IO_PROTOCOL *UsbIo)
 
EFI_STATUS EFIAPI UsbEcmDriverSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS IsSameDevice (IN EFI_DEVICE_PATH_PROTOCOL *UsbEthPath, IN EFI_DEVICE_PATH_PROTOCOL *UsbCdcDataPath)
 
BOOLEAN IsUsbCdcData (IN EFI_DEVICE_PATH_PROTOCOL *UsbEthPath, IN OUT EFI_HANDLE *UsbCdcDataHandle)
 
VOID EFIAPI CallbackFunction (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI UsbEcmDriverStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
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)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gUsbEcmDriverBinding
 

Detailed Description

This file contains code for USB Ethernet Control Model Driver

Copyright (c) 2023, American Megatrends International LLC. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UsbCdcEcm.c.

Function Documentation

◆ CallbackFunction()

VOID EFIAPI CallbackFunction ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Call Back Function.

Parameters
[in]EventEvent whose notification function is being invoked.
[in]ContextThe pointer to the notification function's context, which is implementation-dependent.

Definition at line 230 of file UsbCdcEcm.c.

◆ IsSameDevice()

EFI_STATUS IsSameDevice ( IN EFI_DEVICE_PATH_PROTOCOL UsbEthPath,
IN EFI_DEVICE_PATH_PROTOCOL UsbCdcDataPath 
)

Check if the USB ECM and USB CDC Data interfaces are from the same device.

Parameters
[in]UsbEthPathA pointer to the EFI_DEVICE_PATH_PROTOCOL instance.
[in]UsbCdcDataPathA pointer to the EFI_DEVICE_PATH_PROTOCOL instance.
Return values
EFI_SUCCESSIs the same device.
EFI_NOT_FOUNDIs not the same device.

Definition at line 109 of file UsbCdcEcm.c.

◆ IsSupportedDevice()

BOOLEAN IsSupportedDevice ( IN EFI_USB_IO_PROTOCOL UsbIo)

Check if this interface is USB ECM SubType

Parameters
[in]UsbIoA pointer to the EFI_USB_IO_PROTOCOL instance.
Return values
TRUEUSB ECM SubType.
FALSENot USB ECM SubType.

Definition at line 29 of file UsbCdcEcm.c.

◆ IsUsbCdcData()

BOOLEAN IsUsbCdcData ( IN EFI_DEVICE_PATH_PROTOCOL UsbEthPath,
IN OUT EFI_HANDLE UsbCdcDataHandle 
)

Check if the USB CDC Data(UsbIo) installed and return USB CDC Data Handle.

Parameters
[in]UsbEthPathA pointer to the EFI_DEVICE_PATH_PROTOCOL instance.
[in,out]UsbCdcDataHandleA pointer to the EFI_HANDLE for USB CDC Data.
Return values
TRUEUSB CDC Data(UsbIo) installed.
FALSEUSB CDC Data(UsbIo) did not installed.

Definition at line 159 of file UsbCdcEcm.c.

◆ UsbEcmDriverStart()

EFI_STATUS EFIAPI UsbEcmDriverStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

USB ECM Driver Binding Start.

Parameters
[in]ThisProtocol instance pointer.
[in]ControllerHandleHandle of device to bind driver to.
[in]RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver is added to ControllerHandle
EFI_DEVICE_ERRORThis driver could not be started due to a device error
EFI_OUT_OF_RESOURCESThe driver could not install successfully due to a lack of resources.
otherThis driver does not support this device

Definition at line 292 of file UsbCdcEcm.c.

◆ UsbEcmDriverStop()

EFI_STATUS EFIAPI UsbEcmDriverStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

USB ECM Driver Binding Stop.

Parameters
[in]ThisProtocol instance pointer.
[in]ControllerHandleHandle of device to stop driver on
[in]NumberOfChildrenNumber of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver.
[in]ChildHandleBufferList of Child Handles to Stop.
Return values
EFI_SUCCESSThis driver is removed ControllerHandle
otherThis driver was not removed from this device

Definition at line 427 of file UsbCdcEcm.c.

◆ UsbEcmDriverSupported()

EFI_STATUS EFIAPI UsbEcmDriverSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

USB ECM Driver Binding Support.

Parameters
[in]ThisProtocol instance pointer.
[in]ControllerHandleHandle of device to test.
[in]RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver supports this device.
EFI_ALREADY_STARTEDThis driver is already running on this device.
otherThis driver does not support this device.

Definition at line 66 of file UsbCdcEcm.c.

◆ UsbEcmEntry()

EFI_STATUS EFIAPI UsbEcmEntry ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Entrypoint of ECM Driver.

This function is the entrypoint of ECM Driver. It installs Driver Binding Protocols together with Component Name Protocols.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.

Definition at line 486 of file UsbCdcEcm.c.

Variable Documentation

◆ gUsbEcmDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gUsbEcmDriverBinding
Initial value:
= {
USB_ECM_DRIVER_VERSION,
}
#define NULL
Definition: Base.h:319
EFI_STATUS EFIAPI UsbEcmDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: UsbCdcEcm.c:427
EFI_STATUS EFIAPI UsbEcmDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: UsbCdcEcm.c:66
EFI_STATUS EFIAPI UsbEcmDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: UsbCdcEcm.c:292

Definition at line 10 of file UsbCdcEcm.c.