mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-08 00:23:39 +08:00
Replaced all tabs with two spaces (regardless of indentation is correct).
This commit is contained in:
@@ -166,7 +166,7 @@ etharp_tmr(void)
|
||||
}
|
||||
#endif
|
||||
} else if ((arp_table[i].state == ETHARP_STATE_PENDING) &&
|
||||
(arp_table[i].ctime >= ARP_MAXPENDING)) {
|
||||
(arp_table[i].ctime >= ARP_MAXPENDING)) {
|
||||
arp_table[i].state = ETHARP_STATE_EMPTY;
|
||||
DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired pending entry %u.\n", i));
|
||||
#if ARP_QUEUEING
|
||||
@@ -214,7 +214,7 @@ find_arp_entry(void)
|
||||
#endif
|
||||
(arp_table[i].ctime >= maxtime)) {
|
||||
maxtime = arp_table[i].ctime;
|
||||
j = i;
|
||||
j = i;
|
||||
}
|
||||
}
|
||||
if (j != ARP_TABLE_SIZE) {
|
||||
|
||||
@@ -63,7 +63,7 @@ static const struct eth_addr ethbroadcast = {{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);
|
||||
struct ip_addr *ipaddr);
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static void
|
||||
@@ -179,7 +179,7 @@ low_level_input(struct ethernetif *ethernetif)
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static err_t
|
||||
ethernetif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr)
|
||||
struct ip_addr *ipaddr)
|
||||
{
|
||||
struct ethernetif *ethernetif;
|
||||
struct pbuf *q;
|
||||
@@ -306,8 +306,8 @@ ethernetif_input(struct netif *netif)
|
||||
case ETHTYPE_ARP:
|
||||
p = arp_arp_input(netif, ethernetif->ethaddr, p);
|
||||
if (p != NULL) {
|
||||
low_level_output(ethernetif, p);
|
||||
pbuf_free(p);
|
||||
low_level_output(ethernetif, p);
|
||||
pbuf_free(p);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static err_t
|
||||
loopif_output(struct netif *netif, struct pbuf *p,
|
||||
struct ip_addr *ipaddr)
|
||||
struct ip_addr *ipaddr)
|
||||
{
|
||||
struct pbuf *q, *r;
|
||||
char *ptr;
|
||||
|
||||
@@ -71,16 +71,16 @@ slipif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr)
|
||||
c = ((u8_t *)q->payload)[i];
|
||||
switch (c) {
|
||||
case SLIP_END:
|
||||
sio_send(SLIP_ESC, netif->state);
|
||||
sio_send(SLIP_ESC_END, netif->state);
|
||||
break;
|
||||
sio_send(SLIP_ESC, netif->state);
|
||||
sio_send(SLIP_ESC_END, netif->state);
|
||||
break;
|
||||
case SLIP_ESC:
|
||||
sio_send(SLIP_ESC, netif->state);
|
||||
sio_send(SLIP_ESC_ESC, netif->state);
|
||||
break;
|
||||
sio_send(SLIP_ESC, netif->state);
|
||||
sio_send(SLIP_ESC_ESC, netif->state);
|
||||
break;
|
||||
default:
|
||||
sio_send(c, netif->state);
|
||||
break;
|
||||
sio_send(c, netif->state);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,15 +112,15 @@ slipif_input( struct netif * netif )
|
||||
switch (c) {
|
||||
case SLIP_END:
|
||||
if (recved > 0) {
|
||||
/* Received whole packet. */
|
||||
pbuf_realloc(q, recved);
|
||||
|
||||
/* Received whole packet. */
|
||||
pbuf_realloc(q, recved);
|
||||
|
||||
#ifdef LINK_STATS
|
||||
++lwip_stats.link.recv;
|
||||
++lwip_stats.link.recv;
|
||||
#endif /* LINK_STATS */
|
||||
|
||||
DEBUGF(SLIP_DEBUG, ("slipif: Got packet\n"));
|
||||
return q;
|
||||
|
||||
DEBUGF(SLIP_DEBUG, ("slipif: Got packet\n"));
|
||||
return q;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -128,40 +128,40 @@ slipif_input( struct netif * netif )
|
||||
c = sio_recv(netif->state);
|
||||
switch (c) {
|
||||
case SLIP_ESC_END:
|
||||
c = SLIP_END;
|
||||
break;
|
||||
c = SLIP_END;
|
||||
break;
|
||||
case SLIP_ESC_ESC:
|
||||
c = SLIP_ESC;
|
||||
break;
|
||||
c = SLIP_ESC;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
if (p == NULL) {
|
||||
DEBUGF(SLIP_DEBUG, ("slipif_input: alloc\n"));
|
||||
p = pbuf_alloc(PBUF_LINK, PBUF_POOL_BUFSIZE, PBUF_POOL);
|
||||
DEBUGF(SLIP_DEBUG, ("slipif_input: alloc\n"));
|
||||
p = pbuf_alloc(PBUF_LINK, PBUF_POOL_BUFSIZE, PBUF_POOL);
|
||||
|
||||
#ifdef LINK_STATS
|
||||
if (p == NULL) {
|
||||
++lwip_stats.link.drop;
|
||||
DEBUGF(SLIP_DEBUG, ("slipif_input: no new pbuf! (DROP)\n"));
|
||||
}
|
||||
if (p == NULL) {
|
||||
++lwip_stats.link.drop;
|
||||
DEBUGF(SLIP_DEBUG, ("slipif_input: no new pbuf! (DROP)\n"));
|
||||
}
|
||||
#endif /* LINK_STATS */
|
||||
|
||||
if (q != NULL) {
|
||||
pbuf_chain(q, p);
|
||||
} else {
|
||||
q = p;
|
||||
}
|
||||
|
||||
if (q != NULL) {
|
||||
pbuf_chain(q, p);
|
||||
} else {
|
||||
q = p;
|
||||
}
|
||||
}
|
||||
if (p != NULL && recved < MAX_SIZE) {
|
||||
((u8_t *)p->payload)[i] = c;
|
||||
recved++;
|
||||
i++;
|
||||
if (i >= p->len) {
|
||||
i = 0;
|
||||
p = NULL;
|
||||
}
|
||||
((u8_t *)p->payload)[i] = c;
|
||||
recved++;
|
||||
i++;
|
||||
if (i >= p->len) {
|
||||
i = 0;
|
||||
p = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -196,13 +196,13 @@ slipif_loop(void *nf)
|
||||
err_t
|
||||
slipif_init(struct netif *netif)
|
||||
{
|
||||
|
||||
|
||||
DEBUGF(SLIP_DEBUG, ("slipif_init: netif->num=%x\n", (int)netif->num));
|
||||
|
||||
netif->name[0] = 's';
|
||||
netif->name[1] = 'l';
|
||||
netif->output = slipif_output;
|
||||
netif->mtu = 1500;
|
||||
netif->mtu = 1500;
|
||||
|
||||
netif->state = sio_open(netif->num);
|
||||
if (!netif->state)
|
||||
|
||||
Reference in New Issue
Block a user