[PATCH] drivers/ide/ide.c to work with more IDE controllers

From: Bjorn Wesen (bjorn.wesen@axis.com)
Date: Tue Apr 24 2001 - 07:29:44 EST


Problem description:

  * drivers/ide/ide.c assumes the IDE controller is mapped in such a way
    that it can access it by "hardcoded" I/O commands (IN_BYTE/OUT_BYTE)

  * drivers/ide/ide.c assumes that polled ide/atapi transfers should be
    done the way a PC would

  * drivers/ide/Makefile assumes that all IDE DMA controllers are PCI

This makes it impossible to use for example the IDE-driver for the Etrax
controller (arch/cris) which is not memory-mapped and is not PCI-based.

The following trivial patches (against 2.4.4-pre6 but are probably
appliable to any 2.4.3-ac as well) fix the problem:

  * In include/linux/ide.h, do #ifdef HAVE_ARCH_IN_BYTE etc. around the
    definitions of IN_BYTE and OUT_BYTE (allowing include/asm/ide.h to
    bypass the standard definition - see asm-cris/ide.h for an example)

  * Add the "ideproc" entry in the HW driver structure, and let
    ide_input_bytes and friends in ide.c test that first. If it exists,
    it uses it, otherwise just do the normal PC transfer

  * In the Makefile, let ide-dma.c (which is really PCI DMA only) be
    included by CONFIG_BLK_DEV_IDEDMA_PCI instead of just

  * (Un)related addition: add ide_etrax100 as a chipset enum and an init
    call to the etrax IDE driver under #ifdef CONFIG_ETRAX_IDE

Please comment. It should all be trivial but there is one thing I'm unsure
about and that is if it's guaranteed that the HWIF's structures are nulled
upon creation (or maybe, if the primordial HWIF is nulled when copies are
made). Obviously the above patch depends on any HWIF to have NULL as
'ideproc' if it does not need any alternative function there.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:10 EST