Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ide-disk.c File Reference

#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/major.h>
#include <linux/errno.h>
#include <linux/genhd.h>
#include <linux/malloc.h>
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include "ide.h"

Include dependency graph for ide-disk.c:

Go to the source code of this file.

Defines

#define IDEDISK_VERSION   "1.08"
#define idedisk_proc   NULL

Functions

static void idedisk_bswap_data (void *buffer, int wcount)
static void idedisk_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount)
static void idedisk_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount)
static int lba_capacity_is_ok (struct hd_driveid *id)
static ide_startstop_t read_intr (ide_drive_t *drive)
static ide_startstop_t write_intr (ide_drive_t *drive)
int ide_multwrite (ide_drive_t *drive, unsigned int mcount)
static ide_startstop_t multwrite_intr (ide_drive_t *drive)
static ide_startstop_t set_multmode_intr (ide_drive_t *drive)
static ide_startstop_t set_geometry_intr (ide_drive_t *drive)
static ide_startstop_t recal_intr (ide_drive_t *drive)
static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block)
static int idedisk_open (struct inode *inode, struct file *filp, ide_drive_t *drive)
static void idedisk_release (struct inode *inode, struct file *filp, ide_drive_t *drive)
static int idedisk_media_change (ide_drive_t *drive)
static unsigned long idedisk_capacity (ide_drive_t *drive)
static ide_startstop_t idedisk_special (ide_drive_t *drive)
static void idedisk_pre_reset (ide_drive_t *drive)
static int set_multcount (ide_drive_t *drive, int arg)
static int set_nowerr (ide_drive_t *drive, int arg)
static void idedisk_add_settings (ide_drive_t *drive)
int idedisk_init (void)
static int idedisk_cleanup (ide_drive_t *drive)
static void idedisk_setup (ide_drive_t *drive)

Variables

static ide_driver_t idedisk_driver
static ide_module_t idedisk_module


Define Documentation

#define idedisk_proc   NULL
 

Definition at line 664 of file ide-disk.c.

#define IDEDISK_VERSION   "1.08"
 

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


Function Documentation

static ide_startstop_t do_rw_disk ide_drive_t drive,
struct request rq,
unsigned long  block
[static]
 

Definition at line 383 of file ide-disk.c.

References __cli, ide_drive_s::bad_wstat, request::buffer, hwif_s::channel, request::cmd, ide_drive_s::ctl, DATA_READY, del_timer(), do_pdc4030_io(), hwgroup_s::handler, ide_drive_s::head, HWGROUP, HWIF, IDE_COMMAND_REG, IDE_CONTROL_REG, ide_dma_read, ide_dma_write, ide_end_request(), IDE_HCYL_REG, IDE_LCYL_REG, ide_multwrite(), IDE_NSECTOR_REG, IDE_SECTOR_REG, IDE_SELECT_REG, ide_set_handler(), ide_started, ide_stopped, ide_wait_stat(), idedisk_output_data(), io_request_lock, IS_PDC4030_DRIVE, KERN_ERR, ide_drive_s::mult_count, multwrite_intr(), ide_drive_s::name, request::nr_sectors, NULL, OUT_BYTE, printk, READ, read_intr(), ide_drive_s::sect, SECTOR_WORDS, ide_drive_s::select, spin_lock_irqsave, spin_unlock_irqrestore, hwgroup_s::timer, ide_drive_s::unmask, ide_drive_s::using_dma, WAIT_CMD, WAIT_DRQ, WIN_MULTREAD, WIN_MULTWRITE, WIN_READ, WIN_WRITE, WRITE, write_intr(), hwgroup_s::wrq, and x0f.

Here is the call graph for this function:

int ide_multwrite ide_drive_t drive,
unsigned int  mcount
 

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

References request::bh, request::buffer, request::current_nr_sectors, HWGROUP, ide_end_request(), idedisk_output_data(), io_request_lock, request::nr_sectors, NULL, printk, request::sector, spin_lock_irqsave, spin_unlock_irqrestore, and hwgroup_s::wrq.

Referenced by do_rw_disk(), multwrite_intr(), promise_write(), and promise_write_pollfunc().

Here is the call graph for this function:

static void idedisk_add_settings ide_drive_t drive  )  [static]
 

Definition at line 693 of file ide-disk.c.

References ide_drive_s::bios_cyl, ide_drive_s::bios_head, ide_drive_s::bios_sect, BLKFRAGET, BLKFRASET, BLKRAGET, BLKRASET, BLKSECTGET, BLKSECTSET, ide_drive_s::bswap, HDIO_GET_MULTCOUNT, HDIO_GET_NOWERR, HDIO_SET_MULTCOUNT, HDIO_SET_NOWERR, HWIF, ide_drive_s::id, ide_add_setting(), major, hd_driveid::max_multsect, max_readahead, max_sectors, minor, ide_drive_s::mult_count, ide_drive_s::nowerr, PARTN_BITS, read_ahead, ide_drive_s::select, set_multcount(), set_nowerr(), SETTING_READ, SETTING_RW, TYPE_BYTE, TYPE_INT, TYPE_INTA, and TYPE_SHORT.

