public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Accessing 2nd / 3rd Ethernet interface directly
@ 2009-08-07  8:34 Jim Bradleigh
  2009-08-10 11:41 ` [ECOS] " Tarmo Kuuse
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Bradleigh @ 2009-08-07  8:34 UTC (permalink / raw)
  To: ecos-discuss


Hi,

My target hardware is an i386 PC with 3 Ethernet controllers (all RTL8139 cards) and my application needs to direct access to the 2nd and 3rd Ethernet ports to read/write raw Ethernet frames. The primary port is used for TCP/IP control which works without problems.

I`m fairly new to eCos so not fully up to speed on the entire set-up of it but i`ve been reading the archived mailing list and can`t find any previous examples of how to directly access the Ethernet controllers. 

Can anyone point in the right direction (or various directions) on where to start looking or tell me what is the correct way to do this? I can`t find an API or information that shows me how to locate the 2nd and 3rd cards and read/write raw data to them. 

Thanks,

Jim


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ECOS]  Re: Accessing 2nd / 3rd Ethernet interface directly
  2009-08-07  8:34 [ECOS] Accessing 2nd / 3rd Ethernet interface directly Jim Bradleigh
@ 2009-08-10 11:41 ` Tarmo Kuuse
  0 siblings, 0 replies; 2+ messages in thread
From: Tarmo Kuuse @ 2009-08-10 11:41 UTC (permalink / raw)
  To: ecos-discuss

Hi Jim,

Jim Bradleigh wrote:
> My target hardware is an i386 PC with 3 Ethernet controllers (all RTL8139 cards) and my application needs to direct access to the 2nd and 3rd Ethernet ports to read/write raw Ethernet frames. The primary port is used for TCP/IP control which works without problems.
> 
> I`m fairly new to eCos so not fully up to speed on the entire set-up of it but i`ve been reading the archived mailing list and can`t find any previous examples of how to directly access the Ethernet controllers. 
> 
> Can anyone point in the right direction (or various directions) on where to start looking or tell me what is the correct way to do this? I can`t find an API or information that shows me how to locate the 2nd and 3rd cards and read/write raw data to them. 

I believe when using BSD sockets for communication, the actual interface 
is chosen based on which address you use for source/destination. Once 
you have configured the addresses for all your interfaces, it is no 
longer important to specify the physical interface.

Raw Ethernet is a real joy in eCos. I'd avoid it if possible.

I have a faint understanding that the old OpenBSD TCP/IP stack includes 
the Berkeley Packet Filter (BPF) interface which gives at least read 
access to raw Ethernet.

The new FreeBSD TCP/IP stack does not provide any interface or API to 
read or write raw Ethernet packets. Even BPF support has been removed (I 
asked about that on the list, but nobody is eager to explain).

If you can use BSD sockets, I'd recommend that. A nice online tutorial 
is here: http://beej.us/guide/bgnet/

Otherwise, you probably need to add your own raw interface to the stack 
or Ethernet drivers. This assumes some knowledge about the internals of 
the TCP/IP stack. I'd suggest reading the first 5 chapters of Wright and 
Stevens, "TCP/IP Illustrated, Volume 2".

--
Kind regards,
Tarmo Kuuse


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-10 11:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-07  8:34 [ECOS] Accessing 2nd / 3rd Ethernet interface directly Jim Bradleigh
2009-08-10 11:41 ` [ECOS] " Tarmo Kuuse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).