From e78ab20fc632d6215baf530ce75ea298ae95f4fe Mon Sep 17 00:00:00 2001 From: krw Date: Sat, 11 Jul 2020 21:35:55 +0000 Subject: Cache the adapter's port_wwn and node_wwn in mpi_softc, not the sc_link. Keeps all the sc_link initialization in one easy target, er, place. --- sys/dev/ic/mpi.c | 8 +++++--- sys/dev/ic/mpivar.h | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 8ee40108097..5cbb80bd304 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.215 2020/07/11 13:34:06 krw Exp $ */ +/* $OpenBSD: mpi.c,v 1.216 2020/07/11 21:35:55 krw Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne @@ -361,6 +361,8 @@ mpi_attach(struct mpi_softc *sc) sc->sc_link.adapter_buswidth = sc->sc_buswidth; sc->sc_link.openings = MAX(sc->sc_maxcmds / sc->sc_buswidth, 16); sc->sc_link.pool = &sc->sc_iopool; + sc->sc_link.port_wwn = sc->sc_port_wwn; + sc->sc_link.node_wwn = sc->sc_node_wwn; saa.saa_sc_link = &sc->sc_link; @@ -872,8 +874,8 @@ mpi_cfg_fc(struct mpi_softc *sc) return (1); } - sc->sc_link.port_wwn = letoh64(pg0.wwpn); - sc->sc_link.node_wwn = letoh64(pg0.wwnn); + sc->sc_port_wwn = letoh64(pg0.wwpn); + sc->sc_node_wwn = letoh64(pg0.wwnn); /* configure port config more to our liking */ if (mpi_cfg_header(sc, MPI_CONFIG_REQ_PAGE_TYPE_FC_PORT, 1, 0, diff --git a/sys/dev/ic/mpivar.h b/sys/dev/ic/mpivar.h index e4339589c09..644b11e2035 100644 --- a/sys/dev/ic/mpivar.h +++ b/sys/dev/ic/mpivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpivar.h,v 1.39 2014/09/03 00:46:04 dlg Exp $ */ +/* $OpenBSD: mpivar.h,v 1.40 2020/07/11 21:35:55 krw Exp $ */ /* * Copyright (c) 2005 David Gwynne @@ -105,6 +105,9 @@ struct mpi_softc { struct device sc_dev; struct scsi_link sc_link; + u_int64_t sc_port_wwn; + u_int64_t sc_node_wwn; + int sc_flags; #define MPI_F_SPI (1<<0) #define MPI_F_RAID (1<<1) -- cgit v1.2.3-59-g8ed1b