From 95f7dfb2fad53e7e1ee894c9aff7b283e1c5dad4 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Mon, 7 Jun 2010 17:39:36 +0000 Subject: Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that it will figure out the correct target to handle index and be able to find things like WWPN, etc. MFC after: 2 weeks --- sys/dev/isp/isp_freebsd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev/isp') diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index 597c5c7f43a2..1e34cfbe0165 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -4506,6 +4506,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb) fcparam *fcp = FCPARAM(isp, bus); struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_fc *fc = &cts->xport_specific.fc; + unsigned int hdlidx; cts->protocol = PROTO_SCSI; cts->protocol_version = SCSI_REV_2; @@ -4517,8 +4518,9 @@ isp_action(struct cam_sim *sim, union ccb *ccb) fc->valid = CTS_FC_VALID_SPEED; fc->bitrate = 100000; fc->bitrate *= fcp->isp_gbspeed; - if (tgt > 0 && tgt < MAX_FC_TARG) { - fcportdb_t *lp = &fcp->portdb[tgt]; + hdlidx = fcp->isp_dev_map[tgt] - 1; + if (hdlidx < MAX_FC_TARG) { + fcportdb_t *lp = &fcp->portdb[hdlidx]; fc->wwnn = lp->node_wwn; fc->wwpn = lp->port_wwn; fc->port = lp->portid; -- cgit v1.3