[EMAIL PROTECTED] wrote: > > > ---------------------------------------- >> [EMAIL PROTECTED] wrote: >>> Hi, >>> >>> I'm trying to implement the ethercat protocol into Orocos >> I guess it will be based on http://ethercatmaster.berlios.de, right? > > Yes, It's based on http://ethercatmaster.berlios.de > >>> (www.orocos.org). To do this I want to use the RTNet with a Realtek >>> rtl8139 network card. >> [Keep in mind that the rtl8139 is a fairly mad controller as it only >> allows DMA within a fixed window, forcing us to copy data one time more >> than usual, also in interrupt context.] >> >>> So, I've installed RTNet on Xenamai and try to send and receive raw >>> ethernet packages (ethercat data) using the rtl8139 driver. But I'm a >>> bit confused on how to do this, especially the receiving part isn't >>> really clear to me. The way I see it (please correct me if I'm >>> wrong), the rx_interrupt function takes the data from the rx_ring and >>> puts it on the skb_pool. Then the atomic variable \"ref_count\" is >>> incremented with \"rtnetif_rx (skb)\", so the upper layer can see >>> there has new data been received . Now my question is, how do I reach >>> the data that has been put on the skb_pool? Is there a function to do >>> this? Or do I have to take to take the data with a function like >>> \"sock_queue_rcv_skb()\" and increment \"ref_count\" myself? >> Before you get lost in that, granted, fairly tricky part of RTnet: Do >> you already thought about how to attach your Ethercat master to the >> RTnet stack best? > > Refering to your RTnet stack figure (RTnet - flexible hard real-time > networking framework), I think it's best to access the RTnet Core directly > through the API.
Why? Ok, you would save one task switch this way, but you may complicate the development (think of debugging with gdb...). In user space you could write your stack against the socket API and make is more portable. There are pros and cons of both models, I can just recommend to evaluate both first. > >> You may follow that path above and register the required Ethernet >> protocol number(s) with the RTnet stack manager, option A. But you may >> also consider to use the standard BSD API of RTnet for this by opening >> an AF_PACKET socket, option B. That may even happen from user space then. >> >> >> Weather you prefer A or B will likely depend on additional requirements >> your usage scenario implies. Maybe you can sketch central requirements >> (/wrt timing and overhead). Do you also have an idea about the execution >> model for your master, i.e. what operation should run in which context >> (user or driver task, or even IRQ handler)? And how will applications >> interact with it (=>API)? > > When a package is send by the master, he instantly (couple of nanoseconds > later) gets that package back (a slave may have put data in that package or > retrieved data from it). So receiving data is done directly after sending > data, in the same function (txandrx(...)). That sounds trivial (what doesn't mean that it's bad!). > > The execution will be done in kernel space. But the API will be exported to user space, I guess? Some RTDM device? Would also make sense. Maybe you want to have a look at this experimental process image device driver: http://www.rts.uni-hannover.de/rtaddon/ (CIF InterBus Master) I'm still hoping it is a reasonable start for a generic interface to such devices (=>RTDM profile). > > Making an API is on the TODO list. > > Tom > Jan
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- 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