mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-18 01:58:56 +00:00
V1.0.6
This commit is contained in:
@@ -106,6 +106,9 @@ static char eth_tx_thread_stack[RT_LWIP_ETHTHREAD_STACKSIZE];
|
||||
#ifndef LWIP_NO_RX_THREAD
|
||||
static struct rt_mailbox eth_rx_thread_mb;
|
||||
static struct rt_thread eth_rx_thread;
|
||||
#ifdef AIC_WLAN_ASR
|
||||
static int eth_tx_result = 0;
|
||||
#endif
|
||||
#ifndef RT_LWIP_ETHTHREAD_MBOX_SIZE
|
||||
static char eth_rx_thread_mb_pool[48 * sizeof(rt_ubase_t)];
|
||||
static char eth_rx_thread_stack[1024];
|
||||
@@ -440,11 +443,23 @@ static err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p)
|
||||
msg.netif = netif;
|
||||
msg.buf = p;
|
||||
rt_completion_init(&msg.ack);
|
||||
if (rt_mb_send(ð_tx_thread_mb, (rt_ubase_t) &msg) == RT_EOK)
|
||||
#ifdef AIC_WLAN_ASR
|
||||
int ret = rt_mb_send(ð_tx_thread_mb, (rt_ubase_t) &msg);
|
||||
if (ret == RT_EOK)
|
||||
{
|
||||
/* waiting for ack */
|
||||
rt_completion_wait(&msg.ack, RT_WAITING_FOREVER);
|
||||
return eth_tx_result;
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
if (rt_mb_send(ð_tx_thread_mb, (rt_ubase_t) &msg) == RT_EOK)
|
||||
{
|
||||
/* waiting for ack */
|
||||
rt_completion_wait(&msg.ack, RT_WAITING_FOREVER);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
struct eth_device* enetif;
|
||||
|
||||
@@ -706,14 +721,25 @@ static void eth_tx_thread_entry(void* parameter)
|
||||
RT_ASSERT(msg->netif != RT_NULL);
|
||||
RT_ASSERT(msg->buf != RT_NULL);
|
||||
|
||||
#ifdef AIC_WLAN_ASR
|
||||
eth_tx_result = ERR_MEM;
|
||||
#endif
|
||||
enetif = (struct eth_device*)msg->netif->state;
|
||||
if (enetif != RT_NULL)
|
||||
{
|
||||
/* call driver's interface */
|
||||
if (enetif->eth_tx(&(enetif->parent), msg->buf) != RT_EOK)
|
||||
#ifdef AIC_WLAN_ASR
|
||||
eth_tx_result = enetif->eth_tx(&(enetif->parent), msg->buf);
|
||||
if (eth_tx_result != RT_EOK)
|
||||
{
|
||||
/* transmit eth packet failed */
|
||||
}
|
||||
#else
|
||||
if (enetif->eth_tx(&(enetif->parent), msg->buf) != RT_EOK)
|
||||
{
|
||||
/* transmit eth packet failed */
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* send ACK */
|
||||
|
||||
@@ -383,12 +383,20 @@
|
||||
|
||||
/* TCP sender buffer space (pbufs). This must be at least = 2 *
|
||||
TCP_SND_BUF/TCP_MSS for things to work. */
|
||||
#ifdef AIC_WLAN_ASR
|
||||
#define TCP_SND_QUEUELEN (2 * TCP_SND_BUF/TCP_MSS)
|
||||
#else
|
||||
#define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS)
|
||||
#endif
|
||||
|
||||
/* TCP writable space (bytes). This must be less than or equal
|
||||
to TCP_SND_BUF. It is the amount of space which must be
|
||||
available in the tcp snd_buf for select to return writable */
|
||||
#ifdef AIC_WLAN_ASR
|
||||
#define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/7), (2*TCP_MSS)+1), (TCP_SND_BUF)-1)
|
||||
#else
|
||||
#define TCP_SNDLOWAT (TCP_SND_BUF/2)
|
||||
#endif
|
||||
#define TCP_SNDQUEUELOWAT TCP_SND_QUEUELEN/2
|
||||
|
||||
/* TCP receive window. */
|
||||
@@ -415,7 +423,11 @@
|
||||
#define TCPIP_THREAD_STACKSIZE 4096
|
||||
#endif
|
||||
#define TCPIP_THREAD_NAME "tcpip"
|
||||
#ifdef AIC_WLAN_ASR
|
||||
#define DEFAULT_TCP_RECVMBOX_SIZE 60
|
||||
#else
|
||||
#define DEFAULT_TCP_RECVMBOX_SIZE 10
|
||||
#endif
|
||||
|
||||
/* ---------- ARP options ---------- */
|
||||
#define LWIP_ARP 1
|
||||
|
||||
Reference in New Issue
Block a user