t4_msg.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. /*
  2. * This file is part of the Chelsio T4 Ethernet driver for Linux.
  3. *
  4. * Copyright (c) 2003-2010 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_RDMA_READ_REQ = 0x60,
  72. CPL_PASS_OPEN_REQ6 = 0x81,
  73. CPL_ACT_OPEN_REQ6 = 0x83,
  74. CPL_RDMA_TERMINATE = 0xA2,
  75. CPL_RDMA_WRITE = 0xA4,
  76. CPL_SGE_EGR_UPDATE = 0xA5,
  77. CPL_TRACE_PKT = 0xB0,
  78. CPL_FW4_MSG = 0xC0,
  79. CPL_FW4_PLD = 0xC1,
  80. CPL_FW4_ACK = 0xC3,
  81. CPL_FW6_MSG = 0xE0,
  82. CPL_FW6_PLD = 0xE1,
  83. CPL_TX_PKT_LSO = 0xED,
  84. CPL_TX_PKT_XT = 0xEE,
  85. NUM_CPL_CMDS
  86. };
  87. enum CPL_error {
  88. CPL_ERR_NONE = 0,
  89. CPL_ERR_TCAM_FULL = 3,
  90. CPL_ERR_BAD_LENGTH = 15,
  91. CPL_ERR_BAD_ROUTE = 18,
  92. CPL_ERR_CONN_RESET = 20,
  93. CPL_ERR_CONN_EXIST_SYNRECV = 21,
  94. CPL_ERR_CONN_EXIST = 22,
  95. CPL_ERR_ARP_MISS = 23,
  96. CPL_ERR_BAD_SYN = 24,
  97. CPL_ERR_CONN_TIMEDOUT = 30,
  98. CPL_ERR_XMIT_TIMEDOUT = 31,
  99. CPL_ERR_PERSIST_TIMEDOUT = 32,
  100. CPL_ERR_FINWAIT2_TIMEDOUT = 33,
  101. CPL_ERR_KEEPALIVE_TIMEDOUT = 34,
  102. CPL_ERR_RTX_NEG_ADVICE = 35,
  103. CPL_ERR_PERSIST_NEG_ADVICE = 36,
  104. CPL_ERR_ABORT_FAILED = 42,
  105. CPL_ERR_IWARP_FLM = 50,
  106. };
  107. enum {
  108. ULP_MODE_NONE = 0,
  109. ULP_MODE_ISCSI = 2,
  110. ULP_MODE_RDMA = 4,
  111. ULP_MODE_TCPDDP = 5,
  112. ULP_MODE_FCOE = 6,
  113. };
  114. enum {
  115. ULP_CRC_HEADER = 1 << 0,
  116. ULP_CRC_DATA = 1 << 1
  117. };
  118. enum {
  119. CPL_ABORT_SEND_RST = 0,
  120. CPL_ABORT_NO_RST,
  121. };
  122. enum { /* TX_PKT_XT checksum types */
  123. TX_CSUM_TCP = 0,
  124. TX_CSUM_UDP = 1,
  125. TX_CSUM_CRC16 = 4,
  126. TX_CSUM_CRC32 = 5,
  127. TX_CSUM_CRC32C = 6,
  128. TX_CSUM_FCOE = 7,
  129. TX_CSUM_TCPIP = 8,
  130. TX_CSUM_UDPIP = 9,
  131. TX_CSUM_TCPIP6 = 10,
  132. TX_CSUM_UDPIP6 = 11,
  133. TX_CSUM_IP = 12,
  134. };
  135. union opcode_tid {
  136. __be32 opcode_tid;
  137. u8 opcode;
  138. };
  139. #define CPL_OPCODE(x) ((x) << 24)
  140. #define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE(opcode) | (tid))
  141. #define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
  142. #define GET_TID(cmd) (ntohl(OPCODE_TID(cmd)) & 0xFFFFFF)
  143. /* partitioning of TID fields that also carry a queue id */
  144. #define GET_TID_TID(x) ((x) & 0x3fff)
  145. #define GET_TID_QID(x) (((x) >> 14) & 0x3ff)
  146. #define TID_QID(x) ((x) << 14)
  147. struct rss_header {
  148. u8 opcode;
  149. #if defined(__LITTLE_ENDIAN_BITFIELD)
  150. u8 channel:2;
  151. u8 filter_hit:1;
  152. u8 filter_tid:1;
  153. u8 hash_type:2;
  154. u8 ipv6:1;
  155. u8 send2fw:1;
  156. #else
  157. u8 send2fw:1;
  158. u8 ipv6:1;
  159. u8 hash_type:2;
  160. u8 filter_tid:1;
  161. u8 filter_hit:1;
  162. u8 channel:2;
  163. #endif
  164. __be16 qid;
  165. __be32 hash_val;
  166. };
  167. struct work_request_hdr {
  168. __be32 wr_hi;
  169. __be32 wr_mid;
  170. __be64 wr_lo;
  171. };
  172. #define WR_HDR struct work_request_hdr wr
  173. struct cpl_pass_open_req {
  174. WR_HDR;
  175. union opcode_tid ot;
  176. __be16 local_port;
  177. __be16 peer_port;
  178. __be32 local_ip;
  179. __be32 peer_ip;
  180. __be64 opt0;
  181. #define TX_CHAN(x) ((x) << 2)
  182. #define DELACK(x) ((x) << 5)
  183. #define ULP_MODE(x) ((x) << 8)
  184. #define RCV_BUFSIZ(x) ((x) << 12)
  185. #define DSCP(x) ((x) << 22)
  186. #define SMAC_SEL(x) ((u64)(x) << 28)
  187. #define L2T_IDX(x) ((u64)(x) << 36)
  188. #define NAGLE(x) ((u64)(x) << 49)
  189. #define WND_SCALE(x) ((u64)(x) << 50)
  190. #define KEEP_ALIVE(x) ((u64)(x) << 54)
  191. #define MSS_IDX(x) ((u64)(x) << 60)
  192. __be64 opt1;
  193. #define SYN_RSS_ENABLE (1 << 0)
  194. #define SYN_RSS_QUEUE(x) ((x) << 2)
  195. #define CONN_POLICY_ASK (1 << 22)
  196. };
  197. struct cpl_pass_open_req6 {
  198. WR_HDR;
  199. union opcode_tid ot;
  200. __be16 local_port;
  201. __be16 peer_port;
  202. __be64 local_ip_hi;
  203. __be64 local_ip_lo;
  204. __be64 peer_ip_hi;
  205. __be64 peer_ip_lo;
  206. __be64 opt0;
  207. __be64 opt1;
  208. };
  209. struct cpl_pass_open_rpl {
  210. union opcode_tid ot;
  211. u8 rsvd[3];
  212. u8 status;
  213. };
  214. struct cpl_pass_accept_rpl {
  215. WR_HDR;
  216. union opcode_tid ot;
  217. __be32 opt2;
  218. #define RSS_QUEUE(x) ((x) << 0)
  219. #define RSS_QUEUE_VALID (1 << 10)
  220. #define RX_COALESCE_VALID(x) ((x) << 11)
  221. #define RX_COALESCE(x) ((x) << 12)
  222. #define TX_QUEUE(x) ((x) << 23)
  223. #define RX_CHANNEL(x) ((x) << 26)
  224. #define WND_SCALE_EN(x) ((x) << 28)
  225. #define TSTAMPS_EN(x) ((x) << 29)
  226. #define SACK_EN(x) ((x) << 30)
  227. __be64 opt0;
  228. };
  229. struct cpl_act_open_req {
  230. WR_HDR;
  231. union opcode_tid ot;
  232. __be16 local_port;
  233. __be16 peer_port;
  234. __be32 local_ip;
  235. __be32 peer_ip;
  236. __be64 opt0;
  237. __be32 params;
  238. __be32 opt2;
  239. };
  240. struct cpl_act_open_req6 {
  241. WR_HDR;
  242. union opcode_tid ot;
  243. __be16 local_port;
  244. __be16 peer_port;
  245. __be64 local_ip_hi;
  246. __be64 local_ip_lo;
  247. __be64 peer_ip_hi;
  248. __be64 peer_ip_lo;
  249. __be64 opt0;
  250. __be32 params;
  251. __be32 opt2;
  252. };
  253. struct cpl_act_open_rpl {
  254. union opcode_tid ot;
  255. __be32 atid_status;
  256. #define GET_AOPEN_STATUS(x) ((x) & 0xff)
  257. #define GET_AOPEN_ATID(x) (((x) >> 8) & 0xffffff)
  258. };
  259. struct cpl_pass_establish {
  260. union opcode_tid ot;
  261. __be32 rsvd;
  262. __be32 tos_stid;
  263. #define GET_POPEN_TID(x) ((x) & 0xffffff)
  264. #define GET_POPEN_TOS(x) (((x) >> 24) & 0xff)
  265. __be16 mac_idx;
  266. __be16 tcp_opt;
  267. #define GET_TCPOPT_WSCALE_OK(x) (((x) >> 5) & 1)
  268. #define GET_TCPOPT_SACK(x) (((x) >> 6) & 1)
  269. #define GET_TCPOPT_TSTAMP(x) (((x) >> 7) & 1)
  270. #define GET_TCPOPT_SND_WSCALE(x) (((x) >> 8) & 0xf)
  271. #define GET_TCPOPT_MSS(x) (((x) >> 12) & 0xf)
  272. __be32 snd_isn;
  273. __be32 rcv_isn;
  274. };
  275. struct cpl_act_establish {
  276. union opcode_tid ot;
  277. __be32 rsvd;
  278. __be32 tos_atid;
  279. __be16 mac_idx;
  280. __be16 tcp_opt;
  281. __be32 snd_isn;
  282. __be32 rcv_isn;
  283. };
  284. struct cpl_get_tcb {
  285. WR_HDR;
  286. union opcode_tid ot;
  287. __be16 reply_ctrl;
  288. #define QUEUENO(x) ((x) << 0)
  289. #define REPLY_CHAN(x) ((x) << 14)
  290. #define NO_REPLY(x) ((x) << 15)
  291. __be16 cookie;
  292. };
  293. struct cpl_set_tcb_field {
  294. WR_HDR;
  295. union opcode_tid ot;
  296. __be16 reply_ctrl;
  297. __be16 word_cookie;
  298. #define TCB_WORD(x) ((x) << 0)
  299. #define TCB_COOKIE(x) ((x) << 5)
  300. __be64 mask;
  301. __be64 val;
  302. };
  303. struct cpl_set_tcb_rpl {
  304. union opcode_tid ot;
  305. __be16 rsvd;
  306. u8 cookie;
  307. u8 status;
  308. __be64 oldval;
  309. };
  310. struct cpl_close_con_req {
  311. WR_HDR;
  312. union opcode_tid ot;
  313. __be32 rsvd;
  314. };
  315. struct cpl_close_con_rpl {
  316. union opcode_tid ot;
  317. u8 rsvd[3];
  318. u8 status;
  319. __be32 snd_nxt;
  320. __be32 rcv_nxt;
  321. };
  322. struct cpl_close_listsvr_req {
  323. WR_HDR;
  324. union opcode_tid ot;
  325. __be16 reply_ctrl;
  326. #define LISTSVR_IPV6 (1 << 14)
  327. __be16 rsvd;
  328. };
  329. struct cpl_close_listsvr_rpl {
  330. union opcode_tid ot;
  331. u8 rsvd[3];
  332. u8 status;
  333. };
  334. struct cpl_abort_req_rss {
  335. union opcode_tid ot;
  336. u8 rsvd[3];
  337. u8 status;
  338. };
  339. struct cpl_abort_req {
  340. WR_HDR;
  341. union opcode_tid ot;
  342. __be32 rsvd0;
  343. u8 rsvd1;
  344. u8 cmd;
  345. u8 rsvd2[6];
  346. };
  347. struct cpl_abort_rpl_rss {
  348. union opcode_tid ot;
  349. u8 rsvd[3];
  350. u8 status;
  351. };
  352. struct cpl_abort_rpl {
  353. WR_HDR;
  354. union opcode_tid ot;
  355. __be32 rsvd0;
  356. u8 rsvd1;
  357. u8 cmd;
  358. u8 rsvd2[6];
  359. };
  360. struct cpl_peer_close {
  361. union opcode_tid ot;
  362. __be32 rcv_nxt;
  363. };
  364. struct cpl_tid_release {
  365. WR_HDR;
  366. union opcode_tid ot;
  367. __be32 rsvd;
  368. };
  369. struct cpl_tx_pkt_core {
  370. __be32 ctrl0;
  371. #define TXPKT_VF(x) ((x) << 0)
  372. #define TXPKT_PF(x) ((x) << 8)
  373. #define TXPKT_VF_VLD (1 << 11)
  374. #define TXPKT_OVLAN_IDX(x) ((x) << 12)
  375. #define TXPKT_INTF(x) ((x) << 16)
  376. #define TXPKT_INS_OVLAN (1 << 21)
  377. #define TXPKT_OPCODE(x) ((x) << 24)
  378. __be16 pack;
  379. __be16 len;
  380. __be64 ctrl1;
  381. #define TXPKT_CSUM_END(x) ((x) << 12)
  382. #define TXPKT_CSUM_START(x) ((x) << 20)
  383. #define TXPKT_IPHDR_LEN(x) ((u64)(x) << 20)
  384. #define TXPKT_CSUM_LOC(x) ((u64)(x) << 30)
  385. #define TXPKT_ETHHDR_LEN(x) ((u64)(x) << 34)
  386. #define TXPKT_CSUM_TYPE(x) ((u64)(x) << 40)
  387. #define TXPKT_VLAN(x) ((u64)(x) << 44)
  388. #define TXPKT_VLAN_VLD (1ULL << 60)
  389. #define TXPKT_IPCSUM_DIS (1ULL << 62)
  390. #define TXPKT_L4CSUM_DIS (1ULL << 63)
  391. };
  392. struct cpl_tx_pkt {
  393. WR_HDR;
  394. struct cpl_tx_pkt_core c;
  395. };
  396. #define cpl_tx_pkt_xt cpl_tx_pkt
  397. struct cpl_tx_pkt_lso_core {
  398. __be32 lso_ctrl;
  399. #define LSO_TCPHDR_LEN(x) ((x) << 0)
  400. #define LSO_IPHDR_LEN(x) ((x) << 4)
  401. #define LSO_ETHHDR_LEN(x) ((x) << 16)
  402. #define LSO_IPV6(x) ((x) << 20)
  403. #define LSO_LAST_SLICE (1 << 22)
  404. #define LSO_FIRST_SLICE (1 << 23)
  405. #define LSO_OPCODE(x) ((x) << 24)
  406. __be16 ipid_ofst;
  407. __be16 mss;
  408. __be32 seqno_offset;
  409. __be32 len;
  410. /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
  411. };
  412. struct cpl_tx_pkt_lso {
  413. WR_HDR;
  414. struct cpl_tx_pkt_lso_core c;
  415. /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
  416. };
  417. struct cpl_iscsi_hdr {
  418. union opcode_tid ot;
  419. __be16 pdu_len_ddp;
  420. #define ISCSI_PDU_LEN(x) ((x) & 0x7FFF)
  421. #define ISCSI_DDP (1 << 15)
  422. __be16 len;
  423. __be32 seq;
  424. __be16 urg;
  425. u8 rsvd;
  426. u8 status;
  427. };
  428. struct cpl_rx_data {
  429. union opcode_tid ot;
  430. __be16 rsvd;
  431. __be16 len;
  432. __be32 seq;
  433. __be16 urg;
  434. #if defined(__LITTLE_ENDIAN_BITFIELD)
  435. u8 dack_mode:2;
  436. u8 psh:1;
  437. u8 heartbeat:1;
  438. u8 ddp_off:1;
  439. u8 :3;
  440. #else
  441. u8 :3;
  442. u8 ddp_off:1;
  443. u8 heartbeat:1;
  444. u8 psh:1;
  445. u8 dack_mode:2;
  446. #endif
  447. u8 status;
  448. };
  449. struct cpl_rx_data_ack {
  450. WR_HDR;
  451. union opcode_tid ot;
  452. __be32 credit_dack;
  453. #define RX_CREDITS(x) ((x) << 0)
  454. #define RX_FORCE_ACK(x) ((x) << 28)
  455. };
  456. struct cpl_rx_pkt {
  457. struct rss_header rsshdr;
  458. u8 opcode;
  459. #if defined(__LITTLE_ENDIAN_BITFIELD)
  460. u8 iff:4;
  461. u8 csum_calc:1;
  462. u8 ipmi_pkt:1;
  463. u8 vlan_ex:1;
  464. u8 ip_frag:1;
  465. #else
  466. u8 ip_frag:1;
  467. u8 vlan_ex:1;
  468. u8 ipmi_pkt:1;
  469. u8 csum_calc:1;
  470. u8 iff:4;
  471. #endif
  472. __be16 csum;
  473. __be16 vlan;
  474. __be16 len;
  475. __be32 l2info;
  476. #define RXF_UDP (1 << 22)
  477. #define RXF_TCP (1 << 23)
  478. #define RXF_IP (1 << 24)
  479. #define RXF_IP6 (1 << 25)
  480. __be16 hdr_len;
  481. __be16 err_vec;
  482. };
  483. struct cpl_trace_pkt {
  484. u8 opcode;
  485. u8 intf;
  486. #if defined(__LITTLE_ENDIAN_BITFIELD)
  487. u8 runt:4;
  488. u8 filter_hit:4;
  489. u8 :6;
  490. u8 err:1;
  491. u8 trunc:1;
  492. #else
  493. u8 filter_hit:4;
  494. u8 runt:4;
  495. u8 trunc:1;
  496. u8 err:1;
  497. u8 :6;
  498. #endif
  499. __be16 rsvd;
  500. __be16 len;
  501. __be64 tstamp;
  502. };
  503. struct cpl_l2t_write_req {
  504. WR_HDR;
  505. union opcode_tid ot;
  506. __be16 params;
  507. #define L2T_W_INFO(x) ((x) << 2)
  508. #define L2T_W_PORT(x) ((x) << 8)
  509. #define L2T_W_NOREPLY(x) ((x) << 15)
  510. __be16 l2t_idx;
  511. __be16 vlan;
  512. u8 dst_mac[6];
  513. };
  514. struct cpl_l2t_write_rpl {
  515. union opcode_tid ot;
  516. u8 status;
  517. u8 rsvd[3];
  518. };
  519. struct cpl_rdma_terminate {
  520. union opcode_tid ot;
  521. __be16 rsvd;
  522. __be16 len;
  523. };
  524. struct cpl_sge_egr_update {
  525. __be32 opcode_qid;
  526. #define EGR_QID(x) ((x) & 0x1FFFF)
  527. __be16 cidx;
  528. __be16 pidx;
  529. };
  530. struct cpl_fw4_pld {
  531. u8 opcode;
  532. u8 rsvd0[3];
  533. u8 type;
  534. u8 rsvd1;
  535. __be16 len;
  536. __be64 data;
  537. __be64 rsvd2;
  538. };
  539. struct cpl_fw6_pld {
  540. u8 opcode;
  541. u8 rsvd[5];
  542. __be16 len;
  543. __be64 data[4];
  544. };
  545. struct cpl_fw4_msg {
  546. u8 opcode;
  547. u8 type;
  548. __be16 rsvd0;
  549. __be32 rsvd1;
  550. __be64 data[2];
  551. };
  552. struct cpl_fw4_ack {
  553. union opcode_tid ot;
  554. u8 credits;
  555. u8 rsvd0[2];
  556. u8 seq_vld;
  557. __be32 snd_nxt;
  558. __be32 snd_una;
  559. __be64 rsvd1;
  560. };
  561. struct cpl_fw6_msg {
  562. u8 opcode;
  563. u8 type;
  564. __be16 rsvd0;
  565. __be32 rsvd1;
  566. __be64 data[4];
  567. };
  568. /* cpl_fw6_msg.type values */
  569. enum {
  570. FW6_TYPE_CMD_RPL = 0,
  571. };
  572. enum {
  573. ULP_TX_MEM_READ = 2,
  574. ULP_TX_MEM_WRITE = 3,
  575. ULP_TX_PKT = 4
  576. };
  577. enum {
  578. ULP_TX_SC_NOOP = 0x80,
  579. ULP_TX_SC_IMM = 0x81,
  580. ULP_TX_SC_DSGL = 0x82,
  581. ULP_TX_SC_ISGL = 0x83
  582. };
  583. struct ulptx_sge_pair {
  584. __be32 len[2];
  585. __be64 addr[2];
  586. };
  587. struct ulptx_sgl {
  588. __be32 cmd_nsge;
  589. #define ULPTX_CMD(x) ((x) << 24)
  590. #define ULPTX_NSGE(x) ((x) << 0)
  591. __be32 len0;
  592. __be64 addr0;
  593. struct ulptx_sge_pair sge[0];
  594. };
  595. struct ulp_mem_io {
  596. WR_HDR;
  597. __be32 cmd;
  598. #define ULP_MEMIO_ORDER(x) ((x) << 23)
  599. __be32 len16; /* command length */
  600. __be32 dlen; /* data length in 32-byte units */
  601. #define ULP_MEMIO_DATA_LEN(x) ((x) << 0)
  602. __be32 lock_addr;
  603. #define ULP_MEMIO_ADDR(x) ((x) << 0)
  604. #define ULP_MEMIO_LOCK(x) ((x) << 31)
  605. };
  606. #endif /* __T4_MSG_H */