public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][DOC] writing IDE driver guidelines
@ 2004-05-15 17:23 Bartlomiej Zolnierkiewicz
  2004-05-15 17:34 ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-05-15 17:23 UTC (permalink / raw)
  To: Marc Singer; +Cc: linux-ide, linux-kernel


Feedback is welcomed.


writing IDE driver guidelines


general rules:

- code outside drivers/ide directory shouldn't need to
  include <linux/ide.h> if it does something is wrong

- do not believe in popular myth that driver code
  can be of less quality than core kernel code

- don't copy without thinking ugly and bogus code
  (there is still lot of such in IDE)

- IDE is going into full host driver model
  so write host driver for your interface

- host drivers should request/release IO resource
  themelves and set hwif->mmio to 2

- remember about ordering issues
  (you break device ordering and some machines won't boot)

- use linux-ide@vger.kernel.org mailing list


new architecture:

- add only what is really necessary to <asm/ide.h>
  and put interface specific code into drivers/ide

- ide_init_hwif_ports() is obsolete and dying,
  define IDE_ARCH_NO_OBSOLETE_INIT in <asm/ide.h>

- define ide_default_irq(), ide_init_default_irq()
  and ide_default_io_base() to (0)

- ide_init_default_hwifs() is gone


architecture specific drivers:

- do not abuse ide_default_irq()/ide_default_io_base() from <asm/ide.h>

- your driver should be in drivers/ide/<your_arch>/<your_driver_name>

- see drivers in drivers/ide/arm and drivers/ide/legacy for examples
  (especially m68k and arm specific drivers)

- do not use ide_setup_ports()


PCI drivers:

- no need to split your driver on .c and .h files

- /proc/ide/ interfaces are obsolete


--
Bartlomiej Zolnierkiewicz (15 May 2004)


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

end of thread, other threads:[~2004-05-16 19:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-15 17:23 [RFC][DOC] writing IDE driver guidelines Bartlomiej Zolnierkiewicz
2004-05-15 17:34 ` Jeff Garzik
2004-05-15 17:58   ` Bartlomiej Zolnierkiewicz
2004-05-15 18:13     ` Bartlomiej Zolnierkiewicz
2004-05-15 22:23     ` Jeff Garzik
2004-05-16  1:00       ` Marc Singer
2004-05-16 19:34         ` Bartlomiej Zolnierkiewicz
2004-05-16 19:26       ` Bartlomiej Zolnierkiewicz
2004-05-16  0:51     ` Marc Singer
2004-05-16 19:33       ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox