t4_msg.h 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  1. /*
  2. * This file is part of the Chelsio T4 Ethernet driver for Linux.
  3. *
  4. * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved.
  5. *
  6. * This software is available to you under a choice of one of two
  7. * licenses. You may choose to be licensed under the terms of the GNU
  8. * General Public License (GPL) Version 2, available from the file
  9. * COPYING in the main directory of this source tree, or the
  10. * OpenIB.org BSD license below:
  11. *
  12. * Redistribution and use in source and binary forms, with or
  13. * without modification, are permitted provided that the following
  14. * conditions are met:
  15. *
  16. * - Redistributions of source code must retain the above
  17. * copyright notice, this list of conditions and the following
  18. * disclaimer.
  19. *
  20. * - Redistributions in binary form must reproduce the above
  21. * copyright notice, this list of conditions and the following
  22. * disclaimer in the documentation and/or other materials
  23. * provided with the distribution.
  24. *
  25. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  29. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  30. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  31. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  32. * SOFTWARE.
  33. */
  34. #ifndef __T4_MSG_H
  35. #define __T4_MSG_H
  36. #include <linux/types.h>
  37. enum {
  38. CPL_PASS_OPEN_REQ = 0x1,
  39. CPL_PASS_ACCEPT_RPL = 0x2,
  40. CPL_ACT_OPEN_REQ = 0x3,
  41. CPL_SET_TCB_FIELD = 0x5,
  42. CPL_GET_TCB = 0x6,
  43. CPL_CLOSE_CON_REQ = 0x8,
  44. CPL_CLOSE_LISTSRV_REQ = 0x9,
  45. CPL_ABORT_REQ = 0xA,
  46. CPL_ABORT_RPL = 0xB,
  47. CPL_RX_DATA_ACK = 0xD,
  48. CPL_TX_PKT = 0xE,
  49. CPL_L2T_WRITE_REQ = 0x12,
  50. CPL_TID_RELEASE = 0x1A,
  51. CPL_CLOSE_LISTSRV_RPL = 0x20,
  52. CPL_L2T_WRITE_RPL = 0x23,
  53. CPL_PASS_OPEN_RPL = 0x24,
  54. CPL_ACT_OPEN_RPL = 0x25,
  55. CPL_PEER_CLOSE = 0x26,
  56. CPL_ABORT_REQ_RSS = 0x2B,
  57. CPL_ABORT_RPL_RSS = 0x2D,
  58. CPL_CLOSE_CON_RPL = 0x32,
  59. CPL_ISCSI_HDR = 0x33,
  60. CPL_RDMA_CQE = 0x35,
  61. CPL_RDMA_CQE_READ_RSP = 0x36,
  62. CPL_RDMA_CQE_ERR = 0x37,
  63. CPL_RX_DATA = 0x39,
  64. CPL_SET_TCB_RPL = 0x3A,
  65. CPL_RX_PKT = 0x3B,
  66. CPL_RX_DDP_COMPLETE = 0x3F,
  67. CPL_ACT_ESTABLISH = 0x40,
  68. CPL_PASS_ESTABLISH = 0x41,
  69. CPL_RX_DATA_DDP = 0x42,
  70. CPL_PASS_ACCEPT_REQ = 0x44,
  71. CPL_TRACE_PKT_T5 = 0x48,
  72. CPL_RX_ISCSI_DDP = 0x49,
  73. CPL_RDMA_READ_REQ = 0x60,
  74. CPL_PASS_OPEN_REQ6 = 0x81,
  75. CPL_ACT_OPEN_REQ6 = 0x83,
  76. CPL_RDMA_TERMINATE = 0xA2,
  77. CPL_RDMA_WRITE = 0xA4,
  78. CPL_SGE_EGR_UPDATE = 0xA5,
  79. CPL_TRACE_PKT = 0xB0,
  80. CPL_ISCSI_DATA = 0xB2,
  81. CPL_FW4_MSG = 0xC0,
  82. CPL_FW4_PLD = 0xC1,
  83. CPL_FW4_ACK = 0xC3,
  84. CPL_FW6_MSG = 0xE0,
  85. CPL_FW6_PLD = 0xE1,
  86. CPL_TX_PKT_LSO = 0xED,
  87. CPL_TX_PKT_XT = 0xEE,
  88. NUM_CPL_CMDS
  89. };
  90. enum CPL_error {
  91. CPL_ERR_NONE = 0,
  92. CPL_ERR_TCAM_FULL = 3,
  93. CPL_ERR_BAD_LENGTH = 15,
  94. CPL_ERR_BAD_ROUTE = 18,
  95. CPL_ERR_CONN_RESET = 20,
  96. CPL_ERR_CONN_EXIST_SYNRECV = 21,
  97. CPL_ERR_CONN_EXIST = 22,
  98. CPL_ERR_ARP_MISS = 23,
  99. CPL_ERR_BAD_SYN = 24,
  100. CPL_ERR_CONN_TIMEDOUT = 30,
  101. CPL_ERR_XMIT_TIMEDOUT = 31,
  102. CPL_ERR_PERSIST_TIMEDOUT = 32,
  103. CPL_ERR_FINWAIT2_TIMEDOUT = 33,
  104. CPL_ERR_KEEPALIVE_TIMEDOUT = 34,
  105. CPL_ERR_RTX_NEG_ADVICE = 35,
  106. CPL_ERR_PERSIST_NEG_ADVICE = 36,
  107. CPL_ERR_KEEPALV_NEG_ADVICE = 37,
  108. CPL_ERR_ABORT_FAILED = 42,
  109. CPL_ERR_IWARP_FLM = 50,
  110. };
  111. enum {
  112. CPL_CONN_POLICY_AUTO = 0,
  113. CPL_CONN_POLICY_ASK = 1,
  114. CPL_CONN_POLICY_FILTER = 2,
  115. CPL_CONN_POLICY_DENY = 3
  116. };
  117. enum {
  118. ULP_MODE_NONE = 0,
  119. ULP_MODE_ISCSI = 2,
  120. ULP_MODE_RDMA = 4,
  121. ULP_MODE_TCPDDP = 5,
  122. ULP_MODE_FCOE = 6,
  123. };
  124. enum {
  125. ULP_CRC_HEADER = 1 << 0,
  126. ULP_CRC_DATA = 1 << 1
  127. };
  128. enum {
  129. CPL_ABORT_SEND_RST = 0,
  130. CPL_ABORT_NO_RST,
  131. };
  132. enum { /* TX_PKT_XT checksum types */
  133. TX_CSUM_TCP = 0,
  134. TX_CSUM_UDP = 1,
  135. TX_CSUM_CRC16 = 4,
  136. TX_CSUM_CRC32 = 5,
  137. TX_CSUM_CRC32C = 6,
  138. TX_CSUM_FCOE = 7,
  139. TX_CSUM_TCPIP = 8,
  140. TX_CSUM_UDPIP = 9,
  141. TX_CSUM_TCPIP6 = 10,
  142. TX_CSUM_UDPIP6 = 11,
  143. TX_CSUM_IP = 12,
  144. };
  145. union opcode_tid {
  146. __be32 opcode_tid;
  147. u8 opcode;
  148. };
  149. #define CPL_OPCODE_S 24
  150. #define CPL_OPCODE_V(x) ((x) << CPL_OPCODE_S)
  151. #define CPL_OPCODE_G(x) (((x) >> CPL_OPCODE_S) & 0xFF)
  152. #define TID_G(x) ((x) & 0xFFFFFF)
  153. /* tid is assumed to be 24-bits */
  154. #define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE_V(opcode) | (tid))
  155. #define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
  156. /* extract the TID from a CPL command */
  157. #define GET_TID(cmd) (TID_G(be32_to_cpu(OPCODE_TID(cmd))))
  158. /* partitioning of TID fields that also carry a queue id */
  159. #define TID_TID_S 0
  160. #define TID_TID_M 0x3fff
  161. #define TID_TID_G(x) (((x) >> TID_TID_S) & TID_TID_M)
  162. #define TID_QID_S 14
  163. #define TID_QID_M 0x3ff
  164. #define TID_QID_V(x) ((x) << TID_QID_S)
  165. #define TID_QID_G(x) (((x) >> TID_QID_S) & TID_QID_M)
  166. struct rss_header {
  167. u8 opcode;
  168. #if defined(__LITTLE_ENDIAN_BITFIELD)
  169. u8 channel:2;
  170. u8 filter_hit:1;
  171. u8 filter_tid:1;
  172. u8 hash_type:2;
  173. u8 ipv6:1;
  174. u8 send2fw:1;
  175. #else
  176. u8 send2fw:1;
  177. u8 ipv6:1;
  178. u8 hash_type:2;
  179. u8 filter_tid:1;
  180. u8 filter_hit:1;
  181. u8 channel:2;
  182. #endif
  183. __be16 qid;
  184. __be32 hash_val;
  185. };
  186. struct work_request_hdr {
  187. __be32 wr_hi;
  188. __be32 wr_mid;
  189. __be64 wr_lo;
  190. };
  191. /* wr_hi fields */
  192. #define WR_OP_S 24
  193. #define WR_OP_V(x) ((__u64)(x) << WR_OP_S)
  194. #define WR_HDR struct work_request_hdr wr
  195. /* option 0 fields */
  196. #define TX_CHAN_S 2
  197. #define TX_CHAN_V(x) ((x) << TX_CHAN_S)
  198. #define ULP_MODE_S 8
  199. #define ULP_MODE_V(x) ((x) << ULP_MODE_S)
  200. #define RCV_BUFSIZ_S 12
  201. #define RCV_BUFSIZ_M 0x3FFU
  202. #define RCV_BUFSIZ_V(x) ((x) << RCV_BUFSIZ_S)
  203. #define SMAC_SEL_S 28
  204. #define SMAC_SEL_V(x) ((__u64)(x) << SMAC_SEL_S)
  205. #define L2T_IDX_S 36
  206. #define L2T_IDX_V(x) ((__u64)(x) << L2T_IDX_S)
  207. #define WND_SCALE_S 50
  208. #define WND_SCALE_V(x) ((__u64)(x) << WND_SCALE_S)
  209. #define KEEP_ALIVE_S 54
  210. #define KEEP_ALIVE_V(x) ((__u64)(x) << KEEP_ALIVE_S)
  211. #define KEEP_ALIVE_F KEEP_ALIVE_V(1ULL)
  212. #define MSS_IDX_S 60
  213. #define MSS_IDX_M 0xF
  214. #define MSS_IDX_V(x) ((__u64)(x) << MSS_IDX_S)
  215. #define MSS_IDX_G(x) (((x) >> MSS_IDX_S) & MSS_IDX_M)
  216. /* option 2 fields */
  217. #define RSS_QUEUE_S 0
  218. #define RSS_QUEUE_M 0x3FF
  219. #define RSS_QUEUE_V(x) ((x) << RSS_QUEUE_S)
  220. #define RSS_QUEUE_G(x) (((x) >> RSS_QUEUE_S) & RSS_QUEUE_M)
  221. #define RSS_QUEUE_VALID_S 10
  222. #define RSS_QUEUE_VALID_V(x) ((x) << RSS_QUEUE_VALID_S)
  223. #define RSS_QUEUE_VALID_F RSS_QUEUE_VALID_V(1U)
  224. #define RX_FC_DISABLE_S 20
  225. #define RX_FC_DISABLE_V(x) ((x) << RX_FC_DISABLE_S)
  226. #define RX_FC_DISABLE_F RX_FC_DISABLE_V(1U)
  227. #define RX_FC_VALID_S 22
  228. #define RX_FC_VALID_V(x) ((x) << RX_FC_VALID_S)
  229. #define RX_FC_VALID_F RX_FC_VALID_V(1U)
  230. #define RX_CHANNEL_S 26
  231. #define RX_CHANNEL_V(x) ((x) << RX_CHANNEL_S)
  232. #define WND_SCALE_EN_S 28
  233. #define WND_SCALE_EN_V(x) ((x) << WND_SCALE_EN_S)
  234. #define WND_SCALE_EN_F WND_SCALE_EN_V(1U)
  235. #define T5_OPT_2_VALID_S 31
  236. #define T5_OPT_2_VALID_V(x) ((x) << T5_OPT_2_VALID_S)
  237. #define T5_OPT_2_VALID_F T5_OPT_2_VALID_V(1U)
  238. struct cpl_pass_open_req {
  239. WR_HDR;
  240. union opcode_tid ot;
  241. __be16 local_port;
  242. __be16 peer_port;
  243. __be32 local_ip;
  244. __be32 peer_ip;
  245. __be64 opt0;
  246. __be64 opt1;
  247. };
  248. /* option 0 fields */
  249. #define NO_CONG_S 4
  250. #define NO_CONG_V(x) ((x) << NO_CONG_S)
  251. #define NO_CONG_F NO_CONG_V(1U)
  252. #define DELACK_S 5
  253. #define DELACK_V(x) ((x) << DELACK_S)
  254. #define DELACK_F DELACK_V(1U)
  255. #define DSCP_S 22
  256. #define DSCP_M 0x3F
  257. #define DSCP_V(x) ((x) << DSCP_S)
  258. #define DSCP_G(x) (((x) >> DSCP_S) & DSCP_M)
  259. #define TCAM_BYPASS_S 48
  260. #define TCAM_BYPASS_V(x) ((__u64)(x) << TCAM_BYPASS_S)
  261. #define TCAM_BYPASS_F TCAM_BYPASS_V(1ULL)
  262. #define NAGLE_S 49
  263. #define NAGLE_V(x) ((__u64)(x) << NAGLE_S)
  264. #define NAGLE_F NAGLE_V(1ULL)
  265. /* option 1 fields */
  266. #define SYN_RSS_ENABLE_S 0
  267. #define SYN_RSS_ENABLE_V(x) ((x) << SYN_RSS_ENABLE_S)
  268. #define SYN_RSS_ENABLE_F SYN_RSS_ENABLE_V(1U)
  269. #define SYN_RSS_QUEUE_S 2
  270. #define SYN_RSS_QUEUE_V(x) ((x) << SYN_RSS_QUEUE_S)
  271. #define CONN_POLICY_S 22
  272. #define CONN_POLICY_V(x) ((x) << CONN_POLICY_S)
  273. struct cpl_pass_open_req6 {
  274. WR_HDR;
  275. union opcode_tid ot;
  276. __be16 local_port;
  277. __be16 peer_port;
  278. __be64 local_ip_hi;
  279. __be64 local_ip_lo;
  280. __be64 peer_ip_hi;
  281. __be64 peer_ip_lo;
  282. __be64 opt0;
  283. __be64 opt1;
  284. };
  285. struct cpl_pass_open_rpl {
  286. union opcode_tid ot;
  287. u8 rsvd[3];
  288. u8 status;
  289. };
  290. struct cpl_pass_accept_rpl {
  291. WR_HDR;
  292. union opcode_tid ot;
  293. __be32 opt2;
  294. __be64 opt0;
  295. };
  296. /* option 2 fields */
  297. #define RX_COALESCE_VALID_S 11
  298. #define RX_COALESCE_VALID_V(x) ((x) << RX_COALESCE_VALID_S)
  299. #define RX_COALESCE_VALID_F RX_COALESCE_VALID_V(1U)
  300. #define RX_COALESCE_S 12
  301. #define RX_COALESCE_V(x) ((x) << RX_COALESCE_S)
  302. #define PACE_S 16
  303. #define PACE_V(x) ((x) << PACE_S)
  304. #define TX_QUEUE_S 23
  305. #define TX_QUEUE_M 0x7
  306. #define TX_QUEUE_V(x) ((x) << TX_QUEUE_S)
  307. #define TX_QUEUE_G(x) (((x) >> TX_QUEUE_S) & TX_QUEUE_M)
  308. #define CCTRL_ECN_S 27
  309. #define CCTRL_ECN_V(x) ((x) << CCTRL_ECN_S)
  310. #define CCTRL_ECN_F CCTRL_ECN_V(1U)
  311. #define TSTAMPS_EN_S 29
  312. #define TSTAMPS_EN_V(x) ((x) << TSTAMPS_EN_S)
  313. #define TSTAMPS_EN_F TSTAMPS_EN_V(1U)
  314. #define SACK_EN_S 30
  315. #define SACK_EN_V(x) ((x) << SACK_EN_S)
  316. #define SACK_EN_F SACK_EN_V(1U)
  317. struct cpl_t5_pass_accept_rpl {
  318. WR_HDR;
  319. union opcode_tid ot;
  320. __be32 opt2;
  321. __be64 opt0;
  322. __be32 iss;
  323. __be32 rsvd;
  324. };
  325. struct cpl_act_open_req {
  326. WR_HDR;
  327. union opcode_tid ot;
  328. __be16 local_port;
  329. __be16 peer_port;
  330. __be32 local_ip;
  331. __be32 peer_ip;
  332. __be64 opt0;
  333. __be32 params;
  334. __be32 opt2;
  335. };
  336. #define FILTER_TUPLE_S 24
  337. #define FILTER_TUPLE_M 0xFFFFFFFFFF
  338. #define FILTER_TUPLE_V(x) ((x) << FILTER_TUPLE_S)
  339. #define FILTER_TUPLE_G(x) (((x) >> FILTER_TUPLE_S) & FILTER_TUPLE_M)
  340. struct cpl_t5_act_open_req {
  341. WR_HDR;
  342. union opcode_tid ot;
  343. __be16 local_port;
  344. __be16 peer_port;
  345. __be32 local_ip;
  346. __be32 peer_ip;
  347. __be64 opt0;
  348. __be32 rsvd;
  349. __be32 opt2;
  350. __be64 params;
  351. };
  352. struct cpl_t6_act_open_req {
  353. WR_HDR;
  354. union opcode_tid ot;
  355. __be16 local_port;
  356. __be16 peer_port;
  357. __be32 local_ip;
  358. __be32 peer_ip;
  359. __be64 opt0;
  360. __be32 rsvd;
  361. __be32 opt2;
  362. __be64 params;
  363. __be32 rsvd2;
  364. __be32 opt3;
  365. };
  366. struct cpl_act_open_req6 {
  367. WR_HDR;
  368. union opcode_tid ot;
  369. __be16 local_port;
  370. __be16 peer_port;
  371. __be64 local_ip_hi;
  372. __be64 local_ip_lo;
  373. __be64 peer_ip_hi;
  374. __be64 peer_ip_lo;
  375. __be64 opt0;
  376. __be32 params;
  377. __be32 opt2;
  378. };
  379. struct cpl_t5_act_open_req6 {
  380. WR_HDR;
  381. union opcode_tid ot;
  382. __be16 local_port;
  383. __be16 peer_port;
  384. __be64 local_ip_hi;
  385. __be64 local_ip_lo;
  386. __be64 peer_ip_hi;
  387. __be64 peer_ip_lo;
  388. __be64 opt0;
  389. __be32 rsvd;
  390. __be32 opt2;
  391. __be64 params;
  392. };
  393. struct cpl_t6_act_open_req6 {
  394. WR_HDR;
  395. union opcode_tid ot;
  396. __be16 local_port;
  397. __be16 peer_port;
  398. __be64 local_ip_hi;
  399. __be64 local_ip_lo;
  400. __be64 peer_ip_hi;
  401. __be64 peer_ip_lo;
  402. __be64 opt0;
  403. __be32 rsvd;
  404. __be32 opt2;
  405. __be64 params;
  406. __be32 rsvd2;
  407. __be32 opt3;
  408. };
  409. struct cpl_act_open_rpl {
  410. union opcode_tid ot;
  411. __be32 atid_status;
  412. };
  413. /* cpl_act_open_rpl.atid_status fields */
  414. #define AOPEN_STATUS_S 0
  415. #define AOPEN_STATUS_M 0xFF
  416. #define AOPEN_STATUS_G(x) (((x) >> AOPEN_STATUS_S) & AOPEN_STATUS_M)
  417. #define AOPEN_ATID_S 8
  418. #define AOPEN_ATID_M 0xFFFFFF
  419. #define AOPEN_ATID_G(x) (((x) >> AOPEN_ATID_S) & AOPEN_ATID_M)
  420. struct cpl_pass_establish {
  421. union opcode_tid ot;
  422. __be32 rsvd;
  423. __be32 tos_stid;
  424. __be16 mac_idx;
  425. __be16 tcp_opt;
  426. __be32 snd_isn;
  427. __be32 rcv_isn;
  428. };
  429. /* cpl_pass_establish.tos_stid fields */
  430. #define PASS_OPEN_TID_S 0
  431. #define PASS_OPEN_TID_M 0xFFFFFF
  432. #define PASS_OPEN_TID_V(x) ((x) << PASS_OPEN_TID_S)
  433. #define PASS_OPEN_TID_G(x) (((x) >> PASS_OPEN_TID_S) & PASS_OPEN_TID_M)
  434. #define PASS_OPEN_TOS_S 24
  435. #define PASS_OPEN_TOS_M 0xFF
  436. #define PASS_OPEN_TOS_V(x) ((x) << PASS_OPEN_TOS_S)
  437. #define PASS_OPEN_TOS_G(x) (((x) >> PASS_OPEN_TOS_S) & PASS_OPEN_TOS_M)
  438. /* cpl_pass_establish.tcp_opt fields (also applies to act_open_establish) */
  439. #define TCPOPT_WSCALE_OK_S 5
  440. #define TCPOPT_WSCALE_OK_M 0x1
  441. #define TCPOPT_WSCALE_OK_G(x) \
  442. (((x) >> TCPOPT_WSCALE_OK_S) & TCPOPT_WSCALE_OK_M)
  443. #define TCPOPT_SACK_S 6
  444. #define TCPOPT_SACK_M 0x1
  445. #define TCPOPT_SACK_G(x) (((x) >> TCPOPT_SACK_S) & TCPOPT_SACK_M)
  446. #define TCPOPT_TSTAMP_S 7
  447. #define TCPOPT_TSTAMP_M 0x1
  448. #define TCPOPT_TSTAMP_G(x) (((x) >> TCPOPT_TSTAMP_S) & TCPOPT_TSTAMP_M)
  449. #define TCPOPT_SND_WSCALE_S 8
  450. #define TCPOPT_SND_WSCALE_M 0xF
  451. #define TCPOPT_SND_WSCALE_G(x) \
  452. (((x) >> TCPOPT_SND_WSCALE_S) & TCPOPT_SND_WSCALE_M)
  453. #define TCPOPT_MSS_S 12
  454. #define TCPOPT_MSS_M 0xF
  455. #define TCPOPT_MSS_G(x) (((x) >> TCPOPT_MSS_S) & TCPOPT_MSS_M)
  456. #define T6_TCP_HDR_LEN_S 8
  457. #define T6_TCP_HDR_LEN_V(x) ((x) << T6_TCP_HDR_LEN_S)
  458. #define T6_TCP_HDR_LEN_G(x) (((x) >> T6_TCP_HDR_LEN_S) & TCP_HDR_LEN_M)
  459. #define T6_IP_HDR_LEN_S 14
  460. #define T6_IP_HDR_LEN_V(x) ((x) << T6_IP_HDR_LEN_S)
  461. #define T6_IP_HDR_LEN_G(x) (((x) >> T6_IP_HDR_LEN_S) & IP_HDR_LEN_M)
  462. #define T6_ETH_HDR_LEN_S 24
  463. #define T6_ETH_HDR_LEN_M 0xFF
  464. #define T6_ETH_HDR_LEN_V(x) ((x) << T6_ETH_HDR_LEN_S)
  465. #define T6_ETH_HDR_LEN_G(x) (((x) >> T6_ETH_HDR_LEN_S) & T6_ETH_HDR_LEN_M)
  466. struct cpl_act_establish {
  467. union opcode_tid ot;
  468. __be32 rsvd;
  469. __be32 tos_atid;
  470. __be16 mac_idx;
  471. __be16 tcp_opt;
  472. __be32 snd_isn;
  473. __be32 rcv_isn;
  474. };
  475. struct cpl_get_tcb {
  476. WR_HDR;
  477. union opcode_tid ot;
  478. __be16 reply_ctrl;
  479. __be16 cookie;
  480. };
  481. /* cpl_get_tcb.reply_ctrl fields */
  482. #define QUEUENO_S 0
  483. #define QUEUENO_V(x) ((x) << QUEUENO_S)
  484. #define REPLY_CHAN_S 14
  485. #define REPLY_CHAN_V(x) ((x) << REPLY_CHAN_S)
  486. #define REPLY_CHAN_F REPLY_CHAN_V(1U)
  487. #define NO_REPLY_S 15
  488. #define NO_REPLY_V(x) ((x) << NO_REPLY_S)
  489. #define NO_REPLY_F NO_REPLY_V(1U)
  490. struct cpl_set_tcb_field {
  491. WR_HDR;
  492. union opcode_tid ot;
  493. __be16 reply_ctrl;
  494. __be16 word_cookie;
  495. __be64 mask;
  496. __be64 val;
  497. };
  498. /* cpl_set_tcb_field.word_cookie fields */
  499. #define TCB_WORD_S 0
  500. #define TCB_WORD(x) ((x) << TCB_WORD_S)
  501. #define TCB_COOKIE_S 5
  502. #define TCB_COOKIE_M 0x7
  503. #define TCB_COOKIE_V(x) ((x) << TCB_COOKIE_S)
  504. #define TCB_COOKIE_G(x) (((x) >> TCB_COOKIE_S) & TCB_COOKIE_M)
  505. struct cpl_set_tcb_rpl {
  506. union opcode_tid ot;
  507. __be16 rsvd;
  508. u8 cookie;
  509. u8 status;
  510. __be64 oldval;
  511. };
  512. struct cpl_close_con_req {
  513. WR_HDR;
  514. union opcode_tid ot;
  515. __be32 rsvd;
  516. };
  517. struct cpl_close_con_rpl {
  518. union opcode_tid ot;
  519. u8 rsvd[3];
  520. u8 status;
  521. __be32 snd_nxt;
  522. __be32 rcv_nxt;
  523. };
  524. struct cpl_close_listsvr_req {
  525. WR_HDR;
  526. union opcode_tid ot;
  527. __be16 reply_ctrl;
  528. __be16 rsvd;
  529. };
  530. /* additional cpl_close_listsvr_req.reply_ctrl field */
  531. #define LISTSVR_IPV6_S 14
  532. #define LISTSVR_IPV6_V(x) ((x) << LISTSVR_IPV6_S)
  533. #define LISTSVR_IPV6_F LISTSVR_IPV6_V(1U)
  534. struct cpl_close_listsvr_rpl {
  535. union opcode_tid ot;
  536. u8 rsvd[3];
  537. u8 status;
  538. };
  539. struct cpl_abort_req_rss {
  540. union opcode_tid ot;
  541. u8 rsvd[3];
  542. u8 status;
  543. };
  544. struct cpl_abort_req {
  545. WR_HDR;
  546. union opcode_tid ot;
  547. __be32 rsvd0;
  548. u8 rsvd1;
  549. u8 cmd;
  550. u8 rsvd2[6];
  551. };
  552. struct cpl_abort_rpl_rss {
  553. union opcode_tid ot;
  554. u8 rsvd[3];
  555. u8 status;
  556. };
  557. struct cpl_abort_rpl {
  558. WR_HDR;
  559. union opcode_tid ot;
  560. __be32 rsvd0;
  561. u8 rsvd1;
  562. u8 cmd;
  563. u8 rsvd2[6];
  564. };
  565. struct cpl_peer_close {
  566. union opcode_tid ot;
  567. __be32 rcv_nxt;
  568. };
  569. struct cpl_tid_release {
  570. WR_HDR;
  571. union opcode_tid ot;
  572. __be32 rsvd;
  573. };
  574. struct cpl_tx_pkt_core {
  575. __be32 ctrl0;
  576. __be16 pack;
  577. __be16 len;
  578. __be64 ctrl1;
  579. };
  580. struct cpl_tx_pkt {
  581. WR_HDR;
  582. struct cpl_tx_pkt_core c;
  583. };
  584. #define cpl_tx_pkt_xt cpl_tx_pkt
  585. /* cpl_tx_pkt_core.ctrl0 fields */
  586. #define TXPKT_VF_S 0
  587. #define TXPKT_VF_V(x) ((x) << TXPKT_VF_S)
  588. #define TXPKT_PF_S 8
  589. #define TXPKT_PF_V(x) ((x) << TXPKT_PF_S)
  590. #define TXPKT_VF_VLD_S 11
  591. #define TXPKT_VF_VLD_V(x) ((x) << TXPKT_VF_VLD_S)
  592. #define TXPKT_VF_VLD_F TXPKT_VF_VLD_V(1U)
  593. #define TXPKT_OVLAN_IDX_S 12
  594. #define TXPKT_OVLAN_IDX_V(x) ((x) << TXPKT_OVLAN_IDX_S)
  595. #define TXPKT_T5_OVLAN_IDX_S 12
  596. #define TXPKT_T5_OVLAN_IDX_V(x) ((x) << TXPKT_T5_OVLAN_IDX_S)
  597. #define TXPKT_INTF_S 16
  598. #define TXPKT_INTF_V(x) ((x) << TXPKT_INTF_S)
  599. #define TXPKT_INS_OVLAN_S 21
  600. #define TXPKT_INS_OVLAN_V(x) ((x) << TXPKT_INS_OVLAN_S)
  601. #define TXPKT_INS_OVLAN_F TXPKT_INS_OVLAN_V(1U)
  602. #define TXPKT_OPCODE_S 24
  603. #define TXPKT_OPCODE_V(x) ((x) << TXPKT_OPCODE_S)
  604. /* cpl_tx_pkt_core.ctrl1 fields */
  605. #define TXPKT_CSUM_END_S 12
  606. #define TXPKT_CSUM_END_V(x) ((x) << TXPKT_CSUM_END_S)
  607. #define TXPKT_CSUM_START_S 20
  608. #define TXPKT_CSUM_START_V(x) ((x) << TXPKT_CSUM_START_S)
  609. #define TXPKT_IPHDR_LEN_S 20
  610. #define TXPKT_IPHDR_LEN_V(x) ((__u64)(x) << TXPKT_IPHDR_LEN_S)
  611. #define TXPKT_CSUM_LOC_S 30
  612. #define TXPKT_CSUM_LOC_V(x) ((__u64)(x) << TXPKT_CSUM_LOC_S)
  613. #define TXPKT_ETHHDR_LEN_S 34
  614. #define TXPKT_ETHHDR_LEN_V(x) ((__u64)(x) << TXPKT_ETHHDR_LEN_S)
  615. #define T6_TXPKT_ETHHDR_LEN_S 32
  616. #define T6_TXPKT_ETHHDR_LEN_V(x) ((__u64)(x) << T6_TXPKT_ETHHDR_LEN_S)
  617. #define TXPKT_CSUM_TYPE_S 40
  618. #define TXPKT_CSUM_TYPE_V(x) ((__u64)(x) << TXPKT_CSUM_TYPE_S)
  619. #define TXPKT_VLAN_S 44
  620. #define TXPKT_VLAN_V(x) ((__u64)(x) << TXPKT_VLAN_S)
  621. #define TXPKT_VLAN_VLD_S 60
  622. #define TXPKT_VLAN_VLD_V(x) ((__u64)(x) << TXPKT_VLAN_VLD_S)
  623. #define TXPKT_VLAN_VLD_F TXPKT_VLAN_VLD_V(1ULL)
  624. #define TXPKT_IPCSUM_DIS_S 62
  625. #define TXPKT_IPCSUM_DIS_V(x) ((__u64)(x) << TXPKT_IPCSUM_DIS_S)
  626. #define TXPKT_IPCSUM_DIS_F TXPKT_IPCSUM_DIS_V(1ULL)
  627. #define TXPKT_L4CSUM_DIS_S 63
  628. #define TXPKT_L4CSUM_DIS_V(x) ((__u64)(x) << TXPKT_L4CSUM_DIS_S)
  629. #define TXPKT_L4CSUM_DIS_F TXPKT_L4CSUM_DIS_V(1ULL)
  630. struct cpl_tx_pkt_lso_core {
  631. __be32 lso_ctrl;
  632. __be16 ipid_ofst;
  633. __be16 mss;
  634. __be32 seqno_offset;
  635. __be32 len;
  636. /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
  637. };
  638. /* cpl_tx_pkt_lso_core.lso_ctrl fields */
  639. #define LSO_TCPHDR_LEN_S 0
  640. #define LSO_TCPHDR_LEN_V(x) ((x) << LSO_TCPHDR_LEN_S)
  641. #define LSO_IPHDR_LEN_S 4
  642. #define LSO_IPHDR_LEN_V(x) ((x) << LSO_IPHDR_LEN_S)
  643. #define LSO_ETHHDR_LEN_S 16
  644. #define LSO_ETHHDR_LEN_V(x) ((x) << LSO_ETHHDR_LEN_S)
  645. #define LSO_IPV6_S 20
  646. #define LSO_IPV6_V(x) ((x) << LSO_IPV6_S)
  647. #define LSO_IPV6_F LSO_IPV6_V(1U)
  648. #define LSO_LAST_SLICE_S 22
  649. #define LSO_LAST_SLICE_V(x) ((x) << LSO_LAST_SLICE_S)
  650. #define LSO_LAST_SLICE_F LSO_LAST_SLICE_V(1U)
  651. #define LSO_FIRST_SLICE_S 23
  652. #define LSO_FIRST_SLICE_V(x) ((x) << LSO_FIRST_SLICE_S)
  653. #define LSO_FIRST_SLICE_F LSO_FIRST_SLICE_V(1U)
  654. #define LSO_OPCODE_S 24
  655. #define LSO_OPCODE_V(x) ((x) << LSO_OPCODE_S)
  656. #define LSO_T5_XFER_SIZE_S 0
  657. #define LSO_T5_XFER_SIZE_V(x) ((x) << LSO_T5_XFER_SIZE_S)
  658. struct cpl_tx_pkt_lso {
  659. WR_HDR;
  660. struct cpl_tx_pkt_lso_core c;
  661. /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
  662. };
  663. struct cpl_iscsi_hdr {
  664. union opcode_tid ot;
  665. __be16 pdu_len_ddp;
  666. __be16 len;
  667. __be32 seq;
  668. __be16 urg;
  669. u8 rsvd;
  670. u8 status;
  671. };
  672. /* cpl_iscsi_hdr.pdu_len_ddp fields */
  673. #define ISCSI_PDU_LEN_S 0
  674. #define ISCSI_PDU_LEN_M 0x7FFF
  675. #define ISCSI_PDU_LEN_V(x) ((x) << ISCSI_PDU_LEN_S)
  676. #define ISCSI_PDU_LEN_G(x) (((x) >> ISCSI_PDU_LEN_S) & ISCSI_PDU_LEN_M)
  677. #define ISCSI_DDP_S 15
  678. #define ISCSI_DDP_V(x) ((x) << ISCSI_DDP_S)
  679. #define ISCSI_DDP_F ISCSI_DDP_V(1U)
  680. struct cpl_rx_data {
  681. union opcode_tid ot;
  682. __be16 rsvd;
  683. __be16 len;
  684. __be32 seq;
  685. __be16 urg;
  686. #if defined(__LITTLE_ENDIAN_BITFIELD)
  687. u8 dack_mode:2;
  688. u8 psh:1;
  689. u8 heartbeat:1;
  690. u8 ddp_off:1;
  691. u8 :3;
  692. #else
  693. u8 :3;
  694. u8 ddp_off:1;
  695. u8 heartbeat:1;
  696. u8 psh:1;
  697. u8 dack_mode:2;
  698. #endif
  699. u8 status;
  700. };
  701. struct cpl_rx_data_ack {
  702. WR_HDR;
  703. union opcode_tid ot;
  704. __be32 credit_dack;
  705. };
  706. /* cpl_rx_data_ack.ack_seq fields */
  707. #define RX_CREDITS_S 0
  708. #define RX_CREDITS_V(x) ((x) << RX_CREDITS_S)
  709. #define RX_FORCE_ACK_S 28
  710. #define RX_FORCE_ACK_V(x) ((x) << RX_FORCE_ACK_S)
  711. #define RX_FORCE_ACK_F RX_FORCE_ACK_V(1U)
  712. struct cpl_rx_pkt {
  713. struct rss_header rsshdr;
  714. u8 opcode;
  715. #if defined(__LITTLE_ENDIAN_BITFIELD)
  716. u8 iff:4;
  717. u8 csum_calc:1;
  718. u8 ipmi_pkt:1;
  719. u8 vlan_ex:1;
  720. u8 ip_frag:1;
  721. #else
  722. u8 ip_frag:1;
  723. u8 vlan_ex:1;
  724. u8 ipmi_pkt:1;
  725. u8 csum_calc:1;
  726. u8 iff:4;
  727. #endif
  728. __be16 csum;
  729. __be16 vlan;
  730. __be16 len;
  731. __be32 l2info;
  732. __be16 hdr_len;
  733. __be16 err_vec;
  734. };
  735. #define RX_T6_ETHHDR_LEN_M 0xFF
  736. #define RX_T6_ETHHDR_LEN_G(x) (((x) >> RX_ETHHDR_LEN_S) & RX_T6_ETHHDR_LEN_M)
  737. #define RXF_PSH_S 20
  738. #define RXF_PSH_V(x) ((x) << RXF_PSH_S)
  739. #define RXF_PSH_F RXF_PSH_V(1U)
  740. #define RXF_SYN_S 21
  741. #define RXF_SYN_V(x) ((x) << RXF_SYN_S)
  742. #define RXF_SYN_F RXF_SYN_V(1U)
  743. #define RXF_UDP_S 22
  744. #define RXF_UDP_V(x) ((x) << RXF_UDP_S)
  745. #define RXF_UDP_F RXF_UDP_V(1U)
  746. #define RXF_TCP_S 23
  747. #define RXF_TCP_V(x) ((x) << RXF_TCP_S)
  748. #define RXF_TCP_F RXF_TCP_V(1U)
  749. #define RXF_IP_S 24
  750. #define RXF_IP_V(x) ((x) << RXF_IP_S)
  751. #define RXF_IP_F RXF_IP_V(1U)
  752. #define RXF_IP6_S 25
  753. #define RXF_IP6_V(x) ((x) << RXF_IP6_S)
  754. #define RXF_IP6_F RXF_IP6_V(1U)
  755. #define RXF_SYN_COOKIE_S 26
  756. #define RXF_SYN_COOKIE_V(x) ((x) << RXF_SYN_COOKIE_S)
  757. #define RXF_SYN_COOKIE_F RXF_SYN_COOKIE_V(1U)
  758. #define RXF_FCOE_S 26
  759. #define RXF_FCOE_V(x) ((x) << RXF_FCOE_S)
  760. #define RXF_FCOE_F RXF_FCOE_V(1U)
  761. #define RXF_LRO_S 27
  762. #define RXF_LRO_V(x) ((x) << RXF_LRO_S)
  763. #define RXF_LRO_F RXF_LRO_V(1U)
  764. /* rx_pkt.l2info fields */
  765. #define RX_ETHHDR_LEN_S 0
  766. #define RX_ETHHDR_LEN_M 0x1F
  767. #define RX_ETHHDR_LEN_V(x) ((x) << RX_ETHHDR_LEN_S)
  768. #define RX_ETHHDR_LEN_G(x) (((x) >> RX_ETHHDR_LEN_S) & RX_ETHHDR_LEN_M)
  769. #define RX_T5_ETHHDR_LEN_S 0
  770. #define RX_T5_ETHHDR_LEN_M 0x3F
  771. #define RX_T5_ETHHDR_LEN_V(x) ((x) << RX_T5_ETHHDR_LEN_S)
  772. #define RX_T5_ETHHDR_LEN_G(x) (((x) >> RX_T5_ETHHDR_LEN_S) & RX_T5_ETHHDR_LEN_M)
  773. #define RX_MACIDX_S 8
  774. #define RX_MACIDX_M 0x1FF
  775. #define RX_MACIDX_V(x) ((x) << RX_MACIDX_S)
  776. #define RX_MACIDX_G(x) (((x) >> RX_MACIDX_S) & RX_MACIDX_M)
  777. #define RXF_SYN_S 21
  778. #define RXF_SYN_V(x) ((x) << RXF_SYN_S)
  779. #define RXF_SYN_F RXF_SYN_V(1U)
  780. #define RX_CHAN_S 28
  781. #define RX_CHAN_M 0xF
  782. #define RX_CHAN_V(x) ((x) << RX_CHAN_S)
  783. #define RX_CHAN_G(x) (((x) >> RX_CHAN_S) & RX_CHAN_M)
  784. /* rx_pkt.hdr_len fields */
  785. #define RX_TCPHDR_LEN_S 0
  786. #define RX_TCPHDR_LEN_M 0x3F
  787. #define RX_TCPHDR_LEN_V(x) ((x) << RX_TCPHDR_LEN_S)
  788. #define RX_TCPHDR_LEN_G(x) (((x) >> RX_TCPHDR_LEN_S) & RX_TCPHDR_LEN_M)
  789. #define RX_IPHDR_LEN_S 6
  790. #define RX_IPHDR_LEN_M 0x3FF
  791. #define RX_IPHDR_LEN_V(x) ((x) << RX_IPHDR_LEN_S)
  792. #define RX_IPHDR_LEN_G(x) (((x) >> RX_IPHDR_LEN_S) & RX_IPHDR_LEN_M)
  793. /* rx_pkt.err_vec fields */
  794. #define RXERR_CSUM_S 13
  795. #define RXERR_CSUM_V(x) ((x) << RXERR_CSUM_S)
  796. #define RXERR_CSUM_F RXERR_CSUM_V(1U)
  797. struct cpl_trace_pkt {
  798. u8 opcode;
  799. u8 intf;
  800. #if defined(__LITTLE_ENDIAN_BITFIELD)
  801. u8 runt:4;
  802. u8 filter_hit:4;
  803. u8 :6;
  804. u8 err:1;
  805. u8 trunc:1;
  806. #else
  807. u8 filter_hit:4;
  808. u8 runt:4;
  809. u8 trunc:1;
  810. u8 err:1;
  811. u8 :6;
  812. #endif
  813. __be16 rsvd;
  814. __be16 len;
  815. __be64 tstamp;
  816. };
  817. struct cpl_t5_trace_pkt {
  818. __u8 opcode;
  819. __u8 intf;
  820. #if defined(__LITTLE_ENDIAN_BITFIELD)
  821. __u8 runt:4;
  822. __u8 filter_hit:4;
  823. __u8:6;
  824. __u8 err:1;
  825. __u8 trunc:1;
  826. #else
  827. __u8 filter_hit:4;
  828. __u8 runt:4;
  829. __u8 trunc:1;
  830. __u8 err:1;
  831. __u8:6;
  832. #endif
  833. __be16 rsvd;
  834. __be16 len;
  835. __be64 tstamp;
  836. __be64 rsvd1;
  837. };
  838. struct cpl_l2t_write_req {
  839. WR_HDR;
  840. union opcode_tid ot;
  841. __be16 params;
  842. __be16 l2t_idx;
  843. __be16 vlan;
  844. u8 dst_mac[6];
  845. };
  846. /* cpl_l2t_write_req.params fields */
  847. #define L2T_W_INFO_S 2
  848. #define L2T_W_INFO_V(x) ((x) << L2T_W_INFO_S)
  849. #define L2T_W_PORT_S 8
  850. #define L2T_W_PORT_V(x) ((x) << L2T_W_PORT_S)
  851. #define L2T_W_NOREPLY_S 15
  852. #define L2T_W_NOREPLY_V(x) ((x) << L2T_W_NOREPLY_S)
  853. #define L2T_W_NOREPLY_F L2T_W_NOREPLY_V(1U)
  854. struct cpl_l2t_write_rpl {
  855. union opcode_tid ot;
  856. u8 status;
  857. u8 rsvd[3];
  858. };
  859. struct cpl_rdma_terminate {
  860. union opcode_tid ot;
  861. __be16 rsvd;
  862. __be16 len;
  863. };
  864. struct cpl_sge_egr_update {
  865. __be32 opcode_qid;
  866. __be16 cidx;
  867. __be16 pidx;
  868. };
  869. /* cpl_sge_egr_update.ot fields */
  870. #define EGR_QID_S 0
  871. #define EGR_QID_M 0x1FFFF
  872. #define EGR_QID_G(x) (((x) >> EGR_QID_S) & EGR_QID_M)
  873. /* cpl_fw*.type values */
  874. enum {
  875. FW_TYPE_CMD_RPL = 0,
  876. FW_TYPE_WR_RPL = 1,
  877. FW_TYPE_CQE = 2,
  878. FW_TYPE_OFLD_CONNECTION_WR_RPL = 3,
  879. FW_TYPE_RSSCPL = 4,
  880. };
  881. struct cpl_fw4_pld {
  882. u8 opcode;
  883. u8 rsvd0[3];
  884. u8 type;
  885. u8 rsvd1;
  886. __be16 len;
  887. __be64 data;
  888. __be64 rsvd2;
  889. };
  890. struct cpl_fw6_pld {
  891. u8 opcode;
  892. u8 rsvd[5];
  893. __be16 len;
  894. __be64 data[4];
  895. };
  896. struct cpl_fw4_msg {
  897. u8 opcode;
  898. u8 type;
  899. __be16 rsvd0;
  900. __be32 rsvd1;
  901. __be64 data[2];
  902. };
  903. struct cpl_fw4_ack {
  904. union opcode_tid ot;
  905. u8 credits;
  906. u8 rsvd0[2];
  907. u8 seq_vld;
  908. __be32 snd_nxt;
  909. __be32 snd_una;
  910. __be64 rsvd1;
  911. };
  912. struct cpl_fw6_msg {
  913. u8 opcode;
  914. u8 type;
  915. __be16 rsvd0;
  916. __be32 rsvd1;
  917. __be64 data[4];
  918. };
  919. /* cpl_fw6_msg.type values */
  920. enum {
  921. FW6_TYPE_CMD_RPL = 0,
  922. FW6_TYPE_WR_RPL = 1,
  923. FW6_TYPE_CQE = 2,
  924. FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3,
  925. FW6_TYPE_RSSCPL = FW_TYPE_RSSCPL,
  926. };
  927. struct cpl_fw6_msg_ofld_connection_wr_rpl {
  928. __u64 cookie;
  929. __be32 tid; /* or atid in case of active failure */
  930. __u8 t_state;
  931. __u8 retval;
  932. __u8 rsvd[2];
  933. };
  934. enum {
  935. ULP_TX_MEM_READ = 2,
  936. ULP_TX_MEM_WRITE = 3,
  937. ULP_TX_PKT = 4
  938. };
  939. enum {
  940. ULP_TX_SC_NOOP = 0x80,
  941. ULP_TX_SC_IMM = 0x81,
  942. ULP_TX_SC_DSGL = 0x82,
  943. ULP_TX_SC_ISGL = 0x83
  944. };
  945. #define ULPTX_CMD_S 24
  946. #define ULPTX_CMD_V(x) ((x) << ULPTX_CMD_S)
  947. struct ulptx_sge_pair {
  948. __be32 len[2];
  949. __be64 addr[2];
  950. };
  951. struct ulptx_sgl {
  952. __be32 cmd_nsge;
  953. __be32 len0;
  954. __be64 addr0;
  955. struct ulptx_sge_pair sge[0];
  956. };
  957. #define ULPTX_NSGE_S 0
  958. #define ULPTX_NSGE_V(x) ((x) << ULPTX_NSGE_S)
  959. #define ULPTX_MORE_S 23
  960. #define ULPTX_MORE_V(x) ((x) << ULPTX_MORE_S)
  961. #define ULPTX_MORE_F ULPTX_MORE_V(1U)
  962. struct ulp_mem_io {
  963. WR_HDR;
  964. __be32 cmd;
  965. __be32 len16; /* command length */
  966. __be32 dlen; /* data length in 32-byte units */
  967. __be32 lock_addr;
  968. };
  969. #define ULP_MEMIO_LOCK_S 31
  970. #define ULP_MEMIO_LOCK_V(x) ((x) << ULP_MEMIO_LOCK_S)
  971. #define ULP_MEMIO_LOCK_F ULP_MEMIO_LOCK_V(1U)
  972. /* additional ulp_mem_io.cmd fields */
  973. #define ULP_MEMIO_ORDER_S 23
  974. #define ULP_MEMIO_ORDER_V(x) ((x) << ULP_MEMIO_ORDER_S)
  975. #define ULP_MEMIO_ORDER_F ULP_MEMIO_ORDER_V(1U)
  976. #define T5_ULP_MEMIO_IMM_S 23
  977. #define T5_ULP_MEMIO_IMM_V(x) ((x) << T5_ULP_MEMIO_IMM_S)
  978. #define T5_ULP_MEMIO_IMM_F T5_ULP_MEMIO_IMM_V(1U)
  979. #define T5_ULP_MEMIO_ORDER_S 22
  980. #define T5_ULP_MEMIO_ORDER_V(x) ((x) << T5_ULP_MEMIO_ORDER_S)
  981. #define T5_ULP_MEMIO_ORDER_F T5_ULP_MEMIO_ORDER_V(1U)
  982. /* ulp_mem_io.lock_addr fields */
  983. #define ULP_MEMIO_ADDR_S 0
  984. #define ULP_MEMIO_ADDR_V(x) ((x) << ULP_MEMIO_ADDR_S)
  985. /* ulp_mem_io.dlen fields */
  986. #define ULP_MEMIO_DATA_LEN_S 0
  987. #define ULP_MEMIO_DATA_LEN_V(x) ((x) << ULP_MEMIO_DATA_LEN_S)
  988. #endif /* __T4_MSG_H */