t4_msg.h 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309
  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_SMT_WRITE_REQ = 0x14,
  51. CPL_TID_RELEASE = 0x1A,
  52. CPL_SRQ_TABLE_REQ = 0x1C,
  53. CPL_TX_DATA_ISO = 0x1F,
  54. CPL_CLOSE_LISTSRV_RPL = 0x20,
  55. CPL_L2T_WRITE_RPL = 0x23,
  56. CPL_PASS_OPEN_RPL = 0x24,
  57. CPL_ACT_OPEN_RPL = 0x25,
  58. CPL_PEER_CLOSE = 0x26,
  59. CPL_ABORT_REQ_RSS = 0x2B,
  60. CPL_ABORT_RPL_RSS = 0x2D,
  61. CPL_SMT_WRITE_RPL = 0x2E,
  62. CPL_RX_PHYS_ADDR = 0x30,
  63. CPL_CLOSE_CON_RPL = 0x32,
  64. CPL_ISCSI_HDR = 0x33,
  65. CPL_RDMA_CQE = 0x35,
  66. CPL_RDMA_CQE_READ_RSP = 0x36,
  67. CPL_RDMA_CQE_ERR = 0x37,
  68. CPL_RX_DATA = 0x39,
  69. CPL_SET_TCB_RPL = 0x3A,
  70. CPL_RX_PKT = 0x3B,
  71. CPL_RX_DDP_COMPLETE = 0x3F,
  72. CPL_ACT_ESTABLISH = 0x40,
  73. CPL_PASS_ESTABLISH = 0x41,
  74. CPL_RX_DATA_DDP = 0x42,
  75. CPL_PASS_ACCEPT_REQ = 0x44,
  76. CPL_RX_ISCSI_CMP = 0x45,
  77. CPL_TRACE_PKT_T5 = 0x48,
  78. CPL_RX_ISCSI_DDP = 0x49,
  79. CPL_RX_TLS_CMP = 0x4E,
  80. CPL_RDMA_READ_REQ = 0x60,
  81. CPL_PASS_OPEN_REQ6 = 0x81,
  82. CPL_ACT_OPEN_REQ6 = 0x83,
  83. CPL_TX_TLS_PDU = 0x88,
  84. CPL_TX_TLS_SFO = 0x89,
  85. CPL_TX_SEC_PDU = 0x8A,
  86. CPL_TX_TLS_ACK = 0x8B,
  87. CPL_RDMA_TERMINATE = 0xA2,
  88. CPL_RDMA_WRITE = 0xA4,
  89. CPL_SGE_EGR_UPDATE = 0xA5,
  90. CPL_RX_MPS_PKT = 0xAF,
  91. CPL_TRACE_PKT = 0xB0,
  92. CPL_TLS_DATA = 0xB1,
  93. CPL_ISCSI_DATA = 0xB2,
  94. CPL_FW4_MSG = 0xC0,
  95. CPL_FW4_PLD = 0xC1,
  96. CPL_FW4_ACK = 0xC3,
  97. CPL_SRQ_TABLE_RPL = 0xCC,
  98. CPL_RX_PHYS_DSGL = 0xD0,
  99. CPL_FW6_MSG = 0xE0,
  100. CPL_FW6_PLD = 0xE1,
  101. CPL_TX_TNL_LSO = 0xEC,
  102. CPL_TX_PKT_LSO = 0xED,
  103. CPL_TX_PKT_XT = 0xEE,
  104. NUM_CPL_CMDS
  105. };
  106. enum CPL_error {
  107. CPL_ERR_NONE = 0,
  108. CPL_ERR_TCAM_PARITY = 1,
  109. CPL_ERR_TCAM_MISS = 2,
  110. CPL_ERR_TCAM_FULL = 3,
  111. CPL_ERR_BAD_LENGTH = 15,
  112. CPL_ERR_BAD_ROUTE = 18,
  113. CPL_ERR_CONN_RESET = 20,
  114. CPL_ERR_CONN_EXIST_SYNRECV = 21,
  115. CPL_ERR_CONN_EXIST = 22,
  116. CPL_ERR_ARP_MISS = 23,
  117. CPL_ERR_BAD_SYN = 24,
  118. CPL_ERR_CONN_TIMEDOUT = 30,
  119. CPL_ERR_XMIT_TIMEDOUT = 31,
  120. CPL_ERR_PERSIST_TIMEDOUT = 32,
  121. CPL_ERR_FINWAIT2_TIMEDOUT = 33,
  122. CPL_ERR_KEEPALIVE_TIMEDOUT = 34,
  123. CPL_ERR_RTX_NEG_ADVICE = 35,
  124. CPL_ERR_PERSIST_NEG_ADVICE = 36,
  125. CPL_ERR_KEEPALV_NEG_ADVICE = 37,
  126. CPL_ERR_ABORT_FAILED = 42,
  127. CPL_ERR_IWARP_FLM = 50,
  128. CPL_CONTAINS_READ_RPL = 60,
  129. CPL_CONTAINS_WRITE_RPL = 61,
  130. };
  131. enum {
  132. CPL_CONN_POLICY_AUTO = 0,
  133. CPL_CONN_POLICY_ASK = 1,
  134. CPL_CONN_POLICY_FILTER = 2,
  135. CPL_CONN_POLICY_DENY = 3
  136. };
  137. enum {
  138. ULP_MODE_NONE = 0,
  139. ULP_MODE_ISCSI = 2,
  140. ULP_MODE_RDMA = 4,
  141. ULP_MODE_TCPDDP = 5,
  142. ULP_MODE_FCOE = 6,
  143. ULP_MODE_TLS = 8,
  144. };
  145. enum {
  146. ULP_CRC_HEADER = 1 << 0,
  147. ULP_CRC_DATA = 1 << 1
  148. };
  149. enum {
  150. CPL_ABORT_SEND_RST = 0,
  151. CPL_ABORT_NO_RST,
  152. };
  153. enum { /* TX_PKT_XT checksum types */
  154. TX_CSUM_TCP = 0,
  155. TX_CSUM_UDP = 1,
  156. TX_CSUM_CRC16 = 4,
  157. TX_CSUM_CRC32 = 5,
  158. TX_CSUM_CRC32C = 6,
  159. TX_CSUM_FCOE = 7,
  160. TX_CSUM_TCPIP = 8,
  161. TX_CSUM_UDPIP = 9,
  162. TX_CSUM_TCPIP6 = 10,
  163. TX_CSUM_UDPIP6 = 11,
  164. TX_CSUM_IP = 12,
  165. };
  166. union opcode_tid {
  167. __be32 opcode_tid;
  168. u8 opcode;
  169. };
  170. #define CPL_OPCODE_S 24
  171. #define CPL_OPCODE_V(x) ((x) << CPL_OPCODE_S)
  172. #define CPL_OPCODE_G(x) (((x) >> CPL_OPCODE_S) & 0xFF)
  173. #define TID_G(x) ((x) & 0xFFFFFF)
  174. /* tid is assumed to be 24-bits */
  175. #define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE_V(opcode) | (tid))
  176. #define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
  177. /* extract the TID from a CPL command */
  178. #define GET_TID(cmd) (TID_G(be32_to_cpu(OPCODE_TID(cmd))))
  179. /* partitioning of TID fields that also carry a queue id */
  180. #define TID_TID_S 0
  181. #define TID_TID_M 0x3fff
  182. #define TID_TID_V(x) ((x) << TID_TID_S)
  183. #define TID_TID_G(x) (((x) >> TID_TID_S) & TID_TID_M)
  184. #define TID_QID_S 14
  185. #define TID_QID_M 0x3ff
  186. #define TID_QID_V(x) ((x) << TID_QID_S)
  187. #define TID_QID_G(x) (((x) >> TID_QID_S) & TID_QID_M)
  188. struct rss_header {
  189. u8 opcode;
  190. #if defined(__LITTLE_ENDIAN_BITFIELD)
  191. u8 channel:2;
  192. u8 filter_hit:1;
  193. u8 filter_tid:1;
  194. u8 hash_type:2;
  195. u8 ipv6:1;
  196. u8 send2fw:1;
  197. #else
  198. u8 send2fw:1;
  199. u8 ipv6:1;
  200. u8 hash_type:2;
  201. u8 filter_tid:1;
  202. u8 filter_hit:1;
  203. u8 channel:2;
  204. #endif
  205. __be16 qid;
  206. __be32 hash_val;
  207. };
  208. struct work_request_hdr {
  209. __be32 wr_hi;
  210. __be32 wr_mid;
  211. __be64 wr_lo;
  212. };
  213. /* wr_hi fields */
  214. #define WR_OP_S 24
  215. #define WR_OP_V(x) ((__u64)(x) << WR_OP_S)
  216. #define WR_HDR struct work_request_hdr wr
  217. /* option 0 fields */
  218. #define TX_CHAN_S 2
  219. #define TX_CHAN_V(x) ((x) << TX_CHAN_S)
  220. #define ULP_MODE_S 8
  221. #define ULP_MODE_V(x) ((x) << ULP_MODE_S)
  222. #define RCV_BUFSIZ_S 12
  223. #define RCV_BUFSIZ_M 0x3FFU
  224. #define RCV_BUFSIZ_V(x) ((x) << RCV_BUFSIZ_S)
  225. #define SMAC_SEL_S 28
  226. #define SMAC_SEL_V(x) ((__u64)(x) << SMAC_SEL_S)
  227. #define L2T_IDX_S 36
  228. #define L2T_IDX_V(x) ((__u64)(x) << L2T_IDX_S)
  229. #define WND_SCALE_S 50
  230. #define WND_SCALE_V(x) ((__u64)(x) << WND_SCALE_S)
  231. #define KEEP_ALIVE_S 54
  232. #define KEEP_ALIVE_V(x) ((__u64)(x) << KEEP_ALIVE_S)
  233. #define KEEP_ALIVE_F KEEP_ALIVE_V(1ULL)
  234. #define MSS_IDX_S 60
  235. #define MSS_IDX_M 0xF
  236. #define MSS_IDX_V(x) ((__u64)(x) << MSS_IDX_S)
  237. #define MSS_IDX_G(x) (((x) >> MSS_IDX_S) & MSS_IDX_M)
  238. /* option 2 fields */
  239. #define RSS_QUEUE_S 0
  240. #define RSS_QUEUE_M 0x3FF
  241. #define RSS_QUEUE_V(x) ((x) << RSS_QUEUE_S)
  242. #define RSS_QUEUE_G(x) (((x) >> RSS_QUEUE_S) & RSS_QUEUE_M)
  243. #define RSS_QUEUE_VALID_S 10
  244. #define RSS_QUEUE_VALID_V(x) ((x) << RSS_QUEUE_VALID_S)
  245. #define RSS_QUEUE_VALID_F RSS_QUEUE_VALID_V(1U)
  246. #define RX_FC_DISABLE_S 20
  247. #define RX_FC_DISABLE_V(x) ((x) << RX_FC_DISABLE_S)
  248. #define RX_FC_DISABLE_F RX_FC_DISABLE_V(1U)
  249. #define RX_FC_VALID_S 22
  250. #define RX_FC_VALID_V(x) ((x) << RX_FC_VALID_S)
  251. #define RX_FC_VALID_F RX_FC_VALID_V(1U)
  252. #define RX_CHANNEL_S 26
  253. #define RX_CHANNEL_V(x) ((x) << RX_CHANNEL_S)
  254. #define RX_CHANNEL_F RX_CHANNEL_V(1U)
  255. #define WND_SCALE_EN_S 28
  256. #define WND_SCALE_EN_V(x) ((x) << WND_SCALE_EN_S)
  257. #define WND_SCALE_EN_F WND_SCALE_EN_V(1U)
  258. #define T5_OPT_2_VALID_S 31
  259. #define T5_OPT_2_VALID_V(x) ((x) << T5_OPT_2_VALID_S)
  260. #define T5_OPT_2_VALID_F T5_OPT_2_VALID_V(1U)
  261. struct cpl_pass_open_req {
  262. WR_HDR;
  263. union opcode_tid ot;
  264. __be16 local_port;
  265. __be16 peer_port;
  266. __be32 local_ip;
  267. __be32 peer_ip;
  268. __be64 opt0;
  269. __be64 opt1;
  270. };
  271. /* option 0 fields */
  272. #define NO_CONG_S 4
  273. #define NO_CONG_V(x) ((x) << NO_CONG_S)
  274. #define NO_CONG_F NO_CONG_V(1U)
  275. #define DELACK_S 5
  276. #define DELACK_V(x) ((x) << DELACK_S)
  277. #define DELACK_F DELACK_V(1U)
  278. #define NON_OFFLOAD_S 7
  279. #define NON_OFFLOAD_V(x) ((x) << NON_OFFLOAD_S)
  280. #define NON_OFFLOAD_F NON_OFFLOAD_V(1U)
  281. #define DSCP_S 22
  282. #define DSCP_M 0x3F
  283. #define DSCP_V(x) ((x) << DSCP_S)
  284. #define DSCP_G(x) (((x) >> DSCP_S) & DSCP_M)
  285. #define TCAM_BYPASS_S 48
  286. #define TCAM_BYPASS_V(x) ((__u64)(x) << TCAM_BYPASS_S)
  287. #define TCAM_BYPASS_F TCAM_BYPASS_V(1ULL)
  288. #define NAGLE_S 49
  289. #define NAGLE_V(x) ((__u64)(x) << NAGLE_S)
  290. #define NAGLE_F NAGLE_V(1ULL)
  291. /* option 1 fields */
  292. #define SYN_RSS_ENABLE_S 0
  293. #define SYN_RSS_ENABLE_V(x) ((x) << SYN_RSS_ENABLE_S)
  294. #define SYN_RSS_ENABLE_F SYN_RSS_ENABLE_V(1U)
  295. #define SYN_RSS_QUEUE_S 2
  296. #define SYN_RSS_QUEUE_V(x) ((x) << SYN_RSS_QUEUE_S)
  297. #define CONN_POLICY_S 22
  298. #define CONN_POLICY_V(x) ((x) << CONN_POLICY_S)
  299. struct cpl_pass_open_req6 {
  300. WR_HDR;
  301. union opcode_tid ot;
  302. __be16 local_port;
  303. __be16 peer_port;
  304. __be64 local_ip_hi;
  305. __be64 local_ip_lo;
  306. __be64 peer_ip_hi;
  307. __be64 peer_ip_lo;
  308. __be64 opt0;
  309. __be64 opt1;
  310. };
  311. struct cpl_pass_open_rpl {
  312. union opcode_tid ot;
  313. u8 rsvd[3];
  314. u8 status;
  315. };
  316. struct tcp_options {
  317. __be16 mss;
  318. __u8 wsf;
  319. #if defined(__LITTLE_ENDIAN_BITFIELD)
  320. __u8:4;
  321. __u8 unknown:1;
  322. __u8:1;
  323. __u8 sack:1;
  324. __u8 tstamp:1;
  325. #else
  326. __u8 tstamp:1;
  327. __u8 sack:1;
  328. __u8:1;
  329. __u8 unknown:1;
  330. __u8:4;
  331. #endif
  332. };
  333. struct cpl_pass_accept_req {
  334. union opcode_tid ot;
  335. __be16 rsvd;
  336. __be16 len;
  337. __be32 hdr_len;
  338. __be16 vlan;
  339. __be16 l2info;
  340. __be32 tos_stid;
  341. struct tcp_options tcpopt;
  342. };
  343. /* cpl_pass_accept_req.hdr_len fields */
  344. #define SYN_RX_CHAN_S 0
  345. #define SYN_RX_CHAN_M 0xF
  346. #define SYN_RX_CHAN_V(x) ((x) << SYN_RX_CHAN_S)
  347. #define SYN_RX_CHAN_G(x) (((x) >> SYN_RX_CHAN_S) & SYN_RX_CHAN_M)
  348. #define TCP_HDR_LEN_S 10
  349. #define TCP_HDR_LEN_M 0x3F
  350. #define TCP_HDR_LEN_V(x) ((x) << TCP_HDR_LEN_S)
  351. #define TCP_HDR_LEN_G(x) (((x) >> TCP_HDR_LEN_S) & TCP_HDR_LEN_M)
  352. #define IP_HDR_LEN_S 16
  353. #define IP_HDR_LEN_M 0x3FF
  354. #define IP_HDR_LEN_V(x) ((x) << IP_HDR_LEN_S)
  355. #define IP_HDR_LEN_G(x) (((x) >> IP_HDR_LEN_S) & IP_HDR_LEN_M)
  356. #define ETH_HDR_LEN_S 26
  357. #define ETH_HDR_LEN_M 0x1F
  358. #define ETH_HDR_LEN_V(x) ((x) << ETH_HDR_LEN_S)
  359. #define ETH_HDR_LEN_G(x) (((x) >> ETH_HDR_LEN_S) & ETH_HDR_LEN_M)
  360. /* cpl_pass_accept_req.l2info fields */
  361. #define SYN_MAC_IDX_S 0
  362. #define SYN_MAC_IDX_M 0x1FF
  363. #define SYN_MAC_IDX_V(x) ((x) << SYN_MAC_IDX_S)
  364. #define SYN_MAC_IDX_G(x) (((x) >> SYN_MAC_IDX_S) & SYN_MAC_IDX_M)
  365. #define SYN_XACT_MATCH_S 9
  366. #define SYN_XACT_MATCH_V(x) ((x) << SYN_XACT_MATCH_S)
  367. #define SYN_XACT_MATCH_F SYN_XACT_MATCH_V(1U)
  368. #define SYN_INTF_S 12
  369. #define SYN_INTF_M 0xF
  370. #define SYN_INTF_V(x) ((x) << SYN_INTF_S)
  371. #define SYN_INTF_G(x) (((x) >> SYN_INTF_S) & SYN_INTF_M)
  372. enum { /* TCP congestion control algorithms */
  373. CONG_ALG_RENO,
  374. CONG_ALG_TAHOE,
  375. CONG_ALG_NEWRENO,
  376. CONG_ALG_HIGHSPEED
  377. };
  378. #define CONG_CNTRL_S 14
  379. #define CONG_CNTRL_M 0x3
  380. #define CONG_CNTRL_V(x) ((x) << CONG_CNTRL_S)
  381. #define CONG_CNTRL_G(x) (((x) >> CONG_CNTRL_S) & CONG_CNTRL_M)
  382. #define T5_ISS_S 18
  383. #define T5_ISS_V(x) ((x) << T5_ISS_S)
  384. #define T5_ISS_F T5_ISS_V(1U)
  385. struct cpl_pass_accept_rpl {
  386. WR_HDR;
  387. union opcode_tid ot;
  388. __be32 opt2;
  389. __be64 opt0;
  390. };
  391. /* option 2 fields */
  392. #define RX_COALESCE_VALID_S 11
  393. #define RX_COALESCE_VALID_V(x) ((x) << RX_COALESCE_VALID_S)
  394. #define RX_COALESCE_VALID_F RX_COALESCE_VALID_V(1U)
  395. #define RX_COALESCE_S 12
  396. #define RX_COALESCE_V(x) ((x) << RX_COALESCE_S)
  397. #define PACE_S 16
  398. #define PACE_V(x) ((x) << PACE_S)
  399. #define TX_QUEUE_S 23
  400. #define TX_QUEUE_M 0x7
  401. #define TX_QUEUE_V(x) ((x) << TX_QUEUE_S)
  402. #define TX_QUEUE_G(x) (((x) >> TX_QUEUE_S) & TX_QUEUE_M)
  403. #define CCTRL_ECN_S 27
  404. #define CCTRL_ECN_V(x) ((x) << CCTRL_ECN_S)
  405. #define CCTRL_ECN_F CCTRL_ECN_V(1U)
  406. #define TSTAMPS_EN_S 29
  407. #define TSTAMPS_EN_V(x) ((x) << TSTAMPS_EN_S)
  408. #define TSTAMPS_EN_F TSTAMPS_EN_V(1U)
  409. #define SACK_EN_S 30
  410. #define SACK_EN_V(x) ((x) << SACK_EN_S)
  411. #define SACK_EN_F SACK_EN_V(1U)
  412. struct cpl_t5_pass_accept_rpl {
  413. WR_HDR;
  414. union opcode_tid ot;
  415. __be32 opt2;
  416. __be64 opt0;
  417. __be32 iss;
  418. __be32 rsvd;
  419. };
  420. struct cpl_act_open_req {
  421. WR_HDR;
  422. union opcode_tid ot;
  423. __be16 local_port;
  424. __be16 peer_port;
  425. __be32 local_ip;
  426. __be32 peer_ip;
  427. __be64 opt0;
  428. __be32 params;
  429. __be32 opt2;
  430. };
  431. #define FILTER_TUPLE_S 24
  432. #define FILTER_TUPLE_M 0xFFFFFFFFFF
  433. #define FILTER_TUPLE_V(x) ((x) << FILTER_TUPLE_S)
  434. #define FILTER_TUPLE_G(x) (((x) >> FILTER_TUPLE_S) & FILTER_TUPLE_M)
  435. struct cpl_t5_act_open_req {
  436. WR_HDR;
  437. union opcode_tid ot;
  438. __be16 local_port;
  439. __be16 peer_port;
  440. __be32 local_ip;
  441. __be32 peer_ip;
  442. __be64 opt0;
  443. __be32 rsvd;
  444. __be32 opt2;
  445. __be64 params;
  446. };
  447. struct cpl_t6_act_open_req {
  448. WR_HDR;
  449. union opcode_tid ot;
  450. __be16 local_port;
  451. __be16 peer_port;
  452. __be32 local_ip;
  453. __be32 peer_ip;
  454. __be64 opt0;
  455. __be32 rsvd;
  456. __be32 opt2;
  457. __be64 params;
  458. __be32 rsvd2;
  459. __be32 opt3;
  460. };
  461. struct cpl_act_open_req6 {
  462. WR_HDR;
  463. union opcode_tid ot;
  464. __be16 local_port;
  465. __be16 peer_port;
  466. __be64 local_ip_hi;
  467. __be64 local_ip_lo;
  468. __be64 peer_ip_hi;
  469. __be64 peer_ip_lo;
  470. __be64 opt0;
  471. __be32 params;
  472. __be32 opt2;
  473. };
  474. struct cpl_t5_act_open_req6 {
  475. WR_HDR;
  476. union opcode_tid ot;
  477. __be16 local_port;
  478. __be16 peer_port;
  479. __be64 local_ip_hi;
  480. __be64 local_ip_lo;
  481. __be64 peer_ip_hi;
  482. __be64 peer_ip_lo;
  483. __be64 opt0;
  484. __be32 rsvd;
  485. __be32 opt2;
  486. __be64 params;
  487. };
  488. struct cpl_t6_act_open_req6 {
  489. WR_HDR;
  490. union opcode_tid ot;
  491. __be16 local_port;
  492. __be16 peer_port;
  493. __be64 local_ip_hi;
  494. __be64 local_ip_lo;
  495. __be64 peer_ip_hi;
  496. __be64 peer_ip_lo;
  497. __be64 opt0;
  498. __be32 rsvd;
  499. __be32 opt2;
  500. __be64 params;
  501. __be32 rsvd2;
  502. __be32 opt3;
  503. };
  504. struct cpl_act_open_rpl {
  505. union opcode_tid ot;
  506. __be32 atid_status;
  507. };
  508. /* cpl_act_open_rpl.atid_status fields */
  509. #define AOPEN_STATUS_S 0
  510. #define AOPEN_STATUS_M 0xFF
  511. #define AOPEN_STATUS_G(x) (((x) >> AOPEN_STATUS_S) & AOPEN_STATUS_M)
  512. #define AOPEN_ATID_S 8
  513. #define AOPEN_ATID_M 0xFFFFFF
  514. #define AOPEN_ATID_G(x) (((x) >> AOPEN_ATID_S) & AOPEN_ATID_M)
  515. struct cpl_pass_establish {
  516. union opcode_tid ot;
  517. __be32 rsvd;
  518. __be32 tos_stid;
  519. __be16 mac_idx;
  520. __be16 tcp_opt;
  521. __be32 snd_isn;
  522. __be32 rcv_isn;
  523. };
  524. /* cpl_pass_establish.tos_stid fields */
  525. #define PASS_OPEN_TID_S 0
  526. #define PASS_OPEN_TID_M 0xFFFFFF
  527. #define PASS_OPEN_TID_V(x) ((x) << PASS_OPEN_TID_S)
  528. #define PASS_OPEN_TID_G(x) (((x) >> PASS_OPEN_TID_S) & PASS_OPEN_TID_M)
  529. #define PASS_OPEN_TOS_S 24
  530. #define PASS_OPEN_TOS_M 0xFF
  531. #define PASS_OPEN_TOS_V(x) ((x) << PASS_OPEN_TOS_S)
  532. #define PASS_OPEN_TOS_G(x) (((x) >> PASS_OPEN_TOS_S) & PASS_OPEN_TOS_M)
  533. /* cpl_pass_establish.tcp_opt fields (also applies to act_open_establish) */
  534. #define TCPOPT_WSCALE_OK_S 5
  535. #define TCPOPT_WSCALE_OK_M 0x1
  536. #define TCPOPT_WSCALE_OK_G(x) \
  537. (((x) >> TCPOPT_WSCALE_OK_S) & TCPOPT_WSCALE_OK_M)
  538. #define TCPOPT_SACK_S 6
  539. #define TCPOPT_SACK_M 0x1
  540. #define TCPOPT_SACK_G(x) (((x) >> TCPOPT_SACK_S) & TCPOPT_SACK_M)
  541. #define TCPOPT_TSTAMP_S 7
  542. #define TCPOPT_TSTAMP_M 0x1
  543. #define TCPOPT_TSTAMP_G(x) (((x) >> TCPOPT_TSTAMP_S) & TCPOPT_TSTAMP_M)
  544. #define TCPOPT_SND_WSCALE_S 8
  545. #define TCPOPT_SND_WSCALE_M 0xF
  546. #define TCPOPT_SND_WSCALE_G(x) \
  547. (((x) >> TCPOPT_SND_WSCALE_S) & TCPOPT_SND_WSCALE_M)
  548. #define TCPOPT_MSS_S 12
  549. #define TCPOPT_MSS_M 0xF
  550. #define TCPOPT_MSS_G(x) (((x) >> TCPOPT_MSS_S) & TCPOPT_MSS_M)
  551. #define T6_TCP_HDR_LEN_S 8
  552. #define T6_TCP_HDR_LEN_V(x) ((x) << T6_TCP_HDR_LEN_S)
  553. #define T6_TCP_HDR_LEN_G(x) (((x) >> T6_TCP_HDR_LEN_S) & TCP_HDR_LEN_M)
  554. #define T6_IP_HDR_LEN_S 14
  555. #define T6_IP_HDR_LEN_V(x) ((x) << T6_IP_HDR_LEN_S)
  556. #define T6_IP_HDR_LEN_G(x) (((x) >> T6_IP_HDR_LEN_S) & IP_HDR_LEN_M)
  557. #define T6_ETH_HDR_LEN_S 24
  558. #define T6_ETH_HDR_LEN_M 0xFF
  559. #define T6_ETH_HDR_LEN_V(x) ((x) << T6_ETH_HDR_LEN_S)
  560. #define T6_ETH_HDR_LEN_G(x) (((x) >> T6_ETH_HDR_LEN_S) & T6_ETH_HDR_LEN_M)
  561. struct cpl_act_establish {
  562. union opcode_tid ot;
  563. __be32 rsvd;
  564. __be32 tos_atid;
  565. __be16 mac_idx;
  566. __be16 tcp_opt;
  567. __be32 snd_isn;
  568. __be32 rcv_isn;
  569. };
  570. struct cpl_get_tcb {
  571. WR_HDR;
  572. union opcode_tid ot;
  573. __be16 reply_ctrl;
  574. __be16 cookie;
  575. };
  576. /* cpl_get_tcb.reply_ctrl fields */
  577. #define QUEUENO_S 0
  578. #define QUEUENO_V(x) ((x) << QUEUENO_S)
  579. #define REPLY_CHAN_S 14
  580. #define REPLY_CHAN_V(x) ((x) << REPLY_CHAN_S)
  581. #define REPLY_CHAN_F REPLY_CHAN_V(1U)
  582. #define NO_REPLY_S 15
  583. #define NO_REPLY_V(x) ((x) << NO_REPLY_S)
  584. #define NO_REPLY_F NO_REPLY_V(1U)
  585. struct cpl_set_tcb_field {
  586. WR_HDR;
  587. union opcode_tid ot;
  588. __be16 reply_ctrl;
  589. __be16 word_cookie;
  590. __be64 mask;
  591. __be64 val;
  592. };
  593. /* cpl_set_tcb_field.word_cookie fields */
  594. #define TCB_WORD_S 0
  595. #define TCB_WORD_V(x) ((x) << TCB_WORD_S)
  596. #define TCB_COOKIE_S 5
  597. #define TCB_COOKIE_M 0x7
  598. #define TCB_COOKIE_V(x) ((x) << TCB_COOKIE_S)
  599. #define TCB_COOKIE_G(x) (((x) >> TCB_COOKIE_S) & TCB_COOKIE_M)
  600. struct cpl_set_tcb_rpl {
  601. union opcode_tid ot;
  602. __be16 rsvd;
  603. u8 cookie;
  604. u8 status;
  605. __be64 oldval;
  606. };
  607. struct cpl_close_con_req {
  608. WR_HDR;
  609. union opcode_tid ot;
  610. __be32 rsvd;
  611. };
  612. struct cpl_close_con_rpl {
  613. union opcode_tid ot;
  614. u8 rsvd[3];
  615. u8 status;
  616. __be32 snd_nxt;
  617. __be32 rcv_nxt;
  618. };
  619. struct cpl_close_listsvr_req {
  620. WR_HDR;
  621. union opcode_tid ot;
  622. __be16 reply_ctrl;
  623. __be16 rsvd;
  624. };
  625. /* additional cpl_close_listsvr_req.reply_ctrl field */
  626. #define LISTSVR_IPV6_S 14
  627. #define LISTSVR_IPV6_V(x) ((x) << LISTSVR_IPV6_S)
  628. #define LISTSVR_IPV6_F LISTSVR_IPV6_V(1U)
  629. struct cpl_close_listsvr_rpl {
  630. union opcode_tid ot;
  631. u8 rsvd[3];
  632. u8 status;
  633. };
  634. struct cpl_abort_req_rss {
  635. union opcode_tid ot;
  636. u8 rsvd[3];
  637. u8 status;
  638. };
  639. struct cpl_abort_req_rss6 {
  640. union opcode_tid ot;
  641. __be32 srqidx_status;
  642. };
  643. #define ABORT_RSS_STATUS_S 0
  644. #define ABORT_RSS_STATUS_M 0xff
  645. #define ABORT_RSS_STATUS_V(x) ((x) << ABORT_RSS_STATUS_S)
  646. #define ABORT_RSS_STATUS_G(x) (((x) >> ABORT_RSS_STATUS_S) & ABORT_RSS_STATUS_M)
  647. #define ABORT_RSS_SRQIDX_S 8
  648. #define ABORT_RSS_SRQIDX_M 0xffffff
  649. #define ABORT_RSS_SRQIDX_V(x) ((x) << ABORT_RSS_SRQIDX_S)
  650. #define ABORT_RSS_SRQIDX_G(x) (((x) >> ABORT_RSS_SRQIDX_S) & ABORT_RSS_SRQIDX_M)
  651. struct cpl_abort_req {
  652. WR_HDR;
  653. union opcode_tid ot;
  654. __be32 rsvd0;
  655. u8 rsvd1;
  656. u8 cmd;
  657. u8 rsvd2[6];
  658. };
  659. struct cpl_abort_rpl_rss {
  660. union opcode_tid ot;
  661. u8 rsvd[3];
  662. u8 status;
  663. };
  664. struct cpl_abort_rpl_rss6 {
  665. union opcode_tid ot;
  666. __be32 srqidx_status;
  667. };
  668. struct cpl_abort_rpl {
  669. WR_HDR;
  670. union opcode_tid ot;
  671. __be32 rsvd0;
  672. u8 rsvd1;
  673. u8 cmd;
  674. u8 rsvd2[6];
  675. };
  676. struct cpl_peer_close {
  677. union opcode_tid ot;
  678. __be32 rcv_nxt;
  679. };
  680. struct cpl_tid_release {
  681. WR_HDR;
  682. union opcode_tid ot;
  683. __be32 rsvd;
  684. };
  685. struct cpl_tx_pkt_core {
  686. __be32 ctrl0;
  687. __be16 pack;
  688. __be16 len;
  689. __be64 ctrl1;
  690. };
  691. struct cpl_tx_pkt {
  692. WR_HDR;
  693. struct cpl_tx_pkt_core c;
  694. };
  695. #define cpl_tx_pkt_xt cpl_tx_pkt
  696. /* cpl_tx_pkt_core.ctrl0 fields */
  697. #define TXPKT_VF_S 0
  698. #define TXPKT_VF_V(x) ((x) << TXPKT_VF_S)
  699. #define TXPKT_PF_S 8
  700. #define TXPKT_PF_V(x) ((x) << TXPKT_PF_S)
  701. #define TXPKT_VF_VLD_S 11
  702. #define TXPKT_VF_VLD_V(x) ((x) << TXPKT_VF_VLD_S)
  703. #define TXPKT_VF_VLD_F TXPKT_VF_VLD_V(1U)
  704. #define TXPKT_OVLAN_IDX_S 12
  705. #define TXPKT_OVLAN_IDX_V(x) ((x) << TXPKT_OVLAN_IDX_S)
  706. #define TXPKT_T5_OVLAN_IDX_S 12
  707. #define TXPKT_T5_OVLAN_IDX_V(x) ((x) << TXPKT_T5_OVLAN_IDX_S)
  708. #define TXPKT_INTF_S 16
  709. #define TXPKT_INTF_V(x) ((x) << TXPKT_INTF_S)
  710. #define TXPKT_INS_OVLAN_S 21
  711. #define TXPKT_INS_OVLAN_V(x) ((x) << TXPKT_INS_OVLAN_S)
  712. #define TXPKT_INS_OVLAN_F TXPKT_INS_OVLAN_V(1U)
  713. #define TXPKT_TSTAMP_S 23
  714. #define TXPKT_TSTAMP_V(x) ((x) << TXPKT_TSTAMP_S)
  715. #define TXPKT_TSTAMP_F TXPKT_TSTAMP_V(1ULL)
  716. #define TXPKT_OPCODE_S 24
  717. #define TXPKT_OPCODE_V(x) ((x) << TXPKT_OPCODE_S)
  718. /* cpl_tx_pkt_core.ctrl1 fields */
  719. #define TXPKT_CSUM_END_S 12
  720. #define TXPKT_CSUM_END_V(x) ((x) << TXPKT_CSUM_END_S)
  721. #define TXPKT_CSUM_START_S 20
  722. #define TXPKT_CSUM_START_V(x) ((x) << TXPKT_CSUM_START_S)
  723. #define TXPKT_IPHDR_LEN_S 20
  724. #define TXPKT_IPHDR_LEN_V(x) ((__u64)(x) << TXPKT_IPHDR_LEN_S)
  725. #define TXPKT_CSUM_LOC_S 30
  726. #define TXPKT_CSUM_LOC_V(x) ((__u64)(x) << TXPKT_CSUM_LOC_S)
  727. #define TXPKT_ETHHDR_LEN_S 34
  728. #define TXPKT_ETHHDR_LEN_V(x) ((__u64)(x) << TXPKT_ETHHDR_LEN_S)
  729. #define T6_TXPKT_ETHHDR_LEN_S 32
  730. #define T6_TXPKT_ETHHDR_LEN_V(x) ((__u64)(x) << T6_TXPKT_ETHHDR_LEN_S)
  731. #define TXPKT_CSUM_TYPE_S 40
  732. #define TXPKT_CSUM_TYPE_V(x) ((__u64)(x) << TXPKT_CSUM_TYPE_S)
  733. #define TXPKT_VLAN_S 44
  734. #define TXPKT_VLAN_V(x) ((__u64)(x) << TXPKT_VLAN_S)
  735. #define TXPKT_VLAN_VLD_S 60
  736. #define TXPKT_VLAN_VLD_V(x) ((__u64)(x) << TXPKT_VLAN_VLD_S)
  737. #define TXPKT_VLAN_VLD_F TXPKT_VLAN_VLD_V(1ULL)
  738. #define TXPKT_IPCSUM_DIS_S 62
  739. #define TXPKT_IPCSUM_DIS_V(x) ((__u64)(x) << TXPKT_IPCSUM_DIS_S)
  740. #define TXPKT_IPCSUM_DIS_F TXPKT_IPCSUM_DIS_V(1ULL)
  741. #define TXPKT_L4CSUM_DIS_S 63
  742. #define TXPKT_L4CSUM_DIS_V(x) ((__u64)(x) << TXPKT_L4CSUM_DIS_S)
  743. #define TXPKT_L4CSUM_DIS_F TXPKT_L4CSUM_DIS_V(1ULL)
  744. struct cpl_tx_pkt_lso_core {
  745. __be32 lso_ctrl;
  746. __be16 ipid_ofst;
  747. __be16 mss;
  748. __be32 seqno_offset;
  749. __be32 len;
  750. /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
  751. };
  752. /* cpl_tx_pkt_lso_core.lso_ctrl fields */
  753. #define LSO_TCPHDR_LEN_S 0
  754. #define LSO_TCPHDR_LEN_V(x) ((x) << LSO_TCPHDR_LEN_S)
  755. #define LSO_IPHDR_LEN_S 4
  756. #define LSO_IPHDR_LEN_V(x) ((x) << LSO_IPHDR_LEN_S)
  757. #define LSO_ETHHDR_LEN_S 16
  758. #define LSO_ETHHDR_LEN_V(x) ((x) << LSO_ETHHDR_LEN_S)
  759. #define LSO_IPV6_S 20
  760. #define LSO_IPV6_V(x) ((x) << LSO_IPV6_S)
  761. #define LSO_IPV6_F LSO_IPV6_V(1U)
  762. #define LSO_LAST_SLICE_S 22
  763. #define LSO_LAST_SLICE_V(x) ((x) << LSO_LAST_SLICE_S)
  764. #define LSO_LAST_SLICE_F LSO_LAST_SLICE_V(1U)
  765. #define LSO_FIRST_SLICE_S 23
  766. #define LSO_FIRST_SLICE_V(x) ((x) << LSO_FIRST_SLICE_S)
  767. #define LSO_FIRST_SLICE_F LSO_FIRST_SLICE_V(1U)
  768. #define LSO_OPCODE_S 24
  769. #define LSO_OPCODE_V(x) ((x) << LSO_OPCODE_S)
  770. #define LSO_T5_XFER_SIZE_S 0
  771. #define LSO_T5_XFER_SIZE_V(x) ((x) << LSO_T5_XFER_SIZE_S)
  772. struct cpl_tx_pkt_lso {
  773. WR_HDR;
  774. struct cpl_tx_pkt_lso_core c;
  775. /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
  776. };
  777. struct cpl_iscsi_hdr {
  778. union opcode_tid ot;
  779. __be16 pdu_len_ddp;
  780. __be16 len;
  781. __be32 seq;
  782. __be16 urg;
  783. u8 rsvd;
  784. u8 status;
  785. };
  786. /* cpl_iscsi_hdr.pdu_len_ddp fields */
  787. #define ISCSI_PDU_LEN_S 0
  788. #define ISCSI_PDU_LEN_M 0x7FFF
  789. #define ISCSI_PDU_LEN_V(x) ((x) << ISCSI_PDU_LEN_S)
  790. #define ISCSI_PDU_LEN_G(x) (((x) >> ISCSI_PDU_LEN_S) & ISCSI_PDU_LEN_M)
  791. #define ISCSI_DDP_S 15
  792. #define ISCSI_DDP_V(x) ((x) << ISCSI_DDP_S)
  793. #define ISCSI_DDP_F ISCSI_DDP_V(1U)
  794. struct cpl_rx_data_ddp {
  795. union opcode_tid ot;
  796. __be16 urg;
  797. __be16 len;
  798. __be32 seq;
  799. union {
  800. __be32 nxt_seq;
  801. __be32 ddp_report;
  802. };
  803. __be32 ulp_crc;
  804. __be32 ddpvld;
  805. };
  806. #define cpl_rx_iscsi_ddp cpl_rx_data_ddp
  807. struct cpl_iscsi_data {
  808. union opcode_tid ot;
  809. __u8 rsvd0[2];
  810. __be16 len;
  811. __be32 seq;
  812. __be16 urg;
  813. __u8 rsvd1;
  814. __u8 status;
  815. };
  816. struct cpl_rx_iscsi_cmp {
  817. union opcode_tid ot;
  818. __be16 pdu_len_ddp;
  819. __be16 len;
  820. __be32 seq;
  821. __be16 urg;
  822. __u8 rsvd;
  823. __u8 status;
  824. __be32 ulp_crc;
  825. __be32 ddpvld;
  826. };
  827. struct cpl_tx_data_iso {
  828. __be32 op_to_scsi;
  829. __u8 reserved1;
  830. __u8 ahs_len;
  831. __be16 mpdu;
  832. __be32 burst_size;
  833. __be32 len;
  834. __be32 reserved2_seglen_offset;
  835. __be32 datasn_offset;
  836. __be32 buffer_offset;
  837. __be32 reserved3;
  838. /* encapsulated CPL_TX_DATA follows here */
  839. };
  840. /* cpl_tx_data_iso.op_to_scsi fields */
  841. #define CPL_TX_DATA_ISO_OP_S 24
  842. #define CPL_TX_DATA_ISO_OP_M 0xff
  843. #define CPL_TX_DATA_ISO_OP_V(x) ((x) << CPL_TX_DATA_ISO_OP_S)
  844. #define CPL_TX_DATA_ISO_OP_G(x) \
  845. (((x) >> CPL_TX_DATA_ISO_OP_S) & CPL_TX_DATA_ISO_OP_M)
  846. #define CPL_TX_DATA_ISO_FIRST_S 23
  847. #define CPL_TX_DATA_ISO_FIRST_M 0x1
  848. #define CPL_TX_DATA_ISO_FIRST_V(x) ((x) << CPL_TX_DATA_ISO_FIRST_S)
  849. #define CPL_TX_DATA_ISO_FIRST_G(x) \
  850. (((x) >> CPL_TX_DATA_ISO_FIRST_S) & CPL_TX_DATA_ISO_FIRST_M)
  851. #define CPL_TX_DATA_ISO_FIRST_F CPL_TX_DATA_ISO_FIRST_V(1U)
  852. #define CPL_TX_DATA_ISO_LAST_S 22
  853. #define CPL_TX_DATA_ISO_LAST_M 0x1
  854. #define CPL_TX_DATA_ISO_LAST_V(x) ((x) << CPL_TX_DATA_ISO_LAST_S)
  855. #define CPL_TX_DATA_ISO_LAST_G(x) \
  856. (((x) >> CPL_TX_DATA_ISO_LAST_S) & CPL_TX_DATA_ISO_LAST_M)
  857. #define CPL_TX_DATA_ISO_LAST_F CPL_TX_DATA_ISO_LAST_V(1U)
  858. #define CPL_TX_DATA_ISO_CPLHDRLEN_S 21
  859. #define CPL_TX_DATA_ISO_CPLHDRLEN_M 0x1
  860. #define CPL_TX_DATA_ISO_CPLHDRLEN_V(x) ((x) << CPL_TX_DATA_ISO_CPLHDRLEN_S)
  861. #define CPL_TX_DATA_ISO_CPLHDRLEN_G(x) \
  862. (((x) >> CPL_TX_DATA_ISO_CPLHDRLEN_S) & CPL_TX_DATA_ISO_CPLHDRLEN_M)
  863. #define CPL_TX_DATA_ISO_CPLHDRLEN_F CPL_TX_DATA_ISO_CPLHDRLEN_V(1U)
  864. #define CPL_TX_DATA_ISO_HDRCRC_S 20
  865. #define CPL_TX_DATA_ISO_HDRCRC_M 0x1
  866. #define CPL_TX_DATA_ISO_HDRCRC_V(x) ((x) << CPL_TX_DATA_ISO_HDRCRC_S)
  867. #define CPL_TX_DATA_ISO_HDRCRC_G(x) \
  868. (((x) >> CPL_TX_DATA_ISO_HDRCRC_S) & CPL_TX_DATA_ISO_HDRCRC_M)
  869. #define CPL_TX_DATA_ISO_HDRCRC_F CPL_TX_DATA_ISO_HDRCRC_V(1U)
  870. #define CPL_TX_DATA_ISO_PLDCRC_S 19
  871. #define CPL_TX_DATA_ISO_PLDCRC_M 0x1
  872. #define CPL_TX_DATA_ISO_PLDCRC_V(x) ((x) << CPL_TX_DATA_ISO_PLDCRC_S)
  873. #define CPL_TX_DATA_ISO_PLDCRC_G(x) \
  874. (((x) >> CPL_TX_DATA_ISO_PLDCRC_S) & CPL_TX_DATA_ISO_PLDCRC_M)
  875. #define CPL_TX_DATA_ISO_PLDCRC_F CPL_TX_DATA_ISO_PLDCRC_V(1U)
  876. #define CPL_TX_DATA_ISO_IMMEDIATE_S 18
  877. #define CPL_TX_DATA_ISO_IMMEDIATE_M 0x1
  878. #define CPL_TX_DATA_ISO_IMMEDIATE_V(x) ((x) << CPL_TX_DATA_ISO_IMMEDIATE_S)
  879. #define CPL_TX_DATA_ISO_IMMEDIATE_G(x) \
  880. (((x) >> CPL_TX_DATA_ISO_IMMEDIATE_S) & CPL_TX_DATA_ISO_IMMEDIATE_M)
  881. #define CPL_TX_DATA_ISO_IMMEDIATE_F CPL_TX_DATA_ISO_IMMEDIATE_V(1U)
  882. #define CPL_TX_DATA_ISO_SCSI_S 16
  883. #define CPL_TX_DATA_ISO_SCSI_M 0x3
  884. #define CPL_TX_DATA_ISO_SCSI_V(x) ((x) << CPL_TX_DATA_ISO_SCSI_S)
  885. #define CPL_TX_DATA_ISO_SCSI_G(x) \
  886. (((x) >> CPL_TX_DATA_ISO_SCSI_S) & CPL_TX_DATA_ISO_SCSI_M)
  887. /* cpl_tx_data_iso.reserved2_seglen_offset fields */
  888. #define CPL_TX_DATA_ISO_SEGLEN_OFFSET_S 0
  889. #define CPL_TX_DATA_ISO_SEGLEN_OFFSET_M 0xffffff
  890. #define CPL_TX_DATA_ISO_SEGLEN_OFFSET_V(x) \
  891. ((x) << CPL_TX_DATA_ISO_SEGLEN_OFFSET_S)
  892. #define CPL_TX_DATA_ISO_SEGLEN_OFFSET_G(x) \
  893. (((x) >> CPL_TX_DATA_ISO_SEGLEN_OFFSET_S) & \
  894. CPL_TX_DATA_ISO_SEGLEN_OFFSET_M)
  895. struct cpl_rx_data {
  896. union opcode_tid ot;
  897. __be16 rsvd;
  898. __be16 len;
  899. __be32 seq;
  900. __be16 urg;
  901. #if defined(__LITTLE_ENDIAN_BITFIELD)
  902. u8 dack_mode:2;
  903. u8 psh:1;
  904. u8 heartbeat:1;
  905. u8 ddp_off:1;
  906. u8 :3;
  907. #else
  908. u8 :3;
  909. u8 ddp_off:1;
  910. u8 heartbeat:1;
  911. u8 psh:1;
  912. u8 dack_mode:2;
  913. #endif
  914. u8 status;
  915. };
  916. struct cpl_rx_data_ack {
  917. WR_HDR;
  918. union opcode_tid ot;
  919. __be32 credit_dack;
  920. };
  921. /* cpl_rx_data_ack.ack_seq fields */
  922. #define RX_CREDITS_S 0
  923. #define RX_CREDITS_V(x) ((x) << RX_CREDITS_S)
  924. #define RX_FORCE_ACK_S 28
  925. #define RX_FORCE_ACK_V(x) ((x) << RX_FORCE_ACK_S)
  926. #define RX_FORCE_ACK_F RX_FORCE_ACK_V(1U)
  927. #define RX_DACK_MODE_S 29
  928. #define RX_DACK_MODE_M 0x3
  929. #define RX_DACK_MODE_V(x) ((x) << RX_DACK_MODE_S)
  930. #define RX_DACK_MODE_G(x) (((x) >> RX_DACK_MODE_S) & RX_DACK_MODE_M)
  931. #define RX_DACK_CHANGE_S 31
  932. #define RX_DACK_CHANGE_V(x) ((x) << RX_DACK_CHANGE_S)
  933. #define RX_DACK_CHANGE_F RX_DACK_CHANGE_V(1U)
  934. struct cpl_rx_pkt {
  935. struct rss_header rsshdr;
  936. u8 opcode;
  937. #if defined(__LITTLE_ENDIAN_BITFIELD)
  938. u8 iff:4;
  939. u8 csum_calc:1;
  940. u8 ipmi_pkt:1;
  941. u8 vlan_ex:1;
  942. u8 ip_frag:1;
  943. #else
  944. u8 ip_frag:1;
  945. u8 vlan_ex:1;
  946. u8 ipmi_pkt:1;
  947. u8 csum_calc:1;
  948. u8 iff:4;
  949. #endif
  950. __be16 csum;
  951. __be16 vlan;
  952. __be16 len;
  953. __be32 l2info;
  954. __be16 hdr_len;
  955. __be16 err_vec;
  956. };
  957. #define RX_T6_ETHHDR_LEN_M 0xFF
  958. #define RX_T6_ETHHDR_LEN_G(x) (((x) >> RX_ETHHDR_LEN_S) & RX_T6_ETHHDR_LEN_M)
  959. #define RXF_PSH_S 20
  960. #define RXF_PSH_V(x) ((x) << RXF_PSH_S)
  961. #define RXF_PSH_F RXF_PSH_V(1U)
  962. #define RXF_SYN_S 21
  963. #define RXF_SYN_V(x) ((x) << RXF_SYN_S)
  964. #define RXF_SYN_F RXF_SYN_V(1U)
  965. #define RXF_UDP_S 22
  966. #define RXF_UDP_V(x) ((x) << RXF_UDP_S)
  967. #define RXF_UDP_F RXF_UDP_V(1U)
  968. #define RXF_TCP_S 23
  969. #define RXF_TCP_V(x) ((x) << RXF_TCP_S)
  970. #define RXF_TCP_F RXF_TCP_V(1U)
  971. #define RXF_IP_S 24
  972. #define RXF_IP_V(x) ((x) << RXF_IP_S)
  973. #define RXF_IP_F RXF_IP_V(1U)
  974. #define RXF_IP6_S 25
  975. #define RXF_IP6_V(x) ((x) << RXF_IP6_S)
  976. #define RXF_IP6_F RXF_IP6_V(1U)
  977. #define RXF_SYN_COOKIE_S 26
  978. #define RXF_SYN_COOKIE_V(x) ((x) << RXF_SYN_COOKIE_S)
  979. #define RXF_SYN_COOKIE_F RXF_SYN_COOKIE_V(1U)
  980. #define RXF_FCOE_S 26
  981. #define RXF_FCOE_V(x) ((x) << RXF_FCOE_S)
  982. #define RXF_FCOE_F RXF_FCOE_V(1U)
  983. #define RXF_LRO_S 27
  984. #define RXF_LRO_V(x) ((x) << RXF_LRO_S)
  985. #define RXF_LRO_F RXF_LRO_V(1U)
  986. /* rx_pkt.l2info fields */
  987. #define RX_ETHHDR_LEN_S 0
  988. #define RX_ETHHDR_LEN_M 0x1F
  989. #define RX_ETHHDR_LEN_V(x) ((x) << RX_ETHHDR_LEN_S)
  990. #define RX_ETHHDR_LEN_G(x) (((x) >> RX_ETHHDR_LEN_S) & RX_ETHHDR_LEN_M)
  991. #define RX_T5_ETHHDR_LEN_S 0
  992. #define RX_T5_ETHHDR_LEN_M 0x3F
  993. #define RX_T5_ETHHDR_LEN_V(x) ((x) << RX_T5_ETHHDR_LEN_S)
  994. #define RX_T5_ETHHDR_LEN_G(x) (((x) >> RX_T5_ETHHDR_LEN_S) & RX_T5_ETHHDR_LEN_M)
  995. #define RX_MACIDX_S 8
  996. #define RX_MACIDX_M 0x1FF
  997. #define RX_MACIDX_V(x) ((x) << RX_MACIDX_S)
  998. #define RX_MACIDX_G(x) (((x) >> RX_MACIDX_S) & RX_MACIDX_M)
  999. #define RXF_SYN_S 21
  1000. #define RXF_SYN_V(x) ((x) << RXF_SYN_S)
  1001. #define RXF_SYN_F RXF_SYN_V(1U)
  1002. #define RX_CHAN_S 28
  1003. #define RX_CHAN_M 0xF
  1004. #define RX_CHAN_V(x) ((x) << RX_CHAN_S)
  1005. #define RX_CHAN_G(x) (((x) >> RX_CHAN_S) & RX_CHAN_M)
  1006. /* rx_pkt.hdr_len fields */
  1007. #define RX_TCPHDR_LEN_S 0
  1008. #define RX_TCPHDR_LEN_M 0x3F
  1009. #define RX_TCPHDR_LEN_V(x) ((x) << RX_TCPHDR_LEN_S)
  1010. #define RX_TCPHDR_LEN_G(x) (((x) >> RX_TCPHDR_LEN_S) & RX_TCPHDR_LEN_M)
  1011. #define RX_IPHDR_LEN_S 6
  1012. #define RX_IPHDR_LEN_M 0x3FF
  1013. #define RX_IPHDR_LEN_V(x) ((x) << RX_IPHDR_LEN_S)
  1014. #define RX_IPHDR_LEN_G(x) (((x) >> RX_IPHDR_LEN_S) & RX_IPHDR_LEN_M)
  1015. /* rx_pkt.err_vec fields */
  1016. #define RXERR_CSUM_S 13
  1017. #define RXERR_CSUM_V(x) ((x) << RXERR_CSUM_S)
  1018. #define RXERR_CSUM_F RXERR_CSUM_V(1U)
  1019. #define T6_COMPR_RXERR_LEN_S 1
  1020. #define T6_COMPR_RXERR_LEN_V(x) ((x) << T6_COMPR_RXERR_LEN_S)
  1021. #define T6_COMPR_RXERR_LEN_F T6_COMPR_RXERR_LEN_V(1U)
  1022. #define T6_COMPR_RXERR_VEC_S 0
  1023. #define T6_COMPR_RXERR_VEC_M 0x3F
  1024. #define T6_COMPR_RXERR_VEC_V(x) ((x) << T6_COMPR_RXERR_LEN_S)
  1025. #define T6_COMPR_RXERR_VEC_G(x) \
  1026. (((x) >> T6_COMPR_RXERR_VEC_S) & T6_COMPR_RXERR_VEC_M)
  1027. /* Logical OR of RX_ERROR_CSUM, RX_ERROR_CSIP */
  1028. #define T6_COMPR_RXERR_SUM_S 4
  1029. #define T6_COMPR_RXERR_SUM_V(x) ((x) << T6_COMPR_RXERR_SUM_S)
  1030. #define T6_COMPR_RXERR_SUM_F T6_COMPR_RXERR_SUM_V(1U)
  1031. #define T6_RX_TNLHDR_LEN_S 8
  1032. #define T6_RX_TNLHDR_LEN_M 0xFF
  1033. #define T6_RX_TNLHDR_LEN_V(x) ((x) << T6_RX_TNLHDR_LEN_S)
  1034. #define T6_RX_TNLHDR_LEN_G(x) (((x) >> T6_RX_TNLHDR_LEN_S) & T6_RX_TNLHDR_LEN_M)
  1035. struct cpl_trace_pkt {
  1036. u8 opcode;
  1037. u8 intf;
  1038. #if defined(__LITTLE_ENDIAN_BITFIELD)
  1039. u8 runt:4;
  1040. u8 filter_hit:4;
  1041. u8 :6;
  1042. u8 err:1;
  1043. u8 trunc:1;
  1044. #else
  1045. u8 filter_hit:4;
  1046. u8 runt:4;
  1047. u8 trunc:1;
  1048. u8 err:1;
  1049. u8 :6;
  1050. #endif
  1051. __be16 rsvd;
  1052. __be16 len;
  1053. __be64 tstamp;
  1054. };
  1055. struct cpl_t5_trace_pkt {
  1056. __u8 opcode;
  1057. __u8 intf;
  1058. #if defined(__LITTLE_ENDIAN_BITFIELD)
  1059. __u8 runt:4;
  1060. __u8 filter_hit:4;
  1061. __u8:6;
  1062. __u8 err:1;
  1063. __u8 trunc:1;
  1064. #else
  1065. __u8 filter_hit:4;
  1066. __u8 runt:4;
  1067. __u8 trunc:1;
  1068. __u8 err:1;
  1069. __u8:6;
  1070. #endif
  1071. __be16 rsvd;
  1072. __be16 len;
  1073. __be64 tstamp;
  1074. __be64 rsvd1;
  1075. };
  1076. struct cpl_l2t_write_req {
  1077. WR_HDR;
  1078. union opcode_tid ot;
  1079. __be16 params;
  1080. __be16 l2t_idx;
  1081. __be16 vlan;
  1082. u8 dst_mac[6];
  1083. };
  1084. /* cpl_l2t_write_req.params fields */
  1085. #define L2T_W_INFO_S 2
  1086. #define L2T_W_INFO_V(x) ((x) << L2T_W_INFO_S)
  1087. #define L2T_W_PORT_S 8
  1088. #define L2T_W_PORT_V(x) ((x) << L2T_W_PORT_S)
  1089. #define L2T_W_NOREPLY_S 15
  1090. #define L2T_W_NOREPLY_V(x) ((x) << L2T_W_NOREPLY_S)
  1091. #define L2T_W_NOREPLY_F L2T_W_NOREPLY_V(1U)
  1092. #define CPL_L2T_VLAN_NONE 0xfff
  1093. struct cpl_l2t_write_rpl {
  1094. union opcode_tid ot;
  1095. u8 status;
  1096. u8 rsvd[3];
  1097. };
  1098. struct cpl_smt_write_req {
  1099. WR_HDR;
  1100. union opcode_tid ot;
  1101. __be32 params;
  1102. __be16 pfvf1;
  1103. u8 src_mac1[6];
  1104. __be16 pfvf0;
  1105. u8 src_mac0[6];
  1106. };
  1107. struct cpl_t6_smt_write_req {
  1108. WR_HDR;
  1109. union opcode_tid ot;
  1110. __be32 params;
  1111. __be64 tag;
  1112. __be16 pfvf0;
  1113. u8 src_mac0[6];
  1114. __be32 local_ip;
  1115. __be32 rsvd;
  1116. };
  1117. struct cpl_smt_write_rpl {
  1118. union opcode_tid ot;
  1119. u8 status;
  1120. u8 rsvd[3];
  1121. };
  1122. /* cpl_smt_{read,write}_req.params fields */
  1123. #define SMTW_OVLAN_IDX_S 16
  1124. #define SMTW_OVLAN_IDX_V(x) ((x) << SMTW_OVLAN_IDX_S)
  1125. #define SMTW_IDX_S 20
  1126. #define SMTW_IDX_V(x) ((x) << SMTW_IDX_S)
  1127. #define SMTW_NORPL_S 31
  1128. #define SMTW_NORPL_V(x) ((x) << SMTW_NORPL_S)
  1129. #define SMTW_NORPL_F SMTW_NORPL_V(1U)
  1130. struct cpl_rdma_terminate {
  1131. union opcode_tid ot;
  1132. __be16 rsvd;
  1133. __be16 len;
  1134. };
  1135. struct cpl_sge_egr_update {
  1136. __be32 opcode_qid;
  1137. __be16 cidx;
  1138. __be16 pidx;
  1139. };
  1140. /* cpl_sge_egr_update.ot fields */
  1141. #define EGR_QID_S 0
  1142. #define EGR_QID_M 0x1FFFF
  1143. #define EGR_QID_G(x) (((x) >> EGR_QID_S) & EGR_QID_M)
  1144. /* cpl_fw*.type values */
  1145. enum {
  1146. FW_TYPE_CMD_RPL = 0,
  1147. FW_TYPE_WR_RPL = 1,
  1148. FW_TYPE_CQE = 2,
  1149. FW_TYPE_OFLD_CONNECTION_WR_RPL = 3,
  1150. FW_TYPE_RSSCPL = 4,
  1151. };
  1152. struct cpl_fw4_pld {
  1153. u8 opcode;
  1154. u8 rsvd0[3];
  1155. u8 type;
  1156. u8 rsvd1;
  1157. __be16 len;
  1158. __be64 data;
  1159. __be64 rsvd2;
  1160. };
  1161. struct cpl_fw6_pld {
  1162. u8 opcode;
  1163. u8 rsvd[5];
  1164. __be16 len;
  1165. __be64 data[4];
  1166. };
  1167. struct cpl_fw4_msg {
  1168. u8 opcode;
  1169. u8 type;
  1170. __be16 rsvd0;
  1171. __be32 rsvd1;
  1172. __be64 data[2];
  1173. };
  1174. struct cpl_fw4_ack {
  1175. union opcode_tid ot;
  1176. u8 credits;
  1177. u8 rsvd0[2];
  1178. u8 seq_vld;
  1179. __be32 snd_nxt;
  1180. __be32 snd_una;
  1181. __be64 rsvd1;
  1182. };
  1183. enum {
  1184. CPL_FW4_ACK_FLAGS_SEQVAL = 0x1, /* seqn valid */
  1185. CPL_FW4_ACK_FLAGS_CH = 0x2, /* channel change complete */
  1186. CPL_FW4_ACK_FLAGS_FLOWC = 0x4, /* fw_flowc_wr complete */
  1187. };
  1188. struct cpl_fw6_msg {
  1189. u8 opcode;
  1190. u8 type;
  1191. __be16 rsvd0;
  1192. __be32 rsvd1;
  1193. __be64 data[4];
  1194. };
  1195. /* cpl_fw6_msg.type values */
  1196. enum {
  1197. FW6_TYPE_CMD_RPL = 0,
  1198. FW6_TYPE_WR_RPL = 1,
  1199. FW6_TYPE_CQE = 2,
  1200. FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3,
  1201. FW6_TYPE_RSSCPL = FW_TYPE_RSSCPL,
  1202. };
  1203. struct cpl_fw6_msg_ofld_connection_wr_rpl {
  1204. __u64 cookie;
  1205. __be32 tid; /* or atid in case of active failure */
  1206. __u8 t_state;
  1207. __u8 retval;
  1208. __u8 rsvd[2];
  1209. };
  1210. struct cpl_tx_data {
  1211. union opcode_tid ot;
  1212. __be32 len;
  1213. __be32 rsvd;
  1214. __be32 flags;
  1215. };
  1216. /* cpl_tx_data.flags field */
  1217. #define TX_FORCE_S 13
  1218. #define TX_FORCE_V(x) ((x) << TX_FORCE_S)
  1219. #define T6_TX_FORCE_S 20
  1220. #define T6_TX_FORCE_V(x) ((x) << T6_TX_FORCE_S)
  1221. #define T6_TX_FORCE_F T6_TX_FORCE_V(1U)
  1222. #define TX_SHOVE_S 14
  1223. #define TX_SHOVE_V(x) ((x) << TX_SHOVE_S)
  1224. #define TX_ULP_MODE_S 10
  1225. #define TX_ULP_MODE_M 0x7
  1226. #define TX_ULP_MODE_V(x) ((x) << TX_ULP_MODE_S)
  1227. #define TX_ULP_MODE_G(x) (((x) >> TX_ULP_MODE_S) & TX_ULP_MODE_M)
  1228. enum {
  1229. ULP_TX_MEM_READ = 2,
  1230. ULP_TX_MEM_WRITE = 3,
  1231. ULP_TX_PKT = 4
  1232. };
  1233. enum {
  1234. ULP_TX_SC_NOOP = 0x80,
  1235. ULP_TX_SC_IMM = 0x81,
  1236. ULP_TX_SC_DSGL = 0x82,
  1237. ULP_TX_SC_ISGL = 0x83,
  1238. ULP_TX_SC_MEMRD = 0x86
  1239. };
  1240. #define ULPTX_CMD_S 24
  1241. #define ULPTX_CMD_V(x) ((x) << ULPTX_CMD_S)
  1242. #define ULPTX_LEN16_S 0
  1243. #define ULPTX_LEN16_M 0xFF
  1244. #define ULPTX_LEN16_V(x) ((x) << ULPTX_LEN16_S)
  1245. #define ULP_TX_SC_MORE_S 23
  1246. #define ULP_TX_SC_MORE_V(x) ((x) << ULP_TX_SC_MORE_S)
  1247. #define ULP_TX_SC_MORE_F ULP_TX_SC_MORE_V(1U)
  1248. struct ulptx_sge_pair {
  1249. __be32 len[2];
  1250. __be64 addr[2];
  1251. };
  1252. struct ulptx_sgl {
  1253. __be32 cmd_nsge;
  1254. __be32 len0;
  1255. __be64 addr0;
  1256. struct ulptx_sge_pair sge[0];
  1257. };
  1258. struct ulptx_idata {
  1259. __be32 cmd_more;
  1260. __be32 len;
  1261. };
  1262. struct ulp_txpkt {
  1263. __be32 cmd_dest;
  1264. __be32 len;
  1265. };
  1266. #define ULPTX_CMD_S 24
  1267. #define ULPTX_CMD_M 0xFF
  1268. #define ULPTX_CMD_V(x) ((x) << ULPTX_CMD_S)
  1269. #define ULPTX_NSGE_S 0
  1270. #define ULPTX_NSGE_V(x) ((x) << ULPTX_NSGE_S)
  1271. #define ULPTX_MORE_S 23
  1272. #define ULPTX_MORE_V(x) ((x) << ULPTX_MORE_S)
  1273. #define ULPTX_MORE_F ULPTX_MORE_V(1U)
  1274. #define ULP_TXPKT_DEST_S 16
  1275. #define ULP_TXPKT_DEST_M 0x3
  1276. #define ULP_TXPKT_DEST_V(x) ((x) << ULP_TXPKT_DEST_S)
  1277. #define ULP_TXPKT_FID_S 4
  1278. #define ULP_TXPKT_FID_M 0x7ff
  1279. #define ULP_TXPKT_FID_V(x) ((x) << ULP_TXPKT_FID_S)
  1280. #define ULP_TXPKT_RO_S 3
  1281. #define ULP_TXPKT_RO_V(x) ((x) << ULP_TXPKT_RO_S)
  1282. #define ULP_TXPKT_RO_F ULP_TXPKT_RO_V(1U)
  1283. enum cpl_tx_tnl_lso_type {
  1284. TX_TNL_TYPE_OPAQUE,
  1285. TX_TNL_TYPE_NVGRE,
  1286. TX_TNL_TYPE_VXLAN,
  1287. TX_TNL_TYPE_GENEVE,
  1288. };
  1289. struct cpl_tx_tnl_lso {
  1290. __be32 op_to_IpIdSplitOut;
  1291. __be16 IpIdOffsetOut;
  1292. __be16 UdpLenSetOut_to_TnlHdrLen;
  1293. __be64 r1;
  1294. __be32 Flow_to_TcpHdrLen;
  1295. __be16 IpIdOffset;
  1296. __be16 IpIdSplit_to_Mss;
  1297. __be32 TCPSeqOffset;
  1298. __be32 EthLenOffset_Size;
  1299. /* encapsulated CPL (TX_PKT_XT) follows here */
  1300. };
  1301. #define CPL_TX_TNL_LSO_OPCODE_S 24
  1302. #define CPL_TX_TNL_LSO_OPCODE_M 0xff
  1303. #define CPL_TX_TNL_LSO_OPCODE_V(x) ((x) << CPL_TX_TNL_LSO_OPCODE_S)
  1304. #define CPL_TX_TNL_LSO_OPCODE_G(x) \
  1305. (((x) >> CPL_TX_TNL_LSO_OPCODE_S) & CPL_TX_TNL_LSO_OPCODE_M)
  1306. #define CPL_TX_TNL_LSO_FIRST_S 23
  1307. #define CPL_TX_TNL_LSO_FIRST_M 0x1
  1308. #define CPL_TX_TNL_LSO_FIRST_V(x) ((x) << CPL_TX_TNL_LSO_FIRST_S)
  1309. #define CPL_TX_TNL_LSO_FIRST_G(x) \
  1310. (((x) >> CPL_TX_TNL_LSO_FIRST_S) & CPL_TX_TNL_LSO_FIRST_M)
  1311. #define CPL_TX_TNL_LSO_FIRST_F CPL_TX_TNL_LSO_FIRST_V(1U)
  1312. #define CPL_TX_TNL_LSO_LAST_S 22
  1313. #define CPL_TX_TNL_LSO_LAST_M 0x1
  1314. #define CPL_TX_TNL_LSO_LAST_V(x) ((x) << CPL_TX_TNL_LSO_LAST_S)
  1315. #define CPL_TX_TNL_LSO_LAST_G(x) \
  1316. (((x) >> CPL_TX_TNL_LSO_LAST_S) & CPL_TX_TNL_LSO_LAST_M)
  1317. #define CPL_TX_TNL_LSO_LAST_F CPL_TX_TNL_LSO_LAST_V(1U)
  1318. #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_S 21
  1319. #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_M 0x1
  1320. #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_V(x) \
  1321. ((x) << CPL_TX_TNL_LSO_ETHHDRLENXOUT_S)
  1322. #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_G(x) \
  1323. (((x) >> CPL_TX_TNL_LSO_ETHHDRLENXOUT_S) & \
  1324. CPL_TX_TNL_LSO_ETHHDRLENXOUT_M)
  1325. #define CPL_TX_TNL_LSO_ETHHDRLENXOUT_F CPL_TX_TNL_LSO_ETHHDRLENXOUT_V(1U)
  1326. #define CPL_TX_TNL_LSO_IPV6OUT_S 20
  1327. #define CPL_TX_TNL_LSO_IPV6OUT_M 0x1
  1328. #define CPL_TX_TNL_LSO_IPV6OUT_V(x) ((x) << CPL_TX_TNL_LSO_IPV6OUT_S)
  1329. #define CPL_TX_TNL_LSO_IPV6OUT_G(x) \
  1330. (((x) >> CPL_TX_TNL_LSO_IPV6OUT_S) & CPL_TX_TNL_LSO_IPV6OUT_M)
  1331. #define CPL_TX_TNL_LSO_IPV6OUT_F CPL_TX_TNL_LSO_IPV6OUT_V(1U)
  1332. #define CPL_TX_TNL_LSO_ETHHDRLEN_S 16
  1333. #define CPL_TX_TNL_LSO_ETHHDRLEN_M 0xf
  1334. #define CPL_TX_TNL_LSO_ETHHDRLEN_V(x) ((x) << CPL_TX_TNL_LSO_ETHHDRLEN_S)
  1335. #define CPL_TX_TNL_LSO_ETHHDRLEN_G(x) \
  1336. (((x) >> CPL_TX_TNL_LSO_ETHHDRLEN_S) & CPL_TX_TNL_LSO_ETHHDRLEN_M)
  1337. #define CPL_TX_TNL_LSO_IPHDRLEN_S 4
  1338. #define CPL_TX_TNL_LSO_IPHDRLEN_M 0xfff
  1339. #define CPL_TX_TNL_LSO_IPHDRLEN_V(x) ((x) << CPL_TX_TNL_LSO_IPHDRLEN_S)
  1340. #define CPL_TX_TNL_LSO_IPHDRLEN_G(x) \
  1341. (((x) >> CPL_TX_TNL_LSO_IPHDRLEN_S) & CPL_TX_TNL_LSO_IPHDRLEN_M)
  1342. #define CPL_TX_TNL_LSO_TCPHDRLEN_S 0
  1343. #define CPL_TX_TNL_LSO_TCPHDRLEN_M 0xf
  1344. #define CPL_TX_TNL_LSO_TCPHDRLEN_V(x) ((x) << CPL_TX_TNL_LSO_TCPHDRLEN_S)
  1345. #define CPL_TX_TNL_LSO_TCPHDRLEN_G(x) \
  1346. (((x) >> CPL_TX_TNL_LSO_TCPHDRLEN_S) & CPL_TX_TNL_LSO_TCPHDRLEN_M)
  1347. #define CPL_TX_TNL_LSO_MSS_S 0
  1348. #define CPL_TX_TNL_LSO_MSS_M 0x3fff
  1349. #define CPL_TX_TNL_LSO_MSS_V(x) ((x) << CPL_TX_TNL_LSO_MSS_S)
  1350. #define CPL_TX_TNL_LSO_MSS_G(x) \
  1351. (((x) >> CPL_TX_TNL_LSO_MSS_S) & CPL_TX_TNL_LSO_MSS_M)
  1352. #define CPL_TX_TNL_LSO_SIZE_S 0
  1353. #define CPL_TX_TNL_LSO_SIZE_M 0xfffffff
  1354. #define CPL_TX_TNL_LSO_SIZE_V(x) ((x) << CPL_TX_TNL_LSO_SIZE_S)
  1355. #define CPL_TX_TNL_LSO_SIZE_G(x) \
  1356. (((x) >> CPL_TX_TNL_LSO_SIZE_S) & CPL_TX_TNL_LSO_SIZE_M)
  1357. #define CPL_TX_TNL_LSO_ETHHDRLENOUT_S 16
  1358. #define CPL_TX_TNL_LSO_ETHHDRLENOUT_M 0xf
  1359. #define CPL_TX_TNL_LSO_ETHHDRLENOUT_V(x) \
  1360. ((x) << CPL_TX_TNL_LSO_ETHHDRLENOUT_S)
  1361. #define CPL_TX_TNL_LSO_ETHHDRLENOUT_G(x) \
  1362. (((x) >> CPL_TX_TNL_LSO_ETHHDRLENOUT_S) & CPL_TX_TNL_LSO_ETHHDRLENOUT_M)
  1363. #define CPL_TX_TNL_LSO_IPHDRLENOUT_S 4
  1364. #define CPL_TX_TNL_LSO_IPHDRLENOUT_M 0xfff
  1365. #define CPL_TX_TNL_LSO_IPHDRLENOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPHDRLENOUT_S)
  1366. #define CPL_TX_TNL_LSO_IPHDRLENOUT_G(x) \
  1367. (((x) >> CPL_TX_TNL_LSO_IPHDRLENOUT_S) & CPL_TX_TNL_LSO_IPHDRLENOUT_M)
  1368. #define CPL_TX_TNL_LSO_IPHDRCHKOUT_S 3
  1369. #define CPL_TX_TNL_LSO_IPHDRCHKOUT_M 0x1
  1370. #define CPL_TX_TNL_LSO_IPHDRCHKOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPHDRCHKOUT_S)
  1371. #define CPL_TX_TNL_LSO_IPHDRCHKOUT_G(x) \
  1372. (((x) >> CPL_TX_TNL_LSO_IPHDRCHKOUT_S) & CPL_TX_TNL_LSO_IPHDRCHKOUT_M)
  1373. #define CPL_TX_TNL_LSO_IPHDRCHKOUT_F CPL_TX_TNL_LSO_IPHDRCHKOUT_V(1U)
  1374. #define CPL_TX_TNL_LSO_IPLENSETOUT_S 2
  1375. #define CPL_TX_TNL_LSO_IPLENSETOUT_M 0x1
  1376. #define CPL_TX_TNL_LSO_IPLENSETOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPLENSETOUT_S)
  1377. #define CPL_TX_TNL_LSO_IPLENSETOUT_G(x) \
  1378. (((x) >> CPL_TX_TNL_LSO_IPLENSETOUT_S) & CPL_TX_TNL_LSO_IPLENSETOUT_M)
  1379. #define CPL_TX_TNL_LSO_IPLENSETOUT_F CPL_TX_TNL_LSO_IPLENSETOUT_V(1U)
  1380. #define CPL_TX_TNL_LSO_IPIDINCOUT_S 1
  1381. #define CPL_TX_TNL_LSO_IPIDINCOUT_M 0x1
  1382. #define CPL_TX_TNL_LSO_IPIDINCOUT_V(x) ((x) << CPL_TX_TNL_LSO_IPIDINCOUT_S)
  1383. #define CPL_TX_TNL_LSO_IPIDINCOUT_G(x) \
  1384. (((x) >> CPL_TX_TNL_LSO_IPIDINCOUT_S) & CPL_TX_TNL_LSO_IPIDINCOUT_M)
  1385. #define CPL_TX_TNL_LSO_IPIDINCOUT_F CPL_TX_TNL_LSO_IPIDINCOUT_V(1U)
  1386. #define CPL_TX_TNL_LSO_UDPCHKCLROUT_S 14
  1387. #define CPL_TX_TNL_LSO_UDPCHKCLROUT_M 0x1
  1388. #define CPL_TX_TNL_LSO_UDPCHKCLROUT_V(x) \
  1389. ((x) << CPL_TX_TNL_LSO_UDPCHKCLROUT_S)
  1390. #define CPL_TX_TNL_LSO_UDPCHKCLROUT_G(x) \
  1391. (((x) >> CPL_TX_TNL_LSO_UDPCHKCLROUT_S) & \
  1392. CPL_TX_TNL_LSO_UDPCHKCLROUT_M)
  1393. #define CPL_TX_TNL_LSO_UDPCHKCLROUT_F CPL_TX_TNL_LSO_UDPCHKCLROUT_V(1U)
  1394. #define CPL_TX_TNL_LSO_UDPLENSETOUT_S 15
  1395. #define CPL_TX_TNL_LSO_UDPLENSETOUT_M 0x1
  1396. #define CPL_TX_TNL_LSO_UDPLENSETOUT_V(x) \
  1397. ((x) << CPL_TX_TNL_LSO_UDPLENSETOUT_S)
  1398. #define CPL_TX_TNL_LSO_UDPLENSETOUT_G(x) \
  1399. (((x) >> CPL_TX_TNL_LSO_UDPLENSETOUT_S) & \
  1400. CPL_TX_TNL_LSO_UDPLENSETOUT_M)
  1401. #define CPL_TX_TNL_LSO_UDPLENSETOUT_F CPL_TX_TNL_LSO_UDPLENSETOUT_V(1U)
  1402. #define CPL_TX_TNL_LSO_TNLTYPE_S 12
  1403. #define CPL_TX_TNL_LSO_TNLTYPE_M 0x3
  1404. #define CPL_TX_TNL_LSO_TNLTYPE_V(x) ((x) << CPL_TX_TNL_LSO_TNLTYPE_S)
  1405. #define CPL_TX_TNL_LSO_TNLTYPE_G(x) \
  1406. (((x) >> CPL_TX_TNL_LSO_TNLTYPE_S) & CPL_TX_TNL_LSO_TNLTYPE_M)
  1407. #define S_CPL_TX_TNL_LSO_ETHHDRLEN 16
  1408. #define M_CPL_TX_TNL_LSO_ETHHDRLEN 0xf
  1409. #define V_CPL_TX_TNL_LSO_ETHHDRLEN(x) ((x) << S_CPL_TX_TNL_LSO_ETHHDRLEN)
  1410. #define G_CPL_TX_TNL_LSO_ETHHDRLEN(x) \
  1411. (((x) >> S_CPL_TX_TNL_LSO_ETHHDRLEN) & M_CPL_TX_TNL_LSO_ETHHDRLEN)
  1412. #define CPL_TX_TNL_LSO_TNLHDRLEN_S 0
  1413. #define CPL_TX_TNL_LSO_TNLHDRLEN_M 0xfff
  1414. #define CPL_TX_TNL_LSO_TNLHDRLEN_V(x) ((x) << CPL_TX_TNL_LSO_TNLHDRLEN_S)
  1415. #define CPL_TX_TNL_LSO_TNLHDRLEN_G(x) \
  1416. (((x) >> CPL_TX_TNL_LSO_TNLHDRLEN_S) & CPL_TX_TNL_LSO_TNLHDRLEN_M)
  1417. #define CPL_TX_TNL_LSO_IPV6_S 20
  1418. #define CPL_TX_TNL_LSO_IPV6_M 0x1
  1419. #define CPL_TX_TNL_LSO_IPV6_V(x) ((x) << CPL_TX_TNL_LSO_IPV6_S)
  1420. #define CPL_TX_TNL_LSO_IPV6_G(x) \
  1421. (((x) >> CPL_TX_TNL_LSO_IPV6_S) & CPL_TX_TNL_LSO_IPV6_M)
  1422. #define CPL_TX_TNL_LSO_IPV6_F CPL_TX_TNL_LSO_IPV6_V(1U)
  1423. #define ULP_TX_SC_MORE_S 23
  1424. #define ULP_TX_SC_MORE_V(x) ((x) << ULP_TX_SC_MORE_S)
  1425. #define ULP_TX_SC_MORE_F ULP_TX_SC_MORE_V(1U)
  1426. struct ulp_mem_io {
  1427. WR_HDR;
  1428. __be32 cmd;
  1429. __be32 len16; /* command length */
  1430. __be32 dlen; /* data length in 32-byte units */
  1431. __be32 lock_addr;
  1432. };
  1433. #define ULP_MEMIO_LOCK_S 31
  1434. #define ULP_MEMIO_LOCK_V(x) ((x) << ULP_MEMIO_LOCK_S)
  1435. #define ULP_MEMIO_LOCK_F ULP_MEMIO_LOCK_V(1U)
  1436. /* additional ulp_mem_io.cmd fields */
  1437. #define ULP_MEMIO_ORDER_S 23
  1438. #define ULP_MEMIO_ORDER_V(x) ((x) << ULP_MEMIO_ORDER_S)
  1439. #define ULP_MEMIO_ORDER_F ULP_MEMIO_ORDER_V(1U)
  1440. #define T5_ULP_MEMIO_IMM_S 23
  1441. #define T5_ULP_MEMIO_IMM_V(x) ((x) << T5_ULP_MEMIO_IMM_S)
  1442. #define T5_ULP_MEMIO_IMM_F T5_ULP_MEMIO_IMM_V(1U)
  1443. #define T5_ULP_MEMIO_ORDER_S 22
  1444. #define T5_ULP_MEMIO_ORDER_V(x) ((x) << T5_ULP_MEMIO_ORDER_S)
  1445. #define T5_ULP_MEMIO_ORDER_F T5_ULP_MEMIO_ORDER_V(1U)
  1446. #define T5_ULP_MEMIO_FID_S 4
  1447. #define T5_ULP_MEMIO_FID_M 0x7ff
  1448. #define T5_ULP_MEMIO_FID_V(x) ((x) << T5_ULP_MEMIO_FID_S)
  1449. /* ulp_mem_io.lock_addr fields */
  1450. #define ULP_MEMIO_ADDR_S 0
  1451. #define ULP_MEMIO_ADDR_V(x) ((x) << ULP_MEMIO_ADDR_S)
  1452. /* ulp_mem_io.dlen fields */
  1453. #define ULP_MEMIO_DATA_LEN_S 0
  1454. #define ULP_MEMIO_DATA_LEN_V(x) ((x) << ULP_MEMIO_DATA_LEN_S)
  1455. #define ULPTX_NSGE_S 0
  1456. #define ULPTX_NSGE_M 0xFFFF
  1457. #define ULPTX_NSGE_V(x) ((x) << ULPTX_NSGE_S)
  1458. #define ULPTX_NSGE_G(x) (((x) >> ULPTX_NSGE_S) & ULPTX_NSGE_M)
  1459. struct ulptx_sc_memrd {
  1460. __be32 cmd_to_len;
  1461. __be32 addr;
  1462. };
  1463. #define ULP_TXPKT_DATAMODIFY_S 23
  1464. #define ULP_TXPKT_DATAMODIFY_M 0x1
  1465. #define ULP_TXPKT_DATAMODIFY_V(x) ((x) << ULP_TXPKT_DATAMODIFY_S)
  1466. #define ULP_TXPKT_DATAMODIFY_G(x) \
  1467. (((x) >> ULP_TXPKT_DATAMODIFY_S) & ULP_TXPKT_DATAMODIFY__M)
  1468. #define ULP_TXPKT_DATAMODIFY_F ULP_TXPKT_DATAMODIFY_V(1U)
  1469. #define ULP_TXPKT_CHANNELID_S 22
  1470. #define ULP_TXPKT_CHANNELID_M 0x1
  1471. #define ULP_TXPKT_CHANNELID_V(x) ((x) << ULP_TXPKT_CHANNELID_S)
  1472. #define ULP_TXPKT_CHANNELID_G(x) \
  1473. (((x) >> ULP_TXPKT_CHANNELID_S) & ULP_TXPKT_CHANNELID_M)
  1474. #define ULP_TXPKT_CHANNELID_F ULP_TXPKT_CHANNELID_V(1U)
  1475. #define SCMD_SEQ_NO_CTRL_S 29
  1476. #define SCMD_SEQ_NO_CTRL_M 0x3
  1477. #define SCMD_SEQ_NO_CTRL_V(x) ((x) << SCMD_SEQ_NO_CTRL_S)
  1478. #define SCMD_SEQ_NO_CTRL_G(x) \
  1479. (((x) >> SCMD_SEQ_NO_CTRL_S) & SCMD_SEQ_NO_CTRL_M)
  1480. /* StsFieldPrsnt- Status field at the end of the TLS PDU */
  1481. #define SCMD_STATUS_PRESENT_S 28
  1482. #define SCMD_STATUS_PRESENT_M 0x1
  1483. #define SCMD_STATUS_PRESENT_V(x) ((x) << SCMD_STATUS_PRESENT_S)
  1484. #define SCMD_STATUS_PRESENT_G(x) \
  1485. (((x) >> SCMD_STATUS_PRESENT_S) & SCMD_STATUS_PRESENT_M)
  1486. #define SCMD_STATUS_PRESENT_F SCMD_STATUS_PRESENT_V(1U)
  1487. /* ProtoVersion - Protocol Version 0: 1.2, 1:1.1, 2:DTLS, 3:Generic,
  1488. * 3-15: Reserved.
  1489. */
  1490. #define SCMD_PROTO_VERSION_S 24
  1491. #define SCMD_PROTO_VERSION_M 0xf
  1492. #define SCMD_PROTO_VERSION_V(x) ((x) << SCMD_PROTO_VERSION_S)
  1493. #define SCMD_PROTO_VERSION_G(x) \
  1494. (((x) >> SCMD_PROTO_VERSION_S) & SCMD_PROTO_VERSION_M)
  1495. /* EncDecCtrl - Encryption/Decryption Control. 0: Encrypt, 1: Decrypt */
  1496. #define SCMD_ENC_DEC_CTRL_S 23
  1497. #define SCMD_ENC_DEC_CTRL_M 0x1
  1498. #define SCMD_ENC_DEC_CTRL_V(x) ((x) << SCMD_ENC_DEC_CTRL_S)
  1499. #define SCMD_ENC_DEC_CTRL_G(x) \
  1500. (((x) >> SCMD_ENC_DEC_CTRL_S) & SCMD_ENC_DEC_CTRL_M)
  1501. #define SCMD_ENC_DEC_CTRL_F SCMD_ENC_DEC_CTRL_V(1U)
  1502. /* CipherAuthSeqCtrl - Cipher Authentication Sequence Control. */
  1503. #define SCMD_CIPH_AUTH_SEQ_CTRL_S 22
  1504. #define SCMD_CIPH_AUTH_SEQ_CTRL_M 0x1
  1505. #define SCMD_CIPH_AUTH_SEQ_CTRL_V(x) \
  1506. ((x) << SCMD_CIPH_AUTH_SEQ_CTRL_S)
  1507. #define SCMD_CIPH_AUTH_SEQ_CTRL_G(x) \
  1508. (((x) >> SCMD_CIPH_AUTH_SEQ_CTRL_S) & SCMD_CIPH_AUTH_SEQ_CTRL_M)
  1509. #define SCMD_CIPH_AUTH_SEQ_CTRL_F SCMD_CIPH_AUTH_SEQ_CTRL_V(1U)
  1510. /* CiphMode - Cipher Mode. 0: NOP, 1:AES-CBC, 2:AES-GCM, 3:AES-CTR,
  1511. * 4:Generic-AES, 5-15: Reserved.
  1512. */
  1513. #define SCMD_CIPH_MODE_S 18
  1514. #define SCMD_CIPH_MODE_M 0xf
  1515. #define SCMD_CIPH_MODE_V(x) ((x) << SCMD_CIPH_MODE_S)
  1516. #define SCMD_CIPH_MODE_G(x) \
  1517. (((x) >> SCMD_CIPH_MODE_S) & SCMD_CIPH_MODE_M)
  1518. /* AuthMode - Auth Mode. 0: NOP, 1:SHA1, 2:SHA2-224, 3:SHA2-256
  1519. * 4-15: Reserved
  1520. */
  1521. #define SCMD_AUTH_MODE_S 14
  1522. #define SCMD_AUTH_MODE_M 0xf
  1523. #define SCMD_AUTH_MODE_V(x) ((x) << SCMD_AUTH_MODE_S)
  1524. #define SCMD_AUTH_MODE_G(x) \
  1525. (((x) >> SCMD_AUTH_MODE_S) & SCMD_AUTH_MODE_M)
  1526. /* HmacCtrl - HMAC Control. 0:NOP, 1:No truncation, 2:Support HMAC Truncation
  1527. * per RFC 4366, 3:IPSec 96 bits, 4-7:Reserved
  1528. */
  1529. #define SCMD_HMAC_CTRL_S 11
  1530. #define SCMD_HMAC_CTRL_M 0x7
  1531. #define SCMD_HMAC_CTRL_V(x) ((x) << SCMD_HMAC_CTRL_S)
  1532. #define SCMD_HMAC_CTRL_G(x) \
  1533. (((x) >> SCMD_HMAC_CTRL_S) & SCMD_HMAC_CTRL_M)
  1534. /* IvSize - IV size in units of 2 bytes */
  1535. #define SCMD_IV_SIZE_S 7
  1536. #define SCMD_IV_SIZE_M 0xf
  1537. #define SCMD_IV_SIZE_V(x) ((x) << SCMD_IV_SIZE_S)
  1538. #define SCMD_IV_SIZE_G(x) \
  1539. (((x) >> SCMD_IV_SIZE_S) & SCMD_IV_SIZE_M)
  1540. /* NumIVs - Number of IVs */
  1541. #define SCMD_NUM_IVS_S 0
  1542. #define SCMD_NUM_IVS_M 0x7f
  1543. #define SCMD_NUM_IVS_V(x) ((x) << SCMD_NUM_IVS_S)
  1544. #define SCMD_NUM_IVS_G(x) \
  1545. (((x) >> SCMD_NUM_IVS_S) & SCMD_NUM_IVS_M)
  1546. /* EnbDbgId - If this is enabled upper 20 (63:44) bits if SeqNumber
  1547. * (below) are used as Cid (connection id for debug status), these
  1548. * bits are padded to zero for forming the 64 bit
  1549. * sequence number for TLS
  1550. */
  1551. #define SCMD_ENB_DBGID_S 31
  1552. #define SCMD_ENB_DBGID_M 0x1
  1553. #define SCMD_ENB_DBGID_V(x) ((x) << SCMD_ENB_DBGID_S)
  1554. #define SCMD_ENB_DBGID_G(x) \
  1555. (((x) >> SCMD_ENB_DBGID_S) & SCMD_ENB_DBGID_M)
  1556. /* IV generation in SW. */
  1557. #define SCMD_IV_GEN_CTRL_S 30
  1558. #define SCMD_IV_GEN_CTRL_M 0x1
  1559. #define SCMD_IV_GEN_CTRL_V(x) ((x) << SCMD_IV_GEN_CTRL_S)
  1560. #define SCMD_IV_GEN_CTRL_G(x) \
  1561. (((x) >> SCMD_IV_GEN_CTRL_S) & SCMD_IV_GEN_CTRL_M)
  1562. #define SCMD_IV_GEN_CTRL_F SCMD_IV_GEN_CTRL_V(1U)
  1563. /* More frags */
  1564. #define SCMD_MORE_FRAGS_S 20
  1565. #define SCMD_MORE_FRAGS_M 0x1
  1566. #define SCMD_MORE_FRAGS_V(x) ((x) << SCMD_MORE_FRAGS_S)
  1567. #define SCMD_MORE_FRAGS_G(x) (((x) >> SCMD_MORE_FRAGS_S) & SCMD_MORE_FRAGS_M)
  1568. /*last frag */
  1569. #define SCMD_LAST_FRAG_S 19
  1570. #define SCMD_LAST_FRAG_M 0x1
  1571. #define SCMD_LAST_FRAG_V(x) ((x) << SCMD_LAST_FRAG_S)
  1572. #define SCMD_LAST_FRAG_G(x) (((x) >> SCMD_LAST_FRAG_S) & SCMD_LAST_FRAG_M)
  1573. /* TlsCompPdu */
  1574. #define SCMD_TLS_COMPPDU_S 18
  1575. #define SCMD_TLS_COMPPDU_M 0x1
  1576. #define SCMD_TLS_COMPPDU_V(x) ((x) << SCMD_TLS_COMPPDU_S)
  1577. #define SCMD_TLS_COMPPDU_G(x) (((x) >> SCMD_TLS_COMPPDU_S) & SCMD_TLS_COMPPDU_M)
  1578. /* KeyCntxtInline - Key context inline after the scmd OR PayloadOnly*/
  1579. #define SCMD_KEY_CTX_INLINE_S 17
  1580. #define SCMD_KEY_CTX_INLINE_M 0x1
  1581. #define SCMD_KEY_CTX_INLINE_V(x) ((x) << SCMD_KEY_CTX_INLINE_S)
  1582. #define SCMD_KEY_CTX_INLINE_G(x) \
  1583. (((x) >> SCMD_KEY_CTX_INLINE_S) & SCMD_KEY_CTX_INLINE_M)
  1584. #define SCMD_KEY_CTX_INLINE_F SCMD_KEY_CTX_INLINE_V(1U)
  1585. /* TLSFragEnable - 0: Host created TLS PDUs, 1: TLS Framgmentation in ASIC */
  1586. #define SCMD_TLS_FRAG_ENABLE_S 16
  1587. #define SCMD_TLS_FRAG_ENABLE_M 0x1
  1588. #define SCMD_TLS_FRAG_ENABLE_V(x) ((x) << SCMD_TLS_FRAG_ENABLE_S)
  1589. #define SCMD_TLS_FRAG_ENABLE_G(x) \
  1590. (((x) >> SCMD_TLS_FRAG_ENABLE_S) & SCMD_TLS_FRAG_ENABLE_M)
  1591. #define SCMD_TLS_FRAG_ENABLE_F SCMD_TLS_FRAG_ENABLE_V(1U)
  1592. /* MacOnly - Only send the MAC and discard PDU. This is valid for hash only
  1593. * modes, in this case TLS_TX will drop the PDU and only
  1594. * send back the MAC bytes.
  1595. */
  1596. #define SCMD_MAC_ONLY_S 15
  1597. #define SCMD_MAC_ONLY_M 0x1
  1598. #define SCMD_MAC_ONLY_V(x) ((x) << SCMD_MAC_ONLY_S)
  1599. #define SCMD_MAC_ONLY_G(x) \
  1600. (((x) >> SCMD_MAC_ONLY_S) & SCMD_MAC_ONLY_M)
  1601. #define SCMD_MAC_ONLY_F SCMD_MAC_ONLY_V(1U)
  1602. /* AadIVDrop - Drop the AAD and IV fields. Useful in protocols
  1603. * which have complex AAD and IV formations Eg:AES-CCM
  1604. */
  1605. #define SCMD_AADIVDROP_S 14
  1606. #define SCMD_AADIVDROP_M 0x1
  1607. #define SCMD_AADIVDROP_V(x) ((x) << SCMD_AADIVDROP_S)
  1608. #define SCMD_AADIVDROP_G(x) \
  1609. (((x) >> SCMD_AADIVDROP_S) & SCMD_AADIVDROP_M)
  1610. #define SCMD_AADIVDROP_F SCMD_AADIVDROP_V(1U)
  1611. /* HdrLength - Length of all headers excluding TLS header
  1612. * present before start of crypto PDU/payload.
  1613. */
  1614. #define SCMD_HDR_LEN_S 0
  1615. #define SCMD_HDR_LEN_M 0x3fff
  1616. #define SCMD_HDR_LEN_V(x) ((x) << SCMD_HDR_LEN_S)
  1617. #define SCMD_HDR_LEN_G(x) \
  1618. (((x) >> SCMD_HDR_LEN_S) & SCMD_HDR_LEN_M)
  1619. struct cpl_tx_sec_pdu {
  1620. __be32 op_ivinsrtofst;
  1621. __be32 pldlen;
  1622. __be32 aadstart_cipherstop_hi;
  1623. __be32 cipherstop_lo_authinsert;
  1624. __be32 seqno_numivs;
  1625. __be32 ivgen_hdrlen;
  1626. __be64 scmd1;
  1627. };
  1628. #define CPL_TX_SEC_PDU_OPCODE_S 24
  1629. #define CPL_TX_SEC_PDU_OPCODE_M 0xff
  1630. #define CPL_TX_SEC_PDU_OPCODE_V(x) ((x) << CPL_TX_SEC_PDU_OPCODE_S)
  1631. #define CPL_TX_SEC_PDU_OPCODE_G(x) \
  1632. (((x) >> CPL_TX_SEC_PDU_OPCODE_S) & CPL_TX_SEC_PDU_OPCODE_M)
  1633. /* RX Channel Id */
  1634. #define CPL_TX_SEC_PDU_RXCHID_S 22
  1635. #define CPL_TX_SEC_PDU_RXCHID_M 0x1
  1636. #define CPL_TX_SEC_PDU_RXCHID_V(x) ((x) << CPL_TX_SEC_PDU_RXCHID_S)
  1637. #define CPL_TX_SEC_PDU_RXCHID_G(x) \
  1638. (((x) >> CPL_TX_SEC_PDU_RXCHID_S) & CPL_TX_SEC_PDU_RXCHID_M)
  1639. #define CPL_TX_SEC_PDU_RXCHID_F CPL_TX_SEC_PDU_RXCHID_V(1U)
  1640. /* Ack Follows */
  1641. #define CPL_TX_SEC_PDU_ACKFOLLOWS_S 21
  1642. #define CPL_TX_SEC_PDU_ACKFOLLOWS_M 0x1
  1643. #define CPL_TX_SEC_PDU_ACKFOLLOWS_V(x) ((x) << CPL_TX_SEC_PDU_ACKFOLLOWS_S)
  1644. #define CPL_TX_SEC_PDU_ACKFOLLOWS_G(x) \
  1645. (((x) >> CPL_TX_SEC_PDU_ACKFOLLOWS_S) & CPL_TX_SEC_PDU_ACKFOLLOWS_M)
  1646. #define CPL_TX_SEC_PDU_ACKFOLLOWS_F CPL_TX_SEC_PDU_ACKFOLLOWS_V(1U)
  1647. /* Loopback bit in cpl_tx_sec_pdu */
  1648. #define CPL_TX_SEC_PDU_ULPTXLPBK_S 20
  1649. #define CPL_TX_SEC_PDU_ULPTXLPBK_M 0x1
  1650. #define CPL_TX_SEC_PDU_ULPTXLPBK_V(x) ((x) << CPL_TX_SEC_PDU_ULPTXLPBK_S)
  1651. #define CPL_TX_SEC_PDU_ULPTXLPBK_G(x) \
  1652. (((x) >> CPL_TX_SEC_PDU_ULPTXLPBK_S) & CPL_TX_SEC_PDU_ULPTXLPBK_M)
  1653. #define CPL_TX_SEC_PDU_ULPTXLPBK_F CPL_TX_SEC_PDU_ULPTXLPBK_V(1U)
  1654. /* Length of cpl header encapsulated */
  1655. #define CPL_TX_SEC_PDU_CPLLEN_S 16
  1656. #define CPL_TX_SEC_PDU_CPLLEN_M 0xf
  1657. #define CPL_TX_SEC_PDU_CPLLEN_V(x) ((x) << CPL_TX_SEC_PDU_CPLLEN_S)
  1658. #define CPL_TX_SEC_PDU_CPLLEN_G(x) \
  1659. (((x) >> CPL_TX_SEC_PDU_CPLLEN_S) & CPL_TX_SEC_PDU_CPLLEN_M)
  1660. /* PlaceHolder */
  1661. #define CPL_TX_SEC_PDU_PLACEHOLDER_S 10
  1662. #define CPL_TX_SEC_PDU_PLACEHOLDER_M 0x1
  1663. #define CPL_TX_SEC_PDU_PLACEHOLDER_V(x) ((x) << CPL_TX_SEC_PDU_PLACEHOLDER_S)
  1664. #define CPL_TX_SEC_PDU_PLACEHOLDER_G(x) \
  1665. (((x) >> CPL_TX_SEC_PDU_PLACEHOLDER_S) & \
  1666. CPL_TX_SEC_PDU_PLACEHOLDER_M)
  1667. /* IvInsrtOffset: Insertion location for IV */
  1668. #define CPL_TX_SEC_PDU_IVINSRTOFST_S 0
  1669. #define CPL_TX_SEC_PDU_IVINSRTOFST_M 0x3ff
  1670. #define CPL_TX_SEC_PDU_IVINSRTOFST_V(x) ((x) << CPL_TX_SEC_PDU_IVINSRTOFST_S)
  1671. #define CPL_TX_SEC_PDU_IVINSRTOFST_G(x) \
  1672. (((x) >> CPL_TX_SEC_PDU_IVINSRTOFST_S) & \
  1673. CPL_TX_SEC_PDU_IVINSRTOFST_M)
  1674. /* AadStartOffset: Offset in bytes for AAD start from
  1675. * the first byte following the pkt headers (0-255 bytes)
  1676. */
  1677. #define CPL_TX_SEC_PDU_AADSTART_S 24
  1678. #define CPL_TX_SEC_PDU_AADSTART_M 0xff
  1679. #define CPL_TX_SEC_PDU_AADSTART_V(x) ((x) << CPL_TX_SEC_PDU_AADSTART_S)
  1680. #define CPL_TX_SEC_PDU_AADSTART_G(x) \
  1681. (((x) >> CPL_TX_SEC_PDU_AADSTART_S) & \
  1682. CPL_TX_SEC_PDU_AADSTART_M)
  1683. /* AadStopOffset: offset in bytes for AAD stop/end from the first byte following
  1684. * the pkt headers (0-511 bytes)
  1685. */
  1686. #define CPL_TX_SEC_PDU_AADSTOP_S 15
  1687. #define CPL_TX_SEC_PDU_AADSTOP_M 0x1ff
  1688. #define CPL_TX_SEC_PDU_AADSTOP_V(x) ((x) << CPL_TX_SEC_PDU_AADSTOP_S)
  1689. #define CPL_TX_SEC_PDU_AADSTOP_G(x) \
  1690. (((x) >> CPL_TX_SEC_PDU_AADSTOP_S) & CPL_TX_SEC_PDU_AADSTOP_M)
  1691. /* CipherStartOffset: offset in bytes for encryption/decryption start from the
  1692. * first byte following the pkt headers (0-1023 bytes)
  1693. */
  1694. #define CPL_TX_SEC_PDU_CIPHERSTART_S 5
  1695. #define CPL_TX_SEC_PDU_CIPHERSTART_M 0x3ff
  1696. #define CPL_TX_SEC_PDU_CIPHERSTART_V(x) ((x) << CPL_TX_SEC_PDU_CIPHERSTART_S)
  1697. #define CPL_TX_SEC_PDU_CIPHERSTART_G(x) \
  1698. (((x) >> CPL_TX_SEC_PDU_CIPHERSTART_S) & \
  1699. CPL_TX_SEC_PDU_CIPHERSTART_M)
  1700. /* CipherStopOffset: offset in bytes for encryption/decryption end
  1701. * from end of the payload of this command (0-511 bytes)
  1702. */
  1703. #define CPL_TX_SEC_PDU_CIPHERSTOP_HI_S 0
  1704. #define CPL_TX_SEC_PDU_CIPHERSTOP_HI_M 0x1f
  1705. #define CPL_TX_SEC_PDU_CIPHERSTOP_HI_V(x) \
  1706. ((x) << CPL_TX_SEC_PDU_CIPHERSTOP_HI_S)
  1707. #define CPL_TX_SEC_PDU_CIPHERSTOP_HI_G(x) \
  1708. (((x) >> CPL_TX_SEC_PDU_CIPHERSTOP_HI_S) & \
  1709. CPL_TX_SEC_PDU_CIPHERSTOP_HI_M)
  1710. #define CPL_TX_SEC_PDU_CIPHERSTOP_LO_S 28
  1711. #define CPL_TX_SEC_PDU_CIPHERSTOP_LO_M 0xf
  1712. #define CPL_TX_SEC_PDU_CIPHERSTOP_LO_V(x) \
  1713. ((x) << CPL_TX_SEC_PDU_CIPHERSTOP_LO_S)
  1714. #define CPL_TX_SEC_PDU_CIPHERSTOP_LO_G(x) \
  1715. (((x) >> CPL_TX_SEC_PDU_CIPHERSTOP_LO_S) & \
  1716. CPL_TX_SEC_PDU_CIPHERSTOP_LO_M)
  1717. /* AuthStartOffset: offset in bytes for authentication start from
  1718. * the first byte following the pkt headers (0-1023)
  1719. */
  1720. #define CPL_TX_SEC_PDU_AUTHSTART_S 18
  1721. #define CPL_TX_SEC_PDU_AUTHSTART_M 0x3ff
  1722. #define CPL_TX_SEC_PDU_AUTHSTART_V(x) ((x) << CPL_TX_SEC_PDU_AUTHSTART_S)
  1723. #define CPL_TX_SEC_PDU_AUTHSTART_G(x) \
  1724. (((x) >> CPL_TX_SEC_PDU_AUTHSTART_S) & \
  1725. CPL_TX_SEC_PDU_AUTHSTART_M)
  1726. /* AuthStopOffset: offset in bytes for authentication
  1727. * end from end of the payload of this command (0-511 Bytes)
  1728. */
  1729. #define CPL_TX_SEC_PDU_AUTHSTOP_S 9
  1730. #define CPL_TX_SEC_PDU_AUTHSTOP_M 0x1ff
  1731. #define CPL_TX_SEC_PDU_AUTHSTOP_V(x) ((x) << CPL_TX_SEC_PDU_AUTHSTOP_S)
  1732. #define CPL_TX_SEC_PDU_AUTHSTOP_G(x) \
  1733. (((x) >> CPL_TX_SEC_PDU_AUTHSTOP_S) & \
  1734. CPL_TX_SEC_PDU_AUTHSTOP_M)
  1735. /* AuthInsrtOffset: offset in bytes for authentication insertion
  1736. * from end of the payload of this command (0-511 bytes)
  1737. */
  1738. #define CPL_TX_SEC_PDU_AUTHINSERT_S 0
  1739. #define CPL_TX_SEC_PDU_AUTHINSERT_M 0x1ff
  1740. #define CPL_TX_SEC_PDU_AUTHINSERT_V(x) ((x) << CPL_TX_SEC_PDU_AUTHINSERT_S)
  1741. #define CPL_TX_SEC_PDU_AUTHINSERT_G(x) \
  1742. (((x) >> CPL_TX_SEC_PDU_AUTHINSERT_S) & \
  1743. CPL_TX_SEC_PDU_AUTHINSERT_M)
  1744. struct cpl_rx_phys_dsgl {
  1745. __be32 op_to_tid;
  1746. __be32 pcirlxorder_to_noofsgentr;
  1747. struct rss_header rss_hdr_int;
  1748. };
  1749. #define CPL_RX_PHYS_DSGL_OPCODE_S 24
  1750. #define CPL_RX_PHYS_DSGL_OPCODE_M 0xff
  1751. #define CPL_RX_PHYS_DSGL_OPCODE_V(x) ((x) << CPL_RX_PHYS_DSGL_OPCODE_S)
  1752. #define CPL_RX_PHYS_DSGL_OPCODE_G(x) \
  1753. (((x) >> CPL_RX_PHYS_DSGL_OPCODE_S) & CPL_RX_PHYS_DSGL_OPCODE_M)
  1754. #define CPL_RX_PHYS_DSGL_ISRDMA_S 23
  1755. #define CPL_RX_PHYS_DSGL_ISRDMA_M 0x1
  1756. #define CPL_RX_PHYS_DSGL_ISRDMA_V(x) ((x) << CPL_RX_PHYS_DSGL_ISRDMA_S)
  1757. #define CPL_RX_PHYS_DSGL_ISRDMA_G(x) \
  1758. (((x) >> CPL_RX_PHYS_DSGL_ISRDMA_S) & CPL_RX_PHYS_DSGL_ISRDMA_M)
  1759. #define CPL_RX_PHYS_DSGL_ISRDMA_F CPL_RX_PHYS_DSGL_ISRDMA_V(1U)
  1760. #define CPL_RX_PHYS_DSGL_RSVD1_S 20
  1761. #define CPL_RX_PHYS_DSGL_RSVD1_M 0x7
  1762. #define CPL_RX_PHYS_DSGL_RSVD1_V(x) ((x) << CPL_RX_PHYS_DSGL_RSVD1_S)
  1763. #define CPL_RX_PHYS_DSGL_RSVD1_G(x) \
  1764. (((x) >> CPL_RX_PHYS_DSGL_RSVD1_S) & \
  1765. CPL_RX_PHYS_DSGL_RSVD1_M)
  1766. #define CPL_RX_PHYS_DSGL_PCIRLXORDER_S 31
  1767. #define CPL_RX_PHYS_DSGL_PCIRLXORDER_M 0x1
  1768. #define CPL_RX_PHYS_DSGL_PCIRLXORDER_V(x) \
  1769. ((x) << CPL_RX_PHYS_DSGL_PCIRLXORDER_S)
  1770. #define CPL_RX_PHYS_DSGL_PCIRLXORDER_G(x) \
  1771. (((x) >> CPL_RX_PHYS_DSGL_PCIRLXORDER_S) & \
  1772. CPL_RX_PHYS_DSGL_PCIRLXORDER_M)
  1773. #define CPL_RX_PHYS_DSGL_PCIRLXORDER_F CPL_RX_PHYS_DSGL_PCIRLXORDER_V(1U)
  1774. #define CPL_RX_PHYS_DSGL_PCINOSNOOP_S 30
  1775. #define CPL_RX_PHYS_DSGL_PCINOSNOOP_M 0x1
  1776. #define CPL_RX_PHYS_DSGL_PCINOSNOOP_V(x) \
  1777. ((x) << CPL_RX_PHYS_DSGL_PCINOSNOOP_S)
  1778. #define CPL_RX_PHYS_DSGL_PCINOSNOOP_G(x) \
  1779. (((x) >> CPL_RX_PHYS_DSGL_PCINOSNOOP_S) & \
  1780. CPL_RX_PHYS_DSGL_PCINOSNOOP_M)
  1781. #define CPL_RX_PHYS_DSGL_PCINOSNOOP_F CPL_RX_PHYS_DSGL_PCINOSNOOP_V(1U)
  1782. #define CPL_RX_PHYS_DSGL_PCITPHNTENB_S 29
  1783. #define CPL_RX_PHYS_DSGL_PCITPHNTENB_M 0x1
  1784. #define CPL_RX_PHYS_DSGL_PCITPHNTENB_V(x) \
  1785. ((x) << CPL_RX_PHYS_DSGL_PCITPHNTENB_S)
  1786. #define CPL_RX_PHYS_DSGL_PCITPHNTENB_G(x) \
  1787. (((x) >> CPL_RX_PHYS_DSGL_PCITPHNTENB_S) & \
  1788. CPL_RX_PHYS_DSGL_PCITPHNTENB_M)
  1789. #define CPL_RX_PHYS_DSGL_PCITPHNTENB_F CPL_RX_PHYS_DSGL_PCITPHNTENB_V(1U)
  1790. #define CPL_RX_PHYS_DSGL_PCITPHNT_S 27
  1791. #define CPL_RX_PHYS_DSGL_PCITPHNT_M 0x3
  1792. #define CPL_RX_PHYS_DSGL_PCITPHNT_V(x) ((x) << CPL_RX_PHYS_DSGL_PCITPHNT_S)
  1793. #define CPL_RX_PHYS_DSGL_PCITPHNT_G(x) \
  1794. (((x) >> CPL_RX_PHYS_DSGL_PCITPHNT_S) & \
  1795. CPL_RX_PHYS_DSGL_PCITPHNT_M)
  1796. #define CPL_RX_PHYS_DSGL_DCAID_S 16
  1797. #define CPL_RX_PHYS_DSGL_DCAID_M 0x7ff
  1798. #define CPL_RX_PHYS_DSGL_DCAID_V(x) ((x) << CPL_RX_PHYS_DSGL_DCAID_S)
  1799. #define CPL_RX_PHYS_DSGL_DCAID_G(x) \
  1800. (((x) >> CPL_RX_PHYS_DSGL_DCAID_S) & \
  1801. CPL_RX_PHYS_DSGL_DCAID_M)
  1802. #define CPL_RX_PHYS_DSGL_NOOFSGENTR_S 0
  1803. #define CPL_RX_PHYS_DSGL_NOOFSGENTR_M 0xffff
  1804. #define CPL_RX_PHYS_DSGL_NOOFSGENTR_V(x) \
  1805. ((x) << CPL_RX_PHYS_DSGL_NOOFSGENTR_S)
  1806. #define CPL_RX_PHYS_DSGL_NOOFSGENTR_G(x) \
  1807. (((x) >> CPL_RX_PHYS_DSGL_NOOFSGENTR_S) & \
  1808. CPL_RX_PHYS_DSGL_NOOFSGENTR_M)
  1809. struct cpl_rx_mps_pkt {
  1810. __be32 op_to_r1_hi;
  1811. __be32 r1_lo_length;
  1812. };
  1813. #define CPL_RX_MPS_PKT_OP_S 24
  1814. #define CPL_RX_MPS_PKT_OP_M 0xff
  1815. #define CPL_RX_MPS_PKT_OP_V(x) ((x) << CPL_RX_MPS_PKT_OP_S)
  1816. #define CPL_RX_MPS_PKT_OP_G(x) \
  1817. (((x) >> CPL_RX_MPS_PKT_OP_S) & CPL_RX_MPS_PKT_OP_M)
  1818. #define CPL_RX_MPS_PKT_TYPE_S 20
  1819. #define CPL_RX_MPS_PKT_TYPE_M 0xf
  1820. #define CPL_RX_MPS_PKT_TYPE_V(x) ((x) << CPL_RX_MPS_PKT_TYPE_S)
  1821. #define CPL_RX_MPS_PKT_TYPE_G(x) \
  1822. (((x) >> CPL_RX_MPS_PKT_TYPE_S) & CPL_RX_MPS_PKT_TYPE_M)
  1823. enum {
  1824. X_CPL_RX_MPS_PKT_TYPE_PAUSE = 1 << 0,
  1825. X_CPL_RX_MPS_PKT_TYPE_PPP = 1 << 1,
  1826. X_CPL_RX_MPS_PKT_TYPE_QFC = 1 << 2,
  1827. X_CPL_RX_MPS_PKT_TYPE_PTP = 1 << 3
  1828. };
  1829. struct cpl_srq_table_req {
  1830. WR_HDR;
  1831. union opcode_tid ot;
  1832. __u8 status;
  1833. __u8 rsvd[2];
  1834. __u8 idx;
  1835. __be64 rsvd_pdid;
  1836. __be32 qlen_qbase;
  1837. __be16 cur_msn;
  1838. __be16 max_msn;
  1839. };
  1840. struct cpl_srq_table_rpl {
  1841. union opcode_tid ot;
  1842. __u8 status;
  1843. __u8 rsvd[2];
  1844. __u8 idx;
  1845. __be64 rsvd_pdid;
  1846. __be32 qlen_qbase;
  1847. __be16 cur_msn;
  1848. __be16 max_msn;
  1849. };
  1850. /* cpl_srq_table_{req,rpl}.params fields */
  1851. #define SRQT_QLEN_S 28
  1852. #define SRQT_QLEN_M 0xF
  1853. #define SRQT_QLEN_V(x) ((x) << SRQT_QLEN_S)
  1854. #define SRQT_QLEN_G(x) (((x) >> SRQT_QLEN_S) & SRQT_QLEN_M)
  1855. #define SRQT_QBASE_S 0
  1856. #define SRQT_QBASE_M 0x3FFFFFF
  1857. #define SRQT_QBASE_V(x) ((x) << SRQT_QBASE_S)
  1858. #define SRQT_QBASE_G(x) (((x) >> SRQT_QBASE_S) & SRQT_QBASE_M)
  1859. #define SRQT_PDID_S 0
  1860. #define SRQT_PDID_M 0xFF
  1861. #define SRQT_PDID_V(x) ((x) << SRQT_PDID_S)
  1862. #define SRQT_PDID_G(x) (((x) >> SRQT_PDID_S) & SRQT_PDID_M)
  1863. #define SRQT_IDX_S 0
  1864. #define SRQT_IDX_M 0xF
  1865. #define SRQT_IDX_V(x) ((x) << SRQT_IDX_S)
  1866. #define SRQT_IDX_G(x) (((x) >> SRQT_IDX_S) & SRQT_IDX_M)
  1867. struct cpl_tx_tls_sfo {
  1868. __be32 op_to_seg_len;
  1869. __be32 pld_len;
  1870. __be32 type_protover;
  1871. __be32 r1_lo;
  1872. __be32 seqno_numivs;
  1873. __be32 ivgen_hdrlen;
  1874. __be64 scmd1;
  1875. };
  1876. /* cpl_tx_tls_sfo macros */
  1877. #define CPL_TX_TLS_SFO_OPCODE_S 24
  1878. #define CPL_TX_TLS_SFO_OPCODE_V(x) ((x) << CPL_TX_TLS_SFO_OPCODE_S)
  1879. #define CPL_TX_TLS_SFO_DATA_TYPE_S 20
  1880. #define CPL_TX_TLS_SFO_DATA_TYPE_V(x) ((x) << CPL_TX_TLS_SFO_DATA_TYPE_S)
  1881. #define CPL_TX_TLS_SFO_CPL_LEN_S 16
  1882. #define CPL_TX_TLS_SFO_CPL_LEN_V(x) ((x) << CPL_TX_TLS_SFO_CPL_LEN_S)
  1883. #define CPL_TX_TLS_SFO_SEG_LEN_S 0
  1884. #define CPL_TX_TLS_SFO_SEG_LEN_M 0xffff
  1885. #define CPL_TX_TLS_SFO_SEG_LEN_V(x) ((x) << CPL_TX_TLS_SFO_SEG_LEN_S)
  1886. #define CPL_TX_TLS_SFO_SEG_LEN_G(x) \
  1887. (((x) >> CPL_TX_TLS_SFO_SEG_LEN_S) & CPL_TX_TLS_SFO_SEG_LEN_M)
  1888. #define CPL_TX_TLS_SFO_TYPE_S 24
  1889. #define CPL_TX_TLS_SFO_TYPE_M 0xff
  1890. #define CPL_TX_TLS_SFO_TYPE_V(x) ((x) << CPL_TX_TLS_SFO_TYPE_S)
  1891. #define CPL_TX_TLS_SFO_TYPE_G(x) \
  1892. (((x) >> CPL_TX_TLS_SFO_TYPE_S) & CPL_TX_TLS_SFO_TYPE_M)
  1893. #define CPL_TX_TLS_SFO_PROTOVER_S 8
  1894. #define CPL_TX_TLS_SFO_PROTOVER_M 0xffff
  1895. #define CPL_TX_TLS_SFO_PROTOVER_V(x) ((x) << CPL_TX_TLS_SFO_PROTOVER_S)
  1896. #define CPL_TX_TLS_SFO_PROTOVER_G(x) \
  1897. (((x) >> CPL_TX_TLS_SFO_PROTOVER_S) & CPL_TX_TLS_SFO_PROTOVER_M)
  1898. struct cpl_tls_data {
  1899. struct rss_header rsshdr;
  1900. union opcode_tid ot;
  1901. __be32 length_pkd;
  1902. __be32 seq;
  1903. __be32 r1;
  1904. };
  1905. #define CPL_TLS_DATA_OPCODE_S 24
  1906. #define CPL_TLS_DATA_OPCODE_M 0xff
  1907. #define CPL_TLS_DATA_OPCODE_V(x) ((x) << CPL_TLS_DATA_OPCODE_S)
  1908. #define CPL_TLS_DATA_OPCODE_G(x) \
  1909. (((x) >> CPL_TLS_DATA_OPCODE_S) & CPL_TLS_DATA_OPCODE_M)
  1910. #define CPL_TLS_DATA_TID_S 0
  1911. #define CPL_TLS_DATA_TID_M 0xffffff
  1912. #define CPL_TLS_DATA_TID_V(x) ((x) << CPL_TLS_DATA_TID_S)
  1913. #define CPL_TLS_DATA_TID_G(x) \
  1914. (((x) >> CPL_TLS_DATA_TID_S) & CPL_TLS_DATA_TID_M)
  1915. #define CPL_TLS_DATA_LENGTH_S 0
  1916. #define CPL_TLS_DATA_LENGTH_M 0xffff
  1917. #define CPL_TLS_DATA_LENGTH_V(x) ((x) << CPL_TLS_DATA_LENGTH_S)
  1918. #define CPL_TLS_DATA_LENGTH_G(x) \
  1919. (((x) >> CPL_TLS_DATA_LENGTH_S) & CPL_TLS_DATA_LENGTH_M)
  1920. struct cpl_rx_tls_cmp {
  1921. struct rss_header rsshdr;
  1922. union opcode_tid ot;
  1923. __be32 pdulength_length;
  1924. __be32 seq;
  1925. __be32 ddp_report;
  1926. __be32 r;
  1927. __be32 ddp_valid;
  1928. };
  1929. #define CPL_RX_TLS_CMP_OPCODE_S 24
  1930. #define CPL_RX_TLS_CMP_OPCODE_M 0xff
  1931. #define CPL_RX_TLS_CMP_OPCODE_V(x) ((x) << CPL_RX_TLS_CMP_OPCODE_S)
  1932. #define CPL_RX_TLS_CMP_OPCODE_G(x) \
  1933. (((x) >> CPL_RX_TLS_CMP_OPCODE_S) & CPL_RX_TLS_CMP_OPCODE_M)
  1934. #define CPL_RX_TLS_CMP_TID_S 0
  1935. #define CPL_RX_TLS_CMP_TID_M 0xffffff
  1936. #define CPL_RX_TLS_CMP_TID_V(x) ((x) << CPL_RX_TLS_CMP_TID_S)
  1937. #define CPL_RX_TLS_CMP_TID_G(x) \
  1938. (((x) >> CPL_RX_TLS_CMP_TID_S) & CPL_RX_TLS_CMP_TID_M)
  1939. #define CPL_RX_TLS_CMP_PDULENGTH_S 16
  1940. #define CPL_RX_TLS_CMP_PDULENGTH_M 0xffff
  1941. #define CPL_RX_TLS_CMP_PDULENGTH_V(x) ((x) << CPL_RX_TLS_CMP_PDULENGTH_S)
  1942. #define CPL_RX_TLS_CMP_PDULENGTH_G(x) \
  1943. (((x) >> CPL_RX_TLS_CMP_PDULENGTH_S) & CPL_RX_TLS_CMP_PDULENGTH_M)
  1944. #define CPL_RX_TLS_CMP_LENGTH_S 0
  1945. #define CPL_RX_TLS_CMP_LENGTH_M 0xffff
  1946. #define CPL_RX_TLS_CMP_LENGTH_V(x) ((x) << CPL_RX_TLS_CMP_LENGTH_S)
  1947. #define CPL_RX_TLS_CMP_LENGTH_G(x) \
  1948. (((x) >> CPL_RX_TLS_CMP_LENGTH_S) & CPL_RX_TLS_CMP_LENGTH_M)
  1949. #endif /* __T4_MSG_H */