]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h
Update USB Mass Storage driver to declare its dependency on the BaseLib
[mirror_edk2.git] / MdeModulePkg / Universal / Network / MnpDxe / MnpDriver.h
CommitLineData
83cbd279 1/** @file\r
6e4bac4d 2 Declaration of strctures and functions for MnpDxe driver.\r
c57273b0 3 \r
6e4bac4d 4Copyright (c) 2005 - 2007, Intel Corporation. <BR> \r
5All rights reserved. This program and the accompanying materials are licensed \r
6and made available under the terms and conditions of the BSD License which \r
7accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
83cbd279 9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
83cbd279 13**/\r
14\r
15#ifndef _MNP_DRIVER_H_\r
16#define _MNP_DRIVER_H_\r
c57273b0 17#include <Uefi.h>\r
8a67d61d 18\r
19#include <Protocol/ManagedNetwork.h>\r
83cbd279 20#include <Protocol/SimpleNetwork.h>\r
8a67d61d 21#include <Protocol/ServiceBinding.h>\r
22\r
23#include <Library/DebugLib.h>\r
8a67d61d 24#include <Library/UefiBootServicesTableLib.h>\r
83cbd279 25#include <Library/UefiLib.h>\r
26#include <Library/NetLib.h>\r
83cbd279 27\r
6e4bac4d 28#include "ComponentName.h"\r
83cbd279 29\r
f3f2e05d 30#define MNP_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('M', 'n', 'p', 'S')\r
83cbd279 31\r
6e4bac4d 32typedef struct {\r
83cbd279 33 UINT32 Signature;\r
34\r
35 EFI_HANDLE ControllerHandle;\r
36\r
37 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
38 EFI_SIMPLE_NETWORK_PROTOCOL *Snp;\r
39\r
40 UINT32 Mtu;\r
41\r
e48e37fc 42 LIST_ENTRY ChildrenList;\r
83cbd279 43 UINTN ChildrenNumber;\r
44 UINTN ConfiguredChildrenNumber;\r
45\r
e48e37fc 46 LIST_ENTRY GroupAddressList;\r
83cbd279 47 UINT32 GroupAddressCount;\r
48\r
49 EFI_EVENT TxTimeoutEvent;\r
50\r
51 NET_BUF_QUEUE FreeNbufQue;\r
52 INTN NbufCnt;\r
53\r
54 EFI_EVENT PollTimer;\r
55 BOOLEAN EnableSystemPoll;\r
56\r
57 EFI_EVENT TimeoutCheckTimer;\r
58\r
59 UINT32 UnicastCount;\r
60 UINT32 BroadcastCount;\r
61 UINT32 MulticastCount;\r
62 UINT32 PromiscuousCount;\r
63\r
64 //\r
65 // The size of the data buffer in the MNP_PACKET_BUFFER used to\r
66 // store a packet.\r
67 //\r
68 UINT32 BufferLength;\r
69 UINT32 PaddingSize;\r
70 NET_BUF *RxNbufCache;\r
71 UINT8 *TxBuf;\r
72} MNP_SERVICE_DATA;\r
73\r
74#define MNP_SERVICE_DATA_FROM_THIS(a) \\r
75 CR ( \\r
76 (a), \\r
77 MNP_SERVICE_DATA, \\r
78 ServiceBinding, \\r
79 MNP_SERVICE_DATA_SIGNATURE \\r
80 )\r
81\r
b6c4ecad 82/**\r
83 Test to see if this driver supports ControllerHandle. This service\r
84 is called by the EFI boot service ConnectController(). In\r
85 order to make drivers as small as possible, there are a few calling\r
86 restrictions for this service. ConnectController() must\r
87 follow these calling restrictions. If any other agent wishes to call\r
88 Supported() it must also follow these calling restrictions.\r
89\r
6e4bac4d 90 @param[in] This Protocol instance pointer.\r
91 @param[in] ControllerHandle Handle of device to test.\r
92 @param[in] RemainingDevicePath Optional parameter use to pick a specific \r
93 child device to start.\r
b6c4ecad 94\r
6e4bac4d 95 @retval EFI_SUCCESS This driver supports this device.\r
96 @retval EFI_ALREADY_STARTED This driver is already running on this device.\r
97 @retval Others This driver does not support this device.\r
b6c4ecad 98\r
99**/\r
83cbd279 100EFI_STATUS\r
101EFIAPI\r
102MnpDriverBindingSupported (\r
b6c4ecad 103 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
83cbd279 104 IN EFI_HANDLE ControllerHandle,\r
b6c4ecad 105 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
83cbd279 106 );\r
107\r
b6c4ecad 108/**\r
109 Start this driver on ControllerHandle. This service is called by the\r
6e4bac4d 110 EFI boot service ConnectController(). In order to make drivers as small \r
111 as possible, there are a few calling restrictions for this service.\r
112 ConnectController() must follow these calling restrictions. If any other\r
113 agent wishes to call Start() it must also follow these calling restrictions.\r
114\r
115 @param[in] This Protocol instance pointer.\r
116 @param[in] ControllerHandle Handle of device to bind driver to.\r
117 @param[in] RemainingDevicePath Optional parameter use to pick a specific \r
118 child device to start.\r
119\r
120 @retval EFI_SUCCESS This driver is added to ControllerHandle.\r
121 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.\r
122 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory for Mnp Service Data.\r
123 @retval Others This driver does not support this device.\r
124 \r
b6c4ecad 125**/\r
83cbd279 126EFI_STATUS\r
127EFIAPI\r
128MnpDriverBindingStart (\r
b6c4ecad 129 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
83cbd279 130 IN EFI_HANDLE ControllerHandle,\r
b6c4ecad 131 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
83cbd279 132 );\r
133\r
b6c4ecad 134\r
135/**\r
136 Stop this driver on ControllerHandle. This service is called by the\r
6e4bac4d 137 EFI boot service DisconnectController(). In order to make drivers as \r
138 small as possible, there are a few calling restrictions for this service. \r
139 DisconnectController() must follow these calling restrictions. If any other \r
140 agent wishes to call Stop() it must also follow these calling restrictions.\r
b6c4ecad 141 \r
6e4bac4d 142 @param[in] This Protocol instance pointer.\r
143 @param[in] ControllerHandle Handle of device to stop driver on.\r
144 @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If \r
145 number of children is zero stop the entire \r
146 bus driver.\r
147 @param[in] ChildHandleBuffer List of Child Handles to Stop.\r
b6c4ecad 148\r
6e4bac4d 149 @retval EFI_SUCCESS This driver is removed ControllerHandle.\r
150 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
b6c4ecad 151\r
152**/\r
83cbd279 153EFI_STATUS\r
154EFIAPI\r
155MnpDriverBindingStop (\r
156 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
157 IN EFI_HANDLE ControllerHandle,\r
158 IN UINTN NumberOfChildren,\r
6e4bac4d 159 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
83cbd279 160 );\r
161\r
b6c4ecad 162/**\r
6e4bac4d 163 Creates a child handle with a set of I/O services.\r
b6c4ecad 164\r
6e4bac4d 165 @param[in] This Protocol instance pointer.\r
166 @param[in, out] ChildHandle Pointer to the handle of the child to create. If\r
167 it is NULL, then a new handle is created. If\r
168 it is not NULL, then the I/O services are added \r
169 to the existing child handle.\r
b6c4ecad 170\r
6e4bac4d 171 @retval EFI_SUCCES The protocol was added to ChildHandle. \r
172 @retval EFI_INVALID_PARAMETER ChildHandle is NULL. \r
173 @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to \r
174 create the child.\r
175 @retval Others The child handle was not created.\r
b6c4ecad 176\r
177**/\r
83cbd279 178EFI_STATUS\r
179EFIAPI\r
180MnpServiceBindingCreateChild (\r
181 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
c57273b0 182 IN OUT EFI_HANDLE *ChildHandle\r
83cbd279 183 );\r
184\r
b6c4ecad 185/**\r
6e4bac4d 186 Destroys a child handle with a set of I/O services.\r
187 \r
188 The DestroyChild() function does the opposite of CreateChild(). It removes a \r
189 protocol that was installed by CreateChild() from ChildHandle. If the removed \r
190 protocol is the last protocol on ChildHandle, then ChildHandle is destroyed. \r
191 \r
192 @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL \r
193 instance.\r
194 @param[in] ChildHandle Handle of the child to destroy.\r
195\r
196 @retval EFI_SUCCES The protocol was removed from ChildHandle. \r
197 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that\r
198 is being removed.\r
199 @retval EFI_INVALID_PARAMETER ChildHandle is not a valid UEFI handle.\r
200 @retval EFI_ACCESS_DENIED The protocol could not be removed from the\r
201 ChildHandle because its services are being\r
202 used.\r
203 @retval Others The child handle was not destroyed.\r
b6c4ecad 204\r
205**/\r
83cbd279 206EFI_STATUS\r
207EFIAPI\r
208MnpServiceBindingDestroyChild (\r
209 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
210 IN EFI_HANDLE ChildHandle\r
211 );\r
212\r
213#endif\r