From owner-freebsd-scsi Fri Mar 30 11:27: 1 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 1855637B719 for ; Fri, 30 Mar 2001 11:26:57 -0800 (PST) (envelope-from mjacob@feral.com) Received: from zeppo.feral.com (IDENT:mjacob@zeppo [192.67.166.71]) by feral.com (8.9.3/8.9.3) with ESMTP id LAA18974 for ; Fri, 30 Mar 2001 11:27:02 -0800 Date: Fri, 30 Mar 2001 11:26:56 -0800 (PST) From: Matthew Jacob Reply-To: mjacob@feral.com To: scsi@FreeBSD.ORG Subject: take 2:beginning of changes to CAM_NEW_TRAN_CODE for XPORT_FC In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Fri, 30 Mar 2001, Matthew Jacob wrote: > > Just a start at getting XPORT_FC up and going.... I want to start embedding > WWPN/WWNNs in the path inquiry code and get them up to be visible to scsi_da > because I want scsi_da to do a make_dev_alias using the WWPN. > > -matt > Index: cam_ccb.h =================================================================== RCS file: /home/ncvs/src/sys/cam/cam_ccb.h,v retrieving revision 1.20 diff -u -r1.20 cam_ccb.h --- cam_ccb.h 2001/03/27 05:45:09 1.20 +++ cam_ccb.h 2001/03/30 19:25:12 @@ -521,6 +521,13 @@ struct ccb_pathinq_settings_spi { u_int8_t ppr_options; }; +struct ccb_pathinq_settings_fc { + u_int64_t wwnn; /* world wide node name */ + u_int64_t wwpn; /* world wide port name */ + u_int32_t port; /* 24 port id, if known */ + u_int32_t bitrate; /* Mbps */ +}; +#define PATHINQ_SETTINGS_SIZE 128 #endif /* CAM_NEW_TRAN_CODE */ struct ccb_pathinq { @@ -550,6 +557,8 @@ u_int transport_version; union { struct ccb_pathinq_settings_spi spi; + struct ccb_pathinq_settings_fc fc; + char ccb_pathinq_settings_opaque[PATHINQ_SETTINGS_SIZE]; } xport_specific; #endif /* CAM_NEW_TRAN_CODE */ }; Index: cam_xpt.c =================================================================== RCS file: /home/ncvs/src/sys/cam/cam_xpt.c,v retrieving revision 1.110 diff -u -r1.110 cam_xpt.c --- cam_xpt.c 2001/03/27 05:45:09 1.110 +++ cam_xpt.c 2001/03/30 19:25:15 @@ -1535,6 +1535,14 @@ if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) speed *= (0x01 << spi->bus_width); } + if (cts.ccb_h.status == CAM_REQ_CMP + && cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc; + + fc = &cts.xport_specific.fc; + speed = fc->bitrate; + } + mb = speed / 1000; if (mb > 0) @@ -1568,6 +1576,18 @@ } else if (freq != 0) { printf(")"); } + } + if (cts.ccb_h.status == CAM_REQ_CMP + && cts.transport == XPORT_FC) { + struct ccb_trans_settings_fc *fc; + + fc = &cts.xport_specific.fc; + if (fc->wwnn) + printf(" WWNN %q", (quad_t) fc->wwnn); + if (fc->wwpn) + printf(" WWPN %q", (quad_t) fc->wwpn); + if (fc->port) + printf(" PortID %u", fc->port); } if (path->device->inq_flags & SID_CmdQue To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message