netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* examples to model ethernet driver off of?
@ 2006-09-13 19:40 Kumar Gala
  2006-09-13 19:54 ` Francois Romieu
  0 siblings, 1 reply; 9+ messages in thread
From: Kumar Gala @ 2006-09-13 19:40 UTC (permalink / raw)
  To: netdev

What are good examples of simple/basic ethernet drivers one should  
use to model a new driver off of?

thanks

- kumar

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

* Re: examples to model ethernet driver off of?
  2006-09-13 19:40 examples to model ethernet driver off of? Kumar Gala
@ 2006-09-13 19:54 ` Francois Romieu
  2006-09-13 20:11   ` Auke Kok
  0 siblings, 1 reply; 9+ messages in thread
From: Francois Romieu @ 2006-09-13 19:54 UTC (permalink / raw)
  To: Kumar Gala; +Cc: netdev

Kumar Gala <galak@kernel.crashing.org> :
> What are good examples of simple/basic ethernet drivers one should  
> use to model a new driver off of?

tg3/bnx2/sky2/b44/8139cp

Shake, average, procrastinate.

It depends on what the hardware can do though.

-- 
Ueimor

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

* Re: examples to model ethernet driver off of?
  2006-09-13 19:54 ` Francois Romieu
@ 2006-09-13 20:11   ` Auke Kok
  2006-09-13 20:36     ` Kumar Gala
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Auke Kok @ 2006-09-13 20:11 UTC (permalink / raw)
  To: Francois Romieu; +Cc: Kumar Gala, netdev

Francois Romieu wrote:
> Kumar Gala <galak@kernel.crashing.org> :
>> What are good examples of simple/basic ethernet drivers one should  
>> use to model a new driver off of?
> 
> tg3/bnx2/sky2/b44/8139cp

Can I add e1000/ixgb to that? ;)

Cheers,

Auke

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

* Re: examples to model ethernet driver off of?
  2006-09-13 20:11   ` Auke Kok
@ 2006-09-13 20:36     ` Kumar Gala
  2006-09-13 20:56       ` Auke Kok
  2006-09-13 21:05       ` Francois Romieu
  2006-09-13 20:55     ` Francois Romieu
  2006-09-14  1:26     ` Stephen Hemminger
  2 siblings, 2 replies; 9+ messages in thread
From: Kumar Gala @ 2006-09-13 20:36 UTC (permalink / raw)
  To: Auke Kok; +Cc: Francois Romieu, netdev


On Sep 13, 2006, at 3:11 PM, Auke Kok wrote:

> Francois Romieu wrote:
>> Kumar Gala <galak@kernel.crashing.org> :
>>> What are good examples of simple/basic ethernet drivers one  
>>> should  use to model a new driver off of?
>> tg3/bnx2/sky2/b44/8139cp
>
> Can I add e1000/ixgb to that? ;)

What is the feeling about e100.c?

I'm looking for something that is just basic tx/rx with no real fancy  
features.

- k

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

* Re: examples to model ethernet driver off of?
  2006-09-13 20:11   ` Auke Kok
  2006-09-13 20:36     ` Kumar Gala
@ 2006-09-13 20:55     ` Francois Romieu
  2006-09-14  1:26     ` Stephen Hemminger
  2 siblings, 0 replies; 9+ messages in thread
From: Francois Romieu @ 2006-09-13 20:55 UTC (permalink / raw)
  To: Auke Kok; +Cc: Kumar Gala, netdev

Auke Kok <auke-jan.h.kok@intel.com> :
[...]
> >tg3/bnx2/sky2/b44/8139cp
> 
> Can I add e1000/ixgb to that? ;)

Assume I have not noticed the smiley...

