Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
ide.h File Reference
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/ata.h>
#include <linux/blkdev.h>
#include <linux/proc_fs.h>
#include <linux/interrupt.h>
#include <linux/bitops.h>
#include <linux/bio.h>
#include <linux/pci.h>
#include <linux/completion.h>
#include <linux/pm.h>
#include <linux/mutex.h>
#include <asm/byteorder.h>
#include <asm/io.h>
#include <linux/cdrom.h>

Go to the source code of this file.

Data Structures

struct  ide_io_ports
 
struct  ide_hw
 
struct  ide_taskfile
 
struct  ide_cmd
 
struct  ide_atapi_pc
 
struct  ide_disk_ops
 
struct  ide_drive_s
 
struct  ide_tp_ops
 
struct  ide_port_ops
 
struct  ide_dma_ops
 
struct  hwif_s
 
struct  ide_host
 
struct  ide_devset
 
struct  ide_driver
 
struct  ide_ioctl_devset
 
struct  ide_pci_enablebit
 
struct  ide_port_info
 
struct  drive_list_entry
 
struct  ide_timing
 

Macros

#define SUPPORT_VLB_SYNC   1
 
#define IDE_DEFAULT_MAX_FAILURES   1
 
#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 */
 
#define IDE_NR_PORTS   (10)
 
#define OK_STAT(stat, good, bad)   (((stat)&((good)|(bad)))==(good))
 
#define BAD_R_STAT   (ATA_BUSY | ATA_ERR)
 
#define BAD_W_STAT   (BAD_R_STAT | ATA_DF)
 
#define BAD_STAT   (BAD_R_STAT | ATA_DRQ)
 
#define DRIVE_READY   (ATA_DRDY | ATA_DSC)
 
#define BAD_CRC   (ATA_ABORTED | ATA_ICRC)
 
#define SATA_NR_PORTS   (3) /* 16 possible ?? */
 
#define SATA_STATUS_OFFSET   (0)
 
#define SATA_ERROR_OFFSET   (1)
 
#define SATA_CONTROL_OFFSET   (2)
 
#define PRD_BYTES   8
 
#define PRD_ENTRIES   256
 
#define PARTN_BITS   6 /* number of minor dev bits for partitions */
 
#define MAX_DRIVES   2 /* per interface; 2 assumed by lots of code */
 
#define SECTOR_SIZE   512
 
#define REQ_DRIVE_RESET   0x20
 
#define REQ_DEVSET_EXEC   0x21
 
#define REQ_PARK_HEADS   0x22
 
#define REQ_UNPARK_HEADS   0x23
 
#define MAX_HWIFS   10
 
#define ide_scsi   0x21
 
#define ide_disk   0x20
 
#define ide_optical   0x7
 
#define ide_cdrom   0x5
 
#define ide_tape   0x1
 
#define ide_floppy   0x0
 
#define ATAPI_WAIT_PC   (60 * HZ)
 
#define to_ide_device(dev)   container_of(dev, ide_drive_t, gendev)
 
#define to_ide_drv(obj, cont_type)   container_of(obj, struct cont_type, dev)
 
#define ide_drv_g(disk, cont_type)   container_of((disk)->private_data, struct cont_type, driver)
 
#define MAX_HOST_PORTS   4
 
#define IDE_HOST_BUSY   0
 
#define DS_SYNC   (1 << 0)
 
#define __DEVSET(_flags, _get, _set)
 
#define ide_devset_get(name, field)
 
#define ide_devset_set(name, field)
 
#define ide_devset_get_flag(name, flag)
 
#define ide_devset_set_flag(name, flag)
 
#define __IDE_DEVSET(_name, _flags, _get, _set)
 
#define IDE_DEVSET(_name, _flags, _get, _set)   static __IDE_DEVSET(_name, _flags, _get, _set)
 
#define ide_devset_rw(_name, _func)   IDE_DEVSET(_name, 0, get_##_func, set_##_func)
 
#define ide_devset_w(_name, _func)   IDE_DEVSET(_name, 0, NULL, set_##_func)
 
#define ide_ext_devset_rw(_name, _func)   __IDE_DEVSET(_name, 0, get_##_func, set_##_func)
 
#define ide_ext_devset_rw_sync(_name, _func)   __IDE_DEVSET(_name, DS_SYNC, get_##_func, set_##_func)
 
#define ide_decl_devset(_name)   extern const struct ide_devset ide_devset_##_name
 
#define __ide_debug_log(lvl, fmt, args...)
 
#define to_ide_driver(drv)   container_of(drv, struct ide_driver, gen_driver)
 
#define ide_pci_register_driver(d)   pci_register_driver(d)
 
#define IDE_HFLAG_OFF_BOARD   IDE_HFLAG_NON_BOOTABLE
 
#define ide_pci_suspend   NULL
 
#define ide_pci_resume   NULL
 
#define BAD_DMA_DRIVE   0
 
#define GOOD_DMA_DRIVE   1
 
#define ide_port_for_each_dev(i, dev, port)   for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++)
 
#define ide_port_for_each_present_dev(i, dev, port)
 
#define ide_host_for_each_port(i, port, host)   for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++)
 

Typedefs

typedef u8 hwif_chipset_t
 
typedef struct ide_drive_s ide_drive_t
 
typedef struct hwif_s ide_hwif_t
 
typedef ide_startstop_tide_handler_t )(ide_drive_t *)
 
typedef intide_expiry_t )(ide_drive_t *)
 
typedef voidxfer_func_t )(ide_drive_t *, struct ide_cmd *, void *, unsigned)
 

Enumerations

enum  { IDE_DRV_ERROR_GENERAL = 101, IDE_DRV_ERROR_FILEMARK = 102, IDE_DRV_ERROR_EOD = 103 }
 
enum  {
  WAIT_DRQ = 1 * HZ, WAIT_READY = 5 * HZ, WAIT_PIDENTIFY = 10 * HZ, WAIT_WORSTCASE = 30 * HZ,
  WAIT_CMD = 10 * HZ, WAIT_FLOPPY_CMD = 50 * HZ, WAIT_TAPE_CMD = 900 * HZ, WAIT_MIN_SLEEP = HZ / 50
}
 
enum  {
  ide_unknown, ide_generic, ide_pci, ide_cmd640,
  ide_dtc2278, ide_ali14xx, ide_qd65xx, ide_umc8672,
  ide_ht6560b, ide_4drives, ide_pmac, ide_acorn,
  ide_au1xxx, ide_palm3710
}
 
enum  { IDE_SFLAG_SET_GEOMETRY = (1 << 0), IDE_SFLAG_RECALIBRATE = (1 << 1), IDE_SFLAG_SET_MULTMODE = (1 << 2) }
 
enum  ide_startstop_t { ide_stopped, ide_started }
 
enum  {
  IDE_VALID_ERROR = (1 << 1), IDE_VALID_FEATURE = IDE_VALID_ERROR, IDE_VALID_NSECT = (1 << 2), IDE_VALID_LBAL = (1 << 3),
  IDE_VALID_LBAM = (1 << 4), IDE_VALID_LBAH = (1 << 5), IDE_VALID_DEVICE = (1 << 6), IDE_VALID_LBA,
  IDE_VALID_OUT_TF, IDE_VALID_IN_TF, IDE_VALID_OUT_HOB = IDE_VALID_OUT_TF, IDE_VALID_IN_HOB
}
 
