public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] eth device drivers
@ 2001-06-13 23:51 rob.wj.jansen
  0 siblings, 0 replies; 5+ messages in thread
From: rob.wj.jansen @ 2001-06-13 23:51 UTC (permalink / raw)
  To: tadams; +Cc: ecos-discuss

Trenton wrote:
> Does ETH_DRV_SC create the edb7xxx_sc variable used by NETDEVTAB_ENTRY?
> That's what it looks like in the eCos sources.  Is there documentation
> for all this stuff, or does everyone have to look through the source
> like me?  It would be nice to just have docs that say something like
> "ETH_DRV_SC creates a structured vairable of the type 'eth_hwr_funs' and
> fills it with all the function names, etc".
> 
> With documentation like that, I wouldn't care about what the MACROS were
> doing, I would just use them.

I remember that RedHat sends out requests for help on a regular basis.
I guess they will be happy if someone wrote a guide about writing device drivers ;-)

Regards,
	Rob Jansen

Software Engineer
Competence Center Platforms
BU Mobile Communications
Meijhorst 60-10, 6537 KT Nijmegen, The Netherlands
Tel: +31-24-353-6329
Fax: +31-24-353-3613
mailto:Rob.WJ.Jansen@philips.com


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

* Re: [ECOS] eth device drivers
  2001-06-14 14:41   ` Trenton D. Adams
@ 2001-06-14 15:47     ` Jonathan Larmour
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Larmour @ 2001-06-14 15:47 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: 'eCos'

"Trenton D. Adams" wrote:
> 
> It would be ok to just say to use it, but I would still like to know
> what all the parameters to it should be.  There's a little bit of an
> explanation of DEVTAB_ENTRY in the eCos Reference Manual, but nothing on
> ETH_DRV_SC.
> 
> That still doesn't answer all of my questions though.
> 
> Does ETH_DRV_SC create the edb7xxx_sc variable used by NETDEVTAB_ENTRY?

Yes see io/eth/current/include/eth_drv.h
 
> When you don't answer a question directly should I assume that I'm
> correct in my deductions?

