diff options
author | mjacob <mjacob@FreeBSD.org> | 2006-10-31 05:53:29 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2006-10-31 05:53:29 +0000 |
commit | 7e1db24f987a0a59d6a2ddc84ab0ef69d9d0370e (patch) | |
tree | 8b3b2da053646664eaa8096add01ca22cc513072 /sys/dev/ata | |
parent | 21803ea6f1397d03bf63a4e7bf9f4aac1f9f505d (diff) | |
download | FreeBSD-src-7e1db24f987a0a59d6a2ddc84ab0ef69d9d0370e.zip FreeBSD-src-7e1db24f987a0a59d6a2ddc84ab0ef69d9d0370e.tar.gz |
The first of 3 major steps to move the CAM layer forward to using
the CAM_NEW_TRAN_CODE that has been in the tree for some years now.
This first step consists solely of adding to or correcting
CAM_NEW_TRAN_CODE pieces in the kernel source tree such
that a both a GENERIC (at least on i386) and a LINT build
with CAM_NEW_TRAN_CODE as an option will compile correctly
and run (at least with some the h/w I have).
After a short settle time, the other pieces (making
CAM_NEW_TRAN_CODE the default and updating libcam
and camcontrol) will be brought in.
This will be an incompatible change in that the size of structures
related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change
in both size and content. However, basic system operation and
basic system utilities work well enough with this change.
Reviewed by: freebsd-scsi and specific stakeholders
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/atapi-cam.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sys/dev/ata/atapi-cam.c b/sys/dev/ata/atapi-cam.c index 8a24638..e9ef578 100644 --- a/sys/dev/ata/atapi-cam.c +++ b/sys/dev/ata/atapi-cam.c @@ -363,6 +363,12 @@ atapi_action(struct cam_sim *sim, union ccb *ccb) cpi->unit_number = cam_sim_unit(sim); cpi->bus_id = cam_sim_bus(sim); cpi->base_transfer_speed = 3300; +#ifdef CAM_NEW_TRAN_CODE + cpi->transport = XPORT_ATA; + cpi->transport_version = 2; + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_2; +#endif if (softc->ata_ch && tid != CAM_TARGET_WILDCARD) { mtx_lock(&softc->state_lock); @@ -436,16 +442,25 @@ atapi_action(struct cam_sim *sim, union ccb *ccb) case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; - +#ifdef CAM_NEW_TRAN_CODE + cts->protocol = PROTO_SCSI; + cts->protocol_version = SCSI_REV_2; + cts->transport = XPORT_ATA; + cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->proto_specific.valid = 0; + cts->xport_specific.valid = 0; + /* nothing more to do */ +#else /* - * XXX The default CAM transport code is very SCSI-specific and + * The default CAM transport code is very SCSI-specific and * doesn't understand IDE speeds very well. Be silent about it * here and let it default to what is set in XPT_PATH_INQ */ - CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_SUBTRACE, ("GET_TRAN_SETTINGS\n")); cts->valid = (CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID); cts->flags &= ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); +#endif ccb->ccb_h.status = CAM_REQ_CMP; + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_SUBTRACE, ("GET_TRAN_SETTINGS\n")); xpt_done(ccb); return; } |