This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: [ECOS] Ethernet Link status
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Emmanuel Coullien <coullien dot emmanuel at gmail dot com>
- Cc: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: Thu, 27 Sep 2007 05:18:32 -0600
- Subject: Re: [ECOS] Ethernet Link status
- References: <3fae21000709270046v974f8d5ne0514658da35e542@mail.gmail.com>
Emmanuel Coullien wrote:
> Hi,
>
> I tryed to know what was the Ethernet link status from the application
> level using ioctl but I think it miss some code in the BSD_TCPIP
> package to pass over this layer.
> In fact, it misses the case for SIOCGSTATUS in the BSD_TCPIP layer, so
> I had to add the lines below in the if.c file and now we can get the
> link status.
> case SIOCGIFSTATUS:
> case SIOCGIFSTATS:
> case SIOCGIFSTATSUD:
> if (ifp->if_ioctl == 0)
> {
> return (EOPNOTSUPP);
> }
> return ((*ifp->if_ioctl)(ifp, cmd, data));
>
> What do you think about these modifications. Is it possible to patch
> it in eCos ?
>
Emmanuel,
The attached patch is what was applied. Note the form and
the mailing list address - this is the acceptable way of
applying for patches/changes to eCos.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
Index: net/bsd_tcpip/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/bsd_tcpip/current/ChangeLog,v
retrieving revision 1.65
diff -u -5 -p -r1.65 ChangeLog
--- net/bsd_tcpip/current/ChangeLog 11 Sep 2007 16:37:53 -0000 1.65
+++ net/bsd_tcpip/current/ChangeLog 27 Sep 2007 11:13:44 -0000
@@ -1,5 +1,10 @@
+2007-09-27 Gary Thomas <gary@mlbassoc.com>
+
+ * src/sys/net/if.c (ifioctl): Add missing ioctl functions
+ (SIOCGIFSTATSUD, SIOCGIFSTATS) Reported by Emmanuel Coullien.
+
2007-09-11 Daniel Néri <daniel.neri@sigicom.se>
* include/sys/socketvar.h: Fix very old and subtle macro bug. From
FreeBSD revision 1.141.2.3 (RELENG_6 branch): "correctly return an
error if M_NOWAIT is passed to sblock() and the operation might
Index: net/bsd_tcpip/current/src/sys/net/if.c
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/bsd_tcpip/current/src/sys/net/if.c,v
retrieving revision 1.7
diff -u -5 -p -r1.7 if.c
--- net/bsd_tcpip/current/src/sys/net/if.c 30 Jul 2005 11:23:30 -0000 1.7
+++ net/bsd_tcpip/current/src/sys/net/if.c 27 Sep 2007 11:13:45 -0000
@@ -1252,10 +1252,12 @@ ifioctl(so, cmd, data, p)
case SIOCGIFPSRCADDR:
case SIOCGIFPDSTADDR:
case SIOCGLIFPHYADDR:
case SIOCGIFMEDIA:
case SIOCGIFGENERIC:
+ case SIOCGIFSTATS:
+ case SIOCGIFSTATSUD:
if (ifp->if_ioctl == 0)
return (EOPNOTSUPP);
return ((*ifp->if_ioctl)(ifp, cmd, data));
case SIOCSIFLLADDR: