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.

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