mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-07-07 20:29:04 +00:00
set netif->output to etharp_output by default to save a function call & removed all the xxx_output() functions that directly called etharp_output().
This commit is contained in:
parent
58dcaae372
commit
dac9674c0d
@ -76,7 +76,6 @@ void cs8900if_reset(struct netif *netif);
|
||||
err_t cs8900if_init(struct netif *);
|
||||
void cs8900if_service(struct netif *);
|
||||
void cs8900if_input(struct netif *netif);
|
||||
err_t cs8900if_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr);
|
||||
|
||||
void cs8900_send_debug(u8_t *p, u16_t len);
|
||||
|
||||
|
@ -410,21 +410,6 @@ low_level_output(struct netif *netif, struct pbuf *p)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*
|
||||
* This function is called by the TCP/IP stack when an IP packet
|
||||
* should be sent. It calls the function called low_level_output() to
|
||||
* do the actuall transmission of the packet.
|
||||
*
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static err_t
|
||||
mcf5272fecif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr)
|
||||
{
|
||||
return etharp_output(netif, ipaddr, p);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static void
|
||||
eth_input(struct pbuf *p, struct netif *netif)
|
||||
@ -770,7 +755,7 @@ mcf5272fecif_init(struct netif *netif)
|
||||
mcf5272if->netif = netif;
|
||||
netif->name[0] = IFNAME0;
|
||||
netif->name[1] = IFNAME1;
|
||||
netif->output = mcf5272fecif_output;
|
||||
netif->output = etharp_output;
|
||||
netif->linkoutput = low_level_output;
|
||||
netif->mtu = MTU_FEC - 18; // mtu without ethernet header and crc
|
||||
mcf5272if->ethaddr = (struct eth_addr *)&(netif->hwaddr[0]);
|
||||
|
@ -88,8 +88,6 @@ static struct eth_addr broadcastaddr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
/* Forward declarations. */
|
||||
static void ethernetif_input(struct netif *netif);
|
||||
static err_t ethernetif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr);
|
||||
|
||||
static struct netif *pktif_netif;
|
||||
|
||||
@ -223,22 +221,7 @@ low_level_input(struct netif *netif)
|
||||
|
||||
return p;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*
|
||||
* ethernetif_output():
|
||||
*
|
||||
* This function is called by the TCP/IP stack when an IP packet
|
||||
* should be sent. It calls the function called low_level_output() to
|
||||
* do the actuall transmission of the packet.
|
||||
*
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static err_t
|
||||
ethernetif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr)
|
||||
{
|
||||
return etharp_output(netif, ipaddr, p);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*
|
||||
* ethernetif_input():
|
||||
@ -309,7 +292,7 @@ ethernetif_init(struct netif *netif)
|
||||
netif->name[0] = IFNAME0;
|
||||
netif->name[1] = IFNAME1;
|
||||
netif->linkoutput = low_level_output;
|
||||
netif->output = ethernetif_output;
|
||||
netif->output = etharp_output;
|
||||
|
||||
netif->mtu = 1500;
|
||||
netif->flags = NETIF_FLAG_BROADCAST;
|
||||
|
@ -31,7 +31,6 @@ err_t ne2k_init(struct netif *netif);
|
||||
static void low_level_init(struct netif * netif);
|
||||
static void arp_timer(void *arg);
|
||||
|
||||
static err_t ne2k_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr);
|
||||
static err_t low_level_output(struct netif * netif,struct pbuf *p);
|
||||
u16_t write_AX88796(u8_t * buf, u16_t remote_Addr, u16_t Count);
|
||||
|
||||
|
@ -60,7 +60,7 @@ err_t ne2k_init(struct netif *netif)
|
||||
netif->state = ne2k_if;
|
||||
netif->name[0] = IFNAME0;
|
||||
netif->name[1] = IFNAME1;
|
||||
netif->output = ne2k_output;
|
||||
netif->output = etharp_output;
|
||||
netif->linkoutput = low_level_output;
|
||||
|
||||
ne2k_if->ethaddr = (struct eth_addr *)&(netif->hwaddr[0]);
|
||||
@ -179,22 +179,6 @@ static void low_level_init(struct netif * netif)
|
||||
****************************************************************************************
|
||||
----------------------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* ethernetif_output():
|
||||
*
|
||||
* This function is called by the TCP/IP stack when an IP packet
|
||||
* should be sent. It calls the function called low_level_output() to
|
||||
* do the actual transmission of the packet.
|
||||
*
|
||||
*/
|
||||
static err_t
|
||||
ne2k_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr)
|
||||
{
|
||||
/* resolve hardware address, then send (or queue) packet */
|
||||
return etharp_output(netif, ipaddr, p);
|
||||
}
|
||||
|
||||
/*
|
||||
* low_level_output():
|
||||
*
|
||||
|
@ -82,8 +82,6 @@ struct tapif {
|
||||
|
||||
/* Forward declarations. */
|
||||
static void tapif_input(struct netif *netif);
|
||||
static err_t tapif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr);
|
||||
|
||||
static void tapif_thread(void *data);
|
||||
|
||||
@ -264,22 +262,6 @@ tapif_thread(void *arg)
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*
|
||||
* tapif_output():
|
||||
*
|
||||
* This function is called by the TCP/IP stack when an IP packet
|
||||
* should be sent. It calls the function called low_level_output() to
|
||||
* do the actuall transmission of the packet.
|
||||
*
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static err_t
|
||||
tapif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr)
|
||||
{
|
||||
return etharp_output(netif, ipaddr, p);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*
|
||||
* tapif_input():
|
||||
*
|
||||
@ -359,7 +341,7 @@ tapif_init(struct netif *netif)
|
||||
netif->state = tapif;
|
||||
netif->name[0] = IFNAME0;
|
||||
netif->name[1] = IFNAME1;
|
||||
netif->output = tapif_output;
|
||||
netif->output = etharp_output;
|
||||
netif->linkoutput = low_level_output;
|
||||
netif->mtu = 1500;
|
||||
/* hardware address length */
|
||||
|
@ -81,8 +81,6 @@ static const struct eth_addr ethbroadcast = {{0xff,0xff,0xff,0xff,0xff,0xff}};
|
||||
|
||||
/* Forward declarations. */
|
||||
static void mintapif_input(struct netif *netif);
|
||||
static err_t mintapif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr);
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static void
|
||||
@ -233,22 +231,6 @@ low_level_input(struct netif *netif)
|
||||
return p;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*
|
||||
* mintapif_output():
|
||||
*
|
||||
* This function is called by the TCP/IP stack when an IP packet
|
||||
* should be sent. It calls the function called low_level_output() to
|
||||
* do the actuall transmission of the packet.
|
||||
*
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static err_t
|
||||
mintapif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr)
|
||||
{
|
||||
return etharp_output(netif, ipaddr, p);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*
|
||||
* mintapif_input():
|
||||
*
|
||||
@ -341,7 +323,7 @@ mintapif_init(struct netif *netif)
|
||||
netif->hwaddr_len = 6;
|
||||
netif->name[0] = IFNAME0;
|
||||
netif->name[1] = IFNAME1;
|
||||
netif->output = mintapif_output;
|
||||
netif->output = etharp_output;
|
||||
netif->linkoutput = low_level_output;
|
||||
netif->mtu = 1500;
|
||||
|
||||
|
@ -84,12 +84,6 @@
|
||||
static const struct eth_addr ethbroadcast = {{0xff,0xff,0xff,0xff,0xff,0xff}};
|
||||
extern XEmacIf_Config XEmacIf_ConfigTable[];
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Forward declarations */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static err_t xemacif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* low_level_init function */
|
||||
/* - hooks up the data structures and sets the mac options and mac */
|
||||
@ -289,22 +283,6 @@ static struct pbuf * low_level_input(XEmacIf_Config *xemacif_ptr)
|
||||
return p;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* xemacif_output(): */
|
||||
/* */
|
||||
/* This function is called by the TCP/IP stack when an IP packet */
|
||||
/* should be sent. It calls the function called low_level_output() to */
|
||||
/* do the actuall transmission of the packet. */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static err_t xemacif_output(struct netif *netif_ptr,
|
||||
struct pbuf *p,
|
||||
struct ip_addr *ipaddr)
|
||||
{
|
||||
XEmacIf_Config *xemacif_ptr = xemacif_ptr = netif_ptr->state;
|
||||
|
||||
return etharp_output(netif_ptr, ipaddr, p);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* xemacif_input(): */
|
||||
/* */
|
||||
@ -396,7 +374,7 @@ err_t xemacif_init(struct netif *netif_ptr)
|
||||
netif_ptr->hwaddr[5] = xemacif_ptr->ethaddr.addr[5];
|
||||
netif_ptr->name[0] = IFNAME0;
|
||||
netif_ptr->name[1] = IFNAME1;
|
||||
netif_ptr->output = xemacif_output;
|
||||
netif_ptr->output = etharp_output;
|
||||
netif_ptr->linkoutput = low_level_output;
|
||||
|
||||
/* removed this statement because the ethaddr in the XEmacIf_Config
|
||||
|
Loading…
Reference in New Issue
Block a user