src/drivers/at_wini/at_wini.h File Reference

#include "../drivers.h"
#include "../libdriver/driver.h"
#include "../libdriver/drvlib.h"

Go to the source code of this file.

Defines

#define VERBOSE   0
#define ENABLE_ATAPI   1
#define ATAPI_DEBUG   0
#define REG_CMD_BASE0   0x1F0
#define REG_CMD_BASE1   0x170
#define REG_CTL_BASE0   0x3F6
#define REG_CTL_BASE1   0x376
#define PCI_CTL_OFF   2
#define PCI_DMA_2ND_OFF   8
#define REG_DATA   0
#define REG_PRECOMP   1
#define REG_COUNT   2
#define REG_SECTOR   3
#define REG_CYL_LO   4
#define REG_CYL_HI   5
#define REG_LDH   6
#define LDH_DEFAULT   0xA0
#define LDH_LBA   0x40
#define LDH_DEV   0x10
#define ldh_init(drive)   (LDH_DEFAULT | ((drive) << 4))
#define REG_STATUS   7
#define STATUS_BSY   0x80
#define STATUS_RDY   0x40
#define STATUS_WF   0x20
#define STATUS_SC   0x10
#define STATUS_DRQ   0x08
#define STATUS_CRD   0x04
#define STATUS_IDX   0x02
#define STATUS_ERR   0x01
#define STATUS_ADMBSY   0x100
#define REG_ERROR   1
#define ERROR_BB   0x80
#define ERROR_ECC   0x40
#define ERROR_ID   0x10
#define ERROR_AC   0x04
#define ERROR_TK   0x02
#define ERROR_DM   0x01
#define REG_COMMAND   7
#define CMD_IDLE   0x00
#define CMD_RECALIBRATE   0x10
#define CMD_READ   0x20
#define CMD_READ_EXT   0x24
#define CMD_READ_DMA_EXT   0x25
#define CMD_WRITE   0x30
#define CMD_WRITE_EXT   0x34
#define CMD_WRITE_DMA_EXT   0x35
#define CMD_READVERIFY   0x40
#define CMD_FORMAT   0x50
#define CMD_SEEK   0x70
#define CMD_DIAG   0x90
#define CMD_SPECIFY   0x91
#define CMD_READ_DMA   0xC8
#define CMD_WRITE_DMA   0xCA
#define ATA_IDENTIFY   0xEC
#define REG_CTL   0
#define CTL_NORETRY   0x80
#define CTL_NOECC   0x40
#define CTL_EIGHTHEADS   0x08
#define CTL_RESET   0x04
#define CTL_INTDISABLE   0x02
#define REG_CTL_ALTSTAT   0
#define ID_GENERAL   0x00
#define ID_GEN_NOT_ATA   0x8000
#define ID_CAPABILITIES   0x31
#define ID_CAP_LBA   0x0200
#define ID_CAP_DMA   0x0100
#define ID_FIELD_VALIDITY   0x35
#define ID_FV_88   0x04
#define ID_MULTIWORD_DMA   0x3f
#define ID_MWDMA_2_SEL   0x0400
#define ID_MWDMA_1_SEL   0x0200
#define ID_MWDMA_0_SEL   0x0100
#define ID_MWDMA_2_SUP   0x0004
#define ID_MWDMA_1_SUP   0x0002
#define ID_MWDMA_0_SUP   0x0001
#define ID_CSS   0x53
#define ID_CSS_LBA48   0x0400
#define ID_ULTRA_DMA   0x58
#define ID_UDMA_5_SEL   0x2000
#define ID_UDMA_4_SEL   0x1000
#define ID_UDMA_3_SEL   0x0800
#define ID_UDMA_2_SEL   0x0400
#define ID_UDMA_1_SEL   0x0200
#define ID_UDMA_0_SEL   0x0100
#define ID_UDMA_5_SUP   0x0020
#define ID_UDMA_4_SUP   0x0010
#define ID_UDMA_3_SUP   0x0008
#define ID_UDMA_2_SUP   0x0004
#define ID_UDMA_1_SUP   0x0002
#define ID_UDMA_0_SUP   0x0001
#define DMA_COMMAND   0
#define DMA_CMD_WRITE   0x08
#define DMA_CMD_START   0x01
#define DMA_STATUS   2
#define DMA_ST_D1_DMACAP   0x40
#define DMA_ST_D0_DMACAP   0x20
#define DMA_ST_INT   0x04
#define DMA_ST_ERROR   0x02
#define DMA_ST_BM_ACTIVE   0x01
#define DMA_PRDTP   4
#define LBA48_CHECK_SIZE   0x0f000000
#define LBA_MAX_SIZE   0x0fffffff
#define ERROR_SENSE   0xF0
#define SENSE_NONE   0x00
#define SENSE_RECERR   0x10
#define SENSE_NOTRDY   0x20
#define SENSE_MEDERR   0x30
#define SENSE_HRDERR   0x40
#define SENSE_ILRQST   0x50
#define SENSE_UATTN   0x60
#define SENSE_DPROT   0x70
#define SENSE_ABRT   0xb0
#define SENSE_MISCOM   0xe0
#define ERROR_MCR   0x08
#define ERROR_ABRT   0x04
#define ERROR_EOM   0x02
#define ERROR_ILI   0x01
#define REG_FEAT   1
#define FEAT_OVERLAP   0x02
#define FEAT_DMA   0x01
#define REG_IRR   2
#define IRR_REL   0x04
#define IRR_IO   0x02
#define IRR_COD   0x01
#define REG_SAMTAG   3
#define REG_CNT_LO   4
#define REG_CNT_HI   5
#define REG_DRIVE   6
#define REG_STATUS   7
#define STATUS_BSY   0x80
#define STATUS_DRDY   0x40
#define STATUS_DMADF   0x20
#define STATUS_SRVCDSC   0x10
#define STATUS_DRQ   0x08
#define STATUS_CORR   0x04
#define STATUS_CHECK   0x01
#define ATAPI_PACKETCMD   0xA0
#define ATAPI_IDENTIFY   0xA1
#define SCSI_READ10   0x28
#define SCSI_SENSE   0x03
#define CD_SECTOR_SIZE   2048
#define NO_IRQ   0
#define ATAPI_PACKETSIZE   12
#define SENSE_PACKETSIZE   18
#define ERR   (-1)
#define ERR_BAD_SECTOR   (-2)
#define WAKEUP_SECS   32
#define WAKEUP_TICKS   (WAKEUP_SECS*system_hz)
#define MAX_DRIVES   8
#define COMPAT_DRIVES   4
#define MAX_SECS   127
#define MAX_ERRORS   4
#define NR_MINORS   (MAX_DRIVES * DEV_PER_DRIVE)
#define SUB_PER_DRIVE   (NR_PARTITIONS * NR_PARTITIONS)
#define NR_SUBDEVS   (MAX_DRIVES * SUB_PER_DRIVE)
#define DELAY_USECS   1000
#define DELAY_TICKS   1
#define DEF_TIMEOUT_TICKS   300
#define RECOVERY_USECS   500000
#define RECOVERY_TICKS   30
#define INITIALIZED   0x01
#define DEAF   0x02
#define SMART   0x04
#define ATAPI   0x08
#define IDENTIFIED   0x10
#define IGNORING   0x20
#define NO_DMA_VAR   "ata_no_dma"

