From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: "Trenton D. Adams" Cc: 'eCos' Subject: Re: [ECOS] eth device drivers Date: Thu, 14 Jun 2001 14:13:00 -0000 Message-id: <3B2928FA.3652A989@redhat.com> References: <000d01c0f42a$cfb39330$090110ac@BURN> X-SW-Source: 2001-06/msg00530.html "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/