u-boot/net/udp.c
Tom Rini d678a59d2d Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d, reversing
changes made to 2ee6f3a5f7.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19 08:16:36 -06:00

46 lines
673 B
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2020 Philippe Reynes <philippe.reynes@softathome.com>
*/
#include <common.h>
#include <net.h>
#include <net/udp.h>
static struct udp_ops *udp_ops;
int udp_prereq(void)
{
int ret = 0;
if (udp_ops->prereq)
ret = udp_ops->prereq(udp_ops->data);
return ret;
}
int udp_start(void)
{
return udp_ops->start(udp_ops->data);
}
int udp_loop(struct udp_ops *ops)
{
int ret = -1;
if (!ops) {
printf("%s: ops should not be null\n", __func__);
goto out;
}
if (!ops->start) {
printf("%s: no start function defined\n", __func__);
goto out;
}
udp_ops = ops;
ret = net_loop(UDP);
out:
return ret;
}