enum  {
  IDE_TFLAG_LBA48 = (1 << 0), IDE_TFLAG_WRITE = (1 << 1), IDE_TFLAG_CUSTOM_HANDLER = (1 << 2), IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 3),
  IDE_TFLAG_IO_16BIT = (1 << 4), IDE_TFLAG_DYN = (1 << 5), IDE_TFLAG_FS = (1 << 6), IDE_TFLAG_MULTI_PIO = (1 << 7),
  IDE_TFLAG_SET_XFER = (1 << 8)
}
 
enum  { IDE_FTFLAG_FLAGGED = (1 << 0), IDE_FTFLAG_SET_IN_FLAGS = (1 << 1), IDE_FTFLAG_OUT_DATA = (1 << 2), IDE_FTFLAG_IN_DATA = (1 << 3) }
 
enum  {
  PC_FLAG_ABORT = (1 << 0), PC_FLAG_SUPPRESS_ERROR = (1 << 1), PC_FLAG_WAIT_FOR_DSC = (1 << 2), PC_FLAG_DMA_OK = (1 << 3),
  PC_FLAG_DMA_IN_PROGRESS = (1 << 4), PC_FLAG_DMA_ERROR = (1 << 5), PC_FLAG_WRITING = (1 << 6)
}
 
enum  {
  IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), IDE_AFLAG_NO_EJECT = (1 << 1), IDE_AFLAG_PRE_ATAPI12 = (1 << 2), IDE_AFLAG_TOCADDR_AS_BCD = (1 << 3),
  IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 4), IDE_AFLAG_TOC_VALID = (1 << 6), IDE_AFLAG_DOOR_LOCKED = (1 << 7), IDE_AFLAG_NO_SPEED_SELECT = (1 << 8),
  IDE_AFLAG_VERTOS_300_SSD = (1 << 9), IDE_AFLAG_VERTOS_600_ESD = (1 << 10), IDE_AFLAG_SANYO_3CD = (1 << 11), IDE_AFLAG_FULL_CAPS_PAGE = (1 << 12),
  IDE_AFLAG_PLAY_AUDIO_OK = (1 << 13), IDE_AFLAG_LE_SPEED_FIELDS = (1 << 14), IDE_AFLAG_CLIK_DRIVE = (1 << 15), IDE_AFLAG_ZIP_DRIVE = (1 << 16),
  IDE_AFLAG_SRFP = (1 << 17), IDE_AFLAG_IGNORE_DSC = (1 << 18), IDE_AFLAG_ADDRESS_VALID = (1 << 19), IDE_AFLAG_BUSY = (1 << 20),
  IDE_AFLAG_DETECT_BS = (1 << 21), IDE_AFLAG_FILEMARK = (1 << 22), IDE_AFLAG_MEDIUM_PRESENT = (1 << 23), IDE_AFLAG_NO_AUTOCLOSE = (1 << 24)
}
 
enum  {
  IDE_DFLAG_KEEP_SETTINGS = (1 << 0), IDE_DFLAG_USING_DMA = (1 << 1), IDE_DFLAG_UNMASK = (1 << 2), IDE_DFLAG_NOFLUSH = (1 << 3),
  IDE_DFLAG_DSC_OVERLAP = (1 << 4), IDE_DFLAG_NICE1 = (1 << 5), IDE_DFLAG_PRESENT = (1 << 6), IDE_DFLAG_NOHPA = (1 << 7),
  IDE_DFLAG_ID_READ = (1 << 8), IDE_DFLAG_NOPROBE = (1 << 9), IDE_DFLAG_REMOVABLE = (1 << 10), IDE_DFLAG_ATTACH = (1 << 11),
  IDE_DFLAG_FORCED_GEOM = (1 << 12), IDE_DFLAG_NO_UNMASK = (1 << 13), IDE_DFLAG_NO_IO_32BIT = (1 << 14), IDE_DFLAG_DOORLOCKING = (1 << 15),
  IDE_DFLAG_NODMA = (1 << 16), IDE_DFLAG_BLOCKED = (1 << 17), IDE_DFLAG_SLEEPING = (1 << 18), IDE_DFLAG_POST_RESET = (1 << 19),
  IDE_DFLAG_UDMA33_WARNED = (1 << 20), IDE_DFLAG_LBA48 = (1 << 21), IDE_DFLAG_WCACHE = (1 << 22), IDE_DFLAG_NOWERR = (1 << 23),
  IDE_DFLAG_DMA_PIO_RETRY = (1 << 24), IDE_DFLAG_LBA = (1 << 25), IDE_DFLAG_NO_UNLOAD = (1 << 26), IDE_DFLAG_PARKED = (1 << 27),
  IDE_DFLAG_MEDIA_CHANGED = (1 << 28), IDE_DFLAG_WP = (1 << 29), IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30), IDE_DFLAG_NIEN_QUIRK = (1 << 31)
}
 
enum  { IDE_PFLAG_PROBING = (1 << 0) }
 
enum  {
  IDE_DBG_FUNC = (1 << 0), IDE_DBG_SENSE = (1 << 1), IDE_DBG_PC = (1 << 2), IDE_DBG_RQ = (1 << 3),
  IDE_DBG_PROBE = (1 << 4)
}
 
enum  {
  IDE_PM_START_SUSPEND, IDE_PM_FLUSH_CACHE = IDE_PM_START_SUSPEND, IDE_PM_STANDBY, IDE_PM_START_RESUME,
  IDE_PM_RESTORE_PIO = IDE_PM_START_RESUME, IDE_PM_IDLE, IDE_PM_RESTORE_DMA, IDE_PM_COMPLETED
}
 
enum  { REQ_IDETAPE_PC1 = (1 << 0), REQ_IDETAPE_PC2 = (1 << 1), REQ_IDETAPE_READ = (1 << 2), REQ_IDETAPE_WRITE = (1 << 3) }
 
enum  {
  IDE_HFLAG_ISA_PORTS = (1 << 0), IDE_HFLAG_SINGLE = (1 << 1), IDE_HFLAG_PIO_NO_BLACKLIST = (1 << 2), IDE_HFLAG_QD_2ND_PORT = (1 << 3),
  IDE_HFLAG_ABUSE_PREFETCH = (1 << 4), IDE_HFLAG_ABUSE_FAST_DEVSEL = (1 << 5), IDE_HFLAG_ABUSE_DMA_MODES = (1 << 6), IDE_HFLAG_SET_PIO_MODE_KEEP_DMA = (1 << 7),
  IDE_HFLAG_POST_SET_MODE = (1 << 8), IDE_HFLAG_NO_SET_MODE = (1 << 9), IDE_HFLAG_TRUST_BIOS_FOR_DMA = (1 << 10), IDE_HFLAG_CS5520 = (1 << 11),
  IDE_HFLAG_NO_ATAPI_DMA = (1 << 12), IDE_HFLAG_NON_BOOTABLE = (1 << 13), IDE_HFLAG_NO_DMA = (1 << 14), IDE_HFLAG_NO_AUTODMA = (1 << 15),
  IDE_HFLAG_MMIO = (1 << 16), IDE_HFLAG_NO_LBA48 = (1 << 17), IDE_HFLAG_NO_LBA48_DMA = (1 << 18), IDE_HFLAG_ERROR_STOPS_FIFO = (1 << 19),
  IDE_HFLAG_SERIALIZE = (1 << 20), IDE_HFLAG_DTC2278 = (1 << 21), IDE_HFLAG_4DRIVES = (1 << 22), IDE_HFLAG_TRM290 = (1 << 23),
  IDE_HFLAG_IO_32BIT = (1 << 24), IDE_HFLAG_UNMASK_IRQS = (1 << 25), IDE_HFLAG_BROKEN_ALTSTATUS = (1 << 26), IDE_HFLAG_SERIALIZE_DMA = (1 << 27),
  IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28), IDE_HFLAG_NO_DSC = (1 << 29), IDE_HFLAG_NO_IO_32BIT = (1 << 30), IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31)
}
 
enum  {
  IDE_TIMING_SETUP = (1 << 0), IDE_TIMING_ACT8B = (1 << 1), IDE_TIMING_REC8B = (1 << 2), IDE_TIMING_CYC8B = (1 << 3),
  IDE_TIMING_8BIT, IDE_TIMING_ACTIVE = (1 << 4), IDE_TIMING_RECOVER = (1 << 5), IDE_TIMING_CYCLE = (1 << 6),
  IDE_TIMING_UDMA = (1 << 7), IDE_TIMING_ALL
}
 

Functions

 ide_decl_devset (io_32bit)
 
 ide_decl_devset (keepsettings)
 
 ide_decl_devset (pio_mode)
 
 ide_decl_devset (unmaskirq)
 
 ide_decl_devset (using_dma)
 
int generic_ide_suspend (struct device *, pm_message_t)
 
int generic_ide_resume (struct device *)
 
void ide_complete_power_step (ide_drive_t *, struct request *)
 
ide_startstop_t ide_start_power_step (ide_drive_t *, struct request *)
 
void ide_complete_pm_rq (ide_drive_t *, struct request *)
 
void ide_check_pm_state (ide_drive_t *, struct request *)
 
int ide_device_get (ide_drive_t *)
 
void ide_device_put (ide_drive_t *)
 
int ide_setting_ioctl (ide_drive_t *, struct block_device *, unsigned int, unsigned long, const struct ide_ioctl_devset *)
 
int generic_ide_ioctl (ide_drive_t *, struct block_device *, unsigned, unsigned long)
 
int ide_end_rq (ide_drive_t *, struct request *, int, unsigned int)
 
void ide_kill_rq (ide_drive_t *, struct request *)
 
void __ide_set_handler (ide_drive_t *, ide_handler_t *, unsigned int)
 
void ide_set_handler (ide_drive_t *, ide_handler_t *, unsigned int)
 
void ide_execute_command (ide_drive_t *, struct ide_cmd *, ide_handler_t *, unsigned int)
 
void ide_pad_transfer (ide_drive_t *, int, int)
 
ide_startstop_t ide_error (ide_drive_t *, const char *, u8)
 
void ide_fix_driveid (u16 *)
 
void ide_fixstring (u8 *, const int, const int)
 
int ide_busy_sleep (ide_drive_t *, unsigned long, int)
 
int __ide_wait_stat (ide_drive_t *, u8, u8, unsigned long, u8 *)
 
int ide_wait_stat (ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long)
 
ide_startstop_t ide_do_park_unpark (ide_drive_t *, struct request *)
 
ide_startstop_t ide_do_devset (ide_drive_t *, struct request *)
 
ide_startstop_t ide_do_reset (ide_drive_t *)
 
int ide_devset_execute (ide_drive_t *drive, const struct ide_devset *setting, int arg)
 
void ide_complete_cmd (ide_drive_t *, struct ide_cmd *, u8, u8)
 
int ide_complete_rq (ide_drive_t *, int, unsigned int)
 
void ide_tf_readback (ide_drive_t *drive, struct ide_cmd *cmd)
 
void ide_tf_dump (const char *, struct ide_cmd *)
 
void ide_exec_command (ide_hwif_t *, u8)
 
u8 ide_read_status (ide_hwif_t *)
 
u8 ide_read_altstatus (ide_hwif_t *)
 
void ide_write_devctl (ide_hwif_t *, u8)
 
void ide_dev_select (ide_drive_t *)
 
void ide_tf_load (ide_drive_t *, struct ide_taskfile *, u8)
 
void ide_tf_read (ide_drive_t *, struct ide_taskfile *, u8)
 
void ide_input_data (ide_drive_t *, struct ide_cmd *, void *, unsigned int)
 
void ide_output_data (ide_drive_t *, struct ide_cmd *, void *, unsigned int)
 
void SELECT_MASK (ide_drive_t *, int)
 
u8 ide_read_error (ide_drive_t *)
 
void ide_read_bcount_and_ireason (ide_drive_t *, u16 *, u8 *)
 
int ide_check_ireason (ide_drive_t *, struct request *, int, int, int)
 
int ide_check_atapi_device (ide_drive_t *, const char *)
 
void ide_init_pc (struct ide_atapi_pc *)
 
ssize_t ide_park_show (struct device *dev, struct device_attribute *attr, char *buf)
 
ssize_t ide_park_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t len)
 
int ide_queue_pc_tail (ide_drive_t *, struct gendisk *, struct ide_atapi_pc *, void *, unsigned int)
 
int ide_do_test_unit_ready (ide_drive_t *, struct gendisk *)
 
int ide_do_start_stop (ide_drive_t *, struct gendisk *, int)
 
int ide_set_media_lock (ide_drive_t *, struct gendisk *, int)
 
void ide_create_request_sense_cmd (ide_drive_t *, struct ide_atapi_pc *)
 
void ide_retry_pc (ide_drive_t *drive)
 
void ide_prep_sense (ide_drive_t *drive, struct request *rq)
 
int ide_queue_sense_rq (ide_drive_t *drive, void *special)
 
int ide_cd_expiry (ide_drive_t *)
 
int ide_cd_get_xferlen (struct request *)
 
ide_startstop_t ide_issue_pc (ide_drive_t *, struct ide_cmd *)
 
ide_startstop_t do_rw_taskfile (ide_drive_t *, struct ide_cmd *)
 
void ide_pio_bytes (ide_drive_t *, struct ide_cmd *, unsigned int, unsigned int)
 
void ide_finish_cmd (ide_drive_t *, struct ide_cmd *, u8)
 
int ide_raw_taskfile (ide_drive_t *, struct ide_cmd *, u8 *, u16)
 
int ide_no_data_taskfile (ide_drive_t *, struct ide_cmd *)
 
int ide_taskfile_ioctl (ide_drive_t *, unsigned long)
 
int ide_dev_read_id (ide_drive_t *, u8, u16 *, int)
 
int ide_driveid_update (ide_drive_t *)
 
int ide_config_drive_speed (ide_drive_t *, u8)
 
u8 eighty_ninty_three (ide_drive_t *)
 
int taskfile_lib_get_identify (ide_drive_t *drive, u8 *)
 
int ide_wait_not_busy (ide_hwif_t *hwif, unsigned long timeout)
 
void ide_stall_queue (ide_drive_t *drive, unsigned long timeout)
 
void ide_timer_expiry (unsigned long)
 
irqreturn_t ide_intr (int irq, void *dev_id)
 
void do_ide_request (struct request_queue *)
 
void ide_requeue_and_plug (ide_drive_t *drive, struct request *rq)
 
void ide_init_disk (struct gendisk *, ide_drive_t *)
 
void ide_pci_setup_ports (struct pci_dev *, const struct ide_port_info *, struct ide_hw *, struct ide_hw **)
 
void ide_setup_pci_noise (struct pci_dev *, const struct ide_port_info *)
 
int ide_pci_init_one (struct pci_dev *, const struct ide_port_info *, void *)
 
int ide_pci_init_two (struct pci_dev *, struct pci_dev *, const struct ide_port_info *, void *)
 
void ide_pci_remove (struct pci_dev *)
 
void ide_map_sg (ide_drive_t *, struct ide_cmd *)
 
void ide_init_sg_cmd (struct ide_cmd *, unsigned int)
 
int ide_in_drive_list (u16 *, const struct drive_list_entry *)
 
