mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
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.
This commit is contained in:
parent
73a4b7a9d8
commit
bc1bf6e842
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236666
@ -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
|
||||
|
@ -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). */
|
||||
|
@ -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)) ==
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user