From: Hugo Tyson <hmt@redhat.com>
To: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Where do I put ETH_DRV_SC?
Date: Tue, 14 Aug 2001 07:43:00 -0000 [thread overview]
Message-ID: <wwtn152k8i7.fsf@masala.cambridge.redhat.com> (raw)
In-Reply-To: <2253171AF143D21185A60000F8FA748B03795E12@pluto.combitech.se>
David.Karlberg@combitechsystems.com writes:
> Im Trying to get TCP/IP working on a media Enging . I am using the
> nanoEnging template and I want to write a hardware driver using the
> ETH_DRV_SC()/NETDEVTAB_ENTRY().
They don't say what type of ethernet the mediaEngine has, but I see it's
not the same as the i82559(s) on the commEngine and nanoEngine. It just
says 10BaseT - does that mean it's an SMSC91C96 or similar? If so you
could re-use that driver?
> And my question is: where do I put the ETH_DRV_SC()/NETDEVTAB_ENTRY()
> code?
In the source ;-) That sounds unhelpful, but it's not, really it's not.
Take a look at the generic i82559 driver that's used by the nano target.
It includes a header that sets up a load of context. The header also does
the
ETH_DRV_SC(i82559_sc0, .........
NETDEVTAB_ENTRY(i82559_netdev0, .........
invocations for as many devices as you want.
The compiled generic driver is linked in to libextras.a by the compile line
in its cdl - that's what makes those magic things be linked into the
system, just so long as the results of ETH_DRV_SC()/NETDEVTAB_ENTRY() are
in the image and no garbage collected. Using libextras.a is what prevents
the garbage collection.
The other way we do generic drivers is to have the generic driver in a
header, and a .c sets up context, including ETH_DRV_SC()/NETDEVTAB_ENTRY()
and then includes the header to make all the functions.
Same difference; they're really just two ways to compile the catenation of
two C files, one from a different package selected according to the target
and one generic.
If you don't want to separate your driver into a generic part and a
specific part, you don't have to. So just have one .c file and put the lot
in that. The EBSA285 ethernet driver is like that - only because it's
rather old; the generic i82559 driver grew from it, but we didn't change
over to help keep the EBSA driver stable.
HTH,
- Huge
next prev parent reply other threads:[~2001-08-14 7:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-14 6:57 David.Karlberg
2001-08-14 7:43 ` Hugo Tyson [this message]
2001-08-16 0:06 ` [ECOS] driver for 16x7X serial chip questions Sebastien ANDRE
2001-08-16 3:04 ` David Airlie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wwtn152k8i7.fsf@masala.cambridge.redhat.com \
--to=hmt@redhat.com \
--cc=ecos-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).