void ide_register_region (struct gendisk *)
 
void ide_unregister_region (struct gendisk *)
 
void ide_check_nien_quirk_list (ide_drive_t *)
 
void ide_undecoded_slave (ide_drive_t *)
 
void ide_port_apply_params (ide_hwif_t *)
 
int ide_sysfs_register_port (ide_hwif_t *)
 
struct ide_hostide_host_alloc (const struct ide_port_info *, struct ide_hw **, unsigned int)
 
void ide_host_free (struct ide_host *)
 
int ide_host_register (struct ide_host *, const struct ide_port_info *, struct ide_hw **)
 
int ide_host_add (const struct ide_port_info *, struct ide_hw **, unsigned int, struct ide_host **)
 
void ide_host_remove (struct ide_host *)
 
int ide_legacy_device_add (const struct ide_port_info *, unsigned long)
 
void ide_port_unregister_devices (ide_hwif_t *)
 
void ide_port_scan (ide_hwif_t *)
 
void ide_toggle_bounce (ide_drive_t *drive, int on)
 
u64 ide_get_lba_addr (struct ide_cmd *, int)
 
u8 ide_dump_status (ide_drive_t *, const char *, u8)
 
struct ide_timingide_timing_find_mode (u8)
 
u16 ide_pio_cycle_time (ide_drive_t *, u8)
 
void ide_timing_merge (struct ide_timing *, struct ide_timing *, struct ide_timing *, unsigned int)
 
int ide_timing_compute (ide_drive_t *, u8, struct ide_timing *, int, int)
 
charide_media_string (ide_drive_t *)
 

Variables

struct ide_tp_ops default_tp_ops
 
struct mutex ide_setting_mtx
 
int ide_vlb_clk
 
int ide_pci_clk
 
wait_queue_head_t ide_park_wq
 
struct device_attribute ide_dev_attrs []
 
struct bus_type ide_bus_type
 
struct classide_port_class
 

Macro Definition Documentation

#define __DEVSET (   _flags,
  _get,
  _set 
)
Value:
{ \
.flags = _flags, \
.get = _get, \
.set = _set, \
}

Definition at line 823 of file ide.h.

#define __ide_debug_log (   lvl,
  fmt,
  args... 
)
Value:
{ \
if (unlikely(drive->debug_mask & lvl)) \
printk(KERN_INFO DRV_NAME ": %s: " fmt "\n", \
__func__, ## args); \
}

Definition at line 965 of file ide.h.

#define __IDE_DEVSET (   _name,
  _flags,
  _get,
  _set 
)
Value:
const struct ide_devset ide_devset_##_name = \
__DEVSET(_flags, _get, _set)

Definition at line 858 of file ide.h.

#define ATAPI_WAIT_PC   (60 * HZ)

Definition at line 328 of file ide.h.

#define BAD_CRC   (ATA_ABORTED | ATA_ICRC)

Definition at line 90 of file ide.h.

#define BAD_DMA_DRIVE   0

Definition at line 1337 of file ide.h.

#define BAD_R_STAT   (ATA_BUSY | ATA_ERR)

Definition at line 85 of file ide.h.

#define BAD_STAT   (BAD_R_STAT | ATA_DRQ)

Definition at line 87 of file ide.h.

#define BAD_W_STAT   (BAD_R_STAT | ATA_DF)

Definition at line 86 of file ide.h.

#define DRIVE_READY   (ATA_DRDY | ATA_DSC)

Definition at line 88 of file ide.h.

#define DS_SYNC   (1 << 0)

Definition at line 815 of file ide.h.

#define ERROR_MAX   8 /* Max read/write errors per sector */

Definition at line 40 of file ide.h.

#define ERROR_RECAL   1 /* Recalibrate every 2nd retry */

Definition at line 42 of file ide.h.

#define ERROR_RESET   3 /* Reset controller every 4th retry */

Definition at line 41 of file ide.h.

#define GOOD_DMA_DRIVE   1

Definition at line 1338 of file ide.h.

#define ide_cdrom   0x5

Definition at line 207 of file ide.h.

#define ide_decl_devset (   _name)    extern const struct ide_devset ide_devset_##_name

Definition at line 877 of file ide.h.

#define IDE_DEFAULT_MAX_FAILURES   1

Definition at line 39 of file ide.h.

#define IDE_DEVSET (   _name,
  _flags,
  _get,
  _set 
)    static __IDE_DEVSET(_name, _flags, _get, _set)

Definition at line 862 of file ide.h.

#define ide_devset_get (   name,
  field 
)
Value:
static int get_##name(ide_drive_t *drive) \
{ \
return drive->field; \
}

Definition at line 829 of file ide.h.

#define ide_devset_get_flag (   name,
  flag 
)
Value:
static int get_##name(ide_drive_t *drive) \
{ \
return !!(drive->dev_flags & flag); \
}

Definition at line 842 of file ide.h.

#define ide_devset_rw (   _name,
  _func 
)    IDE_DEVSET(_name, 0, get_##_func, set_##_func)

Definition at line 865 of file ide.h.

#define ide_devset_set (   name,
  field 
)
Value:
static int set_##name(ide_drive_t *drive, int arg) \
{ \
drive->field = arg; \
return 0; \
}

Definition at line 835 of file ide.h.

#define ide_devset_set_flag (   name,
  flag 
)
Value:
static int set_##name(ide_drive_t *drive, int arg) \
{ \
if (arg) \
drive->dev_flags |= flag; \
else \
drive->dev_flags &= ~flag; \
return 0; \
}

Definition at line 848 of file ide.h.

#define ide_devset_w (   _name,
  _func 
)    IDE_DEVSET(_name, 0, NULL, set_##_func)

Definition at line 868 of file ide.h.

#define ide_disk   0x20

Definition at line 205 of file ide.h.

#define ide_drv_g (   disk,
  cont_type 
)    container_of((disk)->private_data, struct cont_type, driver)

Definition at line 584 of file ide.h.

#define ide_ext_devset_rw (   _name,
  _func 
)    __IDE_DEVSET(_name, 0, get_##_func, set_##_func)

Definition at line 871 of file ide.h.

#define ide_ext_devset_rw_sync (   _name,
  _func 
)    __IDE_DEVSET(_name, DS_SYNC, get_##_func, set_##_func)

Definition at line 874 of file ide.h.

#define ide_floppy   0x0

Definition at line 209 of file ide.h.

#define IDE_HFLAG_OFF_BOARD   IDE_HFLAG_NON_BOOTABLE

Definition at line 1285 of file ide.h.

#define IDE_HOST_BUSY   0

Definition at line 798 of file ide.h.

#define ide_host_for_each_port (   i,
  port,
  host 
)    for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++)

Definition at line 1555 of file ide.h.

#define IDE_NR_PORTS   (10)

Definition at line 56 of file ide.h.

#define ide_optical   0x7

Definition at line 206 of file ide.h.

#define ide_pci_register_driver (   d)    pci_register_driver(d)

Definition at line 1180 of file ide.h.

#define ide_pci_resume   NULL

Definition at line 1331 of file ide.h.

#define ide_pci_suspend   NULL

Definition at line 1330 of file ide.h.

#define ide_port_for_each_dev (   i,
  dev,
  port 
)    for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++)

Definition at line 1548 of file ide.h.

#define ide_port_for_each_present_dev (   i,
  dev,
  port 
)
Value:
for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) \
if ((dev)->dev_flags & IDE_DFLAG_PRESENT)

Definition at line 1551 of file ide.h.

#define ide_scsi   0x21

Definition at line 204 of file ide.h.

#define ide_tape   0x1