No, assume that I maybe didn't answer because I'm lazy, overworked, or
don't feel obliged to give an answer to every question everyone asks on the
net ;-). (That's why Red Hat sells proper support packages).

Or I just missed it because of trying to get through it too quickly, as was
the case here.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* RE: [ECOS] eth device drivers
  2001-06-14 14:13 ` Jonathan Larmour
@ 2001-06-14 14:41   ` Trenton D. Adams
  2001-06-14 15:47     ` Jonathan Larmour
  0 siblings, 1 reply; 5+ messages in thread
From: Trenton D. Adams @ 2001-06-14 14:41 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: 'eCos'

It would be ok to just say to use it, but I would still like to know
what all the parameters to it should be.  There's a little bit of an
explanation of DEVTAB_ENTRY in the eCos Reference Manual, but nothing on
ETH_DRV_SC.

That still doesn't answer all of my questions though.

Does ETH_DRV_SC create the edb7xxx_sc variable used by NETDEVTAB_ENTRY?

When you don't answer a question directly should I assume that I'm
correct in my deductions?

> -----Original Message-----
> From: jlarmour@cambridge.redhat.com 
> [ mailto:jlarmour@cambridge.redhat.com ] On Behalf Of Jonathan Larmour
> Sent: Thursday, June 14, 2001 3:14 PM
> To: Trenton D. Adams
> Cc: 'eCos'
> Subject: Re: [ECOS] eth device drivers
> 
> 
> "Trenton D. Adams" wrote:
> > 
> > Do I have to write a driver for the actual modem, and one for the 
> > network portion of it, or should it all be integrated into 
> one?  Right 
> > now I'm looking at 
> "devs\eth\arm\edb7xxx\current\src\if_edb7xxx.c".  
> > It looks to me like it's the only driver file for that 
> network device.  
> > Is this correct?
> 
> For the CS8900 on the edb7211, yes.
>  
> > How do I go about understanding the driver?  For instance, 
> what good 
> > does it do to go
> > 
> > NETDEVTAB_ENTRY (edb7xxx_netdev, "edb7xxx", edb7xxx_cs8900_init, 
> > &edb7xxx_sc); ???
> > 
> > Doesn't that device tab entry have to be put inside a table 
> somewhere 
> > in the kernel in order for the kernel to access it, or to even know 
> > it's there?  Or does the CYG_HAL_TABLE_ENTRY part of the 
> macro create 
> > a string that "make" somehow parses, and automatically puts 
> the entry 
> > into an array somewhere in the kernel as it's being made 
> and compiled?
> 
> CYG_HAL_TABLE_ENTRY puts things into a special ELF section. 
> The object file containing the driver (and the table entry) 
> is forcibly linked into the application by having the object 
> sucked in by the linker script. This happens because of the 
> "compile -library libextras.a if_edb7xxx.c" which places the 
> object in libextras.a, and at the end of the build process 
> all of libextras.a is converted to a single object extras.o.
>  
> > Does ETH_DRV_SC create the edb7xxx_sc variable used by 
> > NETDEVTAB_ENTRY? That's what it looks like in the eCos sources.  Is 
> > there documentation for all this stuff, or does everyone 
> have to look 
> > through the source like me?  It would be nice to just have 
> docs that 
> > say something like "ETH_DRV_SC creates a structured vairable of the 
> > type 'eth_hwr_funs' and fills it with all the function names, etc".
> > 
> > With documentation like that, I wouldn't care about what the MACROS 
> > were doing, I would just use them.
> 
> What if the documentation said just to use them rather than 
> to say what they did, which is an implementation detail :-). 
> And as you can maybe guess from the above description, the 
> implementation is more detailed than people would want to know about!
> 
> Jifl
> -- 
> Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 
> (1223) 271062 Maybe this world is another planet's Hell 
> -Aldous Huxley || Opinions==mine Come to the Red Hat 
> TechWorld open source conference in Brussels!
> Keynotes, techie talks and exhibitions    
> http://www.redhat-techworld.com/
> 

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

* Re: [ECOS] eth device drivers
  2001-06-13 10:07 Trenton D. Adams
@ 2001-06-14 14:13 ` Jonathan Larmour
  2001-06-14 14:41   ` Trenton D. Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Larmour @ 2001-06-14 14:13 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: 'eCos'

"Trenton D. Adams" wrote:
> 
> Do I have to write a driver for the actual modem, and one for the
> network portion of it, or should it all be integrated into one?  Right
> now I'm looking at "devs\eth\arm\edb7xxx\current\src\if_edb7xxx.c".  It
> looks to me like it's the only driver file for that network device.  Is
> this correct?

For the CS8900 on the edb7211, yes.
 
> How do I go about understanding the driver?  For instance, what good
> does it do to go
> 
> NETDEVTAB_ENTRY (edb7xxx_netdev, "edb7xxx", edb7xxx_cs8900_init,
> &edb7xxx_sc);
> ???
> 
> Doesn't that device tab entry have to be put inside a table somewhere in
> the kernel in order for the kernel to access it, or to even know it's
> there?  Or does the CYG_HAL_TABLE_ENTRY part of the macro create a
> string that "make" somehow parses, and automatically puts the entry into
> an array somewhere in the kernel as it's being made and compiled?

CYG_HAL_TABLE_ENTRY puts things into a special ELF section. The object file
containing the driver (and the table entry) is forcibly linked into the
application by having the object sucked in by the linker script. This
happens because of the "compile -library libextras.a if_edb7xxx.c" which
places the object in libextras.a, and at the end of the build process all
of libextras.a is converted to a single object extras.o.
 
> Does ETH_DRV_SC create the edb7xxx_sc variable used by NETDEVTAB_ENTRY?
> That's what it looks like in the eCos sources.  Is there documentation
> for all this stuff, or does everyone have to look through the source
> like me?  It would be nice to just have docs that say something like
> "ETH_DRV_SC creates a structured vairable of the type 'eth_hwr_funs' and
> fills it with all the function names, etc".
> 
> With documentation like that, I wouldn't care about what the MACROS were
> doing, I would just use them.

What if the documentation said just to use them rather than to say what
they did, which is an implementation detail :-). And as you can maybe guess
from the above description, the implementation is more detailed than people
would want to know about!

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* [ECOS] eth device drivers
@ 2001-06-13 10:07 Trenton D. Adams
  2001-06-14 14:13 ` Jonathan Larmour
  0 siblings, 1 reply; 5+ messages in thread
From: Trenton D. Adams @ 2001-06-13 10:07 UTC (permalink / raw)
  To: 'eCos'

I'm a little confused about writing device drivers for a wireless
modem/network card.

Do I have to write a driver for the actual modem, and one for the
network portion of it, or should it all be integrated into one?  Right
now I'm looking at "devs\eth\arm\edb7xxx\current\src\if_edb7xxx.c".  It
looks to me like it's the only driver file for that network device.  Is
this correct?

How do I go about understanding the driver?  For instance, what good
does it do to go

NETDEVTAB_ENTRY (edb7xxx_netdev, "edb7xxx", edb7xxx_cs8900_init,
&edb7xxx_sc);
???

Doesn't that device tab entry have to be put inside a table somewhere in
the kernel in order for the kernel to access it, or to even know it's
there?  Or does the CYG_HAL_TABLE_ENTRY part of the macro create a
string that "make" somehow parses, and automatically puts the entry into
an array somewhere in the kernel as it's being made and compiled?


Does ETH_DRV_SC create the edb7xxx_sc variable used by NETDEVTAB_ENTRY?
That's what it looks like in the eCos sources.  Is there documentation
for all this stuff, or does everyone have to look through the source
like me?  It would be nice to just have docs that say something like
"ETH_DRV_SC creates a structured vairable of the type 'eth_hwr_funs' and
fills it with all the function names, etc".  

With documentation like that, I wouldn't care about what the MACROS were
doing, I would just use them.


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

end of thread, other threads:[~2001-06-14 15:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-13 23:51 [ECOS] eth device drivers rob.wj.jansen
  -- strict thread matches above, loose matches on Subject: below --
2001-06-13 10:07 Trenton D. Adams
2001-06-14 14:13 ` Jonathan Larmour
2001-06-14 14:41   ` Trenton D. Adams
2001-06-14 15:47     ` Jonathan Larmour

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).