Mercurial > illumos > illumos-gate
changeset 10006:54ed6e960d71
6727346 ahci driver should support Compact Flash connected through CF-to-SATA adapter
author | ying tian - Beijing China <Ying.Tian@Sun.COM> |
---|---|
date | Wed, 01 Jul 2009 14:14:31 +0800 |
parents | b6940fb2404d |
children | 1b2a9b424228 |
files | usr/src/uts/common/io/sata/impl/sata.c usr/src/uts/common/sys/sata/impl/sata.h usr/src/uts/common/sys/sata/sata_defs.h |
diffstat | 3 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/io/sata/impl/sata.c Wed Jul 01 13:24:50 2009 +0800 +++ b/usr/src/uts/common/io/sata/impl/sata.c Wed Jul 01 14:14:31 2009 +0800 @@ -129,7 +129,7 @@ #define LEGACY_HWID_LEN 64 /* Model (40) + Serial (20) + pad */ -static char sata_rev_tag[] = {"1.42"}; +static char sata_rev_tag[] = {"1.43"}; /* * SATA cb_ops functions @@ -2903,7 +2903,7 @@ * This function should not be called for ATAPI devices - they * respond directly to SCSI Inquiry command. * - * SATA Identify Device data has to be valid in sata_rive_info. + * SATA Identify Device data has to be valid in sata_drive_info. * Buffer has to accomodate the inquiry length (36 bytes). * * This function should be called with a port mutex held. @@ -2928,7 +2928,9 @@ inq->inq_dtype = sdinfo->satadrv_type == SATA_DTYPE_ATADISK ? DTYPE_DIRECT : DTYPE_RODIRECT; /* DTYPE_UNKNOWN; */ - inq->inq_rmb = sid->ai_config & SATA_REM_MEDIA ? 1 : 0; + /* CFA type device is not a removable media device */ + inq->inq_rmb = ((sid->ai_config != SATA_CFA_TYPE) && + (sid->ai_config & SATA_REM_MEDIA)) ? 1 : 0; inq->inq_qual = 0; /* Device type qualifier (obsolete in SCSI3? */ inq->inq_iso = 0; /* ISO version */ inq->inq_ecma = 0; /* ECMA version */ @@ -9423,6 +9425,9 @@ /* Set the correct device type */ if ((cfg_word & SATA_ATA_TYPE_MASK) == SATA_ATA_TYPE) { sdinfo->satadrv_type = SATA_DTYPE_ATADISK; + } else if (cfg_word == SATA_CFA_TYPE) { + /* It's a Compact Flash media via CF-to-SATA HDD adapter */ + sdinfo->satadrv_type = SATA_DTYPE_ATADISK; } else if ((cfg_word & SATA_ATAPI_TYPE_MASK) == SATA_ATAPI_TYPE) { switch (cfg_word & SATA_ATAPI_ID_DEV_TYPE) { case SATA_ATAPI_CDROM_DEV:
--- a/usr/src/uts/common/sys/sata/impl/sata.h Wed Jul 01 13:24:50 2009 +0800 +++ b/usr/src/uts/common/sys/sata/impl/sata.h Wed Jul 01 14:14:31 2009 +0800 @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -768,7 +768,7 @@ #endif -/* sata_rev_tag 1.42 */ +/* sata_rev_tag 1.43 */ #ifdef __cplusplus }
--- a/usr/src/uts/common/sys/sata/sata_defs.h Wed Jul 01 13:24:50 2009 +0800 +++ b/usr/src/uts/common/sys/sata/sata_defs.h Wed Jul 01 14:14:31 2009 +0800 @@ -247,6 +247,7 @@ #define SATA_ATA_TYPE 0x0000 /* ATA device */ #define SATA_REM_MEDIA 0x0080 /* Removable media */ #define SATA_INCOMPLETE_DATA 0x0004 /* Incomplete Identify Device data */ +#define SATA_CFA_TYPE 0x848a /* CFA feature set device */ #define SATA_ID_SERIAL_OFFSET 10 #define SATA_ID_SERIAL_LEN 20