remove obsolete wait function
=> IRQ handler uses directly the LwIP stacks
This commit is contained in:
parent
a26f88c940
commit
253ec92ca0
2 changed files with 4 additions and 56 deletions
|
@ -110,8 +110,7 @@ static err_t rtl8139if_output(struct netif* netif, struct pbuf* p)
|
|||
return ERR_OK;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void rtl8139if_input(struct netif* netif, struct pbuf* p)
|
||||
static void rtl8139if_input(struct netif* netif, struct pbuf* p)
|
||||
{
|
||||
struct eth_hdr *ethhdr;
|
||||
|
||||
|
@ -138,7 +137,6 @@ void rtl8139if_input(struct netif* netif, struct pbuf* p)
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void rtl_rx_inthandler(struct netif* netif)
|
||||
{
|
||||
|
@ -175,8 +173,7 @@ static void rtl_rx_inthandler(struct netif* netif)
|
|||
#if ETH_PAD_SIZE
|
||||
pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */
|
||||
#endif
|
||||
mailbox_ptr_post(&rtl8139if->mbox, (void*)p);
|
||||
//rtl8139if_input(netif, p);
|
||||
rtl8139if_input(netif, p);
|
||||
LINK_STATS_INC(link.recv);
|
||||
} else {
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("rtl8139if_rx_inthandler: not enough memory!\n"));
|
||||
|
@ -268,46 +265,6 @@ static void rtl8139if_handler(struct state* s)
|
|||
}
|
||||
}
|
||||
|
||||
err_t rtl8139if_wait(struct netif* netif, uint32_t poll)
|
||||
{
|
||||
rtl1839if_t* rtl8139if = netif->state;
|
||||
struct eth_hdr *ethhdr;
|
||||
struct pbuf *p = NULL;
|
||||
err_t err = ERR_OK;
|
||||
|
||||
if (poll) {
|
||||
if (mailbox_ptr_tryfetch(&(rtl8139if->mbox), (void**) &p))
|
||||
return err;
|
||||
} else {
|
||||
mailbox_ptr_fetch(&(rtl8139if->mbox), (void**) &p);
|
||||
}
|
||||
|
||||
/* points to packet payload, which starts with an Ethernet header */
|
||||
ethhdr = p->payload;
|
||||
|
||||
switch (htons(ethhdr->type)) {
|
||||
/* IP or ARP packet? */
|
||||
case ETHTYPE_ARP:
|
||||
case ETHTYPE_IP:
|
||||
#if PPPOE_SUPPORT
|
||||
/* PPPoE packet? */
|
||||
case ETHTYPE_PPPOEDISC:
|
||||
case ETHTYPE_PPPOE:
|
||||
#endif /* PPPOE_SUPPORT */
|
||||
/* full packet send to tcpip_thread to process */
|
||||
if ((err = mynetif->input(p, mynetif)) != ERR_OK) {
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("rtl8139if_poll: IP input error\n"));
|
||||
pbuf_free(p);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
pbuf_free(p);
|
||||
break;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
err_t rtl8139if_init(struct netif* netif)
|
||||
{
|
||||
rtl1839if_t* rtl8139if;
|
||||
|
@ -348,7 +305,6 @@ err_t rtl8139if_init(struct netif* netif)
|
|||
rtl8139if->tx_buffer[2] = rtl8139if->tx_buffer[1] + 4096;
|
||||
rtl8139if->tx_buffer[3] = rtl8139if->tx_buffer[2] + 4096;
|
||||
|
||||
mailbox_ptr_init(&rtl8139if->mbox);
|
||||
netif->state = rtl8139if;
|
||||
mynetif = netif;
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
#define __HAVE_RTL8139_H__
|
||||
|
||||
#include <metalsvm/stddef.h>
|
||||
#include <metalsvm/mailbox.h>
|
||||
#include <metalsvm/spinlock.h>
|
||||
|
||||
#if defined(CONFIG_LWIP) && defined(CONFIG_PCI)
|
||||
|
||||
// the registers are at the following places
|
||||
|
@ -226,17 +227,8 @@ typedef struct rtl1839if {
|
|||
uint32_t tx_complete;
|
||||
uint16_t rx_pos;
|
||||
uint8_t tx_inuse[4];
|
||||
mailbox_ptr_t mbox;
|
||||
} rtl1839if_t;
|
||||
|
||||
/*
|
||||
* Wait for incoming messages.
|
||||
*
|
||||
* poll = 0 : wait blocks until a message is received
|
||||
* poll != 0: non-blocking wait
|
||||
*/
|
||||
err_t rtl8139if_wait(struct netif* netif, uint32_t poll);
|
||||
|
||||
/*
|
||||
* Initialize the network driver for the RealTek RTL8139 family
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue