您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

phantom_hw.h 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #ifndef _PHANTOM_HW_H
  2. #define _PHANTOM_HW_H
  3. /*
  4. * Copyright (C) 2008 Michael Brown <mbrown@fensystems.co.uk>.
  5. * Copyright (C) 2008 NetXen, Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of the
  10. * License, or any later version.
  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. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. FILE_LICENCE ( GPL2_OR_LATER );
  22. /**
  23. * @file
  24. *
  25. * Phantom hardware definitions
  26. *
  27. */
  28. /** A Phantom RX descriptor */
  29. struct phantom_rds_pb {
  30. pseudo_bit_t handle[16]; /**< Reference handle */
  31. pseudo_bit_t flags[16]; /**< Flags */
  32. pseudo_bit_t length[32]; /**< Buffer length */
  33. /* --------------------------------------------------------------- */
  34. pseudo_bit_t dma_addr[64]; /**< Buffer DMA address */
  35. };
  36. /** A Phantom RX status descriptor */
  37. struct phantom_sds_pb {
  38. pseudo_bit_t port[4]; /**< Port number */
  39. pseudo_bit_t status[4]; /**< Checksum status */
  40. pseudo_bit_t type[4]; /**< Type */
  41. pseudo_bit_t total_length[16]; /**< Total packet length */
  42. pseudo_bit_t handle[16]; /**< Reference handle */
  43. pseudo_bit_t protocol[4]; /**< Protocol */
  44. pseudo_bit_t pkt_offset[5]; /**< Offset to packet start */
  45. pseudo_bit_t desc_cnt[3]; /**< Descriptor count */
  46. pseudo_bit_t owner[2]; /**< Owner */
  47. pseudo_bit_t opcode[6]; /**< Opcode */
  48. /* --------------------------------------------------------------- */
  49. pseudo_bit_t hash_value[32]; /**< RSS hash value */
  50. pseudo_bit_t hash_type[8]; /**< RSS hash type */
  51. pseudo_bit_t lro[8]; /**< LRO data */
  52. };
  53. /** Phantom RX status opcodes */
  54. enum phantom_sds_opcode {
  55. UNM_SYN_OFFLOAD = 0x03,
  56. UNM_RXPKT_DESC = 0x04,
  57. };
  58. /** A Phantom TX descriptor */
  59. struct phantom_tx_cds_pb {
  60. pseudo_bit_t tcp_hdr_offset[8]; /**< TCP header offset (LSO) */
  61. pseudo_bit_t ip_hdr_offset[8]; /**< IP header offset (LSO) */
  62. pseudo_bit_t flags[7]; /**< Flags */
  63. pseudo_bit_t opcode[6]; /**< Opcode */
  64. pseudo_bit_t hw_rsvd_0[3]; /**< (Reserved) */
  65. pseudo_bit_t num_buffers[8]; /**< Total number of buffers */
  66. pseudo_bit_t length[24]; /**< Total length */
  67. /* --------------------------------------------------------------- */
  68. pseudo_bit_t buffer2_dma_addr[64]; /**< Buffer 2 DMA address */
  69. /* --------------------------------------------------------------- */
  70. pseudo_bit_t handle[16]; /**< Reference handle (n/a) */
  71. pseudo_bit_t port_mss[16]; /**< TCP MSS (LSO) */
  72. pseudo_bit_t port[4]; /**< Port */
  73. pseudo_bit_t context_id[4]; /**< Context ID */
  74. pseudo_bit_t total_hdr_length[8]; /**< MAC+IP+TCP header (LSO) */
  75. pseudo_bit_t conn_id[16]; /**< IPSec connection ID */
  76. /* --------------------------------------------------------------- */
  77. pseudo_bit_t buffer3_dma_addr[64]; /**< Buffer 3 DMA address */
  78. /* --------------------------------------------------------------- */
  79. pseudo_bit_t buffer1_dma_addr[64]; /**< Buffer 1 DMA address */
  80. /* --------------------------------------------------------------- */
  81. pseudo_bit_t buffer1_length[16]; /**< Buffer 1 length */
  82. pseudo_bit_t buffer2_length[16]; /**< Buffer 2 length */
  83. pseudo_bit_t buffer3_length[16]; /**< Buffer 3 length */
  84. pseudo_bit_t buffer4_length[16]; /**< Buffer 4 length */
  85. /* --------------------------------------------------------------- */
  86. pseudo_bit_t buffer4_dma_addr[64]; /**< Buffer 4 DMA address */
  87. /* --------------------------------------------------------------- */
  88. pseudo_bit_t hw_rsvd_1[64]; /**< (Reserved) */
  89. };
  90. /** A Phantom MAC address request body */
  91. struct phantom_nic_request_body_mac_request_pb {
  92. pseudo_bit_t opcode[8]; /**< Opcode */
  93. pseudo_bit_t tag[8]; /**< Tag */
  94. pseudo_bit_t mac_addr_0[8]; /**< MAC address byte 0 */
  95. pseudo_bit_t mac_addr_1[8]; /**< MAC address byte 1 */
  96. pseudo_bit_t mac_addr_2[8]; /**< MAC address byte 2 */
  97. pseudo_bit_t mac_addr_3[8]; /**< MAC address byte 3 */
  98. pseudo_bit_t mac_addr_4[8]; /**< MAC address byte 4 */
  99. pseudo_bit_t mac_addr_5[8]; /**< MAC address byte 5 */
  100. };
  101. /** Phantom MAC request opcodes */
  102. enum phantom_mac_request_opcode {
  103. UNM_MAC_ADD = 0x01, /**< Add MAC address */
  104. UNM_MAC_DEL = 0x02, /**< Delete MAC address */
  105. };
  106. /** A Phantom NIC request command descriptor */
  107. struct phantom_nic_request_cds_pb {
  108. struct {
  109. pseudo_bit_t dst_minor[18];
  110. pseudo_bit_t dst_subq[1];
  111. pseudo_bit_t dst_major[4];
  112. pseudo_bit_t opcode[6];
  113. pseudo_bit_t hw_rsvd_0[3];
  114. pseudo_bit_t msginfo[24];
  115. pseudo_bit_t hw_rsvd_1[2];
  116. pseudo_bit_t qmsg_type[6];
  117. } common;
  118. /* --------------------------------------------------------------- */
  119. struct {
  120. pseudo_bit_t opcode[8];
  121. pseudo_bit_t comp_id [8];
  122. pseudo_bit_t context_id[16];
  123. pseudo_bit_t need_completion[1];
  124. pseudo_bit_t hw_rsvd_0[23];
  125. pseudo_bit_t sub_opcode[8];
  126. } header;
  127. /* --------------------------------------------------------------- */
  128. union {
  129. struct phantom_nic_request_body_mac_request_pb mac_request;
  130. pseudo_bit_t padding[384];
  131. } body;
  132. };
  133. /** Phantom NIC request opcodes */
  134. enum phantom_nic_request_opcode {
  135. UNM_MAC_EVENT = 0x01, /**< Add/delete MAC address */
  136. };
  137. /** A Phantom command descriptor */
  138. union phantom_cds_pb {
  139. struct phantom_tx_cds_pb tx;
  140. struct phantom_nic_request_cds_pb nic_request;
  141. };
  142. /** Phantom command descriptor opcodes */
  143. enum phantom_cds_opcode {
  144. UNM_TX_ETHER_PKT = 0x01, /**< Transmit raw Ethernet */
  145. UNM_NIC_REQUEST = 0x14, /**< NIC request */
  146. };
  147. #endif /* _PHANTOM_HW_H */