Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
hd.c File Reference
#include <linux/blkdev.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/interrupt.h>
#include <linux/timer.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/genhd.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/blkpg.h>
#include <linux/ata.h>
#include <linux/hdreg.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/irq.h>

Go to the source code of this file.

Data Structures

struct  hd_i_struct
 

Macros

#define HD_IRQ   14
 
#define REALLY_SLOW_IO
 
#define HD_DATA   0x1f0 /* _CTL when writing */
 
#define HD_ERROR   0x1f1 /* see err-bits */
 
#define HD_NSECTOR   0x1f2 /* nr of sectors to read/write */
 
#define HD_SECTOR   0x1f3 /* starting sector */
 
#define HD_LCYL   0x1f4 /* starting cylinder */
 
#define HD_HCYL   0x1f5 /* high byte of starting cyl */
 
#define HD_CURRENT   0x1f6 /* 101dhhhh , d=drive, hhhh=head */
 
#define HD_STATUS   0x1f7 /* see status-bits */
 
#define HD_FEATURE   HD_ERROR /* same io address, read=error, write=feature */
 
#define HD_PRECOMP   HD_FEATURE /* obsolete use of this port - predates IDE */
 
#define HD_COMMAND   HD_STATUS /* same io address, read=status, write=cmd */
 
#define HD_CMD   0x3f6 /* used for resets */
 
#define HD_ALTSTATUS   0x3f6 /* same as HD_STATUS but doesn't clear irq */
 
#define ERR_STAT   0x01
 
#define INDEX_STAT   0x02
 
#define ECC_STAT   0x04 /* Corrected error */
 
#define DRQ_STAT   0x08
 
#define SEEK_STAT   0x10
 
#define SERVICE_STAT   SEEK_STAT
 
#define WRERR_STAT   0x20
 
#define READY_STAT   0x40
 
#define BUSY_STAT   0x80
 
#define MARK_ERR   0x01 /* Bad address mark */
 
#define TRK0_ERR   0x02 /* couldn't find track 0 */
 
#define ABRT_ERR   0x04 /* Command aborted */
 
#define MCR_ERR   0x08 /* media change request */
 
#define ID_ERR   0x10 /* ID field not found */
 
#define MC_ERR   0x20 /* media changed */
 
#define ECC_ERR   0x40 /* Uncorrectable ECC error */
 
#define BBD_ERR   0x80 /* pre-EIDE meaning: block marked bad */
 
#define ICRC_ERR   0x80 /* new meaning: CRC error during transfer */
 
#define TIMEOUT_VALUE   (6*HZ)
 
#define HD_DELAY   0
 
#define MAX_ERRORS   16 /* Max read/write errors/sector */
 
#define RESET_FREQ   8 /* Reset controller every 8th retry */
 
#define RECAL_FREQ   4 /* Recalibrate every 4th retry */
 
#define MAX_HD   2
 
#define STAT_OK   (READY_STAT|SEEK_STAT)
 
#define OK_STATUS(s)   (((s)&(STAT_OK|(BUSY_STAT|WRERR_STAT|ERR_STAT)))==STAT_OK)
 
#define TIMEOUT_VALUE   (6*HZ)
 
#define SET_TIMER
 
#define SET_HANDLER(x)
 

Functions

 __setup ("hd=", parse_hd_setup)
 
 late_initcall (hd_init)
 

Macro Definition Documentation

#define ABRT_ERR   0x04 /* Command aborted */

Definition at line 89 of file hd.c.

#define BBD_ERR   0x80 /* pre-EIDE meaning: block marked bad */

Definition at line 94 of file hd.c.

#define BUSY_STAT   0x80

Definition at line 84 of file hd.c.

#define DRQ_STAT   0x08

Definition at line 79 of file hd.c.

#define ECC_ERR   0x40 /* Uncorrectable ECC error */

Definition at line 93 of file hd.c.

#define ECC_STAT   0x04 /* Corrected error */

Definition at line 78 of file hd.c.

#define ERR_STAT   0x01

Definition at line 76 of file hd.c.

