Thinus Viljoen wrote:
> I got the kernel mode module to compile by including
> /usr/src/linux/include/linux/in.h
> and
> /usr/src/linux/include/linux/net.h
> 
> It is a modified version of the RTnet 0.8.3 "raw-packets.c" example. The 
> module periodically transmits, and continuously receives LAN packets. The 
> modified version uses (sin_family=AF_INET), where the old one used 
> (sll_family=PF_PACKET). I also added a socket - one is used for Rx, while the 
> other is used for Tx.
> 
> When I load the module, both rt_dev_recv() and rt_dev_sendmsg() return error 
> code -38. My question is basically - what is this error code? I am not too 
> sure where to look.

38 means ENOSYS, and this means -translated- that there is no receive or
send service available for your socket in your current execution
context. As RTnet is correctly installed (otherwise socket creation
would have failed), only the execution context can be a problem here
(send and recv only works in RT context).

But before starting to speculate further: Could you add this to the
beginning of one of your task functions:

printk("rtdm_in_rt_context = %d\", rtdm_in_rt_context());

Maybe you have to include rtdm/rtdm_driver.h to resolve
rtdm_in_rt_context. It should should give a non-zero result.


Two remarks on the code:
 o What is rt_assign_irq_to_cpu for?
 o Take care to not collide with some other module starting the timer.
   When using the full RTnet stack (RTmac/TDMA, RTcfg), it will do this
   for you. Better keep this part configurable (=> module parameter).

Thanks,
Jan

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
RTnet-users mailing list
RTnet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtnet-users

Reply via email to