aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_fcport.c
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2010-03-05 22:37:57 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-03-07 02:37:00 -0500
commit0a4b1fc0b24fc7adbaf8413f2992ce1395991a78 (patch)
tree9a07aeee614e2e3f3191aee552effc467163fb33 /drivers/scsi/bfa/bfa_fcport.c
parentf58e9ebbf78bd36c6cf1ca651280d39efe73a7c0 (diff)
[SCSI] bfa: Replace bfa_get_attr() with specific APIs
bfa_ioc_attr_s is a big structure and some times could cause stack overflow if defined locally, so add specific APIs that are needed to replace the use of ioc_attr local var. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcport.c')
-rw-r--r--drivers/scsi/bfa/bfa_fcport.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/drivers/scsi/bfa/bfa_fcport.c b/drivers/scsi/bfa/bfa_fcport.c
index a48413c230a5..0da612010787 100644
--- a/drivers/scsi/bfa/bfa_fcport.c
+++ b/drivers/scsi/bfa/bfa_fcport.c
@@ -145,35 +145,12 @@ bfa_fcport_aen_post(struct bfa_fcport_s *fcport, enum bfa_port_aen_event event)
145 struct bfa_log_mod_s *logmod = fcport->bfa->logm; 145 struct bfa_log_mod_s *logmod = fcport->bfa->logm;
146 wwn_t pwwn = fcport->pwwn; 146 wwn_t pwwn = fcport->pwwn;
147 char pwwn_ptr[BFA_STRING_32]; 147 char pwwn_ptr[BFA_STRING_32];
148 struct bfa_ioc_attr_s ioc_attr;
149 148
150 memset(&aen_data, 0, sizeof(aen_data)); 149 memset(&aen_data, 0, sizeof(aen_data));
151 wwn2str(pwwn_ptr, pwwn); 150 wwn2str(pwwn_ptr, pwwn);
152 switch (event) { 151 bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_PORT, event), pwwn_ptr);
153 case BFA_PORT_AEN_ONLINE:
154 bfa_log(logmod, BFA_AEN_PORT_ONLINE, pwwn_ptr);
155 break;
156 case BFA_PORT_AEN_OFFLINE:
157 bfa_log(logmod, BFA_AEN_PORT_OFFLINE, pwwn_ptr);
158 break;
159 case BFA_PORT_AEN_ENABLE:
160 bfa_log(logmod, BFA_AEN_PORT_ENABLE, pwwn_ptr);
161 break;
162 case BFA_PORT_AEN_DISABLE:
163 bfa_log(logmod, BFA_AEN_PORT_DISABLE, pwwn_ptr);
164 break;
165 case BFA_PORT_AEN_DISCONNECT:
166 bfa_log(logmod, BFA_AEN_PORT_DISCONNECT, pwwn_ptr);
167 break;
168 case BFA_PORT_AEN_QOS_NEG:
169 bfa_log(logmod, BFA_AEN_PORT_QOS_NEG, pwwn_ptr);
170 break;
171 default:
172 break;
173 }
174 152
175 bfa_ioc_get_attr(&fcport->bfa->ioc, &ioc_attr); 153 aen_data.port.ioc_type = bfa_get_type(fcport->bfa);
176 aen_data.port.ioc_type = ioc_attr.ioc_type;
177 aen_data.port.pwwn = pwwn; 154 aen_data.port.pwwn = pwwn;
178} 155}
179 156
@@ -2043,11 +2020,15 @@ void
2043bfa_fcport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off) 2020bfa_fcport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off)
2044{ 2021{
2045 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2022 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
2023 enum bfa_ioc_type_e ioc_type = bfa_get_type(bfa);
2046 2024
2047 bfa_trc(bfa, on_off); 2025 bfa_trc(bfa, on_off);
2048 bfa_trc(bfa, fcport->cfg.qos_enabled); 2026 bfa_trc(bfa, fcport->cfg.qos_enabled);
2049 2027
2050 fcport->cfg.qos_enabled = on_off; 2028 bfa_trc(bfa, ioc_type);
2029
2030 if (ioc_type == BFA_IOC_TYPE_FC)
2031 fcport->cfg.qos_enabled = on_off;
2051} 2032}
2052 2033
2053void 2034void