diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 22:52:46 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:04:13 -0400 |
commit | 3e98cc013fc4902df5f9d9defe1856df0f0cb657 (patch) | |
tree | c762bf9603074c2811118ffca90e3a69f35fb627 /drivers/scsi/bfa | |
parent | 41188cf5a60a24bf54df5be70142f0928f413788 (diff) |
[SCSI] bfa: add PBC port disable handling
Add PBC port disable handling in BFA and return the appropriate status from
BFA APIs. In bfa_fcs_lport.c, handle OFFLINE event to avoid BFA_ASSERT.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcport.c | 38 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_lport.c | 3 |
2 files changed, 36 insertions, 5 deletions
diff --git a/drivers/scsi/bfa/bfa_fcport.c b/drivers/scsi/bfa/bfa_fcport.c index 18d33072bec5..d3b5efba8af0 100644 --- a/drivers/scsi/bfa/bfa_fcport.c +++ b/drivers/scsi/bfa/bfa_fcport.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <bfa.h> | 18 | #include <bfa.h> |
19 | #include <bfa_svc.h> | 19 | #include <bfa_svc.h> |
20 | #include <bfi/bfi_pport.h> | 20 | #include <bfi/bfi_pport.h> |
21 | #include <bfi/bfi_pbc.h> | ||
21 | #include <cs/bfa_debug.h> | 22 | #include <cs/bfa_debug.h> |
22 | #include <aen/bfa_aen.h> | 23 | #include <aen/bfa_aen.h> |
23 | #include <cs/bfa_plog.h> | 24 | #include <cs/bfa_plog.h> |
@@ -1380,6 +1381,14 @@ bfa_status_t | |||
1380 | bfa_fcport_enable(struct bfa_s *bfa) | 1381 | bfa_fcport_enable(struct bfa_s *bfa) |
1381 | { | 1382 | { |
1382 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); | 1383 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); |
1384 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | ||
1385 | struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp; | ||
1386 | |||
1387 | /* if port is PBC disabled, return error */ | ||
1388 | if (cfgrsp->pbc_cfg.port_enabled == BFI_PBC_PORT_DISABLED) { | ||
1389 | bfa_trc(bfa, fcport->pwwn); | ||
1390 | return BFA_STATUS_PBC; | ||
1391 | } | ||
1383 | 1392 | ||
1384 | if (fcport->diag_busy) | 1393 | if (fcport->diag_busy) |
1385 | return BFA_STATUS_DIAG_BUSY; | 1394 | return BFA_STATUS_DIAG_BUSY; |
@@ -1394,6 +1403,16 @@ bfa_fcport_enable(struct bfa_s *bfa) | |||
1394 | bfa_status_t | 1403 | bfa_status_t |
1395 | bfa_fcport_disable(struct bfa_s *bfa) | 1404 | bfa_fcport_disable(struct bfa_s *bfa) |
1396 | { | 1405 | { |
1406 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); | ||
1407 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | ||
1408 | struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp; | ||
1409 | |||
1410 | /* if port is PBC disabled, return error */ | ||
1411 | if (cfgrsp->pbc_cfg.port_enabled == BFI_PBC_PORT_DISABLED) { | ||
1412 | bfa_trc(bfa, fcport->pwwn); | ||
1413 | return BFA_STATUS_PBC; | ||
1414 | } | ||
1415 | |||
1397 | bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DISABLE); | 1416 | bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DISABLE); |
1398 | return BFA_STATUS_OK; | 1417 | return BFA_STATUS_OK; |
1399 | } | 1418 | } |
@@ -1584,6 +1603,8 @@ void | |||
1584 | bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr) | 1603 | bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr) |
1585 | { | 1604 | { |
1586 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); | 1605 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); |
1606 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | ||
1607 | struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp; | ||
1587 | 1608 | ||
1588 | bfa_os_memset(attr, 0, sizeof(struct bfa_pport_attr_s)); | 1609 | bfa_os_memset(attr, 0, sizeof(struct bfa_pport_attr_s)); |
1589 | 1610 | ||
@@ -1618,11 +1639,18 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr) | |||
1618 | 1639 | ||
1619 | attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); | 1640 | attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); |
1620 | attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); | 1641 | attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); |
1621 | attr->port_state = bfa_sm_to_state(hal_pport_sm_table, fcport->sm); | 1642 | |
1622 | if (bfa_ioc_is_disabled(&fcport->bfa->ioc)) | 1643 | /* PBC Disabled State */ |
1623 | attr->port_state = BFA_PPORT_ST_IOCDIS; | 1644 | if (cfgrsp->pbc_cfg.port_enabled == BFI_PBC_PORT_DISABLED) |
1624 | else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) | 1645 | attr->port_state = BFA_PPORT_ST_PREBOOT_DISABLED; |
1625 | attr->port_state = BFA_PPORT_ST_FWMISMATCH; | 1646 | else { |
1647 | attr->port_state = bfa_sm_to_state( | ||
1648 | hal_pport_sm_table, fcport->sm); | ||
1649 | if (bfa_ioc_is_disabled(&fcport->bfa->ioc)) | ||
1650 | attr->port_state = BFA_PPORT_ST_IOCDIS; | ||
1651 | else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) | ||
1652 | attr->port_state = BFA_PPORT_ST_FWMISMATCH; | ||
1653 | } | ||
1626 | } | 1654 | } |
1627 | 1655 | ||
1628 | #define BFA_FCPORT_STATS_TOV 1000 | 1656 | #define BFA_FCPORT_STATS_TOV 1000 |
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index 7c1251c682d8..35df20e68a52 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c | |||
@@ -135,6 +135,9 @@ bfa_fcs_port_sm_init(struct bfa_fcs_port_s *port, enum bfa_fcs_port_event event) | |||
135 | bfa_fcs_port_deleted(port); | 135 | bfa_fcs_port_deleted(port); |
136 | break; | 136 | break; |
137 | 137 | ||
138 | case BFA_FCS_PORT_SM_OFFLINE: | ||
139 | break; | ||
140 | |||
138 | default: | 141 | default: |
139 | bfa_sm_fault(port->fcs, event); | 142 | bfa_sm_fault(port->fcs, event); |
140 | } | 143 | } |