Functions

 _PROTOTYPE (int main,(int argc, char *argv[]))


Define Documentation

#define ATA_IDENTIFY   0xEC

Definition at line 73 of file at_wini.h.

#define ATAPI   0x08

Definition at line 214 of file at_wini.h.

#define ATAPI_DEBUG   0

Definition at line 10 of file at_wini.h.

#define ATAPI_IDENTIFY   0xA1

Definition at line 172 of file at_wini.h.

#define ATAPI_PACKETCMD   0xA0

Definition at line 171 of file at_wini.h.

#define ATAPI_PACKETSIZE   12

Definition at line 182 of file at_wini.h.

#define CD_SECTOR_SIZE   2048

Definition at line 176 of file at_wini.h.

#define CMD_DIAG   0x90

Definition at line 69 of file at_wini.h.

#define CMD_FORMAT   0x50

Definition at line 67 of file at_wini.h.

#define CMD_IDLE   0x00

Definition at line 58 of file at_wini.h.

#define CMD_READ   0x20

Definition at line 60 of file at_wini.h.

#define CMD_READ_DMA   0xC8

Definition at line 71 of file at_wini.h.

#define CMD_READ_DMA_EXT   0x25

Definition at line 62 of file at_wini.h.

#define CMD_READ_EXT   0x24

Definition at line 61 of file at_wini.h.

#define CMD_READVERIFY   0x40

Definition at line 66 of file at_wini.h.

#define CMD_RECALIBRATE   0x10

Definition at line 59 of file at_wini.h.

#define CMD_SEEK   0x70

