aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/twa
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>2006-10-31 05:53:29 +0000
committerMatt Jacob <mjacob@FreeBSD.org>2006-10-31 05:53:29 +0000
commitfa9ed865067ef325f013a8174c94eff345a4f4ed (patch)
tree8b3b2da053646664eaa8096add01ca22cc513072 /sys/dev/twa
parent9df92bda761535b468b198dc0bc23dc059051e8a (diff)
downloadsrc-fa9ed865067ef325f013a8174c94eff345a4f4ed.tar.gz
src-fa9ed865067ef325f013a8174c94eff345a4f4ed.zip
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
Notes
Notes: svn path=/head/; revision=163816
Diffstat (limited to 'sys/dev/twa')
-rw-r--r--sys/dev/twa/tw_osl_cam.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/sys/dev/twa/tw_osl_cam.c b/sys/dev/twa/tw_osl_cam.c
index 457b539114e7..1dfa60f90d4b 100644
--- a/sys/dev/twa/tw_osl_cam.c
+++ b/sys/dev/twa/tw_osl_cam.c
@@ -420,10 +420,26 @@ twa_action(struct cam_sim *sim, union ccb *ccb)
case XPT_GET_TRAN_SETTINGS:
{
struct ccb_trans_settings *cts = &ccb->cts;
-
- tw_osli_dbg_dprintf(3, sc, "XPT_GET_TRAN_SETTINGS");
+#ifdef CAM_NEW_TRAN_CODE
+ struct ccb_trans_settings_scsi *scsi =
+ &cts->proto_specific.scsi;
+ struct ccb_trans_settings_spi *spi =
+ &cts->xport_specific.spi;
+
+ cts->protocol = PROTO_SCSI;
+ cts->protocol_version = SCSI_REV_2;
+ cts->transport = XPORT_SPI;
+ cts->transport_version = 2;
+
+ spi->valid = CTS_SPI_VALID_DISC;
+ spi->flags = CTS_SPI_FLAGS_DISC_ENB;
+ scsi->valid = CTS_SCSI_VALID_TQ;
+ scsi->flags = CTS_SCSI_FLAGS_TAG_ENB;
+#else
cts->valid = (CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID);
cts->flags &= ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB);
+#endif
+ tw_osli_dbg_dprintf(3, sc, "XPT_GET_TRAN_SETTINGS");
ccb_h->status = CAM_REQ_CMP;
xpt_done(ccb);
break;
@@ -455,6 +471,12 @@ twa_action(struct cam_sim *sim, union ccb *ccb)
strncpy(path_inq->sim_vid, "FreeBSD", SIM_IDLEN);
strncpy(path_inq->hba_vid, "3ware", HBA_IDLEN);
strncpy(path_inq->dev_name, cam_sim_name(sim), DEV_IDLEN);
+#ifdef CAM_NEW_TRAN_CODE
+ path_inq->transport = XPORT_SPI;
+ path_inq->transport_version = 2;
+ path_inq->protocol = PROTO_SCSI;
+ path_inq->protocol_version = SCSI_REV_2;
+#endif
ccb_h->status = CAM_REQ_CMP;
xpt_done(ccb);
break;