This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about Hardware Device Driver(Eth)


On Mon, Dec 03, 2001 at 03:03:13PM -0000, HuangQiang wrote:
> Dear all:
> 
> Q1: Is the source in Package/IO/Eth/net/src for logical ethernet layer
> function? And the source in Package/dev/Eth/Arm/...  for the physical
> ethernet driver(low-layer driver)?

Yes, but you mean io/eth/src/net. 

> 
> Q2: How does TCP/IP stack interact with the ethernet driver? Does the TCP/IP
> stack interact with the logical driver (in Package/IO/Eth/net/src) and then
> interact with physical driver(Package/dev/Eth/Arm/...)? Is the layer shown
> below correct?

Yes.

> Q3: But how does TCP/IP stack interact with the logical layer function? (How
> eth_drv_xxx() functions is called in TCP/IP?)

The eth_drv layer uses if_attach and ether_ifattach() to tell it about
the existance of interfaces. It passes an if structure which contains
pointers to the functions to call to do various things on an
interface.

> Q4: some function in logical layer is exported to physical layer:
> eth_drv_tx_done(), eth_drv_init(), eth_drv_recv(). why these is needed?

It has to be able to call in both directions. When the ethernet device
receives a packet it needs to call upwards. When the tcp stack has a
packet to send, it has to call downwards. So each layer has to export
some functions to the other to allows this.

There is some documentation about this in the io/eth/current/doc.

      Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]