summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAndrew Goodbody <andrew.goodbody@linaro.org>2025-12-12 11:32:25 +0000
committerJerome Forissier <jerome.forissier@arm.com>2026-01-15 11:09:28 +0100
commit3938ae6457193cd3b0abb8b74957a388a6b3e639 (patch)
tree9c19370a2cc7dcbc91f889777054617d139cc72f /net
parent60c228c07734a6f3d670c89d2db2e3addd8a73a8 (diff)
net: Move some variables to net-common files
Make some variables available to be used by either the legacy network code or lwIP by moving them into the net-common files. This also allowed removing a small number of duplicated variables from the lwIP code. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Diffstat (limited to 'net')
-rw-r--r--net/lwip/net-lwip.c5
-rw-r--r--net/net-common.c9
-rw-r--r--net/net.c10
3 files changed, 9 insertions, 15 deletions
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
index f70857204b2..c325e923d20 100644
--- a/net/lwip/net-lwip.c
+++ b/net/lwip/net-lwip.c
@@ -33,13 +33,8 @@ static int net_restarted;
int net_restart_wrap;
static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN]
__aligned(PKTALIGN);
-uchar *net_rx_packets[PKTBUFSRX];
-uchar *net_rx_packet;
const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
char *pxelinux_configfile;
-/* Our IP addr (0 = unknown) */
-struct in_addr net_ip;
-char net_boot_file_name[1024];
static err_t net_lwip_tx(struct netif *netif, struct pbuf *p)
{
diff --git a/net/net-common.c b/net/net-common.c
index ec1e179f7d9..f21a80357f6 100644
--- a/net/net-common.c
+++ b/net/net-common.c
@@ -8,6 +8,15 @@
/* Network loop state */
enum net_loop_state net_state;
+/* Our IP addr (0 = unknown) */
+struct in_addr net_ip;
+/* Boot File name */
+char net_boot_file_name[1024];
+/* The actual transferred size of the bootfile (in bytes) */
+u32 net_boot_file_size;
+/* Boot file size in blocks as reported by the DHCP server */
+u32 net_boot_file_expected_size_in_blocks;
+uchar *net_rx_packets[PKTBUFSRX];
void copy_filename(char *dst, const char *src, int size)
{
diff --git a/net/net.c b/net/net.c
index 096f01427ba..8a8160e633f 100644
--- a/net/net.c
+++ b/net/net.c
@@ -141,8 +141,6 @@ char *pxelinux_configfile;
u8 net_ethaddr[6];
/* Boot server enet address */
u8 net_server_ethaddr[6];
-/* Our IP addr (0 = unknown) */
-struct in_addr net_ip;
/* Server IP addr (0 = unknown) */
struct in_addr net_server_ip;
/* Current receive packet */
@@ -170,18 +168,10 @@ ushort net_our_vlan = 0xFFFF;
/* ditto */
ushort net_native_vlan = 0xFFFF;
-/* Boot File name */
-char net_boot_file_name[1024];
/* Indicates whether the file name was specified on the command line */
bool net_boot_file_name_explicit;
-/* The actual transferred size of the bootfile (in bytes) */
-u32 net_boot_file_size;
-/* Boot file size in blocks as reported by the DHCP server */
-u32 net_boot_file_expected_size_in_blocks;
static uchar net_pkt_buf[(PKTBUFSRX+1) * PKTSIZE_ALIGN + PKTALIGN];
-/* Receive packets */
-uchar *net_rx_packets[PKTBUFSRX];
/* Current UDP RX packet handler */
static rxhand_f *udp_packet_handler;
/* Current ARP RX packet handler */