bnx2x_vfpf.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. /* response tlv used for most tlvs */
  64. struct pfvf_general_resp_tlv {
  65. struct pfvf_tlv hdr;
  66. };
  67. /* used to terminate and pad a tlv list */
  68. struct channel_list_end_tlv {
  69. struct channel_tlv tl;
  70. u8 padding[4];
  71. };
  72. /* Acquire */
  73. struct vfpf_acquire_tlv {
  74. struct vfpf_first_tlv first_tlv;
  75. struct vf_pf_vfdev_info {
  76. /* the following fields are for debug purposes */
  77. u8 vf_id; /* ME register value */
  78. u8 vf_os; /* e.g. Linux, W2K8 */
  79. u8 padding[2];
  80. } vfdev_info;
  81. struct vf_pf_resc_request resc_request;
  82. aligned_u64 bulletin_addr;
  83. };
  84. /* acquire response tlv - carries the allocated resources */
  85. struct pfvf_acquire_resp_tlv {
  86. struct pfvf_tlv hdr;
  87. struct pf_vf_pfdev_info {
  88. u32 chip_num;
  89. u32 pf_cap;
  90. #define PFVF_CAP_RSS 0x00000001
  91. #define PFVF_CAP_DHC 0x00000002
  92. #define PFVF_CAP_TPA 0x00000004
  93. char fw_ver[32];
  94. u16 db_size;
  95. u8 indices_per_sb;
  96. u8 padding;
  97. } pfdev_info;
  98. struct pf_vf_resc {
  99. /* in case of status NO_RESOURCE in message hdr, pf will fill
  100. * this struct with suggested amount of resources for next
  101. * acquire request
  102. */
  103. #define PFVF_MAX_QUEUES_PER_VF 16
  104. #define PFVF_MAX_SBS_PER_VF 16
  105. struct hw_sb_info hw_sbs[PFVF_MAX_SBS_PER_VF];
  106. u8 hw_qid[PFVF_MAX_QUEUES_PER_VF];
  107. u8 num_rxqs;
  108. u8 num_txqs;
  109. u8 num_sbs;
  110. u8 num_mac_filters;
  111. u8 num_vlan_filters;
  112. u8 num_mc_filters;
  113. u8 permanent_mac_addr[ETH_ALEN];
  114. u8 current_mac_addr[ETH_ALEN];
  115. u8 padding[2];
  116. } resc;
  117. };
  118. /* release the VF's acquired resources */
  119. struct vfpf_release_tlv {
  120. struct vfpf_first_tlv first_tlv;
  121. u16 vf_id;
  122. u8 padding[2];
  123. };
  124. struct tlv_buffer_size {
  125. u8 tlv_buffer[TLV_BUFFER_SIZE];
  126. };
  127. union vfpf_tlvs {
  128. struct vfpf_first_tlv first_tlv;
  129. struct vfpf_acquire_tlv acquire;
  130. struct vfpf_release_tlv release;
  131. struct channel_list_end_tlv list_end;
  132. struct tlv_buffer_size tlv_buf_size;
  133. };
  134. union pfvf_tlvs {
  135. struct pfvf_general_resp_tlv general_resp;
  136. struct pfvf_acquire_resp_tlv acquire_resp;
  137. struct channel_list_end_tlv list_end;
  138. struct tlv_buffer_size tlv_buf_size;
  139. };
  140. #define MAX_TLVS_IN_LIST 50
  141. enum channel_tlvs {
  142. CHANNEL_TLV_NONE,
  143. CHANNEL_TLV_ACQUIRE,
  144. CHANNEL_TLV_RELEASE,
  145. CHANNEL_TLV_LIST_END,
  146. CHANNEL_TLV_MAX
  147. };
  148. #endif /* VF_PF_IF_H */