TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbCdcEcm.h
Go to the documentation of this file.
1
9#ifndef USB_CDC_ECM_H_
10#define USB_CDC_ECM_H_
11
14#include <Library/UefiLib.h>
16#include <Library/DebugLib.h>
19#include <Library/UefiUsbLib.h>
20#include <Protocol/UsbIo.h>
22
23typedef struct {
24 UINTN Signature;
26 EFI_HANDLE UsbCdcDataHandle;
29 UINT8 NumOfInterface;
30 UINT8 BulkInEndpoint;
31 UINT8 BulkOutEndpoint;
32 UINT8 InterruptEndpoint;
33 EFI_MAC_ADDRESS MacAddress;
35
36#define USB_ECM_DRIVER_VERSION 1
37#define USB_ETHERNET_BULK_TIMEOUT 1
38#define USB_ETHERNET_TRANSFER_TIMEOUT 200
39
40#define USB_ETHERNET_SIGNATURE SIGNATURE_32('u', 'e', 't', 'h')
41#define USB_ETHERNET_DEV_FROM_THIS(a) CR (a, USB_ETHERNET_DRIVER, UsbEth, USB_ETHERNET_SIGNATURE)
42
43typedef struct {
44 UINT16 Src;
45 UINT16 Dst;
46} BIT_MAP;
47
48extern EFI_COMPONENT_NAME2_PROTOCOL gUsbEcmComponentName2;
49
51EFIAPI
54 IN EFI_HANDLE ControllerHandle,
55 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
56 );
57
59EFIAPI
62 IN EFI_HANDLE ControllerHandle,
63 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
64 );
65
67EFIAPI
70 IN EFI_HANDLE ControllerHandle,
71 IN UINTN NumberOfChildren,
72 IN EFI_HANDLE *ChildHandleBuffer
73 );
74
79 );
80
81BOOLEAN
84 IN OUT UINTN *Offset
85 );
86
90 IN UINT8 FunDescriptorType,
91 OUT VOID *DataBuffer
92 );
93
94VOID
97 IN OUT USB_ETHERNET_DRIVER *UsbEthDriver
98 );
99
101EFIAPI
103 IN PXE_CDB *Cdb,
105 IN OUT VOID *Packet,
106 IN OUT UINTN *PacketLength
107 );
108
110EFIAPI
112 IN PXE_CDB *Cdb,
114 IN VOID *Packet,
115 IN OUT UINTN *PacketLength
116 );
117
119EFIAPI
122 IN BOOLEAN IsNewTransfer,
123 IN UINTN PollingInterval,
125 );
126
128EFIAPI
130 IN VOID *Data,
131 IN UINTN DataLength,
132 IN VOID *Context,
133 IN UINT32 Status
134 );
135
137EFIAPI
140 OUT EFI_MAC_ADDRESS *MacAddress
141 );
142
144EFIAPI
147 OUT UINTN *BulkSize
148 );
149
151EFIAPI
154 OUT USB_HEADER_FUN_DESCRIPTOR *UsbHeaderFunDescriptor
155 );
156
158EFIAPI
161 OUT USB_UNION_FUN_DESCRIPTOR *UsbUnionFunDescriptor
162 );
163
165EFIAPI
168 OUT USB_ETHERNET_FUN_DESCRIPTOR *UsbEthFunDescriptor
169 );
170
172EFIAPI
175 IN UINT16 Value,
176 IN VOID *McastAddr
177 );
178
180EFIAPI
183 IN UINT16 Value,
184 IN UINT16 Length,
185 IN VOID *PatternFilter
186 );
187
189EFIAPI
192 IN UINT16 Value,
193 OUT BOOLEAN *PatternActive
194 );
195
197EFIAPI
200 IN UINT16 Value
201 );
202
204EFIAPI
207 IN UINT16 FeatureSelector,
208 OUT VOID *Statistic
209 );
210
211#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
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 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 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 EFIAPI UsbEcmDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: UsbCdcEcm.c:66
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 UsbEcmDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: UsbCdcEcm.c:292
EFI_STATUS EFIAPI GetUsbUnionFunDescriptor(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_UNION_FUN_DESCRIPTOR *UsbUnionFunDescriptor)
BOOLEAN NextDescriptor(IN EFI_USB_CONFIG_DESCRIPTOR *Desc, IN OUT UINTN *Offset)