metalsvm/drivers/net/sccpc.c
2010-08-11 20:47:00 +00:00

65 lines
1.7 KiB
C

/*
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
* RWTH Aachen University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of MetalSVM.
*/
#include <metalsvm/stddef.h>
#include <metalsvm/stdio.h>
#include <metalsvm/string.h>
#if defined(CONFIG_LWIP) && defined(CONFIG_ROCKCREEK)
#include <lwip/sys.h>
#include <lwip/stats.h>
#include <lwip/netif.h>
#include <netif/etharp.h>
static struct netif *mynetif;
/**
*
*
* @return error code
* - ERR_OK: packet transferred to hardware
* - ERR_CONN: no link or link failure
* - ERR_IF: could not transfer to link (hardware buffer full?)
*/
static err_t sccpc_output(struct netif *netif, struct pbuf *p)
{
return ERR_CONN;
}
err_t sccpcif_init(struct netif* netif)
{
mynetif = netif;
/* administrative details */
mynetif->name[0] = 'p';
mynetif->name[1] = 'c';
mynetif->num = 0;
/* downward functions */
mynetif->output = ip_output;
mynetif->linkoutput = sccpc_output;
/* maximum transfer unit */
mynetif->mtu = 1500;
/* broadcast capability */
mynetif->flags = NETIF_FLAG_LINK_UP;
/* hardware address length */
mynetif->hwaddr_len = 6;
return ERR_OK;
}
#endif