aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-13 18:46:21 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 16:27:46 -0400
commit43ffdf4dfb827babcdca5345a76031598a985dc8 (patch)
tree54d7a506915bcc657e80dbee07523aad8a60e984 /drivers/scsi/bfa
parentd37779f8d98a1d7c5ba904982958167d988f01dd (diff)
[SCSI] bfa: Add pbc port disable check and fix LPS message name
- Add PBC port Disabled condition check. - Rename incorrectly named LPS I2H messages. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r--drivers/scsi/bfa/bfa_port.c13
-rw-r--r--drivers/scsi/bfa/bfa_port.h1
-rw-r--r--drivers/scsi/bfa/bfa_svc.c43
-rw-r--r--drivers/scsi/bfa/bfa_svc.h1
-rw-r--r--drivers/scsi/bfa/bfi.h3
-rw-r--r--drivers/scsi/bfa/bfi_ms.h6
6 files changed, 56 insertions, 11 deletions
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c
index 5ebdb6297b4c..6b759364ac90 100644
--- a/drivers/scsi/bfa/bfa_port.c
+++ b/drivers/scsi/bfa/bfa_port.c
@@ -236,6 +236,12 @@ bfa_port_enable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn,
236{ 236{
237 struct bfi_port_generic_req_s *m; 237 struct bfi_port_generic_req_s *m;
238 238
239 /* If port is PBC disabled, return error */
240 if (port->pbc_disabled) {
241 bfa_trc(port, BFA_STATUS_PBC);
242 return BFA_STATUS_PBC;
243 }
244
239 if (bfa_ioc_is_disabled(port->ioc)) { 245 if (bfa_ioc_is_disabled(port->ioc)) {
240 bfa_trc(port, BFA_STATUS_IOC_DISABLED); 246 bfa_trc(port, BFA_STATUS_IOC_DISABLED);
241 return BFA_STATUS_IOC_DISABLED; 247 return BFA_STATUS_IOC_DISABLED;
@@ -280,6 +286,12 @@ bfa_port_disable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn,
280{ 286{
281 struct bfi_port_generic_req_s *m; 287 struct bfi_port_generic_req_s *m;
282 288
289 /* If port is PBC disabled, return error */
290 if (port->pbc_disabled) {
291 bfa_trc(port, BFA_STATUS_PBC);
292 return BFA_STATUS_PBC;
293 }
294
283 if (bfa_ioc_is_disabled(port->ioc)) { 295 if (bfa_ioc_is_disabled(port->ioc)) {
284 bfa_trc(port, BFA_STATUS_IOC_DISABLED); 296 bfa_trc(port, BFA_STATUS_IOC_DISABLED);
285 return BFA_STATUS_IOC_DISABLED; 297 return BFA_STATUS_IOC_DISABLED;
@@ -456,6 +468,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
456 port->endis_pending = BFA_FALSE; 468 port->endis_pending = BFA_FALSE;
457 port->stats_cbfn = NULL; 469 port->stats_cbfn = NULL;
458 port->endis_cbfn = NULL; 470 port->endis_cbfn = NULL;
471 port->pbc_disabled = BFA_FALSE;
459 472
460 bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); 473 bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port);
461 bfa_ioc_notify_init(&port->ioc_notify, bfa_port_notify, port); 474 bfa_ioc_notify_init(&port->ioc_notify, bfa_port_notify, port);
diff --git a/drivers/scsi/bfa/bfa_port.h b/drivers/scsi/bfa/bfa_port.h
index 8b5617447dcd..1587a6f08b26 100644
--- a/drivers/scsi/bfa/bfa_port.h
+++ b/drivers/scsi/bfa/bfa_port.h
@@ -44,6 +44,7 @@ struct bfa_port_s {
44 void *endis_cbarg; 44 void *endis_cbarg;
45 bfa_status_t endis_status; 45 bfa_status_t endis_status;
46 struct bfa_ioc_notify_s ioc_notify; 46 struct bfa_ioc_notify_s ioc_notify;
47 bfa_boolean_t pbc_disabled;
47}; 48};
48 49
49void bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, 50void bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index d1674c6058ed..46e8cdd31db9 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -1934,15 +1934,15 @@ bfa_lps_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1934 msg.msg = m; 1934 msg.msg = m;
1935 1935
1936 switch (m->mhdr.msg_id) { 1936 switch (m->mhdr.msg_id) {
1937 case BFI_LPS_H2I_LOGIN_RSP: 1937 case BFI_LPS_I2H_LOGIN_RSP:
1938 bfa_lps_login_rsp(bfa, msg.login_rsp); 1938 bfa_lps_login_rsp(bfa, msg.login_rsp);
1939 break; 1939 break;
1940 1940
1941 case BFI_LPS_H2I_LOGOUT_RSP: 1941 case BFI_LPS_I2H_LOGOUT_RSP:
1942 bfa_lps_logout_rsp(bfa, msg.logout_rsp); 1942 bfa_lps_logout_rsp(bfa, msg.logout_rsp);
1943 break; 1943 break;
1944 1944
1945 case BFI_LPS_H2I_CVL_EVENT: 1945 case BFI_LPS_I2H_CVL_EVENT:
1946 bfa_lps_rx_cvl_event(bfa, msg.cvl_event); 1946 bfa_lps_rx_cvl_event(bfa, msg.cvl_event);
1947 break; 1947 break;
1948 1948
@@ -3308,6 +3308,9 @@ bfa_fcport_init(struct bfa_s *bfa)
3308 fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); 3308 fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc);
3309 fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); 3309 fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc);
3310 3310
3311 if (bfa_fcport_is_pbcdisabled(bfa))
3312 bfa->modules.port.pbc_disabled = BFA_TRUE;
3313
3311 WARN_ON(!fcport->cfg.maxfrsize); 3314 WARN_ON(!fcport->cfg.maxfrsize);
3312 WARN_ON(!fcport->cfg.rx_bbcredit); 3315 WARN_ON(!fcport->cfg.rx_bbcredit);
3313 WARN_ON(!fcport->speed_sup); 3316 WARN_ON(!fcport->speed_sup);
@@ -3432,6 +3435,9 @@ bfa_fcport_enable(struct bfa_s *bfa)
3432{ 3435{
3433 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 3436 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3434 3437
3438 if (bfa_fcport_is_pbcdisabled(bfa))
3439 return BFA_STATUS_PBC;
3440
3435 if (bfa_ioc_is_disabled(&bfa->ioc)) 3441 if (bfa_ioc_is_disabled(&bfa->ioc))
3436 return BFA_STATUS_IOC_DISABLED; 3442 return BFA_STATUS_IOC_DISABLED;
3437 3443
@@ -3445,6 +3451,8 @@ bfa_fcport_enable(struct bfa_s *bfa)
3445bfa_status_t 3451bfa_status_t
3446bfa_fcport_disable(struct bfa_s *bfa) 3452bfa_fcport_disable(struct bfa_s *bfa)
3447{ 3453{
3454 if (bfa_fcport_is_pbcdisabled(bfa))
3455 return BFA_STATUS_PBC;
3448 3456
3449 if (bfa_ioc_is_disabled(&bfa->ioc)) 3457 if (bfa_ioc_is_disabled(&bfa->ioc))
3450 return BFA_STATUS_IOC_DISABLED; 3458 return BFA_STATUS_IOC_DISABLED;
@@ -3453,6 +3461,21 @@ bfa_fcport_disable(struct bfa_s *bfa)
3453 return BFA_STATUS_OK; 3461 return BFA_STATUS_OK;
3454} 3462}
3455 3463
3464/* If PBC is disabled on port, return error */
3465bfa_status_t
3466bfa_fcport_is_pbcdisabled(struct bfa_s *bfa)
3467{
3468 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3469 struct bfa_iocfc_s *iocfc = &bfa->iocfc;
3470 struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp;
3471
3472 if (cfgrsp->pbc_cfg.port_enabled == BFI_PBC_PORT_DISABLED) {
3473 bfa_trc(bfa, fcport->pwwn);
3474 return BFA_STATUS_PBC;
3475 }
3476 return BFA_STATUS_OK;
3477}
3478
3456/* 3479/*
3457 * Configure port speed. 3480 * Configure port speed.
3458 */ 3481 */
@@ -3660,10 +3683,16 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
3660 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); 3683 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa);
3661 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); 3684 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa);
3662 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); 3685 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm);
3663 if (bfa_ioc_is_disabled(&fcport->bfa->ioc)) 3686
3664 attr->port_state = BFA_PORT_ST_IOCDIS; 3687 /* PBC Disabled State */
3665 else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) 3688 if (bfa_fcport_is_pbcdisabled(bfa))
3666 attr->port_state = BFA_PORT_ST_FWMISMATCH; 3689 attr->port_state = BFA_PORT_ST_PREBOOT_DISABLED;
3690 else {
3691 if (bfa_ioc_is_disabled(&fcport->bfa->ioc))
3692 attr->port_state = BFA_PORT_ST_IOCDIS;
3693 else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc))
3694 attr->port_state = BFA_PORT_ST_FWMISMATCH;
3695 }
3667 3696
3668 /* FCoE vlan */ 3697 /* FCoE vlan */
3669 attr->fcoe_vlan = fcport->fcoe_vlan; 3698 attr->fcoe_vlan = fcport->fcoe_vlan;
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h
index 5902a45c080f..c5927a5cbac9 100644
--- a/drivers/scsi/bfa/bfa_svc.h
+++ b/drivers/scsi/bfa/bfa_svc.h
@@ -524,6 +524,7 @@ bfa_status_t bfa_fcport_get_stats(struct bfa_s *bfa,
524bfa_status_t bfa_fcport_clear_stats(struct bfa_s *bfa, bfa_cb_port_t cbfn, 524bfa_status_t bfa_fcport_clear_stats(struct bfa_s *bfa, bfa_cb_port_t cbfn,
525 void *cbarg); 525 void *cbarg);
526bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa); 526bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa);
527bfa_status_t bfa_fcport_is_pbcdisabled(struct bfa_s *bfa);
527 528
528/* 529/*
529 * bfa rport API functions 530 * bfa rport API functions
diff --git a/drivers/scsi/bfa/bfi.h b/drivers/scsi/bfa/bfi.h
index d57522dd949b..5b69d07af99c 100644
--- a/drivers/scsi/bfa/bfi.h
+++ b/drivers/scsi/bfa/bfi.h
@@ -50,7 +50,7 @@ struct bfi_mhdr_s {
50 } mtag; 50 } mtag;
51}; 51};
52 52
53#define bfi_mhdr_2_qid(_mh) (_mh)->mtag.h2i.qid 53#define bfi_mhdr_2_qid(_mh) ((_mh)->mtag.h2i.qid)
54 54
55#define bfi_h2i_set(_mh, _mc, _op, _lpuid) do { \ 55#define bfi_h2i_set(_mh, _mc, _op, _lpuid) do { \
56 (_mh).msg_class = (_mc); \ 56 (_mh).msg_class = (_mc); \
@@ -411,6 +411,7 @@ union bfi_ioc_i2h_msg_u {
411 411
412#define BFI_PBC_MAX_BLUNS 8 412#define BFI_PBC_MAX_BLUNS 8
413#define BFI_PBC_MAX_VPORTS 16 413#define BFI_PBC_MAX_VPORTS 16
414#define BFI_PBC_PORT_DISABLED 2
414 415
415/* 416/*
416 * PBC boot lun configuration 417 * PBC boot lun configuration
diff --git a/drivers/scsi/bfa/bfi_ms.h b/drivers/scsi/bfa/bfi_ms.h
index a29d905fe8c0..dd2aad9ac6fe 100644
--- a/drivers/scsi/bfa/bfi_ms.h
+++ b/drivers/scsi/bfa/bfi_ms.h
@@ -346,9 +346,9 @@ enum bfi_lps_h2i_msgs {
346}; 346};
347 347
348enum bfi_lps_i2h_msgs { 348enum bfi_lps_i2h_msgs {
349 BFI_LPS_H2I_LOGIN_RSP = BFA_I2HM(1), 349 BFI_LPS_I2H_LOGIN_RSP = BFA_I2HM(1),
350 BFI_LPS_H2I_LOGOUT_RSP = BFA_I2HM(2), 350 BFI_LPS_I2H_LOGOUT_RSP = BFA_I2HM(2),
351 BFI_LPS_H2I_CVL_EVENT = BFA_I2HM(3), 351 BFI_LPS_I2H_CVL_EVENT = BFA_I2HM(3),
352}; 352};
353 353
354struct bfi_lps_login_req_s { 354struct bfi_lps_login_req_s {