bfa_port.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #ifndef __BFA_PORT_H__
  18. #define __BFA_PORT_H__
  19. #include "bfa_defs_svc.h"
  20. #include "bfa_ioc.h"
  21. #include "bfa_cs.h"
  22. typedef void (*bfa_port_stats_cbfn_t) (void *dev, bfa_status_t status);
  23. typedef void (*bfa_port_endis_cbfn_t) (void *dev, bfa_status_t status);
  24. struct bfa_port_s {
  25. void *dev;
  26. struct bfa_ioc_s *ioc;
  27. struct bfa_trc_mod_s *trcmod;
  28. u32 msgtag;
  29. bfa_boolean_t stats_busy;
  30. struct bfa_mbox_cmd_s stats_mb;
  31. bfa_port_stats_cbfn_t stats_cbfn;
  32. void *stats_cbarg;
  33. bfa_status_t stats_status;
  34. u32 stats_reset_time;
  35. union bfa_port_stats_u *stats;
  36. struct bfa_dma_s stats_dma;
  37. bfa_boolean_t endis_pending;
  38. struct bfa_mbox_cmd_s endis_mb;
  39. bfa_port_endis_cbfn_t endis_cbfn;
  40. void *endis_cbarg;
  41. bfa_status_t endis_status;
  42. struct bfa_ioc_hbfail_notify_s hbfail;
  43. };
  44. void bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
  45. void *dev, struct bfa_trc_mod_s *trcmod);
  46. void bfa_port_hbfail(void *arg);
  47. bfa_status_t bfa_port_get_stats(struct bfa_port_s *port,
  48. union bfa_port_stats_u *stats,
  49. bfa_port_stats_cbfn_t cbfn, void *cbarg);
  50. bfa_status_t bfa_port_clear_stats(struct bfa_port_s *port,
  51. bfa_port_stats_cbfn_t cbfn, void *cbarg);
  52. bfa_status_t bfa_port_enable(struct bfa_port_s *port,
  53. bfa_port_endis_cbfn_t cbfn, void *cbarg);
  54. bfa_status_t bfa_port_disable(struct bfa_port_s *port,
  55. bfa_port_endis_cbfn_t cbfn, void *cbarg);
  56. u32 bfa_port_meminfo(void);
  57. void bfa_port_mem_claim(struct bfa_port_s *port,
  58. u8 *dma_kva, u64 dma_pa);
  59. #endif /* __BFA_PORT_H__ */