93 len, file->
pos ) ) != 0 ) {
144 if ( file ==
NULL ) {
223 DBG (
"Could not install download protocol: %s\n",
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
An object interface operation.
struct arbelprm_rc_send_wqe rc
void intf_close(struct interface *intf, int rc)
Close an object interface.
void efi_download_uninstall(EFI_HANDLE handle)
Uninstall iPXE download protocol.
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
static int efi_download_deliver_iob(struct efi_download_file *file, struct io_buffer *iobuf, struct xfer_metadata *meta)
Process received data.
IPXE_DOWNLOAD_DATA_CALLBACK data_callback
Data callback.
The iPXE Download Protocol.
static struct interface_operation efi_xfer_operations[]
Data transfer interface operations.
128 bit buffer containing a unique identifier value.
#define XFER_FL_ABS_OFFSET
Offset is absolute.
PXENV_STATUS_t Status
PXE status code.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
void * context
Callback context.
EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces
static void efi_snp_claim(void)
Claim network devices for use by iPXE.
A single in-progress file.
IPXE_DOWNLOAD_FINISH_CALLBACK finish_callback
Finish callback.
#define EFI_OUT_OF_RESOURCES
Enumeration of EFI_STATUS.
VOID * IPXE_DOWNLOAD_FILE
Token to represent a currently downloading file.
Data transfer interfaces.
IPXE_DOWNLOAD_START Start
void(EFIAPI * IPXE_DOWNLOAD_FINISH_CALLBACK)(IN VOID *Context, IN EFI_STATUS Status)
Callback function that is invoked when the file is finished downloading, or when a connection unexpec...
#define __unused
Declare a variable or data structure as unused.
An object interface descriptor.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
FILE_LICENCE(GPL2_OR_LATER)
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
static EFI_STATUS EFIAPI efi_download_poll(IPXE_DOWNLOAD_PROTOCOL *This __unused)
Poll for more data from iPXE.
static void efi_snp_release(void)
Release network devices for use via SNP.
int xfer_deliver(struct interface *intf, struct io_buffer *iobuf, struct xfer_metadata *meta)
Deliver datagram.
Data transfer interface opening.
static struct interface_descriptor efi_download_file_xfer_desc
EFI download data transfer interface descriptor.
int xfer_open(struct interface *intf, int type,...)
Open location.
#define VOID
Undeclared type.
void * malloc(size_t size)
Allocate memory.
Location is a URI string.
static IPXE_DOWNLOAD_PROTOCOL ipxe_download_protocol_interface
Publicly exposed iPXE download protocol.
size_t pos
Current file position.
#define INTF_DESC(object_type, intf, operations)
Define an object interface descriptor.
#define EFI_SUCCESS
Enumeration of EFI_STATUS.
void * data
Start of data.
static EFI_STATUS EFIAPI efi_download_start(IPXE_DOWNLOAD_PROTOCOL *This __unused, CHAR8 *Url, IPXE_DOWNLOAD_DATA_CALLBACK DataCallback, IPXE_DOWNLOAD_FINISH_CALLBACK FinishCallback, VOID *Context, IPXE_DOWNLOAD_FILE *File)
Start downloading a file, and register callback functions to handle the download.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
void step(void)
Single-step a single process.
struct interface xfer
Data transfer interface that provides downloaded data.
#define IPXE_DOWNLOAD_PROTOCOL_GUID
int efi_download_install(EFI_HANDLE handle)
Install iPXE download protocol.
static void efi_download_close(struct efi_download_file *file, int rc)
Transfer finished or was aborted.
EFI_SYSTEM_TABLE * efi_systab
#define DBG(...)
Print a debugging message.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
#define NULL
NULL pointer (VOID *)
EFI_STATUS(EFIAPI * IPXE_DOWNLOAD_DATA_CALLBACK)(IN VOID *Context, IN VOID *Buffer, IN UINTN BufferLength, IN UINTN FileOffset)
Callback function that is invoked when data arrives for a particular file.
static EFI_GUID ipxe_download_protocol_guid
iPXE download protocol GUID
#define EFIRC(rc)
Convert an iPXE status code to an EFI status code.
static EFI_STATUS EFIAPI efi_download_abort(IPXE_DOWNLOAD_PROTOCOL *This __unused, IPXE_DOWNLOAD_FILE File, EFI_STATUS Status)
Forcibly abort downloading a file that is currently in progress.