Definition at line 208 of file ide.h.

#define MAX_DRIVES   2 /* per interface; 2 assumed by lots of code */

Definition at line 121 of file ide.h.

#define MAX_HOST_PORTS   4

Definition at line 773 of file ide.h.

#define MAX_HWIFS   10

Definition at line 198 of file ide.h.

#define OK_STAT (   stat,
  good,
  bad 
)    (((stat)&((good)|(bad)))==(good))

Definition at line 83 of file ide.h.

#define PARTN_BITS   6 /* number of minor dev bits for partitions */

Definition at line 120 of file ide.h.

#define PRD_BYTES   8

Definition at line 114 of file ide.h.

#define PRD_ENTRIES   256

Definition at line 115 of file ide.h.

#define REQ_DEVSET_EXEC   0x21

Definition at line 155 of file ide.h.

#define REQ_DRIVE_RESET   0x20

Definition at line 154 of file ide.h.

#define REQ_PARK_HEADS   0x22

Definition at line 156 of file ide.h.

#define REQ_UNPARK_HEADS   0x23

Definition at line 157 of file ide.h.

#define SATA_CONTROL_OFFSET   (2)

Definition at line 96 of file ide.h.

#define SATA_ERROR_OFFSET   (1)

Definition at line 95 of file ide.h.

#define SATA_NR_PORTS   (3) /* 16 possible ?? */

Definition at line 92 of file ide.h.

#define SATA_STATUS_OFFSET   (0)

Definition at line 94 of file ide.h.

#define SECTOR_SIZE   512

Definition at line 122 of file ide.h.

#define SUPPORT_VLB_SYNC   1

Definition at line 33 of file ide.h.

#define to_ide_device (   dev)    container_of(dev, ide_drive_t, gendev)

Definition at line 579 of file ide.h.

#define to_ide_driver (   drv)    container_of(drv, struct ide_driver, gen_driver)

Definition at line 1031 of file ide.h.

#define to_ide_drv (   obj,
  cont_type 
)    container_of(obj, struct cont_type, dev)

Definition at line 581 of file ide.h.

Typedef Documentation

typedef u8 hwif_chipset_t

Definition at line 170 of file ide.h.

Definition at line 577 of file ide.h.

typedef int( ide_expiry_t)(ide_drive_t *)

Definition at line 804 of file ide.h.

typedef ide_startstop_t( ide_handler_t)(ide_drive_t *)

Definition at line 803 of file ide.h.

typedef void( xfer_func_t)(ide_drive_t *, struct ide_cmd *, void *, unsigned)

Definition at line 807 of file ide.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
IDE_DRV_ERROR_GENERAL 
IDE_DRV_ERROR_FILEMARK 
IDE_DRV_ERROR_EOD 

Definition at line 47 of file ide.h.

anonymous enum
Enumerator:
WAIT_DRQ 
WAIT_READY 
WAIT_PIDENTIFY 
WAIT_WORSTCASE 
WAIT_CMD 
WAIT_FLOPPY_CMD 
WAIT_TAPE_CMD 
WAIT_MIN_SLEEP 

Definition at line 127 of file ide.h.

anonymous enum
Enumerator:
ide_unknown 
ide_generic 
ide_pci 
ide_cmd640 
ide_dtc2278 
ide_ali14xx 
ide_qd65xx 
ide_umc8672 
ide_ht6560b 
ide_4drives 
ide_pmac 
ide_acorn 
ide_au1xxx 
ide_palm3710 

Definition at line 163 of file ide.h.

anonymous enum
Enumerator:
IDE_SFLAG_SET_GEOMETRY 
IDE_SFLAG_RECALIBRATE 
IDE_SFLAG_SET_MULTMODE 

Definition at line 214 of file ide.h.

anonymous enum
Enumerator:
IDE_VALID_ERROR 
IDE_VALID_FEATURE 
IDE_VALID_NSECT 
IDE_VALID_LBAL 
IDE_VALID_LBAM 
IDE_VALID_LBAH 
IDE_VALID_DEVICE 
IDE_VALID_LBA 
IDE_VALID_OUT_TF 
IDE_VALID_IN_TF 
IDE_VALID_OUT_HOB 
IDE_VALID_IN_HOB 

Definition at line 228 of file ide.h.

anonymous enum
Enumerator:
IDE_TFLAG_LBA48 
IDE_TFLAG_WRITE 
IDE_TFLAG_CUSTOM_HANDLER 
IDE_TFLAG_DMA_PIO_FALLBACK 
IDE_TFLAG_IO_16BIT 
IDE_TFLAG_DYN 
IDE_TFLAG_FS 
IDE_TFLAG_MULTI_PIO 
IDE_TFLAG_SET_XFER 

Definition at line 250 of file ide.h.

anonymous enum
Enumerator:
IDE_FTFLAG_FLAGGED 
IDE_FTFLAG_SET_IN_FLAGS 
IDE_FTFLAG_OUT_DATA 
IDE_FTFLAG_IN_DATA 

Definition at line 264 of file ide.h.

anonymous enum
Enumerator:
PC_FLAG_ABORT 
PC_FLAG_SUPPRESS_ERROR 
PC_FLAG_WAIT_FOR_DSC 
PC_FLAG_DMA_OK 
PC_FLAG_DMA_IN_PROGRESS 
PC_FLAG_DMA_ERROR 
PC_FLAG_WRITING 

Definition at line 317 of file ide.h.

anonymous enum
Enumerator:
IDE_AFLAG_DRQ_INTERRUPT 
IDE_AFLAG_NO_EJECT 
IDE_AFLAG_PRE_ATAPI12 
IDE_AFLAG_TOCADDR_AS_BCD 
IDE_AFLAG_TOCTRACKS_AS_BCD 
IDE_AFLAG_TOC_VALID 
IDE_AFLAG_DOOR_LOCKED 
IDE_AFLAG_NO_SPEED_SELECT 
IDE_AFLAG_VERTOS_300_SSD 
IDE_AFLAG_VERTOS_600_ESD 
IDE_AFLAG_SANYO_3CD 
IDE_AFLAG_FULL_CAPS_PAGE 
IDE_AFLAG_PLAY_AUDIO_OK 
IDE_AFLAG_LE_SPEED_FIELDS 
IDE_AFLAG_CLIK_DRIVE 
IDE_AFLAG_ZIP_DRIVE 
IDE_AFLAG_SRFP 
IDE_AFLAG_IGNORE_DSC 
IDE_AFLAG_ADDRESS_VALID 
IDE_AFLAG_BUSY 
IDE_AFLAG_DETECT_BS 
IDE_AFLAG_FILEMARK 
IDE_AFLAG_MEDIUM_PRESENT 
IDE_AFLAG_NO_AUTOCLOSE 

Definition at line 378 of file ide.h.

anonymous enum
Enumerator:
IDE_DFLAG_KEEP_SETTINGS 
IDE_DFLAG_USING_DMA 
IDE_DFLAG_UNMASK 
IDE_DFLAG_NOFLUSH 
IDE_DFLAG_DSC_OVERLAP 
IDE_DFLAG_NICE1 
IDE_DFLAG_PRESENT 
IDE_DFLAG_NOHPA 
IDE_DFLAG_ID_READ 
IDE_DFLAG_NOPROBE 
IDE_DFLAG_REMOVABLE 
IDE_DFLAG_ATTACH 
IDE_DFLAG_FORCED_GEOM 
IDE_DFLAG_NO_UNMASK 
IDE_DFLAG_NO_IO_32BIT 
IDE_DFLAG_DOORLOCKING 
IDE_DFLAG_NODMA 
IDE_DFLAG_BLOCKED 
IDE_DFLAG_SLEEPING 
IDE_DFLAG_POST_RESET 
IDE_DFLAG_UDMA33_WARNED 
IDE_DFLAG_LBA48 
IDE_DFLAG_WCACHE 
IDE_DFLAG_NOWERR 
IDE_DFLAG_DMA_PIO_RETRY 
IDE_DFLAG_LBA 
IDE_DFLAG_NO_UNLOAD 
IDE_DFLAG_PARKED 
IDE_DFLAG_MEDIA_CHANGED 
IDE_DFLAG_WP 
IDE_DFLAG_FORMAT_IN_PROGRESS 
IDE_DFLAG_NIEN_QUIRK 

