summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-02-02 11:09:28 +0000
committermav <mav@FreeBSD.org>2010-02-02 11:09:28 +0000
commitb5b6d6b0e0e8523be005d532c4327061249c2a84 (patch)
tree37197ad5ae0872a11e1bc6a7828374ebc3770e16 /sbin/camcontrol
parent2c76d0e26f4843ec857eaeade022a391227acb85 (diff)
downloadFreeBSD-src-b5b6d6b0e0e8523be005d532c4327061249c2a84.zip
FreeBSD-src-b5b6d6b0e0e8523be005d532c4327061249c2a84.tar.gz
- Give ATA/SATA SIMs info about ATAPI packet size, supported by device.
- Make ATA XPT to reject longer SCSI CDBs then supported by device, or any SCSI CDBs, if device doesn't support ATAPI.
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r--sbin/camcontrol/camcontrol.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index c98d5c9..8a00f75 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -1010,8 +1010,10 @@ camxferrate(struct cam_device *device)
printf(" (");
if (ata->valid & CTS_ATA_VALID_MODE)
printf("%s, ", ata_mode2string(ata->mode));
+ if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0)
+ printf("ATAPI %dbytes, ", ata->atapi);
if (ata->valid & CTS_ATA_VALID_BYTECOUNT)
- printf("PIO size %dbytes", ata->bytecount);
+ printf("PIO %dbytes", ata->bytecount);
printf(")");
} else if (ccb->cts.transport == XPORT_SATA) {
struct ccb_trans_settings_sata *sata =
@@ -1022,8 +1024,10 @@ camxferrate(struct cam_device *device)
printf("SATA %d.x, ", sata->revision);
if (sata->valid & CTS_SATA_VALID_MODE)
printf("%s, ", ata_mode2string(sata->mode));
+ if ((sata->valid & CTS_SATA_VALID_ATAPI) && sata->atapi != 0)
+ printf("ATAPI %dbytes, ", sata->atapi);
if (sata->valid & CTS_SATA_VALID_BYTECOUNT)
- printf("PIO size %dbytes", sata->bytecount);
+ printf("PIO %dbytes", sata->bytecount);
printf(")");
}
@@ -2800,6 +2804,10 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts)
fprintf(stdout, "%sATA mode: %s\n", pathstr,
ata_mode2string(ata->mode));
}
+ if ((ata->valid & CTS_ATA_VALID_ATAPI) != 0) {
+ fprintf(stdout, "%sATAPI packet length: %d\n", pathstr,
+ ata->atapi);
+ }
if ((ata->valid & CTS_ATA_VALID_BYTECOUNT) != 0) {
fprintf(stdout, "%sPIO transaction length: %d\n",
pathstr, ata->bytecount);
@@ -2817,6 +2825,10 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts)
fprintf(stdout, "%sATA mode: %s\n", pathstr,
ata_mode2string(sata->mode));
}
+ if ((sata->valid & CTS_SATA_VALID_ATAPI) != 0) {
+ fprintf(stdout, "%sATAPI packet length: %d\n", pathstr,
+ sata->atapi);
+ }
if ((sata->valid & CTS_SATA_VALID_BYTECOUNT) != 0) {
fprintf(stdout, "%sPIO transaction length: %d\n",
pathstr, sata->bytecount);
OpenPOWER on IntegriCloud