summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-05-03 13:48:57 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-12 08:00:00 +0200
commitf1dd6339a8d7d62667ba8a1da863319bc5a1dc57 (patch)
treeb2a9a3a75f1ff22c05a2416fe3e8d3311409afbd /include
parenteecf05d8ced03ab994cd083c7906df434ffd44b7 (diff)
downloadbarebox-f1dd6339a8d7d62667ba8a1da863319bc5a1dc57.tar.gz
barebox-f1dd6339a8d7d62667ba8a1da863319bc5a1dc57.tar.xz
fastboot/dfu: use system partitions as fall back
Use the new system partitions infrastructure to have fastboot and DFU fall back to using the same partitions if the global.usbgadget.dfu_function and global.fastboot_partitions are not set, respectively. No functional change intended for configurations that have SYSTEM_PARTITIONS disabled. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/fastboot.h6
-rw-r--r--include/file-list.h5
-rw-r--r--include/usb/gadget-multi.h1
3 files changed, 9 insertions, 3 deletions
diff --git a/include/fastboot.h b/include/fastboot.h
index 2eab2dfe6a..cf8a177bf1 100644
--- a/include/fastboot.h
+++ b/include/fastboot.h
@@ -58,16 +58,16 @@ enum fastboot_msg_type {
#ifdef CONFIG_FASTBOOT_BASE
bool get_fastboot_bbu(void);
-const char *get_fastboot_partitions(void);
+struct file_list *get_fastboot_partitions(void);
#else
static inline int get_fastboot_bbu(void)
{
return false;
}
-static inline const char *get_fastboot_partitions(void)
+static inline struct file_list *get_fastboot_partitions(void)
{
- return NULL;
+ return file_list_parse("");
}
#endif
diff --git a/include/file-list.h b/include/file-list.h
index 2538883c36..be97a49b7a 100644
--- a/include/file-list.h
+++ b/include/file-list.h
@@ -35,4 +35,9 @@ struct file_list_entry *file_list_entry_by_name(struct file_list *files, const c
#define file_list_for_each_entry(files, entry) \
list_for_each_entry(entry, &files->list, list)
+static inline bool file_list_empty(struct file_list *files)
+{
+ return !files || !files->num_entries;
+}
+
#endif /* __FILE_LIST */
diff --git a/include/usb/gadget-multi.h b/include/usb/gadget-multi.h
index 9bb6c889f3..f30dae5686 100644
--- a/include/usb/gadget-multi.h
+++ b/include/usb/gadget-multi.h
@@ -15,6 +15,7 @@ struct f_multi_opts {
int usb_multi_register(struct f_multi_opts *opts);
void usb_multi_unregister(void);
void usb_multi_opts_release(struct f_multi_opts *opts);
+unsigned usb_multi_count_functions(struct f_multi_opts *opts);
int usbgadget_register(bool dfu, const char *dfu_opts,
bool fastboot, const char *fastboot_opts,