cxgb3_ioctl.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * This file is part of the Chelsio T3 Ethernet driver for Linux.
  3. *
  4. * Copyright (C) 2003-2006 Chelsio Communications. All rights reserved.
  5. *
  6. * This program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  8. * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this
  9. * release for licensing terms and conditions.
  10. */
  11. #ifndef __CHIOCTL_H__
  12. #define __CHIOCTL_H__
  13. /*
  14. * Ioctl commands specific to this driver.
  15. */
  16. enum {
  17. CHELSIO_SETREG = 1024,
  18. CHELSIO_GETREG,
  19. CHELSIO_SETTPI,
  20. CHELSIO_GETTPI,
  21. CHELSIO_GETMTUTAB,
  22. CHELSIO_SETMTUTAB,
  23. CHELSIO_GETMTU,
  24. CHELSIO_SET_PM,
  25. CHELSIO_GET_PM,
  26. CHELSIO_GET_TCAM,
  27. CHELSIO_SET_TCAM,
  28. CHELSIO_GET_TCB,
  29. CHELSIO_GET_MEM,
  30. CHELSIO_LOAD_FW,
  31. CHELSIO_GET_PROTO,
  32. CHELSIO_SET_PROTO,
  33. CHELSIO_SET_TRACE_FILTER,
  34. CHELSIO_SET_QSET_PARAMS,
  35. CHELSIO_GET_QSET_PARAMS,
  36. CHELSIO_SET_QSET_NUM,
  37. CHELSIO_GET_QSET_NUM,
  38. CHELSIO_SET_PKTSCHED,
  39. };
  40. struct ch_reg {
  41. uint32_t cmd;
  42. uint32_t addr;
  43. uint32_t val;
  44. };
  45. struct ch_cntxt {
  46. uint32_t cmd;
  47. uint32_t cntxt_type;
  48. uint32_t cntxt_id;
  49. uint32_t data[4];
  50. };
  51. /* context types */
  52. enum { CNTXT_TYPE_EGRESS, CNTXT_TYPE_FL, CNTXT_TYPE_RSP, CNTXT_TYPE_CQ };
  53. struct ch_desc {
  54. uint32_t cmd;
  55. uint32_t queue_num;
  56. uint32_t idx;
  57. uint32_t size;
  58. uint8_t data[128];
  59. };
  60. struct ch_mem_range {
  61. uint32_t cmd;
  62. uint32_t mem_id;
  63. uint32_t addr;
  64. uint32_t len;
  65. uint32_t version;
  66. uint8_t buf[0];
  67. };
  68. struct ch_qset_params {
  69. uint32_t cmd;
  70. uint32_t qset_idx;
  71. int32_t txq_size[3];
  72. int32_t rspq_size;
  73. int32_t fl_size[2];
  74. int32_t intr_lat;
  75. int32_t polling;
  76. int32_t cong_thres;
  77. };
  78. struct ch_pktsched_params {
  79. uint32_t cmd;
  80. uint8_t sched;
  81. uint8_t idx;
  82. uint8_t min;
  83. uint8_t max;
  84. uint8_t binding;
  85. };
  86. #ifndef TCB_SIZE
  87. # define TCB_SIZE 128
  88. #endif
  89. /* TCB size in 32-bit words */
  90. #define TCB_WORDS (TCB_SIZE / 4)
  91. enum { MEM_CM, MEM_PMRX, MEM_PMTX }; /* ch_mem_range.mem_id values */
  92. struct ch_mtus {
  93. uint32_t cmd;
  94. uint32_t nmtus;
  95. uint16_t mtus[NMTUS];
  96. };
  97. struct ch_pm {
  98. uint32_t cmd;
  99. uint32_t tx_pg_sz;
  100. uint32_t tx_num_pg;
  101. uint32_t rx_pg_sz;
  102. uint32_t rx_num_pg;
  103. uint32_t pm_total;
  104. };
  105. struct ch_tcam {
  106. uint32_t cmd;
  107. uint32_t tcam_size;
  108. uint32_t nservers;
  109. uint32_t nroutes;
  110. uint32_t nfilters;
  111. };
  112. struct ch_tcb {
  113. uint32_t cmd;
  114. uint32_t tcb_index;
  115. uint32_t tcb_data[TCB_WORDS];
  116. };
  117. struct ch_tcam_word {
  118. uint32_t cmd;
  119. uint32_t addr;
  120. uint32_t buf[3];
  121. };
  122. struct ch_trace {
  123. uint32_t cmd;
  124. uint32_t sip;
  125. uint32_t sip_mask;
  126. uint32_t dip;
  127. uint32_t dip_mask;
  128. uint16_t sport;
  129. uint16_t sport_mask;
  130. uint16_t dport;
  131. uint16_t dport_mask;
  132. uint32_t vlan:12;
  133. uint32_t vlan_mask:12;
  134. uint32_t intf:4;
  135. uint32_t intf_mask:4;
  136. uint8_t proto;
  137. uint8_t proto_mask;
  138. uint8_t invert_match:1;
  139. uint8_t config_tx:1;
  140. uint8_t config_rx:1;
  141. uint8_t trace_tx:1;
  142. uint8_t trace_rx:1;
  143. };
  144. #define SIOCCHIOCTL SIOCDEVPRIVATE
  145. #endif