summaryrefslogtreecommitdiffstats
path: root/sys/boot/uboot/lib/net.c
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2008-09-03 15:39:50 +0000
committerraj <raj@FreeBSD.org>2008-09-03 15:39:50 +0000
commitc96f761ec1a0290b67e5d8a5396d883187b67221 (patch)
tree892bb1df63c93744c5e68f7e56ba2072cc220c72 /sys/boot/uboot/lib/net.c
parentadfbe058ec9f9187c69e93a461e063d55fe67e66 (diff)
downloadFreeBSD-src-c96f761ec1a0290b67e5d8a5396d883187b67221.zip
FreeBSD-src-c96f761ec1a0290b67e5d8a5396d883187b67221.tar.gz
Move U-Boot compatibility library to WARNS=2 level.
Diffstat (limited to 'sys/boot/uboot/lib/net.c')
-rw-r--r--sys/boot/uboot/lib/net.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/boot/uboot/lib/net.c b/sys/boot/uboot/lib/net.c
index 6e05e73..5902a1b 100644
--- a/sys/boot/uboot/lib/net.c
+++ b/sys/boot/uboot/lib/net.c
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <netif.h>
#include "api_public.h"
+#include "glue.h"
#include "libuboot.h"
#define NETIF_DEBUG
@@ -58,8 +59,6 @@ static int net_get(struct iodesc *, void *, size_t, time_t);
static int net_put(struct iodesc *, void *, size_t);
static void net_end(struct netif *);
-struct device_info * ub_dev_get(int i);
-
extern int devs_no;
extern struct netif_stats net_stats[];
@@ -107,13 +106,14 @@ net_match(struct netif *nif, void *machdep_hint)
static int
net_probe(struct netif *nif, void *machdep_hint)
{
- struct device_info *di;
- int i;
+ struct device_info *di;
+ int i;
for (i = 0; i < devs_no; i++)
- if (di = ub_dev_get(i))
+ if ((di = ub_dev_get(i)) != NULL)
if (di->type == DEV_TYP_NET)
break;
+
if (i == devs_no) {
printf("net_probe: no network devices found, maybe not"
" enumerated yet..?\n");
@@ -131,14 +131,14 @@ net_probe(struct netif *nif, void *machdep_hint)
static int
net_put(struct iodesc *desc, void *pkt, size_t len)
{
- struct netif *nif = desc->io_netif;
- struct uboot_softc *sc = nif->nif_devdata;
-
- struct ether_header *eh;
- size_t sendlen;
- ssize_t rv;
+ struct netif *nif = desc->io_netif;
+ struct uboot_softc *sc = nif->nif_devdata;
+ size_t sendlen;
+ ssize_t rv;
#if defined(NETIF_DEBUG)
+ struct ether_header *eh;
+
printf("net_put: desc 0x%x, pkt 0x%x, len %d\n", desc, pkt, len);
eh = pkt;
printf("dst: %s ", ether_sprintf(eh->ether_dhost));
@@ -205,14 +205,14 @@ net_get(struct iodesc *desc, void *pkt, size_t len, time_t timeout)
static void
net_init(struct iodesc *desc, void *machdep_hint)
{
- struct netif *nif = desc->io_netif;
- struct uboot_softc *sc;
- struct device_info *di;
- int err, i;
+ struct netif *nif = desc->io_netif;
+ struct uboot_softc *sc;
+ struct device_info *di;
+ int err;
sc = nif->nif_devdata = &uboot_softc;
- if (err = ub_dev_open(sc->sc_handle))
+ if ((err = ub_dev_open(sc->sc_handle)) != 0)
panic("%s%d: initialisation failed with error %d\n",
nif->nif_driver->netif_bname, nif->nif_unit, err);
@@ -240,10 +240,10 @@ net_init(struct iodesc *desc, void *machdep_hint)
static void
net_end(struct netif *nif)
{
- struct uboot_softc *sc = nif->nif_devdata;
- int err;
+ struct uboot_softc *sc = nif->nif_devdata;
+ int err;
- if (err = ub_dev_close(sc->sc_handle))
+ if ((err = ub_dev_close(sc->sc_handle)) != 0)
panic("%s%d: net_end failed with error %d\n",
nif->nif_driver->netif_bname, nif->nif_unit, err);
}
OpenPOWER on IntegriCloud