Definition at line 428 of file ide.h.

anonymous enum
Enumerator:
IDE_PFLAG_PROBING 

Definition at line 661 of file ide.h.

anonymous enum
Enumerator:
IDE_DBG_FUNC 
IDE_DBG_SENSE 
IDE_DBG_PC 
IDE_DBG_RQ 
IDE_DBG_PROBE 

Definition at line 951 of file ide.h.

anonymous enum
Enumerator:
IDE_PM_START_SUSPEND 
IDE_PM_FLUSH_CACHE 
IDE_PM_STANDBY 
IDE_PM_START_RESUME 
IDE_PM_RESTORE_PIO 
IDE_PM_IDLE 
IDE_PM_RESTORE_DMA 
IDE_PM_COMPLETED 

Definition at line 990 of file ide.h.

anonymous enum
Enumerator:
REQ_IDETAPE_PC1 
REQ_IDETAPE_PC2 
REQ_IDETAPE_READ 
REQ_IDETAPE_WRITE 

Definition at line 1122 of file ide.h.

anonymous enum
Enumerator:
IDE_HFLAG_ISA_PORTS 
IDE_HFLAG_SINGLE 
IDE_HFLAG_PIO_NO_BLACKLIST 
IDE_HFLAG_QD_2ND_PORT 
IDE_HFLAG_ABUSE_PREFETCH 
IDE_HFLAG_ABUSE_FAST_DEVSEL 
IDE_HFLAG_ABUSE_DMA_MODES 
IDE_HFLAG_SET_PIO_MODE_KEEP_DMA 
IDE_HFLAG_POST_SET_MODE 
IDE_HFLAG_NO_SET_MODE 
IDE_HFLAG_TRUST_BIOS_FOR_DMA 
IDE_HFLAG_CS5520 
IDE_HFLAG_NO_ATAPI_DMA 
IDE_HFLAG_NON_BOOTABLE 
IDE_HFLAG_NO_DMA 
IDE_HFLAG_NO_AUTODMA 
IDE_HFLAG_MMIO 
IDE_HFLAG_NO_LBA48 
IDE_HFLAG_NO_LBA48_DMA 
IDE_HFLAG_ERROR_STOPS_FIFO 
IDE_HFLAG_SERIALIZE 
IDE_HFLAG_DTC2278 
IDE_HFLAG_4DRIVES 
IDE_HFLAG_TRM290 
IDE_HFLAG_IO_32BIT 
IDE_HFLAG_UNMASK_IRQS 
IDE_HFLAG_BROKEN_ALTSTATUS 
IDE_HFLAG_SERIALIZE_DMA 
IDE_HFLAG_CLEAR_SIMPLEX 
IDE_HFLAG_NO_DSC 
IDE_HFLAG_NO_IO_32BIT 
IDE_HFLAG_NO_UNMASK_IRQS 

Definition at line 1213 of file ide.h.

anonymous enum
Enumerator:
IDE_TIMING_SETUP 
IDE_TIMING_ACT8B 
IDE_TIMING_REC8B 
IDE_TIMING_CYC8B 
IDE_TIMING_8BIT 
IDE_TIMING_ACTIVE 
IDE_TIMING_RECOVER 
IDE_TIMING_CYCLE 
IDE_TIMING_UDMA 
IDE_TIMING_ALL 

Definition at line 1475 of file ide.h.

Enumerator:
ide_stopped 
ide_started 

Definition at line 223 of file ide.h.

Function Documentation

void __ide_set_handler ( ide_drive_t ,
ide_handler_t ,
unsigned  int 
)

Definition at line 444 of file ide-iops.c.

int __ide_wait_stat ( ide_drive_t ,
u8  ,
u8  ,
unsigned  long,
u8  
)

Definition at line 105 of file ide-iops.c.

void do_ide_request ( struct request_queue )

Definition at line 456 of file ide-io.c.

ide_startstop_t do_rw_taskfile ( ide_drive_t ,
struct ide_cmd  
)

Definition at line 78 of file ide-taskfile.c.

u8 eighty_ninty_three ( ide_drive_t )

Definition at line 228 of file ide-iops.c.

int generic_ide_ioctl ( ide_drive_t ,
struct block_device ,
unsigned  ,
unsigned  long 
)
int generic_ide_resume ( struct device )

Definition at line 41 of file ide-pm.c.

int generic_ide_suspend ( struct device ,
pm_message_t   
)

Definition at line 5 of file ide-pm.c.

int ide_busy_sleep ( ide_drive_t ,
unsigned  long,
int   
)

Definition at line 330 of file ide-probe.c.

int ide_cd_expiry ( ide_drive_t )

Definition at line 276 of file ide-atapi.c.

int ide_cd_get_xferlen ( struct request )

Definition at line 308 of file ide-atapi.c.

int ide_check_atapi_device ( ide_drive_t ,
const char  
)

Definition at line 36 of file ide-atapi.c.

int ide_check_ireason ( ide_drive_t ,
struct request ,
int  ,
int  ,
int   
)

Definition at line 343 of file ide-atapi.c.

void ide_check_nien_quirk_list ( ide_drive_t )

Definition at line 299 of file ide-iops.c.

void ide_check_pm_state ( ide_drive_t ,
struct request  
)

Definition at line 209 of file ide-pm.c.

void ide_complete_cmd ( ide_drive_t ,
struct ide_cmd ,
u8  ,
u8   
)

Definition at line 74 of file ide-io.c.

void ide_complete_pm_rq ( ide_drive_t drive,
struct request rq 
)

ide_complete_pm_rq - end the current Power Management request : target drive : request

This function cleans up the current PM request and stops the queue if necessary.

Definition at line 182 of file ide-pm.c.

void ide_complete_power_step ( ide_drive_t ,
struct request  
)

Definition at line 81 of file ide-pm.c.

int ide_complete_rq ( ide_drive_t ,
int  ,
unsigned  int 
)

Definition at line 115 of file ide-io.c.

int ide_config_drive_speed ( ide_drive_t ,
u8   
)

Definition at line 342 of file ide-iops.c.

void ide_create_request_sense_cmd ( ide_drive_t ,
struct ide_atapi_pc  
)

Definition at line 157 of file ide-atapi.c.

ide_decl_devset ( io_32bit  )
ide_decl_devset ( keepsettings  )
ide_decl_devset ( pio_mode  )
ide_decl_devset ( unmaskirq  )
ide_decl_devset ( using_dma  )
int ide_dev_read_id ( ide_drive_t drive,
u8  cmd,
u16 id,
int  irq_ctx 
)

ide_dev_read_id - send ATA/ATAPI IDENTIFY command : drive to identify : command to use : buffer for IDENTIFY data : flag set when called from the IRQ context

Sends an ATA(PI) IDENTIFY request to a drive and waits for a response.

Returns: 0 device was identified 1 device timed-out (no response to identify request) 2 device aborted the command (refused to identify itself)

