summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-03-05 08:53:56 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-03-05 08:53:56 +0100
commit438f66ad739298e2c284f8af92be3a9a71e3cd81 (patch)
tree7bf89477962fa916466fa4d8252cec9fabc81f42 /include
parent4160c616e2c7b89920e4af251818133990404565 (diff)
parented1dded0898faa1f917309172f2065014756c59f (diff)
downloadbarebox-438f66ad739298e2c284f8af92be3a9a71e3cd81.tar.gz
barebox-438f66ad739298e2c284f8af92be3a9a71e3cd81.tar.xz
Merge branch 'for-next/fastboot'
Diffstat (limited to 'include')
-rw-r--r--include/ubiformat.h7
-rw-r--r--include/usb/fastboot.h17
2 files changed, 24 insertions, 0 deletions
diff --git a/include/ubiformat.h b/include/ubiformat.h
index 8305a853c7..8a7a16ac18 100644
--- a/include/ubiformat.h
+++ b/include/ubiformat.h
@@ -15,7 +15,14 @@ struct ubiformat_args {
int ubi_ver;
uint32_t image_seq;
long long ec;
+
+ /*
+ * Either set image if you have a file or set image_buf / image_size
+ * if you have a buffer.
+ */
const char *image;
+ const void *image_buf;
+ loff_t image_size;
};
int ubiformat(struct mtd_info *mtd, struct ubiformat_args *args);
diff --git a/include/usb/fastboot.h b/include/usb/fastboot.h
index ced890c9ab..00c9d00df5 100644
--- a/include/usb/fastboot.h
+++ b/include/usb/fastboot.h
@@ -5,6 +5,8 @@
#include <file-list.h>
#include <usb/composite.h>
+struct f_fastboot;
+
/**
* struct f_fastboot_opts - options to configure the fastboot gadget
* @func_inst: The USB function instance to register on
@@ -15,6 +17,21 @@ struct f_fastboot_opts {
struct usb_function_instance func_inst;
struct file_list *files;
bool export_bbu;
+ int (*cmd_exec)(struct f_fastboot *, const char *cmd);
+ int (*cmd_flash)(struct f_fastboot *, struct file_list_entry *entry,
+ const char *filename, const void *buf, size_t len);
};
+/*
+ * Return codes for the exec_cmd callback above:
+ *
+ * FASTBOOT_CMD_FALLTHROUGH - Not handled by the external command dispatcher,
+ * handle it with internal dispatcher
+ * Other than these negative error codes mean errors handling the command and
+ * zero means the command has been successfully handled.
+ */
+#define FASTBOOT_CMD_FALLTHROUGH 1
+
+int fastboot_tx_print(struct f_fastboot *f_fb, const char *fmt, ...);
+
#endif /* _USB_FASTBOOT_H */