[ECOS] Question about Hardware Device Driver(Eth)
Mon Dec 3 07:23:00 GMT 2001
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?
> 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
> 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.
More information about the Ecos-discuss