63 |
static err_t ethernetif_output(struct netif *netif, struct pbuf *p, |
static err_t ethernetif_output(struct netif *netif, struct pbuf *p, |
64 |
struct ip_addr *ipaddr); |
struct ip_addr *ipaddr); |
65 |
|
|
66 |
/*-----------------------------------------------------------------------------------*/ |
|
67 |
static void |
static void |
68 |
low_level_init(struct netif *netif) |
low_level_init(struct netif *netif) |
69 |
{ |
{ |
87 |
|
|
88 |
/* Do whatever else is needed to initialize interface. */ |
/* Do whatever else is needed to initialize interface. */ |
89 |
} |
} |
90 |
/*-----------------------------------------------------------------------------------*/ |
|
91 |
/* |
/* |
92 |
* low_level_output(): |
* low_level_output(): |
93 |
* |
* |
96 |
* might be chained. |
* might be chained. |
97 |
* |
* |
98 |
*/ |
*/ |
99 |
/*-----------------------------------------------------------------------------------*/ |
|
100 |
|
|
101 |
static err_t |
static err_t |
102 |
low_level_output(struct ethernetif *ethernetif, struct pbuf *p) |
low_level_output(struct ethernetif *ethernetif, struct pbuf *p) |
120 |
|
|
121 |
return ERR_OK; |
return ERR_OK; |
122 |
} |
} |
123 |
/*-----------------------------------------------------------------------------------*/ |
|
124 |
/* |
/* |
125 |
* low_level_input(): |
* low_level_input(): |
126 |
* |
* |
128 |
* packet from the interface into the pbuf. |
* packet from the interface into the pbuf. |
129 |
* |
* |
130 |
*/ |
*/ |
131 |
/*-----------------------------------------------------------------------------------*/ |
|
132 |
static struct pbuf * |
static struct pbuf * |
133 |
low_level_input(struct ethernetif *ethernetif) |
low_level_input(struct ethernetif *ethernetif) |
134 |
{ |
{ |
165 |
|
|
166 |
return p; |
return p; |
167 |
} |
} |
168 |
/*-----------------------------------------------------------------------------------*/ |
|
169 |
/* |
/* |
170 |
* ethernetif_output(): |
* ethernetif_output(): |
171 |
* |
* |
174 |
* do the actuall transmission of the packet. |
* do the actuall transmission of the packet. |
175 |
* |
* |
176 |
*/ |
*/ |
177 |
/*-----------------------------------------------------------------------------------*/ |
|
178 |
static err_t |
static err_t |
179 |
ethernetif_output(struct netif *netif, struct pbuf *p, |
ethernetif_output(struct netif *netif, struct pbuf *p, |
180 |
struct ip_addr *ipaddr) |
struct ip_addr *ipaddr) |
264 |
return low_level_output(ethernetif, p); |
return low_level_output(ethernetif, p); |
265 |
|
|
266 |
} |
} |
267 |
/*-----------------------------------------------------------------------------------*/ |
|
268 |
/* |
/* |
269 |
* ethernetif_input(): |
* ethernetif_input(): |
270 |
* |
* |
274 |
* interface. |
* interface. |
275 |
* |
* |
276 |
*/ |
*/ |
277 |
/*-----------------------------------------------------------------------------------*/ |
|
278 |
static void |
static void |
279 |
ethernetif_input(struct netif *netif) |
ethernetif_input(struct netif *netif) |
280 |
{ |
{ |
314 |
} |
} |
315 |
} |
} |
316 |
} |
} |
317 |
/*-----------------------------------------------------------------------------------*/ |
|
318 |
static void |
static void |
319 |
arp_timer(void *arg) |
arp_timer(void *arg) |
320 |
{ |
{ |
321 |
arp_tmr(); |
arp_tmr(); |
322 |
sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); |
sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); |
323 |
} |
} |
324 |
/*-----------------------------------------------------------------------------------*/ |
|
325 |
/* |
/* |
326 |
* ethernetif_init(): |
* ethernetif_init(): |
327 |
* |
* |
330 |
* actual setup of the hardware. |
* actual setup of the hardware. |
331 |
* |
* |
332 |
*/ |
*/ |
333 |
/*-----------------------------------------------------------------------------------*/ |
|
334 |
void |
void |
335 |
ethernetif_init(struct netif *netif) |
ethernetif_init(struct netif *netif) |
336 |
{ |
{ |
350 |
|
|
351 |
sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); |
sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); |
352 |
} |
} |
353 |
/*-----------------------------------------------------------------------------------*/ |
|