diff options
Diffstat (limited to 'cmd/pxe_utils.h')
-rw-r--r-- | cmd/pxe_utils.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cmd/pxe_utils.h b/cmd/pxe_utils.h index cd0d3371765..ca2696f48b0 100644 --- a/cmd/pxe_utils.h +++ b/cmd/pxe_utils.h @@ -77,16 +77,28 @@ struct pxe_menu { extern bool is_pxe; -extern int (*do_getfile)(struct cmd_tbl *cmdtp, const char *file_path, - char *file_addr); +struct pxe_context; +typedef int (*pxe_getfile_func)(struct pxe_context *ctx, const char *file_path, + char *file_addr); /** * struct pxe_context - context information for PXE parsing * * @cmdtp: Pointer to command table to use when calling other commands + * @getfile: Function called by PXE to read a file */ struct pxe_context { struct cmd_tbl *cmdtp; + /** + * getfile() - read a file + * + * @ctx: PXE context + * @file_path: Path to the file + * @file_addr: String containing the hex address to put the file in + * memory + * Return 0 if OK, -ve on error + */ + pxe_getfile_func getfile; }; /** @@ -179,7 +191,9 @@ int format_mac_pxe(char *outbuf, size_t outbuf_len); * * @ctx: Context to set up * @cmdtp: Command table entry which started this action + * @getfile: Function to call to read a file */ -void pxe_setup_ctx(struct pxe_context *ctx, struct cmd_tbl *cmdtp); +void pxe_setup_ctx(struct pxe_context *ctx, struct cmd_tbl *cmdtp, + pxe_getfile_func getfile); #endif /* __PXE_UTILS_H */ |