TianoCore EDK2 master
Loading...
Searching...
No Matches
MnpDriver.h
Go to the documentation of this file.
1
9#ifndef _MNP_DRIVER_H_
10#define _MNP_DRIVER_H_
11
12#include <Uefi.h>
13
17#include <Protocol/VlanConfig.h>
18
19#include <Library/BaseLib.h>
21#include <Library/DebugLib.h>
24#include <Library/UefiLib.h>
25#include <Library/NetLib.h>
26#include <Library/DpcLib.h>
29#include <Library/PrintLib.h>
30
31#include "ComponentName.h"
32
33#define MNP_DEVICE_DATA_SIGNATURE SIGNATURE_32 ('M', 'n', 'p', 'D')
34
35//
36// Global Variables
37//
38extern EFI_DRIVER_BINDING_PROTOCOL gMnpDriverBinding;
39
40typedef struct {
41 UINT32 Signature;
42
43 EFI_HANDLE ControllerHandle;
44 EFI_HANDLE ImageHandle;
45
46 EFI_VLAN_CONFIG_PROTOCOL VlanConfig;
47 UINTN NumberOfVlan;
48 CHAR16 *MacString;
50
51 //
52 // List of MNP_SERVICE_DATA
53 //
54 LIST_ENTRY ServiceList;
55 //
56 // Number of configured MNP Service Binding child
57 //
58 UINTN ConfiguredChildrenNumber;
59
60 LIST_ENTRY GroupAddressList;
61 UINT32 GroupAddressCount;
62
63 LIST_ENTRY FreeTxBufList;
64 LIST_ENTRY AllTxBufList;
65 UINT32 TxBufCount;
66
67 NET_BUF_QUEUE FreeNbufQue;
68 INTN NbufCnt;
69
70 EFI_EVENT PollTimer;
71 BOOLEAN EnableSystemPoll;
72
73 EFI_EVENT TimeoutCheckTimer;
74 EFI_EVENT MediaDetectTimer;
75
76 UINT32 UnicastCount;
77 UINT32 BroadcastCount;
78 UINT32 MulticastCount;
79 UINT32 PromiscuousCount;
80
81 //
82 // The size of the data buffer in the MNP_PACKET_BUFFER used to
83 // store a packet.
84 //
85 UINT32 BufferLength;
86 UINT32 PaddingSize;
87 NET_BUF *RxNbufCache;
89
90#define MNP_DEVICE_DATA_FROM_THIS(a) \
91 CR ( \
92 (a), \
93 MNP_DEVICE_DATA, \
94 VlanConfig, \
95 MNP_DEVICE_DATA_SIGNATURE \
96 )
97
98#define MNP_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('M', 'n', 'p', 'S')
99
100typedef struct {
101 UINT32 Signature;
102
103 LIST_ENTRY Link;
104
105 MNP_DEVICE_DATA *MnpDeviceData;
106 EFI_HANDLE ServiceHandle;
107 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
108 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
109
110 LIST_ENTRY ChildrenList;
111 UINTN ChildrenNumber;
112
113 UINT32 Mtu;
114
115 UINT16 VlanId;
116 UINT8 Priority;
118
119#define MNP_SERVICE_DATA_FROM_THIS(a) \
120 CR ( \
121 (a), \
122 MNP_SERVICE_DATA, \
123 ServiceBinding, \
124 MNP_SERVICE_DATA_SIGNATURE \
125 )
126
127#define MNP_SERVICE_DATA_FROM_LINK(a) \
128 CR ( \
129 (a), \
130 MNP_SERVICE_DATA, \
131 Link, \
132 MNP_SERVICE_DATA_SIGNATURE \
133 )
134
154EFIAPI
157 IN EFI_HANDLE ControllerHandle,
158 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
159 );
160
180EFIAPI
183 IN EFI_HANDLE ControllerHandle,
184 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
185 );
186
206EFIAPI
209 IN EFI_HANDLE ControllerHandle,
210 IN UINTN NumberOfChildren,
211 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
212 );
213
231EFIAPI
234 IN OUT EFI_HANDLE *ChildHandle
235 );
236
259EFIAPI
262 IN EFI_HANDLE ChildHandle
263 );
264
265#endif
UINT64 UINTN
INT64 INTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI MnpDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
Definition: MnpDriver.c:88
EFI_STATUS EFIAPI MnpServiceBindingDestroyChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)
Definition: MnpDriver.c:546
EFI_STATUS EFIAPI MnpDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
Definition: MnpDriver.c:305
EFI_STATUS EFIAPI MnpServiceBindingCreateChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN OUT EFI_HANDLE *ChildHandle)
Definition: MnpDriver.c:430
EFI_STATUS EFIAPI MnpDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
Definition: MnpDriver.c:145
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33