cxgb3_ctl_defs.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * Copyright (c) 2003-2008 Chelsio, Inc. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. #ifndef _CXGB3_OFFLOAD_CTL_DEFS_H
  33. #define _CXGB3_OFFLOAD_CTL_DEFS_H
  34. enum {
  35. GET_MAX_OUTSTANDING_WR = 0,
  36. GET_TX_MAX_CHUNK = 1,
  37. GET_TID_RANGE = 2,
  38. GET_STID_RANGE = 3,
  39. GET_RTBL_RANGE = 4,
  40. GET_L2T_CAPACITY = 5,
  41. GET_MTUS = 6,
  42. GET_WR_LEN = 7,
  43. GET_IFF_FROM_MAC = 8,
  44. GET_DDP_PARAMS = 9,
  45. GET_PORTS = 10,
  46. ULP_ISCSI_GET_PARAMS = 11,
  47. ULP_ISCSI_SET_PARAMS = 12,
  48. RDMA_GET_PARAMS = 13,
  49. RDMA_CQ_OP = 14,
  50. RDMA_CQ_SETUP = 15,
  51. RDMA_CQ_DISABLE = 16,
  52. RDMA_CTRL_QP_SETUP = 17,
  53. RDMA_GET_MEM = 18,
  54. RDMA_GET_MIB = 19,
  55. GET_RX_PAGE_INFO = 50,
  56. };
  57. /*
  58. * Structure used to describe a TID range. Valid TIDs are [base, base+num).
  59. */
  60. struct tid_range {
  61. unsigned int base; /* first TID */
  62. unsigned int num; /* number of TIDs in range */
  63. };
  64. /*
  65. * Structure used to request the size and contents of the MTU table.
  66. */
  67. struct mtutab {
  68. unsigned int size; /* # of entries in the MTU table */
  69. const unsigned short *mtus; /* the MTU table values */
  70. };
  71. struct net_device;
  72. /*
  73. * Structure used to request the adapter net_device owning a given MAC address.
  74. */
  75. struct iff_mac {
  76. struct net_device *dev; /* the net_device */
  77. const unsigned char *mac_addr; /* MAC address to lookup */
  78. u16 vlan_tag;
  79. };
  80. struct pci_dev;
  81. /*
  82. * Structure used to request the TCP DDP parameters.
  83. */
  84. struct ddp_params {
  85. unsigned int llimit; /* TDDP region start address */
  86. unsigned int ulimit; /* TDDP region end address */
  87. unsigned int tag_mask; /* TDDP tag mask */
  88. struct pci_dev *pdev;
  89. };
  90. struct adap_ports {
  91. unsigned int nports; /* number of ports on this adapter */
  92. struct net_device *lldevs[2];
  93. };
  94. /*
  95. * Structure used to return information to the iscsi layer.
  96. */
  97. struct ulp_iscsi_info {
  98. unsigned int offset;
  99. unsigned int llimit;
  100. unsigned int ulimit;
  101. unsigned int tagmask;
  102. u8 pgsz_factor[4];
  103. unsigned int max_rxsz;
  104. unsigned int max_txsz;
  105. struct pci_dev *pdev;
  106. };
  107. /*
  108. * Structure used to return information to the RDMA layer.
  109. */
  110. struct rdma_info {
  111. unsigned int tpt_base; /* TPT base address */
  112. unsigned int tpt_top; /* TPT last entry address */
  113. unsigned int pbl_base; /* PBL base address */
  114. unsigned int pbl_top; /* PBL last entry address */
  115. unsigned int rqt_base; /* RQT base address */
  116. unsigned int rqt_top; /* RQT last entry address */
  117. unsigned int udbell_len; /* user doorbell region length */
  118. unsigned long udbell_physbase; /* user doorbell physical start addr */
  119. void __iomem *kdb_addr; /* kernel doorbell register address */
  120. struct pci_dev *pdev; /* associated PCI device */
  121. };
  122. /*
  123. * Structure used to request an operation on an RDMA completion queue.
  124. */
  125. struct rdma_cq_op {
  126. unsigned int id;
  127. unsigned int op;
  128. unsigned int credits;
  129. };
  130. /*
  131. * Structure used to setup RDMA completion queues.
  132. */
  133. struct rdma_cq_setup {
  134. unsigned int id;
  135. unsigned long long base_addr;
  136. unsigned int size;
  137. unsigned int credits;
  138. unsigned int credit_thres;
  139. unsigned int ovfl_mode;
  140. };
  141. /*
  142. * Structure used to setup the RDMA control egress context.
  143. */
  144. struct rdma_ctrlqp_setup {
  145. unsigned long long base_addr;
  146. unsigned int size;
  147. };
  148. /*
  149. * Offload TX/RX page information.
  150. */
  151. struct ofld_page_info {
  152. unsigned int page_size; /* Page size, should be a power of 2 */
  153. unsigned int num; /* Number of pages */
  154. };
  155. #endif /* _CXGB3_OFFLOAD_CTL_DEFS_H */