diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2010-03-05 22:37:45 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-03-07 02:36:36 -0500 |
commit | f58e9ebbf78bd36c6cf1ca651280d39efe73a7c0 (patch) | |
tree | ffec92bd31a0ebb288cd8a67550a18bad18d2db3 /drivers/scsi | |
parent | 1c8a4c37494932acd59079b4fc8d8f69fb329c2a (diff) |
[SCSI] bfa: New portlog entries for events (FIP/FLOGI/FDISC/LOGO).
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcport.c | 21 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_lps.c | 27 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/defs/bfa_defs_pport.h | 21 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/protocol/fc.h | 5 |
4 files changed, 66 insertions, 8 deletions
diff --git a/drivers/scsi/bfa/bfa_fcport.c b/drivers/scsi/bfa/bfa_fcport.c index f392a7fa8c7f..a48413c230a5 100644 --- a/drivers/scsi/bfa/bfa_fcport.c +++ b/drivers/scsi/bfa/bfa_fcport.c | |||
@@ -326,6 +326,7 @@ static void | |||
326 | bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, | 326 | bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, |
327 | enum bfa_fcport_sm_event event) | 327 | enum bfa_fcport_sm_event event) |
328 | { | 328 | { |
329 | struct bfi_pport_event_s *pevent = fcport->event_arg.i2hmsg.event; | ||
329 | bfa_trc(fcport->bfa, event); | 330 | bfa_trc(fcport->bfa, event); |
330 | 331 | ||
331 | switch (event) { | 332 | switch (event) { |
@@ -335,6 +336,22 @@ bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, | |||
335 | bfa_assert(fcport->event_cbfn); | 336 | bfa_assert(fcport->event_cbfn); |
336 | bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, | 337 | bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, |
337 | BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkup"); | 338 | BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkup"); |
339 | |||
340 | if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) { | ||
341 | |||
342 | bfa_trc(fcport->bfa, pevent->link_state.fcf.fipenabled); | ||
343 | bfa_trc(fcport->bfa, pevent->link_state.fcf.fipfailed); | ||
344 | |||
345 | if (pevent->link_state.fcf.fipfailed) | ||
346 | bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, | ||
347 | BFA_PL_EID_FIP_FCF_DISC, 0, | ||
348 | "FIP FCF Discovery Failed"); | ||
349 | else | ||
350 | bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, | ||
351 | BFA_PL_EID_FIP_FCF_DISC, 0, | ||
352 | "FIP FCF Discovered"); | ||
353 | } | ||
354 | |||
338 | bfa_fcport_callback(fcport, BFA_PPORT_LINKUP); | 355 | bfa_fcport_callback(fcport, BFA_PPORT_LINKUP); |
339 | bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ONLINE); | 356 | bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ONLINE); |
340 | /** | 357 | /** |
@@ -1500,8 +1517,6 @@ bfa_port_stats_query(void *cbarg) | |||
1500 | bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_GET_STATS_REQ, | 1517 | bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_GET_STATS_REQ, |
1501 | bfa_lpuid(fcport->bfa)); | 1518 | bfa_lpuid(fcport->bfa)); |
1502 | bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); | 1519 | bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); |
1503 | |||
1504 | return; | ||
1505 | } | 1520 | } |
1506 | 1521 | ||
1507 | static void | 1522 | static void |
@@ -1526,7 +1541,6 @@ bfa_port_stats_clear(void *cbarg) | |||
1526 | bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_CLEAR_STATS_REQ, | 1541 | bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_CLEAR_STATS_REQ, |
1527 | bfa_lpuid(fcport->bfa)); | 1542 | bfa_lpuid(fcport->bfa)); |
1528 | bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); | 1543 | bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); |
1529 | return; | ||
1530 | } | 1544 | } |
1531 | 1545 | ||
1532 | static void | 1546 | static void |
@@ -1599,7 +1613,6 @@ bfa_port_qos_stats_clear(void *cbarg) | |||
1599 | bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_CLEAR_QOS_STATS_REQ, | 1613 | bfi_h2i_set(msg->mh, BFI_MC_FC_PORT, BFI_PPORT_H2I_CLEAR_QOS_STATS_REQ, |
1600 | bfa_lpuid(fcport->bfa)); | 1614 | bfa_lpuid(fcport->bfa)); |
1601 | bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); | 1615 | bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); |
1602 | return; | ||
1603 | } | 1616 | } |
1604 | 1617 | ||
1605 | static void | 1618 | static void |
diff --git a/drivers/scsi/bfa/bfa_lps.c b/drivers/scsi/bfa/bfa_lps.c index 730616f6e671..d2d48a619c30 100644 --- a/drivers/scsi/bfa/bfa_lps.c +++ b/drivers/scsi/bfa/bfa_lps.c | |||
@@ -99,6 +99,12 @@ bfa_lps_sm_init(struct bfa_lps_s *lps, enum bfa_lps_event event) | |||
99 | bfa_sm_set_state(lps, bfa_lps_sm_login); | 99 | bfa_sm_set_state(lps, bfa_lps_sm_login); |
100 | bfa_lps_send_login(lps); | 100 | bfa_lps_send_login(lps); |
101 | } | 101 | } |
102 | if (lps->fdisc) | ||
103 | bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS, | ||
104 | BFA_PL_EID_LOGIN, 0, "FDISC Request"); | ||
105 | else | ||
106 | bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS, | ||
107 | BFA_PL_EID_LOGIN, 0, "FLOGI Request"); | ||
102 | break; | 108 | break; |
103 | 109 | ||
104 | case BFA_LPS_SM_LOGOUT: | 110 | case BFA_LPS_SM_LOGOUT: |
@@ -136,10 +142,25 @@ bfa_lps_sm_login(struct bfa_lps_s *lps, enum bfa_lps_event event) | |||
136 | 142 | ||
137 | switch (event) { | 143 | switch (event) { |
138 | case BFA_LPS_SM_FWRSP: | 144 | case BFA_LPS_SM_FWRSP: |
139 | if (lps->status == BFA_STATUS_OK) | 145 | if (lps->status == BFA_STATUS_OK) { |
140 | bfa_sm_set_state(lps, bfa_lps_sm_online); | 146 | bfa_sm_set_state(lps, bfa_lps_sm_online); |
141 | else | 147 | if (lps->fdisc) |
148 | bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS, | ||
149 | BFA_PL_EID_LOGIN, 0, "FDISC Accept"); | ||
150 | else | ||
151 | bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS, | ||
152 | BFA_PL_EID_LOGIN, 0, "FLOGI Accept"); | ||
153 | } else { | ||
142 | bfa_sm_set_state(lps, bfa_lps_sm_init); | 154 | bfa_sm_set_state(lps, bfa_lps_sm_init); |
155 | if (lps->fdisc) | ||
156 | bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS, | ||
157 | BFA_PL_EID_LOGIN, 0, | ||
158 | "FDISC Fail (RJT or timeout)"); | ||
159 | else | ||
160 | bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS, | ||
161 | BFA_PL_EID_LOGIN, 0, | ||
162 | "FLOGI Fail (RJT or timeout)"); | ||
163 | } | ||
143 | bfa_lps_login_comp(lps); | 164 | bfa_lps_login_comp(lps); |
144 | break; | 165 | break; |
145 | 166 | ||
@@ -202,6 +223,8 @@ bfa_lps_sm_online(struct bfa_lps_s *lps, enum bfa_lps_event event) | |||
202 | bfa_sm_set_state(lps, bfa_lps_sm_logout); | 223 | bfa_sm_set_state(lps, bfa_lps_sm_logout); |
203 | bfa_lps_send_logout(lps); | 224 | bfa_lps_send_logout(lps); |
204 | } | 225 | } |
226 | bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS, | ||
227 | BFA_PL_EID_LOGO, 0, "Logout"); | ||
205 | break; | 228 | break; |
206 | 229 | ||
207 | case BFA_LPS_SM_RX_CVL: | 230 | case BFA_LPS_SM_RX_CVL: |
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h index 88662a15a21b..164cfbef9b12 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h | |||
@@ -333,8 +333,7 @@ struct bfa_pport_fcpmap_s { | |||
333 | }; | 333 | }; |
334 | 334 | ||
335 | /** | 335 | /** |
336 | * Port RNID info. | 336 | * Port RNI */ |
337 | */ | ||
338 | struct bfa_pport_rnid_s { | 337 | struct bfa_pport_rnid_s { |
339 | wwn_t wwn; | 338 | wwn_t wwn; |
340 | u32 unittype; | 339 | u32 unittype; |
@@ -347,6 +346,23 @@ struct bfa_pport_rnid_s { | |||
347 | u16 topologydiscoveryflags; | 346 | u16 topologydiscoveryflags; |
348 | }; | 347 | }; |
349 | 348 | ||
349 | struct bfa_fcport_fcf_s { | ||
350 | wwn_t name; /* FCF name */ | ||
351 | wwn_t fabric_name; /* Fabric Name */ | ||
352 | u8 fipenabled; /* FIP enabled or not */ | ||
353 | u8 fipfailed; /* FIP failed or not */ | ||
354 | u8 resv[2]; | ||
355 | u8 pri; /* FCF priority */ | ||
356 | u8 version; /* FIP version used */ | ||
357 | u8 available; /* Available for login */ | ||
358 | u8 fka_disabled; /* FKA is disabled */ | ||
359 | u8 maxsz_verified; /* FCoE max size verified */ | ||
360 | u8 fc_map[3]; /* FC map */ | ||
361 | u16 vlan; /* FCoE vlan tag/priority */ | ||
362 | u32 fka_adv_per; /* FIP ka advert. period */ | ||
363 | struct mac_s mac; /* FCF mac */ | ||
364 | }; | ||
365 | |||
350 | /** | 366 | /** |
351 | * Link state information | 367 | * Link state information |
352 | */ | 368 | */ |
@@ -378,6 +394,7 @@ struct bfa_pport_link_s { | |||
378 | struct fc_alpabm_s alpabm; /* alpa bitmap */ | 394 | struct fc_alpabm_s alpabm; /* alpa bitmap */ |
379 | } loop_info; | 395 | } loop_info; |
380 | } tl; | 396 | } tl; |
397 | struct bfa_fcport_fcf_s fcf; /*!< FCF information (for FCoE) */ | ||
381 | }; | 398 | }; |
382 | 399 | ||
383 | #endif /* __BFA_DEFS_PPORT_H__ */ | 400 | #endif /* __BFA_DEFS_PPORT_H__ */ |
diff --git a/drivers/scsi/bfa/include/protocol/fc.h b/drivers/scsi/bfa/include/protocol/fc.h index 14969eecf6a9..8d1038035a76 100644 --- a/drivers/scsi/bfa/include/protocol/fc.h +++ b/drivers/scsi/bfa/include/protocol/fc.h | |||
@@ -50,6 +50,11 @@ struct fchs_s { | |||
50 | 50 | ||
51 | u32 ro; /* relative offset */ | 51 | u32 ro; /* relative offset */ |
52 | }; | 52 | }; |
53 | |||
54 | #define FC_SOF_LEN 4 | ||
55 | #define FC_EOF_LEN 4 | ||
56 | #define FC_CRC_LEN 4 | ||
57 | |||
53 | /* | 58 | /* |
54 | * Fibre Channel BB_E Header Structure | 59 | * Fibre Channel BB_E Header Structure |
55 | */ | 60 | */ |