Merge branch 'master' into ohligs

This commit is contained in:
Marian Ohligs 2011-09-01 22:48:25 +02:00
commit f6e1118cc9
5 changed files with 69 additions and 11 deletions

View file

@ -283,7 +283,4 @@ leave_handler:
// timer interrupt?
if ((s->int_no == 32) || (s->int_no == 123))
scheduler(); // switch to a new task
// exists a new (driver) task with a higher priority?
else if ((s->int_no >= 32) && (get_highest_priority(CORE_ID) > per_core(current_task)->prio))
scheduler();
}

View file

@ -39,6 +39,7 @@
#include <lwip/sys.h>
#include <lwip/stats.h>
#include <lwip/netif.h>
#include <lwip/tcpip.h>
#include <netif/etharp.h>
#include <net/rckemac.h>
@ -755,12 +756,14 @@ err_t rckemacif_init(struct netif* netif)
/* maximum transfer unit */
netif->mtu = 1500;
/* broadcast capability */
netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP;
netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP;
/* hardware address length */
netif->hwaddr_len = 6;
rckemacif->ethaddr = (struct eth_addr *)netif->hwaddr;
tcpip_callback(netif_set_link_up, netif);
return ERR_OK;
}
#endif

View file

@ -32,6 +32,7 @@
#include <lwip/sys.h>
#include <lwip/stats.h>
#include <lwip/netif.h>
#include <lwip/tcpip.h>
#include <netif/etharp.h>
#include <net/rtl8139.h>
@ -440,12 +441,14 @@ err_t rtl8139if_init(struct netif* netif)
/* maximum transfer unit */
netif->mtu = 1500;
/* broadcast capability */
netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP;
netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP;
/* hardware address length */
netif->hwaddr_len = 6;
rtl8139if->ethaddr = (struct eth_addr *)netif->hwaddr;
tcpip_callback(netif_set_link_up, netif);
return ERR_OK;
}
#endif

View file

@ -83,10 +83,11 @@ void sys_msleep(u32_t ms)
sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg,
int stacksize, int prio)
{
int err;
sys_thread_t tmp;
create_kernel_task(&tmp, thread, arg, prio);
kprintf("Created LWIP task %s with id %u\n", name, tmp);
err = create_kernel_task(&tmp, thread, arg, prio);
LWIP_DEBUGF(SYS_DEBUG, ("sys_thread_new: create_kernel_task %d, id = %u", err, tmp));
return tmp;
}
@ -166,6 +167,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t * mbox, void **msg, u32_t timeout)
int err;
err = mailbox_ptr_fetch(&mbox->mailbox, msg, timeout);
LWIP_DEBUGF(SYS_DEBUG, ("sys_arch_mbox_fetch: %d\n", err));
if (!err)
return 0;
@ -186,7 +188,7 @@ void sys_mbox_free(sys_mbox_t* mbox)
*/
u32_t sys_arch_mbox_tryfetch(sys_mbox_t* mbox, void** msg)
{
mailbox_ptr_tryfetch(&mbox->mailbox, msg);
return mailbox_ptr_tryfetch(&mbox->mailbox, msg);
}
/* sys_mbox_new(): create a new mailbox with a minimum size of "size"
@ -207,14 +209,14 @@ void sys_mbox_set_invalid(sys_mbox_t* mbox)
}
/* sys_mbox_trypost(): try to post data to the mailbox
* Note: There is at the moment no try post implemented
* so we use the normal post instead
*
*/
err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg)
{
int err;
err = mailbox_ptr_trypost(&mbox->mailbox, msg);
LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_trypost: %d"\n, err));
return err;
}

View file

@ -62,7 +62,7 @@
/**
* TCP_SND_BUF: TCP sender buffer space (bytes).
*/
#define TCP_SND_BUF 2048
#define TCP_SND_BUF (16*1024)
/**
* LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only)
@ -118,6 +118,59 @@
*/
#define DEFAULT_THREAD_PRIO NORMAL_PRIO
/**
* TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default,
* you might want to increase this.)
* For the receive side, this MSS is advertised to the remote side
* when opening a connection. For the transmit size, this MSS sets
* an upper limit on the MSS advertised by the remote host.
*/
#define TCP_MSS 2048
/**
* PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
*/
#define PBUF_POOL_SIZE 0x80
/**
* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
* per active UDP "connection".
* (requires the LWIP_UDP option)
*/
#define MEMP_NUM_UDP_PCB 0x30
/**
* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
* (requires the LWIP_TCP option)
*/
#define MEMP_NUM_TCP_PCB 0x30
/**
* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
* (requires the LWIP_TCP option)
*/
#define MEMP_NUM_TCP_PCB_LISTEN 0x30
/**
* MEM_SIZE: the size of the heap memory. If the application will send
* a lot of data that needs to be copied, this should be set high.
*/
#define MEM_SIZE (4*0x100000)
/**
* MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
* for callback/timeout API communication.
* (only needed if you use tcpip.c)
*/
#define MEMP_NUM_TCPIP_MSG_API 0x40
/**
* MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
* for incoming packets.
* (only needed if you use tcpip.c)
*/
#define MEMP_NUM_TCPIP_MSG_INPKT 0x40
/* DEBUG options */
#define LWIP_DEBUG 1
#define DHCP_DEBUG LWIP_DBG_OFF