]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/MnpDxe/MnpDriver.h
Import SnpDxe, Tcp4Dxe, Udp4Dxe and MnpDxe.
[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 NET_BUF *RxNbufCache;
86 UINT8 *TxBuf;
87 } MNP_SERVICE_DATA;
88
89 #define MNP_SERVICE_DATA_FROM_THIS(a) \
90 CR ( \
91 (a), \
92 MNP_SERVICE_DATA, \
93 ServiceBinding, \
94 MNP_SERVICE_DATA_SIGNATURE \
95 )
96
97 EFI_STATUS
98 EFIAPI
99 MnpDriverBindingSupported (
100 IN EFI_DRIVER_BINDING_PROTOCOL * This,
101 IN EFI_HANDLE ControllerHandle,
102 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
103 );
104
105 EFI_STATUS
106 EFIAPI
107 MnpDriverBindingStart (
108 IN EFI_DRIVER_BINDING_PROTOCOL * This,
109 IN EFI_HANDLE ControllerHandle,
110 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
111 );
112
113 EFI_STATUS
114 EFIAPI
115 MnpDriverBindingStop (
116 IN EFI_DRIVER_BINDING_PROTOCOL *This,
117 IN EFI_HANDLE ControllerHandle,
118 IN UINTN NumberOfChildren,
119 IN EFI_HANDLE *ChildHandleBuffer
120 );
121
122 EFI_STATUS
123 EFIAPI
124 MnpServiceBindingCreateChild (
125 IN EFI_SERVICE_BINDING_PROTOCOL *This,
126 IN EFI_HANDLE *ChildHandle
127 );
128
129 EFI_STATUS
130 EFIAPI
131 MnpServiceBindingDestroyChild (
132 IN EFI_SERVICE_BINDING_PROTOCOL *This,
133 IN EFI_HANDLE ChildHandle
134 );
135
136 #endif