MityDSP Documentation Index
Classes | Macros | Functions
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"

Classes

struct  Eth_Hdr802_1q
struct  tsNetIface

Macros

#define IEEE802_1Q_TPID   0x0081
#define SUPPORT_VLAN_TAGGING   1

Functions

err_t net_iface_init (struct netif *netif)
void net_iface_set_defaults (tsNetIface *apNetIface, tcNetDrvr *apNetDrvr)
void net_iface_copy_pbuff (tsNetIface *apNetIfaceDst, tsNetIface *apNetIfaceSrc)
void net_iface_rx_cb (void *apBuffer, int anLen, void *apUser, bool abInIsr)
void * net_iface_buf_alloc (int anLen, void *apUser)

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


Macro Definition 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]apNetifPointer to the netif structure for the interface being initialized.
Returns:
Zero upon success, -1 for failure
void net_iface_set_defaults ( tsNetIface apNetIface,
tcNetDrvr apNetDrvr 
)

This function provides defaults for the tsNetIface structure.

Parameters:
[in]apNetIfacePointer to the tsNetIface structure to set to default values.
[in]apNetDrvrPointer to the network driver to associate with the provided tsNetIface.
Returns:
None.
void net_iface_copy_pbuff ( tsNetIface apNetIfaceDst,
tsNetIface apNetIfaceSrc 
)
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]apBufferPointer to the received packet.
[in]anLenThe length of the received packet.
[in]apUserPointer to the netif structure.
[in]abInIsrTrue 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]anLenThe length of the buffer to allocate.
[in]apUserPointer to the netif structure.
Returns:
Payload area of an allocated pbuf.

  
Generated on Mon Apr 22 2013 11:33:32 for MityDSP Net by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.