lpfc_hw4.h 93 KB

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