Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. |
| 3 | * All rights reserved |
| 4 | * www.brocade.com |
| 5 | * |
| 6 | * Linux driver for Brocade Fibre Channel Host Bus Adapter. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License (GPL) Version 2 as |
| 10 | * published by the Free Software Foundation |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | */ |
| 17 | |
| 18 | #ifndef __BFA_PORT_H__ |
| 19 | #define __BFA_PORT_H__ |
| 20 | |
| 21 | #include "bfa_defs_svc.h" |
| 22 | #include "bfa_ioc.h" |
| 23 | #include "bfa_cs.h" |
| 24 | |
| 25 | typedef void (*bfa_port_stats_cbfn_t) (void *dev, bfa_status_t status); |
| 26 | typedef void (*bfa_port_endis_cbfn_t) (void *dev, bfa_status_t status); |
| 27 | |
| 28 | struct bfa_port_s { |
| 29 | void *dev; |
| 30 | struct bfa_ioc_s *ioc; |
| 31 | struct bfa_trc_mod_s *trcmod; |
| 32 | u32 msgtag; |
| 33 | bfa_boolean_t stats_busy; |
| 34 | struct bfa_mbox_cmd_s stats_mb; |
| 35 | bfa_port_stats_cbfn_t stats_cbfn; |
| 36 | void *stats_cbarg; |
| 37 | bfa_status_t stats_status; |
| 38 | u32 stats_reset_time; |
| 39 | union bfa_port_stats_u *stats; |
| 40 | struct bfa_dma_s stats_dma; |
| 41 | bfa_boolean_t endis_pending; |
| 42 | struct bfa_mbox_cmd_s endis_mb; |
| 43 | bfa_port_endis_cbfn_t endis_cbfn; |
| 44 | void *endis_cbarg; |
| 45 | bfa_status_t endis_status; |
Krishna Gudipati | d37779f | 2011-06-13 15:42:10 -0700 | [diff] [blame] | 46 | struct bfa_ioc_notify_s ioc_notify; |
Krishna Gudipati | 43ffdf4 | 2011-06-13 15:46:21 -0700 | [diff] [blame] | 47 | bfa_boolean_t pbc_disabled; |
Krishna Gudipati | 4507025 | 2011-06-24 20:24:29 -0700 | [diff] [blame] | 48 | struct bfa_mem_dma_s port_dma; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
Krishna Gudipati | 4507025 | 2011-06-24 20:24:29 -0700 | [diff] [blame] | 51 | #define BFA_MEM_PORT_DMA(__bfa) (&((__bfa)->modules.port.port_dma)) |
| 52 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 53 | void bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, |
| 54 | void *dev, struct bfa_trc_mod_s *trcmod); |
Krishna Gudipati | d37779f | 2011-06-13 15:42:10 -0700 | [diff] [blame] | 55 | void bfa_port_notify(void *arg, enum bfa_ioc_event_e event); |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 56 | |
| 57 | bfa_status_t bfa_port_get_stats(struct bfa_port_s *port, |
| 58 | union bfa_port_stats_u *stats, |
| 59 | bfa_port_stats_cbfn_t cbfn, void *cbarg); |
| 60 | bfa_status_t bfa_port_clear_stats(struct bfa_port_s *port, |
| 61 | bfa_port_stats_cbfn_t cbfn, void *cbarg); |
| 62 | bfa_status_t bfa_port_enable(struct bfa_port_s *port, |
| 63 | bfa_port_endis_cbfn_t cbfn, void *cbarg); |
| 64 | bfa_status_t bfa_port_disable(struct bfa_port_s *port, |
| 65 | bfa_port_endis_cbfn_t cbfn, void *cbarg); |
| 66 | u32 bfa_port_meminfo(void); |
| 67 | void bfa_port_mem_claim(struct bfa_port_s *port, |
| 68 | u8 *dma_kva, u64 dma_pa); |
| 69 | #endif /* __BFA_PORT_H__ */ |