From 7606b4450b7de96a350d2c4b4c9a21d05d9e18e4 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Sun, 30 Aug 2009 16:31:25 +0000 Subject: [PATCH] Short ATA command format has 28bit address, not 36bit. Rename ata_36bit_cmd() into ata_28bit_cmd(), while it didn't become legacy. MFC after: 2 days --- sbin/camcontrol/camcontrol.c | 4 ++-- sys/cam/ata/ata_all.c | 2 +- sys/cam/ata/ata_all.h | 2 +- sys/cam/ata/ata_da.c | 14 +++++++------- sys/cam/ata/ata_xpt.c | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index beda74b301bf..d3450e0648a0 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -1212,9 +1212,9 @@ ataidentify(struct cam_device *device, int retry_count, int timeout) /*dxfer_len*/sizeof(struct ata_params), timeout ? timeout : 30 * 1000); if (cgd.protocol == PROTO_ATA) - ata_36bit_cmd(&ccb->ataio, ATA_ATA_IDENTIFY, 0, 0, 0); + ata_28bit_cmd(&ccb->ataio, ATA_ATA_IDENTIFY, 0, 0, 0); else - ata_36bit_cmd(&ccb->ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); + ata_28bit_cmd(&ccb->ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); /* Disable freezing the device queue */ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; diff --git a/sys/cam/ata/ata_all.c b/sys/cam/ata/ata_all.c index 1e6eecec820c..e75c109f7eea 100644 --- a/sys/cam/ata/ata_all.c +++ b/sys/cam/ata/ata_all.c @@ -91,7 +91,7 @@ ata_print_ident(struct ata_params *ident_data) } void -ata_36bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features, +ata_28bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features, uint32_t lba, uint8_t sector_count) { bzero(&ataio->cmd, sizeof(ataio->cmd)); diff --git a/sys/cam/ata/ata_all.h b/sys/cam/ata/ata_all.h index 60129956db70..748035f86021 100644 --- a/sys/cam/ata/ata_all.h +++ b/sys/cam/ata/ata_all.h @@ -83,7 +83,7 @@ struct ata_res { int ata_version(int ver); void ata_print_ident(struct ata_params *ident_data); -void ata_36bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features, +void ata_28bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features, uint32_t lba, uint8_t sector_count); void ata_48bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint16_t features, uint64_t lba, uint16_t sector_count); diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 77d7ccad51a1..7d7230b154f1 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -287,7 +287,7 @@ adaclose(struct disk *dp) if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0); else - ata_36bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); + ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0, /*sense_flags*/SF_RETRY_UA, softc->disk->d_devstat); @@ -411,7 +411,7 @@ adadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len ata_48bit_cmd(&ccb.ataio, ATA_WRITE_DMA48, 0, lba, count); } else { - ata_36bit_cmd(&ccb.ataio, ATA_WRITE_DMA, + ata_28bit_cmd(&ccb.ataio, ATA_WRITE_DMA, 0, lba, count); } xpt_polled_action(&ccb); @@ -441,7 +441,7 @@ adadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(&ccb.ataio, ATA_FLUSHCACHE48, 0, 0, 0); else - ata_36bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); + ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); xpt_polled_action(&ccb); if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) @@ -856,10 +856,10 @@ adastart(struct cam_periph *periph, union ccb *start_ccb) } } else { if (bp->bio_cmd == BIO_READ) { - ata_36bit_cmd(ataio, ATA_READ_DMA, + ata_28bit_cmd(ataio, ATA_READ_DMA, 0, lba, count); } else { - ata_36bit_cmd(ataio, ATA_WRITE_DMA, + ata_28bit_cmd(ataio, ATA_WRITE_DMA, 0, lba, count); } } @@ -878,7 +878,7 @@ adastart(struct cam_periph *periph, union ccb *start_ccb) if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(ataio, ATA_FLUSHCACHE48, 0, 0, 0); else - ata_36bit_cmd(ataio, ATA_FLUSHCACHE, 0, 0, 0); + ata_28bit_cmd(ataio, ATA_FLUSHCACHE, 0, 0, 0); break; } start_ccb->ccb_h.ccb_state = ADA_CCB_BUFFER_IO; @@ -1126,7 +1126,7 @@ adashutdown(void * arg, int howto) if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(&ccb.ataio, ATA_FLUSHCACHE48, 0, 0, 0); else - ata_36bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); + ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); xpt_polled_action(&ccb); if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 0be44fc2b772..5acb9a35d0c5 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -357,9 +357,9 @@ probestart(struct cam_periph *periph, union ccb *start_ccb) /*dxfer_len*/sizeof(struct ata_params), 30 * 1000); if (periph->path->device->protocol == PROTO_ATA) - ata_36bit_cmd(ataio, ATA_ATA_IDENTIFY, 0, 0, 0); + ata_28bit_cmd(ataio, ATA_ATA_IDENTIFY, 0, 0, 0); else - ata_36bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); + ata_28bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); break; } case PROBE_SETMODE: @@ -375,7 +375,7 @@ probestart(struct cam_periph *periph, union ccb *start_ccb) /*data_ptr*/NULL, /*dxfer_len*/0, 30 * 1000); - ata_36bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0, + ata_28bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0, ata_max_mode(ident_buf, ATA_UDMA6, ATA_UDMA6)); break; }