--- /home/bjornw/tmp/linux/include/linux/ide.h Thu Jan 4 23:51:21 2001 +++ linux/include/linux/ide.h Wed Apr 18 13:49:54 2001 @@ -133,14 +133,6 @@ #define IDE_BCOUNTL_REG IDE_LCYL_REG #define IDE_BCOUNTH_REG IDE_HCYL_REG -#ifdef REALLY_FAST_IO -#define OUT_BYTE(b,p) outb((b),(p)) -#define IN_BYTE(p) (byte)inb(p) -#else -#define OUT_BYTE(b,p) outb_p((b),(p)) -#define IN_BYTE(p) (byte)inb_p(p) -#endif /* REALLY_FAST_IO */ - #define GET_ERR() IN_BYTE(IDE_ERROR_REG) #define GET_STAT() IN_BYTE(IDE_STATUS_REG) #define GET_ALTSTAT() IN_BYTE(IDE_CONTROL_REG) @@ -255,6 +247,27 @@ #include /* + * If the arch-dependant ide.h did not declare/define any OUT_BYTE + * or IN_BYTE functions, we make some defaults here. + */ + +#ifndef HAVE_ARCH_OUT_BYTE +#ifdef REALLY_FAST_IO +#define OUT_BYTE(b,p) outb((b),(p)) +#else +#define OUT_BYTE(b,p) outb_p((b),(p)) +#endif +#endif + +#ifndef HAVE_ARCH_IN_BYTE +#ifdef REALLY_FAST_IO +#define IN_BYTE(p) (byte)inb_p(p) +#else +#define IN_BYTE(p) (byte)inb(p) +#endif +#endif + +/* * Now for the data we need to maintain per-drive: ide_drive_t */ @@ -373,6 +386,23 @@ typedef int (ide_dmaproc_t)(ide_dma_action_t, ide_drive_t *); /* + * An ide_ideproc_t() performs CPU-polled transfers to/from a drive. + * Arguments are: the drive, the buffer pointer, and the length (in bytes or + * words depending on if it's an IDE or ATAPI call). + * + * If it is not defined for a controller, standard-code is used from ide.c. + * + * Controllers which are not memory-mapped in the standard way need to + * override that mechanism using this function to work. + * + */ +typedef enum { ideproc_ide_input_data, ideproc_ide_output_data, + ideproc_atapi_input_bytes, ideproc_atapi_output_bytes +} ide_ide_action_t; + +typedef void (ide_ideproc_t)(ide_ide_action_t, ide_drive_t *, void *, unsigned int); + +/* * An ide_tuneproc_t() is used to set the speed of an IDE interface * to a particular PIO mode. The "byte" parameter is used * to select the PIO mode by number (0,1,2,3,4,5), and a value of 255 @@ -405,7 +435,7 @@ ide_qd6580, ide_umc8672, ide_ht6560b, ide_pdc4030, ide_rz1000, ide_trm290, ide_cmd646, ide_cy82c693, ide_4drives, - ide_pmac + ide_pmac, ide_etrax100 } hwif_chipset_t; #ifdef CONFIG_BLK_DEV_IDEPCI @@ -433,6 +463,7 @@ ide_maskproc_t *maskproc; /* special host masking for drive selection */ ide_quirkproc_t *quirkproc; /* check host's drive quirk list */ ide_rw_proc_t *rwproc; /* adjust timing based upon rq->cmd direction */ + ide_ideproc_t *ideproc; /* CPU-polled transfer routine */ ide_dmaproc_t *dmaproc; /* dma read/write/abort routine */ unsigned int *dmatable_cpu; /* dma physical region descriptor table (cpu view) */ dma_addr_t dmatable_dma; /* dma physical region descriptor table (dma view) */