bfa_defs_ioc.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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_DEFS_IOC_H__
  18. #define __BFA_DEFS_IOC_H__
  19. #include <protocol/types.h>
  20. #include <defs/bfa_defs_types.h>
  21. #include <defs/bfa_defs_version.h>
  22. #include <defs/bfa_defs_adapter.h>
  23. #include <defs/bfa_defs_pm.h>
  24. enum {
  25. BFA_IOC_DRIVER_LEN = 16,
  26. BFA_IOC_CHIP_REV_LEN = 8,
  27. };
  28. /**
  29. * Driver and firmware versions.
  30. */
  31. struct bfa_ioc_driver_attr_s {
  32. char driver[BFA_IOC_DRIVER_LEN]; /* driver name */
  33. char driver_ver[BFA_VERSION_LEN]; /* driver version */
  34. char fw_ver[BFA_VERSION_LEN]; /* firmware version*/
  35. char bios_ver[BFA_VERSION_LEN]; /* bios version */
  36. char efi_ver[BFA_VERSION_LEN]; /* EFI version */
  37. char ob_ver[BFA_VERSION_LEN]; /* openboot version*/
  38. };
  39. /**
  40. * IOC PCI device attributes
  41. */
  42. struct bfa_ioc_pci_attr_s {
  43. u16 vendor_id; /* PCI vendor ID */
  44. u16 device_id; /* PCI device ID */
  45. u16 ssid; /* subsystem ID */
  46. u16 ssvid; /* subsystem vendor ID */
  47. u32 pcifn; /* PCI device function */
  48. u32 rsvd; /* padding */
  49. u8 chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
  50. };
  51. /**
  52. * IOC states
  53. */
  54. enum bfa_ioc_state {
  55. BFA_IOC_RESET = 1, /* IOC is in reset state */
  56. BFA_IOC_SEMWAIT = 2, /* Waiting for IOC hardware semaphore */
  57. BFA_IOC_HWINIT = 3, /* IOC hardware is being initialized */
  58. BFA_IOC_GETATTR = 4, /* IOC is being configured */
  59. BFA_IOC_OPERATIONAL = 5, /* IOC is operational */
  60. BFA_IOC_INITFAIL = 6, /* IOC hardware failure */
  61. BFA_IOC_HBFAIL = 7, /* IOC heart-beat failure */
  62. BFA_IOC_DISABLING = 8, /* IOC is being disabled */
  63. BFA_IOC_DISABLED = 9, /* IOC is disabled */
  64. BFA_IOC_FWMISMATCH = 10, /* IOC firmware different from drivers */
  65. };
  66. /**
  67. * IOC firmware stats
  68. */
  69. struct bfa_fw_ioc_stats_s {
  70. u32 hb_count;
  71. u32 cfg_reqs;
  72. u32 enable_reqs;
  73. u32 disable_reqs;
  74. u32 stats_reqs;
  75. u32 clrstats_reqs;
  76. u32 unknown_reqs;
  77. u32 ic_reqs; /* interrupt coalesce reqs */
  78. };
  79. /**
  80. * IOC driver stats
  81. */
  82. struct bfa_ioc_drv_stats_s {
  83. u32 ioc_isrs;
  84. u32 ioc_enables;
  85. u32 ioc_disables;
  86. u32 ioc_hbfails;
  87. u32 ioc_boots;
  88. u32 stats_tmos;
  89. u32 hb_count;
  90. u32 disable_reqs;
  91. u32 enable_reqs;
  92. u32 disable_replies;
  93. u32 enable_replies;
  94. };
  95. /**
  96. * IOC statistics
  97. */
  98. struct bfa_ioc_stats_s {
  99. struct bfa_ioc_drv_stats_s drv_stats; /* driver IOC stats */
  100. struct bfa_fw_ioc_stats_s fw_stats; /* firmware IOC stats */
  101. };
  102. enum bfa_ioc_type_e {
  103. BFA_IOC_TYPE_FC = 1,
  104. BFA_IOC_TYPE_FCoE = 2,
  105. BFA_IOC_TYPE_LL = 3,
  106. };
  107. /**
  108. * IOC attributes returned in queries
  109. */
  110. struct bfa_ioc_attr_s {
  111. enum bfa_ioc_type_e ioc_type;
  112. enum bfa_ioc_state state; /* IOC state */
  113. struct bfa_adapter_attr_s adapter_attr; /* HBA attributes */
  114. struct bfa_ioc_driver_attr_s driver_attr; /* driver attr */
  115. struct bfa_ioc_pci_attr_s pci_attr;
  116. u8 port_id; /* port number */
  117. };
  118. /**
  119. * BFA IOC level events
  120. */
  121. enum bfa_ioc_aen_event {
  122. BFA_IOC_AEN_HBGOOD = 1, /* Heart Beat restore event */
  123. BFA_IOC_AEN_HBFAIL = 2, /* Heart Beat failure event */
  124. BFA_IOC_AEN_ENABLE = 3, /* IOC enabled event */
  125. BFA_IOC_AEN_DISABLE = 4, /* IOC disabled event */
  126. BFA_IOC_AEN_FWMISMATCH = 5, /* IOC firmware mismatch */
  127. };
  128. /**
  129. * BFA IOC level event data, now just a place holder
  130. */
  131. struct bfa_ioc_aen_data_s {
  132. enum bfa_ioc_type_e ioc_type;
  133. wwn_t pwwn;
  134. mac_t mac;
  135. };
  136. #endif /* __BFA_DEFS_IOC_H__ */