You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

phantom_hw.h 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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., 51 Franklin Street, Fifth Floor, Boston, MA
  20. * 02110-1301, USA.
  21. *
  22. * You can also choose to distribute this program under the terms of
  23. * the Unmodified Binary Distribution Licence (as given in the file
  24. * COPYING.UBDL), provided that you have satisfied its requirements.
  25. */
  26. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  27. /**
  28. * @file
  29. *
  30. * Phantom hardware definitions
  31. *
  32. */
  33. /** A Phantom RX descriptor */
  34. struct phantom_rds_pb {
  35. pseudo_bit_t handle[16]; /**< Reference handle */
  36. pseudo_bit_t flags[16]; /**< Flags */
  37. pseudo_bit_t length[32]; /**< Buffer length */
  38. /* --------------------------------------------------------------- */
  39. pseudo_bit_t dma_addr[64]; /**< Buffer DMA address */
  40. };
  41. /** A Phantom RX status descriptor */
  42. struct phantom_sds_pb {
  43. pseudo_bit_t port[4]; /**< Port number */
  44. pseudo_bit_t status[4]; /**< Checksum status */
  45. pseudo_bit_t type[4]; /**< Type */
  46. pseudo_bit_t total_length[16]; /**< Total packet length */
  47. pseudo_bit_t handle[16]; /**< Reference handle */
  48. pseudo_bit_t protocol[4]; /**< Protocol */
  49. pseudo_bit_t pkt_offset[5]; /**< Offset to packet start */
  50. pseudo_bit_t desc_cnt[3]; /**< Descriptor count */
  51. pseudo_bit_t owner[2]; /**< Owner */
  52. pseudo_bit_t opcode[6]; /**< Opcode */
  53. /* --------------------------------------------------------------- */
  54. pseudo_bit_t hash_value[32]; /**< RSS hash value */
  55. pseudo_bit_t hash_type[8]; /**< RSS hash type */
  56. pseudo_bit_t lro[8]; /**< LRO data */
  57. };
  58. /** Phantom RX status opcodes */
  59. enum phantom_sds_opcode {
  60. UNM_SYN_OFFLOAD = 0x03,
  61. UNM_RXPKT_DESC = 0x04,
  62. };
  63. /** A Phantom TX descriptor */
  64. struct phantom_tx_cds_pb {
  65. pseudo_bit_t tcp_hdr_offset[8]; /**< TCP header offset (LSO) */
  66. pseudo_bit_t ip_hdr_offset[8]; /**< IP header offset (LSO) */
  67. pseudo_bit_t flags[7]; /**< Flags */
  68. pseudo_bit_t opcode[6]; /**< Opcode */
  69. pseudo_bit_t hw_rsvd_0[3]; /**< (Reserved) */
  70. pseudo_bit_t num_buffers[8]; /**< Total number of buffers */
  71. pseudo_bit_t length[24]; /**< Total length */
  72. /* --------------------------------------------------------------- */
  73. pseudo_bit_t buffer2_dma_addr[64]; /**< Buffer 2 DMA address */
  74. /* --------------------------------------------------------------- */
  75. pseudo_bit_t handle[16]; /**< Reference handle (n/a) */
  76. pseudo_bit_t port_mss[16]; /**< TCP MSS (LSO) */
  77. pseudo_bit_t port[4]; /**< Port */
  78. pseudo_bit_t context_id[4]; /**< Context ID */
  79. pseudo_bit_t total_hdr_length[8]; /**< MAC+IP+TCP header (LSO) */
  80. pseudo_bit_t conn_id[16]; /**< IPSec connection ID */
  81. /* --------------------------------------------------------------- */
  82. pseudo_bit_t buffer3_dma_addr[64]; /**< Buffer 3 DMA address */
  83. /* --------------------------------------------------------------- */
  84. pseudo_bit_t buffer1_dma_addr[64]; /**< Buffer 1 DMA address */
  85. /* --------------------------------------------------------------- */
  86. pseudo_bit_t buffer1_length[16]; /**< Buffer 1 length */
  87. pseudo_bit_t buffer2_length[16]; /**< Buffer 2 length */
  88. pseudo_bit_t buffer3_length[16]; /**< Buffer 3 length */
  89. pseudo_bit_t buffer4_length[16]; /**< Buffer 4 length */
  90. /* --------------------------------------------------------------- */
  91. pseudo_bit_t buffer4_dma_addr[64]; /**< Buffer 4 DMA address */
  92. /* --------------------------------------------------------------- */
  93. pseudo_bit_t hw_rsvd_1[64]; /**< (Reserved) */
  94. };
  95. /** A Phantom MAC address request body */
  96. struct phantom_nic_request_body_mac_request_pb {
  97. pseudo_bit_t opcode[8]; /**< Opcode */
  98. pseudo_bit_t tag[8]; /**< Tag */
  99. pseudo_bit_t mac_addr_0[8]; /**< MAC address byte 0 */
  100. pseudo_bit_t mac_addr_1[8]; /**< MAC address byte 1 */
  101. pseudo_bit_t mac_addr_2[8]; /**< MAC address byte 2 */
  102. pseudo_bit_t mac_addr_3[8]; /**< MAC address byte 3 */
  103. pseudo_bit_t mac_addr_4[8]; /**< MAC address byte 4 */
  104. pseudo_bit_t mac_addr_5[8]; /**< MAC address byte 5 */
  105. };
  106. /** Phantom MAC request opcodes */
  107. enum phantom_mac_request_opcode {
  108. UNM_MAC_ADD = 0x01, /**< Add MAC address */
  109. UNM_MAC_DEL = 0x02, /**< Delete MAC address */
  110. };
  111. /** A Phantom NIC request command descriptor */
  112. struct phantom_nic_request_cds_pb {
  113. struct {
  114. pseudo_bit_t dst_minor[18];
  115. pseudo_bit_t dst_subq[1];
  116. pseudo_bit_t dst_major[4];
  117. pseudo_bit_t opcode[6];
  118. pseudo_bit_t hw_rsvd_0[3];
  119. pseudo_bit_t msginfo[24];
  120. pseudo_bit_t hw_rsvd_1[2];
  121. pseudo_bit_t qmsg_type[6];
  122. } common;
  123. /* --------------------------------------------------------------- */
  124. struct {
  125. pseudo_bit_t opcode[8];
  126. pseudo_bit_t comp_id [8];
  127. pseudo_bit_t context_id[16];
  128. pseudo_bit_t need_completion[1];
  129. pseudo_bit_t hw_rsvd_0[23];
  130. pseudo_bit_t sub_opcode[8];
  131. } header;
  132. /* --------------------------------------------------------------- */
  133. union {
  134. struct phantom_nic_request_body_mac_request_pb mac_request;
  135. pseudo_bit_t padding[384];
  136. } body;
  137. };
  138. /** Phantom NIC request opcodes */
  139. enum phantom_nic_request_opcode {
  140. UNM_MAC_EVENT = 0x01, /**< Add/delete MAC address */
  141. };
  142. /** A Phantom command descriptor */
  143. union phantom_cds_pb {
  144. struct phantom_tx_cds_pb tx;
  145. struct phantom_nic_request_cds_pb nic_request;
  146. };
  147. /** Phantom command descriptor opcodes */
  148. enum phantom_cds_opcode {
  149. UNM_TX_ETHER_PKT = 0x01, /**< Transmit raw Ethernet */
  150. UNM_NIC_REQUEST = 0x14, /**< NIC request */
  151. };
  152. #endif /* _PHANTOM_HW_H */