Definition at line 68 of file at_wini.h.

#define CMD_SPECIFY   0x91

Definition at line 70 of file at_wini.h.

#define CMD_WRITE   0x30

Definition at line 63 of file at_wini.h.

#define CMD_WRITE_DMA   0xCA

Definition at line 72 of file at_wini.h.

#define CMD_WRITE_DMA_EXT   0x35

Definition at line 65 of file at_wini.h.

#define CMD_WRITE_EXT   0x34

Definition at line 64 of file at_wini.h.

#define COMPAT_DRIVES   4

Definition at line 195 of file at_wini.h.

#define CTL_EIGHTHEADS   0x08

Definition at line 78 of file at_wini.h.

#define CTL_INTDISABLE   0x02

Definition at line 80 of file at_wini.h.

#define CTL_NOECC   0x40

Definition at line 77 of file at_wini.h.

#define CTL_NORETRY   0x80

Definition at line 76 of file at_wini.h.

#define CTL_RESET   0x04

Definition at line 79 of file at_wini.h.

#define DEAF   0x02

Definition at line 211 of file at_wini.h.

#define DEF_TIMEOUT_TICKS   300

Definition at line 207 of file at_wini.h.

#define DELAY_TICKS   1

Definition at line 206 of file at_wini.h.

#define DELAY_USECS   1000

Definition at line 205 of file at_wini.h.

#define DMA_CMD_START   0x01

Definition at line 117 of file at_wini.h.

#define DMA_CMD_WRITE   0x08

Definition at line 116 of file at_wini.h.

#define DMA_COMMAND   0

Definition at line 115 of file at_wini.h.

#define DMA_PRDTP   4

Definition at line 124 of file at_wini.h.

#define DMA_ST_BM_ACTIVE   0x01

Definition at line 123 of file at_wini.h.

#define DMA_ST_D0_DMACAP   0x20

Definition at line 120 of file at_wini.h.

#define DMA_ST_D1_DMACAP   0x40

Definition at line 119 of file at_wini.h.

#define DMA_ST_ERROR   0x02

Definition at line 122 of file at_wini.h.

#define DMA_ST_INT   0x04

Definition at line 121 of file at_wini.h.

#define DMA_STATUS   2

Definition at line 118 of file at_wini.h.

#define ENABLE_ATAPI   1

Definition at line 8 of file at_wini.h.

#define ERR   (-1)

Definition at line 186 of file at_wini.h.

#define ERR_BAD_SECTOR   (-2)

Definition at line 187 of file at_wini.h.

#define ERROR_ABRT   0x04

Definition at line 145 of file at_wini.h.

#define ERROR_AC   0x04

Definition at line 52 of file at_wini.h.

#define ERROR_BB   0x80

Definition at line 49 of file at_wini.h.

#define ERROR_DM   0x01

Definition at line 54 of file at_wini.h.

#define ERROR_ECC   0x40

Definition at line 50 of file at_wini.h.

#define ERROR_EOM   0x02

Definition at line 146 of file at_wini.h.

#define ERROR_ID   0x10

Definition at line 51 of file at_wini.h.

#define ERROR_ILI   0x01

Definition at line 147 of file at_wini.h.

#define ERROR_MCR   0x08

Definition at line 144 of file at_wini.h.

#define ERROR_SENSE   0xF0

Definition at line 133 of file at_wini.h.

#define ERROR_TK   0x02

Definition at line 53 of file at_wini.h.

#define FEAT_DMA   0x01

Definition at line 150 of file at_wini.h.

#define FEAT_OVERLAP   0x02

Definition at line 149 of file at_wini.h.

#define ID_CAP_DMA   0x0100

Definition at line 88 of file at_wini.h.

#define ID_CAP_LBA   0x0200

Definition at line 87 of file at_wini.h.

#define ID_CAPABILITIES   0x31

Definition at line 86 of file at_wini.h.

#define ID_CSS   0x53

Definition at line 98 of file at_wini.h.

#define ID_CSS_LBA48   0x0400

Definition at line 99 of file at_wini.h.

#define ID_FIELD_VALIDITY   0x35

Definition at line 89 of file at_wini.h.

#define ID_FV_88   0x04

Definition at line 90 of file at_wini.h.

#define ID_GEN_NOT_ATA   0x8000

Definition at line 85 of file at_wini.h.

#define ID_GENERAL   0x00

Definition at line 84 of file at_wini.h.

#define ID_MULTIWORD_DMA   0x3f

Definition at line 91 of file at_wini.h.

#define ID_MWDMA_0_SEL   0x0100

Definition at line 94 of file at_wini.h.

#define ID_MWDMA_0_SUP   0x0001

Definition at line 97 of file at_wini.h.

#define ID_MWDMA_1_SEL   0x0200

Definition at line 93 of file at_wini.h.

#define ID_MWDMA_1_SUP   0x0002

Definition at line 96 of file at_wini.h.

#define ID_MWDMA_2_SEL   0x0400

Definition at line 92 of file at_wini.h.

#define ID_MWDMA_2_SUP   0x0004

Definition at line 95 of file at_wini.h.

#define ID_UDMA_0_SEL   0x0100

Definition at line 106 of file at_wini.h.

#define ID_UDMA_0_SUP   0x0001

Definition at line 112 of file at_wini.h.

#define ID_UDMA_1_SEL   0x0200

Definition at line 105 of file at_wini.h.

#define ID_UDMA_1_SUP   0x0002

Definition at line 111 of file at_wini.h.

#define ID_UDMA_2_SEL   0x0400

Definition at line 104 of file at_wini.h.

#define ID_UDMA_2_SUP   0x0004

Definition at line 110 of file at_wini.h.

#define ID_UDMA_3_SEL   0x0800

Definition at line 103 of file at_wini.h.

#define ID_UDMA_3_SUP   0x0008

Definition at line 109 of file at_wini.h.

#define ID_UDMA_4_SEL   0x1000

Definition at line 102 of file at_wini.h.

#define ID_UDMA_4_SUP   0x0010

Definition at line 108 of file at_wini.h.

#define ID_UDMA_5_SEL   0x2000

Definition at line 101 of file at_wini.h.

#define ID_UDMA_5_SUP   0x0020

Definition at line 107 of file at_wini.h.

#define ID_ULTRA_DMA   0x58

Definition at line 100 of file at_wini.h.

#define IDENTIFIED   0x10

Definition at line 218 of file at_wini.h.

#define IGNORING   0x20

Definition at line 219 of file at_wini.h.

#define INITIALIZED   0x01

Definition at line 210 of file at_wini.h.

#define IRR_COD   0x01

Definition at line 154 of file at_wini.h.

#define IRR_IO   0x02

Definition at line 153 of file at_wini.h.

#define IRR_REL   0x04

Definition at line 152 of file at_wini.h.

#define LBA48_CHECK_SIZE   0x0f000000

Definition at line 127 of file at_wini.h.

#define LBA_MAX_SIZE   0x0fffffff

Definition at line 128 of file at_wini.h.

#define LDH_DEFAULT   0xA0

Definition at line 32 of file at_wini.h.

#define LDH_DEV   0x10

Definition at line 34 of file at_wini.h.

#define ldh_init ( drive   )     (LDH_DEFAULT | ((drive) << 4))

Definition at line 35 of file at_wini.h.

#define LDH_LBA   0x40

Definition at line 33 of file at_wini.h.

#define MAX_DRIVES   8

Definition at line 194 of file at_wini.h.

#define MAX_ERRORS   4

Definition at line 201 of file at_wini.h.

#define MAX_SECS   127

Definition at line 199 of file at_wini.h.

#define NO_DMA_VAR   "ata_no_dma"

Definition at line 221 of file at_wini.h.

#define NO_IRQ   0

Definition at line 180 of file at_wini.h.

#define NR_MINORS   (MAX_DRIVES * DEV_PER_DRIVE)

Definition at line 202 of file at_wini.h.

#define NR_SUBDEVS   (MAX_DRIVES * SUB_PER_DRIVE)

Definition at line 204 of file at_wini.h.

#define PCI_CTL_OFF   2

Definition at line 20 of file at_wini.h.

#define PCI_DMA_2ND_OFF   8

Definition at line 21 of file at_wini.h.

#define RECOVERY_TICKS   30

Definition at line 209 of file at_wini.h.

#define RECOVERY_USECS   500000

Definition at line 208 of file at_wini.h.

#define REG_CMD_BASE0   0x1F0

Definition at line 15 of file at_wini.h.

#define REG_CMD_BASE1   0x170

Definition at line 16 of file at_wini.h.

#define REG_CNT_HI   5

Definition at line 157 of file at_wini.h.

#define REG_CNT_LO   4

Definition at line 156 of file at_wini.h.

#define REG_COMMAND   7

Definition at line 57 of file at_wini.h.

#define REG_COUNT   2

Definition at line 27 of file at_wini.h.

#define REG_CTL   0

