Skip to contentSkip to conversation

net: fastboot: make UDP port net: configurable

PATCH In review Christian Gmeiner 3 participants 4 messages Jan 13, 2022 – Jan 15, 2022 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: fastboot: make UDP port net: configurable

The fastboot protocol uses per default the UDP port 5554. In some cases it might be needed to change the used port. The fastboot utility provides a way to specifiy an other port number to use already.

fastboot -s udp:192.168.1.76:1234 boot fastboot.img

---
 drivers/fastboot/Kconfig | 7 +++++++
 net/fastboot.c           | 5 +----
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/fastboot/Kconfig +7 -0
index d5e4a02098..b97c67bf60 100644
@@ -21,6 +21,13 @@ config UDP_FUNCTION_FASTBOOT
 	help
 	  This enables the fastboot protocol over UDP.
 
+config UDP_FUNCTION_FASTBOOT_PORT
+	depends on UDP_FUNCTION_FASTBOOT
+	int "Define FASTBOOT UDP port"
+	default 5554
+	help
+	  The fastboot protocol requires a UDP port number.
+
 if FASTBOOT
 
 config FASTBOOT_BUF_ADDR
net/fastboot.c +1 -4
index 7e7a601b9f..139233b86c 100644
@@ -9,9 +9,6 @@
 #include <net.h>
 #include <net/fastboot.h>
 
-/* Fastboot port # defined in spec */
-#define WELL_KNOWN_PORT 5554
-
 enum {
 	FASTBOOT_ERROR = 0,
 	FASTBOOT_QUERY = 1,
@@ -310,7 +307,7 @@ void fastboot_start_server(void)
 	printf("Using %s device\n", eth_get_name());
 	printf("Listening for fastboot command on %pI4\n", &net_ip);
 
-	fastboot_our_port = WELL_KNOWN_PORT;
+	fastboot_our_port = CONFIG_UDP_FUNCTION_FASTBOOT_PORT;
 
 #if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
 	fastboot_set_progress_callback(fastboot_timed_send_info);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hello Christian,

Quoted 11 lines · Christian Gmeiner

The fastboot protocol uses per default the UDP port 5554. In some cases it might be needed to change the used port. The fastboot utility provides a way to specifiy an other port number to use already.

fastboot -s udp:192.168.1.76:1234 boot fastboot.img

---
 drivers/fastboot/Kconfig | 7 +++++++
 net/fastboot.c           | 5 +----
 2 files changed, 8 insertions(+), 4 deletions(-)

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]
Reviewed-by
#2 lore raw
Quoted 16 lines · Heiko Schocher

Hello Christian,

Quoted 11 lines · Christian Gmeiner

The fastboot protocol uses per default the UDP port 5554. In some cases it might be needed to change the used port. The fastboot utility provides a way to specifiy an other port number to use already.

fastboot -s udp:192.168.1.76:1234 boot fastboot.img

---
 drivers/fastboot/Kconfig | 7 +++++++
 net/fastboot.c           | 5 +----
 2 files changed, 8 insertions(+), 4 deletions(-)
Quoted 8 lines

bye,
Heiko
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]

#3 lore raw
Quoted 20 lines · Ramon Fried
Quoted 18 lines · Heiko Schocher

Hello Christian,

Quoted 11 lines · Christian Gmeiner

The fastboot protocol uses per default the UDP port 5554. In some cases it might be needed to change the used port. The fastboot utility provides a way to specifiy an other port number to use already.

fastboot -s udp:192.168.1.76:1234 boot fastboot.img

---
 drivers/fastboot/Kconfig | 7 +++++++
 net/fastboot.c           | 5 +----
 2 files changed, 8 insertions(+), 4 deletions(-)
Quoted 7 lines
Quoted 6 lines

bye,
Heiko
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]

Applied to u-boot-net/next
Thanks !