Lines Matching full:port

18 BFA_TRC_FILE(CNA, PORT);
21 bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats) in bfa_port_stats_swap() argument
45 * @param[in] port - Pointer to the port module
51 bfa_port_enable_isr(struct bfa_port_s *port, bfa_status_t status) in bfa_port_enable_isr() argument
53 bfa_trc(port, status); in bfa_port_enable_isr()
54 port->endis_pending = BFA_FALSE; in bfa_port_enable_isr()
55 port->endis_cbfn(port->endis_cbarg, status); in bfa_port_enable_isr()
62 * @param[in] port - Pointer to the port module
68 bfa_port_disable_isr(struct bfa_port_s *port, bfa_status_t status) in bfa_port_disable_isr() argument
70 bfa_trc(port, status); in bfa_port_disable_isr()
71 port->endis_pending = BFA_FALSE; in bfa_port_disable_isr()
72 port->endis_cbfn(port->endis_cbarg, status); in bfa_port_disable_isr()
79 * @param[in] port - Pointer to the Port module
85 bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status) in bfa_port_get_stats_isr() argument
87 port->stats_status = status; in bfa_port_get_stats_isr()
88 port->stats_busy = BFA_FALSE; in bfa_port_get_stats_isr()
91 memcpy(port->stats, port->stats_dma.kva, in bfa_port_get_stats_isr()
93 bfa_port_stats_swap(port, port->stats); in bfa_port_get_stats_isr()
95 port->stats->fc.secs_reset = ktime_get_seconds() - port->stats_reset_time; in bfa_port_get_stats_isr()
98 if (port->stats_cbfn) { in bfa_port_get_stats_isr()
99 port->stats_cbfn(port->stats_cbarg, status); in bfa_port_get_stats_isr()
100 port->stats_cbfn = NULL; in bfa_port_get_stats_isr()
108 * @param[in] port - Pointer to the Port module
114 bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status) in bfa_port_clear_stats_isr() argument
116 port->stats_status = status; in bfa_port_clear_stats_isr()
117 port->stats_busy = BFA_FALSE; in bfa_port_clear_stats_isr()
122 port->stats_reset_time = ktime_get_seconds(); in bfa_port_clear_stats_isr()
124 if (port->stats_cbfn) { in bfa_port_clear_stats_isr()
125 port->stats_cbfn(port->stats_cbarg, status); in bfa_port_clear_stats_isr()
126 port->stats_cbfn = NULL; in bfa_port_clear_stats_isr()
134 * @param[in] Pointer to the Port module data structure.
141 struct bfa_port_s *port = (struct bfa_port_s *) cbarg; in bfa_port_isr() local
145 bfa_trc(port, m->mh.msg_id); in bfa_port_isr()
149 if (port->endis_pending == BFA_FALSE) in bfa_port_isr()
151 bfa_port_enable_isr(port, i2hmsg->enable_rsp.status); in bfa_port_isr()
155 if (port->endis_pending == BFA_FALSE) in bfa_port_isr()
157 bfa_port_disable_isr(port, i2hmsg->disable_rsp.status); in bfa_port_isr()
162 if (port->stats_busy == BFA_FALSE) in bfa_port_isr()
164 bfa_port_get_stats_isr(port, i2hmsg->getstats_rsp.status); in bfa_port_isr()
168 if (port->stats_busy == BFA_FALSE) in bfa_port_isr()
170 bfa_port_clear_stats_isr(port, i2hmsg->clearstats_rsp.status); in bfa_port_isr()
196 * @param[in] port Port module pointer
197 * dma_kva Kernel Virtual Address of Port DMA Memory
198 * dma_pa Physical Address of Port DMA Memory
203 bfa_port_mem_claim(struct bfa_port_s *port, u8 *dma_kva, u64 dma_pa) in bfa_port_mem_claim() argument
205 port->stats_dma.kva = dma_kva; in bfa_port_mem_claim()
206 port->stats_dma.pa = dma_pa; in bfa_port_mem_claim()
212 * Send the Port enable request to the f/w
214 * @param[in] Pointer to the Port module data structure.
219 bfa_port_enable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn, in bfa_port_enable() argument
224 /* If port is PBC disabled, return error */ in bfa_port_enable()
225 if (port->pbc_disabled) { in bfa_port_enable()
226 bfa_trc(port, BFA_STATUS_PBC); in bfa_port_enable()
230 if (bfa_ioc_is_disabled(port->ioc)) { in bfa_port_enable()
231 bfa_trc(port, BFA_STATUS_IOC_DISABLED); in bfa_port_enable()
235 if (!bfa_ioc_is_operational(port->ioc)) { in bfa_port_enable()
236 bfa_trc(port, BFA_STATUS_IOC_FAILURE); in bfa_port_enable()
240 /* if port is d-port enabled, return error */ in bfa_port_enable()
241 if (port->dport_enabled) { in bfa_port_enable()
242 bfa_trc(port, BFA_STATUS_DPORT_ERR); in bfa_port_enable()
246 if (port->endis_pending) { in bfa_port_enable()
247 bfa_trc(port, BFA_STATUS_DEVBUSY); in bfa_port_enable()
251 m = (struct bfi_port_generic_req_s *) port->endis_mb.msg; in bfa_port_enable()
253 port->msgtag++; in bfa_port_enable()
254 port->endis_cbfn = cbfn; in bfa_port_enable()
255 port->endis_cbarg = cbarg; in bfa_port_enable()
256 port->endis_pending = BFA_TRUE; in bfa_port_enable()
259 bfa_ioc_portid(port->ioc)); in bfa_port_enable()
260 bfa_ioc_mbox_queue(port->ioc, &port->endis_mb); in bfa_port_enable()
268 * Send the Port disable request to the f/w
270 * @param[in] Pointer to the Port module data structure.
275 bfa_port_disable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn, in bfa_port_disable() argument
280 /* If port is PBC disabled, return error */ in bfa_port_disable()
281 if (port->pbc_disabled) { in bfa_port_disable()
282 bfa_trc(port, BFA_STATUS_PBC); in bfa_port_disable()
286 if (bfa_ioc_is_disabled(port->ioc)) { in bfa_port_disable()
287 bfa_trc(port, BFA_STATUS_IOC_DISABLED); in bfa_port_disable()
291 if (!bfa_ioc_is_operational(port->ioc)) { in bfa_port_disable()
292 bfa_trc(port, BFA_STATUS_IOC_FAILURE); in bfa_port_disable()
296 /* if port is d-port enabled, return error */ in bfa_port_disable()
297 if (port->dport_enabled) { in bfa_port_disable()
298 bfa_trc(port, BFA_STATUS_DPORT_ERR); in bfa_port_disable()
302 if (port->endis_pending) { in bfa_port_disable()
303 bfa_trc(port, BFA_STATUS_DEVBUSY); in bfa_port_disable()
307 m = (struct bfi_port_generic_req_s *) port->endis_mb.msg; in bfa_port_disable()
309 port->msgtag++; in bfa_port_disable()
310 port->endis_cbfn = cbfn; in bfa_port_disable()
311 port->endis_cbarg = cbarg; in bfa_port_disable()
312 port->endis_pending = BFA_TRUE; in bfa_port_disable()
315 bfa_ioc_portid(port->ioc)); in bfa_port_disable()
316 bfa_ioc_mbox_queue(port->ioc, &port->endis_mb); in bfa_port_disable()
324 * Send the request to the f/w to fetch Port statistics.
326 * @param[in] Pointer to the Port module data structure.
331 bfa_port_get_stats(struct bfa_port_s *port, union bfa_port_stats_u *stats, in bfa_port_get_stats() argument
336 if (!bfa_ioc_is_operational(port->ioc)) { in bfa_port_get_stats()
337 bfa_trc(port, BFA_STATUS_IOC_FAILURE); in bfa_port_get_stats()
341 if (port->stats_busy) { in bfa_port_get_stats()
342 bfa_trc(port, BFA_STATUS_DEVBUSY); in bfa_port_get_stats()
346 m = (struct bfi_port_get_stats_req_s *) port->stats_mb.msg; in bfa_port_get_stats()
348 port->stats = stats; in bfa_port_get_stats()
349 port->stats_cbfn = cbfn; in bfa_port_get_stats()
350 port->stats_cbarg = cbarg; in bfa_port_get_stats()
351 port->stats_busy = BFA_TRUE; in bfa_port_get_stats()
352 bfa_dma_be_addr_set(m->dma_addr, port->stats_dma.pa); in bfa_port_get_stats()
355 bfa_ioc_portid(port->ioc)); in bfa_port_get_stats()
356 bfa_ioc_mbox_queue(port->ioc, &port->stats_mb); in bfa_port_get_stats()
365 * @param[in] Pointer to the Port module data structure.
370 bfa_port_clear_stats(struct bfa_port_s *port, bfa_port_stats_cbfn_t cbfn, in bfa_port_clear_stats() argument
375 if (!bfa_ioc_is_operational(port->ioc)) { in bfa_port_clear_stats()
376 bfa_trc(port, BFA_STATUS_IOC_FAILURE); in bfa_port_clear_stats()
380 if (port->stats_busy) { in bfa_port_clear_stats()
381 bfa_trc(port, BFA_STATUS_DEVBUSY); in bfa_port_clear_stats()
385 m = (struct bfi_port_generic_req_s *) port->stats_mb.msg; in bfa_port_clear_stats()
387 port->stats_cbfn = cbfn; in bfa_port_clear_stats()
388 port->stats_cbarg = cbarg; in bfa_port_clear_stats()
389 port->stats_busy = BFA_TRUE; in bfa_port_clear_stats()
392 bfa_ioc_portid(port->ioc)); in bfa_port_clear_stats()
393 bfa_ioc_mbox_queue(port->ioc, &port->stats_mb); in bfa_port_clear_stats()
401 * Port module IOC event handler
403 * @param[in] Pointer to the Port module data structure.
411 struct bfa_port_s *port = (struct bfa_port_s *) arg; in bfa_port_notify() local
417 if (port->stats_busy) { in bfa_port_notify()
418 if (port->stats_cbfn) in bfa_port_notify()
419 port->stats_cbfn(port->stats_cbarg, in bfa_port_notify()
421 port->stats_cbfn = NULL; in bfa_port_notify()
422 port->stats_busy = BFA_FALSE; in bfa_port_notify()
426 if (port->endis_pending) { in bfa_port_notify()
427 if (port->endis_cbfn) in bfa_port_notify()
428 port->endis_cbfn(port->endis_cbarg, in bfa_port_notify()
430 port->endis_cbfn = NULL; in bfa_port_notify()
431 port->endis_pending = BFA_FALSE; in bfa_port_notify()
434 /* clear D-port mode */ in bfa_port_notify()
435 if (port->dport_enabled) in bfa_port_notify()
436 bfa_port_set_dportenabled(port, BFA_FALSE); in bfa_port_notify()
447 * @param[in] port - Pointer to the Port module data structure
457 bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, in bfa_port_attach() argument
460 WARN_ON(!port); in bfa_port_attach()
462 port->dev = dev; in bfa_port_attach()
463 port->ioc = ioc; in bfa_port_attach()
464 port->trcmod = trcmod; in bfa_port_attach()
466 port->stats_busy = BFA_FALSE; in bfa_port_attach()
467 port->endis_pending = BFA_FALSE; in bfa_port_attach()
468 port->stats_cbfn = NULL; in bfa_port_attach()
469 port->endis_cbfn = NULL; in bfa_port_attach()
470 port->pbc_disabled = BFA_FALSE; in bfa_port_attach()
471 port->dport_enabled = BFA_FALSE; in bfa_port_attach()
473 bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); in bfa_port_attach()
474 bfa_q_qe_init(&port->ioc_notify); in bfa_port_attach()
475 bfa_ioc_notify_init(&port->ioc_notify, bfa_port_notify, port); in bfa_port_attach()
476 list_add_tail(&port->ioc_notify.qe, &port->ioc->notify_q); in bfa_port_attach()
481 port->stats_reset_time = ktime_get_seconds(); in bfa_port_attach()
483 bfa_trc(port, 0); in bfa_port_attach()
489 * Port module- set pbc disabled flag
491 * @param[in] port - Pointer to the Port module data structure
496 bfa_port_set_dportenabled(struct bfa_port_s *port, bfa_boolean_t enabled) in bfa_port_set_dportenabled() argument
498 port->dport_enabled = enabled; in bfa_port_set_dportenabled()