Author: mav
Date: Tue Nov 17 14:13:55 2015
New Revision: 290980
URL: https://svnweb.freebsd.org/changeset/base/290980

Log:
  Make firmware handle virtual ports SNS logins for us.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_library.c

Modified: head/sys/dev/isp/isp.c
==============================================================================
--- head/sys/dev/isp/isp.c      Tue Nov 17 13:09:51 2015        (r290979)
+++ head/sys/dev/isp/isp.c      Tue Nov 17 14:13:55 2015        (r290980)
@@ -2187,7 +2187,7 @@ isp_fibre_init_2400(ispsoftc_t *isp)
                size_t amt = 0;
                uint8_t *off;
 
-               vpinfo.vp_global_options = 0;
+               vpinfo.vp_global_options = ICB2400_VPGOPT_GEN_RIDA;
                if (ISP_CAP_VP0(isp)) {
                        vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE;
                        vpinfo.vp_count = isp->isp_nchan;
@@ -2207,7 +2207,8 @@ isp_fibre_init_2400(ispsoftc_t *isp)
                        ISP_MEMZERO(&pi, sizeof (pi));
                        fcp2 = FCPARAM(isp, chan);
                        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)
                                        pi.vp_port_options |= 
ICB2400_VPOPT_INI_ENABLE;
                                if ((fcp2->role & ISP_ROLE_TARGET) == 0)
@@ -2914,16 +2915,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha
                        } else {
                                fcp->isp_fabric_params = 0;
                        }
-                       if (chan) {
-                               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;
-                       }
+                       fcp->isp_sns_hdl = NPH_SNS_ID;
                        r = isp_register_fc4_type_24xx(isp, chan);
                } else {
                        fcp->isp_sns_hdl = SNS_ID;
@@ -3167,7 +3159,7 @@ fail:
                 * Don't scan "special" ids.
                 */
                if (ISP_CAP_2KLOGIN(isp)) {
-                       if (handle >= NPH_RESERVED - isp->isp_nchan)
+                       if (handle >= NPH_RESERVED)
                                continue;
                } else {
                        if (handle >= FL_ID && handle <= SNS_ID)
@@ -4276,7 +4268,7 @@ isp_next_handle(ispsoftc_t *isp, uint16_
        handle = *ohp;
        if (ISP_CAP_2KLOGIN(isp)) {
                minh = 0;
-               maxh = NPH_RESERVED - isp->isp_nchan; /* Reserve for SNS */
+               maxh = NPH_RESERVED;
        } else {
                minh = SNS_ID + 1;
                maxh = NPH_MAX - 1;

Modified: head/sys/dev/isp/isp_library.c
==============================================================================
--- head/sys/dev/isp/isp_library.c      Tue Nov 17 13:09:51 2015        
(r290979)
+++ head/sys/dev/isp/isp_library.c      Tue Nov 17 14:13:55 2015        
(r290980)
@@ -604,7 +604,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch
        vp->vp_mod_cnt = 1;
        vp->vp_mod_idx0 = chan;
        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) {
                vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to