[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rtems_bsdnet_ifconfig problem using C++

Hi all,

yes, more info.

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:

int     (*attach)(struct rtems_bsdnet_ifconfig *conf, int attaching);

I am using the SMC91111 network driver which is declared as follows:


where the rtems_smc91111_driver_attach_leon2 function is declared as:

int rtems_smc91111_driver_attach_leon2(struct rtems_bsdnet_ifconfig 

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.

How can I solve the problem? 


Aitor.Viana.Sanchez at esa.int 
Sent by: rtems-users-bounces at rtems.org
12/11/2007 14:39

rtems-users at rtems.org

rtems_bsdnet_ifconfig problem using C++

Hi all, 

I got some problems with the network configuration when using C++.  

In the main.cpp source code I include: 

#include <rtems.h> 
#include <bsp.h> 
#include "../rtems/rtems_config.h" 

extern "C" 
        #include <rtems/rtems_bsdnet.h>
#include "../rtems/rtems-network.h" 

#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. 
The problem is that when I try to compile the application i get the next 

/home/aitor/workspace/OBSFramework/src/rtems/rtems-network.h:97: invalid  
   conversion from `int (*)(rtems_bsdnet_ifconfig*)' to `int 
   (*)(rtems_bsdnet_ifconfig*, int)' 

where the line referenced in the error is the next one 

static struct rtems_bsdnet_ifconfig netdriver_config = { 
        RTEMS_BSP_NETWORK_DRIVER_NAME,                /* name */ 
        RTEMS_BSP_NETWORK_DRIVER_ATTACH,        /* attach function */ 

        &loopback_config,                /* link to next interface */ 
        NULL,                                /* No more interfaces */ 

#if (defined (RTEMS_USE_BOOTP)) 
        NULL,                                /* BOOTP supplies IP address 
        NULL,                                /* BOOTP supplies IP net mask 
        "",                /* IP address */ 
        "",                /* IP net mask */ 
#endif /* !RTEMS_USE_BOOTP */ 

        ethernet_address,               /* Ethernet hardware address */ 
        NULL,                           /* Driver supplies hardware 
address */ 
        0                                /* Use default driver parameters 

I don't know why this is happening. Can anyone give a clue? 

Thanks in advance, 


Joel Sherrill <joel.sherrill at oarcorp.com>  
Sent by: rtems-users-bounces+aitor.viana.sanchez=esa.int at rtems.org 

05/11/2007 15:18 

Leon Pollak <leonp at plris.com> 
RTEMS Users <rtems-users at rtems.org> 
Re: TOD differences

Leon Pollak wrote:
> On Monday 05 November 2007 14:24, Joel Sherrill wrote:
>> Leon Pollak wrote:
>>> Hello, all.
>>> The question seems to be very simple, but I did not find any answer in
>>> docs, wiki...
>>> I have two rtems_time_of_day structures containing two times. How can 
>>> calculate the difference (in seconds) between them?
>> Not in the public API.  With the movement in 4.8 to struct timespec
>> in the super core, there are a lot of timespec math routines.  There
>> has always been some TOD to XXX routines.
>> I have considered making the existing set of time math routines
>> available via the public API.  It isn't especially hard to do but
>> would require documentation.  If this is of interest to the
>> community, I will move it from my idea list to my someday we might
>> do this list.
> Thanks, Joel.
> I definitely do not represent the community :-), but I vote "pro"!
> Meanwhile, can you be so kind to "disclose" where I can find any
> internal "TOD_to_XXX" routine?
Depends on the version.  For 4.7 and older, the routine
you want is _TOD_To_seconds() from the SuperCore.
For 4.8 and newer, it has the same name but is part
of the RTEMS Classic API since the SuperCore doesn't
know the Classic API TOD structure any more.
libbsp/shared/tod.c has an example of using it.
In 4.8 and newer, there is also a set of timespec math
routines prototyped in score/include/rtems/score/timespec.h
> Again, thanks.
rtems-users mailing list
rtems-users at rtems.com

rtems-users mailing list
rtems-users at rtems.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rtems.rtems.org/pipermail/rtems-users/attachments/20071112/0519ea94/attachment-0001.html