From c4680a4704fd377f4c89e0b8f6149f3aec8b39fb Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 10 Jul 2010 17:02:52 +0000 Subject: More IGMP logic git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2781 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/net/uip/uip_igmppoll.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'nuttx/net/uip/uip_igmppoll.c') diff --git a/nuttx/net/uip/uip_igmppoll.c b/nuttx/net/uip/uip_igmppoll.c index 7ba4b50a0..5d74732fa 100755 --- a/nuttx/net/uip/uip_igmppoll.c +++ b/nuttx/net/uip/uip_igmppoll.c @@ -1,7 +1,5 @@ /**************************************************************************** - * net/uip/uip-igmp.h - * The definitions in this header file are intended only for internal use - * by the NuttX port of the uIP stack. + * net/uip/uip_igmppoll.c * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -85,7 +83,9 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g { uip_ipaddr_t *dest; - /* IGMP header + IP header + 8 bytes of data */ + /* Check what kind of messsage we need to send. There are only two + * possibilities: + */ if (group->msgid == IGMPv2_MEMBERSHIP_REPORT) { @@ -104,7 +104,21 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g uiphdr_ipaddr_copy(IGMPBUF->grpaddr, &group->grpaddr); } + /* Send the message */ + uip_igmpsend(dev, dest); + + /* Indicate that the message has been sent */ + + CLR_SCHEDMSG(group->flags); + group->msgid = 0; + + /* If there is a thread waiting fore the message to be sent, wake it up */ + + if (IS_WAITMSG(group->flags)) + { + sem_post(&group->sem); + } } /**************************************************************************** -- cgit v1.2.3