questions about writing network drivers

Ian Caddy ianc at microsol.iinet.net.au
Mon Dec 30 00:22:06 UTC 2002


Hi,

I am not familiar with these drivers specifically, but it
looks like the 2 structures sonic_write_register_t and the
other one are hardware overlay structures, in other words,
these structures get overlayed on the hardware memory of the
device.

You should find somewhere that there is a pointer to this
structure defined and then this pointer is pointed to the
actual hardware address.  Now if you read and write to that
structure you are actually reading and writing to the hardware.

There is no seperate read or write function required.

As to the xxx_softc structure, it is generally initialised in
the xxx_driver_attach function which also passes a copy of it
to the network stack.

In relation to the memory verses I/O space you will need to
look at your hardware and chip information for how it is
split.

For more reference information, there is a networking
supplement document on the RTEMS site and it references the
Motorola 68360 BSP.  It is quite good to show you how it all
hangs together.

regards,

Ian Caddy


M.C.Shao wrote:
> hi,all
> merry christmas& happy new year.
> I am trying to write a network driver for my rtl8139 chip.For I didn't 
> find an available network dirver for it under rtems.And I am refferring 
> to dec21140's and sonic's drivers. when I read sonic's code, it seems 
> that it use "sonic_write_register_t and sonic_read_register_t" 
> strutcture to write/read sonice chip's register. But I didn't find where 
> the code is implemented to acctually do the "write/read"?
> Only those two structures are defined, but no real implementation code.
> The second question, where is the "xxx_softc" stucture initiated? I am 
> puzzled about this.
> And the last question, what's the difference between memory access and 
> I/O access to the chip registers? I am wondering which method to use now.
> Any suggestions are appriciated. Thank you very much.
> --
> Shao Mingchao
> Engineering Physics Department
> Tsinghua University
> Beijing,100084,China




More information about the users mailing list