fm10k_pf.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /* Intel Ethernet Switch Host Interface Driver
  2. * Copyright(c) 2013 - 2014 Intel Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * The full GNU General Public License is included in this distribution in
  14. * the file called "COPYING".
  15. *
  16. * Contact Information:
  17. * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  18. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  19. */
  20. #ifndef _FM10K_PF_H_
  21. #define _FM10K_PF_H_
  22. #include "fm10k_type.h"
  23. #include "fm10k_common.h"
  24. bool fm10k_glort_valid_pf(struct fm10k_hw *hw, u16 glort);
  25. u16 fm10k_queues_per_pool(struct fm10k_hw *hw);
  26. u16 fm10k_vf_queue_index(struct fm10k_hw *hw, u16 vf_idx);
  27. enum fm10k_pf_tlv_msg_id_v1 {
  28. FM10K_PF_MSG_ID_TEST = 0x000, /* msg ID reserved */
  29. FM10K_PF_MSG_ID_XCAST_MODES = 0x001,
  30. FM10K_PF_MSG_ID_UPDATE_MAC_FWD_RULE = 0x002,
  31. FM10K_PF_MSG_ID_LPORT_MAP = 0x100,
  32. FM10K_PF_MSG_ID_LPORT_CREATE = 0x200,
  33. FM10K_PF_MSG_ID_LPORT_DELETE = 0x201,
  34. FM10K_PF_MSG_ID_CONFIG = 0x300,
  35. FM10K_PF_MSG_ID_UPDATE_PVID = 0x400,
  36. FM10K_PF_MSG_ID_CREATE_FLOW_TABLE = 0x501,
  37. FM10K_PF_MSG_ID_DELETE_FLOW_TABLE = 0x502,
  38. FM10K_PF_MSG_ID_UPDATE_FLOW = 0x503,
  39. FM10K_PF_MSG_ID_DELETE_FLOW = 0x504,
  40. FM10K_PF_MSG_ID_SET_FLOW_STATE = 0x505,
  41. FM10K_PF_MSG_ID_GET_1588_INFO = 0x506,
  42. FM10K_PF_MSG_ID_1588_TIMESTAMP = 0x701,
  43. };
  44. enum fm10k_pf_tlv_attr_id_v1 {
  45. FM10K_PF_ATTR_ID_ERR = 0x00,
  46. FM10K_PF_ATTR_ID_LPORT_MAP = 0x01,
  47. FM10K_PF_ATTR_ID_XCAST_MODE = 0x02,
  48. FM10K_PF_ATTR_ID_MAC_UPDATE = 0x03,
  49. FM10K_PF_ATTR_ID_VLAN_UPDATE = 0x04,
  50. FM10K_PF_ATTR_ID_CONFIG = 0x05,
  51. FM10K_PF_ATTR_ID_CREATE_FLOW_TABLE = 0x06,
  52. FM10K_PF_ATTR_ID_DELETE_FLOW_TABLE = 0x07,
  53. FM10K_PF_ATTR_ID_UPDATE_FLOW = 0x08,
  54. FM10K_PF_ATTR_ID_FLOW_STATE = 0x09,
  55. FM10K_PF_ATTR_ID_FLOW_HANDLE = 0x0A,
  56. FM10K_PF_ATTR_ID_DELETE_FLOW = 0x0B,
  57. FM10K_PF_ATTR_ID_PORT = 0x0C,
  58. FM10K_PF_ATTR_ID_UPDATE_PVID = 0x0D,
  59. FM10K_PF_ATTR_ID_1588_TIMESTAMP = 0x10,
  60. };
  61. #define FM10K_MSG_LPORT_MAP_GLORT_SHIFT 0
  62. #define FM10K_MSG_LPORT_MAP_GLORT_SIZE 16
  63. #define FM10K_MSG_LPORT_MAP_MASK_SHIFT 16
  64. #define FM10K_MSG_LPORT_MAP_MASK_SIZE 16
  65. #define FM10K_MSG_UPDATE_PVID_GLORT_SHIFT 0
  66. #define FM10K_MSG_UPDATE_PVID_GLORT_SIZE 16
  67. #define FM10K_MSG_UPDATE_PVID_PVID_SHIFT 16
  68. #define FM10K_MSG_UPDATE_PVID_PVID_SIZE 16
  69. struct fm10k_mac_update {
  70. __le32 mac_lower;
  71. __le16 mac_upper;
  72. __le16 vlan;
  73. __le16 glort;
  74. u8 flags;
  75. u8 action;
  76. } __packed;
  77. struct fm10k_global_table_data {
  78. __le32 used;
  79. __le32 avail;
  80. } __packed;
  81. struct fm10k_swapi_error {
  82. __le32 status;
  83. struct fm10k_global_table_data mac;
  84. struct fm10k_global_table_data nexthop;
  85. struct fm10k_global_table_data ffu;
  86. } __packed;
  87. struct fm10k_swapi_1588_timestamp {
  88. __le64 egress;
  89. __le64 ingress;
  90. __le16 dglort;
  91. __le16 sglort;
  92. } __packed;
  93. s32 fm10k_msg_lport_map_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
  94. extern const struct fm10k_tlv_attr fm10k_lport_map_msg_attr[];
  95. #define FM10K_PF_MSG_LPORT_MAP_HANDLER(func) \
  96. FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_LPORT_MAP, \
  97. fm10k_lport_map_msg_attr, func)
  98. s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *, u32 **,
  99. struct fm10k_mbx_info *);
  100. extern const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[];
  101. #define FM10K_PF_MSG_UPDATE_PVID_HANDLER(func) \
  102. FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_UPDATE_PVID, \
  103. fm10k_update_pvid_msg_attr, func)
  104. s32 fm10k_msg_err_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
  105. extern const struct fm10k_tlv_attr fm10k_err_msg_attr[];
  106. #define FM10K_PF_MSG_ERR_HANDLER(msg, func) \
  107. FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_##msg, fm10k_err_msg_attr, func)
  108. extern const struct fm10k_tlv_attr fm10k_1588_timestamp_msg_attr[];
  109. #define FM10K_PF_MSG_1588_TIMESTAMP_HANDLER(func) \
  110. FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_1588_TIMESTAMP, \
  111. fm10k_1588_timestamp_msg_attr, func)
  112. s32 fm10k_iov_msg_msix_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
  113. s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *, u32 **,
  114. struct fm10k_mbx_info *);
  115. s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *, u32 **,
  116. struct fm10k_mbx_info *);
  117. extern const struct fm10k_msg_data fm10k_iov_msg_data_pf[];
  118. extern struct fm10k_info fm10k_pf_info;
  119. #endif /* _FM10K_PF_H */