2 Definitions for the web server.
4 Copyright (c) 2011, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _WEB_SERVER_H_
16 #define _WEB_SERVER_H_
21 #include <Guid/EventGroup.h>
23 #include <Library/BaseMemoryLib.h>
24 #include <Library/DebugLib.h>
25 #include <Library/PcdLib.h>
26 #include <Library/UefiApplicationEntryPoint.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/UefiLib.h>
29 #include <Protocol/BlockIo.h>
31 #include <netinet/in.h>
33 #include <sys/EfiSysCall.h>
35 #include <sys/socket.h>
37 #pragma warning ( disable : 4054 )
38 #pragma warning ( disable : 4152 )
40 //------------------------------------------------------------------------------
42 //------------------------------------------------------------------------------
44 #define PAGE_ACPI_DSDT L"/DSDT"
45 #define PAGE_ACPI_FADT L"/FADT"
46 #define PAGE_ACPI_RSDP_10B L"/RSDP1.0b"
47 #define PAGE_ACPI_RSDP_30 L"/RSDP3.0"
48 #define PAGE_ACPI_RSDT L"/RSDT"
49 #define PAGE_BOOT_SERVICES_TABLE L"/BootServicesTable"
50 #define PAGE_CONFIGURATION_TABLE L"/ConfigurationTable"
51 #define PAGE_DXE_SERVICES_TABLE L"/DxeServicesTable"
52 #define PAGE_RUNTIME_SERVICES_TABLE L"/RuntimeServicesTable"
54 //------------------------------------------------------------------------------
56 //------------------------------------------------------------------------------
58 #define DSDT_SIGNATURE 0x54445344
59 #define FADT_SIGNATURE 0x50434146
61 //------------------------------------------------------------------------------
63 //------------------------------------------------------------------------------
65 #if defined(_MSC_VER) /* Handle Microsoft VC++ compiler specifics. */
66 #define DBG_ENTER() DEBUG (( DEBUG_INFO, "Entering " __FUNCTION__ "\n" )) ///< Display routine entry
67 #define DBG_EXIT() DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ "\n" )) ///< Display routine exit
68 #define DBG_EXIT_DEC(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %d\n", Status )) ///< Display routine exit with decimal value
69 #define DBG_EXIT_HEX(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: 0x%08x\n", Status )) ///< Display routine exit with hex value
70 #define DBG_EXIT_STATUS(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %r\n", Status )) ///< Display routine exit with status value
71 #define DBG_EXIT_TF(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", returning %s\n", (FALSE == Status) ? L"FALSE" : L"TRUE" )) ///< Display routine with TRUE/FALSE value
75 #define DBG_EXIT_DEC(Status)
76 #define DBG_EXIT_HEX(Status)
77 #define DBG_EXIT_STATUS(Status)
78 #define DBG_EXIT_TF(Status)
81 #define DIM(x) ( sizeof ( x ) / sizeof ( x[0] )) ///< Compute the number of entries in an array
83 //------------------------------------------------------------------------------
85 //------------------------------------------------------------------------------
87 #define DEBUG_SOCKET_POLL 0x00080000 ///< Display the socket poll messages
88 #define DEBUG_PORT_WORK 0x00040000 ///< Display the port work messages
89 #define DEBUG_SERVER_TIMER 0x00020000 ///< Display the socket poll messages
90 #define DEBUG_HTTP_PORT 0x00010000 ///< Display HTTP port related messages
91 #define DEBUG_REQUEST 0x00008000 ///< Display the HTTP request messages
93 #define HTTP_PORT_POLL_DELAY ( 2 * 1000 ) ///< Delay in milliseconds for attempts to open the HTTP port
94 #define CLIENT_POLL_DELAY 50 ///< Delay in milliseconds between client polls
96 #define TPL_WEB_SERVER TPL_CALLBACK ///< TPL for routine synchronization
101 This macro which is enabled when debug is enabled verifies that
102 the new TPL value is >= the current TPL value.
108 #if !defined(MDEPKG_NDEBUG)
110 #define VERIFY_TPL(tpl) \
112 EFI_TPL PreviousTpl; \
114 PreviousTpl = gBS->RaiseTPL ( TPL_HIGH_LEVEL ); \
115 gBS->RestoreTPL ( PreviousTpl ); \
116 if ( PreviousTpl > tpl ) { \
117 DEBUG (( DEBUG_ERROR, "Current TPL: %d, New TPL: %d\r\n", PreviousTpl, tpl )); \
118 ASSERT ( PreviousTpl <= tpl ); \
122 #else // MDEPKG_NDEBUG
124 #define VERIFY_TPL(tpl)
126 #endif // MDEPKG_NDEBUG
128 #define WEB_SERVER_SIGNATURE SIGNATURE_32 ('W','e','b','S') ///< DT_WEB_SERVER memory signature
130 #define SPACES_ADDRESS_TO_DATA 2
131 #define BYTES_ON_A_LINE 16
132 #define SPACES_BETWEEN_BYTES 1
133 #define SPACES_DATA_TO_ASCII 2
136 //------------------------------------------------------------------------------
137 // Protocol Declarations
138 //------------------------------------------------------------------------------
140 extern EFI_COMPONENT_NAME_PROTOCOL gComponentName
; ///< Component name protocol declaration
141 extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2
; ///< Component name 2 protocol declaration
142 extern EFI_DRIVER_BINDING_PROTOCOL gDriverBinding
; ///< Driver binding protocol declaration
144 //------------------------------------------------------------------------------
146 //------------------------------------------------------------------------------
149 Port control structure
155 size_t RequestLength
; ///< Request length in bytes
156 size_t TxBytes
; ///< Bytes in the TX buffer
157 UINT8 Request
[ 65536 ]; ///< Page request
158 UINT8 RxBuffer
[ 65536 ]; ///< Receive buffer
159 UINT8 TxBuffer
[ 65536 ]; ///< Transmit buffer
163 Web server control structure
166 UINTN Signature
; ///< Structure identification
171 EFI_HANDLE ImageHandle
; ///< Image handle
174 // HTTP port management
176 BOOLEAN bTimerRunning
; ///< Port creation timer status
177 EFI_EVENT TimerEvent
; ///< Timer to open HTTP port
178 int HttpListenPort
; ///< File descriptor for the HTTP listen port
181 // Client port management
183 nfds_t MaxEntries
; ///< Maximum entries in the PortList array
184 nfds_t Entries
; ///< The current number of entries in the PortList array
185 struct pollfd
* pFdList
; ///< List of socket file descriptors
186 WSDT_PORT
** ppPortList
; ///< List of port management structures
189 //#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
191 extern DT_WEB_SERVER mWebServer
;
194 Process an HTTP request
196 @param [in] SocketFD The socket's file descriptor to add to the list.
197 @param [in] pPort The WSDT_PORT structure address
198 @param [out] pbDone Address to receive the request completion status
200 @retval EFI_SUCCESS The request was successfully processed
207 IN WSDT_PORT
* pPort
,
212 Data structure to delcare page support routines
215 UINT16
* pPageName
; ///< Name of the page
216 PFN_RESPONSE pfnResponse
; ///< Routine to generate the response
217 UINT16
* pDescription
; ///< Description of the page
220 extern CONST DT_PAGE mPageList
[]; ///< List of pages
221 extern CONST UINTN mPageCount
; ///< Number of pages
223 //------------------------------------------------------------------------------
225 //------------------------------------------------------------------------------
228 Respond with the ACPI DSDT table
230 @param [in] SocketFD The socket's file descriptor to add to the list.
231 @param [in] pPort The WSDT_PORT structure address
232 @param [out] pbDone Address to receive the request completion status
234 @retval EFI_SUCCESS The request was successfully processed
240 IN WSDT_PORT
* pPort
,
245 Respond with the ACPI FADT table
247 @param [in] SocketFD The socket's file descriptor to add to the list.
248 @param [in] pPort The WSDT_PORT structure address
249 @param [out] pbDone Address to receive the request completion status
251 @retval EFI_SUCCESS The request was successfully processed
257 IN WSDT_PORT
* pPort
,
262 Respond with the ACPI RSDP 1.0b table
264 @param [in] SocketFD The socket's file descriptor to add to the list.
265 @param [in] pPort The WSDT_PORT structure address
266 @param [out] pbDone Address to receive the request completion status
268 @retval EFI_SUCCESS The request was successfully processed
274 IN WSDT_PORT
* pPort
,
279 Respond with the ACPI RSDP 3.0 table
281 @param [in] SocketFD The socket's file descriptor to add to the list.
282 @param [in] pPort The WSDT_PORT structure address
283 @param [out] pbDone Address to receive the request completion status
285 @retval EFI_SUCCESS The request was successfully processed
291 IN WSDT_PORT
* pPort
,
296 Respond with the ACPI RSDT table
298 @param [in] SocketFD The socket's file descriptor to add to the list.
299 @param [in] pPort The WSDT_PORT structure address
300 @param [out] pbDone Address to receive the request completion status
302 @retval EFI_SUCCESS The request was successfully processed
308 IN WSDT_PORT
* pPort
,
313 Respond with the boot services table
315 @param [in] SocketFD The socket's file descriptor to add to the list.
316 @param [in] pPort The WSDT_PORT structure address
317 @param [out] pbDone Address to receive the request completion status
319 @retval EFI_SUCCESS The request was successfully processed
323 BootServicesTablePage (
325 IN WSDT_PORT
* pPort
,
330 Respond with the configuration tables
332 @param [in] SocketFD The socket's file descriptor to add to the list.
333 @param [in] pPort The WSDT_PORT structure address
334 @param [out] pbDone Address to receive the request completion status
336 @retval EFI_SUCCESS The request was successfully processed
340 ConfigurationTablePage (
342 IN WSDT_PORT
* pPort
,
347 Respond with the DHCP options
349 @param [in] SocketFD The socket's file descriptor to add to the list.
350 @param [in] pPort The WSDT_PORT structure address
351 @param [out] pbDone Address to receive the request completion status
353 @retval EFI_SUCCESS The request was successfully processed
359 IN WSDT_PORT
* pPort
,
364 Respond with the DXE services table
366 @param [in] SocketFD The socket's file descriptor to add to the list.
367 @param [in] pPort The WSDT_PORT structure address
368 @param [out] pbDone Address to receive the request completion status
370 @retval EFI_SUCCESS The request was successfully processed
374 DxeServicesTablePage (
376 IN WSDT_PORT
* pPort
,
381 Respond with the firmware status
383 @param [in] SocketFD The socket's file descriptor to add to the list.
384 @param [in] pPort The WSDT_PORT structure address
385 @param [out] pbDone Address to receive the request completion status
387 @retval EFI_SUCCESS The request was successfully processed
393 IN WSDT_PORT
* pPort
,
398 Respond with the handles in the system
400 @param [in] SocketFD The socket's file descriptor to add to the list.
401 @param [in] pPort The WSDT_PORT structure address
402 @param [out] pbDone Address to receive the request completion status
404 @retval EFI_SUCCESS The request was successfully processed
410 IN WSDT_PORT
* pPort
,
415 Respond with the Hello World page
417 @param [in] SocketFD The socket's file descriptor to add to the list.
418 @param [in] pPort The WSDT_PORT structure address
419 @param [out] pbDone Address to receive the request completion status
421 @retval EFI_SUCCESS The request was successfully processed
427 IN WSDT_PORT
* pPort
,
432 Respond with the list of known pages
434 @param [in] SocketFD The socket's file descriptor to add to the list.
435 @param [in] pPort The WSDT_PORT structure address
436 @param [out] pbDone Address to receive the request completion status
438 @retval EFI_SUCCESS The request was successfully processed
444 IN WSDT_PORT
* pPort
,
449 Page to reboot the system
451 @param [in] SocketFD The socket's file descriptor to add to the list.
452 @param [in] pPort The WSDT_PORT structure address
453 @param [out] pbDone Address to receive the request completion status
455 @retval EFI_SUCCESS The request was successfully processed
461 IN WSDT_PORT
* pPort
,
466 Respond with the runtime services table
468 @param [in] SocketFD The socket's file descriptor to add to the list.
469 @param [in] pPort The WSDT_PORT structure address
470 @param [out] pbDone Address to receive the request completion status
472 @retval EFI_SUCCESS The request was successfully processed
476 RuntimeSservicesTablePage (
478 IN WSDT_PORT
* pPort
,
483 Respond with the system table
485 @param [in] SocketFD The socket's file descriptor to add to the list.
486 @param [in] pPort The WSDT_PORT structure address
487 @param [out] pbDone Address to receive the request completion status
489 @retval EFI_SUCCESS The request was successfully processed
495 IN WSDT_PORT
* pPort
,
499 //------------------------------------------------------------------------------
501 //------------------------------------------------------------------------------
504 Display the EFI Table Header
506 @param [in] SocketFD The socket's file descriptor to add to the list.
507 @param [in] pPort The WSDT_PORT structure address
508 @param [in] pHeader Address of the EFI_TABLE_HEADER structure
510 @retval EFI_SUCCESS The request was successfully processed
516 IN WSDT_PORT
* pPort
,
517 IN EFI_TABLE_HEADER
* pHeader
521 Buffer the HTTP page header
523 @param [in] SocketFD The socket's file descriptor to add to the list.
524 @param [in] pPort The WSDT_PORT structure address
525 @param [in] pTitle A zero terminated Unicode title string
527 @retval EFI_SUCCESS The request was successfully processed
533 IN WSDT_PORT
* pPort
,
534 IN CONST CHAR16
* pTitle
538 Buffer and send the HTTP page trailer
540 @param [in] SocketFD The socket's file descriptor to add to the list.
541 @param [in] pPort The WSDT_PORT structure address
542 @param [out] pbDone Address to receive the request completion status
544 @retval EFI_SUCCESS The request was successfully processed
550 IN WSDT_PORT
* pPort
,
555 Process an HTTP request
557 @param [in] SocketFD The socket's file descriptor to add to the list.
558 @param [in] pPort The WSDT_PORT structure address
559 @param [out] pbDone Address to receive the request completion status
561 @retval EFI_SUCCESS The request was successfully processed
567 IN WSDT_PORT
* pPort
,
572 Buffer data for sending
574 @param [in] SocketFD The socket's file descriptor to add to the list.
575 @param [in] pPort The WSDT_PORT structure address
576 @param [in] LengthInBytes Length of valid data in the buffer
577 @param [in] pBuffer Buffer of data to send
579 @retval EFI_SUCCESS The request was successfully processed
585 IN WSDT_PORT
* pPort
,
586 IN
size_t LengthInBytes
,
587 IN CONST UINT8
* pBuffer
593 @param [in] SocketFD The socket's file descriptor to add to the list.
594 @param [in] pPort The WSDT_PORT structure address
595 @param [in] pString A zero terminated Unicode string
597 @retval EFI_SUCCESS The request was successfully processed
603 IN WSDT_PORT
* pPort
,
604 IN CONST
char * pString
610 @param [in] SocketFD The socket's file descriptor to add to the list.
611 @param [in] pPort The WSDT_PORT structure address
612 @param [in] Data The data byte to send
614 @retval EFI_SUCCESS The request was successfully processed
620 IN WSDT_PORT
* pPort
,
627 @param [in] SocketFD The socket's file descriptor to add to the list.
628 @param [in] pPort The WSDT_PORT structure address
629 @param [in] Character Character to display
630 @param [in] pReplacement Replacement character string
632 @retval EFI_SUCCESS The request was successfully processed
638 IN WSDT_PORT
* pPort
,
640 IN CHAR8
* pReplacement
646 @param [in] SocketFD The socket's file descriptor to add to the list.
647 @param [in] pPort The WSDT_PORT structure address
648 @param [in] ByteCount The number of bytes to display
649 @param [in] pData Address of the byte array
651 @retval EFI_SUCCESS The request was successfully processed
657 IN WSDT_PORT
* pPort
,
659 IN CONST UINT8
* pData
663 Display a row containing a GUID value
665 @param [in] SocketFD The socket's file descriptor to add to the list.
666 @param [in] pPort The WSDT_PORT structure address
667 @param [in] pGuid Address of the GUID to display
669 @retval EFI_SUCCESS The request was successfully processed
675 IN WSDT_PORT
* pPort
,
676 IN CONST EFI_GUID
* pGuid
680 Output a hex value to the HTML page
682 @param [in] SocketFD Socket file descriptor
683 @param [in] pPort The WSDT_PORT structure address
684 @param [in] Bits Number of bits to display
685 @param [in] Value Value to display
687 @retval EFI_SUCCESS Successfully displayed the address
692 IN WSDT_PORT
* pPort
,
698 Output a hex value to the HTML page
700 @param [in] SocketFD Socket file descriptor
701 @param [in] pPort The WSDT_PORT structure address
702 @param [in] Value Value to display
704 @retval EFI_SUCCESS Successfully displayed the address
709 IN WSDT_PORT
* pPort
,
714 Output an IP address to the HTML page
716 @param [in] SocketFD Socket file descriptor
717 @param [in] pPort The WSDT_PORT structure address
718 @param [in] pAddress Address of the socket address
720 @retval EFI_SUCCESS Successfully displayed the address
725 IN WSDT_PORT
* pPort
,
726 IN
struct sockaddr_in
* pAddress
730 Send a Unicode string
732 @param [in] SocketFD The socket's file descriptor to add to the list.
733 @param [in] pPort The WSDT_PORT structure address
734 @param [in] pString A zero terminated Unicode string
736 @retval EFI_SUCCESS The request was successfully processed
740 HttpSendUnicodeString (
742 IN WSDT_PORT
* pPort
,
743 IN CONST UINT16
* pString
747 Output a value to the HTML page
749 @param [in] SocketFD Socket file descriptor
750 @param [in] pPort The WSDT_PORT structure address
751 @param [in] Value Value to display
753 @retval EFI_SUCCESS Successfully displayed the address
758 IN WSDT_PORT
* pPort
,
763 Display a row containing a decimal value
765 @param [in] SocketFD The socket's file descriptor to add to the list.
766 @param [in] pPort The WSDT_PORT structure address
767 @param [in] pName Address of a zero terminated name string
768 @param [in] Value The value to display
770 @retval EFI_SUCCESS The request was successfully processed
776 IN WSDT_PORT
* pPort
,
777 IN CONST CHAR8
* pName
,
782 Display a row containing a GUID value
784 @param [in] SocketFD The socket's file descriptor to add to the list.
785 @param [in] pPort The WSDT_PORT structure address
786 @param [in] pName Address of a zero terminated name string
787 @param [in] pGuid Address of the GUID to display
789 @retval EFI_SUCCESS The request was successfully processed
795 IN WSDT_PORT
* pPort
,
796 IN CONST CHAR8
* pName
,
797 IN CONST EFI_GUID
* pGuid
801 Display a row containing a hex value
803 @param [in] SocketFD The socket's file descriptor to add to the list.
804 @param [in] pPort The WSDT_PORT structure address
805 @param [in] pName Address of a zero terminated name string
806 @param [in] Value The value to display
807 @param [in] pWebPage Address of a zero terminated web page name
809 @retval EFI_SUCCESS The request was successfully processed
815 IN WSDT_PORT
* pPort
,
816 IN CONST CHAR8
* pName
,
818 IN CONST CHAR16
* pWebPage
822 Display a row containing a pointer
824 @param [in] SocketFD The socket's file descriptor to add to the list.
825 @param [in] pPort The WSDT_PORT structure address
826 @param [in] pName Address of a zero terminated name string
827 @param [in] pAddress The address to display
828 @param [in] pWebPage Address of a zero terminated web page name
830 @retval EFI_SUCCESS The request was successfully processed
836 IN WSDT_PORT
* pPort
,
837 IN CONST CHAR8
* pName
,
838 IN CONST VOID
* pAddress
,
839 IN CONST CHAR16
* pWebPage
843 Display a row containing a revision
845 @param [in] SocketFD The socket's file descriptor to add to the list.
846 @param [in] pPort The WSDT_PORT structure address
847 @param [in] pName Address of a zero terminated name string
848 @param [in] Revision The revision to display
850 @retval EFI_SUCCESS The request was successfully processed
856 IN WSDT_PORT
* pPort
,
857 IN CONST CHAR8
* pName
,
862 Display a row containing a unicode string
864 @param [in] SocketFD The socket's file descriptor to add to the list.
865 @param [in] pPort The WSDT_PORT structure address
866 @param [in] pName Address of a zero terminated name string
867 @param [in] pString Address of a zero terminated unicode string
869 @retval EFI_SUCCESS The request was successfully processed
875 IN WSDT_PORT
* pPort
,
876 IN CONST CHAR8
* pName
,
877 IN CONST CHAR16
* pString
883 @param [in] SocketFD The socket's file descriptor to add to the list.
884 @param [in] pPort The WSDT_PORT structure address
885 @param [in] pName Address of a zero terminated name string
886 @param [in] pTable Address of the table
888 @retval EFI_SUCCESS The request was successfully processed
894 IN WSDT_PORT
* pPort
,
895 IN CONST CHAR16
* pName
,
896 IN CONST VOID
* pTable
902 @param [in] SocketFD The socket's file descriptor to add to the list.
903 @param [in] pPort The WSDT_PORT structure address
904 @param [out] pbDone Address to receive the request completion status
906 @retval EFI_SUCCESS The request was successfully processed
912 IN WSDT_PORT
* pPort
,
917 HTTP port creation timer routine
919 This routine polls the socket layer waiting for the initial network connection
920 which will enable the creation of the HTTP port. The socket layer will manage
921 the coming and going of the network connections after that until the last network
922 connection is broken.
924 @param [in] pWebServer The web server control structure address.
929 IN DT_WEB_SERVER
* pWebServer
933 Start the web server port creation timer
935 @param [in] pWebServer The web server control structure address.
937 @retval EFI_SUCCESS The timer was successfully started.
938 @retval EFI_ALREADY_STARTED The timer is already running.
939 @retval Other The timer failed to start.
943 WebServerTimerStart (
944 IN DT_WEB_SERVER
* pWebServer
948 Stop the web server port creation timer
950 @param [in] pWebServer The web server control structure address.
952 @retval EFI_SUCCESS The HTTP port timer is stopped
953 @retval Other Failed to stop the HTTP port timer
958 IN DT_WEB_SERVER
* pWebServer
961 //------------------------------------------------------------------------------
962 // Driver Binding Protocol Support
963 //------------------------------------------------------------------------------
966 Stop this driver on Controller by removing NetworkInterfaceIdentifier protocol and
967 closing the DevicePath and PciIo protocols on Controller.
969 @param [in] pThis Protocol instance pointer.
970 @param [in] Controller Handle of device to stop driver on.
971 @param [in] NumberOfChildren How many children need to be stopped.
972 @param [in] pChildHandleBuffer Not used.
974 @retval EFI_SUCCESS This driver is removed Controller.
975 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
976 @retval other This driver was not removed from this device.
982 IN EFI_DRIVER_BINDING_PROTOCOL
* pThis
,
983 IN EFI_HANDLE Controller
,
984 IN UINTN NumberOfChildren
,
985 IN EFI_HANDLE
* pChildHandleBuffer
988 //------------------------------------------------------------------------------
989 // EFI Component Name Protocol Support
990 //------------------------------------------------------------------------------
993 Retrieves a Unicode string that is the user readable name of the driver.
995 This function retrieves the user readable name of a driver in the form of a
996 Unicode string. If the driver specified by This has a user readable name in
997 the language specified by Language, then a pointer to the driver name is
998 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
999 by This does not support the language specified by Language,
1000 then EFI_UNSUPPORTED is returned.
1002 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1003 EFI_COMPONENT_NAME_PROTOCOL instance.
1004 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1005 array indicating the language. This is the
1006 language of the driver name that the caller is
1007 requesting, and it must match one of the
1008 languages specified in SupportedLanguages. The
1009 number of languages supported by a driver is up
1010 to the driver writer. Language is specified
1011 in RFC 3066 or ISO 639-2 language code format.
1012 @param [out] ppDriverName A pointer to the Unicode string to return.
1013 This Unicode string is the name of the
1014 driver specified by This in the language
1015 specified by Language.
1017 @retval EFI_SUCCESS The Unicode string for the Driver specified by
1018 This and the language specified by Language was
1019 returned in DriverName.
1020 @retval EFI_INVALID_PARAMETER Language is NULL.
1021 @retval EFI_INVALID_PARAMETER DriverName is NULL.
1022 @retval EFI_UNSUPPORTED The driver specified by This does not support
1023 the language specified by Language.
1029 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1030 IN CHAR8
* pLanguage
,
1031 OUT CHAR16
** ppDriverName
1036 Retrieves a Unicode string that is the user readable name of the controller
1037 that is being managed by a driver.
1039 This function retrieves the user readable name of the controller specified by
1040 ControllerHandle and ChildHandle in the form of a Unicode string. If the
1041 driver specified by This has a user readable name in the language specified by
1042 Language, then a pointer to the controller name is returned in ControllerName,
1043 and EFI_SUCCESS is returned. If the driver specified by This is not currently
1044 managing the controller specified by ControllerHandle and ChildHandle,
1045 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
1046 support the language specified by Language, then EFI_UNSUPPORTED is returned.
1048 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1049 EFI_COMPONENT_NAME_PROTOCOL instance.
1050 @param [in] ControllerHandle The handle of a controller that the driver
1051 specified by This is managing. This handle
1052 specifies the controller whose name is to be
1054 @param [in] ChildHandle The handle of the child controller to retrieve
1055 the name of. This is an optional parameter that
1056 may be NULL. It will be NULL for device
1057 drivers. It will also be NULL for a bus drivers
1058 that wish to retrieve the name of the bus
1059 controller. It will not be NULL for a bus
1060 driver that wishes to retrieve the name of a
1062 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1063 array indicating the language. This is the
1064 language of the driver name that the caller is
1065 requesting, and it must match one of the
1066 languages specified in SupportedLanguages. The
1067 number of languages supported by a driver is up
1068 to the driver writer. Language is specified in
1069 RFC 3066 or ISO 639-2 language code format.
1070 @param [out] ppControllerName A pointer to the Unicode string to return.
1071 This Unicode string is the name of the
1072 controller specified by ControllerHandle and
1073 ChildHandle in the language specified by
1074 Language from the point of view of the driver
1077 @retval EFI_SUCCESS The Unicode string for the user readable name in
1078 the language specified by Language for the
1079 driver specified by This was returned in
1081 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
1082 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1084 @retval EFI_INVALID_PARAMETER Language is NULL.
1085 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1086 @retval EFI_UNSUPPORTED The driver specified by This is not currently
1087 managing the controller specified by
1088 ControllerHandle and ChildHandle.
1089 @retval EFI_UNSUPPORTED The driver specified by This does not support
1090 the language specified by Language.
1096 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1097 IN EFI_HANDLE ControllerHandle
,
1098 IN OPTIONAL EFI_HANDLE ChildHandle
,
1099 IN CHAR8
* pLanguage
,
1100 OUT CHAR16
** ppControllerName
1103 //------------------------------------------------------------------------------
1105 #endif // _WEB_SERVER_H_