#ifndef _IDE_H#define _IDE_H/* * linux/include/linux/ide.h * * Copyright (C) 1994-2002 Linus Torvalds & authors */#include <linux/init.h>#include <linux/ioport.h>#include <linux/hdreg.h>#include <linux/hdsmart.h>#include <linux/blkdev.h>#include <linux/proc_fs.h>#include <linux/interrupt.h>#include <linux/bitops.h>#include <linux/bio.h>#include <linux/device.h>#include <linux/pci.h>#include <linux/completion.h>#ifdef CONFIG_BLK_DEV_IDEACPI#include <acpi/acpi.h>#endif#include <asm/byteorder.h>#include <asm/system.h>#include <asm/io.h>#include <asm/semaphore.h>#include <asm/mutex.h>/****************************************************************************** * IDE driver configuration options (play with these as desired): * * REALLY_SLOW_IO can be defined in ide.c and ide-cd.c, if necessary */#define INITIAL_MULT_COUNT 0/* off=0; on=2,4,8,16,32, etc.. */#ifndef SUPPORT_SLOW_DATA_PORTS/* 1 to support slow data ports */#define SUPPORT_SLOW_DATA_PORTS 1/* 0 to reduce kernel size */#endif#ifndef SUPPORT_VLB_SYNC/* 1 to support weird 32-bit chips */#define SUPPORT_VLB_SYNC 1/* 0 to reduce kernel size */#endif#ifndef OK_TO_RESET_CONTROLLER/* 1 needed for good error recovery */#define OK_TO_RESET_CONTROLLER 1/* 0 for use with AH2372A/B interface */#endif#ifndef DISABLE_IRQ_NOSYNC#define DISABLE_IRQ_NOSYNC 0#endif/* * Used to indicate "no IRQ", should be a value that cannot be an IRQ * number. */#define IDE_NO_IRQ (-1)/* * "No user-serviceable parts" beyond this point :) *****************************************************************************/typedefunsigned char byte;/* used everywhere *//* * Probably not wise to fiddle with these */#define ERROR_MAX 8/* Max read/write errors per sector */#define ERROR_RESET 3/* Reset controller every 4th retry */#define ERROR_RECAL 1/* Recalibrate every 2nd retry *//* * Tune flags */#define IDE_TUNE_NOAUTO 2#define IDE_TUNE_AUTO 1#define IDE_TUNE_DEFAULT 0/* * state flags */#define DMA_PIO_RETRY 1/* retrying in PIO */#define HWIF(drive) ((ide_hwif_t *)((drive)->hwif))#define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup))/* * Definitions for accessing IDE controller registers */#define IDE_NR_PORTS (10)#define IDE_DATA_OFFSET (0)#define IDE_ERROR_OFFSET (1)#define IDE_NSECTOR_OFFSET (2)#define IDE_SECTOR_OFFSET (3)#define IDE_LCYL_OFFSET (4)#define IDE_HCYL_OFFSET (5)#define IDE_SELECT_OFFSET (6)#define IDE_STATUS_OFFSET (7)#define IDE_CONTROL_OFFSET (8)#define IDE_IRQ_OFFSET (9)#define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET