summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-disk.h
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>1999-09-21 19:50:40 +0000
committersos <sos@FreeBSD.org>1999-09-21 19:50:40 +0000
commit73b70d4d13907aa399a81ba42253053555298f93 (patch)
tree59d5f8ea67bed9fb0f3c1d949e17d6d179d54e8c /sys/dev/ata/ata-disk.h
parentbf608b572c2e8d26fc3956de3177006c36ad3358 (diff)
downloadFreeBSD-src-73b70d4d13907aa399a81ba42253053555298f93.zip
FreeBSD-src-73b70d4d13907aa399a81ba42253053555298f93.tar.gz
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there are some cool things in this one (and new bugs probably :) )... The ATA driver has grown "real" timeout support for all devices. This means that it should be possible to get in contact with (especially) lost ATAPI devices. It also means that the ATA driver is now usable on notebooks as it will DTRT on resume. An experimental hack at utilizing the Promise66's at UDMA66 is in there, but I cant test it. If someone feels like sending me one, give me a ping. The ATAPI DMA enableling scheme has been changed, also better DMA support for the Aladdin chipset has been implemented for ATAPI devices. Note that the Aladdin apparently only can do DMA reads on ATAPI devices, and the Promise cant do ATAPI DMA at all. I have seen problems on some ATAPI devices that should be able to run in DMA mode, so if you encounter problems with hanging atapi devices during the probe, or during access, disable DMA in atapi-all.c, and let me know. It might be nessesary to do this via a "white list" for known good devices... The ATAPI CDROM driver can now use eject/close without hanging and the bug that caused reading beyond the end of a CD has been fixed. Media change is also handled proberly. DVD drives are identified and are usable as CDROM devices at least, I dont have the HW to test this further, see above :). The ATAPI tape driver has gotten some support for using the DSC method for not blocking the IDE channel during read/write when the device has full buffers. It knows about the OnStream DI-30 device, support is not completed yet, but it can function as a primitive backup medium, without filemarks, and without bad media handeling. This is because the OnStream device doesn't handle this (like everybody else) in HW. It also now supports getting/setting the record position on devices that supports it. Some rather major cleanups and rearrangements as well (cvs -b diff is your freind). I'm closing in on declaring this for beta code, most of the infrastruture is in place by now. As usual USE AT YOUR OWN RISK!!, this is still alpha level code. This driver can hose your disk real bad if anything goes wrong, but now you have been warned :) But please tell me how it works for you! Enjoy! -Søren
Diffstat (limited to 'sys/dev/ata/ata-disk.h')
-rw-r--r--sys/dev/ata/ata-disk.h64
1 files changed, 34 insertions, 30 deletions
diff --git a/sys/dev/ata/ata-disk.h b/sys/dev/ata/ata-disk.h
index 2f017b2..83747c2 100644
--- a/sys/dev/ata/ata-disk.h
+++ b/sys/dev/ata/ata-disk.h
@@ -40,9 +40,9 @@ struct ata_params {
int16_t vendorunique0[3];
int8_t serial[20]; /* serial number */
int16_t buffertype; /* buffer type */
-#define ATA_BT_SINGLEPORTSECTOR 1 /* 1 port, 1 sector buffer */
-#define ATA_BT_DUALPORTMULTI 2 /* 2 port, mult sector buffer */
-#define ATA_BT_DUALPORTMULTICACHE 3 /* above plus track cache */
+#define ATA_BT_SINGLEPORTSECTOR 1 /* 1 port, 1 sector buffer */
+#define ATA_BT_DUALPORTMULTI 2 /* 2 port, mult sector buffer */
+#define ATA_BT_DUALPORTMULTICACHE 3 /* above plus track cache */
int16_t buffersize; /* buf size, 512-byte units */
int16_t necc; /* ecc bytes appended */
@@ -52,15 +52,15 @@ struct ata_params {
int8_t vendorunique1;
int16_t usedmovsd; /* double word read/write? */
- u_int8_t vendorcap; /* vendor capabilities */
- u_int8_t dmaflag :1; /* DMA supported - always 1 */
- u_int8_t lbaflag :1; /* LBA supported - always 1 */
- u_int8_t iordydis :1; /* IORDY may be disabled */
- u_int8_t iordyflag :1; /* IORDY supported */
- u_int8_t :1;
- u_int8_t standby :1; /* standby timer supported */
- u_int8_t :1;
- u_int8_t :1;
+ u_int8_t vendorcap; /* vendor capabilities */
+ u_int8_t dmaflag :1; /* DMA supported - always 1 */
+ u_int8_t lbaflag :1; /* LBA supported - always 1 */
+ u_int8_t iordydis :1; /* IORDY may be disabled */
+ u_int8_t iordyflag :1; /* IORDY supported */
+ u_int8_t :1;
+ u_int8_t standby :1; /* standby timer supported */
+ u_int8_t :1;
+ u_int8_t :1;
int16_t capvalidate; /* validation for above */
int8_t vendorunique3;
@@ -69,8 +69,8 @@ struct ata_params {
int8_t odmamode; /* old DMA modes, not ATA-3 */
int16_t atavalid; /* fields valid */
-#define ATA_FLAG_54_58 1 /* words 54-58 valid */
-#define ATA_FLAG_64_70 2 /* words 64-70 valid */
+#define ATA_FLAG_54_58 1 /* words 54-58 valid */
+#define ATA_FLAG_64_70 2 /* words 64-70 valid */
int16_t currcyls;
int16_t currheads;
@@ -81,19 +81,19 @@ struct ata_params {
int8_t multsectvalid;
int32_t lbasize;
- int16_t sdmamodes; /* singleword DMA modes */
- int16_t wdmamodes; /* multiword DMA modes */
- int16_t apiomodes; /* advanced PIO modes */
+ int16_t sdmamodes; /* singleword DMA modes */
+ int16_t wdmamodes; /* multiword DMA modes */
+ int16_t apiomodes; /* advanced PIO modes */
- u_int16_t mwdmamin; /* min. M/W DMA time/word ns */
- u_int16_t mwdmarec; /* rec. M/W DMA time ns */
- u_int16_t pioblind; /* min. PIO cycle w/o flow */
- u_int16_t pioiordy; /* min. PIO cycle IORDY flow */
+ u_int16_t mwdmamin; /* min. M/W DMA time/word ns */
+ u_int16_t mwdmarec; /* rec. M/W DMA time ns */
+ u_int16_t pioblind; /* min. PIO cycle w/o flow */
+ u_int16_t pioiordy; /* min. PIO cycle IORDY flow */
int16_t reserved69;
int16_t reserved70;
- u_int16_t rlsovlap; /* rel time (us) for overlap */
- u_int16_t rlsservice; /* rel time (us) for service */
+ u_int16_t rlsovlap; /* rel time (us) for overlap */
+ u_int16_t rlsservice; /* rel time (us) for service */
int16_t reserved73;
int16_t reserved74;
int16_t queuelen;
@@ -125,7 +125,7 @@ struct ad_softc {
int32_t unit; /* ATA_MASTER or ATA_SLAVE */
int32_t lun; /* logical unit number */
u_int16_t cylinders; /* disk geometry (probed) */
- u_int8_t heads;
+ u_int8_t heads;
u_int8_t sectors;
u_int32_t total_secs; /* total # of sectors (LBA) */
u_int32_t transfersize; /* size of each transfer */
@@ -137,18 +137,18 @@ struct ad_softc {
#define AD_F_DMA_ENABLED 0x0008
#define AD_F_TAG_ENABLED 0x0010
- struct buf_queue_head queue; /* head of request queue */
- struct devstat stats; /* devstat entry */
+ struct buf_queue_head queue; /* head of request queue */
+ struct devstat stats; /* devstat entry */
struct disk disk; /* disklabel/slice stuff */
};
struct ad_request {
struct ad_softc *device; /* ptr to parent device */
- u_int32_t blockaddr; /* block number */
- u_int32_t bytecount; /* bytes to transfer */
- u_int32_t donecount; /* bytes transferred */
+ u_int32_t blockaddr; /* block number */
+ u_int32_t bytecount; /* bytes to transfer */
+ u_int32_t donecount; /* bytes transferred */
u_int32_t currentsize; /* size of current transfer */
- u_int32_t result; /* result code */
+ struct callout_handle timeout_handle; /* handle for untimeout */
int32_t flags;
#define AR_F_READ 0x0001
#define AR_F_ERROR 0x0002
@@ -159,3 +159,7 @@ struct ad_request {
u_int8_t tag; /* tag ID of this request */
TAILQ_ENTRY(ad_request) chain; /* list management */
};
+
+void ad_transfer(struct ad_request *);
+int32_t ad_interrupt(struct ad_request *);
+void ad_reinit(struct ad_softc *);
OpenPOWER on IntegriCloud