fastboot: lift restrictions on !NET_LWIP for USB
Fastboot works either over TCP, UDP or USB. The latter doesn't have anything to do with networking, thus should work just fine with regardless which network stack is selected. In practice, header symbols are used inside common code paths. Add some ifdeffery to guard against that. This will make fastboot over USB work with the new LWIP stack. Signed-off-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20250312073655.2281377-1-mwalle@kernel.org Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
This commit is contained in:

committed by
Mattijs Korpershoek

parent
7cedd20ed3
commit
d3c9f810f2
@@ -16,6 +16,7 @@
|
||||
#include <linux/printk.h>
|
||||
#include <linux/stringify.h>
|
||||
|
||||
#if CONFIG_IS_ENABLED(NET)
|
||||
static int do_fastboot_udp(int argc, char *const argv[],
|
||||
uintptr_t buf_addr, size_t buf_size)
|
||||
{
|
||||
@@ -55,6 +56,7 @@ static int do_fastboot_tcp(int argc, char *const argv[],
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int do_fastboot_usb(int argc, char *const argv[],
|
||||
uintptr_t buf_addr, size_t buf_size)
|
||||
@@ -160,10 +162,12 @@ NXTARG:
|
||||
|
||||
fastboot_init((void *)buf_addr, buf_size);
|
||||
|
||||
#if CONFIG_IS_ENABLED(NET)
|
||||
if (!strcmp(argv[1], "udp"))
|
||||
return do_fastboot_udp(argc, argv, buf_addr, buf_size);
|
||||
if (!strcmp(argv[1], "tcp"))
|
||||
return do_fastboot_tcp(argc, argv, buf_addr, buf_size);
|
||||
#endif
|
||||
if (!strcmp(argv[1], "usb")) {
|
||||
argv++;
|
||||
argc--;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
menu "Fastboot support"
|
||||
depends on CMDLINE
|
||||
depends on !NET_LWIP
|
||||
|
||||
config FASTBOOT
|
||||
bool
|
||||
|
@@ -183,11 +183,15 @@ void fastboot_handle_boot(int command, bool success)
|
||||
switch (command) {
|
||||
case FASTBOOT_COMMAND_BOOT:
|
||||
fastboot_boot();
|
||||
#if CONFIG_IS_ENABLED(NET)
|
||||
net_set_state(NETLOOP_SUCCESS);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FASTBOOT_COMMAND_CONTINUE:
|
||||
#if CONFIG_IS_ENABLED(NET)
|
||||
net_set_state(NETLOOP_SUCCESS);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case FASTBOOT_COMMAND_REBOOT:
|
||||
|
Reference in New Issue
Block a user