diff options
author | mav <mav@FreeBSD.org> | 2009-02-28 11:25:05 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-02-28 11:25:05 +0000 |
commit | b342cbbd7afd2f2831b83817093c7f75c25d4b4d (patch) | |
tree | f3410869622522be80b33c90bcbde706aecd00e0 /sys/dev/ata/ata-all.h | |
parent | 24ca141ec70a3d76fd6bf5cff5521ec69c1d6d55 (diff) | |
download | FreeBSD-src-b342cbbd7afd2f2831b83817093c7f75c25d4b4d.zip FreeBSD-src-b342cbbd7afd2f2831b83817093c7f75c25d4b4d.tar.gz |
Rework device probing by moving ata_getparam() call from ata_identify() to
drivers' probe routines. It allows not to sleep and so not drop Giant inside
ata_identify() critical section and so avoid crash if it reentered on
request timeout. Reentering of probe call checked inside of it.
Give device own knowledge about it's type (ata/atapi/atapicam). It is not
a good idea to ask channel status for device type inside ata_getparam().
Add softc memory deallocation on device destruction.
Diffstat (limited to 'sys/dev/ata/ata-all.h')
-rw-r--r-- | sys/dev/ata/ata-all.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-all.h b/sys/dev/ata/ata-all.h index c00bb1c..8c7f0d1 100644 --- a/sys/dev/ata/ata-all.h +++ b/sys/dev/ata/ata-all.h @@ -410,6 +410,10 @@ struct ata_device { #define ATA_MASTER 0x00 #define ATA_SLAVE 0x01 #define ATA_PM 0x0f + int type; /* device type */ +#define ATA_T_ATA 0x00 +#define ATA_T_ATAPI 0x01 +#define ATA_T_ATAPI_CAM 0x02 struct ata_params param; /* ata param structure */ int mode; /* current transfermode */ @@ -422,6 +426,8 @@ struct ata_device { #define ATA_D_MEDIA_CHANGED 0x0002 #define ATA_D_ENC_PRESENT 0x0004 #define ATA_D_48BIT_ACTIVE 0x0008 +#define ATA_D_PROBED 0x0010 +#define ATA_D_VALID 0x0020 }; /* structure for holding DMA Physical Region Descriptors (PRD) entries */ @@ -559,6 +565,8 @@ void ata_interrupt(void *data); int ata_device_ioctl(device_t dev, u_long cmd, caddr_t data); int ata_getparam(struct ata_device *atadev, int init); int ata_identify(device_t dev); +device_t ata_add_child(device_t, int, int); +int ata_delete_child(device_t , device_t); void ata_default_registers(device_t dev); void ata_modify_if_48bit(struct ata_request *request); void ata_udelay(int interval); |