bfa_cee.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Linux network driver for Brocade Converged Network Adapter.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License (GPL) Version 2 as
  6. * published by the Free Software Foundation
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. */
  13. /*
  14. * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
  15. * All rights reserved
  16. * www.brocade.com
  17. */
  18. #ifndef __BFA_CEE_H__
  19. #define __BFA_CEE_H__
  20. #include "bfa_defs_cna.h"
  21. #include "bfa_ioc.h"
  22. typedef void (*bfa_cee_get_attr_cbfn_t) (void *dev, enum bfa_status status);
  23. typedef void (*bfa_cee_get_stats_cbfn_t) (void *dev, enum bfa_status status);
  24. typedef void (*bfa_cee_reset_stats_cbfn_t) (void *dev, enum bfa_status status);
  25. struct bfa_cee_cbfn {
  26. bfa_cee_get_attr_cbfn_t get_attr_cbfn;
  27. void *get_attr_cbarg;
  28. bfa_cee_get_stats_cbfn_t get_stats_cbfn;
  29. void *get_stats_cbarg;
  30. bfa_cee_reset_stats_cbfn_t reset_stats_cbfn;
  31. void *reset_stats_cbarg;
  32. };
  33. struct bfa_cee {
  34. void *dev;
  35. bool get_attr_pending;
  36. bool get_stats_pending;
  37. bool reset_stats_pending;
  38. enum bfa_status get_attr_status;
  39. enum bfa_status get_stats_status;
  40. enum bfa_status reset_stats_status;
  41. struct bfa_cee_cbfn cbfn;
  42. struct bfa_ioc_notify ioc_notify;
  43. struct bfa_cee_attr *attr;
  44. struct bfa_cee_stats *stats;
  45. struct bfa_dma attr_dma;
  46. struct bfa_dma stats_dma;
  47. struct bfa_ioc *ioc;
  48. struct bfa_mbox_cmd get_cfg_mb;
  49. struct bfa_mbox_cmd get_stats_mb;
  50. struct bfa_mbox_cmd reset_stats_mb;
  51. };
  52. u32 bfa_nw_cee_meminfo(void);
  53. void bfa_nw_cee_mem_claim(struct bfa_cee *cee, u8 *dma_kva,
  54. u64 dma_pa);
  55. void bfa_nw_cee_attach(struct bfa_cee *cee, struct bfa_ioc *ioc, void *dev);
  56. enum bfa_status bfa_nw_cee_get_attr(struct bfa_cee *cee,
  57. struct bfa_cee_attr *attr,
  58. bfa_cee_get_attr_cbfn_t cbfn, void *cbarg);
  59. #endif /* __BFA_CEE_H__ */