svn commit: r284586 - stable/10/sys/cam/ctl

Alexander Motin mav at FreeBSD.org
Fri Jun 19 00:53:16 UTC 2015


Author: mav
Date: Fri Jun 19 00:53:15 2015
New Revision: 284586
URL: https://svnweb.freebsd.org/changeset/base/284586

Log:
  MFC r284013: Allow setting only WWNN or only WWPN.

Modified:
  stable/10/sys/cam/ctl/scsi_ctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- stable/10/sys/cam/ctl/scsi_ctl.c	Fri Jun 19 00:10:30 2015	(r284585)
+++ stable/10/sys/cam/ctl/scsi_ctl.c	Fri Jun 19 00:53:15 2015	(r284586)
@@ -1657,16 +1657,24 @@ ctlfe_onoffline(void *arg, int online)
 			 * down to the SIM.  Otherwise, record what the SIM
 			 * has reported.
 			 */
-			if ((bus_softc->port.wwnn != 0)
-			 && (bus_softc->port.wwpn != 0)) {
+			if (bus_softc->port.wwnn != 0 && bus_softc->port.wwnn
+			    != ccb->knob.xport_specific.fc.wwnn) {
 				ccb->knob.xport_specific.fc.wwnn =
-					bus_softc->port.wwnn;
-				ccb->knob.xport_specific.fc.wwpn =
-					bus_softc->port.wwpn;
+				    bus_softc->port.wwnn;
 				set_wwnn = 1;
 			} else {
 				ctl_port_set_wwns(&bus_softc->port,
 				    true, ccb->knob.xport_specific.fc.wwnn,
+				    false, 0);
+			}
+			if (bus_softc->port.wwpn != 0 && bus_softc->port.wwpn
+			     != ccb->knob.xport_specific.fc.wwpn) {
+				ccb->knob.xport_specific.fc.wwpn =
+				    bus_softc->port.wwpn;
+				set_wwnn = 1;
+			} else {
+				ctl_port_set_wwns(&bus_softc->port,
+				    false, 0,
 				    true, ccb->knob.xport_specific.fc.wwpn);
 			}
 #endif /* RANDOM_WWNN */


More information about the svn-src-all mailing list