<br><font size=2 face="sans-serif">Hi all,</font>
<br>
<br><font size=2 face="sans-serif">yes, more info.</font>
<br>
<br><font size=2 face="sans-serif">I found that in all rtems_bsdnet.h files
within the RTEMS distribution the rtems_bsdnet_ifconfig structure gets
a function pointer has the second field. The declaration of that function
is:</font>
<br>
<br><font size=2 face="sans-serif">int (*attach)(struct rtems_bsdnet_ifconfig
*conf, int attaching);</font>
<br>
<br><font size=2 face="sans-serif">I am using the SMC91111 network driver
which is declared as follows:</font>
<br>
<br><font size=2 face="sans-serif">#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111
rtems_smc91111_driver_attach_leon2</font>
<br>
<br><font size=2 face="sans-serif">where the rtems_smc91111_driver_attach_leon2
function is declared as:</font>
<br>
<br><font size=2 face="sans-serif">int rtems_smc91111_driver_attach_leon2(struct
rtems_bsdnet_ifconfig *config);</font>
<br>
<br><font size=2 face="sans-serif">The problem is that driver function
apparently only has ONE argument, but in the rtems_bsdnet_ifconfig
a function with TWO arguments is needed, even when the extra parameter
is ignored for older attach functions.</font>
<br>
<br><font size=2 face="sans-serif">How can I solve the problem? </font>
<br>
<br><font size=2 face="sans-serif">Aitor</font>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Aitor.Viana.Sanchez@esa.int</b>
</font>
<br><font size=1 face="sans-serif">Sent by: rtems-users-bounces@rtems.org</font>
<p><font size=1 face="sans-serif">12/11/2007 14:39</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">rtems-users@rtems.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">rtems_bsdnet_ifconfig problem using
C++</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2>Hi all,</font><font size=3> </font>
<br>
<br><font size=2>I got some problems with the network configuration when
using C++. </font><font size=3> </font>
<br>
<br><font size=2>In the main.cpp source code I include:</font><font size=3>
</font>
<br>
<br><font size=2>#include <rtems.h></font><font size=3> </font>
<br><font size=2>#include <bsp.h></font><font size=3> </font>
<br><font size=2>#include "../rtems/rtems_config.h"</font><font size=3>
</font>
<br>
<br><font size=2>extern "C"</font><font size=3> </font>
<br><font size=2>{</font><font size=3> </font>
<br><font size=2> #include <rtems/rtems_bsdnet.h></font>
<br><font size=2>}</font><font size=3> </font>
<br><font size=2>#include "../rtems/rtems-network.h"</font><font size=3>
</font>
<br>
<br><font size=2>#include <rtems/rtems_bsdnet.h> is include within
the extern statement because otherwise i cannot use the rtems_bsdnet_initialize_network()
method. The rtems-network.h is the network configuration file (pretty similar
to the one provided with the RTEMS examples) and also is working perfectly
with previous C projects.</font><font size=3> </font>
<br><font size=2>The problem is that when I try to compile the application
i get the next error:</font><font size=3> </font>
<br>
<br><font size=2>/home/aitor/workspace/OBSFramework/src/rtems/rtems-network.h:97:
invalid </font><font size=3> </font>
<br><font size=2> conversion from `int (*)(rtems_bsdnet_ifconfig*)'
to `int </font>
<br><font size=2> (*)(rtems_bsdnet_ifconfig*, int)'</font><font size=3>
</font>
<br>
<br>
<br><font size=2>where the line referenced in the error is the next one</font><font size=3>
</font>
<br>
<br><font size=2>static struct rtems_bsdnet_ifconfig netdriver_config =
{</font><font size=3> </font>
<br><font size=2> RTEMS_BSP_NETWORK_DRIVER_NAME,
/* name */</font><font size=3>
</font>
<br><font size=2> RTEMS_BSP_NETWORK_DRIVER_ATTACH,
/* attach function */</font><font size=3> </font>
<br>
<br><font size=2>#ifdef RTEMS_USE_LOOPBACK </font>
<br><font size=2> &loopback_config,
/* link to next interface
*/</font><font size=3> </font>
<br><font size=2>#else</font><font size=3> </font>
<br><font size=2> NULL,
/* No more interfaces */</font><font size=3> </font>
<br><font size=2>#endif</font><font size=3> </font>
<br>
<br><font size=2>#if (defined (RTEMS_USE_BOOTP))</font><font size=3> </font>
<br><font size=2> NULL,
/* BOOTP supplies IP address */</font><font size=3> </font>
<br><font size=2> NULL,
/* BOOTP supplies IP net mask */</font><font size=3> </font>
<br><font size=2>#else</font><font size=3> </font>
<br><font size=2> "192.168.1.29",
/* IP address */</font><font size=3>
</font>
<br><font size=2> "255.255.255.0",
/* IP net mask */</font><font size=3>
</font>
<br><font size=2>#endif /* !RTEMS_USE_BOOTP */</font><font size=3> </font>
<br>
<br><font size=2>#if (defined (RTEMS_SET_ETHERNET_ADDRESS))</font><font size=3>
</font>
<br><font size=2> ethernet_address,
/* Ethernet hardware address */</font><font size=3>
</font>
<br><font size=2>#else</font><font size=3> </font>
<br><font size=2> NULL,
/*
Driver supplies hardware address */</font><font size=3> </font>
<br><font size=2>#endif</font><font size=3> </font>
<br><font size=2> 0
/* Use default driver parameters */</font><font size=3> </font>
<br><font size=2>};</font><font size=3> </font>
<br>
<br><font size=2>I don't know why this is happening. Can anyone give a
clue?</font><font size=3> </font>
<br>
<br><font size=2>Thanks in advance,</font><font size=3> </font>
<br>
<br><font size=2>Aitor</font><font size=3> </font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1><b>Joel Sherrill <joel.sherrill@oarcorp.com></b>
</font><font size=3> </font>
<br><font size=1>Sent by: rtems-users-bounces+aitor.viana.sanchez=esa.int@rtems.org</font><font size=3>
</font>
<br>
<br><font size=1>05/11/2007 15:18</font><font size=3> </font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td width=24%>
<div align=right><font size=1>To</font></div>
<td width=75%><font size=1>Leon Pollak <leonp@plris.com></font><font size=3>
</font>
<tr valign=top>
<td>
<div align=right><font size=1>cc</font></div>
<td><font size=1>RTEMS Users <rtems-users@rtems.org></font><font size=3>
</font>
<tr valign=top>
<td>
<div align=right><font size=1>Subject</font></div>
<td><font size=1>Re: TOD differences</font></table>
<br>
<table width=100%>
<tr valign=top>
<td width=50%>
<td width=50%></table>
<br>
<br></table>
<br>
<br><font size=2><tt>Leon Pollak wrote:</tt></font>
<br><font size=2><tt>> On Monday 05 November 2007 14:24, Joel Sherrill
wrote:</tt></font>
<br><font size=2><tt>></tt></font>
<br><font size=2><tt>>> Leon Pollak wrote:</tt></font>
<br><font size=2><tt>>></tt></font>
<br><font size=2><tt>>>> Hello, all.</tt></font>
<br><font size=2><tt>>>> The question seems to be very simple,
but I did not find any answer in</tt></font>
<br><font size=2><tt>>>> docs, wiki...</tt></font>
<br><font size=2><tt>>>></tt></font>
<br><font size=2><tt>>>> I have two rtems_time_of_day structures
containing two times. How can I</tt></font>
<br><font size=2><tt>>>> calculate the difference (in seconds)
between them?</tt></font>
<br><font size=2><tt>>>></tt></font>
<br><font size=2><tt>>> Not in the public API. With the movement
in 4.8 to struct timespec</tt></font>
<br><font size=2><tt>>> in the super core, there are a lot of timespec
math routines. There</tt></font>
<br><font size=2><tt>>> has always been some TOD to XXX routines.</tt></font>
<br><font size=2><tt>>></tt></font>
<br><font size=2><tt>>> I have considered making the existing set
of time math routines</tt></font>
<br><font size=2><tt>>> available via the public API. It isn't
especially hard to do but</tt></font>
<br><font size=2><tt>>> would require documentation. If this
is of interest to the</tt></font>
<br><font size=2><tt>>> community, I will move it from my idea list
to my someday we might</tt></font>
<br><font size=2><tt>>> do this list.</tt></font>
<br><font size=2><tt>>></tt></font>
<br><font size=2><tt>> Thanks, Joel.</tt></font>
<br><font size=2><tt>> I definitely do not represent the community :-),
but I vote "pro"!</tt></font>
<br><font size=2><tt>> Meanwhile, can you be so kind to "disclose"
where I can find any</tt></font>
<br><font size=2><tt>> internal "TOD_to_XXX" routine?</tt></font>
<br><font size=2><tt>></tt></font>
<br><font size=2><tt>Depends on the version. For 4.7 and older, the
routine</tt></font>
<br><font size=2><tt>you want is _TOD_To_seconds() from the SuperCore.</tt></font>
<br><font size=3> </font>
<br><font size=2><tt>For 4.8 and newer, it has the same name but is part</tt></font>
<br><font size=2><tt>of the RTEMS Classic API since the SuperCore doesn't</tt></font>
<br><font size=2><tt>know the Classic API TOD structure any more.</tt></font>
<br><font size=3> </font>
<br><font size=2><tt>libbsp/shared/tod.c has an example of using it.</tt></font>
<br><font size=3> </font>
<br><font size=2><tt>In 4.8 and newer, there is also a set of timespec
math</tt></font>
<br><font size=2><tt>routines prototyped in score/include/rtems/score/timespec.h</tt></font>
<br><font size=3> </font>
<br><font size=2><tt>--joel</tt></font>
<br><font size=2><tt>> Again, thanks.</tt></font>
<br><font size=2><tt>></tt></font>
<br><font size=3> </font>
<br><font size=2><tt>_______________________________________________</tt></font>
<br><font size=2><tt>rtems-users mailing list</tt></font>
<br><font size=2><tt>rtems-users@rtems.com</tt></font>
<br><font size=2><tt>http://rtems.rtems.org/mailman/listinfo/rtems-users</tt></font><font size=3>
</font>
<br>
<br><font size=2><tt>_______________________________________________<br>
rtems-users mailing list<br>
rtems-users@rtems.com<br>
http://rtems.rtems.org/mailman/listinfo/rtems-users</tt></font>
<br>
<br>