- $ grep int32 drivers/net/e1000/*
- $ grep ' if(' drivers/net/e1000/*
- tabs and spaces damage
- forward declarations (are not a substitute for documentation)
- static some_return_type
  e1000_shnortz(...

  I still use dumb grep

- wild return -EIO; in the middle of e1000_probe
- useless cast in e1000_probe::INIT_WORK() due to wrong prototype
  of e1000_reset_task().

It looks nicer than last time I poke my nose into it but I am not
completely sure that I would recommend it to a newcomer as the
climax of best practices or simplicity. Btw I do not remember if
it handles multi-page skb like everybody else either.

-- 
Ueimor

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

* Re: examples to model ethernet driver off of?
  2006-09-13 20:36     ` Kumar Gala
@ 2006-09-13 20:56       ` Auke Kok
  2006-09-13 21:05       ` Francois Romieu
  1 sibling, 0 replies; 9+ messages in thread
From: Auke Kok @ 2006-09-13 20:56 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Francois Romieu, netdev

Kumar Gala wrote:
> 
> On Sep 13, 2006, at 3:11 PM, Auke Kok wrote:
> 
>> Francois Romieu wrote:
>>> Kumar Gala <galak@kernel.crashing.org> :
>>>> What are good examples of simple/basic ethernet drivers one should  
>>>> use to model a new driver off of?
>>> tg3/bnx2/sky2/b44/8139cp
>>
>> Can I add e1000/ixgb to that? ;)
> 
> What is the feeling about e100.c?

e100 is a rather simple driver because the hardware doesn't support much 
features. We've tried to make e100 a bit more like e1000 over the last few 
years as in basic structure, and as such e1000 is always a bit ahead of e100 
when it comes to that. Nonetheless it's probably an easy driver to read 
codewise (I should hope).

Cheers,

Auke

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

* Re: examples to model ethernet driver off of?
  2006-09-13 20:36     ` Kumar Gala
  2006-09-13 20:56       ` Auke Kok
@ 2006-09-13 21:05       ` Francois Romieu
  1 sibling, 0 replies; 9+ messages in thread
From: Francois Romieu @ 2006-09-13 21:05 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Auke Kok, netdev

Kumar Gala <galak@kernel.crashing.org> :
[...]
> What is the feeling about e100.c?
> 
> I'm looking for something that is just basic tx/rx with no real fancy  
> features.

- a bit too much of 'if(' (missing space) and 'if (evil_statement'
- some 'return' which are not on a line of their own
- a few local variables could be added to avoid repeated foo->bar.baz[shnort]

But yes, it's quite nice.

-- 
Ueimor

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

* Re: examples to model ethernet driver off of?
  2006-09-13 20:11   ` Auke Kok
  2006-09-13 20:36     ` Kumar Gala
  2006-09-13 20:55     ` Francois Romieu
@ 2006-09-14  1:26     ` Stephen Hemminger
  2006-09-14  1:40       ` David Miller
  2 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2006-09-14  1:26 UTC (permalink / raw)
  To: Auke Kok; +Cc: Francois Romieu, Kumar Gala, netdev

On Wed, 13 Sep 2006 13:11:07 -0700
Auke Kok <auke-jan.h.kok@intel.com> wrote:

> Francois Romieu wrote:
> > Kumar Gala <galak@kernel.crashing.org> :
> >> What are good examples of simple/basic ethernet drivers one should  
> >> use to model a new driver off of?
> > 
> > tg3/bnx2/sky2/b44/8139cp
> 
> Can I add e1000/ixgb to that? ;)

sorry to pick on e1000, but the code is too verbose and
split over too many files.  The e100 code is much cleaner.

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

* Re: examples to model ethernet driver off of?
  2006-09-14  1:26     ` Stephen Hemminger
@ 2006-09-14  1:40       ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2006-09-14  1:40 UTC (permalink / raw)
  To: shemminger; +Cc: auke-jan.h.kok, romieu, galak, netdev

From: Stephen Hemminger <shemminger@osdl.org>
Date: Thu, 14 Sep 2006 10:26:10 +0900

> sorry to pick on e1000, but the code is too verbose and
> split over too many files.  The e100 code is much cleaner.

I totally agree, I would never use e1000 as a model
driver for someone writing some new code.

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

end of thread, other threads:[~2006-09-14  1:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-13 19:40 examples to model ethernet driver off of? Kumar Gala
2006-09-13 19:54 ` Francois Romieu
2006-09-13 20:11   ` Auke Kok
2006-09-13 20:36     ` Kumar Gala
2006-09-13 20:56       ` Auke Kok
2006-09-13 21:05       ` Francois Romieu
2006-09-13 20:55     ` Francois Romieu
2006-09-14  1:26     ` Stephen Hemminger
2006-09-14  1:40       ` David Miller

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 NNTP newsgroup(s).