bnx2x_vfpf.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /* bnx2x_vfpf.h: Broadcom Everest network driver.
  2. *
  3. * Copyright (c) 2011-2012 Broadcom Corporation
  4. *
  5. * Unless you and Broadcom execute a separate written software license
  6. * agreement governing use of this software, this software is licensed to you
  7. * under the terms of the GNU General Public License version 2, available
  8. * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL").
  9. *
  10. * Notwithstanding the above, under no circumstances may you combine this
  11. * software in any way with any other Broadcom software provided under a
  12. * license other than the GPL, without Broadcom's express prior written
  13. * consent.
  14. *
  15. * Maintained by: Eilon Greenstein <eilong@broadcom.com>
  16. * Written by: Ariel Elior <ariele@broadcom.com>
  17. */
  18. #ifndef VF_PF_IF_H
  19. #define VF_PF_IF_H
  20. /* Common definitions for all HVs */
  21. struct vf_pf_resc_request {
  22. u8 num_rxqs;
  23. u8 num_txqs;
  24. u8 num_sbs;
  25. u8 num_mac_filters;
  26. u8 num_vlan_filters;
  27. u8 num_mc_filters; /* No limit so superfluous */
  28. };
  29. struct hw_sb_info {
  30. u8 hw_sb_id; /* aka absolute igu id, used to ack the sb */
  31. u8 sb_qid; /* used to update DHC for sb */
  32. };
  33. /* HW VF-PF channel definitions
  34. * A.K.A VF-PF mailbox
  35. */
  36. #define TLV_BUFFER_SIZE 1024
  37. enum {
  38. PFVF_STATUS_WAITING = 0,
  39. PFVF_STATUS_SUCCESS,
  40. PFVF_STATUS_FAILURE,
  41. PFVF_STATUS_NOT_SUPPORTED,
  42. PFVF_STATUS_NO_RESOURCE
  43. };
  44. /* vf pf channel tlvs */
  45. /* general tlv header (used for both vf->pf request and pf->vf response) */
  46. struct channel_tlv {
  47. u16 type;
  48. u16 length;
  49. };
  50. /* header of first vf->pf tlv carries the offset used to calculate response
  51. * buffer address
  52. */
  53. struct vfpf_first_tlv {
  54. struct channel_tlv tl;
  55. u32 resp_msg_offset;
  56. };
  57. /* header of pf->vf tlvs, carries the status of handling the request */
  58. struct pfvf_tlv {
  59. struct channel_tlv tl;
  60. u8 status;
  61. u8 padding[3];
  62. };
  63. /* used to terminate and pad a tlv list */
  64. struct channel_list_end_tlv {
  65. struct channel_tlv tl;
  66. u8 padding[4];
  67. };
  68. /* Acquire */
  69. struct vfpf_acquire_tlv {
  70. struct vfpf_first_tlv first_tlv;
  71. struct vf_pf_vfdev_info {
  72. /* the following fields are for debug purposes */
  73. u8 vf_id; /* ME register value */
  74. u8 vf_os; /* e.g. Linux, W2K8 */
  75. u8 padding[2];
  76. } vfdev_info;
  77. struct vf_pf_resc_request resc_request;
  78. aligned_u64 bulletin_addr;
  79. };
  80. /* acquire response tlv - carries the allocated resources */
  81. struct pfvf_acquire_resp_tlv {
  82. struct pfvf_tlv hdr;
  83. struct pf_vf_pfdev_info {
  84. u32 chip_num;
  85. u32 pf_cap;
  86. #define PFVF_CAP_RSS 0x00000001
  87. #define PFVF_CAP_DHC 0x00000002
  88. #define PFVF_CAP_TPA 0x00000004
  89. char fw_ver[32];
  90. u16 db_size;
  91. u8 indices_per_sb;
  92. u8 padding;
  93. } pfdev_info;
  94. struct pf_vf_resc {
  95. /* in case of status NO_RESOURCE in message hdr, pf will fill
  96. * this struct with suggested amount of resources for next
  97. * acquire request
  98. */
  99. #define PFVF_MAX_QUEUES_PER_VF 16
  100. #define PFVF_MAX_SBS_PER_VF 16
  101. struct hw_sb_info hw_sbs[PFVF_MAX_SBS_PER_VF];
  102. u8 hw_qid[PFVF_MAX_QUEUES_PER_VF];
  103. u8 num_rxqs;
  104. u8 num_txqs;
  105. u8 num_sbs;
  106. u8 num_mac_filters;
  107. u8 num_vlan_filters;
  108. u8 num_mc_filters;
  109. u8 permanent_mac_addr[ETH_ALEN];
  110. u8 current_mac_addr[ETH_ALEN];
  111. u8 padding[2];
  112. } resc;
  113. };
  114. struct tlv_buffer_size {
  115. u8 tlv_buffer[TLV_BUFFER_SIZE];
  116. };
  117. union vfpf_tlvs {
  118. struct vfpf_first_tlv first_tlv;
  119. struct vfpf_acquire_tlv acquire;
  120. struct channel_list_end_tlv list_end;
  121. struct tlv_buffer_size tlv_buf_size;
  122. };
  123. union pfvf_tlvs {
  124. struct pfvf_acquire_resp_tlv acquire_resp;
  125. struct channel_list_end_tlv list_end;
  126. struct tlv_buffer_size tlv_buf_size;
  127. };
  128. #define MAX_TLVS_IN_LIST 50
  129. enum channel_tlvs {
  130. CHANNEL_TLV_NONE,
  131. CHANNEL_TLV_ACQUIRE,
  132. CHANNEL_TLV_LIST_END,
  133. CHANNEL_TLV_MAX
  134. };
  135. #endif /* VF_PF_IF_H */