/*-
* Copyright (c) 2000-2001 Benno Rice
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
__FBSDID("$FreeBSD$");
#include <netinet/in_systm.h>
#include <netinet/if_ether.h>
#include <stand.h>
#include <net.h>
#include <netif.h>
#include "openfirm.h"
static int ofwn_probe(struct netif *, void *);
static int ofwn_match(struct netif *, void *);
extern struct netif_stats ofwn_stats[];
/* dif_unit dif_nsel dif_stats dif_private */
{ 0, 1, &ofwn_stats[0], 0, },
};
"net", /* netif_bname */
ofwn_match, /* netif_match */
ofwn_probe, /* netif_probe */
ofwn_init, /* netif_init */
ofwn_get, /* netif_get */
ofwn_put, /* netif_put */
ofwn_end, /* netif_end */
ofwn_ifs, /* netif_ifs */
};
static void *dmabuf;
static int
{
return 1;
}
static int
{
return 0;
}
static int
{
#if defined(NETIF_DEBUG)
#endif
if (sendlen < 60) {
sendlen = 60;
#if defined(NETIF_DEBUG)
#endif
}
if (dmabuf) {
}
#if defined(NETIF_DEBUG)
#endif
return rv;
}
static int
{
time_t t;
int length;
#if defined(NETIF_DEBUG)
timeout);
#endif
t = getsecs();
do {
#if defined(NETIF_DEBUG)
#endif
if (length < 12)
return -1;
#if defined(NETIF_VERBOSE_DEBUG)
{
int i;
for(i = 0; i < 96; i += 4) {
}
printf("\n");
}
#endif
#if defined(NETIF_DEBUG)
{
}
#endif
return length;
}
extern char *strchr();
static void
{
char *ch;
int pathlen;
*ch = '\0';
#ifdef __sparc64__
#else
#endif
goto punt;
printf("Could not open network device.\n");
goto punt;
}
#if defined(NETIF_DEBUG)
#endif
#ifndef __sparc64__
< 0) {
goto punt;
}
#if defined(NETIF_DEBUG)
#endif
#endif
return;
punt:
printf("\n");
OF_enter();
}
static void
{
#ifdef BROKEN
/* dma-free freezes at least some Apple ethernet controllers */
#endif
}
#if 0
int
ofwn_getunit(const char *path)
{
int i;
char newpath[255];
for (i = 0; i < nofwninfo; i++) {
return i;
return i;
}
return -1;
}
#endif