cpl5_cmd.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*****************************************************************************
  2. * *
  3. * File: cpl5_cmd.h *
  4. * $Revision: 1.6 $ *
  5. * $Date: 2005/06/21 18:29:47 $ *
  6. * Description: *
  7. * part of the Chelsio 10Gb Ethernet Driver. *
  8. * *
  9. * This program is free software; you can redistribute it and/or modify *
  10. * it under the terms of the GNU General Public License, version 2, as *
  11. * published by the Free Software Foundation. *
  12. * *
  13. * You should have received a copy of the GNU General Public License along *
  14. * with this program; if not, write to the Free Software Foundation, Inc., *
  15. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  16. * *
  17. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
  18. * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
  19. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
  20. * *
  21. * http://www.chelsio.com *
  22. * *
  23. * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
  24. * All rights reserved. *
  25. * *
  26. * Maintainers: maintainers@chelsio.com *
  27. * *
  28. * Authors: Dimitrios Michailidis <dm@chelsio.com> *
  29. * Tina Yang <tainay@chelsio.com> *
  30. * Felix Marti <felix@chelsio.com> *
  31. * Scott Bardone <sbardone@chelsio.com> *
  32. * Kurt Ottaway <kottaway@chelsio.com> *
  33. * Frank DiMambro <frank@chelsio.com> *
  34. * *
  35. * History: *
  36. * *
  37. ****************************************************************************/
  38. #ifndef _CXGB_CPL5_CMD_H_
  39. #define _CXGB_CPL5_CMD_H_
  40. #include <asm/byteorder.h>
  41. #if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
  42. #error "Adjust your <asm/byteorder.h> defines"
  43. #endif
  44. enum CPL_opcode {
  45. CPL_RX_PKT = 0xAD,
  46. CPL_TX_PKT = 0xB2,
  47. CPL_TX_PKT_LSO = 0xB6,
  48. };
  49. enum { /* TX_PKT_LSO ethernet types */
  50. CPL_ETH_II,
  51. CPL_ETH_II_VLAN,
  52. CPL_ETH_802_3,
  53. CPL_ETH_802_3_VLAN
  54. };
  55. struct cpl_rx_data {
  56. u32 rsvd0;
  57. u32 len;
  58. u32 seq;
  59. u16 urg;
  60. u8 rsvd1;
  61. u8 status;
  62. };
  63. /*
  64. * We want this header's alignment to be no more stringent than 2-byte aligned.
  65. * All fields are u8 or u16 except for the length. However that field is not
  66. * used so we break it into 2 16-bit parts to easily meet our alignment needs.
  67. */
  68. struct cpl_tx_pkt {
  69. u8 opcode;
  70. #if defined(__LITTLE_ENDIAN_BITFIELD)
  71. u8 iff:4;
  72. u8 ip_csum_dis:1;
  73. u8 l4_csum_dis:1;
  74. u8 vlan_valid:1;
  75. u8 rsvd:1;
  76. #else
  77. u8 rsvd:1;
  78. u8 vlan_valid:1;
  79. u8 l4_csum_dis:1;
  80. u8 ip_csum_dis:1;
  81. u8 iff:4;
  82. #endif
  83. u16 vlan;
  84. u16 len_hi;
  85. u16 len_lo;
  86. };
  87. struct cpl_tx_pkt_lso {
  88. u8 opcode;
  89. #if defined(__LITTLE_ENDIAN_BITFIELD)
  90. u8 iff:4;
  91. u8 ip_csum_dis:1;
  92. u8 l4_csum_dis:1;
  93. u8 vlan_valid:1;
  94. u8 rsvd:1;
  95. #else
  96. u8 rsvd:1;
  97. u8 vlan_valid:1;
  98. u8 l4_csum_dis:1;
  99. u8 ip_csum_dis:1;
  100. u8 iff:4;
  101. #endif
  102. u16 vlan;
  103. u32 len;
  104. u32 rsvd2;
  105. u8 rsvd3;
  106. #if defined(__LITTLE_ENDIAN_BITFIELD)
  107. u8 tcp_hdr_words:4;
  108. u8 ip_hdr_words:4;
  109. #else
  110. u8 ip_hdr_words:4;
  111. u8 tcp_hdr_words:4;
  112. #endif
  113. u16 eth_type_mss;
  114. };
  115. struct cpl_rx_pkt {
  116. u8 opcode;
  117. #if defined(__LITTLE_ENDIAN_BITFIELD)
  118. u8 iff:4;
  119. u8 csum_valid:1;
  120. u8 bad_pkt:1;
  121. u8 vlan_valid:1;
  122. u8 rsvd:1;
  123. #else
  124. u8 rsvd:1;
  125. u8 vlan_valid:1;
  126. u8 bad_pkt:1;
  127. u8 csum_valid:1;
  128. u8 iff:4;
  129. #endif
  130. u16 csum;
  131. u16 vlan;
  132. u16 len;
  133. };
  134. #endif /* _CXGB_CPL5_CMD_H_ */