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:
parent
0fe1703ff4
commit
0ddd63d169
@ -222,14 +222,17 @@ FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev,
|
||||
irqstate_t flags;
|
||||
|
||||
nllvdbg("addr: %08x dev: %p\n", *addr, dev);
|
||||
#if CONFIG_PREALLOC_IGMPGROUPS > 0
|
||||
if (up_interrupt_context())
|
||||
{
|
||||
#if CONFIG_PREALLOC_IGMPGROUPS > 0
|
||||
grplldbg("Use a pre-allocated group entry\n");
|
||||
group = uip_grpprealloc();
|
||||
#else
|
||||
grplldbg("Cannot allocate from interrupt handler\n");
|
||||
group = NULL;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
grplldbg("Allocate from the heap\n");
|
||||
group = uip_grpheapalloc();
|
||||
|
@ -142,6 +142,11 @@ void uip_igmpinput(struct uip_driver_s *dev)
|
||||
|
||||
destipaddr = uip_ip4addr_conv(IGMPBUF->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 */
|
||||
|
||||
@ -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");
|
||||
|
||||
|
@ -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);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Return EEXIST if the address is already a member of the group */
|
||||
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
|
@ -173,6 +173,8 @@ int igmp_leavegroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Return ENOENT if the address is not a member of the group */
|
||||
|
||||
nvdbg("Return -ENOENT\n");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
@ -162,14 +162,14 @@ void uip_igmpsend(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group,
|
||||
|
||||
/* Set up the IGMP message */
|
||||
|
||||
IGMPBUF->type = group->msgid;
|
||||
IGMPBUF->maxresp = 0;
|
||||
IGMPBUF->type = group->msgid;
|
||||
IGMPBUF->maxresp = 0;
|
||||
uiphdr_ipaddr_copy(IGMPBUF->grpaddr, &group->grpaddr);
|
||||
|
||||
/* Calculate the IGMP checksum. */
|
||||
|
||||
IGMPBUF->chksum = 0;
|
||||
IGMPBUF->chksum = ~uip_igmpchksum(&IGMPBUF->type, UIP_IPIGMPH_LEN);
|
||||
IGMPBUF->chksum = 0;
|
||||
IGMPBUF->chksum = ~uip_igmpchksum(&IGMPBUF->type, UIP_IPIGMPH_LEN);
|
||||
|
||||
IGMP_STATINCR(uip_stats.igmp.poll_send);
|
||||
IGMP_STATINCR(uip_stats.ip.sent);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* net/uip/uip_igmpleave.c
|
||||
* net/uip/uip_igmptimer.c
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
@ -170,8 +170,8 @@ int uip_decisec2tick(int decisecs)
|
||||
*/
|
||||
|
||||
return CLK_TCK * decisecs / 10;
|
||||
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_igmpstartticks and uip_igmpstarttimer
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user