Costmetic clean-up

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2799 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2010-07-14 17:09:45 +00:00
parent 0fe1703ff4
commit 0ddd63d169
6 changed files with 22 additions and 9 deletions
+5 -2
View File
@@ -222,14 +222,17 @@ FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev,
irqstate_t flags; irqstate_t flags;
nllvdbg("addr: %08x dev: %p\n", *addr, dev); nllvdbg("addr: %08x dev: %p\n", *addr, dev);
#if CONFIG_PREALLOC_IGMPGROUPS > 0
if (up_interrupt_context()) if (up_interrupt_context())
{ {
#if CONFIG_PREALLOC_IGMPGROUPS > 0
grplldbg("Use a pre-allocated group entry\n"); grplldbg("Use a pre-allocated group entry\n");
group = uip_grpprealloc(); group = uip_grpprealloc();
#else
grplldbg("Cannot allocate from interrupt handler\n");
group = NULL;
#endif
} }
else else
#endif
{ {
grplldbg("Allocate from the heap\n"); grplldbg("Allocate from the heap\n");
group = uip_grpheapalloc(); group = uip_grpheapalloc();
+6 -1
View File
@@ -142,6 +142,11 @@ void uip_igmpinput(struct uip_driver_s *dev)
destipaddr = uip_ip4addr_conv(IGMPBUF->destipaddr); destipaddr = uip_ip4addr_conv(IGMPBUF->destipaddr);
group = uip_grpallocfind(dev, &destipaddr); group = uip_grpallocfind(dev, &destipaddr);
if (!group)
{
nlldbg("Failed to allocate/find group: %08x\n", destipaddr);
return;
}
/* Now handle the message based on the IGMP message type */ /* Now handle the message based on the IGMP message type */
@@ -210,7 +215,7 @@ void uip_igmpinput(struct uip_driver_s *dev)
} }
} }
} }
else /* if (group->grpaddr != 0) */ else /* if (IGMPBUF->grpaddr != 0) */
{ {
nllvdbg("Group-specific multicast queury\n"); nllvdbg("Group-specific multicast queury\n");
+3
View File
@@ -151,6 +151,9 @@ int igmp_joingroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr)
uip_addmcastmac(dev, (FAR uip_ipaddr_t *)&grpaddr->s_addr); uip_addmcastmac(dev, (FAR uip_ipaddr_t *)&grpaddr->s_addr);
return OK; return OK;
} }
/* Return EEXIST if the address is already a member of the group */
return -EEXIST; return -EEXIST;
} }
+2
View File
@@ -173,6 +173,8 @@ int igmp_leavegroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr)
return OK; return OK;
} }
/* Return ENOENT if the address is not a member of the group */
nvdbg("Return -ENOENT\n"); nvdbg("Return -ENOENT\n");
return -ENOENT; return -ENOENT;
} }
+4 -4
View File
@@ -162,14 +162,14 @@ void uip_igmpsend(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group,
/* Set up the IGMP message */ /* Set up the IGMP message */
IGMPBUF->type = group->msgid; IGMPBUF->type = group->msgid;
IGMPBUF->maxresp = 0; IGMPBUF->maxresp = 0;
uiphdr_ipaddr_copy(IGMPBUF->grpaddr, &group->grpaddr); uiphdr_ipaddr_copy(IGMPBUF->grpaddr, &group->grpaddr);
/* Calculate the IGMP checksum. */ /* Calculate the IGMP checksum. */
IGMPBUF->chksum = 0; IGMPBUF->chksum = 0;
IGMPBUF->chksum = ~uip_igmpchksum(&IGMPBUF->type, UIP_IPIGMPH_LEN); IGMPBUF->chksum = ~uip_igmpchksum(&IGMPBUF->type, UIP_IPIGMPH_LEN);
IGMP_STATINCR(uip_stats.igmp.poll_send); IGMP_STATINCR(uip_stats.igmp.poll_send);
IGMP_STATINCR(uip_stats.ip.sent); IGMP_STATINCR(uip_stats.ip.sent);
+2 -2
View File
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* net/uip/uip_igmpleave.c * net/uip/uip_igmptimer.c
* *
* Copyright (C) 2010 Gregory Nutt. All rights reserved. * Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -170,8 +170,8 @@ int uip_decisec2tick(int decisecs)
*/ */
return CLK_TCK * decisecs / 10; return CLK_TCK * decisecs / 10;
} }
/**************************************************************************** /****************************************************************************
* Name: uip_igmpstartticks and uip_igmpstarttimer * Name: uip_igmpstartticks and uip_igmpstarttimer
* *