diff options
Diffstat (limited to 'sys/cam/ctl/ctl_frontend.c')
-rw-r--r-- | sys/cam/ctl/ctl_frontend.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/cam/ctl/ctl_frontend.c b/sys/cam/ctl/ctl_frontend.c index c38e527..e22b9d4 100644 --- a/sys/cam/ctl/ctl_frontend.c +++ b/sys/cam/ctl/ctl_frontend.c @@ -301,6 +301,20 @@ ctl_port_set_wwns(struct ctl_port *port, int wwnn_valid, uint64_t wwnn, void ctl_port_online(struct ctl_port *port) { + struct ctl_softc *softc = control_softc; + struct ctl_lun *lun; + uint32_t l; + + if (port->lun_map) { + for (l = 0; l < CTL_MAX_LUNS; l++) { + if (ctl_lun_map_from_port(port, l) >= CTL_MAX_LUNS) + continue; + port->lun_enable(port->targ_lun_arg, l); + } + } else { + STAILQ_FOREACH(lun, &softc->lun_list, links) + port->lun_enable(port->targ_lun_arg, lun->lun); + } port->port_online(port->onoff_arg); /* XXX KDM need a lock here? */ port->status |= CTL_PORT_STATUS_ONLINE; @@ -309,7 +323,21 @@ ctl_port_online(struct ctl_port *port) void ctl_port_offline(struct ctl_port *port) { + struct ctl_softc *softc = control_softc; + struct ctl_lun *lun; + uint32_t l; + port->port_offline(port->onoff_arg); + if (port->lun_map) { + for (l = 0; l < CTL_MAX_LUNS; l++) { + if (ctl_lun_map_from_port(port, l) >= CTL_MAX_LUNS) + continue; + port->lun_disable(port->targ_lun_arg, l); + } + } else { + STAILQ_FOREACH(lun, &softc->lun_list, links) + port->lun_disable(port->targ_lun_arg, lun->lun); + } /* XXX KDM need a lock here? */ port->status &= ~CTL_PORT_STATUS_ONLINE; } |