Definition at line 250 of file ide-probe.c.

void ide_dev_select ( ide_drive_t )

Definition at line 77 of file ide-io-std.c.

int ide_device_get ( ide_drive_t drive)

ide_device_get - get an additional reference to a ide_drive_t : device to get a reference to

Gets a reference to the ide_drive_t and increments the use count of the underlying LLDD module.

Definition at line 71 of file ide.c.

void ide_device_put ( ide_drive_t drive)

ide_device_put - release a reference to a ide_drive_t : device to release a reference on

Release a reference to the ide_drive_t and decrements the use count of the underlying LLDD module.

Definition at line 98 of file ide.c.

int ide_devset_execute ( ide_drive_t drive,
const struct ide_devset setting,
int  arg 
)

Definition at line 158 of file ide-devsets.c.

ide_startstop_t ide_do_devset ( ide_drive_t ,
struct request  
)

Definition at line 182 of file ide-devsets.c.

ide_startstop_t ide_do_park_unpark ( ide_drive_t ,
struct request  
)

Definition at line 61 of file ide-park.c.

ide_startstop_t ide_do_reset ( ide_drive_t )

Definition at line 438 of file ide-eh.c.

int ide_do_start_stop ( ide_drive_t ,
struct gendisk *  ,
int   
)

Definition at line 127 of file ide-atapi.c.

int ide_do_test_unit_ready ( ide_drive_t ,
struct gendisk *   
)

Definition at line 116 of file ide-atapi.c.

int ide_driveid_update ( ide_drive_t )

Definition at line 310 of file ide-iops.c.

u8 ide_dump_status ( ide_drive_t drive,
const char msg,
u8  stat 
)

ide_dump_status - translate ATA/ATAPI error : drive that status applies to : text message to print : status byte to decode

Error reporting, in human readable form (luxurious, but a memory hog). Combines the drive name, message and status byte to provide a user understandable explanation of the device error.

Definition at line 133 of file ide-lib.c.

int ide_end_rq ( ide_drive_t ,
struct request ,
int  ,
unsigned  int 
)

Definition at line 57 of file ide-io.c.

ide_startstop_t ide_error ( ide_drive_t drive,
const char msg,
u8  stat 
)

ide_error - handle an error on the IDE : drive the error occurred on : message to report : status bits

ide_error() takes action based on the error returned by the drive. For normal I/O that may well include retries. We deal with both new-style (taskfile) and old style command handling here. In the case of taskfile command handling there is work left to do

Definition at line 114 of file ide-eh.c.

void ide_exec_command ( ide_hwif_t ,
u8   
)

Definition at line 41 of file ide-io-std.c.

void ide_execute_command ( ide_drive_t drive,
struct ide_cmd cmd,
ide_handler_t handler,
unsigned  timeout 
)

ide_execute_command - execute an IDE command : IDE drive to issue the command against : command : handler for next phase : timeout for command

Helper function to issue an IDE command. This handles the atomicity requirements, command timing and ensures that the handler and IRQ setup do not race. All IDE command kick off should go via this function or do equivalent locking.

Definition at line 481 of file ide-iops.c.

void ide_finish_cmd ( ide_drive_t ,
struct ide_cmd ,
u8   
)

Definition at line 325 of file ide-taskfile.c.

void ide_fix_driveid ( u16 )

Definition at line 48 of file ide-iops.c.

void ide_fixstring ( u8 ,
const int  ,
const int   
)

Definition at line 69 of file ide-iops.c.

u64 ide_get_lba_addr ( struct ide_cmd ,
int   
)

Definition at line 35 of file ide-lib.c.

int ide_host_add ( const struct ide_port_info ,
struct ide_hw **  ,
unsigned  int,
struct ide_host **   
)

Definition at line 1464 of file ide-probe.c.

struct ide_host* ide_host_alloc ( const struct ide_port_info ,
struct ide_hw **  ,
unsigned  int 
)
read

Definition at line 1280 of file ide-probe.c.

void ide_host_free ( struct ide_host )

Definition at line 1554 of file ide-probe.c.

int ide_host_register ( struct ide_host ,
const struct ide_port_info ,
struct ide_hw **   
)

Definition at line 1368 of file ide-probe.c.

void ide_host_remove ( struct ide_host )

Definition at line 1568 of file ide-probe.c.

int ide_in_drive_list ( u16 id,
const struct drive_list_entry table 
)

ide_in_drive_list - look for drive in black/white list : drive identifier : list to inspect

Look for a drive in the blacklist and the whitelist tables Returns 1 if the drive is found in the table.

Definition at line 196 of file ide-iops.c.

void ide_init_disk ( struct gendisk *  ,
ide_drive_t  
)

Definition at line 935 of file ide-probe.c.

void ide_init_pc ( struct ide_atapi_pc )

Definition at line 79 of file ide-atapi.c.

void ide_init_sg_cmd ( struct ide_cmd ,
unsigned  int 
)

Definition at line 233 of file ide-io.c.

void ide_input_data ( ide_drive_t ,
struct ide_cmd ,
void ,
unsigned  int 
)

Definition at line 164 of file ide-io-std.c.

irqreturn_t ide_intr ( int  irq,
void dev_id 
)

ide_intr - default IDE interrupt handler : interrupt number : hwif : unused weirdness from the kernel irq layer

This is the default IRQ handler for the IDE layer. You should not need to override it. If you do be aware it is subtle in places

hwif is the interface in the group currently performing a command. hwif->cur_dev is the drive and hwif->handler is the IRQ handler to call. As we issue a command the handlers step through multiple states, reassigning the handler to the next step in the process. Unlike a smart SCSI controller IDE expects the main processor to sequence the various transfer stages. We also manage a poll timer to catch up with most timeout situations. There are still a few where the handlers don't ever decide to give up.

The handler eventually returns ide_stopped to indicate the request completed. At this point we issue the next request on the port and the process begins again.

Definition at line 770 of file ide-io.c.

ide_startstop_t ide_issue_pc ( ide_drive_t ,
struct ide_cmd  
)

Definition at line 669 of file ide-atapi.c.

void ide_kill_rq ( ide_drive_t ,
struct request  
)

Definition at line 136 of file ide-io.c.

int ide_legacy_device_add ( const struct ide_port_info ,
unsigned  long 
)

Definition at line 42 of file ide-legacy.c.

void ide_map_sg ( ide_drive_t ,
struct ide_cmd  
)

Definition at line 223 of file ide-io.c.

char* ide_media_string ( ide_drive_t )

Definition at line 4 of file ide-sysfs.c.

int ide_no_data_taskfile ( ide_drive_t ,
struct ide_cmd  
)

Definition at line 461 of file ide-taskfile.c.

void ide_output_data ( ide_drive_t ,
struct ide_cmd ,
void ,
unsigned  int 
)

Definition at line 208 of file ide-io-std.c.

void ide_pad_transfer ( ide_drive_t ,
int  ,
int   
)

Definition at line 879 of file ide-io.c.

ssize_t ide_park_show ( struct device dev,
struct device_attribute attr,
char buf 
)

Definition at line 88 of file ide-park.c.

ssize_t ide_park_store ( struct device dev,
struct device_attribute attr,
const char buf,
size_t  len 
)

Definition at line 111 of file ide-park.c.

int ide_pci_init_one ( struct pci_dev ,
const struct ide_port_info ,
void  
)

Definition at line 597 of file setup-pci.c.

int ide_pci_init_two ( struct pci_dev ,
struct pci_dev ,
const struct ide_port_info ,
void  
)

Definition at line 538 of file setup-pci.c.

