Make firmware handle virtual ports SNS logins for us.

This commit is contained in:
Alexander Motin 2015-11-17 14:13:55 +00:00
parent 676420e8b1
commit 53c0eee354
2 changed files with 8 additions and 15 deletions

View File

@ -2187,7 +2187,7 @@ isp_fibre_init_2400(ispsoftc_t *isp)
size_t amt = 0; size_t amt = 0;
uint8_t *off; uint8_t *off;
vpinfo.vp_global_options = 0; vpinfo.vp_global_options = ICB2400_VPGOPT_GEN_RIDA;
if (ISP_CAP_VP0(isp)) { if (ISP_CAP_VP0(isp)) {
vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE; vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE;
vpinfo.vp_count = isp->isp_nchan; vpinfo.vp_count = isp->isp_nchan;
@ -2207,7 +2207,8 @@ isp_fibre_init_2400(ispsoftc_t *isp)
ISP_MEMZERO(&pi, sizeof (pi)); ISP_MEMZERO(&pi, sizeof (pi));
fcp2 = FCPARAM(isp, chan); fcp2 = FCPARAM(isp, chan);
if (fcp2->role != ISP_ROLE_NONE) { if (fcp2->role != ISP_ROLE_NONE) {
pi.vp_port_options = ICB2400_VPOPT_ENABLED; pi.vp_port_options = ICB2400_VPOPT_ENABLED |
ICB2400_VPOPT_ENA_SNSLOGIN;
if (fcp2->role & ISP_ROLE_INITIATOR) if (fcp2->role & ISP_ROLE_INITIATOR)
pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE; pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE;
if ((fcp2->role & ISP_ROLE_TARGET) == 0) if ((fcp2->role & ISP_ROLE_TARGET) == 0)
@ -2914,16 +2915,7 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
} else { } else {
fcp->isp_fabric_params = 0; fcp->isp_fabric_params = 0;
} }
if (chan) { fcp->isp_sns_hdl = NPH_SNS_ID;
fcp->isp_sns_hdl = NPH_RESERVED - chan;
r = isp_plogx(isp, chan, fcp->isp_sns_hdl, SNS_PORT_ID, PLOGX_FLG_CMD_PLOGI | PLOGX_FLG_COND_PLOGI | PLOGX_FLG_SKIP_PRLI, 0);
if (r) {
isp_prt(isp, ISP_LOGWARN, "%s: Chan %d cannot log into SNS", __func__, chan);
return (-1);
}
} else {
fcp->isp_sns_hdl = NPH_SNS_ID;
}
r = isp_register_fc4_type_24xx(isp, chan); r = isp_register_fc4_type_24xx(isp, chan);
} else { } else {
fcp->isp_sns_hdl = SNS_ID; fcp->isp_sns_hdl = SNS_ID;
@ -3167,7 +3159,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
* Don't scan "special" ids. * Don't scan "special" ids.
*/ */
if (ISP_CAP_2KLOGIN(isp)) { if (ISP_CAP_2KLOGIN(isp)) {
if (handle >= NPH_RESERVED - isp->isp_nchan) if (handle >= NPH_RESERVED)
continue; continue;
} else { } else {
if (handle >= FL_ID && handle <= SNS_ID) if (handle >= FL_ID && handle <= SNS_ID)
@ -4276,7 +4268,7 @@ isp_next_handle(ispsoftc_t *isp, uint16_t *ohp)
handle = *ohp; handle = *ohp;
if (ISP_CAP_2KLOGIN(isp)) { if (ISP_CAP_2KLOGIN(isp)) {
minh = 0; minh = 0;
maxh = NPH_RESERVED - isp->isp_nchan; /* Reserve for SNS */ maxh = NPH_RESERVED;
} else { } else {
minh = SNS_ID + 1; minh = SNS_ID + 1;
maxh = NPH_MAX - 1; maxh = NPH_MAX - 1;

View File

@ -604,7 +604,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan)
vp->vp_mod_cnt = 1; vp->vp_mod_cnt = 1;
vp->vp_mod_idx0 = chan; vp->vp_mod_idx0 = chan;
vp->vp_mod_cmd = VP_MODIFY_ENA; vp->vp_mod_cmd = VP_MODIFY_ENA;
vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED; vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED |
ICB2400_VPOPT_ENA_SNSLOGIN;
if (fcp->role & ISP_ROLE_INITIATOR) { if (fcp->role & ISP_ROLE_INITIATOR) {
vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE;
} }