bfa_cee.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (c) 2005-2009 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_CEE_H__
  18. #define __BFA_CEE_H__
  19. #include <defs/bfa_defs_cee.h>
  20. #include <bfa_ioc.h>
  21. #include <cs/bfa_trc.h>
  22. #include <cs/bfa_log.h>
  23. typedef void (*bfa_cee_get_attr_cbfn_t) (void *dev, bfa_status_t status);
  24. typedef void (*bfa_cee_get_stats_cbfn_t) (void *dev, bfa_status_t status);
  25. typedef void (*bfa_cee_reset_stats_cbfn_t) (void *dev, bfa_status_t status);
  26. typedef void (*bfa_cee_hbfail_cbfn_t) (void *dev, bfa_status_t status);
  27. struct bfa_cee_cbfn_s {
  28. bfa_cee_get_attr_cbfn_t get_attr_cbfn;
  29. void *get_attr_cbarg;
  30. bfa_cee_get_stats_cbfn_t get_stats_cbfn;
  31. void *get_stats_cbarg;
  32. bfa_cee_reset_stats_cbfn_t reset_stats_cbfn;
  33. void *reset_stats_cbarg;
  34. };
  35. struct bfa_cee_s {
  36. void *dev;
  37. bfa_boolean_t get_attr_pending;
  38. bfa_boolean_t get_stats_pending;
  39. bfa_boolean_t reset_stats_pending;
  40. bfa_status_t get_attr_status;
  41. bfa_status_t get_stats_status;
  42. bfa_status_t reset_stats_status;
  43. struct bfa_cee_cbfn_s cbfn;
  44. struct bfa_ioc_hbfail_notify_s hbfail;
  45. struct bfa_trc_mod_s *trcmod;
  46. struct bfa_log_mod_s *logmod;
  47. struct bfa_cee_attr_s *attr;
  48. struct bfa_cee_stats_s *stats;
  49. struct bfa_dma_s attr_dma;
  50. struct bfa_dma_s stats_dma;
  51. struct bfa_ioc_s *ioc;
  52. struct bfa_mbox_cmd_s get_cfg_mb;
  53. struct bfa_mbox_cmd_s get_stats_mb;
  54. struct bfa_mbox_cmd_s reset_stats_mb;
  55. };
  56. u32 bfa_cee_meminfo(void);
  57. void bfa_cee_mem_claim(struct bfa_cee_s *cee, u8 *dma_kva,
  58. u64 dma_pa);
  59. void bfa_cee_attach(struct bfa_cee_s *cee, struct bfa_ioc_s *ioc, void *dev,
  60. struct bfa_trc_mod_s *trcmod,
  61. struct bfa_log_mod_s *logmod);
  62. void bfa_cee_detach(struct bfa_cee_s *cee);
  63. bfa_status_t bfa_cee_get_attr(struct bfa_cee_s *cee,
  64. struct bfa_cee_attr_s *attr,
  65. bfa_cee_get_attr_cbfn_t cbfn, void *cbarg);
  66. bfa_status_t bfa_cee_get_stats(struct bfa_cee_s *cee,
  67. struct bfa_cee_stats_s *stats,
  68. bfa_cee_get_stats_cbfn_t cbfn, void *cbarg);
  69. bfa_status_t bfa_cee_reset_stats(struct bfa_cee_s *cee,
  70. bfa_cee_reset_stats_cbfn_t cbfn, void *cbarg);
  71. #endif /* __BFA_CEE_H__ */