#define HD_ALTSTATUS   0x3f6 /* same as HD_STATUS but doesn't clear irq */

Definition at line 73 of file hd.c.

#define HD_CMD   0x3f6 /* used for resets */

Definition at line 72 of file hd.c.

#define HD_COMMAND   HD_STATUS /* same io address, read=status, write=cmd */

Definition at line 70 of file hd.c.

#define HD_CURRENT   0x1f6 /* 101dhhhh , d=drive, hhhh=head */

Definition at line 66 of file hd.c.

#define HD_DATA   0x1f0 /* _CTL when writing */

Definition at line 60 of file hd.c.

#define HD_DELAY   0

Definition at line 102 of file hd.c.

#define HD_ERROR   0x1f1 /* see err-bits */

Definition at line 61 of file hd.c.

#define HD_FEATURE   HD_ERROR /* same io address, read=error, write=feature */

Definition at line 68 of file hd.c.

#define HD_HCYL   0x1f5 /* high byte of starting cyl */

Definition at line 65 of file hd.c.

#define HD_IRQ   14

Definition at line 44 of file hd.c.

#define HD_LCYL   0x1f4 /* starting cylinder */

Definition at line 64 of file hd.c.

#define HD_NSECTOR   0x1f2 /* nr of sectors to read/write */

Definition at line 62 of file hd.c.

#define HD_PRECOMP   HD_FEATURE /* obsolete use of this port - predates IDE */

Definition at line 69 of file hd.c.

#define HD_SECTOR   0x1f3 /* starting sector */

Definition at line 63 of file hd.c.

#define HD_STATUS   0x1f7 /* see status-bits */

Definition at line 67 of file hd.c.

#define ICRC_ERR   0x80 /* new meaning: CRC error during transfer */

Definition at line 95 of file hd.c.

#define ID_ERR   0x10 /* ID field not found */

Definition at line 91 of file hd.c.

#define INDEX_STAT   0x02

Definition at line 77 of file hd.c.

#define MARK_ERR   0x01 /* Bad address mark */

Definition at line 87 of file hd.c.

#define MAX_ERRORS   16 /* Max read/write errors/sector */

Definition at line 104 of file hd.c.

#define MAX_HD   2

Definition at line 107 of file hd.c.

#define MC_ERR   0x20 /* media changed */

Definition at line 92 of file hd.c.

#define MCR_ERR   0x08 /* media change request */

Definition at line 90 of file hd.c.

#define OK_STATUS (   s)    (((s)&(STAT_OK|(BUSY_STAT|WRERR_STAT|ERR_STAT)))==STAT_OK)

Definition at line 110 of file hd.c.

#define READY_STAT   0x40

Definition at line 83 of file hd.c.

#define REALLY_SLOW_IO

Definition at line 46 of file hd.c.

#define RECAL_FREQ   4 /* Recalibrate every 4th retry */

Definition at line 106 of file hd.c.

#define RESET_FREQ   8 /* Reset controller every 8th retry */

Definition at line 105 of file hd.c.

#define SEEK_STAT   0x10

Definition at line 80 of file hd.c.

#define SERVICE_STAT   SEEK_STAT

Definition at line 81 of file hd.c.

#define SET_HANDLER (   x)
Value:
if ((do_hd = (x)) != NULL) \
SET_TIMER; \
del_timer(&device_timer);

Definition at line 148 of file hd.c.

#define SET_TIMER
Value:
do { \
mod_timer(&device_timer, jiffies + TIMEOUT_VALUE); \
} while (0)

Definition at line 142 of file hd.c.

#define STAT_OK   (READY_STAT|SEEK_STAT)

Definition at line 109 of file hd.c.

#define TIMEOUT_VALUE   (6*HZ)

Definition at line 140 of file hd.c.

#define TIMEOUT_VALUE   (6*HZ)

Definition at line 140 of file hd.c.

#define TRK0_ERR   0x02 /* couldn't find track 0 */

Definition at line 88 of file hd.c.

#define WRERR_STAT   0x20

Definition at line 82 of file hd.c.

Function Documentation

__setup ( )
late_initcall ( hd_init  )