diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index d7fe3d7d3023..fef85b82203e 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -942,9 +942,9 @@ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_action((union ccb *)&cts); } } + ata_device_transport(path); if (changed) proberequestdefaultnegotiation(periph); - ata_device_transport(path); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -1123,6 +1123,9 @@ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) snprintf(ident_buf->revision, sizeof(ident_buf->revision), "%04x", softc->pm_prv); path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + ata_device_transport(path); + if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) + proberequestdefaultnegotiation(periph); /* Set supported bits. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1200,6 +1203,9 @@ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; } + ata_device_transport(path); + if (changed) + proberequestdefaultnegotiation(periph); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -1777,6 +1783,12 @@ ata_get_transfer_settings(struct ccb_trans_settings *cts) sim = cts->ccb_h.path->bus->sim; (*(sim->sim_action))(sim, (union ccb *)cts); + if (cts->protocol == PROTO_UNKNOWN || + cts->protocol == PROTO_UNSPECIFIED) { + cts->protocol = device->protocol; + cts->protocol_version = device->protocol_version; + } + if (cts->protocol == PROTO_ATA) { ata = &cts->proto_specific.ata; if ((ata->valid & CTS_ATA_VALID_TQ) == 0) { @@ -1797,6 +1809,12 @@ ata_get_transfer_settings(struct ccb_trans_settings *cts) scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; } } + + if (cts->transport == XPORT_UNKNOWN || + cts->transport == XPORT_UNSPECIFIED) { + cts->transport = device->transport; + cts->transport_version = device->transport_version; + } } static void diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 3b26da3fd54e..ccdba319e7b4 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -2881,7 +2881,7 @@ ahciaction(struct cam_sim *sim, union ccb *ccb) d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -2967,7 +2967,7 @@ ahciaction(struct cam_sim *sim, union ccb *ccb) cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; /* ATI SB600 can't handle 256 sectors with FPDMA (NCQ). */ diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 6bee48d5b1a2..73e32dd749db 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -1787,7 +1787,7 @@ ataaction(struct cam_sim *sim, union ccb *ccb) d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; if (ch->flags & ATA_SATA) { cts->transport = XPORT_SATA; @@ -1875,7 +1875,7 @@ ataaction(struct cam_sim *sim, union ccb *ccb) else cpi->transport = XPORT_ATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; if (device_get_devclass(device_get_parent(parent)) == diff --git a/sys/dev/mvs/mvs.c b/sys/dev/mvs/mvs.c index debe55af4b76..1c7c930b602d 100644 --- a/sys/dev/mvs/mvs.c +++ b/sys/dev/mvs/mvs.c @@ -2301,7 +2301,7 @@ mvsaction(struct cam_sim *sim, union ccb *ccb) d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -2385,7 +2385,7 @@ mvsaction(struct cam_sim *sim, union ccb *ccb) cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; if ((ch->quirks & MVS_Q_SOC) == 0) { diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c index 2b709cd9693d..caf493a9bd08 100644 --- a/sys/dev/siis/siis.c +++ b/sys/dev/siis/siis.c @@ -1884,7 +1884,7 @@ siisaction(struct cam_sim *sim, union ccb *ccb) d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - cts->protocol = PROTO_ATA; + cts->protocol = PROTO_UNSPECIFIED; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -1960,7 +1960,7 @@ siisaction(struct cam_sim *sim, union ccb *ccb) cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_SATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; - cpi->protocol = PROTO_ATA; + cpi->protocol = PROTO_UNSPECIFIED; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; cpi->hba_vendor = pci_get_vendor(parent);