Lines Matching +full:pa +full:- +full:stats

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Linux network driver for QLogic BR-series Converged Network Adapter.
6 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
7 * Copyright (c) 2014-2015 QLogic Corporation
23 bfa_cee_format_lldp_cfg(&cee_cfg->lldp_remote); in bfa_cee_format_cee_cfg()
27 bfa_cee_stats_swap(struct bfa_cee_stats *stats) in bfa_cee_stats_swap() argument
29 u32 *buffer = (u32 *)stats; in bfa_cee_stats_swap()
41 lldp_cfg->time_to_live = in bfa_cee_format_lldp_cfg()
42 ntohs(lldp_cfg->time_to_live); in bfa_cee_format_lldp_cfg()
43 lldp_cfg->enabled_system_cap = in bfa_cee_format_lldp_cfg()
44 ntohs(lldp_cfg->enabled_system_cap); in bfa_cee_format_lldp_cfg()
48 * bfa_cee_attr_meminfo - Returns the size of the DMA memory needed by CEE attributes
56 * bfa_cee_stats_meminfo - Returns the size of the DMA memory needed by CEE stats
65 * bfa_cee_get_attr_isr - CEE ISR for get-attributes responses from f/w
73 cee->get_attr_status = status; in bfa_cee_get_attr_isr()
75 memcpy(cee->attr, cee->attr_dma.kva, in bfa_cee_get_attr_isr()
77 bfa_cee_format_cee_cfg(cee->attr); in bfa_cee_get_attr_isr()
79 cee->get_attr_pending = false; in bfa_cee_get_attr_isr()
80 if (cee->cbfn.get_attr_cbfn) in bfa_cee_get_attr_isr()
81 cee->cbfn.get_attr_cbfn(cee->cbfn.get_attr_cbarg, status); in bfa_cee_get_attr_isr()
85 * bfa_cee_get_stats_isr - CEE ISR for get-stats responses from f/w
93 cee->get_stats_status = status; in bfa_cee_get_stats_isr()
95 memcpy(cee->stats, cee->stats_dma.kva, in bfa_cee_get_stats_isr()
97 bfa_cee_stats_swap(cee->stats); in bfa_cee_get_stats_isr()
99 cee->get_stats_pending = false; in bfa_cee_get_stats_isr()
100 if (cee->cbfn.get_stats_cbfn) in bfa_cee_get_stats_isr()
101 cee->cbfn.get_stats_cbfn(cee->cbfn.get_stats_cbarg, status); in bfa_cee_get_stats_isr()
105 * bfa_cee_reset_stats_isr - CEE ISR for reset-stats responses from f/w
113 cee->reset_stats_status = status; in bfa_cee_reset_stats_isr()
114 cee->reset_stats_pending = false; in bfa_cee_reset_stats_isr()
115 if (cee->cbfn.reset_stats_cbfn) in bfa_cee_reset_stats_isr()
116 cee->cbfn.reset_stats_cbfn(cee->cbfn.reset_stats_cbarg, status); in bfa_cee_reset_stats_isr()
119 * bfa_nw_cee_meminfo - Returns the size of the DMA memory needed by CEE module
128 * bfa_nw_cee_mem_claim - Initialized CEE DMA Memory
137 cee->attr_dma.kva = dma_kva; in bfa_nw_cee_mem_claim()
138 cee->attr_dma.pa = dma_pa; in bfa_nw_cee_mem_claim()
139 cee->stats_dma.kva = dma_kva + bfa_cee_attr_meminfo(); in bfa_nw_cee_mem_claim()
140 cee->stats_dma.pa = dma_pa + bfa_cee_attr_meminfo(); in bfa_nw_cee_mem_claim()
141 cee->attr = (struct bfa_cee_attr *) dma_kva; in bfa_nw_cee_mem_claim()
142 cee->stats = (struct bfa_cee_stats *) in bfa_nw_cee_mem_claim()
147 * bfa_nw_cee_get_attr - Send the request to the f/w to fetch CEE attributes.
162 BUG_ON(!((cee != NULL) && (cee->ioc != NULL))); in bfa_nw_cee_get_attr()
163 if (!bfa_nw_ioc_is_operational(cee->ioc)) in bfa_nw_cee_get_attr()
166 if (cee->get_attr_pending) in bfa_nw_cee_get_attr()
169 cee->get_attr_pending = true; in bfa_nw_cee_get_attr()
170 cmd = (struct bfi_cee_get_req *) cee->get_cfg_mb.msg; in bfa_nw_cee_get_attr()
171 cee->attr = attr; in bfa_nw_cee_get_attr()
172 cee->cbfn.get_attr_cbfn = cbfn; in bfa_nw_cee_get_attr()
173 cee->cbfn.get_attr_cbarg = cbarg; in bfa_nw_cee_get_attr()
174 bfi_h2i_set(cmd->mh, BFI_MC_CEE, BFI_CEE_H2I_GET_CFG_REQ, in bfa_nw_cee_get_attr()
175 bfa_ioc_portid(cee->ioc)); in bfa_nw_cee_get_attr()
176 bfa_dma_be_addr_set(cmd->dma_addr, cee->attr_dma.pa); in bfa_nw_cee_get_attr()
177 bfa_nw_ioc_mbox_queue(cee->ioc, &cee->get_cfg_mb, NULL, NULL); in bfa_nw_cee_get_attr()
183 * bfa_cee_isr - Handles Mail-box interrupts for CEE module.
196 switch (msg->mh.msg_id) { in bfa_cee_isr()
198 bfa_cee_get_attr_isr(cee, get_rsp->cmd_status); in bfa_cee_isr()
201 bfa_cee_get_stats_isr(cee, get_rsp->cmd_status); in bfa_cee_isr()
204 bfa_cee_reset_stats_isr(cee, get_rsp->cmd_status); in bfa_cee_isr()
212 * bfa_cee_notify - CEE module heart-beat failure handler.
227 if (cee->get_attr_pending) { in bfa_cee_notify()
228 cee->get_attr_status = BFA_STATUS_FAILED; in bfa_cee_notify()
229 cee->get_attr_pending = false; in bfa_cee_notify()
230 if (cee->cbfn.get_attr_cbfn) { in bfa_cee_notify()
231 cee->cbfn.get_attr_cbfn( in bfa_cee_notify()
232 cee->cbfn.get_attr_cbarg, in bfa_cee_notify()
236 if (cee->get_stats_pending) { in bfa_cee_notify()
237 cee->get_stats_status = BFA_STATUS_FAILED; in bfa_cee_notify()
238 cee->get_stats_pending = false; in bfa_cee_notify()
239 if (cee->cbfn.get_stats_cbfn) { in bfa_cee_notify()
240 cee->cbfn.get_stats_cbfn( in bfa_cee_notify()
241 cee->cbfn.get_stats_cbarg, in bfa_cee_notify()
245 if (cee->reset_stats_pending) { in bfa_cee_notify()
246 cee->reset_stats_status = BFA_STATUS_FAILED; in bfa_cee_notify()
247 cee->reset_stats_pending = false; in bfa_cee_notify()
248 if (cee->cbfn.reset_stats_cbfn) { in bfa_cee_notify()
249 cee->cbfn.reset_stats_cbfn( in bfa_cee_notify()
250 cee->cbfn.reset_stats_cbarg, in bfa_cee_notify()
262 * bfa_nw_cee_attach - CEE module-attach API
275 cee->dev = dev; in bfa_nw_cee_attach()
276 cee->ioc = ioc; in bfa_nw_cee_attach()
278 bfa_nw_ioc_mbox_regisr(cee->ioc, BFI_MC_CEE, bfa_cee_isr, cee); in bfa_nw_cee_attach()
279 bfa_ioc_notify_init(&cee->ioc_notify, bfa_cee_notify, cee); in bfa_nw_cee_attach()
280 bfa_nw_ioc_notify_register(cee->ioc, &cee->ioc_notify); in bfa_nw_cee_attach()