From owner-svn-src-all@FreeBSD.ORG Mon Jun 7 17:39:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 189F31065672; Mon, 7 Jun 2010 17:39:37 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 068388FC12; Mon, 7 Jun 2010 17:39:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57Hda7v046668; Mon, 7 Jun 2010 17:39:36 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57HdaHd046667; Mon, 7 Jun 2010 17:39:36 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006071739.o57HdaHd046667@svn.freebsd.org> From: Matt Jacob Date: Mon, 7 Jun 2010 17:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208895 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 17:39:37 -0000 Author: mjacob Date: Mon Jun 7 17:39:36 2010 New Revision: 208895 URL: http://svn.freebsd.org/changeset/base/208895 Log: 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 Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Jun 7 16:32:12 2010 (r208894) +++ head/sys/dev/isp/isp_freebsd.c Mon Jun 7 17:39:36 2010 (r208895) @@ -4506,6 +4506,7 @@ isp_action(struct cam_sim *sim, union cc 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 cc 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;