void ide_pci_remove ( struct pci_dev )

Definition at line 604 of file setup-pci.c.

void ide_pci_setup_ports ( struct pci_dev dev,
const struct ide_port_info d,
struct ide_hw hw,
struct ide_hw **  hws 
)

ide_pci_setup_ports - configure ports/devices on PCI IDE : PCI device : IDE port info : struct ide_hw instances corresponding to this PCI IDE device : struct ide_hw pointers table to update

Scan the interfaces attached to this device and do any necessary per port setup. Attach the devices and ask the generic DMA layer to do its work for us.

Normally called automaticall from do_ide_pci_setup_device, but is also used directly as a helper function by some controllers where the chipset setup is not the default PCI IDE one.

Definition at line 461 of file setup-pci.c.

void ide_pio_bytes ( ide_drive_t ,
struct ide_cmd ,
unsigned  int,
unsigned  int 
)

Definition at line 223 of file ide-taskfile.c.

u16 ide_pio_cycle_time ( ide_drive_t ,
u8   
)

Definition at line 81 of file ide-timings.c.

void ide_port_apply_params ( ide_hwif_t )

Definition at line 355 of file ide.c.

void ide_port_scan ( ide_hwif_t )

Definition at line 1582 of file ide-probe.c.

void ide_port_unregister_devices ( ide_hwif_t )

Definition at line 1498 of file ide-probe.c.

void ide_prep_sense ( ide_drive_t drive,
struct request rq 
)

Definition at line 171 of file ide-atapi.c.

int ide_queue_pc_tail ( ide_drive_t ,
struct gendisk *  ,
struct ide_atapi_pc ,
void ,
unsigned  int 
)

Definition at line 89 of file ide-atapi.c.

int ide_queue_sense_rq ( ide_drive_t drive,
void special 
)

Definition at line 223 of file ide-atapi.c.

int ide_raw_taskfile ( ide_drive_t ,
struct ide_cmd ,
u8 ,
u16   
)

Definition at line 427 of file ide-taskfile.c.

u8 ide_read_altstatus ( ide_hwif_t )

Definition at line 59 of file ide-io-std.c.

void ide_read_bcount_and_ireason ( ide_drive_t ,
u16 ,
u8  
)

Definition at line 323 of file ide-atapi.c.

u8 ide_read_error ( ide_drive_t )

Definition at line 38 of file ide-iops.c.

u8 ide_read_status ( ide_hwif_t )

Definition at line 50 of file ide-io-std.c.

void ide_register_region ( struct gendisk *  )

Definition at line 919 of file ide-probe.c.

void ide_requeue_and_plug ( ide_drive_t drive,
struct request rq 
)

Definition at line 443 of file ide-io.c.

void ide_retry_pc ( ide_drive_t drive)

Definition at line 247 of file ide-atapi.c.

void ide_set_handler ( ide_drive_t ,
ide_handler_t ,
unsigned  int 
)

Definition at line 456 of file ide-iops.c.

int ide_set_media_lock ( ide_drive_t ,
struct gendisk *  ,
int   
)

Definition at line 142 of file ide-atapi.c.

int ide_setting_ioctl ( ide_drive_t ,
struct block_device ,
unsigned  int,
unsigned  long,
const struct ide_ioctl_devset  
)

Definition at line 19 of file ide-ioctls.c.

void ide_setup_pci_noise ( struct pci_dev ,
const struct ide_port_info  
)

Definition at line 170 of file setup-pci.c.

void ide_stall_queue ( ide_drive_t drive,
unsigned long  timeout 
)

ide_stall_queue - pause an IDE device : drive to stall : time to stall for (jiffies)

ide_stall_queue() can be used by a drive to give excess bandwidth back to the port by sleeping for timeout jiffies.

Definition at line 386 of file ide-io.c.

ide_startstop_t ide_start_power_step ( ide_drive_t ,
struct request  
)

Definition at line 111 of file ide-pm.c.

int ide_sysfs_register_port ( ide_hwif_t )

Definition at line 114 of file ide-sysfs.c.

int ide_taskfile_ioctl ( ide_drive_t ,
unsigned  long 
)
void ide_tf_dump ( const char ,
struct ide_cmd  
)

Definition at line 44 of file ide-taskfile.c.

void ide_tf_load ( ide_drive_t ,
struct ide_taskfile ,
u8   
)

Definition at line 89 of file ide-io-std.c.

void ide_tf_read ( ide_drive_t ,
struct ide_taskfile ,
u8   
)

Definition at line 116 of file ide-io-std.c.

void ide_tf_readback ( ide_drive_t drive,
struct ide_cmd cmd 
)

Definition at line 27 of file ide-taskfile.c.

void ide_timer_expiry ( unsigned long  data)

ide_timer_expiry - handle lack of an IDE interrupt : timer callback magic (hwif)

An IDE command has timed out before the expected drive return occurred. At this point we attempt to clean up the current mess. If the current handler includes an expiry handler then we invoke the expiry handler, and providing it is happy the work is done. If that fails we apply generic recovery rules invoking the handler and checking the drive DMA status. We have an excessively incestuous relationship with the DMA logic that wants cleaning up.

Definition at line 613 of file ide-io.c.

int ide_timing_compute ( ide_drive_t ,
u8  ,
struct ide_timing ,
int  ,
int   
)

Definition at line 144 of file ide-timings.c.

struct ide_timing* ide_timing_find_mode ( u8  )
read

Definition at line 70 of file ide-timings.c.

void ide_timing_merge ( struct ide_timing ,
struct ide_timing ,
struct ide_timing ,
unsigned  int 
)

Definition at line 122 of file ide-timings.c.

void ide_toggle_bounce ( ide_drive_t drive,
int  on 
)

ide_toggle_bounce - handle bounce buffering : drive to update : on/off boolean

Enable or disable bounce buffering for the device. Drives move between PIO and DMA and that changes the rules we need.

Definition at line 18 of file ide-lib.c.

void ide_undecoded_slave ( ide_drive_t dev1)

ide_undecoded_slave - look for bad CF adapters : slave device

Analyse the drives on the interface and attempt to decide if we have the same drive viewed twice. This occurs with crap CF adapters and PCMCIA sometimes.

Definition at line 649 of file ide-probe.c.

void ide_unregister_region ( struct gendisk *  )

Definition at line 927 of file ide-probe.c.

int ide_wait_not_busy ( ide_hwif_t hwif,
unsigned long  timeout 
)

Definition at line 507 of file ide-iops.c.

int ide_wait_stat ( ide_startstop_t ,
ide_drive_t ,
u8  ,
u8  ,
unsigned  long 
)

Definition at line 164 of file ide-iops.c.

void ide_write_devctl ( ide_hwif_t ,
u8   
)

Definition at line 68 of file ide-io-std.c.

void SELECT_MASK ( ide_drive_t ,
int   
)

Definition at line 30 of file ide-iops.c.

int taskfile_lib_get_identify ( ide_drive_t drive,
u8  
)

Definition at line 57 of file ide-taskfile.c.

Variable Documentation

struct ide_tp_ops default_tp_ops

Definition at line 249 of file ide-io-std.c.

struct bus_type ide_bus_type

Definition at line 154 of file ide.c.

struct device_attribute ide_dev_attrs[]

Definition at line 64 of file ide-sysfs.c.

wait_queue_head_t ide_park_wq
int ide_pci_clk

Definition at line 174 of file ide.c.

struct class* ide_port_class

Definition at line 62 of file ide.c.

struct mutex ide_setting_mtx
int ide_vlb_clk

Definition at line 168 of file ide.c.