This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: synch eth patch


On Wed, 2003-02-12 at 07:54, Bart Veer wrote:
> >>>>> "Jani" == Jani Monoses <jani@iv.ro> writes:
> 
>     Jani> I did mean to send it to the list, sorry.
>     >> note: this should really be a public discussion.  My opinion is
>     >> not the only one that counts :-)
> 
>     >> My question would be - "does the synthetic ethernet driver build 
>     >> [without changes] when using one of the other stacks?"  If so, then
>     >> IMO it's not the driver's fault.
> 
>     Jani> mine is "do other drivers build with lwIP?" - yes :)
>     Jani> one of them actually defines EINVAL to be 2 before using it.
> 
> Yes, arm/ks32c500. However #define'ing a system error code inside a
> device driver is a very bad idea and that driver should really be
> cleaned up. Especially since the error package #define's EINVAL as 22
> rather than 2.
> 
> EINVAL should always be available - most serial drivers depend on it.
> I believe the correct solution is to make sure that EINVAL is always
> #define'd in the synthetic target ethernet driver, probably by an
> explicit #include of <cyg/error/codes.h>. I'll try to look into this
> today or tomorrow.
> 

Since the routine which calls the driver (in this case) only
wants a yes/no (0/~0) result, I don't see the need for the
driver to instantiate the actual error code.  The upper layer
will return EINVAL as appropriate.

-- 
------------------------------------------------------------
Gary Thomas                 |
MLB Associates              |  Consulting for the
+1 (970) 229-1963           |    Embedded world
http://www.mlbassoc.com/    |
email: <gary@mlbassoc.com>  |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]