bfa_defs_qos.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_QOS_H__
  18. #define __BFA_DEFS_QOS_H__
  19. /**
  20. * QoS states
  21. */
  22. enum bfa_qos_state {
  23. BFA_QOS_ONLINE = 1, /* QoS is online */
  24. BFA_QOS_OFFLINE = 2, /* QoS is offline */
  25. };
  26. /**
  27. * QoS Priority levels.
  28. */
  29. enum bfa_qos_priority {
  30. BFA_QOS_UNKNOWN = 0,
  31. BFA_QOS_HIGH = 1, /* QoS Priority Level High */
  32. BFA_QOS_MED = 2, /* QoS Priority Level Medium */
  33. BFA_QOS_LOW = 3, /* QoS Priority Level Low */
  34. };
  35. /**
  36. * QoS bandwidth allocation for each priority level
  37. */
  38. enum bfa_qos_bw_alloc {
  39. BFA_QOS_BW_HIGH = 60, /* bandwidth allocation for High */
  40. BFA_QOS_BW_MED = 30, /* bandwidth allocation for Medium */
  41. BFA_QOS_BW_LOW = 10, /* bandwidth allocation for Low */
  42. };
  43. /**
  44. * QoS attribute returned in QoS Query
  45. */
  46. struct bfa_qos_attr_s {
  47. enum bfa_qos_state state; /* QoS current state */
  48. u32 total_bb_cr; /* Total BB Credits */
  49. };
  50. /**
  51. * These fields should be displayed only from the CLI.
  52. * There will be a separate BFAL API (get_qos_vc_attr ?)
  53. * to retrieve this.
  54. *
  55. */
  56. #define BFA_QOS_MAX_VC 16
  57. struct bfa_qos_vc_info_s {
  58. u8 vc_credit;
  59. u8 borrow_credit;
  60. u8 priority;
  61. u8 resvd;
  62. };
  63. struct bfa_qos_vc_attr_s {
  64. u16 total_vc_count; /* Total VC Count */
  65. u16 shared_credit;
  66. u32 elp_opmode_flags;
  67. struct bfa_qos_vc_info_s vc_info[BFA_QOS_MAX_VC]; /* as many as
  68. * total_vc_count */
  69. };
  70. /**
  71. * QoS statistics
  72. */
  73. struct bfa_qos_stats_s {
  74. u32 flogi_sent; /* QoS Flogi sent */
  75. u32 flogi_acc_recvd; /* QoS Flogi Acc received */
  76. u32 flogi_rjt_recvd; /* QoS Flogi rejects received */
  77. u32 flogi_retries; /* QoS Flogi retries */
  78. u32 elp_recvd; /* QoS ELP received */
  79. u32 elp_accepted; /* QoS ELP Accepted */
  80. u32 elp_rejected; /* QoS ELP rejected */
  81. u32 elp_dropped; /* QoS ELP dropped */
  82. u32 qos_rscn_recvd; /* QoS RSCN received */
  83. u32 rsvd; /* padding for 64 bit alignment */
  84. };
  85. #endif /* __BFA_DEFS_QOS_H__ */