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_LISTEN 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 bRunning
; ///< Web server running
177 EFI_EVENT TimerEvent
; ///< Timer to open HTTP port
178 int HttpListenPort
; ///< File descriptor for the HTTP listen port over TCP4
179 int HttpListenPort6
; ///< File descriptor for the HTTP listen port over TCP6
182 // Client port management
184 nfds_t MaxEntries
; ///< Maximum entries in the PortList array
185 nfds_t Entries
; ///< The current number of entries in the PortList array
186 struct pollfd
* pFdList
; ///< List of socket file descriptors
187 WSDT_PORT
** ppPortList
; ///< List of port management structures
190 //#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
192 extern DT_WEB_SERVER mWebServer
;
195 Process an HTTP request
197 @param [in] SocketFD The socket's file descriptor to add to the list.
198 @param [in] pPort The WSDT_PORT structure address
199 @param [out] pbDone Address to receive the request completion status
201 @retval EFI_SUCCESS The request was successfully processed
208 IN WSDT_PORT
* pPort
,
213 Data structure to delcare page support routines
216 UINT16
* pPageName
; ///< Name of the page
217 PFN_RESPONSE pfnResponse
; ///< Routine to generate the response
218 UINT16
* pDescription
; ///< Description of the page
221 extern CONST DT_PAGE mPageList
[]; ///< List of pages
222 extern CONST UINTN mPageCount
; ///< Number of pages
224 //------------------------------------------------------------------------------
226 //------------------------------------------------------------------------------
229 Respond with the ACPI DSDT table
231 @param [in] SocketFD The socket's file descriptor to add to the list.
232 @param [in] pPort The WSDT_PORT structure address
233 @param [out] pbDone Address to receive the request completion status
235 @retval EFI_SUCCESS The request was successfully processed
241 IN WSDT_PORT
* pPort
,
246 Respond with the ACPI FADT table
248 @param [in] SocketFD The socket's file descriptor to add to the list.
249 @param [in] pPort The WSDT_PORT structure address
250 @param [out] pbDone Address to receive the request completion status
252 @retval EFI_SUCCESS The request was successfully processed
258 IN WSDT_PORT
* pPort
,
263 Respond with the ACPI RSDP 1.0b table
265 @param [in] SocketFD The socket's file descriptor to add to the list.
266 @param [in] pPort The WSDT_PORT structure address
267 @param [out] pbDone Address to receive the request completion status
269 @retval EFI_SUCCESS The request was successfully processed
275 IN WSDT_PORT
* pPort
,
280 Respond with the ACPI RSDP 3.0 table
282 @param [in] SocketFD The socket's file descriptor to add to the list.
283 @param [in] pPort The WSDT_PORT structure address
284 @param [out] pbDone Address to receive the request completion status
286 @retval EFI_SUCCESS The request was successfully processed
292 IN WSDT_PORT
* pPort
,
297 Respond with the ACPI RSDT table
299 @param [in] SocketFD The socket's file descriptor to add to the list.
300 @param [in] pPort The WSDT_PORT structure address
301 @param [out] pbDone Address to receive the request completion status
303 @retval EFI_SUCCESS The request was successfully processed
309 IN WSDT_PORT
* pPort
,
314 Respond with the boot services table
316 @param [in] SocketFD The socket's file descriptor to add to the list.
317 @param [in] pPort The WSDT_PORT structure address
318 @param [out] pbDone Address to receive the request completion status
320 @retval EFI_SUCCESS The request was successfully processed
324 BootServicesTablePage (
326 IN WSDT_PORT
* pPort
,
331 Respond with the configuration tables
333 @param [in] SocketFD The socket's file descriptor to add to the list.
334 @param [in] pPort The WSDT_PORT structure address
335 @param [out] pbDone Address to receive the request completion status
337 @retval EFI_SUCCESS The request was successfully processed
341 ConfigurationTablePage (
343 IN WSDT_PORT
* pPort
,
348 Respond with the DHCP options
350 @param [in] SocketFD The socket's file descriptor to add to the list.
351 @param [in] pPort The WSDT_PORT structure address
352 @param [out] pbDone Address to receive the request completion status
354 @retval EFI_SUCCESS The request was successfully processed
360 IN WSDT_PORT
* pPort
,
365 Respond with the DXE services table
367 @param [in] SocketFD The socket's file descriptor to add to the list.
368 @param [in] pPort The WSDT_PORT structure address
369 @param [out] pbDone Address to receive the request completion status
371 @retval EFI_SUCCESS The request was successfully processed
375 DxeServicesTablePage (
377 IN WSDT_PORT
* pPort
,
382 Respond with the Exit page
384 @param [in] SocketFD The socket's file descriptor to add to the list.
385 @param [in] pPort The WSDT_PORT structure address
386 @param [out] pbDone Address to receive the request completion status
388 @retval EFI_SUCCESS The request was successfully processed
394 IN WSDT_PORT
* pPort
,
399 Respond with the firmware status
401 @param [in] SocketFD The socket's file descriptor to add to the list.
402 @param [in] pPort The WSDT_PORT structure address
403 @param [out] pbDone Address to receive the request completion status
405 @retval EFI_SUCCESS The request was successfully processed
411 IN WSDT_PORT
* pPort
,
416 Respond with the handles in the system
418 @param [in] SocketFD The socket's file descriptor to add to the list.
419 @param [in] pPort The WSDT_PORT structure address
420 @param [out] pbDone Address to receive the request completion status
422 @retval EFI_SUCCESS The request was successfully processed
428 IN WSDT_PORT
* pPort
,
433 Respond with the Hello World page
435 @param [in] SocketFD The socket's file descriptor to add to the list.
436 @param [in] pPort The WSDT_PORT structure address
437 @param [out] pbDone Address to receive the request completion status
439 @retval EFI_SUCCESS The request was successfully processed
445 IN WSDT_PORT
* pPort
,
450 Respond with the list of known pages
452 @param [in] SocketFD The socket's file descriptor to add to the list.
453 @param [in] pPort The WSDT_PORT structure address
454 @param [out] pbDone Address to receive the request completion status
456 @retval EFI_SUCCESS The request was successfully processed
462 IN WSDT_PORT
* pPort
,
467 Respond with the Ports page
469 @param [in] SocketFD The socket's file descriptor to add to the list.
470 @param [in] pPort The WSDT_PORT structure address
471 @param [out] pbDone Address to receive the request completion status
473 @retval EFI_SUCCESS The request was successfully processed
479 IN WSDT_PORT
* pPort
,
484 Page to reboot the system
486 @param [in] SocketFD The socket's file descriptor to add to the list.
487 @param [in] pPort The WSDT_PORT structure address
488 @param [out] pbDone Address to receive the request completion status
490 @retval EFI_SUCCESS The request was successfully processed
496 IN WSDT_PORT
* pPort
,
501 Respond with the runtime services table
503 @param [in] SocketFD The socket's file descriptor to add to the list.
504 @param [in] pPort The WSDT_PORT structure address
505 @param [out] pbDone Address to receive the request completion status
507 @retval EFI_SUCCESS The request was successfully processed
511 RuntimeSservicesTablePage (
513 IN WSDT_PORT
* pPort
,
518 Respond with the system table
520 @param [in] SocketFD The socket's file descriptor to add to the list.
521 @param [in] pPort The WSDT_PORT structure address
522 @param [out] pbDone Address to receive the request completion status
524 @retval EFI_SUCCESS The request was successfully processed
530 IN WSDT_PORT
* pPort
,
534 //------------------------------------------------------------------------------
536 //------------------------------------------------------------------------------
539 Display the EFI Table Header
541 @param [in] SocketFD The socket's file descriptor to add to the list.
542 @param [in] pPort The WSDT_PORT structure address
543 @param [in] pHeader Address of the EFI_TABLE_HEADER structure
545 @retval EFI_SUCCESS The request was successfully processed
551 IN WSDT_PORT
* pPort
,
552 IN EFI_TABLE_HEADER
* pHeader
556 Buffer the HTTP page header
558 @param [in] SocketFD The socket's file descriptor to add to the list.
559 @param [in] pPort The WSDT_PORT structure address
560 @param [in] pTitle A zero terminated Unicode title string
562 @retval EFI_SUCCESS The request was successfully processed
568 IN WSDT_PORT
* pPort
,
569 IN CONST CHAR16
* pTitle
573 Buffer and send the HTTP page trailer
575 @param [in] SocketFD The socket's file descriptor to add to the list.
576 @param [in] pPort The WSDT_PORT structure address
577 @param [out] pbDone Address to receive the request completion status
579 @retval EFI_SUCCESS The request was successfully processed
585 IN WSDT_PORT
* pPort
,
590 Process an HTTP request
592 @param [in] SocketFD The socket's file descriptor to add to the list.
593 @param [in] pPort The WSDT_PORT structure address
594 @param [out] pbDone Address to receive the request completion status
596 @retval EFI_SUCCESS The request was successfully processed
602 IN WSDT_PORT
* pPort
,
607 Buffer data for sending
609 @param [in] SocketFD The socket's file descriptor to add to the list.
610 @param [in] pPort The WSDT_PORT structure address
611 @param [in] LengthInBytes Length of valid data in the buffer
612 @param [in] pBuffer Buffer of data to send
614 @retval EFI_SUCCESS The request was successfully processed
620 IN WSDT_PORT
* pPort
,
621 IN
size_t LengthInBytes
,
622 IN CONST UINT8
* pBuffer
628 @param [in] SocketFD The socket's file descriptor to add to the list.
629 @param [in] pPort The WSDT_PORT structure address
630 @param [in] pString A zero terminated Unicode string
632 @retval EFI_SUCCESS The request was successfully processed
638 IN WSDT_PORT
* pPort
,
639 IN CONST
char * pString
645 @param [in] SocketFD The socket's file descriptor to add to the list.
646 @param [in] pPort The WSDT_PORT structure address
647 @param [in] Data The data byte to send
649 @retval EFI_SUCCESS The request was successfully processed
655 IN WSDT_PORT
* pPort
,
662 @param [in] SocketFD The socket's file descriptor to add to the list.
663 @param [in] pPort The WSDT_PORT structure address
664 @param [in] Character Character to display
665 @param [in] pReplacement Replacement character string
667 @retval EFI_SUCCESS The request was successfully processed
673 IN WSDT_PORT
* pPort
,
675 IN CHAR8
* pReplacement
681 @param [in] SocketFD The socket's file descriptor to add to the list.
682 @param [in] pPort The WSDT_PORT structure address
683 @param [in] ByteCount The number of bytes to display
684 @param [in] pData Address of the byte array
686 @retval EFI_SUCCESS The request was successfully processed
692 IN WSDT_PORT
* pPort
,
694 IN CONST UINT8
* pData
698 Display a row containing a GUID value
700 @param [in] SocketFD The socket's file descriptor to add to the list.
701 @param [in] pPort The WSDT_PORT structure address
702 @param [in] pGuid Address of the GUID to display
704 @retval EFI_SUCCESS The request was successfully processed
710 IN WSDT_PORT
* pPort
,
711 IN CONST EFI_GUID
* pGuid
715 Output a hex value to the HTML page
717 @param [in] SocketFD Socket file descriptor
718 @param [in] pPort The WSDT_PORT structure address
719 @param [in] Bits Number of bits to display
720 @param [in] Value Value to display
722 @retval EFI_SUCCESS Successfully displayed the address
727 IN WSDT_PORT
* pPort
,
733 Output a hex value to the HTML page
735 @param [in] SocketFD Socket file descriptor
736 @param [in] pPort The WSDT_PORT structure address
737 @param [in] Value Value to display
739 @retval EFI_SUCCESS Successfully displayed the address
744 IN WSDT_PORT
* pPort
,
749 Output an IP address to the HTML page
751 @param [in] SocketFD Socket file descriptor
752 @param [in] pPort The WSDT_PORT structure address
753 @param [in] pAddress Address of the socket address
755 @retval EFI_SUCCESS Successfully displayed the address
760 IN WSDT_PORT
* pPort
,
761 IN
struct sockaddr_in6
* pAddress
765 Send a Unicode string
767 @param [in] SocketFD The socket's file descriptor to add to the list.
768 @param [in] pPort The WSDT_PORT structure address
769 @param [in] pString A zero terminated Unicode string
771 @retval EFI_SUCCESS The request was successfully processed
775 HttpSendUnicodeString (
777 IN WSDT_PORT
* pPort
,
778 IN CONST UINT16
* pString
782 Output a value to the HTML page
784 @param [in] SocketFD Socket file descriptor
785 @param [in] pPort The WSDT_PORT structure address
786 @param [in] Value Value to display
788 @retval EFI_SUCCESS Successfully displayed the address
793 IN WSDT_PORT
* pPort
,
798 Display a row containing a decimal value
800 @param [in] SocketFD The socket's file descriptor to add to the list.
801 @param [in] pPort The WSDT_PORT structure address
802 @param [in] pName Address of a zero terminated name string
803 @param [in] Value The value to display
805 @retval EFI_SUCCESS The request was successfully processed
811 IN WSDT_PORT
* pPort
,
812 IN CONST CHAR8
* pName
,
817 Display a row containing a GUID value
819 @param [in] SocketFD The socket's file descriptor to add to the list.
820 @param [in] pPort The WSDT_PORT structure address
821 @param [in] pName Address of a zero terminated name string
822 @param [in] pGuid Address of the GUID to display
824 @retval EFI_SUCCESS The request was successfully processed
830 IN WSDT_PORT
* pPort
,
831 IN CONST CHAR8
* pName
,
832 IN CONST EFI_GUID
* pGuid
836 Display a row containing a hex value
838 @param [in] SocketFD The socket's file descriptor to add to the list.
839 @param [in] pPort The WSDT_PORT structure address
840 @param [in] pName Address of a zero terminated name string
841 @param [in] Value The value to display
842 @param [in] pWebPage Address of a zero terminated web page name
844 @retval EFI_SUCCESS The request was successfully processed
850 IN WSDT_PORT
* pPort
,
851 IN CONST CHAR8
* pName
,
853 IN CONST CHAR16
* pWebPage
857 Display a row containing a pointer
859 @param [in] SocketFD The socket's file descriptor to add to the list.
860 @param [in] pPort The WSDT_PORT structure address
861 @param [in] pName Address of a zero terminated name string
862 @param [in] pAddress The address to display
863 @param [in] pWebPage Address of a zero terminated web page name
865 @retval EFI_SUCCESS The request was successfully processed
871 IN WSDT_PORT
* pPort
,
872 IN CONST CHAR8
* pName
,
873 IN CONST VOID
* pAddress
,
874 IN CONST CHAR16
* pWebPage
878 Display a row containing a revision
880 @param [in] SocketFD The socket's file descriptor to add to the list.
881 @param [in] pPort The WSDT_PORT structure address
882 @param [in] pName Address of a zero terminated name string
883 @param [in] Revision The revision to display
885 @retval EFI_SUCCESS The request was successfully processed
891 IN WSDT_PORT
* pPort
,
892 IN CONST CHAR8
* pName
,
897 Display a row containing a unicode string
899 @param [in] SocketFD The socket's file descriptor to add to the list.
900 @param [in] pPort The WSDT_PORT structure address
901 @param [in] pName Address of a zero terminated name string
902 @param [in] pString Address of a zero terminated unicode string
904 @retval EFI_SUCCESS The request was successfully processed
910 IN WSDT_PORT
* pPort
,
911 IN CONST CHAR8
* pName
,
912 IN CONST CHAR16
* pString
918 @param [in] SocketFD The socket's file descriptor to add to the list.
919 @param [in] pPort The WSDT_PORT structure address
920 @param [in] pName Address of a zero terminated name string
921 @param [in] pTable Address of the table
923 @retval EFI_SUCCESS The request was successfully processed
929 IN WSDT_PORT
* pPort
,
930 IN CONST CHAR16
* pName
,
931 IN CONST VOID
* pTable
937 @param [in] SocketFD The socket's file descriptor to add to the list.
938 @param [in] pPort The WSDT_PORT structure address
939 @param [out] pbDone Address to receive the request completion status
941 @retval EFI_SUCCESS The request was successfully processed
947 IN WSDT_PORT
* pPort
,
952 HTTP port creation timer routine
954 This routine polls the socket layer waiting for the initial network connection
955 which will enable the creation of the HTTP port. The socket layer will manage
956 the coming and going of the network connections after that until the last network
957 connection is broken.
959 @param [in] pWebServer The web server control structure address.
964 IN DT_WEB_SERVER
* pWebServer
968 Start the web server port creation timer
970 @param [in] pWebServer The web server control structure address.
972 @retval EFI_SUCCESS The timer was successfully started.
973 @retval EFI_ALREADY_STARTED The timer is already running.
974 @retval Other The timer failed to start.
978 WebServerTimerStart (
979 IN DT_WEB_SERVER
* pWebServer
983 Stop the web server port creation timer
985 @param [in] pWebServer The web server control structure address.
987 @retval EFI_SUCCESS The HTTP port timer is stopped
988 @retval Other Failed to stop the HTTP port timer
993 IN DT_WEB_SERVER
* pWebServer
996 //------------------------------------------------------------------------------
997 // Driver Binding Protocol Support
998 //------------------------------------------------------------------------------
1001 Stop this driver on Controller by removing NetworkInterfaceIdentifier protocol and
1002 closing the DevicePath and PciIo protocols on Controller.
1004 @param [in] pThis Protocol instance pointer.
1005 @param [in] Controller Handle of device to stop driver on.
1006 @param [in] NumberOfChildren How many children need to be stopped.
1007 @param [in] pChildHandleBuffer Not used.
1009 @retval EFI_SUCCESS This driver is removed Controller.
1010 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
1011 @retval other This driver was not removed from this device.
1017 IN EFI_DRIVER_BINDING_PROTOCOL
* pThis
,
1018 IN EFI_HANDLE Controller
,
1019 IN UINTN NumberOfChildren
,
1020 IN EFI_HANDLE
* pChildHandleBuffer
1023 //------------------------------------------------------------------------------
1024 // EFI Component Name Protocol Support
1025 //------------------------------------------------------------------------------
1028 Retrieves a Unicode string that is the user readable name of the driver.
1030 This function retrieves the user readable name of a driver in the form of a
1031 Unicode string. If the driver specified by This has a user readable name in
1032 the language specified by Language, then a pointer to the driver name is
1033 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
1034 by This does not support the language specified by Language,
1035 then EFI_UNSUPPORTED is returned.
1037 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1038 EFI_COMPONENT_NAME_PROTOCOL instance.
1039 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1040 array indicating the language. This is the
1041 language of the driver name that the caller is
1042 requesting, and it must match one of the
1043 languages specified in SupportedLanguages. The
1044 number of languages supported by a driver is up
1045 to the driver writer. Language is specified
1046 in RFC 3066 or ISO 639-2 language code format.
1047 @param [out] ppDriverName A pointer to the Unicode string to return.
1048 This Unicode string is the name of the
1049 driver specified by This in the language
1050 specified by Language.
1052 @retval EFI_SUCCESS The Unicode string for the Driver specified by
1053 This and the language specified by Language was
1054 returned in DriverName.
1055 @retval EFI_INVALID_PARAMETER Language is NULL.
1056 @retval EFI_INVALID_PARAMETER DriverName is NULL.
1057 @retval EFI_UNSUPPORTED The driver specified by This does not support
1058 the language specified by Language.
1064 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1065 IN CHAR8
* pLanguage
,
1066 OUT CHAR16
** ppDriverName
1071 Retrieves a Unicode string that is the user readable name of the controller
1072 that is being managed by a driver.
1074 This function retrieves the user readable name of the controller specified by
1075 ControllerHandle and ChildHandle in the form of a Unicode string. If the
1076 driver specified by This has a user readable name in the language specified by
1077 Language, then a pointer to the controller name is returned in ControllerName,
1078 and EFI_SUCCESS is returned. If the driver specified by This is not currently
1079 managing the controller specified by ControllerHandle and ChildHandle,
1080 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
1081 support the language specified by Language, then EFI_UNSUPPORTED is returned.
1083 @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1084 EFI_COMPONENT_NAME_PROTOCOL instance.
1085 @param [in] ControllerHandle The handle of a controller that the driver
1086 specified by This is managing. This handle
1087 specifies the controller whose name is to be
1089 @param [in] ChildHandle The handle of the child controller to retrieve
1090 the name of. This is an optional parameter that
1091 may be NULL. It will be NULL for device
1092 drivers. It will also be NULL for a bus drivers
1093 that wish to retrieve the name of the bus
1094 controller. It will not be NULL for a bus
1095 driver that wishes to retrieve the name of a
1097 @param [in] pLanguage A pointer to a Null-terminated ASCII string
1098 array indicating the language. This is the
1099 language of the driver name that the caller is
1100 requesting, and it must match one of the
1101 languages specified in SupportedLanguages. The
1102 number of languages supported by a driver is up
1103 to the driver writer. Language is specified in
1104 RFC 3066 or ISO 639-2 language code format.
1105 @param [out] ppControllerName A pointer to the Unicode string to return.
1106 This Unicode string is the name of the
1107 controller specified by ControllerHandle and
1108 ChildHandle in the language specified by
1109 Language from the point of view of the driver
1112 @retval EFI_SUCCESS The Unicode string for the user readable name in
1113 the language specified by Language for the
1114 driver specified by This was returned in
1116 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
1117 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1119 @retval EFI_INVALID_PARAMETER Language is NULL.
1120 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1121 @retval EFI_UNSUPPORTED The driver specified by This is not currently
1122 managing the controller specified by
1123 ControllerHandle and ChildHandle.
1124 @retval EFI_UNSUPPORTED The driver specified by This does not support
1125 the language specified by Language.
1131 IN EFI_COMPONENT_NAME_PROTOCOL
* pThis
,
1132 IN EFI_HANDLE ControllerHandle
,
1133 IN OPTIONAL EFI_HANDLE ChildHandle
,
1134 IN CHAR8
* pLanguage
,
1135 OUT CHAR16
** ppControllerName
1138 //------------------------------------------------------------------------------
1140 #endif // _WEB_SERVER_H_