> Tom Panis wrote:
>> Hi,
>>
>> I'm trying to send raw ethernet packages on Xenomai, I'm also working
>> with the trunk version of RTnet. I looked at the example
>> \"raw-ethernet.c\" and I'm wondering why the functions like socket_rt,
>> send_rt ,.. aren't used. Is it still real-time? I tried to use the
>
> It is, but only when you link against Xenomai's POSIX skin (xeno-config
> --posix-ldflags). This step will wrap all POSIX calls like socket, send,
> bind to RTDM services, finally invoking RTnet if it is installed
> (otherwise you will end up in Linux again).
>
>> real-time functions like socket_rt,... but then I can't send or receive
>> raw ethernet packages anymore: the function send_rt returns -1.
>
> All _rt services are deprecated now (we should mark them...). They were
> replaced by RTDM's rt_dev_XXX. But only the name changed here.
>
> The difference between rt_dev_XXX (or old XXX_rt) s! ervices and the true
> POSIX calls are the way error codes are returned. For POSIX services you
> have to check errno, for the RTDM API you get the error directly via the
> return code. Thus, one time -1 only means some error occurred, the other
> it means -EPERM (here: RT context required).
>
>> I attached the program code. Running the program (I use rtlo as
>> interface) results in the following output:
>>
>> Socket created: socket id: 0
>> Got interface: index: 0
>> Sending frames...
>> Cannot send: Success
>> Length: -1
>> shutting down
>
> How did you compile that program? It doesn't map itself to RT context
> unless you compiled it against the POSIX skin (which does so
> automatically for main).
I didn't compiled it against the POSIX skin. Now I just edited raw-ethertnet.c and kept it in the same directory. I compile it with makefile that's already there. When I do this I can send messages, but I can't ! receive any. When rt_dev_recv() is called, the program hangs, he keeps waiting for a package to arrive. When I send messages to my computer without this program running dmesg results :
[4299353.146000] RTnet: no one cared for packet with layer 3 protocol type 0x1234
[4299354.150000] RTnet: no one cared for packet with layer 3 protocol type 0x1234
....
When my program runs, these messages aren't given anymore, so the packages are taking care of I guess...
I added the source. The output of the program is:
Socket created: socket id: 1
Got interface: index: 0
Receiving
After stopping the program with ctrl+c the following is added:
Length: -9
shutting down
>> My second problem is the reason why I only can use the loopback: I use a
>> Realtek rtl8139 network card. Loading the modules works fine with
>> insmod. With dmesg I see rteth0 has been initialized but when I want to
>> activate it with \"rtifconfig rteth0 up 192.168.1.100\" my system freezes
>> without any message and the only solution is a hard reboot. Does anyone
>> also has this problem, or has any solution?
>
> IRQ conflict with Linux? Xenomai trunk revision (upcoming 2.3) can
> detect this, but current 2.2.x version still just locks up (endless IRQ
> handler invocations because Linux cannot handle the real source).
It was indeed an IRQ conflict. The onboard ethernet controller and the realtek network card (pci) had the same IRQ. Giving it another IRQ solved the problem.
>
> Jan
>
Tom
raw-ethernet.c
Description: Binary data
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users