diff options
author | mav <mav@FreeBSD.org> | 2012-06-06 06:52:51 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2012-06-06 06:52:51 +0000 |
commit | ee6412e858b4f4494d4ed0593871b67016382659 (patch) | |
tree | 4a291a92409c3b2f5d1945f6fcc0dde4efa2df88 /sys/cam | |
parent | 691dfc2d38f86af8b930db40efa6e0ec1a6e455d (diff) | |
download | FreeBSD-src-ee6412e858b4f4494d4ed0593871b67016382659.zip FreeBSD-src-ee6412e858b4f4494d4ed0593871b67016382659.tar.gz |
ATA/SATA controllers have no idea about protocol of the connected device
until transport will do some probe actions (at least soft reset).
Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol.
Make ATA/SATA transport to fill that gap by reporting protocol to SIM with
XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed.
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/ata/ata_xpt.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index d7fe3d7..fef85b8 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -942,9 +942,9 @@ noerror: 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 @@ notsata: 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 @@ notsata: 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 |