struct pxe_context ctx;
int err, i = 0;
- pxe_setup_ctx(&ctx, cmdtp, do_get_tftp);
+ pxe_setup_ctx(&ctx, cmdtp, do_get_tftp, NULL);
if (argc != 1)
return CMD_RET_USAGE;
char *pxefile_addr_str;
struct pxe_context ctx;
- pxe_setup_ctx(&ctx, cmdtp, do_get_tftp);
+ pxe_setup_ctx(&ctx, cmdtp, do_get_tftp, NULL);
if (argc == 1) {
pxefile_addr_str = from_env("pxefile_addr_r");
}
void pxe_setup_ctx(struct pxe_context *ctx, struct cmd_tbl *cmdtp,
- pxe_getfile_func getfile)
+ pxe_getfile_func getfile, void *userdata)
{
ctx->cmdtp = cmdtp;
ctx->getfile = getfile;
+ ctx->userdata = userdata;
}
*
* @cmdtp: Pointer to command table to use when calling other commands
* @getfile: Function called by PXE to read a file
+ * @userdata: Data the caller requires for @getfile
*/
struct pxe_context {
struct cmd_tbl *cmdtp;
* Return 0 if OK, -ve on error
*/
pxe_getfile_func getfile;
+
+ void *userdata;
};
/**
* @ctx: Context to set up
* @cmdtp: Command table entry which started this action
* @getfile: Function to call to read a file
+ * @userdata: Data the caller requires for @getfile - stored in ctx->userdata
*/
void pxe_setup_ctx(struct pxe_context *ctx, struct cmd_tbl *cmdtp,
- pxe_getfile_func getfile);
+ pxe_getfile_func getfile, void *userdata);
#endif /* __PXE_UTILS_H */
env_set("bootfile", filename);
}
- pxe_setup_ctx(&ctx, cmdtp, NULL);
+ pxe_setup_ctx(&ctx, cmdtp, NULL, NULL);
if (strstr(argv[3], "ext2")) {
ctx.getfile = do_get_ext2;
} else if (strstr(argv[3], "fat")) {