diff options
| author | H. Peter Anvin | 2008-03-26 23:10:56 +0100 |
|---|---|---|
| committer | H. Peter Anvin | 2008-03-26 23:10:56 +0100 |
| commit | d62e89d776095767d075a75ceffc884ed267f685 (patch) | |
| tree | 83e12ddb9e620e53a6293fe6067eefbd092bcd50 /src/interface | |
| parent | [DHCP] Save precious packet-aligned memory by copying DHCP responses (diff) | |
| download | ipxe-d62e89d776095767d075a75ceffc884ed267f685.tar.gz ipxe-d62e89d776095767d075a75ceffc884ed267f685.tar.xz ipxe-d62e89d776095767d075a75ceffc884ed267f685.zip | |
[PXEXT] Add FILE_API_CHECK API function
Add FILE_API_CHECK to the PXEXT API so the NBP can query the
availability and status of the API.
Diffstat (limited to 'src/interface')
| -rw-r--r-- | src/interface/pxe/pxe_file.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/interface/pxe/pxe_file.c b/src/interface/pxe/pxe_file.c index 718f5e38e..41674588c 100644 --- a/src/interface/pxe/pxe_file.c +++ b/src/interface/pxe/pxe_file.c @@ -227,3 +227,38 @@ PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec ) { file_exec->Status = PXENV_STATUS_SUCCESS; return PXENV_EXIT_SUCCESS; } + +/** + * FILE API CHECK + * + * @v file_exec Pointer to a struct s_PXENV_FILE_API_CHECK + * @v s_PXENV_FILE_API_CHECK::Magic Inbound magic number (0x91d447b2) + * @ret #PXENV_EXIT_SUCCESS Command was executed successfully + * @ret #PXENV_EXIT_FAILURE Command was not executed successfully + * @ret s_PXENV_FILE_API_CHECK::Status PXE status code + * @ret s_PXENV_FILE_API_CHECK::Magic Outbound magic number (0xe9c17b20) + * @ret s_PXENV_FILE_API_CHECK::Provider "gPXE" (0x45585067) + * @ret s_PXENV_FILE_API_CHECK::APIMask API function bitmask + * @ret s_PXENV_FILE_API_CHECK::Flags Reserved + * + */ +PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check ) { + DBG ( "PXENV_FILE_API_CHECK" ); + + if ( file_api_check->Magic != 0x91d447b2 ) { + file_api_check->Status = PXENV_STATUS_BAD_FUNC; + return PXENV_EXIT_FAILURE; + } else if ( file_api_check->Size < + sizeof(struct s_PXENV_FILE_API_CHECK) ) { + file_api_check->Status = PXENV_STATUS_OUT_OF_RESOURCES; + return PXENV_EXIT_FAILURE; + } else { + file_api_check->Status = PXENV_STATUS_SUCCESS; + file_api_check->Size = sizeof(struct s_PXENV_FILE_API_CHECK); + file_api_check->Magic = 0xe9c17b20; + file_api_check->Provider = 0x45585067; /* "gPXE" */ + file_api_check->APIMask = 0x0000007f; /* Functions e0-e6 */ + file_api_check->Flags = 0; /* None defined */ + return PXENV_EXIT_SUCCESS; + } +} |
