aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bna/bfa_ioc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bna/bfa_ioc.c')
-rw-r--r--drivers/net/bna/bfa_ioc.c54
1 files changed, 33 insertions, 21 deletions
diff --git a/drivers/net/bna/bfa_ioc.c b/drivers/net/bna/bfa_ioc.c
index 04bfb29bdc93..c52ef6347dc6 100644
--- a/drivers/net/bna/bfa_ioc.c
+++ b/drivers/net/bna/bfa_ioc.c
@@ -71,6 +71,7 @@ static void bfa_ioc_mbox_poll(struct bfa_ioc *ioc);
71static void bfa_ioc_mbox_hbfail(struct bfa_ioc *ioc); 71static void bfa_ioc_mbox_hbfail(struct bfa_ioc *ioc);
72static void bfa_ioc_recover(struct bfa_ioc *ioc); 72static void bfa_ioc_recover(struct bfa_ioc *ioc);
73static void bfa_ioc_check_attr_wwns(struct bfa_ioc *ioc); 73static void bfa_ioc_check_attr_wwns(struct bfa_ioc *ioc);
74static void bfa_ioc_event_notify(struct bfa_ioc *, enum bfa_ioc_event);
74static void bfa_ioc_disable_comp(struct bfa_ioc *ioc); 75static void bfa_ioc_disable_comp(struct bfa_ioc *ioc);
75static void bfa_ioc_lpu_stop(struct bfa_ioc *ioc); 76static void bfa_ioc_lpu_stop(struct bfa_ioc *ioc);
76static void bfa_ioc_fail_notify(struct bfa_ioc *ioc); 77static void bfa_ioc_fail_notify(struct bfa_ioc *ioc);
@@ -1123,23 +1124,28 @@ bfa_iocpf_sm_fail(struct bfa_iocpf *iocpf, enum iocpf_event event)
1123 * BFA IOC private functions 1124 * BFA IOC private functions
1124 */ 1125 */
1125 1126
1127/**
1128 * Notify common modules registered for notification.
1129 */
1126static void 1130static void
1127bfa_ioc_disable_comp(struct bfa_ioc *ioc) 1131bfa_ioc_event_notify(struct bfa_ioc *ioc, enum bfa_ioc_event event)
1128{ 1132{
1133 struct bfa_ioc_notify *notify;
1129 struct list_head *qe; 1134 struct list_head *qe;
1130 struct bfa_ioc_hbfail_notify *notify;
1131 1135
1132 ioc->cbfn->disable_cbfn(ioc->bfa); 1136 list_for_each(qe, &ioc->notify_q) {
1133 1137 notify = (struct bfa_ioc_notify *)qe;
1134 /** 1138 notify->cbfn(notify->cbarg, event);
1135 * Notify common modules registered for notification.
1136 */
1137 list_for_each(qe, &ioc->hb_notify_q) {
1138 notify = (struct bfa_ioc_hbfail_notify *) qe;
1139 notify->cbfn(notify->cbarg);
1140 } 1139 }
1141} 1140}
1142 1141
1142static void
1143bfa_ioc_disable_comp(struct bfa_ioc *ioc)
1144{
1145 ioc->cbfn->disable_cbfn(ioc->bfa);
1146 bfa_ioc_event_notify(ioc, BFA_IOC_E_DISABLED);
1147}
1148
1143bool 1149bool
1144bfa_nw_ioc_sem_get(void __iomem *sem_reg) 1150bfa_nw_ioc_sem_get(void __iomem *sem_reg)
1145{ 1151{
@@ -1650,17 +1656,11 @@ bfa_ioc_mbox_hbfail(struct bfa_ioc *ioc)
1650static void 1656static void
1651bfa_ioc_fail_notify(struct bfa_ioc *ioc) 1657bfa_ioc_fail_notify(struct bfa_ioc *ioc)
1652{ 1658{
1653 struct list_head *qe;
1654 struct bfa_ioc_hbfail_notify *notify;
1655
1656 /** 1659 /**
1657 * Notify driver and common modules registered for notification. 1660 * Notify driver and common modules registered for notification.
1658 */ 1661 */
1659 ioc->cbfn->hbfail_cbfn(ioc->bfa); 1662 ioc->cbfn->hbfail_cbfn(ioc->bfa);
1660 list_for_each(qe, &ioc->hb_notify_q) { 1663 bfa_ioc_event_notify(ioc, BFA_IOC_E_FAILED);
1661 notify = (struct bfa_ioc_hbfail_notify *) qe;
1662 notify->cbfn(notify->cbarg);
1663 }
1664} 1664}
1665 1665
1666static void 1666static void
@@ -1839,7 +1839,7 @@ bfa_nw_ioc_attach(struct bfa_ioc *ioc, void *bfa, struct bfa_ioc_cbfn *cbfn)
1839 ioc->iocpf.ioc = ioc; 1839 ioc->iocpf.ioc = ioc;
1840 1840
1841 bfa_ioc_mbox_attach(ioc); 1841 bfa_ioc_mbox_attach(ioc);
1842 INIT_LIST_HEAD(&ioc->hb_notify_q); 1842 INIT_LIST_HEAD(&ioc->notify_q);
1843 1843
1844 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); 1844 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit);
1845 bfa_fsm_send_event(ioc, IOC_E_RESET); 1845 bfa_fsm_send_event(ioc, IOC_E_RESET);
@@ -1969,6 +1969,8 @@ bfa_nw_ioc_mbox_queue(struct bfa_ioc *ioc, struct bfa_mbox_cmd *cmd)
1969 * mailbox is free -- queue command to firmware 1969 * mailbox is free -- queue command to firmware
1970 */ 1970 */
1971 bfa_ioc_mbox_send(ioc, cmd->msg, sizeof(cmd->msg)); 1971 bfa_ioc_mbox_send(ioc, cmd->msg, sizeof(cmd->msg));
1972
1973 return;
1972} 1974}
1973 1975
1974/** 1976/**
@@ -2005,14 +2007,24 @@ bfa_nw_ioc_error_isr(struct bfa_ioc *ioc)
2005} 2007}
2006 2008
2007/** 2009/**
2010 * return true if IOC is disabled
2011 */
2012bool
2013bfa_nw_ioc_is_disabled(struct bfa_ioc *ioc)
2014{
2015 return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabling) ||
2016 bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabled);
2017}
2018
2019/**
2008 * Add to IOC heartbeat failure notification queue. To be used by common 2020 * Add to IOC heartbeat failure notification queue. To be used by common
2009 * modules such as cee, port, diag. 2021 * modules such as cee, port, diag.
2010 */ 2022 */
2011void 2023void
2012bfa_nw_ioc_hbfail_register(struct bfa_ioc *ioc, 2024bfa_nw_ioc_notify_register(struct bfa_ioc *ioc,
2013 struct bfa_ioc_hbfail_notify *notify) 2025 struct bfa_ioc_notify *notify)
2014{ 2026{
2015 list_add_tail(&notify->qe, &ioc->hb_notify_q); 2027 list_add_tail(&notify->qe, &ioc->notify_q);
2016} 2028}
2017 2029
2018#define BFA_MFG_NAME "Brocade" 2030#define BFA_MFG_NAME "Brocade"