Referenced by idedisk_setup().

Here is the call graph for this function:

static void idedisk_bswap_data void *  buffer,
int  wcount
[static]
 

Definition at line 55 of file ide-disk.c.

References p, and u16.

Referenced by idedisk_input_data(), and idedisk_output_data().

static unsigned long idedisk_capacity ide_drive_t drive  )  [static]
 

Definition at line 523 of file ide-disk.c.

References hd_driveid::capability, ide_drive_s::cyl, ide_drive_s::head, ide_drive_s::id, hd_driveid::lba_capacity, lba_capacity_is_ok(), NULL, ide_drive_s::sect, ide_drive_s::sect0, and ide_drive_s::select.

Referenced by idedisk_setup().

Here is the call graph for this function:

static int idedisk_cleanup ide_drive_t drive  )  [static]
 

Definition at line 742 of file ide-disk.c.

References ide_unregister_subdriver().

Referenced by idedisk_init().

Here is the call graph for this function:

int idedisk_init void   ) 
 

Definition at line 871 of file ide-disk.c.

References ide_disk, ide_register_module(), ide_register_subdriver(), ide_scan_devices(), IDE_SUBDRIVER_VERSION, idedisk_cleanup(), idedisk_setup(), KERN_ERR, MOD_DEC_USE_COUNT, MOD_INC_USE_COUNT, ide_driver_s::name, and printk.

Referenced by __initfunc().

Here is the call graph for this function:

static void idedisk_input_data ide_drive_t drive,
void *  buffer,
unsigned int  wcount
[inline, static]
 

Definition at line 65 of file ide-disk.c.

References ide_drive_s::bswap, ide_input_data(), and idedisk_bswap_data().

Referenced by read_intr().

Here is the call graph for this function:

static int idedisk_media_change ide_drive_t drive  )  [static]
 

Definition at line 514 of file ide-disk.c.

static int idedisk_open struct inode *  inode,
struct file filp,
ide_drive_t drive
[static]
 

Definition at line 488 of file ide-disk.c.

References check_disk_change(), ide_drive_s::doorlocking, ide_wait_cmd(), MOD_INC_USE_COUNT, NULL, ide_drive_s::removable, ide_drive_s::usage, and WIN_DOORLOCK.

Here is the call graph for this function:

static void idedisk_output_data ide_drive_t drive,
void *  buffer,
unsigned int  wcount
[inline, static]
 

Definition at line 72 of file ide-disk.c.

References ide_drive_s::bswap, ide_output_data(), and idedisk_bswap_data().

Referenced by do_rw_disk(), ide_multwrite(), and write_intr().

Here is the call graph for this function:

static void idedisk_pre_reset ide_drive_t drive  )  [static]
 

Definition at line 570 of file ide-disk.c.

References special_t::all, special_t::b, ide_drive_s::keep_settings, ide_drive_s::mult_count, ide_drive_s::mult_req, OK_TO_RESET_CONTROLLER, ide_drive_s::special, and ide_drive_s::using_dma.

static void idedisk_release struct inode *  inode,
struct file filp,
ide_drive_t drive
[static]
 

Definition at line 504 of file ide-disk.c.

References ide_drive_s::doorlocking, ide_wait_cmd(), MOD_DEC_USE_COUNT, NULL, ide_drive_s::removable, ide_drive_s::usage, and WIN_DOORUNLOCK.

Here is the call graph for this function:

static void idedisk_setup ide_drive_t drive  )  [static]
 

Definition at line 747 of file ide-disk.c.

References special_t::b, ide_drive_s::bios_cyl, ide_drive_s::bios_head, ide_drive_s::bios_sect, hd_driveid::buf_size, check, hd_driveid::cur_cyls, hd_driveid::cur_heads, hd_driveid::cur_sectors, ide_drive_s::cyl, hd_driveid::dma_ultra, ide_drive_s::doorlocking, drive_is_flashcard(), hd_driveid::field_valid, ide_drive_s::forced_geom, ide_drive_s::head, hd_driveid::heads, ide_drive_s::id, idedisk_add_settings(), idedisk_capacity(), INITIAL_MULT_COUNT, KERN_INFO, L, le16_to_cpu, hd_driveid::max_multsect, hd_driveid::model, ide_drive_s::mult_count, ide_drive_s::mult_req, hd_driveid::multsect, hd_driveid::multsect_valid, ide_drive_s::name, ide_drive_s::no_io_32bit, printk, ide_drive_s::removable, ide_drive_s::sect, ide_drive_s::special, and ide_drive_s::using_dma.

Referenced by idedisk_init().

Here is the call graph for this function:

static ide_startstop_t idedisk_special ide_drive_t drive  )  [static]
 

