diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2010-03-03 20:43:19 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-03-04 05:43:40 -0500 |
commit | 5b098082e22c168b7df4c5c3cd924047cee7d995 (patch) | |
tree | f4d40a769b8793382f7e11c1439f1bccb29729d8 /drivers/scsi/bfa | |
parent | ab5336189a12b6561a1b5708d782a4e27e2e3b79 (diff) |
[SCSI] bfa: Changes to support FDMI Driver Parameter
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>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs.c | 17 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad.c | 3 | ||||
-rw-r--r-- | drivers/scsi/bfa/fdmi.c | 22 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/fcs/bfa_fcs.h | 2 |
4 files changed, 43 insertions, 1 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c index 7cb39a306ea9..50120c285fff 100644 --- a/drivers/scsi/bfa/bfa_fcs.c +++ b/drivers/scsi/bfa/bfa_fcs.c | |||
@@ -127,6 +127,23 @@ bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, | |||
127 | } | 127 | } |
128 | 128 | ||
129 | /** | 129 | /** |
130 | * @brief | ||
131 | * FCS FDMI Driver Parameter Initialization | ||
132 | * | ||
133 | * @param[in] fcs FCS instance | ||
134 | * @param[in] fdmi_enable TRUE/FALSE | ||
135 | * | ||
136 | * @return None | ||
137 | */ | ||
138 | void | ||
139 | bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable) | ||
140 | { | ||
141 | |||
142 | fcs->fdmi_enabled = fdmi_enable; | ||
143 | |||
144 | } | ||
145 | |||
146 | /** | ||
130 | * FCS instance cleanup and exit. | 147 | * FCS instance cleanup and exit. |
131 | * | 148 | * |
132 | * param[in] fcs FCS instance | 149 | * param[in] fcs FCS instance |
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index b52b773d49d9..8e2b2a26cb74 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c | |||
@@ -53,6 +53,7 @@ static int log_level = BFA_LOG_WARNING; | |||
53 | static int ioc_auto_recover = BFA_TRUE; | 53 | static int ioc_auto_recover = BFA_TRUE; |
54 | static int ipfc_enable = BFA_FALSE; | 54 | static int ipfc_enable = BFA_FALSE; |
55 | static int ipfc_mtu = -1; | 55 | static int ipfc_mtu = -1; |
56 | static int fdmi_enable = BFA_TRUE; | ||
56 | int bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH; | 57 | int bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH; |
57 | int bfa_linkup_delay = -1; | 58 | int bfa_linkup_delay = -1; |
58 | 59 | ||
@@ -74,6 +75,7 @@ module_param(log_level, int, S_IRUGO | S_IWUSR); | |||
74 | module_param(ioc_auto_recover, int, S_IRUGO | S_IWUSR); | 75 | module_param(ioc_auto_recover, int, S_IRUGO | S_IWUSR); |
75 | module_param(ipfc_enable, int, S_IRUGO | S_IWUSR); | 76 | module_param(ipfc_enable, int, S_IRUGO | S_IWUSR); |
76 | module_param(ipfc_mtu, int, S_IRUGO | S_IWUSR); | 77 | module_param(ipfc_mtu, int, S_IRUGO | S_IWUSR); |
78 | module_param(fdmi_enable, int, S_IRUGO | S_IWUSR); | ||
77 | module_param(bfa_linkup_delay, int, S_IRUGO | S_IWUSR); | 79 | module_param(bfa_linkup_delay, int, S_IRUGO | S_IWUSR); |
78 | 80 | ||
79 | /* | 81 | /* |
@@ -748,6 +750,7 @@ bfad_drv_init(struct bfad_s *bfad) | |||
748 | bfa_fcs_aen_init(&bfad->bfa_fcs, bfad->aen); | 750 | bfa_fcs_aen_init(&bfad->bfa_fcs, bfad->aen); |
749 | bfa_fcs_init(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE); | 751 | bfa_fcs_init(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE); |
750 | bfa_fcs_driver_info_init(&bfad->bfa_fcs, &driver_info); | 752 | bfa_fcs_driver_info_init(&bfad->bfa_fcs, &driver_info); |
753 | bfa_fcs_set_fdmi_param(&bfad->bfa_fcs, fdmi_enable); | ||
751 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 754 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
752 | 755 | ||
753 | bfad->bfad_flags |= BFAD_DRV_INIT_DONE; | 756 | bfad->bfad_flags |= BFAD_DRV_INIT_DONE; |
diff --git a/drivers/scsi/bfa/fdmi.c b/drivers/scsi/bfa/fdmi.c index df2a1e54e16b..d76d9220b6e6 100644 --- a/drivers/scsi/bfa/fdmi.c +++ b/drivers/scsi/bfa/fdmi.c | |||
@@ -116,6 +116,9 @@ static void bfa_fcs_port_fdmi_sm_rpa_retry(struct bfa_fcs_port_fdmi_s *fdmi, | |||
116 | enum port_fdmi_event event); | 116 | enum port_fdmi_event event); |
117 | static void bfa_fcs_port_fdmi_sm_online(struct bfa_fcs_port_fdmi_s *fdmi, | 117 | static void bfa_fcs_port_fdmi_sm_online(struct bfa_fcs_port_fdmi_s *fdmi, |
118 | enum port_fdmi_event event); | 118 | enum port_fdmi_event event); |
119 | static void bfa_fcs_port_fdmi_sm_disabled(struct bfa_fcs_port_fdmi_s *fdmi, | ||
120 | enum port_fdmi_event event); | ||
121 | |||
119 | /** | 122 | /** |
120 | * Start in offline state - awaiting MS to send start. | 123 | * Start in offline state - awaiting MS to send start. |
121 | */ | 124 | */ |
@@ -479,6 +482,20 @@ bfa_fcs_port_fdmi_sm_online(struct bfa_fcs_port_fdmi_s *fdmi, | |||
479 | } | 482 | } |
480 | } | 483 | } |
481 | 484 | ||
485 | /** | ||
486 | * FDMI is disabled state. | ||
487 | */ | ||
488 | static void | ||
489 | bfa_fcs_port_fdmi_sm_disabled(struct bfa_fcs_port_fdmi_s *fdmi, | ||
490 | enum port_fdmi_event event) | ||
491 | { | ||
492 | struct bfa_fcs_port_s *port = fdmi->ms->port; | ||
493 | |||
494 | bfa_trc(port->fcs, port->port_cfg.pwwn); | ||
495 | bfa_trc(port->fcs, event); | ||
496 | |||
497 | /* No op State. It can only be enabled at Driver Init. */ | ||
498 | } | ||
482 | 499 | ||
483 | /** | 500 | /** |
484 | * RHBA : Register HBA Attributes. | 501 | * RHBA : Register HBA Attributes. |
@@ -1201,7 +1218,10 @@ bfa_fcs_port_fdmi_init(struct bfa_fcs_port_ms_s *ms) | |||
1201 | struct bfa_fcs_port_fdmi_s *fdmi = &ms->fdmi; | 1218 | struct bfa_fcs_port_fdmi_s *fdmi = &ms->fdmi; |
1202 | 1219 | ||
1203 | fdmi->ms = ms; | 1220 | fdmi->ms = ms; |
1204 | bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_offline); | 1221 | if (ms->port->fcs->fdmi_enabled) |
1222 | bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_offline); | ||
1223 | else | ||
1224 | bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_disabled); | ||
1205 | } | 1225 | } |
1206 | 1226 | ||
1207 | void | 1227 | void |
diff --git a/drivers/scsi/bfa/include/fcs/bfa_fcs.h b/drivers/scsi/bfa/include/fcs/bfa_fcs.h index 627669c65546..0396ec460532 100644 --- a/drivers/scsi/bfa/include/fcs/bfa_fcs.h +++ b/drivers/scsi/bfa/include/fcs/bfa_fcs.h | |||
@@ -49,6 +49,7 @@ struct bfa_fcs_s { | |||
49 | struct bfa_trc_mod_s *trcmod; /* tracing module */ | 49 | struct bfa_trc_mod_s *trcmod; /* tracing module */ |
50 | struct bfa_aen_s *aen; /* aen component */ | 50 | struct bfa_aen_s *aen; /* aen component */ |
51 | bfa_boolean_t vf_enabled; /* VF mode is enabled */ | 51 | bfa_boolean_t vf_enabled; /* VF mode is enabled */ |
52 | bfa_boolean_t fdmi_enabled; /*!< FDMI is enabled */ | ||
52 | bfa_boolean_t min_cfg; /* min cfg enabled/disabled */ | 53 | bfa_boolean_t min_cfg; /* min cfg enabled/disabled */ |
53 | u16 port_vfid; /* port default VF ID */ | 54 | u16 port_vfid; /* port default VF ID */ |
54 | struct bfa_fcs_driver_info_s driver_info; | 55 | 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, | |||
64 | bfa_boolean_t min_cfg); | 65 | bfa_boolean_t min_cfg); |
65 | void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, | 66 | void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, |
66 | struct bfa_fcs_driver_info_s *driver_info); | 67 | struct bfa_fcs_driver_info_s *driver_info); |
68 | void bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable); | ||
67 | void bfa_fcs_exit(struct bfa_fcs_s *fcs); | 69 | void bfa_fcs_exit(struct bfa_fcs_s *fcs); |
68 | void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod); | 70 | void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod); |
69 | void bfa_fcs_log_init(struct bfa_fcs_s *fcs, struct bfa_log_mod_s *logmod); | 71 | void bfa_fcs_log_init(struct bfa_fcs_s *fcs, struct bfa_log_mod_s *logmod); |