Show info about net devices in loader's 'lsdev' command. While there fix style.

This commit is contained in:
Rafal Jaworowski 2008-09-03 17:41:44 +00:00
parent 09c7f9e338
commit 387a29b78d
2 changed files with 182 additions and 169 deletions

View File

@ -103,7 +103,8 @@ struct devsw netdev = {
int
net_init(void)
{
return 0;
return (0);
}
/*
@ -151,10 +152,8 @@ net_open(struct open_file *f, ...)
}
int
net_close(f)
struct open_file *f;
net_close(struct open_file *f)
{
#ifdef NETIF_DEBUG
if (debug)
printf("net_close: opens=%d\n", netdev_opens);
@ -182,7 +181,8 @@ net_close(f)
int
net_strategy()
{
return EIO;
return (EIO);
}
#define SUPPORT_BOOTP
@ -205,8 +205,7 @@ int try_bootp = 1;
extern n_long ip_convertaddr(char *p);
static int
net_getparams(sock)
int sock;
net_getparams(int sock)
{
char buf[MAXHOSTNAMELEN];
char temp[FNAME_SIZE];
@ -270,7 +269,7 @@ net_getparams(sock)
printf("net_open: bootparam/getfile RPC failed\n");
return (EIO);
}
exit:
exit:
/*
* If present, strip the server's address off of the rootpath
* before passing it along. This allows us to be compatible with
@ -306,5 +305,18 @@ net_getparams(sock)
static void
net_print(int verbose)
{
return;
struct netif_driver *drv;
int i, d, cnt;
cnt = 0;
for (d = 0; netif_drivers[d]; d++) {
drv = netif_drivers[d];
for (i = 0; i < drv->netif_nifs; i++) {
printf("\t%s%d:", "net", cnt++);
if (verbose)
printf(" (%s%d)", drv->netif_bname,
drv->netif_ifs[i].dif_unit);
}
}
printf("\n");
}

View File

@ -59,8 +59,9 @@ devopen(struct open_file *f, const char *fname, const char **file)
int
devclose(struct open_file *f)
{
if (f->f_devdata != NULL) {
free(f->f_devdata);
}
return(0);
return (0);
}