bfa_fcs.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_FCS_H__
  18. #define __BFA_FCS_H__
  19. #include <cs/bfa_debug.h>
  20. #include <defs/bfa_defs_status.h>
  21. #include <defs/bfa_defs_version.h>
  22. #include <bfa.h>
  23. #include <fcs/bfa_fcs_fabric.h>
  24. #define BFA_FCS_OS_STR_LEN 64
  25. struct bfa_fcs_stats_s {
  26. struct {
  27. u32 untagged; /* untagged receive frames */
  28. u32 tagged; /* tagged receive frames */
  29. u32 vfid_unknown; /* VF id is unknown */
  30. } uf;
  31. };
  32. struct bfa_fcs_driver_info_s {
  33. u8 version[BFA_VERSION_LEN]; /* Driver Version */
  34. u8 host_machine_name[BFA_FCS_OS_STR_LEN];
  35. u8 host_os_name[BFA_FCS_OS_STR_LEN]; /* OS name and version */
  36. u8 host_os_patch[BFA_FCS_OS_STR_LEN];/* patch or service pack */
  37. u8 os_device_name[BFA_FCS_OS_STR_LEN]; /* Driver Device Name */
  38. };
  39. struct bfa_fcs_s {
  40. struct bfa_s *bfa; /* corresponding BFA bfa instance */
  41. struct bfad_s *bfad; /* corresponding BDA driver instance */
  42. struct bfa_log_mod_s *logm; /* driver logging module instance */
  43. struct bfa_trc_mod_s *trcmod; /* tracing module */
  44. struct bfa_aen_s *aen; /* aen component */
  45. bfa_boolean_t vf_enabled; /* VF mode is enabled */
  46. bfa_boolean_t min_cfg; /* min cfg enabled/disabled */
  47. u16 port_vfid; /* port default VF ID */
  48. struct bfa_fcs_driver_info_s driver_info;
  49. struct bfa_fcs_fabric_s fabric; /* base fabric state machine */
  50. struct bfa_fcs_stats_s stats; /* FCS statistics */
  51. struct bfa_wc_s wc; /* waiting counter */
  52. };
  53. /*
  54. * bfa fcs API functions
  55. */
  56. void bfa_fcs_init(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
  57. bfa_boolean_t min_cfg);
  58. void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
  59. struct bfa_fcs_driver_info_s *driver_info);
  60. void bfa_fcs_exit(struct bfa_fcs_s *fcs);
  61. void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod);
  62. void bfa_fcs_log_init(struct bfa_fcs_s *fcs, struct bfa_log_mod_s *logmod);
  63. void bfa_fcs_aen_init(struct bfa_fcs_s *fcs, struct bfa_aen_s *aen);
  64. void bfa_fcs_start(struct bfa_fcs_s *fcs);
  65. #endif /* __BFA_FCS_H__ */