[SCSI] bfa: Changes to support FDMI Driver Parameter
authorKrishna Gudipati <kgudipat@brocade.com>
Thu, 4 Mar 2010 01:43:19 +0000 (17:43 -0800)
committerJames Bottomley <James.Bottomley@suse.de>
Thu, 4 Mar 2010 10:43:40 +0000 (16:13 +0530)
 Added a FCS function to be called during driver init, to set the FDMI
 Driver parameter.

fdmi.c: Created a disabled state when fdmi is disabled.

bfad.c:
  * Added fdmi_enable driver parameter.
  * Added support to call bfa_fcs_set_fdmi_param() to initialize fcs
    fdmi setting.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/bfa/bfa_fcs.c
drivers/scsi/bfa/bfad.c
drivers/scsi/bfa/fdmi.c
drivers/scsi/bfa/include/fcs/bfa_fcs.h

index 7cb39a306ea98bf38bc3d18a44a0ac55537f42d4..50120c285fff2f78df280a0dd80e18edf703bc57 100644 (file)
@@ -126,6 +126,23 @@ bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
        bfa_fcs_fabric_psymb_init(&fcs->fabric);
 }
 
+/**
+ *      @brief
+ *              FCS FDMI Driver Parameter Initialization
+ *
+ *      @param[in]              fcs             FCS instance
+ *      @param[in]              fdmi_enable     TRUE/FALSE
+ *
+ *      @return None
+ */
+void
+bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable)
+{
+
+       fcs->fdmi_enabled = fdmi_enable;
+
+}
+
 /**
  *             FCS instance cleanup and exit.
  *
index b52b773d49d9de6f64439899310cd16211a3b4d9..8e2b2a26cb74ece1cb91256e8b5bc6ad21446be1 100644 (file)
@@ -53,6 +53,7 @@ static int      log_level = BFA_LOG_WARNING;
 static int      ioc_auto_recover = BFA_TRUE;
 static int      ipfc_enable = BFA_FALSE;
 static int      ipfc_mtu = -1;
+static int     fdmi_enable = BFA_TRUE;
 int            bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH;
 int            bfa_linkup_delay = -1;
 
@@ -74,6 +75,7 @@ module_param(log_level, int, S_IRUGO | S_IWUSR);
 module_param(ioc_auto_recover, int, S_IRUGO | S_IWUSR);
 module_param(ipfc_enable, int, S_IRUGO | S_IWUSR);
 module_param(ipfc_mtu, int, S_IRUGO | S_IWUSR);
+module_param(fdmi_enable, int, S_IRUGO | S_IWUSR);
 module_param(bfa_linkup_delay, int, S_IRUGO | S_IWUSR);
 
 /*
@@ -748,6 +750,7 @@ bfad_drv_init(struct bfad_s *bfad)
        bfa_fcs_aen_init(&bfad->bfa_fcs, bfad->aen);
        bfa_fcs_init(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE);
        bfa_fcs_driver_info_init(&bfad->bfa_fcs, &driver_info);
+       bfa_fcs_set_fdmi_param(&bfad->bfa_fcs, fdmi_enable);
        spin_unlock_irqrestore(&bfad->bfad_lock, flags);
 
        bfad->bfad_flags |= BFAD_DRV_INIT_DONE;
index df2a1e54e16bb3e2d28aff9826258a957951bc22..d76d9220b6e678d6fe29a72e61435d8c79e5360e 100644 (file)
@@ -116,6 +116,9 @@ static void     bfa_fcs_port_fdmi_sm_rpa_retry(struct bfa_fcs_port_fdmi_s *fdmi,
                        enum port_fdmi_event event);
 static void     bfa_fcs_port_fdmi_sm_online(struct bfa_fcs_port_fdmi_s *fdmi,
                        enum port_fdmi_event event);
+static void    bfa_fcs_port_fdmi_sm_disabled(struct bfa_fcs_port_fdmi_s *fdmi,
+                       enum port_fdmi_event event);
+
 /**
  *             Start in offline state - awaiting MS to send start.
  */
@@ -479,6 +482,20 @@ bfa_fcs_port_fdmi_sm_online(struct bfa_fcs_port_fdmi_s *fdmi,
        }
 }
 
+/**
+ *  FDMI is disabled state.
+ */
+static void
+bfa_fcs_port_fdmi_sm_disabled(struct bfa_fcs_port_fdmi_s *fdmi,
+                               enum port_fdmi_event event)
+{
+       struct bfa_fcs_port_s *port = fdmi->ms->port;
+
+       bfa_trc(port->fcs, port->port_cfg.pwwn);
+       bfa_trc(port->fcs, event);
+
+       /* No op State. It can only be enabled at Driver Init. */
+}
 
 /**
 *   RHBA : Register HBA Attributes.
@@ -1201,7 +1218,10 @@ bfa_fcs_port_fdmi_init(struct bfa_fcs_port_ms_s *ms)
        struct bfa_fcs_port_fdmi_s *fdmi = &ms->fdmi;
 
        fdmi->ms = ms;
-       bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_offline);
+       if (ms->port->fcs->fdmi_enabled)
+               bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_offline);
+       else
+               bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_disabled);
 }
 
 void
index 627669c65546deebebe77ba2a71acae083d26cf3..0396ec460532e18d37229bd1c4995a04dac82e8a 100644 (file)
@@ -49,6 +49,7 @@ struct bfa_fcs_s {
        struct bfa_trc_mod_s  *trcmod;  /*  tracing module */
        struct bfa_aen_s      *aen;     /*  aen component */
        bfa_boolean_t   vf_enabled;     /*  VF mode is enabled */
+       bfa_boolean_t   fdmi_enabled;   /*!< FDMI is enabled */
        bfa_boolean_t min_cfg;          /* min cfg enabled/disabled */
        u16        port_vfid;   /*  port default VF ID */
        struct bfa_fcs_driver_info_s driver_info;
@@ -64,6 +65,7 @@ void bfa_fcs_init(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
                        bfa_boolean_t min_cfg);
 void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
                        struct bfa_fcs_driver_info_s *driver_info);
+void bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable);
 void bfa_fcs_exit(struct bfa_fcs_s *fcs);
 void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod);
 void bfa_fcs_log_init(struct bfa_fcs_s *fcs, struct bfa_log_mod_s *logmod);