Re: How to activate ethernet driver

Grant Edwards <[email protected]> Fri, 10 Apr 2015 14:30:02 +0000 (UTC)
Newsgroups gmane.os.ecos.general
Message-ID <[email protected]>
On 2015-04-10, Jerzy Dyrda <[email protected]> wrote:
> Hello Dennis,
>
> 2015-04-10 11:11 GMT+02:00  <[email protected]>:
> [snip]
> We are a bit closer.

>> I digged a little deeper in the source code and found the function
>> "cyg_io_init" which iterates over the __DEVTAB__ table. I can see how
>> it runs through different devices like tty, flash, adc, ... but not
>> the ethernet driver. As far as I understand the reference manual,
>> this SHOULD happen here too!
>
> No exactly, it seems that Ethernet driver is a different sort of
> devices strictly connected to network stack.

[...]

True.  However, you can create a "normal" driver table entry for an
Ethernet driver if you want to.

Then you can have an init function called exactly once at system
startup time.

You can also then use use cyg_io_read(), cyg_io_write(),
cyg_io_set_config(), cyg_io_get_config() etc. for whatever you want.
I've done that in the past for a number of Ethernet drivers so that
user application can read/write raw MAC-level packets for certain
proprietary Ethernet protocols. [The eCos network stacks didn't used
to provide any mechanism for that].  We also use the normal cyg_io API
to allow application code to configure and uery a variety of features
in the Ethernet controller hardware that the normal network stacks are
not aware of and for which they provide no API.

-- 
Grant Edwards               grant.b.edwards        Yow! Don't hit me!!  I'm in
                                  at               the Twilight Zone!!!
                              gmail.com            


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss