Library for Bert van Dam's book "ARM MICROCONTROLLERS" For all chapters with internet.

Dependencies:   mbed

Committer:
ICTFBI
Date:
Fri Oct 16 14:28:26 2015 +0000
Revision:
0:4edb816d21e1
Pre-update 16-10-15

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ICTFBI 0:4edb816d21e1 1 /**
ICTFBI 0:4edb816d21e1 2 * @file
ICTFBI 0:4edb816d21e1 3 * Ethernet Interface Skeleton
ICTFBI 0:4edb816d21e1 4 *
ICTFBI 0:4edb816d21e1 5 */
ICTFBI 0:4edb816d21e1 6
ICTFBI 0:4edb816d21e1 7 /*
ICTFBI 0:4edb816d21e1 8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
ICTFBI 0:4edb816d21e1 9 * All rights reserved.
ICTFBI 0:4edb816d21e1 10 *
ICTFBI 0:4edb816d21e1 11 * Redistribution and use in source and binary forms, with or without modification,
ICTFBI 0:4edb816d21e1 12 * are permitted provided that the following conditions are met:
ICTFBI 0:4edb816d21e1 13 *
ICTFBI 0:4edb816d21e1 14 * 1. Redistributions of source code must retain the above copyright notice,
ICTFBI 0:4edb816d21e1 15 * this list of conditions and the following disclaimer.
ICTFBI 0:4edb816d21e1 16 * 2. Redistributions in binary form must reproduce the above copyright notice,
ICTFBI 0:4edb816d21e1 17 * this list of conditions and the following disclaimer in the documentation
ICTFBI 0:4edb816d21e1 18 * and/or other materials provided with the distribution.
ICTFBI 0:4edb816d21e1 19 * 3. The name of the author may not be used to endorse or promote products
ICTFBI 0:4edb816d21e1 20 * derived from this software without specific prior written permission.
ICTFBI 0:4edb816d21e1 21 *
ICTFBI 0:4edb816d21e1 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
ICTFBI 0:4edb816d21e1 23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
ICTFBI 0:4edb816d21e1 24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
ICTFBI 0:4edb816d21e1 25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
ICTFBI 0:4edb816d21e1 26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
ICTFBI 0:4edb816d21e1 27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
ICTFBI 0:4edb816d21e1 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
ICTFBI 0:4edb816d21e1 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ICTFBI 0:4edb816d21e1 30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
ICTFBI 0:4edb816d21e1 31 * OF SUCH DAMAGE.
ICTFBI 0:4edb816d21e1 32 *
ICTFBI 0:4edb816d21e1 33 * This file is part of the lwIP TCP/IP stack.
ICTFBI 0:4edb816d21e1 34 *
ICTFBI 0:4edb816d21e1 35 * Author: Adam Dunkels <adam@sics.se>
ICTFBI 0:4edb816d21e1 36 *
ICTFBI 0:4edb816d21e1 37 */
ICTFBI 0:4edb816d21e1 38
ICTFBI 0:4edb816d21e1 39 /*
ICTFBI 0:4edb816d21e1 40 * This file is a skeleton for developing Ethernet network interface
ICTFBI 0:4edb816d21e1 41 * drivers for lwIP. Add code to the low_level functions and do a
ICTFBI 0:4edb816d21e1 42 * search-and-replace for the word "ethernetif" to replace it with
ICTFBI 0:4edb816d21e1 43 * something that better describes your network interface.
ICTFBI 0:4edb816d21e1 44 */
ICTFBI 0:4edb816d21e1 45
ICTFBI 0:4edb816d21e1 46 #include "lwip/opt.h"
ICTFBI 0:4edb816d21e1 47
ICTFBI 0:4edb816d21e1 48 #if 0 /* don't build, this is only a skeleton, see previous comment */
ICTFBI 0:4edb816d21e1 49
ICTFBI 0:4edb816d21e1 50 #include "lwip/def.h"
ICTFBI 0:4edb816d21e1 51 #include "lwip/mem.h"
ICTFBI 0:4edb816d21e1 52 #include "lwip/pbuf.h"
ICTFBI 0:4edb816d21e1 53 #include "lwip/sys.h"
ICTFBI 0:4edb816d21e1 54 #include <lwip/stats.h>
ICTFBI 0:4edb816d21e1 55 #include <lwip/snmp.h>
ICTFBI 0:4edb816d21e1 56 #include "netif/etharp.h"
ICTFBI 0:4edb816d21e1 57 #include "netif/ppp_oe.h"
ICTFBI 0:4edb816d21e1 58
ICTFBI 0:4edb816d21e1 59 /* Define those to better describe your network interface. */
ICTFBI 0:4edb816d21e1 60 #define IFNAME0 'e'
ICTFBI 0:4edb816d21e1 61 #define IFNAME1 'n'
ICTFBI 0:4edb816d21e1 62
ICTFBI 0:4edb816d21e1 63 /**
ICTFBI 0:4edb816d21e1 64 * Helper struct to hold private data used to operate your ethernet interface.
ICTFBI 0:4edb816d21e1 65 * Keeping the ethernet address of the MAC in this struct is not necessary
ICTFBI 0:4edb816d21e1 66 * as it is already kept in the struct netif.
ICTFBI 0:4edb816d21e1 67 * But this is only an example, anyway...
ICTFBI 0:4edb816d21e1 68 */
ICTFBI 0:4edb816d21e1 69 struct ethernetif {
ICTFBI 0:4edb816d21e1 70 struct eth_addr *ethaddr;
ICTFBI 0:4edb816d21e1 71 /* Add whatever per-interface state that is needed here. */
ICTFBI 0:4edb816d21e1 72 };
ICTFBI 0:4edb816d21e1 73
ICTFBI 0:4edb816d21e1 74 /* Forward declarations. */
ICTFBI 0:4edb816d21e1 75 static void ethernetif_input(struct netif *netif);
ICTFBI 0:4edb816d21e1 76
ICTFBI 0:4edb816d21e1 77 /**
ICTFBI 0:4edb816d21e1 78 * In this function, the hardware should be initialized.
ICTFBI 0:4edb816d21e1 79 * Called from ethernetif_init().
ICTFBI 0:4edb816d21e1 80 *
ICTFBI 0:4edb816d21e1 81 * @param netif the already initialized lwip network interface structure
ICTFBI 0:4edb816d21e1 82 * for this ethernetif
ICTFBI 0:4edb816d21e1 83 */
ICTFBI 0:4edb816d21e1 84 static void
ICTFBI 0:4edb816d21e1 85 low_level_init(struct netif *netif)
ICTFBI 0:4edb816d21e1 86 {
ICTFBI 0:4edb816d21e1 87 struct ethernetif *ethernetif = netif->state;
ICTFBI 0:4edb816d21e1 88
ICTFBI 0:4edb816d21e1 89 /* set MAC hardware address length */
ICTFBI 0:4edb816d21e1 90 netif->hwaddr_len = ETHARP_HWADDR_LEN;
ICTFBI 0:4edb816d21e1 91
ICTFBI 0:4edb816d21e1 92 /* set MAC hardware address */
ICTFBI 0:4edb816d21e1 93 netif->hwaddr[0] = ;
ICTFBI 0:4edb816d21e1 94 ...
ICTFBI 0:4edb816d21e1 95 netif->hwaddr[5] = ;
ICTFBI 0:4edb816d21e1 96
ICTFBI 0:4edb816d21e1 97 /* maximum transfer unit */
ICTFBI 0:4edb816d21e1 98 netif->mtu = 1500;
ICTFBI 0:4edb816d21e1 99
ICTFBI 0:4edb816d21e1 100 /* device capabilities */
ICTFBI 0:4edb816d21e1 101 /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */
ICTFBI 0:4edb816d21e1 102 netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP;
ICTFBI 0:4edb816d21e1 103
ICTFBI 0:4edb816d21e1 104 /* Do whatever else is needed to initialize interface. */
ICTFBI 0:4edb816d21e1 105 }
ICTFBI 0:4edb816d21e1 106
ICTFBI 0:4edb816d21e1 107 /**
ICTFBI 0:4edb816d21e1 108 * This function should do the actual transmission of the packet. The packet is
ICTFBI 0:4edb816d21e1 109 * contained in the pbuf that is passed to the function. This pbuf
ICTFBI 0:4edb816d21e1 110 * might be chained.
ICTFBI 0:4edb816d21e1 111 *
ICTFBI 0:4edb816d21e1 112 * @param netif the lwip network interface structure for this ethernetif
ICTFBI 0:4edb816d21e1 113 * @param p the MAC packet to send (e.g. IP packet including MAC addresses and type)
ICTFBI 0:4edb816d21e1 114 * @return ERR_OK if the packet could be sent
ICTFBI 0:4edb816d21e1 115 * an err_t value if the packet couldn't be sent
ICTFBI 0:4edb816d21e1 116 *
ICTFBI 0:4edb816d21e1 117 * @note Returning ERR_MEM here if a DMA queue of your MAC is full can lead to
ICTFBI 0:4edb816d21e1 118 * strange results. You might consider waiting for space in the DMA queue
ICTFBI 0:4edb816d21e1 119 * to become availale since the stack doesn't retry to send a packet
ICTFBI 0:4edb816d21e1 120 * dropped because of memory failure (except for the TCP timers).
ICTFBI 0:4edb816d21e1 121 */
ICTFBI 0:4edb816d21e1 122
ICTFBI 0:4edb816d21e1 123 static err_t
ICTFBI 0:4edb816d21e1 124 low_level_output(struct netif *netif, struct pbuf *p)
ICTFBI 0:4edb816d21e1 125 {
ICTFBI 0:4edb816d21e1 126 struct ethernetif *ethernetif = netif->state;
ICTFBI 0:4edb816d21e1 127 struct pbuf *q;
ICTFBI 0:4edb816d21e1 128
ICTFBI 0:4edb816d21e1 129 initiate transfer();
ICTFBI 0:4edb816d21e1 130
ICTFBI 0:4edb816d21e1 131 #if ETH_PAD_SIZE
ICTFBI 0:4edb816d21e1 132 pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
ICTFBI 0:4edb816d21e1 133 #endif
ICTFBI 0:4edb816d21e1 134
ICTFBI 0:4edb816d21e1 135 for(q = p; q != NULL; q = q->next) {
ICTFBI 0:4edb816d21e1 136 /* Send the data from the pbuf to the interface, one pbuf at a
ICTFBI 0:4edb816d21e1 137 time. The size of the data in each pbuf is kept in the ->len
ICTFBI 0:4edb816d21e1 138 variable. */
ICTFBI 0:4edb816d21e1 139 send data from(q->payload, q->len);
ICTFBI 0:4edb816d21e1 140 }
ICTFBI 0:4edb816d21e1 141
ICTFBI 0:4edb816d21e1 142 signal that packet should be sent();
ICTFBI 0:4edb816d21e1 143
ICTFBI 0:4edb816d21e1 144 #if ETH_PAD_SIZE
ICTFBI 0:4edb816d21e1 145 pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */
ICTFBI 0:4edb816d21e1 146 #endif
ICTFBI 0:4edb816d21e1 147
ICTFBI 0:4edb816d21e1 148 LINK_STATS_INC(link.xmit);
ICTFBI 0:4edb816d21e1 149
ICTFBI 0:4edb816d21e1 150 return ERR_OK;
ICTFBI 0:4edb816d21e1 151 }
ICTFBI 0:4edb816d21e1 152
ICTFBI 0:4edb816d21e1 153 /**
ICTFBI 0:4edb816d21e1 154 * Should allocate a pbuf and transfer the bytes of the incoming
ICTFBI 0:4edb816d21e1 155 * packet from the interface into the pbuf.
ICTFBI 0:4edb816d21e1 156 *
ICTFBI 0:4edb816d21e1 157 * @param netif the lwip network interface structure for this ethernetif
ICTFBI 0:4edb816d21e1 158 * @return a pbuf filled with the received packet (including MAC header)
ICTFBI 0:4edb816d21e1 159 * NULL on memory error
ICTFBI 0:4edb816d21e1 160 */
ICTFBI 0:4edb816d21e1 161 static struct pbuf *
ICTFBI 0:4edb816d21e1 162 low_level_input(struct netif *netif)
ICTFBI 0:4edb816d21e1 163 {
ICTFBI 0:4edb816d21e1 164 struct ethernetif *ethernetif = netif->state;
ICTFBI 0:4edb816d21e1 165 struct pbuf *p, *q;
ICTFBI 0:4edb816d21e1 166 u16_t len;
ICTFBI 0:4edb816d21e1 167
ICTFBI 0:4edb816d21e1 168 /* Obtain the size of the packet and put it into the "len"
ICTFBI 0:4edb816d21e1 169 variable. */
ICTFBI 0:4edb816d21e1 170 len = ;
ICTFBI 0:4edb816d21e1 171
ICTFBI 0:4edb816d21e1 172 #if ETH_PAD_SIZE
ICTFBI 0:4edb816d21e1 173 len += ETH_PAD_SIZE; /* allow room for Ethernet padding */
ICTFBI 0:4edb816d21e1 174 #endif
ICTFBI 0:4edb816d21e1 175
ICTFBI 0:4edb816d21e1 176 /* We allocate a pbuf chain of pbufs from the pool. */
ICTFBI 0:4edb816d21e1 177 p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
ICTFBI 0:4edb816d21e1 178
ICTFBI 0:4edb816d21e1 179 if (p != NULL) {
ICTFBI 0:4edb816d21e1 180
ICTFBI 0:4edb816d21e1 181 #if ETH_PAD_SIZE
ICTFBI 0:4edb816d21e1 182 pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
ICTFBI 0:4edb816d21e1 183 #endif
ICTFBI 0:4edb816d21e1 184
ICTFBI 0:4edb816d21e1 185 /* We iterate over the pbuf chain until we have read the entire
ICTFBI 0:4edb816d21e1 186 * packet into the pbuf. */
ICTFBI 0:4edb816d21e1 187 for(q = p; q != NULL; q = q->next) {
ICTFBI 0:4edb816d21e1 188 /* Read enough bytes to fill this pbuf in the chain. The
ICTFBI 0:4edb816d21e1 189 * available data in the pbuf is given by the q->len
ICTFBI 0:4edb816d21e1 190 * variable.
ICTFBI 0:4edb816d21e1 191 * This does not necessarily have to be a memcpy, you can also preallocate
ICTFBI 0:4edb816d21e1 192 * pbufs for a DMA-enabled MAC and after receiving truncate it to the
ICTFBI 0:4edb816d21e1 193 * actually received size. In this case, ensure the tot_len member of the
ICTFBI 0:4edb816d21e1 194 * pbuf is the sum of the chained pbuf len members.
ICTFBI 0:4edb816d21e1 195 */
ICTFBI 0:4edb816d21e1 196 read data into(q->payload, q->len);
ICTFBI 0:4edb816d21e1 197 }
ICTFBI 0:4edb816d21e1 198 acknowledge that packet has been read();
ICTFBI 0:4edb816d21e1 199
ICTFBI 0:4edb816d21e1 200 #if ETH_PAD_SIZE
ICTFBI 0:4edb816d21e1 201 pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */
ICTFBI 0:4edb816d21e1 202 #endif
ICTFBI 0:4edb816d21e1 203
ICTFBI 0:4edb816d21e1 204 LINK_STATS_INC(link.recv);
ICTFBI 0:4edb816d21e1 205 } else {
ICTFBI 0:4edb816d21e1 206 drop packet();
ICTFBI 0:4edb816d21e1 207 LINK_STATS_INC(link.memerr);
ICTFBI 0:4edb816d21e1 208 LINK_STATS_INC(link.drop);
ICTFBI 0:4edb816d21e1 209 }
ICTFBI 0:4edb816d21e1 210
ICTFBI 0:4edb816d21e1 211 return p;
ICTFBI 0:4edb816d21e1 212 }
ICTFBI 0:4edb816d21e1 213
ICTFBI 0:4edb816d21e1 214 /**
ICTFBI 0:4edb816d21e1 215 * This function should be called when a packet is ready to be read
ICTFBI 0:4edb816d21e1 216 * from the interface. It uses the function low_level_input() that
ICTFBI 0:4edb816d21e1 217 * should handle the actual reception of bytes from the network
ICTFBI 0:4edb816d21e1 218 * interface. Then the type of the received packet is determined and
ICTFBI 0:4edb816d21e1 219 * the appropriate input function is called.
ICTFBI 0:4edb816d21e1 220 *
ICTFBI 0:4edb816d21e1 221 * @param netif the lwip network interface structure for this ethernetif
ICTFBI 0:4edb816d21e1 222 */
ICTFBI 0:4edb816d21e1 223 static void
ICTFBI 0:4edb816d21e1 224 ethernetif_input(struct netif *netif)
ICTFBI 0:4edb816d21e1 225 {
ICTFBI 0:4edb816d21e1 226 struct ethernetif *ethernetif;
ICTFBI 0:4edb816d21e1 227 struct eth_hdr *ethhdr;
ICTFBI 0:4edb816d21e1 228 struct pbuf *p;
ICTFBI 0:4edb816d21e1 229
ICTFBI 0:4edb816d21e1 230 ethernetif = netif->state;
ICTFBI 0:4edb816d21e1 231
ICTFBI 0:4edb816d21e1 232 /* move received packet into a new pbuf */
ICTFBI 0:4edb816d21e1 233 p = low_level_input(netif);
ICTFBI 0:4edb816d21e1 234 /* no packet could be read, silently ignore this */
ICTFBI 0:4edb816d21e1 235 if (p == NULL) return;
ICTFBI 0:4edb816d21e1 236 /* points to packet payload, which starts with an Ethernet header */
ICTFBI 0:4edb816d21e1 237 ethhdr = p->payload;
ICTFBI 0:4edb816d21e1 238
ICTFBI 0:4edb816d21e1 239 switch (htons(ethhdr->type)) {
ICTFBI 0:4edb816d21e1 240 /* IP or ARP packet? */
ICTFBI 0:4edb816d21e1 241 case ETHTYPE_IP:
ICTFBI 0:4edb816d21e1 242 case ETHTYPE_ARP:
ICTFBI 0:4edb816d21e1 243 #if PPPOE_SUPPORT
ICTFBI 0:4edb816d21e1 244 /* PPPoE packet? */
ICTFBI 0:4edb816d21e1 245 case ETHTYPE_PPPOEDISC:
ICTFBI 0:4edb816d21e1 246 case ETHTYPE_PPPOE:
ICTFBI 0:4edb816d21e1 247 #endif /* PPPOE_SUPPORT */
ICTFBI 0:4edb816d21e1 248 /* full packet send to tcpip_thread to process */
ICTFBI 0:4edb816d21e1 249 if (netif->input(p, netif)!=ERR_OK)
ICTFBI 0:4edb816d21e1 250 { LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
ICTFBI 0:4edb816d21e1 251 pbuf_free(p);
ICTFBI 0:4edb816d21e1 252 p = NULL;
ICTFBI 0:4edb816d21e1 253 }
ICTFBI 0:4edb816d21e1 254 break;
ICTFBI 0:4edb816d21e1 255
ICTFBI 0:4edb816d21e1 256 default:
ICTFBI 0:4edb816d21e1 257 pbuf_free(p);
ICTFBI 0:4edb816d21e1 258 p = NULL;
ICTFBI 0:4edb816d21e1 259 break;
ICTFBI 0:4edb816d21e1 260 }
ICTFBI 0:4edb816d21e1 261 }
ICTFBI 0:4edb816d21e1 262
ICTFBI 0:4edb816d21e1 263 /**
ICTFBI 0:4edb816d21e1 264 * Should be called at the beginning of the program to set up the
ICTFBI 0:4edb816d21e1 265 * network interface. It calls the function low_level_init() to do the
ICTFBI 0:4edb816d21e1 266 * actual setup of the hardware.
ICTFBI 0:4edb816d21e1 267 *
ICTFBI 0:4edb816d21e1 268 * This function should be passed as a parameter to netif_add().
ICTFBI 0:4edb816d21e1 269 *
ICTFBI 0:4edb816d21e1 270 * @param netif the lwip network interface structure for this ethernetif
ICTFBI 0:4edb816d21e1 271 * @return ERR_OK if the loopif is initialized
ICTFBI 0:4edb816d21e1 272 * ERR_MEM if private data couldn't be allocated
ICTFBI 0:4edb816d21e1 273 * any other err_t on error
ICTFBI 0:4edb816d21e1 274 */
ICTFBI 0:4edb816d21e1 275 err_t
ICTFBI 0:4edb816d21e1 276 ethernetif_init(struct netif *netif)
ICTFBI 0:4edb816d21e1 277 {
ICTFBI 0:4edb816d21e1 278 struct ethernetif *ethernetif;
ICTFBI 0:4edb816d21e1 279
ICTFBI 0:4edb816d21e1 280 LWIP_ASSERT("netif != NULL", (netif != NULL));
ICTFBI 0:4edb816d21e1 281
ICTFBI 0:4edb816d21e1 282 ethernetif = mem_malloc(sizeof(struct ethernetif));
ICTFBI 0:4edb816d21e1 283 if (ethernetif == NULL) {
ICTFBI 0:4edb816d21e1 284 LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_init: out of memory\n"));
ICTFBI 0:4edb816d21e1 285 return ERR_MEM;
ICTFBI 0:4edb816d21e1 286 }
ICTFBI 0:4edb816d21e1 287
ICTFBI 0:4edb816d21e1 288 #if LWIP_NETIF_HOSTNAME
ICTFBI 0:4edb816d21e1 289 /* Initialize interface hostname */
ICTFBI 0:4edb816d21e1 290 netif->hostname = "lwip";
ICTFBI 0:4edb816d21e1 291 #endif /* LWIP_NETIF_HOSTNAME */
ICTFBI 0:4edb816d21e1 292
ICTFBI 0:4edb816d21e1 293 /*
ICTFBI 0:4edb816d21e1 294 * Initialize the snmp variables and counters inside the struct netif.
ICTFBI 0:4edb816d21e1 295 * The last argument should be replaced with your link speed, in units
ICTFBI 0:4edb816d21e1 296 * of bits per second.
ICTFBI 0:4edb816d21e1 297 */
ICTFBI 0:4edb816d21e1 298 NETIF_INIT_SNMP(netif, snmp_ifType_ethernet_csmacd, LINK_SPEED_OF_YOUR_NETIF_IN_BPS);
ICTFBI 0:4edb816d21e1 299
ICTFBI 0:4edb816d21e1 300 netif->state = ethernetif;
ICTFBI 0:4edb816d21e1 301 netif->name[0] = IFNAME0;
ICTFBI 0:4edb816d21e1 302 netif->name[1] = IFNAME1;
ICTFBI 0:4edb816d21e1 303 /* We directly use etharp_output() here to save a function call.
ICTFBI 0:4edb816d21e1 304 * You can instead declare your own function an call etharp_output()
ICTFBI 0:4edb816d21e1 305 * from it if you have to do some checks before sending (e.g. if link
ICTFBI 0:4edb816d21e1 306 * is available...) */
ICTFBI 0:4edb816d21e1 307 netif->output = etharp_output;
ICTFBI 0:4edb816d21e1 308 netif->linkoutput = low_level_output;
ICTFBI 0:4edb816d21e1 309
ICTFBI 0:4edb816d21e1 310 ethernetif->ethaddr = (struct eth_addr *)&(netif->hwaddr[0]);
ICTFBI 0:4edb816d21e1 311
ICTFBI 0:4edb816d21e1 312 /* initialize the hardware */
ICTFBI 0:4edb816d21e1 313 low_level_init(netif);
ICTFBI 0:4edb816d21e1 314
ICTFBI 0:4edb816d21e1 315 return ERR_OK;
ICTFBI 0:4edb816d21e1 316 }
ICTFBI 0:4edb816d21e1 317
ICTFBI 0:4edb816d21e1 318 #endif /* 0 */