e:/hudson/workspace/MityDSP MDK Release/trunk/sw/inc/net/net_iface.h File Reference
This is the header file for the net_iface functions, which sit between the MityDSP network drivers and the lwIP stack.
More...
#include <std.h>
#include <buf.h>
#include <lck.h>
#include <mbx.h>
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/pbuf.h"
#include "lwip/sys.h"
#include "lwip/stats.h"
#include "netif/etharp.h"
Detailed Description
This is the header file for the net_iface functions, which sit between the MityDSP network drivers and the lwIP stack.
o 0 | / Copyright (c) 2005-2007 (CL)---o Critical Link, LLC \ O
Define Documentation
#define IEEE802_1Q_TPID 0x0081 |
#define SUPPORT_VLAN_TAGGING 1 |
Function Documentation
err_t net_iface_init |
( |
struct netif * |
apNetif |
) |
|
This function should be registered as the lwIP network interface (netif) initialization function. When activated, it sets up the interface, starts the receiver thread, and initializes the network hardware.
- Parameters:
-
[in] | apNetif | Pointer to the netif structure for the interface being initialized. |
- Returns:
- Zero upon success, -1 for failure
This function provides defaults for the tsNetIface structure.
- Parameters:
-
[in] | apNetIface | Pointer to the tsNetIface structure to set to default values. |
[in] | apNetDrvr | Pointer to the network driver to associate with the provided tsNetIface. |
- Returns:
- None.
void net_iface_rx_cb |
( |
void * |
apBuffer, |
|
|
int |
anLen, |
|
|
void * |
apUser, |
|
|
bool |
abInIsr | |
|
) |
| | |
This function is registered as the receive packet callback for the network driver by the "open" call in net_iface_init. When activated, it posts the pointer to the received data to the net_iface_rx_thread.
- Parameters:
-
[in] | apBuffer | Pointer to the received packet. |
[in] | anLen | The length of the received packet. |
[in] | apUser | Pointer to the netif structure. |
[in] | abInIsr | True if called from ISR (not used). |
- Returns:
- None.
void* net_iface_buf_alloc |
( |
int |
anLen, |
|
|
void * |
apUser | |
|
) |
| | |
This function is registered as the buffer allocation callback for the network driver by the "open" call in net_iface_init. When activated, it provides a valid location where the next packet is to be written.
- Note:
- The pbuf size must be set greater or equal to the max packet size in lwipopts.h.
- Parameters:
-
[in] | anLen | The length of the buffer to allocate. |
[in] | apUser | Pointer to the netif structure. |
- Returns:
- Payload area of an allocated pbuf.