Definition at line 75 of file at_wini.h.

#define REG_CTL_ALTSTAT   0

Definition at line 81 of file at_wini.h.

#define REG_CTL_BASE0   0x3F6

Definition at line 17 of file at_wini.h.

#define REG_CTL_BASE1   0x376

Definition at line 18 of file at_wini.h.

#define REG_CYL_HI   5

Definition at line 30 of file at_wini.h.

#define REG_CYL_LO   4

Definition at line 29 of file at_wini.h.

#define REG_DATA   0

Definition at line 25 of file at_wini.h.

#define REG_DRIVE   6

Definition at line 158 of file at_wini.h.

#define REG_ERROR   1

Definition at line 48 of file at_wini.h.

#define REG_FEAT   1

Definition at line 148 of file at_wini.h.

#define REG_IRR   2

Definition at line 151 of file at_wini.h.

#define REG_LDH   6

Definition at line 31 of file at_wini.h.

#define REG_PRECOMP   1

Definition at line 26 of file at_wini.h.

#define REG_SAMTAG   3

Definition at line 155 of file at_wini.h.

#define REG_SECTOR   3

Definition at line 28 of file at_wini.h.

#define REG_STATUS   7

Definition at line 161 of file at_wini.h.

#define REG_STATUS   7

Definition at line 161 of file at_wini.h.

#define SCSI_READ10   0x28

Definition at line 173 of file at_wini.h.

#define SCSI_SENSE   0x03

Definition at line 174 of file at_wini.h.

#define SENSE_ABRT   0xb0

Definition at line 142 of file at_wini.h.

#define SENSE_DPROT   0x70

Definition at line 141 of file at_wini.h.

#define SENSE_HRDERR   0x40

Definition at line 138 of file at_wini.h.

#define SENSE_ILRQST   0x50

Definition at line 139 of file at_wini.h.

#define SENSE_MEDERR   0x30

Definition at line 137 of file at_wini.h.

#define SENSE_MISCOM   0xe0

Definition at line 143 of file at_wini.h.

#define SENSE_NONE   0x00

Definition at line 134 of file at_wini.h.

#define SENSE_NOTRDY   0x20

Definition at line 136 of file at_wini.h.

#define SENSE_PACKETSIZE   18

Definition at line 183 of file at_wini.h.

#define SENSE_RECERR   0x10

Definition at line 135 of file at_wini.h.

#define SENSE_UATTN   0x60

Definition at line 140 of file at_wini.h.

#define SMART   0x04

Definition at line 212 of file at_wini.h.

#define STATUS_ADMBSY   0x100

Definition at line 47 of file at_wini.h.

#define STATUS_BSY   0x80

Definition at line 162 of file at_wini.h.

#define STATUS_BSY   0x80

Definition at line 162 of file at_wini.h.

#define STATUS_CHECK   0x01

Definition at line 168 of file at_wini.h.

#define STATUS_CORR   0x04

Definition at line 167 of file at_wini.h.

#define STATUS_CRD   0x04

Definition at line 44 of file at_wini.h.

#define STATUS_DMADF   0x20

Definition at line 164 of file at_wini.h.

#define STATUS_DRDY   0x40

Definition at line 163 of file at_wini.h.

#define STATUS_DRQ   0x08

Definition at line 166 of file at_wini.h.

#define STATUS_DRQ   0x08

Definition at line 166 of file at_wini.h.

#define STATUS_ERR   0x01

Definition at line 46 of file at_wini.h.

#define STATUS_IDX   0x02

Definition at line 45 of file at_wini.h.

#define STATUS_RDY   0x40

Definition at line 40 of file at_wini.h.

#define STATUS_SC   0x10

Definition at line 42 of file at_wini.h.

#define STATUS_SRVCDSC   0x10

Definition at line 165 of file at_wini.h.

#define STATUS_WF   0x20

Definition at line 41 of file at_wini.h.

#define SUB_PER_DRIVE   (NR_PARTITIONS * NR_PARTITIONS)

Definition at line 203 of file at_wini.h.

#define VERBOSE   0

Definition at line 7 of file at_wini.h.

#define WAKEUP_SECS   32

Definition at line 190 of file at_wini.h.

#define WAKEUP_TICKS   (WAKEUP_SECS*system_hz)

Definition at line 191 of file at_wini.h.


Function Documentation

_PROTOTYPE ( int  main,
(int argc, char *argv[])   
)


Generated on Tue Mar 9 04:36:45 2010 for Minix by  doxygen 1.5.8