lpfc_hw4.h 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472
  1. /*******************************************************************
  2. * This file is part of the Emulex Linux Device Driver for *
  3. * Fibre Channel Host Bus Adapters. *
  4. * Copyright (C) 2009 Emulex. All rights reserved. *
  5. * EMULEX and SLI are trademarks of Emulex. *
  6. * www.emulex.com *
  7. * *
  8. * This program is free software; you can redistribute it and/or *
  9. * modify it under the terms of version 2 of the GNU General *
  10. * Public License as published by the Free Software Foundation. *
  11. * This program is distributed in the hope that it will be useful. *
  12. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
  13. * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
  14. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
  15. * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
  16. * TO BE LEGALLY INVALID. See the GNU General Public License for *
  17. * more details, a copy of which can be found in the file COPYING *
  18. * included with this package. *
  19. *******************************************************************/
  20. /* Macros to deal with bit fields. Each bit field must have 3 #defines
  21. * associated with it (_SHIFT, _MASK, and _WORD).
  22. * EG. For a bit field that is in the 7th bit of the "field4" field of a
  23. * structure and is 2 bits in size the following #defines must exist:
  24. * struct temp {
  25. * uint32_t field1;
  26. * uint32_t field2;
  27. * uint32_t field3;
  28. * uint32_t field4;
  29. * #define example_bit_field_SHIFT 7
  30. * #define example_bit_field_MASK 0x03
  31. * #define example_bit_field_WORD field4
  32. * uint32_t field5;
  33. * };
  34. * Then the macros below may be used to get or set the value of that field.
  35. * EG. To get the value of the bit field from the above example:
  36. * struct temp t1;
  37. * value = bf_get(example_bit_field, &t1);
  38. * And then to set that bit field:
  39. * bf_set(example_bit_field, &t1, 2);
  40. * Or clear that bit field:
  41. * bf_set(example_bit_field, &t1, 0);
  42. */
  43. #define bf_get(name, ptr) \
  44. (((ptr)->name##_WORD >> name##_SHIFT) & name##_MASK)
  45. #define bf_set(name, ptr, value) \
  46. ((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
  47. ((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
  48. struct dma_address {
  49. uint32_t addr_lo;
  50. uint32_t addr_hi;
  51. };
  52. struct lpfc_sli_intf {
  53. uint32_t word0;
  54. #define lpfc_sli_intf_valid_SHIFT 29
  55. #define lpfc_sli_intf_valid_MASK 0x00000007
  56. #define lpfc_sli_intf_valid_WORD word0
  57. #define LPFC_SLI_INTF_VALID 6
  58. #define lpfc_sli_intf_featurelevel2_SHIFT 24
  59. #define lpfc_sli_intf_featurelevel2_MASK 0x0000001F
  60. #define lpfc_sli_intf_featurelevel2_WORD word0
  61. #define lpfc_sli_intf_featurelevel1_SHIFT 16
  62. #define lpfc_sli_intf_featurelevel1_MASK 0x000000FF
  63. #define lpfc_sli_intf_featurelevel1_WORD word0
  64. #define LPFC_SLI_INTF_FEATURELEVEL1_1 1
  65. #define LPFC_SLI_INTF_FEATURELEVEL1_2 2
  66. #define lpfc_sli_intf_sli_family_SHIFT 8
  67. #define lpfc_sli_intf_sli_family_MASK 0x000000FF
  68. #define lpfc_sli_intf_sli_family_WORD word0
  69. #define LPFC_SLI_INTF_FAMILY_BE2 0
  70. #define LPFC_SLI_INTF_FAMILY_BE3 1
  71. #define lpfc_sli_intf_slirev_SHIFT 4
  72. #define lpfc_sli_intf_slirev_MASK 0x0000000F
  73. #define lpfc_sli_intf_slirev_WORD word0
  74. #define LPFC_SLI_INTF_REV_SLI3 3
  75. #define LPFC_SLI_INTF_REV_SLI4 4
  76. #define lpfc_sli_intf_if_type_SHIFT 0
  77. #define lpfc_sli_intf_if_type_MASK 0x00000007
  78. #define lpfc_sli_intf_if_type_WORD word0
  79. #define LPFC_SLI_INTF_IF_TYPE_0 0
  80. #define LPFC_SLI_INTF_IF_TYPE_1 1
  81. };
  82. #define LPFC_SLI4_MBX_EMBED true
  83. #define LPFC_SLI4_MBX_NEMBED false
  84. #define LPFC_SLI4_MB_WORD_COUNT 64
  85. #define LPFC_MAX_MQ_PAGE 8
  86. #define LPFC_MAX_WQ_PAGE 8
  87. #define LPFC_MAX_CQ_PAGE 4
  88. #define LPFC_MAX_EQ_PAGE 8
  89. #define LPFC_VIR_FUNC_MAX 32 /* Maximum number of virtual functions */
  90. #define LPFC_PCI_FUNC_MAX 5 /* Maximum number of PCI functions */
  91. #define LPFC_VFR_PAGE_SIZE 0x1000 /* 4KB BAR2 per-VF register page size */
  92. /* Define SLI4 Alignment requirements. */
  93. #define LPFC_ALIGN_16_BYTE 16
  94. #define LPFC_ALIGN_64_BYTE 64
  95. /* Define SLI4 specific definitions. */
  96. #define LPFC_MQ_CQE_BYTE_OFFSET 256
  97. #define LPFC_MBX_CMD_HDR_LENGTH 16
  98. #define LPFC_MBX_ERROR_RANGE 0x4000
  99. #define LPFC_BMBX_BIT1_ADDR_HI 0x2
  100. #define LPFC_BMBX_BIT1_ADDR_LO 0
  101. #define LPFC_RPI_HDR_COUNT 64
  102. #define LPFC_HDR_TEMPLATE_SIZE 4096
  103. #define LPFC_RPI_ALLOC_ERROR 0xFFFF
  104. #define LPFC_FCF_RECORD_WD_CNT 132
  105. #define LPFC_ENTIRE_FCF_DATABASE 0
  106. #define LPFC_DFLT_FCF_INDEX 0
  107. /* Virtual function numbers */
  108. #define LPFC_VF0 0
  109. #define LPFC_VF1 1
  110. #define LPFC_VF2 2
  111. #define LPFC_VF3 3
  112. #define LPFC_VF4 4
  113. #define LPFC_VF5 5
  114. #define LPFC_VF6 6
  115. #define LPFC_VF7 7
  116. #define LPFC_VF8 8
  117. #define LPFC_VF9 9
  118. #define LPFC_VF10 10
  119. #define LPFC_VF11 11
  120. #define LPFC_VF12 12
  121. #define LPFC_VF13 13
  122. #define LPFC_VF14 14
  123. #define LPFC_VF15 15
  124. #define LPFC_VF16 16
  125. #define LPFC_VF17 17
  126. #define LPFC_VF18 18
  127. #define LPFC_VF19 19
  128. #define LPFC_VF20 20
  129. #define LPFC_VF21 21
  130. #define LPFC_VF22 22
  131. #define LPFC_VF23 23
  132. #define LPFC_VF24 24
  133. #define LPFC_VF25 25
  134. #define LPFC_VF26 26
  135. #define LPFC_VF27 27
  136. #define LPFC_VF28 28
  137. #define LPFC_VF29 29
  138. #define LPFC_VF30 30
  139. #define LPFC_VF31 31
  140. /* PCI function numbers */
  141. #define LPFC_PCI_FUNC0 0
  142. #define LPFC_PCI_FUNC1 1
  143. #define LPFC_PCI_FUNC2 2
  144. #define LPFC_PCI_FUNC3 3
  145. #define LPFC_PCI_FUNC4 4
  146. /* Active interrupt test count */
  147. #define LPFC_ACT_INTR_CNT 4
  148. /* Delay Multiplier constant */
  149. #define LPFC_DMULT_CONST 651042
  150. #define LPFC_MIM_IMAX 636
  151. #define LPFC_FP_DEF_IMAX 10000
  152. #define LPFC_SP_DEF_IMAX 10000
  153. /* PORT_CAPABILITIES constants. */
  154. #define LPFC_MAX_SUPPORTED_PAGES 8
  155. struct ulp_bde64 {
  156. union ULP_BDE_TUS {
  157. uint32_t w;
  158. struct {
  159. #ifdef __BIG_ENDIAN_BITFIELD
  160. uint32_t bdeFlags:8; /* BDE Flags 0 IS A SUPPORTED
  161. VALUE !! */
  162. uint32_t bdeSize:24; /* Size of buffer (in bytes) */
  163. #else /* __LITTLE_ENDIAN_BITFIELD */
  164. uint32_t bdeSize:24; /* Size of buffer (in bytes) */
  165. uint32_t bdeFlags:8; /* BDE Flags 0 IS A SUPPORTED
  166. VALUE !! */
  167. #endif
  168. #define BUFF_TYPE_BDE_64 0x00 /* BDE (Host_resident) */
  169. #define BUFF_TYPE_BDE_IMMED 0x01 /* Immediate Data BDE */
  170. #define BUFF_TYPE_BDE_64P 0x02 /* BDE (Port-resident) */
  171. #define BUFF_TYPE_BDE_64I 0x08 /* Input BDE (Host-resident) */
  172. #define BUFF_TYPE_BDE_64IP 0x0A /* Input BDE (Port-resident) */
  173. #define BUFF_TYPE_BLP_64 0x40 /* BLP (Host-resident) */
  174. #define BUFF_TYPE_BLP_64P 0x42 /* BLP (Port-resident) */
  175. } f;
  176. } tus;
  177. uint32_t addrLow;
  178. uint32_t addrHigh;
  179. };
  180. struct lpfc_sli4_flags {
  181. uint32_t word0;
  182. #define lpfc_fip_flag_SHIFT 0
  183. #define lpfc_fip_flag_MASK 0x00000001
  184. #define lpfc_fip_flag_WORD word0
  185. };
  186. struct sli4_bls_acc {
  187. uint32_t word0_rsvd; /* Word0 must be reserved */
  188. uint32_t word1;
  189. #define lpfc_abts_orig_SHIFT 0
  190. #define lpfc_abts_orig_MASK 0x00000001
  191. #define lpfc_abts_orig_WORD word1
  192. #define LPFC_ABTS_UNSOL_RSP 1
  193. #define LPFC_ABTS_UNSOL_INT 0
  194. uint32_t word2;
  195. #define lpfc_abts_rxid_SHIFT 0
  196. #define lpfc_abts_rxid_MASK 0x0000FFFF
  197. #define lpfc_abts_rxid_WORD word2
  198. #define lpfc_abts_oxid_SHIFT 16
  199. #define lpfc_abts_oxid_MASK 0x0000FFFF
  200. #define lpfc_abts_oxid_WORD word2
  201. uint32_t word3;
  202. uint32_t word4;
  203. uint32_t word5_rsvd; /* Word5 must be reserved */
  204. };
  205. /* event queue entry structure */
  206. struct lpfc_eqe {
  207. uint32_t word0;
  208. #define lpfc_eqe_resource_id_SHIFT 16
  209. #define lpfc_eqe_resource_id_MASK 0x000000FF
  210. #define lpfc_eqe_resource_id_WORD word0
  211. #define lpfc_eqe_minor_code_SHIFT 4
  212. #define lpfc_eqe_minor_code_MASK 0x00000FFF
  213. #define lpfc_eqe_minor_code_WORD word0
  214. #define lpfc_eqe_major_code_SHIFT 1
  215. #define lpfc_eqe_major_code_MASK 0x00000007
  216. #define lpfc_eqe_major_code_WORD word0
  217. #define lpfc_eqe_valid_SHIFT 0
  218. #define lpfc_eqe_valid_MASK 0x00000001
  219. #define lpfc_eqe_valid_WORD word0
  220. };
  221. /* completion queue entry structure (common fields for all cqe types) */
  222. struct lpfc_cqe {
  223. uint32_t reserved0;
  224. uint32_t reserved1;
  225. uint32_t reserved2;
  226. uint32_t word3;
  227. #define lpfc_cqe_valid_SHIFT 31
  228. #define lpfc_cqe_valid_MASK 0x00000001
  229. #define lpfc_cqe_valid_WORD word3
  230. #define lpfc_cqe_code_SHIFT 16
  231. #define lpfc_cqe_code_MASK 0x000000FF
  232. #define lpfc_cqe_code_WORD word3
  233. };
  234. /* Completion Queue Entry Status Codes */
  235. #define CQE_STATUS_SUCCESS 0x0
  236. #define CQE_STATUS_FCP_RSP_FAILURE 0x1
  237. #define CQE_STATUS_REMOTE_STOP 0x2
  238. #define CQE_STATUS_LOCAL_REJECT 0x3
  239. #define CQE_STATUS_NPORT_RJT 0x4
  240. #define CQE_STATUS_FABRIC_RJT 0x5
  241. #define CQE_STATUS_NPORT_BSY 0x6
  242. #define CQE_STATUS_FABRIC_BSY 0x7
  243. #define CQE_STATUS_INTERMED_RSP 0x8
  244. #define CQE_STATUS_LS_RJT 0x9
  245. #define CQE_STATUS_CMD_REJECT 0xb
  246. #define CQE_STATUS_FCP_TGT_LENCHECK 0xc
  247. #define CQE_STATUS_NEED_BUFF_ENTRY 0xf
  248. /* Status returned by hardware (valid only if status = CQE_STATUS_SUCCESS). */
  249. #define CQE_HW_STATUS_NO_ERR 0x0
  250. #define CQE_HW_STATUS_UNDERRUN 0x1
  251. #define CQE_HW_STATUS_OVERRUN 0x2
  252. /* Completion Queue Entry Codes */
  253. #define CQE_CODE_COMPL_WQE 0x1
  254. #define CQE_CODE_RELEASE_WQE 0x2
  255. #define CQE_CODE_RECEIVE 0x4
  256. #define CQE_CODE_XRI_ABORTED 0x5
  257. /* completion queue entry for wqe completions */
  258. struct lpfc_wcqe_complete {
  259. uint32_t word0;
  260. #define lpfc_wcqe_c_request_tag_SHIFT 16
  261. #define lpfc_wcqe_c_request_tag_MASK 0x0000FFFF
  262. #define lpfc_wcqe_c_request_tag_WORD word0
  263. #define lpfc_wcqe_c_status_SHIFT 8
  264. #define lpfc_wcqe_c_status_MASK 0x000000FF
  265. #define lpfc_wcqe_c_status_WORD word0
  266. #define lpfc_wcqe_c_hw_status_SHIFT 0
  267. #define lpfc_wcqe_c_hw_status_MASK 0x000000FF
  268. #define lpfc_wcqe_c_hw_status_WORD word0
  269. uint32_t total_data_placed;
  270. uint32_t parameter;
  271. uint32_t word3;
  272. #define lpfc_wcqe_c_valid_SHIFT lpfc_cqe_valid_SHIFT
  273. #define lpfc_wcqe_c_valid_MASK lpfc_cqe_valid_MASK
  274. #define lpfc_wcqe_c_valid_WORD lpfc_cqe_valid_WORD
  275. #define lpfc_wcqe_c_xb_SHIFT 28
  276. #define lpfc_wcqe_c_xb_MASK 0x00000001
  277. #define lpfc_wcqe_c_xb_WORD word3
  278. #define lpfc_wcqe_c_pv_SHIFT 27
  279. #define lpfc_wcqe_c_pv_MASK 0x00000001
  280. #define lpfc_wcqe_c_pv_WORD word3
  281. #define lpfc_wcqe_c_priority_SHIFT 24
  282. #define lpfc_wcqe_c_priority_MASK 0x00000007
  283. #define lpfc_wcqe_c_priority_WORD word3
  284. #define lpfc_wcqe_c_code_SHIFT lpfc_cqe_code_SHIFT
  285. #define lpfc_wcqe_c_code_MASK lpfc_cqe_code_MASK
  286. #define lpfc_wcqe_c_code_WORD lpfc_cqe_code_WORD
  287. };
  288. /* completion queue entry for wqe release */
  289. struct lpfc_wcqe_release {
  290. uint32_t reserved0;
  291. uint32_t reserved1;
  292. uint32_t word2;
  293. #define lpfc_wcqe_r_wq_id_SHIFT 16
  294. #define lpfc_wcqe_r_wq_id_MASK 0x0000FFFF
  295. #define lpfc_wcqe_r_wq_id_WORD word2
  296. #define lpfc_wcqe_r_wqe_index_SHIFT 0
  297. #define lpfc_wcqe_r_wqe_index_MASK 0x0000FFFF
  298. #define lpfc_wcqe_r_wqe_index_WORD word2
  299. uint32_t word3;
  300. #define lpfc_wcqe_r_valid_SHIFT lpfc_cqe_valid_SHIFT
  301. #define lpfc_wcqe_r_valid_MASK lpfc_cqe_valid_MASK
  302. #define lpfc_wcqe_r_valid_WORD lpfc_cqe_valid_WORD
  303. #define lpfc_wcqe_r_code_SHIFT lpfc_cqe_code_SHIFT
  304. #define lpfc_wcqe_r_code_MASK lpfc_cqe_code_MASK
  305. #define lpfc_wcqe_r_code_WORD lpfc_cqe_code_WORD
  306. };
  307. struct sli4_wcqe_xri_aborted {
  308. uint32_t word0;
  309. #define lpfc_wcqe_xa_status_SHIFT 8
  310. #define lpfc_wcqe_xa_status_MASK 0x000000FF
  311. #define lpfc_wcqe_xa_status_WORD word0
  312. uint32_t parameter;
  313. uint32_t word2;
  314. #define lpfc_wcqe_xa_remote_xid_SHIFT 16
  315. #define lpfc_wcqe_xa_remote_xid_MASK 0x0000FFFF
  316. #define lpfc_wcqe_xa_remote_xid_WORD word2
  317. #define lpfc_wcqe_xa_xri_SHIFT 0
  318. #define lpfc_wcqe_xa_xri_MASK 0x0000FFFF
  319. #define lpfc_wcqe_xa_xri_WORD word2
  320. uint32_t word3;
  321. #define lpfc_wcqe_xa_valid_SHIFT lpfc_cqe_valid_SHIFT
  322. #define lpfc_wcqe_xa_valid_MASK lpfc_cqe_valid_MASK
  323. #define lpfc_wcqe_xa_valid_WORD lpfc_cqe_valid_WORD
  324. #define lpfc_wcqe_xa_ia_SHIFT 30
  325. #define lpfc_wcqe_xa_ia_MASK 0x00000001
  326. #define lpfc_wcqe_xa_ia_WORD word3
  327. #define CQE_XRI_ABORTED_IA_REMOTE 0
  328. #define CQE_XRI_ABORTED_IA_LOCAL 1
  329. #define lpfc_wcqe_xa_br_SHIFT 29
  330. #define lpfc_wcqe_xa_br_MASK 0x00000001
  331. #define lpfc_wcqe_xa_br_WORD word3
  332. #define CQE_XRI_ABORTED_BR_BA_ACC 0
  333. #define CQE_XRI_ABORTED_BR_BA_RJT 1
  334. #define lpfc_wcqe_xa_eo_SHIFT 28
  335. #define lpfc_wcqe_xa_eo_MASK 0x00000001
  336. #define lpfc_wcqe_xa_eo_WORD word3
  337. #define CQE_XRI_ABORTED_EO_REMOTE 0
  338. #define CQE_XRI_ABORTED_EO_LOCAL 1
  339. #define lpfc_wcqe_xa_code_SHIFT lpfc_cqe_code_SHIFT
  340. #define lpfc_wcqe_xa_code_MASK lpfc_cqe_code_MASK
  341. #define lpfc_wcqe_xa_code_WORD lpfc_cqe_code_WORD
  342. };
  343. /* completion queue entry structure for rqe completion */
  344. struct lpfc_rcqe {
  345. uint32_t word0;
  346. #define lpfc_rcqe_bindex_SHIFT 16
  347. #define lpfc_rcqe_bindex_MASK 0x0000FFF
  348. #define lpfc_rcqe_bindex_WORD word0
  349. #define lpfc_rcqe_status_SHIFT 8
  350. #define lpfc_rcqe_status_MASK 0x000000FF
  351. #define lpfc_rcqe_status_WORD word0
  352. #define FC_STATUS_RQ_SUCCESS 0x10 /* Async receive successful */
  353. #define FC_STATUS_RQ_BUF_LEN_EXCEEDED 0x11 /* payload truncated */
  354. #define FC_STATUS_INSUFF_BUF_NEED_BUF 0x12 /* Insufficient buffers */
  355. #define FC_STATUS_INSUFF_BUF_FRM_DISC 0x13 /* Frame Discard */
  356. uint32_t reserved1;
  357. uint32_t word2;
  358. #define lpfc_rcqe_length_SHIFT 16
  359. #define lpfc_rcqe_length_MASK 0x0000FFFF
  360. #define lpfc_rcqe_length_WORD word2
  361. #define lpfc_rcqe_rq_id_SHIFT 6
  362. #define lpfc_rcqe_rq_id_MASK 0x000003FF
  363. #define lpfc_rcqe_rq_id_WORD word2
  364. #define lpfc_rcqe_fcf_id_SHIFT 0
  365. #define lpfc_rcqe_fcf_id_MASK 0x0000003F
  366. #define lpfc_rcqe_fcf_id_WORD word2
  367. uint32_t word3;
  368. #define lpfc_rcqe_valid_SHIFT lpfc_cqe_valid_SHIFT
  369. #define lpfc_rcqe_valid_MASK lpfc_cqe_valid_MASK
  370. #define lpfc_rcqe_valid_WORD lpfc_cqe_valid_WORD
  371. #define lpfc_rcqe_port_SHIFT 30
  372. #define lpfc_rcqe_port_MASK 0x00000001
  373. #define lpfc_rcqe_port_WORD word3
  374. #define lpfc_rcqe_hdr_length_SHIFT 24
  375. #define lpfc_rcqe_hdr_length_MASK 0x0000001F
  376. #define lpfc_rcqe_hdr_length_WORD word3
  377. #define lpfc_rcqe_code_SHIFT lpfc_cqe_code_SHIFT
  378. #define lpfc_rcqe_code_MASK lpfc_cqe_code_MASK
  379. #define lpfc_rcqe_code_WORD lpfc_cqe_code_WORD
  380. #define lpfc_rcqe_eof_SHIFT 8
  381. #define lpfc_rcqe_eof_MASK 0x000000FF
  382. #define lpfc_rcqe_eof_WORD word3
  383. #define FCOE_EOFn 0x41
  384. #define FCOE_EOFt 0x42
  385. #define FCOE_EOFni 0x49
  386. #define FCOE_EOFa 0x50
  387. #define lpfc_rcqe_sof_SHIFT 0
  388. #define lpfc_rcqe_sof_MASK 0x000000FF
  389. #define lpfc_rcqe_sof_WORD word3
  390. #define FCOE_SOFi2 0x2d
  391. #define FCOE_SOFi3 0x2e
  392. #define FCOE_SOFn2 0x35
  393. #define FCOE_SOFn3 0x36
  394. };
  395. struct lpfc_wqe_generic{
  396. struct ulp_bde64 bde;
  397. uint32_t word3;
  398. uint32_t word4;
  399. uint32_t word5;
  400. uint32_t word6;
  401. #define lpfc_wqe_gen_context_SHIFT 16
  402. #define lpfc_wqe_gen_context_MASK 0x0000FFFF
  403. #define lpfc_wqe_gen_context_WORD word6
  404. #define lpfc_wqe_gen_xri_SHIFT 0
  405. #define lpfc_wqe_gen_xri_MASK 0x0000FFFF
  406. #define lpfc_wqe_gen_xri_WORD word6
  407. uint32_t word7;
  408. #define lpfc_wqe_gen_lnk_SHIFT 23
  409. #define lpfc_wqe_gen_lnk_MASK 0x00000001
  410. #define lpfc_wqe_gen_lnk_WORD word7
  411. #define lpfc_wqe_gen_erp_SHIFT 22
  412. #define lpfc_wqe_gen_erp_MASK 0x00000001
  413. #define lpfc_wqe_gen_erp_WORD word7
  414. #define lpfc_wqe_gen_pu_SHIFT 20
  415. #define lpfc_wqe_gen_pu_MASK 0x00000003
  416. #define lpfc_wqe_gen_pu_WORD word7
  417. #define lpfc_wqe_gen_class_SHIFT 16
  418. #define lpfc_wqe_gen_class_MASK 0x00000007
  419. #define lpfc_wqe_gen_class_WORD word7
  420. #define lpfc_wqe_gen_command_SHIFT 8
  421. #define lpfc_wqe_gen_command_MASK 0x000000FF
  422. #define lpfc_wqe_gen_command_WORD word7
  423. #define lpfc_wqe_gen_status_SHIFT 4
  424. #define lpfc_wqe_gen_status_MASK 0x0000000F
  425. #define lpfc_wqe_gen_status_WORD word7
  426. #define lpfc_wqe_gen_ct_SHIFT 2
  427. #define lpfc_wqe_gen_ct_MASK 0x00000003
  428. #define lpfc_wqe_gen_ct_WORD word7
  429. uint32_t abort_tag;
  430. uint32_t word9;
  431. #define lpfc_wqe_gen_request_tag_SHIFT 0
  432. #define lpfc_wqe_gen_request_tag_MASK 0x0000FFFF
  433. #define lpfc_wqe_gen_request_tag_WORD word9
  434. uint32_t word10;
  435. #define lpfc_wqe_gen_ccp_SHIFT 24
  436. #define lpfc_wqe_gen_ccp_MASK 0x000000FF
  437. #define lpfc_wqe_gen_ccp_WORD word10
  438. #define lpfc_wqe_gen_ccpe_SHIFT 23
  439. #define lpfc_wqe_gen_ccpe_MASK 0x00000001
  440. #define lpfc_wqe_gen_ccpe_WORD word10
  441. #define lpfc_wqe_gen_pv_SHIFT 19
  442. #define lpfc_wqe_gen_pv_MASK 0x00000001
  443. #define lpfc_wqe_gen_pv_WORD word10
  444. #define lpfc_wqe_gen_pri_SHIFT 16
  445. #define lpfc_wqe_gen_pri_MASK 0x00000007
  446. #define lpfc_wqe_gen_pri_WORD word10
  447. uint32_t word11;
  448. #define lpfc_wqe_gen_cq_id_SHIFT 16
  449. #define lpfc_wqe_gen_cq_id_MASK 0x0000FFFF
  450. #define lpfc_wqe_gen_cq_id_WORD word11
  451. #define LPFC_WQE_CQ_ID_DEFAULT 0xffff
  452. #define lpfc_wqe_gen_wqec_SHIFT 7
  453. #define lpfc_wqe_gen_wqec_MASK 0x00000001
  454. #define lpfc_wqe_gen_wqec_WORD word11
  455. #define ELS_ID_FLOGI 3
  456. #define ELS_ID_FDISC 2
  457. #define ELS_ID_LOGO 1
  458. #define ELS_ID_DEFAULT 0
  459. #define lpfc_wqe_gen_els_id_SHIFT 4
  460. #define lpfc_wqe_gen_els_id_MASK 0x00000003
  461. #define lpfc_wqe_gen_els_id_WORD word11
  462. #define lpfc_wqe_gen_cmd_type_SHIFT 0
  463. #define lpfc_wqe_gen_cmd_type_MASK 0x0000000F
  464. #define lpfc_wqe_gen_cmd_type_WORD word11
  465. uint32_t payload[4];
  466. };
  467. struct lpfc_rqe {
  468. uint32_t address_hi;
  469. uint32_t address_lo;
  470. };
  471. /* buffer descriptors */
  472. struct lpfc_bde4 {
  473. uint32_t addr_hi;
  474. uint32_t addr_lo;
  475. uint32_t word2;
  476. #define lpfc_bde4_last_SHIFT 31
  477. #define lpfc_bde4_last_MASK 0x00000001
  478. #define lpfc_bde4_last_WORD word2
  479. #define lpfc_bde4_sge_offset_SHIFT 0
  480. #define lpfc_bde4_sge_offset_MASK 0x000003FF
  481. #define lpfc_bde4_sge_offset_WORD word2
  482. uint32_t word3;
  483. #define lpfc_bde4_length_SHIFT 0
  484. #define lpfc_bde4_length_MASK 0x000000FF
  485. #define lpfc_bde4_length_WORD word3
  486. };
  487. struct lpfc_register {
  488. uint32_t word0;
  489. };
  490. #define LPFC_UERR_STATUS_HI 0x00A4
  491. #define LPFC_UERR_STATUS_LO 0x00A0
  492. #define LPFC_UE_MASK_HI 0x00AC
  493. #define LPFC_UE_MASK_LO 0x00A8
  494. #define LPFC_SLI_INTF 0x0058
  495. /* BAR0 Registers */
  496. #define LPFC_HST_STATE 0x00AC
  497. #define lpfc_hst_state_perr_SHIFT 31
  498. #define lpfc_hst_state_perr_MASK 0x1
  499. #define lpfc_hst_state_perr_WORD word0
  500. #define lpfc_hst_state_sfi_SHIFT 30
  501. #define lpfc_hst_state_sfi_MASK 0x1
  502. #define lpfc_hst_state_sfi_WORD word0
  503. #define lpfc_hst_state_nip_SHIFT 29
  504. #define lpfc_hst_state_nip_MASK 0x1
  505. #define lpfc_hst_state_nip_WORD word0
  506. #define lpfc_hst_state_ipc_SHIFT 28
  507. #define lpfc_hst_state_ipc_MASK 0x1
  508. #define lpfc_hst_state_ipc_WORD word0
  509. #define lpfc_hst_state_xrom_SHIFT 27
  510. #define lpfc_hst_state_xrom_MASK 0x1
  511. #define lpfc_hst_state_xrom_WORD word0
  512. #define lpfc_hst_state_dl_SHIFT 26
  513. #define lpfc_hst_state_dl_MASK 0x1
  514. #define lpfc_hst_state_dl_WORD word0
  515. #define lpfc_hst_state_port_status_SHIFT 0
  516. #define lpfc_hst_state_port_status_MASK 0xFFFF
  517. #define lpfc_hst_state_port_status_WORD word0
  518. #define LPFC_POST_STAGE_POWER_ON_RESET 0x0000
  519. #define LPFC_POST_STAGE_AWAITING_HOST_RDY 0x0001
  520. #define LPFC_POST_STAGE_HOST_RDY 0x0002
  521. #define LPFC_POST_STAGE_BE_RESET 0x0003
  522. #define LPFC_POST_STAGE_SEEPROM_CS_START 0x0100
  523. #define LPFC_POST_STAGE_SEEPROM_CS_DONE 0x0101
  524. #define LPFC_POST_STAGE_DDR_CONFIG_START 0x0200
  525. #define LPFC_POST_STAGE_DDR_CONFIG_DONE 0x0201
  526. #define LPFC_POST_STAGE_DDR_CALIBRATE_START 0x0300
  527. #define LPFC_POST_STAGE_DDR_CALIBRATE_DONE 0x0301
  528. #define LPFC_POST_STAGE_DDR_TEST_START 0x0400
  529. #define LPFC_POST_STAGE_DDR_TEST_DONE 0x0401
  530. #define LPFC_POST_STAGE_REDBOOT_INIT_START 0x0600
  531. #define LPFC_POST_STAGE_REDBOOT_INIT_DONE 0x0601
  532. #define LPFC_POST_STAGE_FW_IMAGE_LOAD_START 0x0700
  533. #define LPFC_POST_STAGE_FW_IMAGE_LOAD_DONE 0x0701
  534. #define LPFC_POST_STAGE_ARMFW_START 0x0800
  535. #define LPFC_POST_STAGE_DHCP_QUERY_START 0x0900
  536. #define LPFC_POST_STAGE_DHCP_QUERY_DONE 0x0901
  537. #define LPFC_POST_STAGE_BOOT_TARGET_DISCOVERY_START 0x0A00
  538. #define LPFC_POST_STAGE_BOOT_TARGET_DISCOVERY_DONE 0x0A01
  539. #define LPFC_POST_STAGE_RC_OPTION_SET 0x0B00
  540. #define LPFC_POST_STAGE_SWITCH_LINK 0x0B01
  541. #define LPFC_POST_STAGE_SEND_ICDS_MESSAGE 0x0B02
  542. #define LPFC_POST_STAGE_PERFROM_TFTP 0x0B03
  543. #define LPFC_POST_STAGE_PARSE_XML 0x0B04
  544. #define LPFC_POST_STAGE_DOWNLOAD_IMAGE 0x0B05
  545. #define LPFC_POST_STAGE_FLASH_IMAGE 0x0B06
  546. #define LPFC_POST_STAGE_RC_DONE 0x0B07
  547. #define LPFC_POST_STAGE_REBOOT_SYSTEM 0x0B08
  548. #define LPFC_POST_STAGE_MAC_ADDRESS 0x0C00
  549. #define LPFC_POST_STAGE_ARMFW_READY 0xC000
  550. #define LPFC_POST_STAGE_ARMFW_UE 0xF000
  551. /* BAR1 Registers */
  552. #define LPFC_IMR_MASK_ALL 0xFFFFFFFF
  553. #define LPFC_ISCR_CLEAR_ALL 0xFFFFFFFF
  554. #define LPFC_HST_ISR0 0x0C18
  555. #define LPFC_HST_ISR1 0x0C1C
  556. #define LPFC_HST_ISR2 0x0C20
  557. #define LPFC_HST_ISR3 0x0C24
  558. #define LPFC_HST_ISR4 0x0C28
  559. #define LPFC_HST_IMR0 0x0C48
  560. #define LPFC_HST_IMR1 0x0C4C
  561. #define LPFC_HST_IMR2 0x0C50
  562. #define LPFC_HST_IMR3 0x0C54
  563. #define LPFC_HST_IMR4 0x0C58
  564. #define LPFC_HST_ISCR0 0x0C78
  565. #define LPFC_HST_ISCR1 0x0C7C
  566. #define LPFC_HST_ISCR2 0x0C80
  567. #define LPFC_HST_ISCR3 0x0C84
  568. #define LPFC_HST_ISCR4 0x0C88
  569. #define LPFC_SLI4_INTR0 BIT0
  570. #define LPFC_SLI4_INTR1 BIT1
  571. #define LPFC_SLI4_INTR2 BIT2
  572. #define LPFC_SLI4_INTR3 BIT3
  573. #define LPFC_SLI4_INTR4 BIT4
  574. #define LPFC_SLI4_INTR5 BIT5
  575. #define LPFC_SLI4_INTR6 BIT6
  576. #define LPFC_SLI4_INTR7 BIT7
  577. #define LPFC_SLI4_INTR8 BIT8
  578. #define LPFC_SLI4_INTR9 BIT9
  579. #define LPFC_SLI4_INTR10 BIT10
  580. #define LPFC_SLI4_INTR11 BIT11
  581. #define LPFC_SLI4_INTR12 BIT12
  582. #define LPFC_SLI4_INTR13 BIT13
  583. #define LPFC_SLI4_INTR14 BIT14
  584. #define LPFC_SLI4_INTR15 BIT15
  585. #define LPFC_SLI4_INTR16 BIT16
  586. #define LPFC_SLI4_INTR17 BIT17
  587. #define LPFC_SLI4_INTR18 BIT18
  588. #define LPFC_SLI4_INTR19 BIT19
  589. #define LPFC_SLI4_INTR20 BIT20
  590. #define LPFC_SLI4_INTR21 BIT21
  591. #define LPFC_SLI4_INTR22 BIT22
  592. #define LPFC_SLI4_INTR23 BIT23
  593. #define LPFC_SLI4_INTR24 BIT24
  594. #define LPFC_SLI4_INTR25 BIT25
  595. #define LPFC_SLI4_INTR26 BIT26
  596. #define LPFC_SLI4_INTR27 BIT27
  597. #define LPFC_SLI4_INTR28 BIT28
  598. #define LPFC_SLI4_INTR29 BIT29
  599. #define LPFC_SLI4_INTR30 BIT30
  600. #define LPFC_SLI4_INTR31 BIT31
  601. /* BAR2 Registers */
  602. #define LPFC_RQ_DOORBELL 0x00A0
  603. #define lpfc_rq_doorbell_num_posted_SHIFT 16
  604. #define lpfc_rq_doorbell_num_posted_MASK 0x3FFF
  605. #define lpfc_rq_doorbell_num_posted_WORD word0
  606. #define LPFC_RQ_POST_BATCH 8 /* RQEs to post at one time */
  607. #define lpfc_rq_doorbell_id_SHIFT 0
  608. #define lpfc_rq_doorbell_id_MASK 0x03FF
  609. #define lpfc_rq_doorbell_id_WORD word0
  610. #define LPFC_WQ_DOORBELL 0x0040
  611. #define lpfc_wq_doorbell_num_posted_SHIFT 24
  612. #define lpfc_wq_doorbell_num_posted_MASK 0x00FF
  613. #define lpfc_wq_doorbell_num_posted_WORD word0
  614. #define lpfc_wq_doorbell_index_SHIFT 16
  615. #define lpfc_wq_doorbell_index_MASK 0x00FF
  616. #define lpfc_wq_doorbell_index_WORD word0
  617. #define lpfc_wq_doorbell_id_SHIFT 0
  618. #define lpfc_wq_doorbell_id_MASK 0xFFFF
  619. #define lpfc_wq_doorbell_id_WORD word0
  620. #define LPFC_EQCQ_DOORBELL 0x0120
  621. #define lpfc_eqcq_doorbell_arm_SHIFT 29
  622. #define lpfc_eqcq_doorbell_arm_MASK 0x0001
  623. #define lpfc_eqcq_doorbell_arm_WORD word0
  624. #define lpfc_eqcq_doorbell_num_released_SHIFT 16
  625. #define lpfc_eqcq_doorbell_num_released_MASK 0x1FFF
  626. #define lpfc_eqcq_doorbell_num_released_WORD word0
  627. #define lpfc_eqcq_doorbell_qt_SHIFT 10
  628. #define lpfc_eqcq_doorbell_qt_MASK 0x0001
  629. #define lpfc_eqcq_doorbell_qt_WORD word0
  630. #define LPFC_QUEUE_TYPE_COMPLETION 0
  631. #define LPFC_QUEUE_TYPE_EVENT 1
  632. #define lpfc_eqcq_doorbell_eqci_SHIFT 9
  633. #define lpfc_eqcq_doorbell_eqci_MASK 0x0001
  634. #define lpfc_eqcq_doorbell_eqci_WORD word0
  635. #define lpfc_eqcq_doorbell_cqid_SHIFT 0
  636. #define lpfc_eqcq_doorbell_cqid_MASK 0x03FF
  637. #define lpfc_eqcq_doorbell_cqid_WORD word0
  638. #define lpfc_eqcq_doorbell_eqid_SHIFT 0
  639. #define lpfc_eqcq_doorbell_eqid_MASK 0x01FF
  640. #define lpfc_eqcq_doorbell_eqid_WORD word0
  641. #define LPFC_BMBX 0x0160
  642. #define lpfc_bmbx_addr_SHIFT 2
  643. #define lpfc_bmbx_addr_MASK 0x3FFFFFFF
  644. #define lpfc_bmbx_addr_WORD word0
  645. #define lpfc_bmbx_hi_SHIFT 1
  646. #define lpfc_bmbx_hi_MASK 0x0001
  647. #define lpfc_bmbx_hi_WORD word0
  648. #define lpfc_bmbx_rdy_SHIFT 0
  649. #define lpfc_bmbx_rdy_MASK 0x0001
  650. #define lpfc_bmbx_rdy_WORD word0
  651. #define LPFC_MQ_DOORBELL 0x0140
  652. #define lpfc_mq_doorbell_num_posted_SHIFT 16
  653. #define lpfc_mq_doorbell_num_posted_MASK 0x3FFF
  654. #define lpfc_mq_doorbell_num_posted_WORD word0
  655. #define lpfc_mq_doorbell_id_SHIFT 0
  656. #define lpfc_mq_doorbell_id_MASK 0x03FF
  657. #define lpfc_mq_doorbell_id_WORD word0
  658. struct lpfc_sli4_cfg_mhdr {
  659. uint32_t word1;
  660. #define lpfc_mbox_hdr_emb_SHIFT 0
  661. #define lpfc_mbox_hdr_emb_MASK 0x00000001
  662. #define lpfc_mbox_hdr_emb_WORD word1
  663. #define lpfc_mbox_hdr_sge_cnt_SHIFT 3
  664. #define lpfc_mbox_hdr_sge_cnt_MASK 0x0000001F
  665. #define lpfc_mbox_hdr_sge_cnt_WORD word1
  666. uint32_t payload_length;
  667. uint32_t tag_lo;
  668. uint32_t tag_hi;
  669. uint32_t reserved5;
  670. };
  671. union lpfc_sli4_cfg_shdr {
  672. struct {
  673. uint32_t word6;
  674. #define lpfc_mbox_hdr_opcode_SHIFT 0
  675. #define lpfc_mbox_hdr_opcode_MASK 0x000000FF
  676. #define lpfc_mbox_hdr_opcode_WORD word6
  677. #define lpfc_mbox_hdr_subsystem_SHIFT 8
  678. #define lpfc_mbox_hdr_subsystem_MASK 0x000000FF
  679. #define lpfc_mbox_hdr_subsystem_WORD word6
  680. #define lpfc_mbox_hdr_port_number_SHIFT 16
  681. #define lpfc_mbox_hdr_port_number_MASK 0x000000FF
  682. #define lpfc_mbox_hdr_port_number_WORD word6
  683. #define lpfc_mbox_hdr_domain_SHIFT 24
  684. #define lpfc_mbox_hdr_domain_MASK 0x000000FF
  685. #define lpfc_mbox_hdr_domain_WORD word6
  686. uint32_t timeout;
  687. uint32_t request_length;
  688. uint32_t reserved9;
  689. } request;
  690. struct {
  691. uint32_t word6;
  692. #define lpfc_mbox_hdr_opcode_SHIFT 0
  693. #define lpfc_mbox_hdr_opcode_MASK 0x000000FF
  694. #define lpfc_mbox_hdr_opcode_WORD word6
  695. #define lpfc_mbox_hdr_subsystem_SHIFT 8
  696. #define lpfc_mbox_hdr_subsystem_MASK 0x000000FF
  697. #define lpfc_mbox_hdr_subsystem_WORD word6
  698. #define lpfc_mbox_hdr_domain_SHIFT 24
  699. #define lpfc_mbox_hdr_domain_MASK 0x000000FF
  700. #define lpfc_mbox_hdr_domain_WORD word6
  701. uint32_t word7;
  702. #define lpfc_mbox_hdr_status_SHIFT 0
  703. #define lpfc_mbox_hdr_status_MASK 0x000000FF
  704. #define lpfc_mbox_hdr_status_WORD word7
  705. #define lpfc_mbox_hdr_add_status_SHIFT 8
  706. #define lpfc_mbox_hdr_add_status_MASK 0x000000FF
  707. #define lpfc_mbox_hdr_add_status_WORD word7
  708. uint32_t response_length;
  709. uint32_t actual_response_length;
  710. } response;
  711. };
  712. /* Mailbox structures */
  713. struct mbox_header {
  714. struct lpfc_sli4_cfg_mhdr cfg_mhdr;
  715. union lpfc_sli4_cfg_shdr cfg_shdr;
  716. };
  717. /* Subsystem Definitions */
  718. #define LPFC_MBOX_SUBSYSTEM_COMMON 0x1
  719. #define LPFC_MBOX_SUBSYSTEM_FCOE 0xC
  720. /* Device Specific Definitions */
  721. /* The HOST ENDIAN defines are in Big Endian format. */
  722. #define HOST_ENDIAN_LOW_WORD0 0xFF3412FF
  723. #define HOST_ENDIAN_HIGH_WORD1 0xFF7856FF
  724. /* Common Opcodes */
  725. #define LPFC_MBOX_OPCODE_CQ_CREATE 0x0C
  726. #define LPFC_MBOX_OPCODE_EQ_CREATE 0x0D
  727. #define LPFC_MBOX_OPCODE_MQ_CREATE 0x15
  728. #define LPFC_MBOX_OPCODE_GET_CNTL_ATTRIBUTES 0x20
  729. #define LPFC_MBOX_OPCODE_NOP 0x21
  730. #define LPFC_MBOX_OPCODE_MQ_DESTROY 0x35
  731. #define LPFC_MBOX_OPCODE_CQ_DESTROY 0x36
  732. #define LPFC_MBOX_OPCODE_EQ_DESTROY 0x37
  733. #define LPFC_MBOX_OPCODE_QUERY_FW_CFG 0x3A
  734. #define LPFC_MBOX_OPCODE_FUNCTION_RESET 0x3D
  735. /* FCoE Opcodes */
  736. #define LPFC_MBOX_OPCODE_FCOE_WQ_CREATE 0x01
  737. #define LPFC_MBOX_OPCODE_FCOE_WQ_DESTROY 0x02
  738. #define LPFC_MBOX_OPCODE_FCOE_POST_SGL_PAGES 0x03
  739. #define LPFC_MBOX_OPCODE_FCOE_REMOVE_SGL_PAGES 0x04
  740. #define LPFC_MBOX_OPCODE_FCOE_RQ_CREATE 0x05
  741. #define LPFC_MBOX_OPCODE_FCOE_RQ_DESTROY 0x06
  742. #define LPFC_MBOX_OPCODE_FCOE_READ_FCF_TABLE 0x08
  743. #define LPFC_MBOX_OPCODE_FCOE_ADD_FCF 0x09
  744. #define LPFC_MBOX_OPCODE_FCOE_DELETE_FCF 0x0A
  745. #define LPFC_MBOX_OPCODE_FCOE_POST_HDR_TEMPLATE 0x0B
  746. #define LPFC_MBOX_OPCODE_FCOE_REDISCOVER_FCF 0x10
  747. /* Mailbox command structures */
  748. struct eq_context {
  749. uint32_t word0;
  750. #define lpfc_eq_context_size_SHIFT 31
  751. #define lpfc_eq_context_size_MASK 0x00000001
  752. #define lpfc_eq_context_size_WORD word0
  753. #define LPFC_EQE_SIZE_4 0x0
  754. #define LPFC_EQE_SIZE_16 0x1
  755. #define lpfc_eq_context_valid_SHIFT 29
  756. #define lpfc_eq_context_valid_MASK 0x00000001
  757. #define lpfc_eq_context_valid_WORD word0
  758. uint32_t word1;
  759. #define lpfc_eq_context_count_SHIFT 26
  760. #define lpfc_eq_context_count_MASK 0x00000003
  761. #define lpfc_eq_context_count_WORD word1
  762. #define LPFC_EQ_CNT_256 0x0
  763. #define LPFC_EQ_CNT_512 0x1
  764. #define LPFC_EQ_CNT_1024 0x2
  765. #define LPFC_EQ_CNT_2048 0x3
  766. #define LPFC_EQ_CNT_4096 0x4
  767. uint32_t word2;
  768. #define lpfc_eq_context_delay_multi_SHIFT 13
  769. #define lpfc_eq_context_delay_multi_MASK 0x000003FF
  770. #define lpfc_eq_context_delay_multi_WORD word2
  771. uint32_t reserved3;
  772. };
  773. struct sgl_page_pairs {
  774. uint32_t sgl_pg0_addr_lo;
  775. uint32_t sgl_pg0_addr_hi;
  776. uint32_t sgl_pg1_addr_lo;
  777. uint32_t sgl_pg1_addr_hi;
  778. };
  779. struct lpfc_mbx_post_sgl_pages {
  780. struct mbox_header header;
  781. uint32_t word0;
  782. #define lpfc_post_sgl_pages_xri_SHIFT 0
  783. #define lpfc_post_sgl_pages_xri_MASK 0x0000FFFF
  784. #define lpfc_post_sgl_pages_xri_WORD word0
  785. #define lpfc_post_sgl_pages_xricnt_SHIFT 16
  786. #define lpfc_post_sgl_pages_xricnt_MASK 0x0000FFFF
  787. #define lpfc_post_sgl_pages_xricnt_WORD word0
  788. struct sgl_page_pairs sgl_pg_pairs[1];
  789. };
  790. /* word0 of page-1 struct shares the same SHIFT/MASK/WORD defines as above */
  791. struct lpfc_mbx_post_uembed_sgl_page1 {
  792. union lpfc_sli4_cfg_shdr cfg_shdr;
  793. uint32_t word0;
  794. struct sgl_page_pairs sgl_pg_pairs;
  795. };
  796. struct lpfc_mbx_sge {
  797. uint32_t pa_lo;
  798. uint32_t pa_hi;
  799. uint32_t length;
  800. };
  801. struct lpfc_mbx_nembed_cmd {
  802. struct lpfc_sli4_cfg_mhdr cfg_mhdr;
  803. #define LPFC_SLI4_MBX_SGE_MAX_PAGES 19
  804. struct lpfc_mbx_sge sge[LPFC_SLI4_MBX_SGE_MAX_PAGES];
  805. };
  806. struct lpfc_mbx_nembed_sge_virt {
  807. void *addr[LPFC_SLI4_MBX_SGE_MAX_PAGES];
  808. };
  809. struct lpfc_mbx_eq_create {
  810. struct mbox_header header;
  811. union {
  812. struct {
  813. uint32_t word0;
  814. #define lpfc_mbx_eq_create_num_pages_SHIFT 0
  815. #define lpfc_mbx_eq_create_num_pages_MASK 0x0000FFFF
  816. #define lpfc_mbx_eq_create_num_pages_WORD word0
  817. struct eq_context context;
  818. struct dma_address page[LPFC_MAX_EQ_PAGE];
  819. } request;
  820. struct {
  821. uint32_t word0;
  822. #define lpfc_mbx_eq_create_q_id_SHIFT 0
  823. #define lpfc_mbx_eq_create_q_id_MASK 0x0000FFFF
  824. #define lpfc_mbx_eq_create_q_id_WORD word0
  825. } response;
  826. } u;
  827. };
  828. struct lpfc_mbx_eq_destroy {
  829. struct mbox_header header;
  830. union {
  831. struct {
  832. uint32_t word0;
  833. #define lpfc_mbx_eq_destroy_q_id_SHIFT 0
  834. #define lpfc_mbx_eq_destroy_q_id_MASK 0x0000FFFF
  835. #define lpfc_mbx_eq_destroy_q_id_WORD word0
  836. } request;
  837. struct {
  838. uint32_t word0;
  839. } response;
  840. } u;
  841. };
  842. struct lpfc_mbx_nop {
  843. struct mbox_header header;
  844. uint32_t context[2];
  845. };
  846. struct cq_context {
  847. uint32_t word0;
  848. #define lpfc_cq_context_event_SHIFT 31
  849. #define lpfc_cq_context_event_MASK 0x00000001
  850. #define lpfc_cq_context_event_WORD word0
  851. #define lpfc_cq_context_valid_SHIFT 29
  852. #define lpfc_cq_context_valid_MASK 0x00000001
  853. #define lpfc_cq_context_valid_WORD word0
  854. #define lpfc_cq_context_count_SHIFT 27
  855. #define lpfc_cq_context_count_MASK 0x00000003
  856. #define lpfc_cq_context_count_WORD word0
  857. #define LPFC_CQ_CNT_256 0x0
  858. #define LPFC_CQ_CNT_512 0x1
  859. #define LPFC_CQ_CNT_1024 0x2
  860. uint32_t word1;
  861. #define lpfc_cq_eq_id_SHIFT 22
  862. #define lpfc_cq_eq_id_MASK 0x000000FF
  863. #define lpfc_cq_eq_id_WORD word1
  864. uint32_t reserved0;
  865. uint32_t reserved1;
  866. };
  867. struct lpfc_mbx_cq_create {
  868. struct mbox_header header;
  869. union {
  870. struct {
  871. uint32_t word0;
  872. #define lpfc_mbx_cq_create_num_pages_SHIFT 0
  873. #define lpfc_mbx_cq_create_num_pages_MASK 0x0000FFFF
  874. #define lpfc_mbx_cq_create_num_pages_WORD word0
  875. struct cq_context context;
  876. struct dma_address page[LPFC_MAX_CQ_PAGE];
  877. } request;
  878. struct {
  879. uint32_t word0;
  880. #define lpfc_mbx_cq_create_q_id_SHIFT 0
  881. #define lpfc_mbx_cq_create_q_id_MASK 0x0000FFFF
  882. #define lpfc_mbx_cq_create_q_id_WORD word0
  883. } response;
  884. } u;
  885. };
  886. struct lpfc_mbx_cq_destroy {
  887. struct mbox_header header;
  888. union {
  889. struct {
  890. uint32_t word0;
  891. #define lpfc_mbx_cq_destroy_q_id_SHIFT 0
  892. #define lpfc_mbx_cq_destroy_q_id_MASK 0x0000FFFF
  893. #define lpfc_mbx_cq_destroy_q_id_WORD word0
  894. } request;
  895. struct {
  896. uint32_t word0;
  897. } response;
  898. } u;
  899. };
  900. struct wq_context {
  901. uint32_t reserved0;
  902. uint32_t reserved1;
  903. uint32_t reserved2;
  904. uint32_t reserved3;
  905. };
  906. struct lpfc_mbx_wq_create {
  907. struct mbox_header header;
  908. union {
  909. struct {
  910. uint32_t word0;
  911. #define lpfc_mbx_wq_create_num_pages_SHIFT 0
  912. #define lpfc_mbx_wq_create_num_pages_MASK 0x0000FFFF
  913. #define lpfc_mbx_wq_create_num_pages_WORD word0
  914. #define lpfc_mbx_wq_create_cq_id_SHIFT 16
  915. #define lpfc_mbx_wq_create_cq_id_MASK 0x0000FFFF
  916. #define lpfc_mbx_wq_create_cq_id_WORD word0
  917. struct dma_address page[LPFC_MAX_WQ_PAGE];
  918. } request;
  919. struct {
  920. uint32_t word0;
  921. #define lpfc_mbx_wq_create_q_id_SHIFT 0
  922. #define lpfc_mbx_wq_create_q_id_MASK 0x0000FFFF
  923. #define lpfc_mbx_wq_create_q_id_WORD word0
  924. } response;
  925. } u;
  926. };
  927. struct lpfc_mbx_wq_destroy {
  928. struct mbox_header header;
  929. union {
  930. struct {
  931. uint32_t word0;
  932. #define lpfc_mbx_wq_destroy_q_id_SHIFT 0
  933. #define lpfc_mbx_wq_destroy_q_id_MASK 0x0000FFFF
  934. #define lpfc_mbx_wq_destroy_q_id_WORD word0
  935. } request;
  936. struct {
  937. uint32_t word0;
  938. } response;
  939. } u;
  940. };
  941. #define LPFC_HDR_BUF_SIZE 128
  942. #define LPFC_DATA_BUF_SIZE 2048
  943. struct rq_context {
  944. uint32_t word0;
  945. #define lpfc_rq_context_rq_size_SHIFT 16
  946. #define lpfc_rq_context_rq_size_MASK 0x0000000F
  947. #define lpfc_rq_context_rq_size_WORD word0
  948. #define LPFC_RQ_RING_SIZE_512 9 /* 512 entries */
  949. #define LPFC_RQ_RING_SIZE_1024 10 /* 1024 entries */
  950. #define LPFC_RQ_RING_SIZE_2048 11 /* 2048 entries */
  951. #define LPFC_RQ_RING_SIZE_4096 12 /* 4096 entries */
  952. uint32_t reserved1;
  953. uint32_t word2;
  954. #define lpfc_rq_context_cq_id_SHIFT 16
  955. #define lpfc_rq_context_cq_id_MASK 0x000003FF
  956. #define lpfc_rq_context_cq_id_WORD word2
  957. #define lpfc_rq_context_buf_size_SHIFT 0
  958. #define lpfc_rq_context_buf_size_MASK 0x0000FFFF
  959. #define lpfc_rq_context_buf_size_WORD word2
  960. uint32_t reserved3;
  961. };
  962. struct lpfc_mbx_rq_create {
  963. struct mbox_header header;
  964. union {
  965. struct {
  966. uint32_t word0;
  967. #define lpfc_mbx_rq_create_num_pages_SHIFT 0
  968. #define lpfc_mbx_rq_create_num_pages_MASK 0x0000FFFF
  969. #define lpfc_mbx_rq_create_num_pages_WORD word0
  970. struct rq_context context;
  971. struct dma_address page[LPFC_MAX_WQ_PAGE];
  972. } request;
  973. struct {
  974. uint32_t word0;
  975. #define lpfc_mbx_rq_create_q_id_SHIFT 0
  976. #define lpfc_mbx_rq_create_q_id_MASK 0x0000FFFF
  977. #define lpfc_mbx_rq_create_q_id_WORD word0
  978. } response;
  979. } u;
  980. };
  981. struct lpfc_mbx_rq_destroy {
  982. struct mbox_header header;
  983. union {
  984. struct {
  985. uint32_t word0;
  986. #define lpfc_mbx_rq_destroy_q_id_SHIFT 0
  987. #define lpfc_mbx_rq_destroy_q_id_MASK 0x0000FFFF
  988. #define lpfc_mbx_rq_destroy_q_id_WORD word0
  989. } request;
  990. struct {
  991. uint32_t word0;
  992. } response;
  993. } u;
  994. };
  995. struct mq_context {
  996. uint32_t word0;
  997. #define lpfc_mq_context_cq_id_SHIFT 22
  998. #define lpfc_mq_context_cq_id_MASK 0x000003FF
  999. #define lpfc_mq_context_cq_id_WORD word0
  1000. #define lpfc_mq_context_count_SHIFT 16
  1001. #define lpfc_mq_context_count_MASK 0x0000000F
  1002. #define lpfc_mq_context_count_WORD word0
  1003. #define LPFC_MQ_CNT_16 0x5
  1004. #define LPFC_MQ_CNT_32 0x6
  1005. #define LPFC_MQ_CNT_64 0x7
  1006. #define LPFC_MQ_CNT_128 0x8
  1007. uint32_t word1;
  1008. #define lpfc_mq_context_valid_SHIFT 31
  1009. #define lpfc_mq_context_valid_MASK 0x00000001
  1010. #define lpfc_mq_context_valid_WORD word1
  1011. uint32_t reserved2;
  1012. uint32_t reserved3;
  1013. };
  1014. struct lpfc_mbx_mq_create {
  1015. struct mbox_header header;
  1016. union {
  1017. struct {
  1018. uint32_t word0;
  1019. #define lpfc_mbx_mq_create_num_pages_SHIFT 0
  1020. #define lpfc_mbx_mq_create_num_pages_MASK 0x0000FFFF
  1021. #define lpfc_mbx_mq_create_num_pages_WORD word0
  1022. struct mq_context context;
  1023. struct dma_address page[LPFC_MAX_MQ_PAGE];
  1024. } request;
  1025. struct {
  1026. uint32_t word0;
  1027. #define lpfc_mbx_mq_create_q_id_SHIFT 0
  1028. #define lpfc_mbx_mq_create_q_id_MASK 0x0000FFFF
  1029. #define lpfc_mbx_mq_create_q_id_WORD word0
  1030. } response;
  1031. } u;
  1032. };
  1033. struct lpfc_mbx_mq_destroy {
  1034. struct mbox_header header;
  1035. union {
  1036. struct {
  1037. uint32_t word0;
  1038. #define lpfc_mbx_mq_destroy_q_id_SHIFT 0
  1039. #define lpfc_mbx_mq_destroy_q_id_MASK 0x0000FFFF
  1040. #define lpfc_mbx_mq_destroy_q_id_WORD word0
  1041. } request;
  1042. struct {
  1043. uint32_t word0;
  1044. } response;
  1045. } u;
  1046. };
  1047. struct lpfc_mbx_post_hdr_tmpl {
  1048. struct mbox_header header;
  1049. uint32_t word10;
  1050. #define lpfc_mbx_post_hdr_tmpl_rpi_offset_SHIFT 0
  1051. #define lpfc_mbx_post_hdr_tmpl_rpi_offset_MASK 0x0000FFFF
  1052. #define lpfc_mbx_post_hdr_tmpl_rpi_offset_WORD word10
  1053. #define lpfc_mbx_post_hdr_tmpl_page_cnt_SHIFT 16
  1054. #define lpfc_mbx_post_hdr_tmpl_page_cnt_MASK 0x0000FFFF
  1055. #define lpfc_mbx_post_hdr_tmpl_page_cnt_WORD word10
  1056. uint32_t rpi_paddr_lo;
  1057. uint32_t rpi_paddr_hi;
  1058. };
  1059. struct sli4_sge { /* SLI-4 */
  1060. uint32_t addr_hi;
  1061. uint32_t addr_lo;
  1062. uint32_t word2;
  1063. #define lpfc_sli4_sge_offset_SHIFT 0 /* Offset of buffer - Not used*/
  1064. #define lpfc_sli4_sge_offset_MASK 0x00FFFFFF
  1065. #define lpfc_sli4_sge_offset_WORD word2
  1066. #define lpfc_sli4_sge_last_SHIFT 31 /* Last SEG in the SGL sets
  1067. this flag !! */
  1068. #define lpfc_sli4_sge_last_MASK 0x00000001
  1069. #define lpfc_sli4_sge_last_WORD word2
  1070. uint32_t sge_len;
  1071. };
  1072. struct fcf_record {
  1073. uint32_t max_rcv_size;
  1074. uint32_t fka_adv_period;
  1075. uint32_t fip_priority;
  1076. uint32_t word3;
  1077. #define lpfc_fcf_record_mac_0_SHIFT 0
  1078. #define lpfc_fcf_record_mac_0_MASK 0x000000FF
  1079. #define lpfc_fcf_record_mac_0_WORD word3
  1080. #define lpfc_fcf_record_mac_1_SHIFT 8
  1081. #define lpfc_fcf_record_mac_1_MASK 0x000000FF
  1082. #define lpfc_fcf_record_mac_1_WORD word3
  1083. #define lpfc_fcf_record_mac_2_SHIFT 16
  1084. #define lpfc_fcf_record_mac_2_MASK 0x000000FF
  1085. #define lpfc_fcf_record_mac_2_WORD word3
  1086. #define lpfc_fcf_record_mac_3_SHIFT 24
  1087. #define lpfc_fcf_record_mac_3_MASK 0x000000FF
  1088. #define lpfc_fcf_record_mac_3_WORD word3
  1089. uint32_t word4;
  1090. #define lpfc_fcf_record_mac_4_SHIFT 0
  1091. #define lpfc_fcf_record_mac_4_MASK 0x000000FF
  1092. #define lpfc_fcf_record_mac_4_WORD word4
  1093. #define lpfc_fcf_record_mac_5_SHIFT 8
  1094. #define lpfc_fcf_record_mac_5_MASK 0x000000FF
  1095. #define lpfc_fcf_record_mac_5_WORD word4
  1096. #define lpfc_fcf_record_fcf_avail_SHIFT 16
  1097. #define lpfc_fcf_record_fcf_avail_MASK 0x000000FF
  1098. #define lpfc_fcf_record_fcf_avail_WORD word4
  1099. #define lpfc_fcf_record_mac_addr_prov_SHIFT 24
  1100. #define lpfc_fcf_record_mac_addr_prov_MASK 0x000000FF
  1101. #define lpfc_fcf_record_mac_addr_prov_WORD word4
  1102. #define LPFC_FCF_FPMA 1 /* Fabric Provided MAC Address */
  1103. #define LPFC_FCF_SPMA 2 /* Server Provided MAC Address */
  1104. uint32_t word5;
  1105. #define lpfc_fcf_record_fab_name_0_SHIFT 0
  1106. #define lpfc_fcf_record_fab_name_0_MASK 0x000000FF
  1107. #define lpfc_fcf_record_fab_name_0_WORD word5
  1108. #define lpfc_fcf_record_fab_name_1_SHIFT 8
  1109. #define lpfc_fcf_record_fab_name_1_MASK 0x000000FF
  1110. #define lpfc_fcf_record_fab_name_1_WORD word5
  1111. #define lpfc_fcf_record_fab_name_2_SHIFT 16
  1112. #define lpfc_fcf_record_fab_name_2_MASK 0x000000FF
  1113. #define lpfc_fcf_record_fab_name_2_WORD word5
  1114. #define lpfc_fcf_record_fab_name_3_SHIFT 24
  1115. #define lpfc_fcf_record_fab_name_3_MASK 0x000000FF
  1116. #define lpfc_fcf_record_fab_name_3_WORD word5
  1117. uint32_t word6;
  1118. #define lpfc_fcf_record_fab_name_4_SHIFT 0
  1119. #define lpfc_fcf_record_fab_name_4_MASK 0x000000FF
  1120. #define lpfc_fcf_record_fab_name_4_WORD word6
  1121. #define lpfc_fcf_record_fab_name_5_SHIFT 8
  1122. #define lpfc_fcf_record_fab_name_5_MASK 0x000000FF
  1123. #define lpfc_fcf_record_fab_name_5_WORD word6
  1124. #define lpfc_fcf_record_fab_name_6_SHIFT 16
  1125. #define lpfc_fcf_record_fab_name_6_MASK 0x000000FF
  1126. #define lpfc_fcf_record_fab_name_6_WORD word6
  1127. #define lpfc_fcf_record_fab_name_7_SHIFT 24
  1128. #define lpfc_fcf_record_fab_name_7_MASK 0x000000FF
  1129. #define lpfc_fcf_record_fab_name_7_WORD word6
  1130. uint32_t word7;
  1131. #define lpfc_fcf_record_fc_map_0_SHIFT 0
  1132. #define lpfc_fcf_record_fc_map_0_MASK 0x000000FF
  1133. #define lpfc_fcf_record_fc_map_0_WORD word7
  1134. #define lpfc_fcf_record_fc_map_1_SHIFT 8
  1135. #define lpfc_fcf_record_fc_map_1_MASK 0x000000FF
  1136. #define lpfc_fcf_record_fc_map_1_WORD word7
  1137. #define lpfc_fcf_record_fc_map_2_SHIFT 16
  1138. #define lpfc_fcf_record_fc_map_2_MASK 0x000000FF
  1139. #define lpfc_fcf_record_fc_map_2_WORD word7
  1140. #define lpfc_fcf_record_fcf_valid_SHIFT 24
  1141. #define lpfc_fcf_record_fcf_valid_MASK 0x000000FF
  1142. #define lpfc_fcf_record_fcf_valid_WORD word7
  1143. uint32_t word8;
  1144. #define lpfc_fcf_record_fcf_index_SHIFT 0
  1145. #define lpfc_fcf_record_fcf_index_MASK 0x0000FFFF
  1146. #define lpfc_fcf_record_fcf_index_WORD word8
  1147. #define lpfc_fcf_record_fcf_state_SHIFT 16
  1148. #define lpfc_fcf_record_fcf_state_MASK 0x0000FFFF
  1149. #define lpfc_fcf_record_fcf_state_WORD word8
  1150. uint8_t vlan_bitmap[512];
  1151. uint32_t word137;
  1152. #define lpfc_fcf_record_switch_name_0_SHIFT 0
  1153. #define lpfc_fcf_record_switch_name_0_MASK 0x000000FF
  1154. #define lpfc_fcf_record_switch_name_0_WORD word137
  1155. #define lpfc_fcf_record_switch_name_1_SHIFT 8
  1156. #define lpfc_fcf_record_switch_name_1_MASK 0x000000FF
  1157. #define lpfc_fcf_record_switch_name_1_WORD word137
  1158. #define lpfc_fcf_record_switch_name_2_SHIFT 16
  1159. #define lpfc_fcf_record_switch_name_2_MASK 0x000000FF
  1160. #define lpfc_fcf_record_switch_name_2_WORD word137
  1161. #define lpfc_fcf_record_switch_name_3_SHIFT 24
  1162. #define lpfc_fcf_record_switch_name_3_MASK 0x000000FF
  1163. #define lpfc_fcf_record_switch_name_3_WORD word137
  1164. uint32_t word138;
  1165. #define lpfc_fcf_record_switch_name_4_SHIFT 0
  1166. #define lpfc_fcf_record_switch_name_4_MASK 0x000000FF
  1167. #define lpfc_fcf_record_switch_name_4_WORD word138
  1168. #define lpfc_fcf_record_switch_name_5_SHIFT 8
  1169. #define lpfc_fcf_record_switch_name_5_MASK 0x000000FF
  1170. #define lpfc_fcf_record_switch_name_5_WORD word138
  1171. #define lpfc_fcf_record_switch_name_6_SHIFT 16
  1172. #define lpfc_fcf_record_switch_name_6_MASK 0x000000FF
  1173. #define lpfc_fcf_record_switch_name_6_WORD word138
  1174. #define lpfc_fcf_record_switch_name_7_SHIFT 24
  1175. #define lpfc_fcf_record_switch_name_7_MASK 0x000000FF
  1176. #define lpfc_fcf_record_switch_name_7_WORD word138
  1177. };
  1178. struct lpfc_mbx_read_fcf_tbl {
  1179. union lpfc_sli4_cfg_shdr cfg_shdr;
  1180. union {
  1181. struct {
  1182. uint32_t word10;
  1183. #define lpfc_mbx_read_fcf_tbl_indx_SHIFT 0
  1184. #define lpfc_mbx_read_fcf_tbl_indx_MASK 0x0000FFFF
  1185. #define lpfc_mbx_read_fcf_tbl_indx_WORD word10
  1186. } request;
  1187. struct {
  1188. uint32_t eventag;
  1189. } response;
  1190. } u;
  1191. uint32_t word11;
  1192. #define lpfc_mbx_read_fcf_tbl_nxt_vindx_SHIFT 0
  1193. #define lpfc_mbx_read_fcf_tbl_nxt_vindx_MASK 0x0000FFFF
  1194. #define lpfc_mbx_read_fcf_tbl_nxt_vindx_WORD word11
  1195. };
  1196. struct lpfc_mbx_add_fcf_tbl_entry {
  1197. union lpfc_sli4_cfg_shdr cfg_shdr;
  1198. uint32_t word10;
  1199. #define lpfc_mbx_add_fcf_tbl_fcfi_SHIFT 0
  1200. #define lpfc_mbx_add_fcf_tbl_fcfi_MASK 0x0000FFFF
  1201. #define lpfc_mbx_add_fcf_tbl_fcfi_WORD word10
  1202. struct lpfc_mbx_sge fcf_sge;
  1203. };
  1204. struct lpfc_mbx_del_fcf_tbl_entry {
  1205. struct mbox_header header;
  1206. uint32_t word10;
  1207. #define lpfc_mbx_del_fcf_tbl_count_SHIFT 0
  1208. #define lpfc_mbx_del_fcf_tbl_count_MASK 0x0000FFFF
  1209. #define lpfc_mbx_del_fcf_tbl_count_WORD word10
  1210. #define lpfc_mbx_del_fcf_tbl_index_SHIFT 16
  1211. #define lpfc_mbx_del_fcf_tbl_index_MASK 0x0000FFFF
  1212. #define lpfc_mbx_del_fcf_tbl_index_WORD word10
  1213. };
  1214. struct lpfc_mbx_redisc_fcf_tbl {
  1215. struct mbox_header header;
  1216. uint32_t word10;
  1217. #define lpfc_mbx_redisc_fcf_count_SHIFT 0
  1218. #define lpfc_mbx_redisc_fcf_count_MASK 0x0000FFFF
  1219. #define lpfc_mbx_redisc_fcf_count_WORD word10
  1220. uint32_t resvd;
  1221. uint32_t word12;
  1222. #define lpfc_mbx_redisc_fcf_index_SHIFT 0
  1223. #define lpfc_mbx_redisc_fcf_index_MASK 0x0000FFFF
  1224. #define lpfc_mbx_redisc_fcf_index_WORD word12
  1225. };
  1226. struct lpfc_mbx_query_fw_cfg {
  1227. struct mbox_header header;
  1228. uint32_t config_number;
  1229. uint32_t asic_rev;
  1230. uint32_t phys_port;
  1231. uint32_t function_mode;
  1232. /* firmware Function Mode */
  1233. #define lpfc_function_mode_toe_SHIFT 0
  1234. #define lpfc_function_mode_toe_MASK 0x00000001
  1235. #define lpfc_function_mode_toe_WORD function_mode
  1236. #define lpfc_function_mode_nic_SHIFT 1
  1237. #define lpfc_function_mode_nic_MASK 0x00000001
  1238. #define lpfc_function_mode_nic_WORD function_mode
  1239. #define lpfc_function_mode_rdma_SHIFT 2
  1240. #define lpfc_function_mode_rdma_MASK 0x00000001
  1241. #define lpfc_function_mode_rdma_WORD function_mode
  1242. #define lpfc_function_mode_vm_SHIFT 3
  1243. #define lpfc_function_mode_vm_MASK 0x00000001
  1244. #define lpfc_function_mode_vm_WORD function_mode
  1245. #define lpfc_function_mode_iscsi_i_SHIFT 4
  1246. #define lpfc_function_mode_iscsi_i_MASK 0x00000001
  1247. #define lpfc_function_mode_iscsi_i_WORD function_mode
  1248. #define lpfc_function_mode_iscsi_t_SHIFT 5
  1249. #define lpfc_function_mode_iscsi_t_MASK 0x00000001
  1250. #define lpfc_function_mode_iscsi_t_WORD function_mode
  1251. #define lpfc_function_mode_fcoe_i_SHIFT 6
  1252. #define lpfc_function_mode_fcoe_i_MASK 0x00000001
  1253. #define lpfc_function_mode_fcoe_i_WORD function_mode
  1254. #define lpfc_function_mode_fcoe_t_SHIFT 7
  1255. #define lpfc_function_mode_fcoe_t_MASK 0x00000001
  1256. #define lpfc_function_mode_fcoe_t_WORD function_mode
  1257. #define lpfc_function_mode_dal_SHIFT 8
  1258. #define lpfc_function_mode_dal_MASK 0x00000001
  1259. #define lpfc_function_mode_dal_WORD function_mode
  1260. #define lpfc_function_mode_lro_SHIFT 9
  1261. #define lpfc_function_mode_lro_MASK 0x00000001
  1262. #define lpfc_function_mode_lro_WORD function_mode9
  1263. #define lpfc_function_mode_flex10_SHIFT 10
  1264. #define lpfc_function_mode_flex10_MASK 0x00000001
  1265. #define lpfc_function_mode_flex10_WORD function_mode
  1266. #define lpfc_function_mode_ncsi_SHIFT 11
  1267. #define lpfc_function_mode_ncsi_MASK 0x00000001
  1268. #define lpfc_function_mode_ncsi_WORD function_mode
  1269. };
  1270. /* Status field for embedded SLI_CONFIG mailbox command */
  1271. #define STATUS_SUCCESS 0x0
  1272. #define STATUS_FAILED 0x1
  1273. #define STATUS_ILLEGAL_REQUEST 0x2
  1274. #define STATUS_ILLEGAL_FIELD 0x3
  1275. #define STATUS_INSUFFICIENT_BUFFER 0x4
  1276. #define STATUS_UNAUTHORIZED_REQUEST 0x5
  1277. #define STATUS_FLASHROM_SAVE_FAILED 0x17
  1278. #define STATUS_FLASHROM_RESTORE_FAILED 0x18
  1279. #define STATUS_ICCBINDEX_ALLOC_FAILED 0x1a
  1280. #define STATUS_IOCTLHANDLE_ALLOC_FAILED 0x1b
  1281. #define STATUS_INVALID_PHY_ADDR_FROM_OSM 0x1c
  1282. #define STATUS_INVALID_PHY_ADDR_LEN_FROM_OSM 0x1d
  1283. #define STATUS_ASSERT_FAILED 0x1e
  1284. #define STATUS_INVALID_SESSION 0x1f
  1285. #define STATUS_INVALID_CONNECTION 0x20
  1286. #define STATUS_BTL_PATH_EXCEEDS_OSM_LIMIT 0x21
  1287. #define STATUS_BTL_NO_FREE_SLOT_PATH 0x24
  1288. #define STATUS_BTL_NO_FREE_SLOT_TGTID 0x25
  1289. #define STATUS_OSM_DEVSLOT_NOT_FOUND 0x26
  1290. #define STATUS_FLASHROM_READ_FAILED 0x27
  1291. #define STATUS_POLL_IOCTL_TIMEOUT 0x28
  1292. #define STATUS_ERROR_ACITMAIN 0x2a
  1293. #define STATUS_REBOOT_REQUIRED 0x2c
  1294. #define STATUS_FCF_IN_USE 0x3a
  1295. #define STATUS_FCF_TABLE_EMPTY 0x43
  1296. struct lpfc_mbx_sli4_config {
  1297. struct mbox_header header;
  1298. };
  1299. struct lpfc_mbx_init_vfi {
  1300. uint32_t word1;
  1301. #define lpfc_init_vfi_vr_SHIFT 31
  1302. #define lpfc_init_vfi_vr_MASK 0x00000001
  1303. #define lpfc_init_vfi_vr_WORD word1
  1304. #define lpfc_init_vfi_vt_SHIFT 30
  1305. #define lpfc_init_vfi_vt_MASK 0x00000001
  1306. #define lpfc_init_vfi_vt_WORD word1
  1307. #define lpfc_init_vfi_vf_SHIFT 29
  1308. #define lpfc_init_vfi_vf_MASK 0x00000001
  1309. #define lpfc_init_vfi_vf_WORD word1
  1310. #define lpfc_init_vfi_vfi_SHIFT 0
  1311. #define lpfc_init_vfi_vfi_MASK 0x0000FFFF
  1312. #define lpfc_init_vfi_vfi_WORD word1
  1313. uint32_t word2;
  1314. #define lpfc_init_vfi_fcfi_SHIFT 0
  1315. #define lpfc_init_vfi_fcfi_MASK 0x0000FFFF
  1316. #define lpfc_init_vfi_fcfi_WORD word2
  1317. uint32_t word3;
  1318. #define lpfc_init_vfi_pri_SHIFT 13
  1319. #define lpfc_init_vfi_pri_MASK 0x00000007
  1320. #define lpfc_init_vfi_pri_WORD word3
  1321. #define lpfc_init_vfi_vf_id_SHIFT 1
  1322. #define lpfc_init_vfi_vf_id_MASK 0x00000FFF
  1323. #define lpfc_init_vfi_vf_id_WORD word3
  1324. uint32_t word4;
  1325. #define lpfc_init_vfi_hop_count_SHIFT 24
  1326. #define lpfc_init_vfi_hop_count_MASK 0x000000FF
  1327. #define lpfc_init_vfi_hop_count_WORD word4
  1328. };
  1329. struct lpfc_mbx_reg_vfi {
  1330. uint32_t word1;
  1331. #define lpfc_reg_vfi_vp_SHIFT 28
  1332. #define lpfc_reg_vfi_vp_MASK 0x00000001
  1333. #define lpfc_reg_vfi_vp_WORD word1
  1334. #define lpfc_reg_vfi_vfi_SHIFT 0
  1335. #define lpfc_reg_vfi_vfi_MASK 0x0000FFFF
  1336. #define lpfc_reg_vfi_vfi_WORD word1
  1337. uint32_t word2;
  1338. #define lpfc_reg_vfi_vpi_SHIFT 16
  1339. #define lpfc_reg_vfi_vpi_MASK 0x0000FFFF
  1340. #define lpfc_reg_vfi_vpi_WORD word2
  1341. #define lpfc_reg_vfi_fcfi_SHIFT 0
  1342. #define lpfc_reg_vfi_fcfi_MASK 0x0000FFFF
  1343. #define lpfc_reg_vfi_fcfi_WORD word2
  1344. uint32_t wwn[2];
  1345. struct ulp_bde64 bde;
  1346. uint32_t word8_rsvd;
  1347. uint32_t word9_rsvd;
  1348. uint32_t word10;
  1349. #define lpfc_reg_vfi_nport_id_SHIFT 0
  1350. #define lpfc_reg_vfi_nport_id_MASK 0x00FFFFFF
  1351. #define lpfc_reg_vfi_nport_id_WORD word10
  1352. };
  1353. struct lpfc_mbx_init_vpi {
  1354. uint32_t word1;
  1355. #define lpfc_init_vpi_vfi_SHIFT 16
  1356. #define lpfc_init_vpi_vfi_MASK 0x0000FFFF
  1357. #define lpfc_init_vpi_vfi_WORD word1
  1358. #define lpfc_init_vpi_vpi_SHIFT 0
  1359. #define lpfc_init_vpi_vpi_MASK 0x0000FFFF
  1360. #define lpfc_init_vpi_vpi_WORD word1
  1361. };
  1362. struct lpfc_mbx_read_vpi {
  1363. uint32_t word1_rsvd;
  1364. uint32_t word2;
  1365. #define lpfc_mbx_read_vpi_vnportid_SHIFT 0
  1366. #define lpfc_mbx_read_vpi_vnportid_MASK 0x00FFFFFF
  1367. #define lpfc_mbx_read_vpi_vnportid_WORD word2
  1368. uint32_t word3_rsvd;
  1369. uint32_t word4;
  1370. #define lpfc_mbx_read_vpi_acq_alpa_SHIFT 0
  1371. #define lpfc_mbx_read_vpi_acq_alpa_MASK 0x000000FF
  1372. #define lpfc_mbx_read_vpi_acq_alpa_WORD word4
  1373. #define lpfc_mbx_read_vpi_pb_SHIFT 15
  1374. #define lpfc_mbx_read_vpi_pb_MASK 0x00000001
  1375. #define lpfc_mbx_read_vpi_pb_WORD word4
  1376. #define lpfc_mbx_read_vpi_spec_alpa_SHIFT 16
  1377. #define lpfc_mbx_read_vpi_spec_alpa_MASK 0x000000FF
  1378. #define lpfc_mbx_read_vpi_spec_alpa_WORD word4
  1379. #define lpfc_mbx_read_vpi_ns_SHIFT 30
  1380. #define lpfc_mbx_read_vpi_ns_MASK 0x00000001
  1381. #define lpfc_mbx_read_vpi_ns_WORD word4
  1382. #define lpfc_mbx_read_vpi_hl_SHIFT 31
  1383. #define lpfc_mbx_read_vpi_hl_MASK 0x00000001
  1384. #define lpfc_mbx_read_vpi_hl_WORD word4
  1385. uint32_t word5_rsvd;
  1386. uint32_t word6;
  1387. #define lpfc_mbx_read_vpi_vpi_SHIFT 0
  1388. #define lpfc_mbx_read_vpi_vpi_MASK 0x0000FFFF
  1389. #define lpfc_mbx_read_vpi_vpi_WORD word6
  1390. uint32_t word7;
  1391. #define lpfc_mbx_read_vpi_mac_0_SHIFT 0
  1392. #define lpfc_mbx_read_vpi_mac_0_MASK 0x000000FF
  1393. #define lpfc_mbx_read_vpi_mac_0_WORD word7
  1394. #define lpfc_mbx_read_vpi_mac_1_SHIFT 8
  1395. #define lpfc_mbx_read_vpi_mac_1_MASK 0x000000FF
  1396. #define lpfc_mbx_read_vpi_mac_1_WORD word7
  1397. #define lpfc_mbx_read_vpi_mac_2_SHIFT 16
  1398. #define lpfc_mbx_read_vpi_mac_2_MASK 0x000000FF
  1399. #define lpfc_mbx_read_vpi_mac_2_WORD word7
  1400. #define lpfc_mbx_read_vpi_mac_3_SHIFT 24
  1401. #define lpfc_mbx_read_vpi_mac_3_MASK 0x000000FF
  1402. #define lpfc_mbx_read_vpi_mac_3_WORD word7
  1403. uint32_t word8;
  1404. #define lpfc_mbx_read_vpi_mac_4_SHIFT 0
  1405. #define lpfc_mbx_read_vpi_mac_4_MASK 0x000000FF
  1406. #define lpfc_mbx_read_vpi_mac_4_WORD word8
  1407. #define lpfc_mbx_read_vpi_mac_5_SHIFT 8
  1408. #define lpfc_mbx_read_vpi_mac_5_MASK 0x000000FF
  1409. #define lpfc_mbx_read_vpi_mac_5_WORD word8
  1410. #define lpfc_mbx_read_vpi_vlan_tag_SHIFT 16
  1411. #define lpfc_mbx_read_vpi_vlan_tag_MASK 0x00000FFF
  1412. #define lpfc_mbx_read_vpi_vlan_tag_WORD word8
  1413. #define lpfc_mbx_read_vpi_vv_SHIFT 28
  1414. #define lpfc_mbx_read_vpi_vv_MASK 0x0000001
  1415. #define lpfc_mbx_read_vpi_vv_WORD word8
  1416. };
  1417. struct lpfc_mbx_unreg_vfi {
  1418. uint32_t word1_rsvd;
  1419. uint32_t word2;
  1420. #define lpfc_unreg_vfi_vfi_SHIFT 0
  1421. #define lpfc_unreg_vfi_vfi_MASK 0x0000FFFF
  1422. #define lpfc_unreg_vfi_vfi_WORD word2
  1423. };
  1424. struct lpfc_mbx_resume_rpi {
  1425. uint32_t word1;
  1426. #define lpfc_resume_rpi_index_SHIFT 0
  1427. #define lpfc_resume_rpi_index_MASK 0x0000FFFF
  1428. #define lpfc_resume_rpi_index_WORD word1
  1429. #define lpfc_resume_rpi_ii_SHIFT 30
  1430. #define lpfc_resume_rpi_ii_MASK 0x00000003
  1431. #define lpfc_resume_rpi_ii_WORD word1
  1432. #define RESUME_INDEX_RPI 0
  1433. #define RESUME_INDEX_VPI 1
  1434. #define RESUME_INDEX_VFI 2
  1435. #define RESUME_INDEX_FCFI 3
  1436. uint32_t event_tag;
  1437. };
  1438. #define REG_FCF_INVALID_QID 0xFFFF
  1439. struct lpfc_mbx_reg_fcfi {
  1440. uint32_t word1;
  1441. #define lpfc_reg_fcfi_info_index_SHIFT 0
  1442. #define lpfc_reg_fcfi_info_index_MASK 0x0000FFFF
  1443. #define lpfc_reg_fcfi_info_index_WORD word1
  1444. #define lpfc_reg_fcfi_fcfi_SHIFT 16
  1445. #define lpfc_reg_fcfi_fcfi_MASK 0x0000FFFF
  1446. #define lpfc_reg_fcfi_fcfi_WORD word1
  1447. uint32_t word2;
  1448. #define lpfc_reg_fcfi_rq_id1_SHIFT 0
  1449. #define lpfc_reg_fcfi_rq_id1_MASK 0x0000FFFF
  1450. #define lpfc_reg_fcfi_rq_id1_WORD word2
  1451. #define lpfc_reg_fcfi_rq_id0_SHIFT 16
  1452. #define lpfc_reg_fcfi_rq_id0_MASK 0x0000FFFF
  1453. #define lpfc_reg_fcfi_rq_id0_WORD word2
  1454. uint32_t word3;
  1455. #define lpfc_reg_fcfi_rq_id3_SHIFT 0
  1456. #define lpfc_reg_fcfi_rq_id3_MASK 0x0000FFFF
  1457. #define lpfc_reg_fcfi_rq_id3_WORD word3
  1458. #define lpfc_reg_fcfi_rq_id2_SHIFT 16
  1459. #define lpfc_reg_fcfi_rq_id2_MASK 0x0000FFFF
  1460. #define lpfc_reg_fcfi_rq_id2_WORD word3
  1461. uint32_t word4;
  1462. #define lpfc_reg_fcfi_type_match0_SHIFT 24
  1463. #define lpfc_reg_fcfi_type_match0_MASK 0x000000FF
  1464. #define lpfc_reg_fcfi_type_match0_WORD word4
  1465. #define lpfc_reg_fcfi_type_mask0_SHIFT 16
  1466. #define lpfc_reg_fcfi_type_mask0_MASK 0x000000FF
  1467. #define lpfc_reg_fcfi_type_mask0_WORD word4
  1468. #define lpfc_reg_fcfi_rctl_match0_SHIFT 8
  1469. #define lpfc_reg_fcfi_rctl_match0_MASK 0x000000FF
  1470. #define lpfc_reg_fcfi_rctl_match0_WORD word4
  1471. #define lpfc_reg_fcfi_rctl_mask0_SHIFT 0
  1472. #define lpfc_reg_fcfi_rctl_mask0_MASK 0x000000FF
  1473. #define lpfc_reg_fcfi_rctl_mask0_WORD word4
  1474. uint32_t word5;
  1475. #define lpfc_reg_fcfi_type_match1_SHIFT 24
  1476. #define lpfc_reg_fcfi_type_match1_MASK 0x000000FF
  1477. #define lpfc_reg_fcfi_type_match1_WORD word5
  1478. #define lpfc_reg_fcfi_type_mask1_SHIFT 16
  1479. #define lpfc_reg_fcfi_type_mask1_MASK 0x000000FF
  1480. #define lpfc_reg_fcfi_type_mask1_WORD word5
  1481. #define lpfc_reg_fcfi_rctl_match1_SHIFT 8
  1482. #define lpfc_reg_fcfi_rctl_match1_MASK 0x000000FF
  1483. #define lpfc_reg_fcfi_rctl_match1_WORD word5
  1484. #define lpfc_reg_fcfi_rctl_mask1_SHIFT 0
  1485. #define lpfc_reg_fcfi_rctl_mask1_MASK 0x000000FF
  1486. #define lpfc_reg_fcfi_rctl_mask1_WORD word5
  1487. uint32_t word6;
  1488. #define lpfc_reg_fcfi_type_match2_SHIFT 24
  1489. #define lpfc_reg_fcfi_type_match2_MASK 0x000000FF
  1490. #define lpfc_reg_fcfi_type_match2_WORD word6
  1491. #define lpfc_reg_fcfi_type_mask2_SHIFT 16
  1492. #define lpfc_reg_fcfi_type_mask2_MASK 0x000000FF
  1493. #define lpfc_reg_fcfi_type_mask2_WORD word6
  1494. #define lpfc_reg_fcfi_rctl_match2_SHIFT 8
  1495. #define lpfc_reg_fcfi_rctl_match2_MASK 0x000000FF
  1496. #define lpfc_reg_fcfi_rctl_match2_WORD word6
  1497. #define lpfc_reg_fcfi_rctl_mask2_SHIFT 0
  1498. #define lpfc_reg_fcfi_rctl_mask2_MASK 0x000000FF
  1499. #define lpfc_reg_fcfi_rctl_mask2_WORD word6
  1500. uint32_t word7;
  1501. #define lpfc_reg_fcfi_type_match3_SHIFT 24
  1502. #define lpfc_reg_fcfi_type_match3_MASK 0x000000FF
  1503. #define lpfc_reg_fcfi_type_match3_WORD word7
  1504. #define lpfc_reg_fcfi_type_mask3_SHIFT 16
  1505. #define lpfc_reg_fcfi_type_mask3_MASK 0x000000FF
  1506. #define lpfc_reg_fcfi_type_mask3_WORD word7
  1507. #define lpfc_reg_fcfi_rctl_match3_SHIFT 8
  1508. #define lpfc_reg_fcfi_rctl_match3_MASK 0x000000FF
  1509. #define lpfc_reg_fcfi_rctl_match3_WORD word7
  1510. #define lpfc_reg_fcfi_rctl_mask3_SHIFT 0
  1511. #define lpfc_reg_fcfi_rctl_mask3_MASK 0x000000FF
  1512. #define lpfc_reg_fcfi_rctl_mask3_WORD word7
  1513. uint32_t word8;
  1514. #define lpfc_reg_fcfi_mam_SHIFT 13
  1515. #define lpfc_reg_fcfi_mam_MASK 0x00000003
  1516. #define lpfc_reg_fcfi_mam_WORD word8
  1517. #define LPFC_MAM_BOTH 0 /* Both SPMA and FPMA */
  1518. #define LPFC_MAM_SPMA 1 /* Server Provided MAC Address */
  1519. #define LPFC_MAM_FPMA 2 /* Fabric Provided MAC Address */
  1520. #define lpfc_reg_fcfi_vv_SHIFT 12
  1521. #define lpfc_reg_fcfi_vv_MASK 0x00000001
  1522. #define lpfc_reg_fcfi_vv_WORD word8
  1523. #define lpfc_reg_fcfi_vlan_tag_SHIFT 0
  1524. #define lpfc_reg_fcfi_vlan_tag_MASK 0x00000FFF
  1525. #define lpfc_reg_fcfi_vlan_tag_WORD word8
  1526. };
  1527. struct lpfc_mbx_unreg_fcfi {
  1528. uint32_t word1_rsv;
  1529. uint32_t word2;
  1530. #define lpfc_unreg_fcfi_SHIFT 0
  1531. #define lpfc_unreg_fcfi_MASK 0x0000FFFF
  1532. #define lpfc_unreg_fcfi_WORD word2
  1533. };
  1534. struct lpfc_mbx_read_rev {
  1535. uint32_t word1;
  1536. #define lpfc_mbx_rd_rev_sli_lvl_SHIFT 16
  1537. #define lpfc_mbx_rd_rev_sli_lvl_MASK 0x0000000F
  1538. #define lpfc_mbx_rd_rev_sli_lvl_WORD word1
  1539. #define lpfc_mbx_rd_rev_fcoe_SHIFT 20
  1540. #define lpfc_mbx_rd_rev_fcoe_MASK 0x00000001
  1541. #define lpfc_mbx_rd_rev_fcoe_WORD word1
  1542. #define lpfc_mbx_rd_rev_cee_ver_SHIFT 21
  1543. #define lpfc_mbx_rd_rev_cee_ver_MASK 0x00000003
  1544. #define lpfc_mbx_rd_rev_cee_ver_WORD word1
  1545. #define LPFC_PREDCBX_CEE_MODE 0
  1546. #define LPFC_DCBX_CEE_MODE 1
  1547. #define lpfc_mbx_rd_rev_vpd_SHIFT 29
  1548. #define lpfc_mbx_rd_rev_vpd_MASK 0x00000001
  1549. #define lpfc_mbx_rd_rev_vpd_WORD word1
  1550. uint32_t first_hw_rev;
  1551. uint32_t second_hw_rev;
  1552. uint32_t word4_rsvd;
  1553. uint32_t third_hw_rev;
  1554. uint32_t word6;
  1555. #define lpfc_mbx_rd_rev_fcph_low_SHIFT 0
  1556. #define lpfc_mbx_rd_rev_fcph_low_MASK 0x000000FF
  1557. #define lpfc_mbx_rd_rev_fcph_low_WORD word6
  1558. #define lpfc_mbx_rd_rev_fcph_high_SHIFT 8
  1559. #define lpfc_mbx_rd_rev_fcph_high_MASK 0x000000FF
  1560. #define lpfc_mbx_rd_rev_fcph_high_WORD word6
  1561. #define lpfc_mbx_rd_rev_ftr_lvl_low_SHIFT 16
  1562. #define lpfc_mbx_rd_rev_ftr_lvl_low_MASK 0x000000FF
  1563. #define lpfc_mbx_rd_rev_ftr_lvl_low_WORD word6
  1564. #define lpfc_mbx_rd_rev_ftr_lvl_high_SHIFT 24
  1565. #define lpfc_mbx_rd_rev_ftr_lvl_high_MASK 0x000000FF
  1566. #define lpfc_mbx_rd_rev_ftr_lvl_high_WORD word6
  1567. uint32_t word7_rsvd;
  1568. uint32_t fw_id_rev;
  1569. uint8_t fw_name[16];
  1570. uint32_t ulp_fw_id_rev;
  1571. uint8_t ulp_fw_name[16];
  1572. uint32_t word18_47_rsvd[30];
  1573. uint32_t word48;
  1574. #define lpfc_mbx_rd_rev_avail_len_SHIFT 0
  1575. #define lpfc_mbx_rd_rev_avail_len_MASK 0x00FFFFFF
  1576. #define lpfc_mbx_rd_rev_avail_len_WORD word48
  1577. uint32_t vpd_paddr_low;
  1578. uint32_t vpd_paddr_high;
  1579. uint32_t avail_vpd_len;
  1580. uint32_t rsvd_52_63[12];
  1581. };
  1582. struct lpfc_mbx_read_config {
  1583. uint32_t word1;
  1584. #define lpfc_mbx_rd_conf_max_bbc_SHIFT 0
  1585. #define lpfc_mbx_rd_conf_max_bbc_MASK 0x000000FF
  1586. #define lpfc_mbx_rd_conf_max_bbc_WORD word1
  1587. #define lpfc_mbx_rd_conf_init_bbc_SHIFT 8
  1588. #define lpfc_mbx_rd_conf_init_bbc_MASK 0x000000FF
  1589. #define lpfc_mbx_rd_conf_init_bbc_WORD word1
  1590. uint32_t word2;
  1591. #define lpfc_mbx_rd_conf_nport_did_SHIFT 0
  1592. #define lpfc_mbx_rd_conf_nport_did_MASK 0x00FFFFFF
  1593. #define lpfc_mbx_rd_conf_nport_did_WORD word2
  1594. #define lpfc_mbx_rd_conf_topology_SHIFT 24
  1595. #define lpfc_mbx_rd_conf_topology_MASK 0x000000FF
  1596. #define lpfc_mbx_rd_conf_topology_WORD word2
  1597. uint32_t word3;
  1598. #define lpfc_mbx_rd_conf_ao_SHIFT 0
  1599. #define lpfc_mbx_rd_conf_ao_MASK 0x00000001
  1600. #define lpfc_mbx_rd_conf_ao_WORD word3
  1601. #define lpfc_mbx_rd_conf_bb_scn_SHIFT 8
  1602. #define lpfc_mbx_rd_conf_bb_scn_MASK 0x0000000F
  1603. #define lpfc_mbx_rd_conf_bb_scn_WORD word3
  1604. #define lpfc_mbx_rd_conf_cbb_scn_SHIFT 12
  1605. #define lpfc_mbx_rd_conf_cbb_scn_MASK 0x0000000F
  1606. #define lpfc_mbx_rd_conf_cbb_scn_WORD word3
  1607. #define lpfc_mbx_rd_conf_mc_SHIFT 29
  1608. #define lpfc_mbx_rd_conf_mc_MASK 0x00000001
  1609. #define lpfc_mbx_rd_conf_mc_WORD word3
  1610. uint32_t word4;
  1611. #define lpfc_mbx_rd_conf_e_d_tov_SHIFT 0
  1612. #define lpfc_mbx_rd_conf_e_d_tov_MASK 0x0000FFFF
  1613. #define lpfc_mbx_rd_conf_e_d_tov_WORD word4
  1614. uint32_t word5;
  1615. #define lpfc_mbx_rd_conf_lp_tov_SHIFT 0
  1616. #define lpfc_mbx_rd_conf_lp_tov_MASK 0x0000FFFF
  1617. #define lpfc_mbx_rd_conf_lp_tov_WORD word5
  1618. uint32_t word6;
  1619. #define lpfc_mbx_rd_conf_r_a_tov_SHIFT 0
  1620. #define lpfc_mbx_rd_conf_r_a_tov_MASK 0x0000FFFF
  1621. #define lpfc_mbx_rd_conf_r_a_tov_WORD word6
  1622. uint32_t word7;
  1623. #define lpfc_mbx_rd_conf_r_t_tov_SHIFT 0
  1624. #define lpfc_mbx_rd_conf_r_t_tov_MASK 0x000000FF
  1625. #define lpfc_mbx_rd_conf_r_t_tov_WORD word7
  1626. uint32_t word8;
  1627. #define lpfc_mbx_rd_conf_al_tov_SHIFT 0
  1628. #define lpfc_mbx_rd_conf_al_tov_MASK 0x0000000F
  1629. #define lpfc_mbx_rd_conf_al_tov_WORD word8
  1630. uint32_t word9;
  1631. #define lpfc_mbx_rd_conf_lmt_SHIFT 0
  1632. #define lpfc_mbx_rd_conf_lmt_MASK 0x0000FFFF
  1633. #define lpfc_mbx_rd_conf_lmt_WORD word9
  1634. uint32_t word10;
  1635. #define lpfc_mbx_rd_conf_max_alpa_SHIFT 0
  1636. #define lpfc_mbx_rd_conf_max_alpa_MASK 0x000000FF
  1637. #define lpfc_mbx_rd_conf_max_alpa_WORD word10
  1638. uint32_t word11_rsvd;
  1639. uint32_t word12;
  1640. #define lpfc_mbx_rd_conf_xri_base_SHIFT 0
  1641. #define lpfc_mbx_rd_conf_xri_base_MASK 0x0000FFFF
  1642. #define lpfc_mbx_rd_conf_xri_base_WORD word12
  1643. #define lpfc_mbx_rd_conf_xri_count_SHIFT 16
  1644. #define lpfc_mbx_rd_conf_xri_count_MASK 0x0000FFFF
  1645. #define lpfc_mbx_rd_conf_xri_count_WORD word12
  1646. uint32_t word13;
  1647. #define lpfc_mbx_rd_conf_rpi_base_SHIFT 0
  1648. #define lpfc_mbx_rd_conf_rpi_base_MASK 0x0000FFFF
  1649. #define lpfc_mbx_rd_conf_rpi_base_WORD word13
  1650. #define lpfc_mbx_rd_conf_rpi_count_SHIFT 16
  1651. #define lpfc_mbx_rd_conf_rpi_count_MASK 0x0000FFFF
  1652. #define lpfc_mbx_rd_conf_rpi_count_WORD word13
  1653. uint32_t word14;
  1654. #define lpfc_mbx_rd_conf_vpi_base_SHIFT 0
  1655. #define lpfc_mbx_rd_conf_vpi_base_MASK 0x0000FFFF
  1656. #define lpfc_mbx_rd_conf_vpi_base_WORD word14
  1657. #define lpfc_mbx_rd_conf_vpi_count_SHIFT 16
  1658. #define lpfc_mbx_rd_conf_vpi_count_MASK 0x0000FFFF
  1659. #define lpfc_mbx_rd_conf_vpi_count_WORD word14
  1660. uint32_t word15;
  1661. #define lpfc_mbx_rd_conf_vfi_base_SHIFT 0
  1662. #define lpfc_mbx_rd_conf_vfi_base_MASK 0x0000FFFF
  1663. #define lpfc_mbx_rd_conf_vfi_base_WORD word15
  1664. #define lpfc_mbx_rd_conf_vfi_count_SHIFT 16
  1665. #define lpfc_mbx_rd_conf_vfi_count_MASK 0x0000FFFF
  1666. #define lpfc_mbx_rd_conf_vfi_count_WORD word15
  1667. uint32_t word16;
  1668. #define lpfc_mbx_rd_conf_fcfi_base_SHIFT 0
  1669. #define lpfc_mbx_rd_conf_fcfi_base_MASK 0x0000FFFF
  1670. #define lpfc_mbx_rd_conf_fcfi_base_WORD word16
  1671. #define lpfc_mbx_rd_conf_fcfi_count_SHIFT 16
  1672. #define lpfc_mbx_rd_conf_fcfi_count_MASK 0x0000FFFF
  1673. #define lpfc_mbx_rd_conf_fcfi_count_WORD word16
  1674. uint32_t word17;
  1675. #define lpfc_mbx_rd_conf_rq_count_SHIFT 0
  1676. #define lpfc_mbx_rd_conf_rq_count_MASK 0x0000FFFF
  1677. #define lpfc_mbx_rd_conf_rq_count_WORD word17
  1678. #define lpfc_mbx_rd_conf_eq_count_SHIFT 16
  1679. #define lpfc_mbx_rd_conf_eq_count_MASK 0x0000FFFF
  1680. #define lpfc_mbx_rd_conf_eq_count_WORD word17
  1681. uint32_t word18;
  1682. #define lpfc_mbx_rd_conf_wq_count_SHIFT 0
  1683. #define lpfc_mbx_rd_conf_wq_count_MASK 0x0000FFFF
  1684. #define lpfc_mbx_rd_conf_wq_count_WORD word18
  1685. #define lpfc_mbx_rd_conf_cq_count_SHIFT 16
  1686. #define lpfc_mbx_rd_conf_cq_count_MASK 0x0000FFFF
  1687. #define lpfc_mbx_rd_conf_cq_count_WORD word18
  1688. };
  1689. struct lpfc_mbx_request_features {
  1690. uint32_t word1;
  1691. #define lpfc_mbx_rq_ftr_qry_SHIFT 0
  1692. #define lpfc_mbx_rq_ftr_qry_MASK 0x00000001
  1693. #define lpfc_mbx_rq_ftr_qry_WORD word1
  1694. uint32_t word2;
  1695. #define lpfc_mbx_rq_ftr_rq_iaab_SHIFT 0
  1696. #define lpfc_mbx_rq_ftr_rq_iaab_MASK 0x00000001
  1697. #define lpfc_mbx_rq_ftr_rq_iaab_WORD word2
  1698. #define lpfc_mbx_rq_ftr_rq_npiv_SHIFT 1
  1699. #define lpfc_mbx_rq_ftr_rq_npiv_MASK 0x00000001
  1700. #define lpfc_mbx_rq_ftr_rq_npiv_WORD word2
  1701. #define lpfc_mbx_rq_ftr_rq_dif_SHIFT 2
  1702. #define lpfc_mbx_rq_ftr_rq_dif_MASK 0x00000001
  1703. #define lpfc_mbx_rq_ftr_rq_dif_WORD word2
  1704. #define lpfc_mbx_rq_ftr_rq_vf_SHIFT 3
  1705. #define lpfc_mbx_rq_ftr_rq_vf_MASK 0x00000001
  1706. #define lpfc_mbx_rq_ftr_rq_vf_WORD word2
  1707. #define lpfc_mbx_rq_ftr_rq_fcpi_SHIFT 4
  1708. #define lpfc_mbx_rq_ftr_rq_fcpi_MASK 0x00000001
  1709. #define lpfc_mbx_rq_ftr_rq_fcpi_WORD word2
  1710. #define lpfc_mbx_rq_ftr_rq_fcpt_SHIFT 5
  1711. #define lpfc_mbx_rq_ftr_rq_fcpt_MASK 0x00000001
  1712. #define lpfc_mbx_rq_ftr_rq_fcpt_WORD word2
  1713. #define lpfc_mbx_rq_ftr_rq_fcpc_SHIFT 6
  1714. #define lpfc_mbx_rq_ftr_rq_fcpc_MASK 0x00000001
  1715. #define lpfc_mbx_rq_ftr_rq_fcpc_WORD word2
  1716. #define lpfc_mbx_rq_ftr_rq_ifip_SHIFT 7
  1717. #define lpfc_mbx_rq_ftr_rq_ifip_MASK 0x00000001
  1718. #define lpfc_mbx_rq_ftr_rq_ifip_WORD word2
  1719. uint32_t word3;
  1720. #define lpfc_mbx_rq_ftr_rsp_iaab_SHIFT 0
  1721. #define lpfc_mbx_rq_ftr_rsp_iaab_MASK 0x00000001
  1722. #define lpfc_mbx_rq_ftr_rsp_iaab_WORD word3
  1723. #define lpfc_mbx_rq_ftr_rsp_npiv_SHIFT 1
  1724. #define lpfc_mbx_rq_ftr_rsp_npiv_MASK 0x00000001
  1725. #define lpfc_mbx_rq_ftr_rsp_npiv_WORD word3
  1726. #define lpfc_mbx_rq_ftr_rsp_dif_SHIFT 2
  1727. #define lpfc_mbx_rq_ftr_rsp_dif_MASK 0x00000001
  1728. #define lpfc_mbx_rq_ftr_rsp_dif_WORD word3
  1729. #define lpfc_mbx_rq_ftr_rsp_vf_SHIFT 3
  1730. #define lpfc_mbx_rq_ftr_rsp_vf__MASK 0x00000001
  1731. #define lpfc_mbx_rq_ftr_rsp_vf_WORD word3
  1732. #define lpfc_mbx_rq_ftr_rsp_fcpi_SHIFT 4
  1733. #define lpfc_mbx_rq_ftr_rsp_fcpi_MASK 0x00000001
  1734. #define lpfc_mbx_rq_ftr_rsp_fcpi_WORD word3
  1735. #define lpfc_mbx_rq_ftr_rsp_fcpt_SHIFT 5
  1736. #define lpfc_mbx_rq_ftr_rsp_fcpt_MASK 0x00000001
  1737. #define lpfc_mbx_rq_ftr_rsp_fcpt_WORD word3
  1738. #define lpfc_mbx_rq_ftr_rsp_fcpc_SHIFT 6
  1739. #define lpfc_mbx_rq_ftr_rsp_fcpc_MASK 0x00000001
  1740. #define lpfc_mbx_rq_ftr_rsp_fcpc_WORD word3
  1741. #define lpfc_mbx_rq_ftr_rsp_ifip_SHIFT 7
  1742. #define lpfc_mbx_rq_ftr_rsp_ifip_MASK 0x00000001
  1743. #define lpfc_mbx_rq_ftr_rsp_ifip_WORD word3
  1744. };
  1745. struct lpfc_mbx_supp_pages {
  1746. uint32_t word1;
  1747. #define qs_SHIFT 0
  1748. #define qs_MASK 0x00000001
  1749. #define qs_WORD word1
  1750. #define wr_SHIFT 1
  1751. #define wr_MASK 0x00000001
  1752. #define wr_WORD word1
  1753. #define pf_SHIFT 8
  1754. #define pf_MASK 0x000000ff
  1755. #define pf_WORD word1
  1756. #define cpn_SHIFT 16
  1757. #define cpn_MASK 0x000000ff
  1758. #define cpn_WORD word1
  1759. uint32_t word2;
  1760. #define list_offset_SHIFT 0
  1761. #define list_offset_MASK 0x000000ff
  1762. #define list_offset_WORD word2
  1763. #define next_offset_SHIFT 8
  1764. #define next_offset_MASK 0x000000ff
  1765. #define next_offset_WORD word2
  1766. #define elem_cnt_SHIFT 16
  1767. #define elem_cnt_MASK 0x000000ff
  1768. #define elem_cnt_WORD word2
  1769. uint32_t word3;
  1770. #define pn_0_SHIFT 24
  1771. #define pn_0_MASK 0x000000ff
  1772. #define pn_0_WORD word3
  1773. #define pn_1_SHIFT 16
  1774. #define pn_1_MASK 0x000000ff
  1775. #define pn_1_WORD word3
  1776. #define pn_2_SHIFT 8
  1777. #define pn_2_MASK 0x000000ff
  1778. #define pn_2_WORD word3
  1779. #define pn_3_SHIFT 0
  1780. #define pn_3_MASK 0x000000ff
  1781. #define pn_3_WORD word3
  1782. uint32_t word4;
  1783. #define pn_4_SHIFT 24
  1784. #define pn_4_MASK 0x000000ff
  1785. #define pn_4_WORD word4
  1786. #define pn_5_SHIFT 16
  1787. #define pn_5_MASK 0x000000ff
  1788. #define pn_5_WORD word4
  1789. #define pn_6_SHIFT 8
  1790. #define pn_6_MASK 0x000000ff
  1791. #define pn_6_WORD word4
  1792. #define pn_7_SHIFT 0
  1793. #define pn_7_MASK 0x000000ff
  1794. #define pn_7_WORD word4
  1795. uint32_t rsvd[27];
  1796. #define LPFC_SUPP_PAGES 0
  1797. #define LPFC_BLOCK_GUARD_PROFILES 1
  1798. #define LPFC_SLI4_PARAMETERS 2
  1799. };
  1800. struct lpfc_mbx_sli4_params {
  1801. uint32_t word1;
  1802. #define qs_SHIFT 0
  1803. #define qs_MASK 0x00000001
  1804. #define qs_WORD word1
  1805. #define wr_SHIFT 1
  1806. #define wr_MASK 0x00000001
  1807. #define wr_WORD word1
  1808. #define pf_SHIFT 8
  1809. #define pf_MASK 0x000000ff
  1810. #define pf_WORD word1
  1811. #define cpn_SHIFT 16
  1812. #define cpn_MASK 0x000000ff
  1813. #define cpn_WORD word1
  1814. uint32_t word2;
  1815. #define if_type_SHIFT 0
  1816. #define if_type_MASK 0x00000007
  1817. #define if_type_WORD word2
  1818. #define sli_rev_SHIFT 4
  1819. #define sli_rev_MASK 0x0000000f
  1820. #define sli_rev_WORD word2
  1821. #define sli_family_SHIFT 8
  1822. #define sli_family_MASK 0x000000ff
  1823. #define sli_family_WORD word2
  1824. #define featurelevel_1_SHIFT 16
  1825. #define featurelevel_1_MASK 0x000000ff
  1826. #define featurelevel_1_WORD word2
  1827. #define featurelevel_2_SHIFT 24
  1828. #define featurelevel_2_MASK 0x0000001f
  1829. #define featurelevel_2_WORD word2
  1830. uint32_t word3;
  1831. #define fcoe_SHIFT 0
  1832. #define fcoe_MASK 0x00000001
  1833. #define fcoe_WORD word3
  1834. #define fc_SHIFT 1
  1835. #define fc_MASK 0x00000001
  1836. #define fc_WORD word3
  1837. #define nic_SHIFT 2
  1838. #define nic_MASK 0x00000001
  1839. #define nic_WORD word3
  1840. #define iscsi_SHIFT 3
  1841. #define iscsi_MASK 0x00000001
  1842. #define iscsi_WORD word3
  1843. #define rdma_SHIFT 4
  1844. #define rdma_MASK 0x00000001
  1845. #define rdma_WORD word3
  1846. uint32_t sge_supp_len;
  1847. uint32_t word5;
  1848. #define if_page_sz_SHIFT 0
  1849. #define if_page_sz_MASK 0x0000ffff
  1850. #define if_page_sz_WORD word5
  1851. #define loopbk_scope_SHIFT 24
  1852. #define loopbk_scope_MASK 0x0000000f
  1853. #define loopbk_scope_WORD word5
  1854. #define rq_db_window_SHIFT 28
  1855. #define rq_db_window_MASK 0x0000000f
  1856. #define rq_db_window_WORD word5
  1857. uint32_t word6;
  1858. #define eq_pages_SHIFT 0
  1859. #define eq_pages_MASK 0x0000000f
  1860. #define eq_pages_WORD word6
  1861. #define eqe_size_SHIFT 8
  1862. #define eqe_size_MASK 0x000000ff
  1863. #define eqe_size_WORD word6
  1864. uint32_t word7;
  1865. #define cq_pages_SHIFT 0
  1866. #define cq_pages_MASK 0x0000000f
  1867. #define cq_pages_WORD word7
  1868. #define cqe_size_SHIFT 8
  1869. #define cqe_size_MASK 0x000000ff
  1870. #define cqe_size_WORD word7
  1871. uint32_t word8;
  1872. #define mq_pages_SHIFT 0
  1873. #define mq_pages_MASK 0x0000000f
  1874. #define mq_pages_WORD word8
  1875. #define mqe_size_SHIFT 8
  1876. #define mqe_size_MASK 0x000000ff
  1877. #define mqe_size_WORD word8
  1878. #define mq_elem_cnt_SHIFT 16
  1879. #define mq_elem_cnt_MASK 0x000000ff
  1880. #define mq_elem_cnt_WORD word8
  1881. uint32_t word9;
  1882. #define wq_pages_SHIFT 0
  1883. #define wq_pages_MASK 0x0000ffff
  1884. #define wq_pages_WORD word9
  1885. #define wqe_size_SHIFT 8
  1886. #define wqe_size_MASK 0x000000ff
  1887. #define wqe_size_WORD word9
  1888. uint32_t word10;
  1889. #define rq_pages_SHIFT 0
  1890. #define rq_pages_MASK 0x0000ffff
  1891. #define rq_pages_WORD word10
  1892. #define rqe_size_SHIFT 8
  1893. #define rqe_size_MASK 0x000000ff
  1894. #define rqe_size_WORD word10
  1895. uint32_t word11;
  1896. #define hdr_pages_SHIFT 0
  1897. #define hdr_pages_MASK 0x0000000f
  1898. #define hdr_pages_WORD word11
  1899. #define hdr_size_SHIFT 8
  1900. #define hdr_size_MASK 0x0000000f
  1901. #define hdr_size_WORD word11
  1902. #define hdr_pp_align_SHIFT 16
  1903. #define hdr_pp_align_MASK 0x0000ffff
  1904. #define hdr_pp_align_WORD word11
  1905. uint32_t word12;
  1906. #define sgl_pages_SHIFT 0
  1907. #define sgl_pages_MASK 0x0000000f
  1908. #define sgl_pages_WORD word12
  1909. #define sgl_pp_align_SHIFT 16
  1910. #define sgl_pp_align_MASK 0x0000ffff
  1911. #define sgl_pp_align_WORD word12
  1912. uint32_t rsvd_13_63[51];
  1913. };
  1914. /* Mailbox Completion Queue Error Messages */
  1915. #define MB_CQE_STATUS_SUCCESS 0x0
  1916. #define MB_CQE_STATUS_INSUFFICIENT_PRIVILEGES 0x1
  1917. #define MB_CQE_STATUS_INVALID_PARAMETER 0x2
  1918. #define MB_CQE_STATUS_INSUFFICIENT_RESOURCES 0x3
  1919. #define MB_CEQ_STATUS_QUEUE_FLUSHING 0x4
  1920. #define MB_CQE_STATUS_DMA_FAILED 0x5
  1921. /* mailbox queue entry structure */
  1922. struct lpfc_mqe {
  1923. uint32_t word0;
  1924. #define lpfc_mqe_status_SHIFT 16
  1925. #define lpfc_mqe_status_MASK 0x0000FFFF
  1926. #define lpfc_mqe_status_WORD word0
  1927. #define lpfc_mqe_command_SHIFT 8
  1928. #define lpfc_mqe_command_MASK 0x000000FF
  1929. #define lpfc_mqe_command_WORD word0
  1930. union {
  1931. uint32_t mb_words[LPFC_SLI4_MB_WORD_COUNT - 1];
  1932. /* sli4 mailbox commands */
  1933. struct lpfc_mbx_sli4_config sli4_config;
  1934. struct lpfc_mbx_init_vfi init_vfi;
  1935. struct lpfc_mbx_reg_vfi reg_vfi;
  1936. struct lpfc_mbx_reg_vfi unreg_vfi;
  1937. struct lpfc_mbx_init_vpi init_vpi;
  1938. struct lpfc_mbx_resume_rpi resume_rpi;
  1939. struct lpfc_mbx_read_fcf_tbl read_fcf_tbl;
  1940. struct lpfc_mbx_add_fcf_tbl_entry add_fcf_entry;
  1941. struct lpfc_mbx_del_fcf_tbl_entry del_fcf_entry;
  1942. struct lpfc_mbx_redisc_fcf_tbl redisc_fcf_tbl;
  1943. struct lpfc_mbx_reg_fcfi reg_fcfi;
  1944. struct lpfc_mbx_unreg_fcfi unreg_fcfi;
  1945. struct lpfc_mbx_mq_create mq_create;
  1946. struct lpfc_mbx_eq_create eq_create;
  1947. struct lpfc_mbx_cq_create cq_create;
  1948. struct lpfc_mbx_wq_create wq_create;
  1949. struct lpfc_mbx_rq_create rq_create;
  1950. struct lpfc_mbx_mq_destroy mq_destroy;
  1951. struct lpfc_mbx_eq_destroy eq_destroy;
  1952. struct lpfc_mbx_cq_destroy cq_destroy;
  1953. struct lpfc_mbx_wq_destroy wq_destroy;
  1954. struct lpfc_mbx_rq_destroy rq_destroy;
  1955. struct lpfc_mbx_post_sgl_pages post_sgl_pages;
  1956. struct lpfc_mbx_nembed_cmd nembed_cmd;
  1957. struct lpfc_mbx_read_rev read_rev;
  1958. struct lpfc_mbx_read_vpi read_vpi;
  1959. struct lpfc_mbx_read_config rd_config;
  1960. struct lpfc_mbx_request_features req_ftrs;
  1961. struct lpfc_mbx_post_hdr_tmpl hdr_tmpl;
  1962. struct lpfc_mbx_query_fw_cfg query_fw_cfg;
  1963. struct lpfc_mbx_supp_pages supp_pages;
  1964. struct lpfc_mbx_sli4_params sli4_params;
  1965. struct lpfc_mbx_nop nop;
  1966. } un;
  1967. };
  1968. struct lpfc_mcqe {
  1969. uint32_t word0;
  1970. #define lpfc_mcqe_status_SHIFT 0
  1971. #define lpfc_mcqe_status_MASK 0x0000FFFF
  1972. #define lpfc_mcqe_status_WORD word0
  1973. #define lpfc_mcqe_ext_status_SHIFT 16
  1974. #define lpfc_mcqe_ext_status_MASK 0x0000FFFF
  1975. #define lpfc_mcqe_ext_status_WORD word0
  1976. uint32_t mcqe_tag0;
  1977. uint32_t mcqe_tag1;
  1978. uint32_t trailer;
  1979. #define lpfc_trailer_valid_SHIFT 31
  1980. #define lpfc_trailer_valid_MASK 0x00000001
  1981. #define lpfc_trailer_valid_WORD trailer
  1982. #define lpfc_trailer_async_SHIFT 30
  1983. #define lpfc_trailer_async_MASK 0x00000001
  1984. #define lpfc_trailer_async_WORD trailer
  1985. #define lpfc_trailer_hpi_SHIFT 29
  1986. #define lpfc_trailer_hpi_MASK 0x00000001
  1987. #define lpfc_trailer_hpi_WORD trailer
  1988. #define lpfc_trailer_completed_SHIFT 28
  1989. #define lpfc_trailer_completed_MASK 0x00000001
  1990. #define lpfc_trailer_completed_WORD trailer
  1991. #define lpfc_trailer_consumed_SHIFT 27
  1992. #define lpfc_trailer_consumed_MASK 0x00000001
  1993. #define lpfc_trailer_consumed_WORD trailer
  1994. #define lpfc_trailer_type_SHIFT 16
  1995. #define lpfc_trailer_type_MASK 0x000000FF
  1996. #define lpfc_trailer_type_WORD trailer
  1997. #define lpfc_trailer_code_SHIFT 8
  1998. #define lpfc_trailer_code_MASK 0x000000FF
  1999. #define lpfc_trailer_code_WORD trailer
  2000. #define LPFC_TRAILER_CODE_LINK 0x1
  2001. #define LPFC_TRAILER_CODE_FCOE 0x2
  2002. #define LPFC_TRAILER_CODE_DCBX 0x3
  2003. };
  2004. struct lpfc_acqe_link {
  2005. uint32_t word0;
  2006. #define lpfc_acqe_link_speed_SHIFT 24
  2007. #define lpfc_acqe_link_speed_MASK 0x000000FF
  2008. #define lpfc_acqe_link_speed_WORD word0
  2009. #define LPFC_ASYNC_LINK_SPEED_ZERO 0x0
  2010. #define LPFC_ASYNC_LINK_SPEED_10MBPS 0x1
  2011. #define LPFC_ASYNC_LINK_SPEED_100MBPS 0x2
  2012. #define LPFC_ASYNC_LINK_SPEED_1GBPS 0x3
  2013. #define LPFC_ASYNC_LINK_SPEED_10GBPS 0x4
  2014. #define lpfc_acqe_link_duplex_SHIFT 16
  2015. #define lpfc_acqe_link_duplex_MASK 0x000000FF
  2016. #define lpfc_acqe_link_duplex_WORD word0
  2017. #define LPFC_ASYNC_LINK_DUPLEX_NONE 0x0
  2018. #define LPFC_ASYNC_LINK_DUPLEX_HALF 0x1
  2019. #define LPFC_ASYNC_LINK_DUPLEX_FULL 0x2
  2020. #define lpfc_acqe_link_status_SHIFT 8
  2021. #define lpfc_acqe_link_status_MASK 0x000000FF
  2022. #define lpfc_acqe_link_status_WORD word0
  2023. #define LPFC_ASYNC_LINK_STATUS_DOWN 0x0
  2024. #define LPFC_ASYNC_LINK_STATUS_UP 0x1
  2025. #define LPFC_ASYNC_LINK_STATUS_LOGICAL_DOWN 0x2
  2026. #define LPFC_ASYNC_LINK_STATUS_LOGICAL_UP 0x3
  2027. #define lpfc_acqe_link_physical_SHIFT 0
  2028. #define lpfc_acqe_link_physical_MASK 0x000000FF
  2029. #define lpfc_acqe_link_physical_WORD word0
  2030. #define LPFC_ASYNC_LINK_PORT_A 0x0
  2031. #define LPFC_ASYNC_LINK_PORT_B 0x1
  2032. uint32_t word1;
  2033. #define lpfc_acqe_link_fault_SHIFT 0
  2034. #define lpfc_acqe_link_fault_MASK 0x000000FF
  2035. #define lpfc_acqe_link_fault_WORD word1
  2036. #define LPFC_ASYNC_LINK_FAULT_NONE 0x0
  2037. #define LPFC_ASYNC_LINK_FAULT_LOCAL 0x1
  2038. #define LPFC_ASYNC_LINK_FAULT_REMOTE 0x2
  2039. #define lpfc_acqe_qos_link_speed_SHIFT 16
  2040. #define lpfc_acqe_qos_link_speed_MASK 0x0000FFFF
  2041. #define lpfc_acqe_qos_link_speed_WORD word1
  2042. uint32_t event_tag;
  2043. uint32_t trailer;
  2044. };
  2045. struct lpfc_acqe_fcoe {
  2046. uint32_t index;
  2047. uint32_t word1;
  2048. #define lpfc_acqe_fcoe_fcf_count_SHIFT 0
  2049. #define lpfc_acqe_fcoe_fcf_count_MASK 0x0000FFFF
  2050. #define lpfc_acqe_fcoe_fcf_count_WORD word1
  2051. #define lpfc_acqe_fcoe_event_type_SHIFT 16
  2052. #define lpfc_acqe_fcoe_event_type_MASK 0x0000FFFF
  2053. #define lpfc_acqe_fcoe_event_type_WORD word1
  2054. #define LPFC_FCOE_EVENT_TYPE_NEW_FCF 0x1
  2055. #define LPFC_FCOE_EVENT_TYPE_FCF_TABLE_FULL 0x2
  2056. #define LPFC_FCOE_EVENT_TYPE_FCF_DEAD 0x3
  2057. #define LPFC_FCOE_EVENT_TYPE_CVL 0x4
  2058. #define LPFC_FCOE_EVENT_TYPE_FCF_PARAM_MOD 0x5
  2059. uint32_t event_tag;
  2060. uint32_t trailer;
  2061. };
  2062. struct lpfc_acqe_dcbx {
  2063. uint32_t tlv_ttl;
  2064. uint32_t reserved;
  2065. uint32_t event_tag;
  2066. uint32_t trailer;
  2067. };
  2068. /*
  2069. * Define the bootstrap mailbox (bmbx) region used to communicate
  2070. * mailbox command between the host and port. The mailbox consists
  2071. * of a payload area of 256 bytes and a completion queue of length
  2072. * 16 bytes.
  2073. */
  2074. struct lpfc_bmbx_create {
  2075. struct lpfc_mqe mqe;
  2076. struct lpfc_mcqe mcqe;
  2077. };
  2078. #define SGL_ALIGN_SZ 64
  2079. #define SGL_PAGE_SIZE 4096
  2080. /* align SGL addr on a size boundary - adjust address up */
  2081. #define NO_XRI ((uint16_t)-1)
  2082. struct wqe_common {
  2083. uint32_t word6;
  2084. #define wqe_xri_tag_SHIFT 0
  2085. #define wqe_xri_tag_MASK 0x0000FFFF
  2086. #define wqe_xri_tag_WORD word6
  2087. #define wqe_ctxt_tag_SHIFT 16
  2088. #define wqe_ctxt_tag_MASK 0x0000FFFF
  2089. #define wqe_ctxt_tag_WORD word6
  2090. uint32_t word7;
  2091. #define wqe_ct_SHIFT 2
  2092. #define wqe_ct_MASK 0x00000003
  2093. #define wqe_ct_WORD word7
  2094. #define wqe_status_SHIFT 4
  2095. #define wqe_status_MASK 0x0000000f
  2096. #define wqe_status_WORD word7
  2097. #define wqe_cmnd_SHIFT 8
  2098. #define wqe_cmnd_MASK 0x000000ff
  2099. #define wqe_cmnd_WORD word7
  2100. #define wqe_class_SHIFT 16
  2101. #define wqe_class_MASK 0x00000007
  2102. #define wqe_class_WORD word7
  2103. #define wqe_pu_SHIFT 20
  2104. #define wqe_pu_MASK 0x00000003
  2105. #define wqe_pu_WORD word7
  2106. #define wqe_erp_SHIFT 22
  2107. #define wqe_erp_MASK 0x00000001
  2108. #define wqe_erp_WORD word7
  2109. #define wqe_lnk_SHIFT 23
  2110. #define wqe_lnk_MASK 0x00000001
  2111. #define wqe_lnk_WORD word7
  2112. #define wqe_tmo_SHIFT 24
  2113. #define wqe_tmo_MASK 0x000000ff
  2114. #define wqe_tmo_WORD word7
  2115. uint32_t abort_tag; /* word 8 in WQE */
  2116. uint32_t word9;
  2117. #define wqe_reqtag_SHIFT 0
  2118. #define wqe_reqtag_MASK 0x0000FFFF
  2119. #define wqe_reqtag_WORD word9
  2120. #define wqe_rcvoxid_SHIFT 16
  2121. #define wqe_rcvoxid_MASK 0x0000FFFF
  2122. #define wqe_rcvoxid_WORD word9
  2123. uint32_t word10;
  2124. #define wqe_pri_SHIFT 16
  2125. #define wqe_pri_MASK 0x00000007
  2126. #define wqe_pri_WORD word10
  2127. #define wqe_pv_SHIFT 19
  2128. #define wqe_pv_MASK 0x00000001
  2129. #define wqe_pv_WORD word10
  2130. #define wqe_xc_SHIFT 21
  2131. #define wqe_xc_MASK 0x00000001
  2132. #define wqe_xc_WORD word10
  2133. #define wqe_ccpe_SHIFT 23
  2134. #define wqe_ccpe_MASK 0x00000001
  2135. #define wqe_ccpe_WORD word10
  2136. #define wqe_ccp_SHIFT 24
  2137. #define wqe_ccp_MASK 0x000000ff
  2138. #define wqe_ccp_WORD word10
  2139. uint32_t word11;
  2140. #define wqe_cmd_type_SHIFT 0
  2141. #define wqe_cmd_type_MASK 0x0000000f
  2142. #define wqe_cmd_type_WORD word11
  2143. #define wqe_wqec_SHIFT 7
  2144. #define wqe_wqec_MASK 0x00000001
  2145. #define wqe_wqec_WORD word11
  2146. #define wqe_cqid_SHIFT 16
  2147. #define wqe_cqid_MASK 0x0000ffff
  2148. #define wqe_cqid_WORD word11
  2149. };
  2150. struct wqe_did {
  2151. uint32_t word5;
  2152. #define wqe_els_did_SHIFT 0
  2153. #define wqe_els_did_MASK 0x00FFFFFF
  2154. #define wqe_els_did_WORD word5
  2155. #define wqe_xmit_bls_pt_SHIFT 28
  2156. #define wqe_xmit_bls_pt_MASK 0x00000003
  2157. #define wqe_xmit_bls_pt_WORD word5
  2158. #define wqe_xmit_bls_ar_SHIFT 30
  2159. #define wqe_xmit_bls_ar_MASK 0x00000001
  2160. #define wqe_xmit_bls_ar_WORD word5
  2161. #define wqe_xmit_bls_xo_SHIFT 31
  2162. #define wqe_xmit_bls_xo_MASK 0x00000001
  2163. #define wqe_xmit_bls_xo_WORD word5
  2164. };
  2165. struct els_request64_wqe {
  2166. struct ulp_bde64 bde;
  2167. uint32_t payload_len;
  2168. uint32_t word4;
  2169. #define els_req64_sid_SHIFT 0
  2170. #define els_req64_sid_MASK 0x00FFFFFF
  2171. #define els_req64_sid_WORD word4
  2172. #define els_req64_sp_SHIFT 24
  2173. #define els_req64_sp_MASK 0x00000001
  2174. #define els_req64_sp_WORD word4
  2175. #define els_req64_vf_SHIFT 25
  2176. #define els_req64_vf_MASK 0x00000001
  2177. #define els_req64_vf_WORD word4
  2178. struct wqe_did wqe_dest;
  2179. struct wqe_common wqe_com; /* words 6-11 */
  2180. uint32_t word12;
  2181. #define els_req64_vfid_SHIFT 1
  2182. #define els_req64_vfid_MASK 0x00000FFF
  2183. #define els_req64_vfid_WORD word12
  2184. #define els_req64_pri_SHIFT 13
  2185. #define els_req64_pri_MASK 0x00000007
  2186. #define els_req64_pri_WORD word12
  2187. uint32_t word13;
  2188. #define els_req64_hopcnt_SHIFT 24
  2189. #define els_req64_hopcnt_MASK 0x000000ff
  2190. #define els_req64_hopcnt_WORD word13
  2191. uint32_t reserved[2];
  2192. };
  2193. struct xmit_els_rsp64_wqe {
  2194. struct ulp_bde64 bde;
  2195. uint32_t rsvd3;
  2196. uint32_t rsvd4;
  2197. struct wqe_did wqe_dest;
  2198. struct wqe_common wqe_com; /* words 6-11 */
  2199. uint32_t rsvd_12_15[4];
  2200. };
  2201. struct xmit_bls_rsp64_wqe {
  2202. uint32_t payload0;
  2203. /* Payload0 for BA_ACC */
  2204. #define xmit_bls_rsp64_acc_seq_id_SHIFT 16
  2205. #define xmit_bls_rsp64_acc_seq_id_MASK 0x000000ff
  2206. #define xmit_bls_rsp64_acc_seq_id_WORD payload0
  2207. #define xmit_bls_rsp64_acc_seq_id_vald_SHIFT 24
  2208. #define xmit_bls_rsp64_acc_seq_id_vald_MASK 0x000000ff
  2209. #define xmit_bls_rsp64_acc_seq_id_vald_WORD payload0
  2210. /* Payload0 for BA_RJT */
  2211. #define xmit_bls_rsp64_rjt_vspec_SHIFT 0
  2212. #define xmit_bls_rsp64_rjt_vspec_MASK 0x000000ff
  2213. #define xmit_bls_rsp64_rjt_vspec_WORD payload0
  2214. #define xmit_bls_rsp64_rjt_expc_SHIFT 8
  2215. #define xmit_bls_rsp64_rjt_expc_MASK 0x000000ff
  2216. #define xmit_bls_rsp64_rjt_expc_WORD payload0
  2217. #define xmit_bls_rsp64_rjt_rsnc_SHIFT 16
  2218. #define xmit_bls_rsp64_rjt_rsnc_MASK 0x000000ff
  2219. #define xmit_bls_rsp64_rjt_rsnc_WORD payload0
  2220. uint32_t word1;
  2221. #define xmit_bls_rsp64_rxid_SHIFT 0
  2222. #define xmit_bls_rsp64_rxid_MASK 0x0000ffff
  2223. #define xmit_bls_rsp64_rxid_WORD word1
  2224. #define xmit_bls_rsp64_oxid_SHIFT 16
  2225. #define xmit_bls_rsp64_oxid_MASK 0x0000ffff
  2226. #define xmit_bls_rsp64_oxid_WORD word1
  2227. uint32_t word2;
  2228. #define xmit_bls_rsp64_seqcnthi_SHIFT 0
  2229. #define xmit_bls_rsp64_seqcnthi_MASK 0x0000ffff
  2230. #define xmit_bls_rsp64_seqcnthi_WORD word2
  2231. #define xmit_bls_rsp64_seqcntlo_SHIFT 16
  2232. #define xmit_bls_rsp64_seqcntlo_MASK 0x0000ffff
  2233. #define xmit_bls_rsp64_seqcntlo_WORD word2
  2234. uint32_t rsrvd3;
  2235. uint32_t rsrvd4;
  2236. struct wqe_did wqe_dest;
  2237. struct wqe_common wqe_com; /* words 6-11 */
  2238. uint32_t rsvd_12_15[4];
  2239. };
  2240. struct wqe_rctl_dfctl {
  2241. uint32_t word5;
  2242. #define wqe_si_SHIFT 2
  2243. #define wqe_si_MASK 0x000000001
  2244. #define wqe_si_WORD word5
  2245. #define wqe_la_SHIFT 3
  2246. #define wqe_la_MASK 0x000000001
  2247. #define wqe_la_WORD word5
  2248. #define wqe_ls_SHIFT 7
  2249. #define wqe_ls_MASK 0x000000001
  2250. #define wqe_ls_WORD word5
  2251. #define wqe_dfctl_SHIFT 8
  2252. #define wqe_dfctl_MASK 0x0000000ff
  2253. #define wqe_dfctl_WORD word5
  2254. #define wqe_type_SHIFT 16
  2255. #define wqe_type_MASK 0x0000000ff
  2256. #define wqe_type_WORD word5
  2257. #define wqe_rctl_SHIFT 24
  2258. #define wqe_rctl_MASK 0x0000000ff
  2259. #define wqe_rctl_WORD word5
  2260. };
  2261. struct xmit_seq64_wqe {
  2262. struct ulp_bde64 bde;
  2263. uint32_t paylaod_offset;
  2264. uint32_t relative_offset;
  2265. struct wqe_rctl_dfctl wge_ctl;
  2266. struct wqe_common wqe_com; /* words 6-11 */
  2267. /* Note: word10 different REVISIT */
  2268. uint32_t xmit_len;
  2269. uint32_t rsvd_12_15[3];
  2270. };
  2271. struct xmit_bcast64_wqe {
  2272. struct ulp_bde64 bde;
  2273. uint32_t paylaod_len;
  2274. uint32_t rsvd4;
  2275. struct wqe_rctl_dfctl wge_ctl; /* word 5 */
  2276. struct wqe_common wqe_com; /* words 6-11 */
  2277. uint32_t rsvd_12_15[4];
  2278. };
  2279. struct gen_req64_wqe {
  2280. struct ulp_bde64 bde;
  2281. uint32_t command_len;
  2282. uint32_t payload_len;
  2283. struct wqe_rctl_dfctl wge_ctl; /* word 5 */
  2284. struct wqe_common wqe_com; /* words 6-11 */
  2285. uint32_t rsvd_12_15[4];
  2286. };
  2287. struct create_xri_wqe {
  2288. uint32_t rsrvd[5]; /* words 0-4 */
  2289. struct wqe_did wqe_dest; /* word 5 */
  2290. struct wqe_common wqe_com; /* words 6-11 */
  2291. uint32_t rsvd_12_15[4]; /* word 12-15 */
  2292. };
  2293. #define T_REQUEST_TAG 3
  2294. #define T_XRI_TAG 1
  2295. struct abort_cmd_wqe {
  2296. uint32_t rsrvd[3];
  2297. uint32_t word3;
  2298. #define abort_cmd_ia_SHIFT 0
  2299. #define abort_cmd_ia_MASK 0x000000001
  2300. #define abort_cmd_ia_WORD word3
  2301. #define abort_cmd_criteria_SHIFT 8
  2302. #define abort_cmd_criteria_MASK 0x0000000ff
  2303. #define abort_cmd_criteria_WORD word3
  2304. uint32_t rsrvd4;
  2305. uint32_t rsrvd5;
  2306. struct wqe_common wqe_com; /* words 6-11 */
  2307. uint32_t rsvd_12_15[4]; /* word 12-15 */
  2308. };
  2309. struct fcp_iwrite64_wqe {
  2310. struct ulp_bde64 bde;
  2311. uint32_t payload_len;
  2312. uint32_t total_xfer_len;
  2313. uint32_t initial_xfer_len;
  2314. struct wqe_common wqe_com; /* words 6-11 */
  2315. uint32_t rsvd_12_15[4]; /* word 12-15 */
  2316. };
  2317. struct fcp_iread64_wqe {
  2318. struct ulp_bde64 bde;
  2319. uint32_t payload_len; /* word 3 */
  2320. uint32_t total_xfer_len; /* word 4 */
  2321. uint32_t rsrvd5; /* word 5 */
  2322. struct wqe_common wqe_com; /* words 6-11 */
  2323. uint32_t rsvd_12_15[4]; /* word 12-15 */
  2324. };
  2325. struct fcp_icmnd64_wqe {
  2326. struct ulp_bde64 bde; /* words 0-2 */
  2327. uint32_t rsrvd[3]; /* words 3-5 */
  2328. struct wqe_common wqe_com; /* words 6-11 */
  2329. uint32_t rsvd_12_15[4]; /* word 12-15 */
  2330. };
  2331. union lpfc_wqe {
  2332. uint32_t words[16];
  2333. struct lpfc_wqe_generic generic;
  2334. struct fcp_icmnd64_wqe fcp_icmd;
  2335. struct fcp_iread64_wqe fcp_iread;
  2336. struct fcp_iwrite64_wqe fcp_iwrite;
  2337. struct abort_cmd_wqe abort_cmd;
  2338. struct create_xri_wqe create_xri;
  2339. struct xmit_bcast64_wqe xmit_bcast64;
  2340. struct xmit_seq64_wqe xmit_sequence;
  2341. struct xmit_bls_rsp64_wqe xmit_bls_rsp;
  2342. struct xmit_els_rsp64_wqe xmit_els_rsp;
  2343. struct els_request64_wqe els_req;
  2344. struct gen_req64_wqe gen_req;
  2345. };
  2346. #define FCP_COMMAND 0x0
  2347. #define FCP_COMMAND_DATA_OUT 0x1
  2348. #define ELS_COMMAND_NON_FIP 0xC
  2349. #define ELS_COMMAND_FIP 0xD
  2350. #define OTHER_COMMAND 0x8