summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-disk.h
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2002-02-04 19:23:40 +0000
committersos <sos@FreeBSD.org>2002-02-04 19:23:40 +0000
commitf0704f5ca18f3a7991726b05a2bf9eeea477567a (patch)
tree5e4cc6717e35748abaad55907c0de3f487461cd0 /sys/dev/ata/ata-disk.h
parent2ceaebc7d8f7c823715cc793b8557152e5c3392e (diff)
downloadFreeBSD-src-f0704f5ca18f3a7991726b05a2bf9eeea477567a.zip
FreeBSD-src-f0704f5ca18f3a7991726b05a2bf9eeea477567a.tar.gz
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty bugs in the old implementation. This made it possible to collapse the ATA/ATAPI device control structures into one generic structure. A note here, the kernel is NOT ready for detach of active devices, it fails all over in random places, but for inactive devices it works. However for ATA RAID this works, since the RAID abstration layer insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the physical disks. Proberly detect the RAID's from the BIOS, and mark critical RAID1 arrays as such, but continue if there is enough of the mirror left to do so. Properly fail arrays on a live system. For RAID0 that means return EIO, and for RAID1 it means continue on the still working part of the mirror if possible, else return EIO. If the state changes, log this to the console. Allow for Promise & Highpoint controllers/arrays to coexist on the same machine. It is not possible to distribute arrays over different makes of controllers though. If Promise SuperSwap enclosures are used, signal disk state on the status LED on the front. Misc fixes that I had lying around for various minor bugs. Sponsored by: Advanis Inc.
Diffstat (limited to 'sys/dev/ata/ata-disk.h')
-rw-r--r--sys/dev/ata/ata-disk.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/dev/ata/ata-disk.h b/sys/dev/ata/ata-disk.h
index 217063f..0bf49d8 100644
--- a/sys/dev/ata/ata-disk.h
+++ b/sys/dev/ata/ata-disk.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1998,1999,2000,2001 Søren Schmidt <sos@FreeBSD.org>
+ * Copyright (c) 1998,1999,2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,12 +30,12 @@
/* structure describing an ATA disk request */
struct ad_request {
- struct ad_softc *device; /* ptr to parent device */
+ struct ad_softc *softc; /* 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 currentsize; /* size of current transfer */
- struct callout_handle timeout_handle; /* handle for untimeout */
+ struct callout_handle timeout_handle; /* handle for untimeout */
int retries; /* retry count */
int flags;
#define ADR_F_READ 0x0001
@@ -55,8 +55,7 @@ struct ad_request {
/* structure describing an ATA disk */
struct ad_softc {
- struct ata_softc *controller; /* ptr to parent ctrl */
- int unit; /* ATA_MASTER or ATA_SLAVE */
+ struct ata_device *device; /* ptr to device softc */
int lun; /* logical unit number */
u_int64_t total_secs; /* total # of sectors (LBA) */
u_int8_t heads;
@@ -65,11 +64,10 @@ struct ad_softc {
int num_tags; /* number of tags supported */
int flags; /* drive flags */
#define AD_F_LABELLING 0x0001
-#define AD_F_DETACHING 0x0002
-#define AD_F_CHS_USED 0x0004
-#define AD_F_32B_ENABLED 0x0008
-#define AD_F_TAG_ENABLED 0x0010
-#define AD_F_RAID_SUBDISK 0x0020
+#define AD_F_CHS_USED 0x0002
+#define AD_F_32B_ENABLED 0x0004
+#define AD_F_TAG_ENABLED 0x0008
+#define AD_F_RAID_SUBDISK 0x0010
struct ad_request *tags[32]; /* tag array of requests */
int outstanding; /* tags not serviced yet */
@@ -79,9 +77,9 @@ struct ad_softc {
dev_t dev; /* device place holder */
};
-void ad_attach(struct ata_softc *, int);
-void ad_detach(struct ad_softc *, int);
-void ad_start(struct ad_softc *);
+void ad_attach(struct ata_device *);
+void ad_detach(struct ata_device *, int);
+void ad_start(struct ata_device *);
int ad_transfer(struct ad_request *);
int ad_interrupt(struct ad_request *);
int ad_service(struct ad_softc *, int);
OpenPOWER on IntegriCloud