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