]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h
Import ArpDxe, Dhcp4Dxe, Ip4Dxe, Mtftp4Dxe, PxeBcDxe and PxeDhcp4Dxe.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / MnpDxe / MnpDriver.h
1 /** @file
2
3 Copyright (c) 2005 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 MnpDriver.h
15
16 Abstract:
17
18
19 **/
20
21 #ifndef _MNP_DRIVER_H_
22 #define _MNP_DRIVER_H_
23 #include <PiDxe.h>
24
25 #include <Protocol/ManagedNetwork.h>
26 #include <Protocol/SimpleNetwork.h>
27 #include <Protocol/ServiceBinding.h>
28
29 #include <Library/DebugLib.h>
30 #include <Library/UefiDriverEntryPoint.h>
31 #include <Library/UefiBootServicesTableLib.h>
32 #include <Library/UefiLib.h>
33 #include <Library/NetLib.h>
34 #include <Library/BaseLib.h>
35 #include <Library/MemoryAllocationLib.h>
36 #include <Library/BaseMemoryLib.h>
37
38 #include "MnpDebug.h"
39
40 //
41 // Required Global Variables
42 //
43 extern EFI_DRIVER_BINDING_PROTOCOL gMnpDriverBinding;
44 extern EFI_COMPONENT_NAME_PROTOCOL gMnpComponentName;
45
46 #define MNP_SERVICE_DATA_SIGNATURE EFI_SIGNATURE_32 ('M', 'n', 'p', 'S')
47
48 typedef struct _MNP_SERVICE_DATA {
49 UINT32 Signature;
50
51 EFI_HANDLE ControllerHandle;
52
53 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
54 EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
55
56 UINT32 Mtu;
57
58 NET_LIST_ENTRY ChildrenList;
59 UINTN ChildrenNumber;
60 UINTN ConfiguredChildrenNumber;
61
62 NET_LIST_ENTRY GroupAddressList;
63 UINT32 GroupAddressCount;
64
65 EFI_EVENT TxTimeoutEvent;
66
67 NET_BUF_QUEUE FreeNbufQue;
68 INTN NbufCnt;
69
70 EFI_EVENT PollTimer;
71 BOOLEAN EnableSystemPoll;
72
73 EFI_EVENT TimeoutCheckTimer;
74
75 UINT32 UnicastCount;
76 UINT32 BroadcastCount;
77 UINT32 MulticastCount;
78 UINT32 PromiscuousCount;
79
80 //
81 // The size of the data buffer in the MNP_PACKET_BUFFER used to
82 // store a packet.
83 //
84 UINT32 BufferLength;
85 UINT32 PaddingSize;
86 NET_BUF *RxNbufCache;
87 UINT8 *TxBuf;
88 } MNP_SERVICE_DATA;
89
90 #define MNP_SERVICE_DATA_FROM_THIS(a) \
91 CR ( \
92 (a), \
93 MNP_SERVICE_DATA, \
94 ServiceBinding, \
95 MNP_SERVICE_DATA_SIGNATURE \
96 )
97
98 EFI_STATUS
99 EFIAPI
100 MnpDriverBindingSupported (
101 IN EFI_DRIVER_BINDING_PROTOCOL * This,
102 IN EFI_HANDLE ControllerHandle,
103 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
104 );
105
106 EFI_STATUS
107 EFIAPI
108 MnpDriverBindingStart (
109 IN EFI_DRIVER_BINDING_PROTOCOL * This,
110 IN EFI_HANDLE ControllerHandle,
111 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
112 );
113
114 EFI_STATUS
115 EFIAPI
116 MnpDriverBindingStop (
117 IN EFI_DRIVER_BINDING_PROTOCOL *This,
118 IN EFI_HANDLE ControllerHandle,
119 IN UINTN NumberOfChildren,
120 IN EFI_HANDLE *ChildHandleBuffer
121 );
122
123 EFI_STATUS
124 EFIAPI
125 MnpServiceBindingCreateChild (
126 IN EFI_SERVICE_BINDING_PROTOCOL *This,
127 IN EFI_HANDLE *ChildHandle
128 );
129
130 EFI_STATUS
131 EFIAPI
132 MnpServiceBindingDestroyChild (
133 IN EFI_SERVICE_BINDING_PROTOCOL *This,
134 IN EFI_HANDLE ChildHandle
135 );
136
137 #endif