Definition at line 539 of file ide-disk.c.

References special_t::all, special_t::b, ide_drive_s::cyl, ide_drive_s::head, ide_drive_s::id, ide_cmd(), IDE_HCYL_REG, IDE_LCYL_REG, IDE_SECTOR_REG, IDE_SELECT_REG, ide_started, ide_stopped, IS_PDC4030_DRIVE, KERN_ERR, hd_driveid::max_multsect, ide_drive_s::mult_req, ide_drive_s::name, OUT_BYTE, printk, recal_intr(), s, ide_drive_s::sect, ide_drive_s::select, set_geometry_intr(), set_multmode_intr(), ide_drive_s::special, WIN_RESTORE, WIN_SETMULT, WIN_SPECIFY, and xBF.

Here is the call graph for this function:

static int lba_capacity_is_ok struct hd_driveid id  )  [static]
 

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

References hd_driveid::cur_cyls, hd_driveid::cyls, hd_driveid::heads, hd_driveid::lba_capacity, hd_driveid::sectors, and tail.

Referenced by idedisk_capacity().

static ide_startstop_t multwrite_intr ide_drive_t drive  )  [static]
 

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

References byte, request::current_nr_sectors, DRIVE_READY, DRQ_STAT, GET_STAT, HWGROUP, i, ide_end_request(), ide_error(), ide_multwrite(), ide_set_handler(), ide_started, ide_stopped, request::nr_sectors, NULL, OK_STAT, hwgroup_s::rq, WAIT_CMD, and hwgroup_s::wrq.

Referenced by do_rw_disk().

Here is the call graph for this function:

static ide_startstop_t read_intr ide_drive_t drive  )  [static]
 

Definition at line 128 of file ide-disk.c.

References BAD_R_STAT, request::buffer, byte, request::current_nr_sectors, DATA_READY, DRQ_STAT, ERR_STAT, request::errors, GET_STAT, HWGROUP, i, ide_end_request(), ide_error(), ide_set_handler(), ide_started, ide_stopped, idedisk_input_data(), ide_drive_s::mult_count, request::nr_sectors, NULL, OK_STAT, printk, read_intr(), request::sector, SECTOR_WORDS, and WAIT_CMD.

Here is the call graph for this function:

static ide_startstop_t recal_intr ide_drive_t drive  )  [static]
 

Definition at line 369 of file ide-disk.c.

References BAD_STAT, byte, GET_STAT, ide_error(), ide_stopped, OK_STAT, and READY_STAT.

Here is the call graph for this function:

static ide_startstop_t set_geometry_intr ide_drive_t drive  )  [static]
 

Definition at line 357 of file ide-disk.c.

References BAD_STAT, byte, GET_STAT, ide_error(), ide_stopped, OK_STAT, and READY_STAT.

Referenced by idedisk_special().

Here is the call graph for this function:

static int set_multcount ide_drive_t drive,
int  arg
[static]
 

Definition at line 668 of file ide-disk.c.

References special_t::b, EBUSY, EIO, ide_do_drive_cmd(), ide_init_drive_cmd(), ide_wait, ide_drive_s::mult_count, ide_drive_s::mult_req, and ide_drive_s::special.

Referenced by idedisk_add_settings().

Here is the call graph for this function:

static ide_startstop_t set_multmode_intr ide_drive_t drive  )  [static]
 

Definition at line 340 of file ide-disk.c.

References special_t::b, BAD_STAT, byte, GET_STAT, ide_dump_status(), ide_stopped, ide_drive_s::mult_count, ide_drive_s::mult_req, OK_STAT, READY_STAT, and ide_drive_s::special.

Referenced by idedisk_special().

Here is the call graph for this function:

static int set_nowerr ide_drive_t drive,
int  arg
[static]
 

Definition at line 681 of file ide-disk.c.

References BAD_R_STAT, BAD_W_STAT, EBUSY, ide_spin_wait_hwgroup(), io_request_lock, and spin_unlock_irqrestore.

Referenced by idedisk_add_settings().

Here is the call graph for this function:

static ide_startstop_t write_intr ide_drive_t drive  )  [static]
 

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

References ide_drive_s::bad_wstat, request::buffer, byte, request::current_nr_sectors, DRIVE_READY, DRQ_STAT, request::errors, GET_STAT, HWGROUP, i, ide_end_request(), ide_error(), ide_set_handler(), ide_started, ide_stopped, idedisk_output_data(), ide_drive_s::name, request::nr_sectors, NULL, OK_STAT, printk, hwgroup_s::rq, request::sector, SECTOR_WORDS, WAIT_CMD, and write_intr().

Here is the call graph for this function:


Variable Documentation

ide_driver_t idedisk_driver [static]
 

Initial value:

Definition at line 714 of file ide-disk.c.

ide_module_t idedisk_module [static]
 

Initial value:

Definition at line 735 of file ide-disk.c.