]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/SocketDxe/Socket.h
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / StdLib / SocketDxe / Socket.h
1 /** @file
2 Definitions for the Socket layer driver.
3
4 Copyright (c) 2011, Intel Corporation. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8 #ifndef _SOCKET_H_
9 #define _SOCKET_H_
10
11 #include <Library/UefiDriverEntryPoint.h>
12 #include <Efi/EfiSocketLib.h>
13
14 #include <Protocol/LoadedImage.h>
15
16 //------------------------------------------------------------------------------
17 // Protocol Declarations
18 //------------------------------------------------------------------------------
19
20 extern EFI_COMPONENT_NAME_PROTOCOL mComponentName; ///< Component name protocol declaration
21 extern EFI_COMPONENT_NAME2_PROTOCOL mComponentName2; ///< Component name 2 protocol declaration
22 extern EFI_DRIVER_BINDING_PROTOCOL mDriverBinding; ///< Driver binding protocol declaration
23 extern EFI_SERVICE_BINDING_PROTOCOL mServiceBinding; ///< Service binding protocol delcaration
24
25 //------------------------------------------------------------------------------
26 // Driver Binding Protocol Support
27 //------------------------------------------------------------------------------
28
29 /**
30 Stop this driver on Controller by removing NetworkInterfaceIdentifier protocol and
31 closing the DevicePath and PciIo protocols on Controller.
32
33 @param [in] pThis Protocol instance pointer.
34 @param [in] Controller Handle of device to stop driver on.
35 @param [in] NumberOfChildren How many children need to be stopped.
36 @param [in] pChildHandleBuffer Not used.
37
38 @retval EFI_SUCCESS This driver is removed Controller.
39 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
40 @retval other This driver was not removed from this device.
41
42 **/
43 EFI_STATUS
44 EFIAPI
45 DriverStop (
46 IN EFI_DRIVER_BINDING_PROTOCOL * pThis,
47 IN EFI_HANDLE Controller,
48 IN UINTN NumberOfChildren,
49 IN EFI_HANDLE * pChildHandleBuffer
50 );
51
52 //------------------------------------------------------------------------------
53 // EFI Component Name Protocol Support
54 //------------------------------------------------------------------------------
55
56 /**
57 Retrieves a Unicode string that is the user readable name of the driver.
58
59 This function retrieves the user readable name of a driver in the form of a
60 Unicode string. If the driver specified by This has a user readable name in
61 the language specified by Language, then a pointer to the driver name is
62 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
63 by This does not support the language specified by Language,
64 then EFI_UNSUPPORTED is returned.
65
66 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
67 EFI_COMPONENT_NAME_PROTOCOL instance.
68 @param [in] pLanguage A pointer to a Null-terminated ASCII string
69 array indicating the language. This is the
70 language of the driver name that the caller is
71 requesting, and it must match one of the
72 languages specified in SupportedLanguages. The
73 number of languages supported by a driver is up
74 to the driver writer. Language is specified
75 in RFC 3066 or ISO 639-2 language code format.
76 @param [out] ppDriverName A pointer to the Unicode string to return.
77 This Unicode string is the name of the
78 driver specified by This in the language
79 specified by Language.
80
81 @retval EFI_SUCCESS The Unicode string for the Driver specified by
82 This and the language specified by Language was
83 returned in DriverName.
84 @retval EFI_INVALID_PARAMETER Language is NULL.
85 @retval EFI_INVALID_PARAMETER DriverName is NULL.
86 @retval EFI_UNSUPPORTED The driver specified by This does not support
87 the language specified by Language.
88
89 **/
90 EFI_STATUS
91 EFIAPI
92 GetDriverName (
93 IN EFI_COMPONENT_NAME_PROTOCOL * pThis,
94 IN CHAR8 * pLanguage,
95 OUT CHAR16 ** ppDriverName
96 );
97
98
99 /**
100 Retrieves a Unicode string that is the user readable name of the controller
101 that is being managed by a driver.
102
103 This function retrieves the user readable name of the controller specified by
104 ControllerHandle and ChildHandle in the form of a Unicode string. If the
105 driver specified by This has a user readable name in the language specified by
106 Language, then a pointer to the controller name is returned in ControllerName,
107 and EFI_SUCCESS is returned. If the driver specified by This is not currently
108 managing the controller specified by ControllerHandle and ChildHandle,
109 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
110 support the language specified by Language, then EFI_UNSUPPORTED is returned.
111
112 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
113 EFI_COMPONENT_NAME_PROTOCOL instance.
114 @param [in] ControllerHandle The handle of a controller that the driver
115 specified by This is managing. This handle
116 specifies the controller whose name is to be
117 returned.
118 @param [in] ChildHandle The handle of the child controller to retrieve
119 the name of. This is an optional parameter that
120 may be NULL. It will be NULL for device
121 drivers. It will also be NULL for a bus drivers
122 that wish to retrieve the name of the bus
123 controller. It will not be NULL for a bus
124 driver that wishes to retrieve the name of a
125 child controller.
126 @param [in] pLanguage A pointer to a Null-terminated ASCII string
127 array indicating the language. This is the
128 language of the driver name that the caller is
129 requesting, and it must match one of the
130 languages specified in SupportedLanguages. The
131 number of languages supported by a driver is up
132 to the driver writer. Language is specified in
133 RFC 3066 or ISO 639-2 language code format.
134 @param [out] ppControllerName A pointer to the Unicode string to return.
135 This Unicode string is the name of the
136 controller specified by ControllerHandle and
137 ChildHandle in the language specified by
138 Language from the point of view of the driver
139 specified by This.
140
141 @retval EFI_SUCCESS The Unicode string for the user readable name in
142 the language specified by Language for the
143 driver specified by This was returned in
144 DriverName.
145 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
146 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
147 EFI_HANDLE.
148 @retval EFI_INVALID_PARAMETER Language is NULL.
149 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
150 @retval EFI_UNSUPPORTED The driver specified by This is not currently
151 managing the controller specified by
152 ControllerHandle and ChildHandle.
153 @retval EFI_UNSUPPORTED The driver specified by This does not support
154 the language specified by Language.
155
156 **/
157 EFI_STATUS
158 EFIAPI
159 GetControllerName (
160 IN EFI_COMPONENT_NAME_PROTOCOL * pThis,
161 IN EFI_HANDLE ControllerHandle,
162 IN OPTIONAL EFI_HANDLE ChildHandle,
163 IN CHAR8 * pLanguage,
164 OUT CHAR16 ** ppControllerName
165 );
166
167 //------------------------------------------------------------------------------
168
169 #endif // _SOCKET_H_