t4_msg.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  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. #define GET_TCB_COOKIE(x) (((x) >> 5) & 7)
  301. __be64 mask;
  302. __be64 val;
  303. };
  304. struct cpl_set_tcb_rpl {
  305. union opcode_tid ot;
  306. __be16 rsvd;
  307. u8 cookie;
  308. u8 status;
  309. __be64 oldval;
  310. };
  311. struct cpl_close_con_req {
  312. WR_HDR;
  313. union opcode_tid ot;
  314. __be32 rsvd;
  315. };
  316. struct cpl_close_con_rpl {
  317. union opcode_tid ot;
  318. u8 rsvd[3];
  319. u8 status;
  320. __be32 snd_nxt;
  321. __be32 rcv_nxt;
  322. };
  323. struct cpl_close_listsvr_req {
  324. WR_HDR;
  325. union opcode_tid ot;
  326. __be16 reply_ctrl;
  327. #define LISTSVR_IPV6 (1 << 14)
  328. __be16 rsvd;
  329. };
  330. struct cpl_close_listsvr_rpl {
  331. union opcode_tid ot;
  332. u8 rsvd[3];
  333. u8 status;
  334. };
  335. struct cpl_abort_req_rss {
  336. union opcode_tid ot;
  337. u8 rsvd[3];
  338. u8 status;
  339. };
  340. struct cpl_abort_req {
  341. WR_HDR;
  342. union opcode_tid ot;
  343. __be32 rsvd0;
  344. u8 rsvd1;
  345. u8 cmd;
  346. u8 rsvd2[6];
  347. };
  348. struct cpl_abort_rpl_rss {
  349. union opcode_tid ot;
  350. u8 rsvd[3];
  351. u8 status;
  352. };
  353. struct cpl_abort_rpl {
  354. WR_HDR;
  355. union opcode_tid ot;
  356. __be32 rsvd0;
  357. u8 rsvd1;
  358. u8 cmd;
  359. u8 rsvd2[6];
  360. };
  361. struct cpl_peer_close {
  362. union opcode_tid ot;
  363. __be32 rcv_nxt;
  364. };
  365. struct cpl_tid_release {
  366. WR_HDR;
  367. union opcode_tid ot;
  368. __be32 rsvd;
  369. };
  370. struct cpl_tx_pkt_core {
  371. __be32 ctrl0;
  372. #define TXPKT_VF(x) ((x) << 0)
  373. #define TXPKT_PF(x) ((x) << 8)
  374. #define TXPKT_VF_VLD (1 << 11)
  375. #define TXPKT_OVLAN_IDX(x) ((x) << 12)
  376. #define TXPKT_INTF(x) ((x) << 16)
  377. #define TXPKT_INS_OVLAN (1 << 21)
  378. #define TXPKT_OPCODE(x) ((x) << 24)
  379. __be16 pack;
  380. __be16 len;
  381. __be64 ctrl1;
  382. #define TXPKT_CSUM_END(x) ((x) << 12)
  383. #define TXPKT_CSUM_START(x) ((x) << 20)
  384. #define TXPKT_IPHDR_LEN(x) ((u64)(x) << 20)
  385. #define TXPKT_CSUM_LOC(x) ((u64)(x) << 30)
  386. #define TXPKT_ETHHDR_LEN(x) ((u64)(x) << 34)
  387. #define TXPKT_CSUM_TYPE(x) ((u64)(x) << 40)
  388. #define TXPKT_VLAN(x) ((u64)(x) << 44)
  389. #define TXPKT_VLAN_VLD (1ULL << 60)
  390. #define TXPKT_IPCSUM_DIS (1ULL << 62)
  391. #define TXPKT_L4CSUM_DIS (1ULL << 63)
  392. };
  393. struct cpl_tx_pkt {
  394. WR_HDR;
  395. struct cpl_tx_pkt_core c;
  396. };
  397. #define cpl_tx_pkt_xt cpl_tx_pkt
  398. struct cpl_tx_pkt_lso_core {
  399. __be32 lso_ctrl;
  400. #define LSO_TCPHDR_LEN(x) ((x) << 0)
  401. #define LSO_IPHDR_LEN(x) ((x) << 4)
  402. #define LSO_ETHHDR_LEN(x) ((x) << 16)
  403. #define LSO_IPV6(x) ((x) << 20)
  404. #define LSO_LAST_SLICE (1 << 22)
  405. #define LSO_FIRST_SLICE (1 << 23)
  406. #define LSO_OPCODE(x) ((x) << 24)
  407. __be16 ipid_ofst;
  408. __be16 mss;
  409. __be32 seqno_offset;
  410. __be32 len;
  411. /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
  412. };
  413. struct cpl_tx_pkt_lso {
  414. WR_HDR;
  415. struct cpl_tx_pkt_lso_core c;
  416. /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
  417. };
  418. struct cpl_iscsi_hdr {
  419. union opcode_tid ot;
  420. __be16 pdu_len_ddp;
  421. #define ISCSI_PDU_LEN(x) ((x) & 0x7FFF)
  422. #define ISCSI_DDP (1 << 15)
  423. __be16 len;
  424. __be32 seq;
  425. __be16 urg;
  426. u8 rsvd;
  427. u8 status;
  428. };
  429. struct cpl_rx_data {
  430. union opcode_tid ot;
  431. __be16 rsvd;
  432. __be16 len;
  433. __be32 seq;
  434. __be16 urg;
  435. #if defined(__LITTLE_ENDIAN_BITFIELD)
  436. u8 dack_mode:2;
  437. u8 psh:1;
  438. u8 heartbeat:1;
  439. u8 ddp_off:1;
  440. u8 :3;
  441. #else
  442. u8 :3;
  443. u8 ddp_off:1;
  444. u8 heartbeat:1;
  445. u8 psh:1;
  446. u8 dack_mode:2;
  447. #endif
  448. u8 status;
  449. };
  450. struct cpl_rx_data_ack {
  451. WR_HDR;
  452. union opcode_tid ot;
  453. __be32 credit_dack;
  454. #define RX_CREDITS(x) ((x) << 0)
  455. #define RX_FORCE_ACK(x) ((x) << 28)
  456. };
  457. struct cpl_rx_pkt {
  458. struct rss_header rsshdr;
  459. u8 opcode;
  460. #if defined(__LITTLE_ENDIAN_BITFIELD)
  461. u8 iff:4;
  462. u8 csum_calc:1;
  463. u8 ipmi_pkt:1;
  464. u8 vlan_ex:1;
  465. u8 ip_frag:1;
  466. #else
  467. u8 ip_frag:1;
  468. u8 vlan_ex:1;
  469. u8 ipmi_pkt:1;
  470. u8 csum_calc:1;
  471. u8 iff:4;
  472. #endif
  473. __be16 csum;
  474. __be16 vlan;
  475. __be16 len;
  476. __be32 l2info;
  477. #define RXF_UDP (1 << 22)
  478. #define RXF_TCP (1 << 23)
  479. #define RXF_IP (1 << 24)
  480. #define RXF_IP6 (1 << 25)
  481. __be16 hdr_len;
  482. __be16 err_vec;
  483. };
  484. struct cpl_trace_pkt {
  485. u8 opcode;
  486. u8 intf;
  487. #if defined(__LITTLE_ENDIAN_BITFIELD)
  488. u8 runt:4;
  489. u8 filter_hit:4;
  490. u8 :6;
  491. u8 err:1;
  492. u8 trunc:1;
  493. #else
  494. u8 filter_hit:4;
  495. u8 runt:4;
  496. u8 trunc:1;
  497. u8 err:1;
  498. u8 :6;
  499. #endif
  500. __be16 rsvd;
  501. __be16 len;
  502. __be64 tstamp;
  503. };
  504. struct cpl_l2t_write_req {
  505. WR_HDR;
  506. union opcode_tid ot;
  507. __be16 params;
  508. #define L2T_W_INFO(x) ((x) << 2)
  509. #define L2T_W_PORT(x) ((x) << 8)
  510. #define L2T_W_NOREPLY(x) ((x) << 15)
  511. __be16 l2t_idx;
  512. __be16 vlan;
  513. u8 dst_mac[6];
  514. };
  515. struct cpl_l2t_write_rpl {
  516. union opcode_tid ot;
  517. u8 status;
  518. u8 rsvd[3];
  519. };
  520. struct cpl_rdma_terminate {
  521. union opcode_tid ot;
  522. __be16 rsvd;
  523. __be16 len;
  524. };
  525. struct cpl_sge_egr_update {
  526. __be32 opcode_qid;
  527. #define EGR_QID(x) ((x) & 0x1FFFF)
  528. __be16 cidx;
  529. __be16 pidx;
  530. };
  531. struct cpl_fw4_pld {
  532. u8 opcode;
  533. u8 rsvd0[3];
  534. u8 type;
  535. u8 rsvd1;
  536. __be16 len;
  537. __be64 data;
  538. __be64 rsvd2;
  539. };
  540. struct cpl_fw6_pld {
  541. u8 opcode;
  542. u8 rsvd[5];
  543. __be16 len;
  544. __be64 data[4];
  545. };
  546. struct cpl_fw4_msg {
  547. u8 opcode;
  548. u8 type;
  549. __be16 rsvd0;
  550. __be32 rsvd1;
  551. __be64 data[2];
  552. };
  553. struct cpl_fw4_ack {
  554. union opcode_tid ot;
  555. u8 credits;
  556. u8 rsvd0[2];
  557. u8 seq_vld;
  558. __be32 snd_nxt;
  559. __be32 snd_una;
  560. __be64 rsvd1;
  561. };
  562. struct cpl_fw6_msg {
  563. u8 opcode;
  564. u8 type;
  565. __be16 rsvd0;
  566. __be32 rsvd1;
  567. __be64 data[4];
  568. };
  569. /* cpl_fw6_msg.type values */
  570. enum {
  571. FW6_TYPE_CMD_RPL = 0,
  572. };
  573. enum {
  574. ULP_TX_MEM_READ = 2,
  575. ULP_TX_MEM_WRITE = 3,
  576. ULP_TX_PKT = 4
  577. };
  578. enum {
  579. ULP_TX_SC_NOOP = 0x80,
  580. ULP_TX_SC_IMM = 0x81,
  581. ULP_TX_SC_DSGL = 0x82,
  582. ULP_TX_SC_ISGL = 0x83
  583. };
  584. struct ulptx_sge_pair {
  585. __be32 len[2];
  586. __be64 addr[2];
  587. };
  588. struct ulptx_sgl {
  589. __be32 cmd_nsge;
  590. #define ULPTX_CMD(x) ((x) << 24)
  591. #define ULPTX_NSGE(x) ((x) << 0)
  592. #define ULPTX_MORE (1U << 23)
  593. __be32 len0;
  594. __be64 addr0;
  595. struct ulptx_sge_pair sge[0];
  596. };
  597. struct ulp_mem_io {
  598. WR_HDR;
  599. __be32 cmd;
  600. #define ULP_MEMIO_ORDER(x) ((x) << 23)
  601. __be32 len16; /* command length */
  602. __be32 dlen; /* data length in 32-byte units */
  603. #define ULP_MEMIO_DATA_LEN(x) ((x) << 0)
  604. __be32 lock_addr;
  605. #define ULP_MEMIO_ADDR(x) ((x) << 0)
  606. #define ULP_MEMIO_LOCK(x) ((x) << 31)
  607. };
  608. #endif /* __T4_MSG_H */