]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h
Update to support to produce Component Name and & Component Name 2 protocol based...
[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 extern EFI_COMPONENT_NAME2_PROTOCOL gMnpComponentName2;
46
47 #define MNP_SERVICE_DATA_SIGNATURE EFI_SIGNATURE_32 ('M', 'n', 'p', 'S')
48
49 typedef struct _MNP_SERVICE_DATA {
50 UINT32 Signature;
51
52 EFI_HANDLE ControllerHandle;
53
54 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
55 EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
56
57 UINT32 Mtu;
58
59 NET_LIST_ENTRY ChildrenList;
60 UINTN ChildrenNumber;
61 UINTN ConfiguredChildrenNumber;
62
63 NET_LIST_ENTRY GroupAddressList;
64 UINT32 GroupAddressCount;
65
66 EFI_EVENT TxTimeoutEvent;
67
68 NET_BUF_QUEUE FreeNbufQue;
69 INTN NbufCnt;
70
71 EFI_EVENT PollTimer;
72 BOOLEAN EnableSystemPoll;
73
74 EFI_EVENT TimeoutCheckTimer;
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;
88 UINT8 *TxBuf;
89 } MNP_SERVICE_DATA;
90
91 #define MNP_SERVICE_DATA_FROM_THIS(a) \
92 CR ( \
93 (a), \
94 MNP_SERVICE_DATA, \
95 ServiceBinding, \
96 MNP_SERVICE_DATA_SIGNATURE \
97 )
98
99 EFI_STATUS
100 EFIAPI
101 MnpDriverBindingSupported (
102 IN EFI_DRIVER_BINDING_PROTOCOL * This,
103 IN EFI_HANDLE ControllerHandle,
104 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
105 );
106
107 EFI_STATUS
108 EFIAPI
109 MnpDriverBindingStart (
110 IN EFI_DRIVER_BINDING_PROTOCOL * This,
111 IN EFI_HANDLE ControllerHandle,
112 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
113 );
114
115 EFI_STATUS
116 EFIAPI
117 MnpDriverBindingStop (
118 IN EFI_DRIVER_BINDING_PROTOCOL *This,
119 IN EFI_HANDLE ControllerHandle,
120 IN UINTN NumberOfChildren,
121 IN EFI_HANDLE *ChildHandleBuffer
122 );
123
124 EFI_STATUS
125 EFIAPI
126 MnpServiceBindingCreateChild (
127 IN EFI_SERVICE_BINDING_PROTOCOL *This,
128 IN EFI_HANDLE *ChildHandle
129 );
130
131 EFI_STATUS
132 EFIAPI
133 MnpServiceBindingDestroyChild (
134 IN EFI_SERVICE_BINDING_PROTOCOL *This,
135 IN EFI_HANDLE ChildHandle
136 );
137
138 #endif