lpfc_hw.h 110 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836
  1. /*******************************************************************
  2. * This file is part of the Emulex Linux Device Driver for *
  3. * Fibre Channel Host Bus Adapters. *
  4. * Copyright (C) 2004-2011 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. #define FDMI_DID 0xfffffaU
  21. #define NameServer_DID 0xfffffcU
  22. #define SCR_DID 0xfffffdU
  23. #define Fabric_DID 0xfffffeU
  24. #define Bcast_DID 0xffffffU
  25. #define Mask_DID 0xffffffU
  26. #define CT_DID_MASK 0xffff00U
  27. #define Fabric_DID_MASK 0xfff000U
  28. #define WELL_KNOWN_DID_MASK 0xfffff0U
  29. #define PT2PT_LocalID 1
  30. #define PT2PT_RemoteID 2
  31. #define FF_DEF_EDTOV 2000 /* Default E_D_TOV (2000ms) */
  32. #define FF_DEF_ALTOV 15 /* Default AL_TIME (15ms) */
  33. #define FF_DEF_RATOV 2 /* Default RA_TOV (2s) */
  34. #define FF_DEF_ARBTOV 1900 /* Default ARB_TOV (1900ms) */
  35. #define LPFC_BUF_RING0 64 /* Number of buffers to post to RING
  36. 0 */
  37. #define FCELSSIZE 1024 /* maximum ELS transfer size */
  38. #define LPFC_FCP_RING 0 /* ring 0 for FCP initiator commands */
  39. #define LPFC_EXTRA_RING 1 /* ring 1 for other protocols */
  40. #define LPFC_ELS_RING 2 /* ring 2 for ELS commands */
  41. #define LPFC_FCP_NEXT_RING 3
  42. #define SLI2_IOCB_CMD_R0_ENTRIES 172 /* SLI-2 FCP command ring entries */
  43. #define SLI2_IOCB_RSP_R0_ENTRIES 134 /* SLI-2 FCP response ring entries */
  44. #define SLI2_IOCB_CMD_R1_ENTRIES 4 /* SLI-2 extra command ring entries */
  45. #define SLI2_IOCB_RSP_R1_ENTRIES 4 /* SLI-2 extra response ring entries */
  46. #define SLI2_IOCB_CMD_R1XTRA_ENTRIES 36 /* SLI-2 extra FCP cmd ring entries */
  47. #define SLI2_IOCB_RSP_R1XTRA_ENTRIES 52 /* SLI-2 extra FCP rsp ring entries */
  48. #define SLI2_IOCB_CMD_R2_ENTRIES 20 /* SLI-2 ELS command ring entries */
  49. #define SLI2_IOCB_RSP_R2_ENTRIES 20 /* SLI-2 ELS response ring entries */
  50. #define SLI2_IOCB_CMD_R3_ENTRIES 0
  51. #define SLI2_IOCB_RSP_R3_ENTRIES 0
  52. #define SLI2_IOCB_CMD_R3XTRA_ENTRIES 24
  53. #define SLI2_IOCB_RSP_R3XTRA_ENTRIES 32
  54. #define SLI2_IOCB_CMD_SIZE 32
  55. #define SLI2_IOCB_RSP_SIZE 32
  56. #define SLI3_IOCB_CMD_SIZE 128
  57. #define SLI3_IOCB_RSP_SIZE 64
  58. #define LPFC_UNREG_ALL_RPIS_VPORT 0xffff
  59. #define LPFC_UNREG_ALL_DFLT_RPIS 0xffffffff
  60. /* vendor ID used in SCSI netlink calls */
  61. #define LPFC_NL_VENDOR_ID (SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_EMULEX)
  62. #define FW_REV_STR_SIZE 32
  63. /* Common Transport structures and definitions */
  64. union CtRevisionId {
  65. /* Structure is in Big Endian format */
  66. struct {
  67. uint32_t Revision:8;
  68. uint32_t InId:24;
  69. } bits;
  70. uint32_t word;
  71. };
  72. union CtCommandResponse {
  73. /* Structure is in Big Endian format */
  74. struct {
  75. uint32_t CmdRsp:16;
  76. uint32_t Size:16;
  77. } bits;
  78. uint32_t word;
  79. };
  80. #define FC4_FEATURE_INIT 0x2
  81. #define FC4_FEATURE_TARGET 0x1
  82. struct lpfc_sli_ct_request {
  83. /* Structure is in Big Endian format */
  84. union CtRevisionId RevisionId;
  85. uint8_t FsType;
  86. uint8_t FsSubType;
  87. uint8_t Options;
  88. uint8_t Rsrvd1;
  89. union CtCommandResponse CommandResponse;
  90. uint8_t Rsrvd2;
  91. uint8_t ReasonCode;
  92. uint8_t Explanation;
  93. uint8_t VendorUnique;
  94. union {
  95. uint32_t PortID;
  96. struct gid {
  97. uint8_t PortType; /* for GID_PT requests */
  98. uint8_t DomainScope;
  99. uint8_t AreaScope;
  100. uint8_t Fc4Type; /* for GID_FT requests */
  101. } gid;
  102. struct rft {
  103. uint32_t PortId; /* For RFT_ID requests */
  104. #ifdef __BIG_ENDIAN_BITFIELD
  105. uint32_t rsvd0:16;
  106. uint32_t rsvd1:7;
  107. uint32_t fcpReg:1; /* Type 8 */
  108. uint32_t rsvd2:2;
  109. uint32_t ipReg:1; /* Type 5 */
  110. uint32_t rsvd3:5;
  111. #else /* __LITTLE_ENDIAN_BITFIELD */
  112. uint32_t rsvd0:16;
  113. uint32_t fcpReg:1; /* Type 8 */
  114. uint32_t rsvd1:7;
  115. uint32_t rsvd3:5;
  116. uint32_t ipReg:1; /* Type 5 */
  117. uint32_t rsvd2:2;
  118. #endif
  119. uint32_t rsvd[7];
  120. } rft;
  121. struct rnn {
  122. uint32_t PortId; /* For RNN_ID requests */
  123. uint8_t wwnn[8];
  124. } rnn;
  125. struct rsnn { /* For RSNN_ID requests */
  126. uint8_t wwnn[8];
  127. uint8_t len;
  128. uint8_t symbname[255];
  129. } rsnn;
  130. struct da_id { /* For DA_ID requests */
  131. uint32_t port_id;
  132. } da_id;
  133. struct rspn { /* For RSPN_ID requests */
  134. uint32_t PortId;
  135. uint8_t len;
  136. uint8_t symbname[255];
  137. } rspn;
  138. struct gff {
  139. uint32_t PortId;
  140. } gff;
  141. struct gff_acc {
  142. uint8_t fbits[128];
  143. } gff_acc;
  144. #define FCP_TYPE_FEATURE_OFFSET 7
  145. struct rff {
  146. uint32_t PortId;
  147. uint8_t reserved[2];
  148. uint8_t fbits;
  149. uint8_t type_code; /* type=8 for FCP */
  150. } rff;
  151. } un;
  152. };
  153. #define SLI_CT_REVISION 1
  154. #define GID_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
  155. sizeof(struct gid))
  156. #define GFF_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
  157. sizeof(struct gff))
  158. #define RFT_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
  159. sizeof(struct rft))
  160. #define RFF_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
  161. sizeof(struct rff))
  162. #define RNN_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
  163. sizeof(struct rnn))
  164. #define RSNN_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
  165. sizeof(struct rsnn))
  166. #define DA_ID_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
  167. sizeof(struct da_id))
  168. #define RSPN_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
  169. sizeof(struct rspn))
  170. /*
  171. * FsType Definitions
  172. */
  173. #define SLI_CT_MANAGEMENT_SERVICE 0xFA
  174. #define SLI_CT_TIME_SERVICE 0xFB
  175. #define SLI_CT_DIRECTORY_SERVICE 0xFC
  176. #define SLI_CT_FABRIC_CONTROLLER_SERVICE 0xFD
  177. /*
  178. * Directory Service Subtypes
  179. */
  180. #define SLI_CT_DIRECTORY_NAME_SERVER 0x02
  181. /*
  182. * Response Codes
  183. */
  184. #define SLI_CT_RESPONSE_FS_RJT 0x8001
  185. #define SLI_CT_RESPONSE_FS_ACC 0x8002
  186. /*
  187. * Reason Codes
  188. */
  189. #define SLI_CT_NO_ADDITIONAL_EXPL 0x0
  190. #define SLI_CT_INVALID_COMMAND 0x01
  191. #define SLI_CT_INVALID_VERSION 0x02
  192. #define SLI_CT_LOGICAL_ERROR 0x03
  193. #define SLI_CT_INVALID_IU_SIZE 0x04
  194. #define SLI_CT_LOGICAL_BUSY 0x05
  195. #define SLI_CT_PROTOCOL_ERROR 0x07
  196. #define SLI_CT_UNABLE_TO_PERFORM_REQ 0x09
  197. #define SLI_CT_REQ_NOT_SUPPORTED 0x0b
  198. #define SLI_CT_HBA_INFO_NOT_REGISTERED 0x10
  199. #define SLI_CT_MULTIPLE_HBA_ATTR_OF_SAME_TYPE 0x11
  200. #define SLI_CT_INVALID_HBA_ATTR_BLOCK_LEN 0x12
  201. #define SLI_CT_HBA_ATTR_NOT_PRESENT 0x13
  202. #define SLI_CT_PORT_INFO_NOT_REGISTERED 0x20
  203. #define SLI_CT_MULTIPLE_PORT_ATTR_OF_SAME_TYPE 0x21
  204. #define SLI_CT_INVALID_PORT_ATTR_BLOCK_LEN 0x22
  205. #define SLI_CT_VENDOR_UNIQUE 0xff
  206. /*
  207. * Name Server SLI_CT_UNABLE_TO_PERFORM_REQ Explanations
  208. */
  209. #define SLI_CT_NO_PORT_ID 0x01
  210. #define SLI_CT_NO_PORT_NAME 0x02
  211. #define SLI_CT_NO_NODE_NAME 0x03
  212. #define SLI_CT_NO_CLASS_OF_SERVICE 0x04
  213. #define SLI_CT_NO_IP_ADDRESS 0x05
  214. #define SLI_CT_NO_IPA 0x06
  215. #define SLI_CT_NO_FC4_TYPES 0x07
  216. #define SLI_CT_NO_SYMBOLIC_PORT_NAME 0x08
  217. #define SLI_CT_NO_SYMBOLIC_NODE_NAME 0x09
  218. #define SLI_CT_NO_PORT_TYPE 0x0A
  219. #define SLI_CT_ACCESS_DENIED 0x10
  220. #define SLI_CT_INVALID_PORT_ID 0x11
  221. #define SLI_CT_DATABASE_EMPTY 0x12
  222. /*
  223. * Name Server Command Codes
  224. */
  225. #define SLI_CTNS_GA_NXT 0x0100
  226. #define SLI_CTNS_GPN_ID 0x0112
  227. #define SLI_CTNS_GNN_ID 0x0113
  228. #define SLI_CTNS_GCS_ID 0x0114
  229. #define SLI_CTNS_GFT_ID 0x0117
  230. #define SLI_CTNS_GSPN_ID 0x0118
  231. #define SLI_CTNS_GPT_ID 0x011A
  232. #define SLI_CTNS_GFF_ID 0x011F
  233. #define SLI_CTNS_GID_PN 0x0121
  234. #define SLI_CTNS_GID_NN 0x0131
  235. #define SLI_CTNS_GIP_NN 0x0135
  236. #define SLI_CTNS_GIPA_NN 0x0136
  237. #define SLI_CTNS_GSNN_NN 0x0139
  238. #define SLI_CTNS_GNN_IP 0x0153
  239. #define SLI_CTNS_GIPA_IP 0x0156
  240. #define SLI_CTNS_GID_FT 0x0171
  241. #define SLI_CTNS_GID_PT 0x01A1
  242. #define SLI_CTNS_RPN_ID 0x0212
  243. #define SLI_CTNS_RNN_ID 0x0213
  244. #define SLI_CTNS_RCS_ID 0x0214
  245. #define SLI_CTNS_RFT_ID 0x0217
  246. #define SLI_CTNS_RSPN_ID 0x0218
  247. #define SLI_CTNS_RPT_ID 0x021A
  248. #define SLI_CTNS_RFF_ID 0x021F
  249. #define SLI_CTNS_RIP_NN 0x0235
  250. #define SLI_CTNS_RIPA_NN 0x0236
  251. #define SLI_CTNS_RSNN_NN 0x0239
  252. #define SLI_CTNS_DA_ID 0x0300
  253. /*
  254. * Port Types
  255. */
  256. #define SLI_CTPT_N_PORT 0x01
  257. #define SLI_CTPT_NL_PORT 0x02
  258. #define SLI_CTPT_FNL_PORT 0x03
  259. #define SLI_CTPT_IP 0x04
  260. #define SLI_CTPT_FCP 0x08
  261. #define SLI_CTPT_NX_PORT 0x7F
  262. #define SLI_CTPT_F_PORT 0x81
  263. #define SLI_CTPT_FL_PORT 0x82
  264. #define SLI_CTPT_E_PORT 0x84
  265. #define SLI_CT_LAST_ENTRY 0x80000000
  266. /* Fibre Channel Service Parameter definitions */
  267. #define FC_PH_4_0 6 /* FC-PH version 4.0 */
  268. #define FC_PH_4_1 7 /* FC-PH version 4.1 */
  269. #define FC_PH_4_2 8 /* FC-PH version 4.2 */
  270. #define FC_PH_4_3 9 /* FC-PH version 4.3 */
  271. #define FC_PH_LOW 8 /* Lowest supported FC-PH version */
  272. #define FC_PH_HIGH 9 /* Highest supported FC-PH version */
  273. #define FC_PH3 0x20 /* FC-PH-3 version */
  274. #define FF_FRAME_SIZE 2048
  275. struct lpfc_name {
  276. union {
  277. struct {
  278. #ifdef __BIG_ENDIAN_BITFIELD
  279. uint8_t nameType:4; /* FC Word 0, bit 28:31 */
  280. uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit
  281. 8:11 of IEEE ext */
  282. #else /* __LITTLE_ENDIAN_BITFIELD */
  283. uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit
  284. 8:11 of IEEE ext */
  285. uint8_t nameType:4; /* FC Word 0, bit 28:31 */
  286. #endif
  287. #define NAME_IEEE 0x1 /* IEEE name - nameType */
  288. #define NAME_IEEE_EXT 0x2 /* IEEE extended name */
  289. #define NAME_FC_TYPE 0x3 /* FC native name type */
  290. #define NAME_IP_TYPE 0x4 /* IP address */
  291. #define NAME_CCITT_TYPE 0xC
  292. #define NAME_CCITT_GR_TYPE 0xE
  293. uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, IEEE
  294. extended Lsb */
  295. uint8_t IEEE[6]; /* FC IEEE address */
  296. } s;
  297. uint8_t wwn[8];
  298. } u;
  299. };
  300. struct csp {
  301. uint8_t fcphHigh; /* FC Word 0, byte 0 */
  302. uint8_t fcphLow;
  303. uint8_t bbCreditMsb;
  304. uint8_t bbCreditlsb; /* FC Word 0, byte 3 */
  305. /*
  306. * Word 1 Bit 31 in common service parameter is overloaded.
  307. * Word 1 Bit 31 in FLOGI request is multiple NPort request
  308. * Word 1 Bit 31 in FLOGI response is clean address bit
  309. */
  310. #define clean_address_bit request_multiple_Nport /* Word 1, bit 31 */
  311. /*
  312. * Word 1 Bit 30 in common service parameter is overloaded.
  313. * Word 1 Bit 30 in FLOGI request is Virtual Fabrics
  314. * Word 1 Bit 30 in PLOGI request is random offset
  315. */
  316. #define virtual_fabric_support randomOffset /* Word 1, bit 30 */
  317. #ifdef __BIG_ENDIAN_BITFIELD
  318. uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */
  319. uint16_t randomOffset:1; /* FC Word 1, bit 30 */
  320. uint16_t response_multiple_NPort:1; /* FC Word 1, bit 29 */
  321. uint16_t fPort:1; /* FC Word 1, bit 28 */
  322. uint16_t altBbCredit:1; /* FC Word 1, bit 27 */
  323. uint16_t edtovResolution:1; /* FC Word 1, bit 26 */
  324. uint16_t multicast:1; /* FC Word 1, bit 25 */
  325. uint16_t broadcast:1; /* FC Word 1, bit 24 */
  326. uint16_t huntgroup:1; /* FC Word 1, bit 23 */
  327. uint16_t simplex:1; /* FC Word 1, bit 22 */
  328. uint16_t word1Reserved1:3; /* FC Word 1, bit 21:19 */
  329. uint16_t dhd:1; /* FC Word 1, bit 18 */
  330. uint16_t contIncSeqCnt:1; /* FC Word 1, bit 17 */
  331. uint16_t payloadlength:1; /* FC Word 1, bit 16 */
  332. #else /* __LITTLE_ENDIAN_BITFIELD */
  333. uint16_t broadcast:1; /* FC Word 1, bit 24 */
  334. uint16_t multicast:1; /* FC Word 1, bit 25 */
  335. uint16_t edtovResolution:1; /* FC Word 1, bit 26 */
  336. uint16_t altBbCredit:1; /* FC Word 1, bit 27 */
  337. uint16_t fPort:1; /* FC Word 1, bit 28 */
  338. uint16_t response_multiple_NPort:1; /* FC Word 1, bit 29 */
  339. uint16_t randomOffset:1; /* FC Word 1, bit 30 */
  340. uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */
  341. uint16_t payloadlength:1; /* FC Word 1, bit 16 */
  342. uint16_t contIncSeqCnt:1; /* FC Word 1, bit 17 */
  343. uint16_t dhd:1; /* FC Word 1, bit 18 */
  344. uint16_t word1Reserved1:3; /* FC Word 1, bit 21:19 */
  345. uint16_t simplex:1; /* FC Word 1, bit 22 */
  346. uint16_t huntgroup:1; /* FC Word 1, bit 23 */
  347. #endif
  348. uint8_t bbRcvSizeMsb; /* Upper nibble is reserved */
  349. uint8_t bbRcvSizeLsb; /* FC Word 1, byte 3 */
  350. union {
  351. struct {
  352. uint8_t word2Reserved1; /* FC Word 2 byte 0 */
  353. uint8_t totalConcurrSeq; /* FC Word 2 byte 1 */
  354. uint8_t roByCategoryMsb; /* FC Word 2 byte 2 */
  355. uint8_t roByCategoryLsb; /* FC Word 2 byte 3 */
  356. } nPort;
  357. uint32_t r_a_tov; /* R_A_TOV must be in B.E. format */
  358. } w2;
  359. uint32_t e_d_tov; /* E_D_TOV must be in B.E. format */
  360. };
  361. struct class_parms {
  362. #ifdef __BIG_ENDIAN_BITFIELD
  363. uint8_t classValid:1; /* FC Word 0, bit 31 */
  364. uint8_t intermix:1; /* FC Word 0, bit 30 */
  365. uint8_t stackedXparent:1; /* FC Word 0, bit 29 */
  366. uint8_t stackedLockDown:1; /* FC Word 0, bit 28 */
  367. uint8_t seqDelivery:1; /* FC Word 0, bit 27 */
  368. uint8_t word0Reserved1:3; /* FC Word 0, bit 24:26 */
  369. #else /* __LITTLE_ENDIAN_BITFIELD */
  370. uint8_t word0Reserved1:3; /* FC Word 0, bit 24:26 */
  371. uint8_t seqDelivery:1; /* FC Word 0, bit 27 */
  372. uint8_t stackedLockDown:1; /* FC Word 0, bit 28 */
  373. uint8_t stackedXparent:1; /* FC Word 0, bit 29 */
  374. uint8_t intermix:1; /* FC Word 0, bit 30 */
  375. uint8_t classValid:1; /* FC Word 0, bit 31 */
  376. #endif
  377. uint8_t word0Reserved2; /* FC Word 0, bit 16:23 */
  378. #ifdef __BIG_ENDIAN_BITFIELD
  379. uint8_t iCtlXidReAssgn:2; /* FC Word 0, Bit 14:15 */
  380. uint8_t iCtlInitialPa:2; /* FC Word 0, bit 12:13 */
  381. uint8_t iCtlAck0capable:1; /* FC Word 0, bit 11 */
  382. uint8_t iCtlAckNcapable:1; /* FC Word 0, bit 10 */
  383. uint8_t word0Reserved3:2; /* FC Word 0, bit 8: 9 */
  384. #else /* __LITTLE_ENDIAN_BITFIELD */
  385. uint8_t word0Reserved3:2; /* FC Word 0, bit 8: 9 */
  386. uint8_t iCtlAckNcapable:1; /* FC Word 0, bit 10 */
  387. uint8_t iCtlAck0capable:1; /* FC Word 0, bit 11 */
  388. uint8_t iCtlInitialPa:2; /* FC Word 0, bit 12:13 */
  389. uint8_t iCtlXidReAssgn:2; /* FC Word 0, Bit 14:15 */
  390. #endif
  391. uint8_t word0Reserved4; /* FC Word 0, bit 0: 7 */
  392. #ifdef __BIG_ENDIAN_BITFIELD
  393. uint8_t rCtlAck0capable:1; /* FC Word 1, bit 31 */
  394. uint8_t rCtlAckNcapable:1; /* FC Word 1, bit 30 */
  395. uint8_t rCtlXidInterlck:1; /* FC Word 1, bit 29 */
  396. uint8_t rCtlErrorPolicy:2; /* FC Word 1, bit 27:28 */
  397. uint8_t word1Reserved1:1; /* FC Word 1, bit 26 */
  398. uint8_t rCtlCatPerSeq:2; /* FC Word 1, bit 24:25 */
  399. #else /* __LITTLE_ENDIAN_BITFIELD */
  400. uint8_t rCtlCatPerSeq:2; /* FC Word 1, bit 24:25 */
  401. uint8_t word1Reserved1:1; /* FC Word 1, bit 26 */
  402. uint8_t rCtlErrorPolicy:2; /* FC Word 1, bit 27:28 */
  403. uint8_t rCtlXidInterlck:1; /* FC Word 1, bit 29 */
  404. uint8_t rCtlAckNcapable:1; /* FC Word 1, bit 30 */
  405. uint8_t rCtlAck0capable:1; /* FC Word 1, bit 31 */
  406. #endif
  407. uint8_t word1Reserved2; /* FC Word 1, bit 16:23 */
  408. uint8_t rcvDataSizeMsb; /* FC Word 1, bit 8:15 */
  409. uint8_t rcvDataSizeLsb; /* FC Word 1, bit 0: 7 */
  410. uint8_t concurrentSeqMsb; /* FC Word 2, bit 24:31 */
  411. uint8_t concurrentSeqLsb; /* FC Word 2, bit 16:23 */
  412. uint8_t EeCreditSeqMsb; /* FC Word 2, bit 8:15 */
  413. uint8_t EeCreditSeqLsb; /* FC Word 2, bit 0: 7 */
  414. uint8_t openSeqPerXchgMsb; /* FC Word 3, bit 24:31 */
  415. uint8_t openSeqPerXchgLsb; /* FC Word 3, bit 16:23 */
  416. uint8_t word3Reserved1; /* Fc Word 3, bit 8:15 */
  417. uint8_t word3Reserved2; /* Fc Word 3, bit 0: 7 */
  418. };
  419. struct serv_parm { /* Structure is in Big Endian format */
  420. struct csp cmn;
  421. struct lpfc_name portName;
  422. struct lpfc_name nodeName;
  423. struct class_parms cls1;
  424. struct class_parms cls2;
  425. struct class_parms cls3;
  426. struct class_parms cls4;
  427. uint8_t vendorVersion[16];
  428. };
  429. /*
  430. * Virtual Fabric Tagging Header
  431. */
  432. struct fc_vft_header {
  433. uint32_t word0;
  434. #define fc_vft_hdr_r_ctl_SHIFT 24
  435. #define fc_vft_hdr_r_ctl_MASK 0xFF
  436. #define fc_vft_hdr_r_ctl_WORD word0
  437. #define fc_vft_hdr_ver_SHIFT 22
  438. #define fc_vft_hdr_ver_MASK 0x3
  439. #define fc_vft_hdr_ver_WORD word0
  440. #define fc_vft_hdr_type_SHIFT 18
  441. #define fc_vft_hdr_type_MASK 0xF
  442. #define fc_vft_hdr_type_WORD word0
  443. #define fc_vft_hdr_e_SHIFT 16
  444. #define fc_vft_hdr_e_MASK 0x1
  445. #define fc_vft_hdr_e_WORD word0
  446. #define fc_vft_hdr_priority_SHIFT 13
  447. #define fc_vft_hdr_priority_MASK 0x7
  448. #define fc_vft_hdr_priority_WORD word0
  449. #define fc_vft_hdr_vf_id_SHIFT 1
  450. #define fc_vft_hdr_vf_id_MASK 0xFFF
  451. #define fc_vft_hdr_vf_id_WORD word0
  452. uint32_t word1;
  453. #define fc_vft_hdr_hopct_SHIFT 24
  454. #define fc_vft_hdr_hopct_MASK 0xFF
  455. #define fc_vft_hdr_hopct_WORD word1
  456. };
  457. /*
  458. * Extended Link Service LS_COMMAND codes (Payload Word 0)
  459. */
  460. #ifdef __BIG_ENDIAN_BITFIELD
  461. #define ELS_CMD_MASK 0xffff0000
  462. #define ELS_RSP_MASK 0xff000000
  463. #define ELS_CMD_LS_RJT 0x01000000
  464. #define ELS_CMD_ACC 0x02000000
  465. #define ELS_CMD_PLOGI 0x03000000
  466. #define ELS_CMD_FLOGI 0x04000000
  467. #define ELS_CMD_LOGO 0x05000000
  468. #define ELS_CMD_ABTX 0x06000000
  469. #define ELS_CMD_RCS 0x07000000
  470. #define ELS_CMD_RES 0x08000000
  471. #define ELS_CMD_RSS 0x09000000
  472. #define ELS_CMD_RSI 0x0A000000
  473. #define ELS_CMD_ESTS 0x0B000000
  474. #define ELS_CMD_ESTC 0x0C000000
  475. #define ELS_CMD_ADVC 0x0D000000
  476. #define ELS_CMD_RTV 0x0E000000
  477. #define ELS_CMD_RLS 0x0F000000
  478. #define ELS_CMD_ECHO 0x10000000
  479. #define ELS_CMD_TEST 0x11000000
  480. #define ELS_CMD_RRQ 0x12000000
  481. #define ELS_CMD_PRLI 0x20100014
  482. #define ELS_CMD_PRLO 0x21100014
  483. #define ELS_CMD_PRLO_ACC 0x02100014
  484. #define ELS_CMD_PDISC 0x50000000
  485. #define ELS_CMD_FDISC 0x51000000
  486. #define ELS_CMD_ADISC 0x52000000
  487. #define ELS_CMD_FARP 0x54000000
  488. #define ELS_CMD_FARPR 0x55000000
  489. #define ELS_CMD_RPS 0x56000000
  490. #define ELS_CMD_RPL 0x57000000
  491. #define ELS_CMD_FAN 0x60000000
  492. #define ELS_CMD_RSCN 0x61040000
  493. #define ELS_CMD_SCR 0x62000000
  494. #define ELS_CMD_RNID 0x78000000
  495. #define ELS_CMD_LIRR 0x7A000000
  496. #else /* __LITTLE_ENDIAN_BITFIELD */
  497. #define ELS_CMD_MASK 0xffff
  498. #define ELS_RSP_MASK 0xff
  499. #define ELS_CMD_LS_RJT 0x01
  500. #define ELS_CMD_ACC 0x02
  501. #define ELS_CMD_PLOGI 0x03
  502. #define ELS_CMD_FLOGI 0x04
  503. #define ELS_CMD_LOGO 0x05
  504. #define ELS_CMD_ABTX 0x06
  505. #define ELS_CMD_RCS 0x07
  506. #define ELS_CMD_RES 0x08
  507. #define ELS_CMD_RSS 0x09
  508. #define ELS_CMD_RSI 0x0A
  509. #define ELS_CMD_ESTS 0x0B
  510. #define ELS_CMD_ESTC 0x0C
  511. #define ELS_CMD_ADVC 0x0D
  512. #define ELS_CMD_RTV 0x0E
  513. #define ELS_CMD_RLS 0x0F
  514. #define ELS_CMD_ECHO 0x10
  515. #define ELS_CMD_TEST 0x11
  516. #define ELS_CMD_RRQ 0x12
  517. #define ELS_CMD_PRLI 0x14001020
  518. #define ELS_CMD_PRLO 0x14001021
  519. #define ELS_CMD_PRLO_ACC 0x14001002
  520. #define ELS_CMD_PDISC 0x50
  521. #define ELS_CMD_FDISC 0x51
  522. #define ELS_CMD_ADISC 0x52
  523. #define ELS_CMD_FARP 0x54
  524. #define ELS_CMD_FARPR 0x55
  525. #define ELS_CMD_RPS 0x56
  526. #define ELS_CMD_RPL 0x57
  527. #define ELS_CMD_FAN 0x60
  528. #define ELS_CMD_RSCN 0x0461
  529. #define ELS_CMD_SCR 0x62
  530. #define ELS_CMD_RNID 0x78
  531. #define ELS_CMD_LIRR 0x7A
  532. #endif
  533. /*
  534. * LS_RJT Payload Definition
  535. */
  536. struct ls_rjt { /* Structure is in Big Endian format */
  537. union {
  538. uint32_t lsRjtError;
  539. struct {
  540. uint8_t lsRjtRsvd0; /* FC Word 0, bit 24:31 */
  541. uint8_t lsRjtRsnCode; /* FC Word 0, bit 16:23 */
  542. /* LS_RJT reason codes */
  543. #define LSRJT_INVALID_CMD 0x01
  544. #define LSRJT_LOGICAL_ERR 0x03
  545. #define LSRJT_LOGICAL_BSY 0x05
  546. #define LSRJT_PROTOCOL_ERR 0x07
  547. #define LSRJT_UNABLE_TPC 0x09 /* Unable to perform command */
  548. #define LSRJT_CMD_UNSUPPORTED 0x0B
  549. #define LSRJT_VENDOR_UNIQUE 0xFF /* See Byte 3 */
  550. uint8_t lsRjtRsnCodeExp; /* FC Word 0, bit 8:15 */
  551. /* LS_RJT reason explanation */
  552. #define LSEXP_NOTHING_MORE 0x00
  553. #define LSEXP_SPARM_OPTIONS 0x01
  554. #define LSEXP_SPARM_ICTL 0x03
  555. #define LSEXP_SPARM_RCTL 0x05
  556. #define LSEXP_SPARM_RCV_SIZE 0x07
  557. #define LSEXP_SPARM_CONCUR_SEQ 0x09
  558. #define LSEXP_SPARM_CREDIT 0x0B
  559. #define LSEXP_INVALID_PNAME 0x0D
  560. #define LSEXP_INVALID_NNAME 0x0E
  561. #define LSEXP_INVALID_CSP 0x0F
  562. #define LSEXP_INVALID_ASSOC_HDR 0x11
  563. #define LSEXP_ASSOC_HDR_REQ 0x13
  564. #define LSEXP_INVALID_O_SID 0x15
  565. #define LSEXP_INVALID_OX_RX 0x17
  566. #define LSEXP_CMD_IN_PROGRESS 0x19
  567. #define LSEXP_PORT_LOGIN_REQ 0x1E
  568. #define LSEXP_INVALID_NPORT_ID 0x1F
  569. #define LSEXP_INVALID_SEQ_ID 0x21
  570. #define LSEXP_INVALID_XCHG 0x23
  571. #define LSEXP_INACTIVE_XCHG 0x25
  572. #define LSEXP_RQ_REQUIRED 0x27
  573. #define LSEXP_OUT_OF_RESOURCE 0x29
  574. #define LSEXP_CANT_GIVE_DATA 0x2A
  575. #define LSEXP_REQ_UNSUPPORTED 0x2C
  576. uint8_t vendorUnique; /* FC Word 0, bit 0: 7 */
  577. } b;
  578. } un;
  579. };
  580. /*
  581. * N_Port Login (FLOGO/PLOGO Request) Payload Definition
  582. */
  583. typedef struct _LOGO { /* Structure is in Big Endian format */
  584. union {
  585. uint32_t nPortId32; /* Access nPortId as a word */
  586. struct {
  587. uint8_t word1Reserved1; /* FC Word 1, bit 31:24 */
  588. uint8_t nPortIdByte0; /* N_port ID bit 16:23 */
  589. uint8_t nPortIdByte1; /* N_port ID bit 8:15 */
  590. uint8_t nPortIdByte2; /* N_port ID bit 0: 7 */
  591. } b;
  592. } un;
  593. struct lpfc_name portName; /* N_port name field */
  594. } LOGO;
  595. /*
  596. * FCP Login (PRLI Request / ACC) Payload Definition
  597. */
  598. #define PRLX_PAGE_LEN 0x10
  599. #define TPRLO_PAGE_LEN 0x14
  600. typedef struct _PRLI { /* Structure is in Big Endian format */
  601. uint8_t prliType; /* FC Parm Word 0, bit 24:31 */
  602. #define PRLI_FCP_TYPE 0x08
  603. uint8_t word0Reserved1; /* FC Parm Word 0, bit 16:23 */
  604. #ifdef __BIG_ENDIAN_BITFIELD
  605. uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */
  606. uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */
  607. uint8_t estabImagePair:1; /* FC Parm Word 0, bit 13 */
  608. /* ACC = imagePairEstablished */
  609. uint8_t word0Reserved2:1; /* FC Parm Word 0, bit 12 */
  610. uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, ACC ONLY */
  611. #else /* __LITTLE_ENDIAN_BITFIELD */
  612. uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, ACC ONLY */
  613. uint8_t word0Reserved2:1; /* FC Parm Word 0, bit 12 */
  614. uint8_t estabImagePair:1; /* FC Parm Word 0, bit 13 */
  615. uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */
  616. uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */
  617. /* ACC = imagePairEstablished */
  618. #endif
  619. #define PRLI_REQ_EXECUTED 0x1 /* acceptRspCode */
  620. #define PRLI_NO_RESOURCES 0x2
  621. #define PRLI_INIT_INCOMPLETE 0x3
  622. #define PRLI_NO_SUCH_PA 0x4
  623. #define PRLI_PREDEF_CONFIG 0x5
  624. #define PRLI_PARTIAL_SUCCESS 0x6
  625. #define PRLI_INVALID_PAGE_CNT 0x7
  626. uint8_t word0Reserved3; /* FC Parm Word 0, bit 0:7 */
  627. uint32_t origProcAssoc; /* FC Parm Word 1, bit 0:31 */
  628. uint32_t respProcAssoc; /* FC Parm Word 2, bit 0:31 */
  629. uint8_t word3Reserved1; /* FC Parm Word 3, bit 24:31 */
  630. uint8_t word3Reserved2; /* FC Parm Word 3, bit 16:23 */
  631. #ifdef __BIG_ENDIAN_BITFIELD
  632. uint16_t Word3bit15Resved:1; /* FC Parm Word 3, bit 15 */
  633. uint16_t Word3bit14Resved:1; /* FC Parm Word 3, bit 14 */
  634. uint16_t Word3bit13Resved:1; /* FC Parm Word 3, bit 13 */
  635. uint16_t Word3bit12Resved:1; /* FC Parm Word 3, bit 12 */
  636. uint16_t Word3bit11Resved:1; /* FC Parm Word 3, bit 11 */
  637. uint16_t Word3bit10Resved:1; /* FC Parm Word 3, bit 10 */
  638. uint16_t TaskRetryIdReq:1; /* FC Parm Word 3, bit 9 */
  639. uint16_t Retry:1; /* FC Parm Word 3, bit 8 */
  640. uint16_t ConfmComplAllowed:1; /* FC Parm Word 3, bit 7 */
  641. uint16_t dataOverLay:1; /* FC Parm Word 3, bit 6 */
  642. uint16_t initiatorFunc:1; /* FC Parm Word 3, bit 5 */
  643. uint16_t targetFunc:1; /* FC Parm Word 3, bit 4 */
  644. uint16_t cmdDataMixEna:1; /* FC Parm Word 3, bit 3 */
  645. uint16_t dataRspMixEna:1; /* FC Parm Word 3, bit 2 */
  646. uint16_t readXferRdyDis:1; /* FC Parm Word 3, bit 1 */
  647. uint16_t writeXferRdyDis:1; /* FC Parm Word 3, bit 0 */
  648. #else /* __LITTLE_ENDIAN_BITFIELD */
  649. uint16_t Retry:1; /* FC Parm Word 3, bit 8 */
  650. uint16_t TaskRetryIdReq:1; /* FC Parm Word 3, bit 9 */
  651. uint16_t Word3bit10Resved:1; /* FC Parm Word 3, bit 10 */
  652. uint16_t Word3bit11Resved:1; /* FC Parm Word 3, bit 11 */
  653. uint16_t Word3bit12Resved:1; /* FC Parm Word 3, bit 12 */
  654. uint16_t Word3bit13Resved:1; /* FC Parm Word 3, bit 13 */
  655. uint16_t Word3bit14Resved:1; /* FC Parm Word 3, bit 14 */
  656. uint16_t Word3bit15Resved:1; /* FC Parm Word 3, bit 15 */
  657. uint16_t writeXferRdyDis:1; /* FC Parm Word 3, bit 0 */
  658. uint16_t readXferRdyDis:1; /* FC Parm Word 3, bit 1 */
  659. uint16_t dataRspMixEna:1; /* FC Parm Word 3, bit 2 */
  660. uint16_t cmdDataMixEna:1; /* FC Parm Word 3, bit 3 */
  661. uint16_t targetFunc:1; /* FC Parm Word 3, bit 4 */
  662. uint16_t initiatorFunc:1; /* FC Parm Word 3, bit 5 */
  663. uint16_t dataOverLay:1; /* FC Parm Word 3, bit 6 */
  664. uint16_t ConfmComplAllowed:1; /* FC Parm Word 3, bit 7 */
  665. #endif
  666. } PRLI;
  667. /*
  668. * FCP Logout (PRLO Request / ACC) Payload Definition
  669. */
  670. typedef struct _PRLO { /* Structure is in Big Endian format */
  671. uint8_t prloType; /* FC Parm Word 0, bit 24:31 */
  672. #define PRLO_FCP_TYPE 0x08
  673. uint8_t word0Reserved1; /* FC Parm Word 0, bit 16:23 */
  674. #ifdef __BIG_ENDIAN_BITFIELD
  675. uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */
  676. uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */
  677. uint8_t word0Reserved2:2; /* FC Parm Word 0, bit 12:13 */
  678. uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, ACC ONLY */
  679. #else /* __LITTLE_ENDIAN_BITFIELD */
  680. uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, ACC ONLY */
  681. uint8_t word0Reserved2:2; /* FC Parm Word 0, bit 12:13 */
  682. uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */
  683. uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */
  684. #endif
  685. #define PRLO_REQ_EXECUTED 0x1 /* acceptRspCode */
  686. #define PRLO_NO_SUCH_IMAGE 0x4
  687. #define PRLO_INVALID_PAGE_CNT 0x7
  688. uint8_t word0Reserved3; /* FC Parm Word 0, bit 0:7 */
  689. uint32_t origProcAssoc; /* FC Parm Word 1, bit 0:31 */
  690. uint32_t respProcAssoc; /* FC Parm Word 2, bit 0:31 */
  691. uint32_t word3Reserved1; /* FC Parm Word 3, bit 0:31 */
  692. } PRLO;
  693. typedef struct _ADISC { /* Structure is in Big Endian format */
  694. uint32_t hardAL_PA;
  695. struct lpfc_name portName;
  696. struct lpfc_name nodeName;
  697. uint32_t DID;
  698. } ADISC;
  699. typedef struct _FARP { /* Structure is in Big Endian format */
  700. uint32_t Mflags:8;
  701. uint32_t Odid:24;
  702. #define FARP_NO_ACTION 0 /* FARP information enclosed, no
  703. action */
  704. #define FARP_MATCH_PORT 0x1 /* Match on Responder Port Name */
  705. #define FARP_MATCH_NODE 0x2 /* Match on Responder Node Name */
  706. #define FARP_MATCH_IP 0x4 /* Match on IP address, not supported */
  707. #define FARP_MATCH_IPV4 0x5 /* Match on IPV4 address, not
  708. supported */
  709. #define FARP_MATCH_IPV6 0x6 /* Match on IPV6 address, not
  710. supported */
  711. uint32_t Rflags:8;
  712. uint32_t Rdid:24;
  713. #define FARP_REQUEST_PLOGI 0x1 /* Request for PLOGI */
  714. #define FARP_REQUEST_FARPR 0x2 /* Request for FARP Response */
  715. struct lpfc_name OportName;
  716. struct lpfc_name OnodeName;
  717. struct lpfc_name RportName;
  718. struct lpfc_name RnodeName;
  719. uint8_t Oipaddr[16];
  720. uint8_t Ripaddr[16];
  721. } FARP;
  722. typedef struct _FAN { /* Structure is in Big Endian format */
  723. uint32_t Fdid;
  724. struct lpfc_name FportName;
  725. struct lpfc_name FnodeName;
  726. } FAN;
  727. typedef struct _SCR { /* Structure is in Big Endian format */
  728. uint8_t resvd1;
  729. uint8_t resvd2;
  730. uint8_t resvd3;
  731. uint8_t Function;
  732. #define SCR_FUNC_FABRIC 0x01
  733. #define SCR_FUNC_NPORT 0x02
  734. #define SCR_FUNC_FULL 0x03
  735. #define SCR_CLEAR 0xff
  736. } SCR;
  737. typedef struct _RNID_TOP_DISC {
  738. struct lpfc_name portName;
  739. uint8_t resvd[8];
  740. uint32_t unitType;
  741. #define RNID_HBA 0x7
  742. #define RNID_HOST 0xa
  743. #define RNID_DRIVER 0xd
  744. uint32_t physPort;
  745. uint32_t attachedNodes;
  746. uint16_t ipVersion;
  747. #define RNID_IPV4 0x1
  748. #define RNID_IPV6 0x2
  749. uint16_t UDPport;
  750. uint8_t ipAddr[16];
  751. uint16_t resvd1;
  752. uint16_t flags;
  753. #define RNID_TD_SUPPORT 0x1
  754. #define RNID_LP_VALID 0x2
  755. } RNID_TOP_DISC;
  756. typedef struct _RNID { /* Structure is in Big Endian format */
  757. uint8_t Format;
  758. #define RNID_TOPOLOGY_DISC 0xdf
  759. uint8_t CommonLen;
  760. uint8_t resvd1;
  761. uint8_t SpecificLen;
  762. struct lpfc_name portName;
  763. struct lpfc_name nodeName;
  764. union {
  765. RNID_TOP_DISC topologyDisc; /* topology disc (0xdf) */
  766. } un;
  767. } RNID;
  768. typedef struct _RPS { /* Structure is in Big Endian format */
  769. union {
  770. uint32_t portNum;
  771. struct lpfc_name portName;
  772. } un;
  773. } RPS;
  774. typedef struct _RPS_RSP { /* Structure is in Big Endian format */
  775. uint16_t rsvd1;
  776. uint16_t portStatus;
  777. uint32_t linkFailureCnt;
  778. uint32_t lossSyncCnt;
  779. uint32_t lossSignalCnt;
  780. uint32_t primSeqErrCnt;
  781. uint32_t invalidXmitWord;
  782. uint32_t crcCnt;
  783. } RPS_RSP;
  784. struct RLS { /* Structure is in Big Endian format */
  785. uint32_t rls;
  786. #define rls_rsvd_SHIFT 24
  787. #define rls_rsvd_MASK 0x000000ff
  788. #define rls_rsvd_WORD rls
  789. #define rls_did_SHIFT 0
  790. #define rls_did_MASK 0x00ffffff
  791. #define rls_did_WORD rls
  792. };
  793. struct RLS_RSP { /* Structure is in Big Endian format */
  794. uint32_t linkFailureCnt;
  795. uint32_t lossSyncCnt;
  796. uint32_t lossSignalCnt;
  797. uint32_t primSeqErrCnt;
  798. uint32_t invalidXmitWord;
  799. uint32_t crcCnt;
  800. };
  801. struct RRQ { /* Structure is in Big Endian format */
  802. uint32_t rrq;
  803. #define rrq_rsvd_SHIFT 24
  804. #define rrq_rsvd_MASK 0x000000ff
  805. #define rrq_rsvd_WORD rrq
  806. #define rrq_did_SHIFT 0
  807. #define rrq_did_MASK 0x00ffffff
  808. #define rrq_did_WORD rrq
  809. uint32_t rrq_exchg;
  810. #define rrq_oxid_SHIFT 16
  811. #define rrq_oxid_MASK 0xffff
  812. #define rrq_oxid_WORD rrq_exchg
  813. #define rrq_rxid_SHIFT 0
  814. #define rrq_rxid_MASK 0xffff
  815. #define rrq_rxid_WORD rrq_exchg
  816. };
  817. #define LPFC_MAX_VFN_PER_PFN 255 /* Maximum VFs allowed per ARI */
  818. #define LPFC_DEF_VFN_PER_PFN 0 /* Default VFs due to platform limitation*/
  819. struct RTV_RSP { /* Structure is in Big Endian format */
  820. uint32_t ratov;
  821. uint32_t edtov;
  822. uint32_t qtov;
  823. #define qtov_rsvd0_SHIFT 28
  824. #define qtov_rsvd0_MASK 0x0000000f
  825. #define qtov_rsvd0_WORD qtov /* reserved */
  826. #define qtov_edtovres_SHIFT 27
  827. #define qtov_edtovres_MASK 0x00000001
  828. #define qtov_edtovres_WORD qtov /* E_D_TOV Resolution */
  829. #define qtov__rsvd1_SHIFT 19
  830. #define qtov_rsvd1_MASK 0x0000003f
  831. #define qtov_rsvd1_WORD qtov /* reserved */
  832. #define qtov_rttov_SHIFT 18
  833. #define qtov_rttov_MASK 0x00000001
  834. #define qtov_rttov_WORD qtov /* R_T_TOV value */
  835. #define qtov_rsvd2_SHIFT 0
  836. #define qtov_rsvd2_MASK 0x0003ffff
  837. #define qtov_rsvd2_WORD qtov /* reserved */
  838. };
  839. typedef struct _RPL { /* Structure is in Big Endian format */
  840. uint32_t maxsize;
  841. uint32_t index;
  842. } RPL;
  843. typedef struct _PORT_NUM_BLK {
  844. uint32_t portNum;
  845. uint32_t portID;
  846. struct lpfc_name portName;
  847. } PORT_NUM_BLK;
  848. typedef struct _RPL_RSP { /* Structure is in Big Endian format */
  849. uint32_t listLen;
  850. uint32_t index;
  851. PORT_NUM_BLK port_num_blk;
  852. } RPL_RSP;
  853. /* This is used for RSCN command */
  854. typedef struct _D_ID { /* Structure is in Big Endian format */
  855. union {
  856. uint32_t word;
  857. struct {
  858. #ifdef __BIG_ENDIAN_BITFIELD
  859. uint8_t resv;
  860. uint8_t domain;
  861. uint8_t area;
  862. uint8_t id;
  863. #else /* __LITTLE_ENDIAN_BITFIELD */
  864. uint8_t id;
  865. uint8_t area;
  866. uint8_t domain;
  867. uint8_t resv;
  868. #endif
  869. } b;
  870. } un;
  871. } D_ID;
  872. #define RSCN_ADDRESS_FORMAT_PORT 0x0
  873. #define RSCN_ADDRESS_FORMAT_AREA 0x1
  874. #define RSCN_ADDRESS_FORMAT_DOMAIN 0x2
  875. #define RSCN_ADDRESS_FORMAT_FABRIC 0x3
  876. #define RSCN_ADDRESS_FORMAT_MASK 0x3
  877. /*
  878. * Structure to define all ELS Payload types
  879. */
  880. typedef struct _ELS_PKT { /* Structure is in Big Endian format */
  881. uint8_t elsCode; /* FC Word 0, bit 24:31 */
  882. uint8_t elsByte1;
  883. uint8_t elsByte2;
  884. uint8_t elsByte3;
  885. union {
  886. struct ls_rjt lsRjt; /* Payload for LS_RJT ELS response */
  887. struct serv_parm logi; /* Payload for PLOGI/FLOGI/PDISC/ACC */
  888. LOGO logo; /* Payload for PLOGO/FLOGO/ACC */
  889. PRLI prli; /* Payload for PRLI/ACC */
  890. PRLO prlo; /* Payload for PRLO/ACC */
  891. ADISC adisc; /* Payload for ADISC/ACC */
  892. FARP farp; /* Payload for FARP/ACC */
  893. FAN fan; /* Payload for FAN */
  894. SCR scr; /* Payload for SCR/ACC */
  895. RNID rnid; /* Payload for RNID */
  896. uint8_t pad[128 - 4]; /* Pad out to payload of 128 bytes */
  897. } un;
  898. } ELS_PKT;
  899. /*
  900. * FDMI
  901. * HBA MAnagement Operations Command Codes
  902. */
  903. #define SLI_MGMT_GRHL 0x100 /* Get registered HBA list */
  904. #define SLI_MGMT_GHAT 0x101 /* Get HBA attributes */
  905. #define SLI_MGMT_GRPL 0x102 /* Get registered Port list */
  906. #define SLI_MGMT_GPAT 0x110 /* Get Port attributes */
  907. #define SLI_MGMT_RHBA 0x200 /* Register HBA */
  908. #define SLI_MGMT_RHAT 0x201 /* Register HBA attributes */
  909. #define SLI_MGMT_RPRT 0x210 /* Register Port */
  910. #define SLI_MGMT_RPA 0x211 /* Register Port attributes */
  911. #define SLI_MGMT_DHBA 0x300 /* De-register HBA */
  912. #define SLI_MGMT_DPRT 0x310 /* De-register Port */
  913. /*
  914. * Management Service Subtypes
  915. */
  916. #define SLI_CT_FDMI_Subtypes 0x10
  917. /*
  918. * HBA Management Service Reject Code
  919. */
  920. #define REJECT_CODE 0x9 /* Unable to perform command request */
  921. /*
  922. * HBA Management Service Reject Reason Code
  923. * Please refer to the Reason Codes above
  924. */
  925. /*
  926. * HBA Attribute Types
  927. */
  928. #define NODE_NAME 0x1
  929. #define MANUFACTURER 0x2
  930. #define SERIAL_NUMBER 0x3
  931. #define MODEL 0x4
  932. #define MODEL_DESCRIPTION 0x5
  933. #define HARDWARE_VERSION 0x6
  934. #define DRIVER_VERSION 0x7
  935. #define OPTION_ROM_VERSION 0x8
  936. #define FIRMWARE_VERSION 0x9
  937. #define OS_NAME_VERSION 0xa
  938. #define MAX_CT_PAYLOAD_LEN 0xb
  939. /*
  940. * Port Attrubute Types
  941. */
  942. #define SUPPORTED_FC4_TYPES 0x1
  943. #define SUPPORTED_SPEED 0x2
  944. #define PORT_SPEED 0x3
  945. #define MAX_FRAME_SIZE 0x4
  946. #define OS_DEVICE_NAME 0x5
  947. #define HOST_NAME 0x6
  948. union AttributesDef {
  949. /* Structure is in Big Endian format */
  950. struct {
  951. uint32_t AttrType:16;
  952. uint32_t AttrLen:16;
  953. } bits;
  954. uint32_t word;
  955. };
  956. /*
  957. * HBA Attribute Entry (8 - 260 bytes)
  958. */
  959. typedef struct {
  960. union AttributesDef ad;
  961. union {
  962. uint32_t VendorSpecific;
  963. uint8_t Manufacturer[64];
  964. uint8_t SerialNumber[64];
  965. uint8_t Model[256];
  966. uint8_t ModelDescription[256];
  967. uint8_t HardwareVersion[256];
  968. uint8_t DriverVersion[256];
  969. uint8_t OptionROMVersion[256];
  970. uint8_t FirmwareVersion[256];
  971. struct lpfc_name NodeName;
  972. uint8_t SupportFC4Types[32];
  973. uint32_t SupportSpeed;
  974. uint32_t PortSpeed;
  975. uint32_t MaxFrameSize;
  976. uint8_t OsDeviceName[256];
  977. uint8_t OsNameVersion[256];
  978. uint32_t MaxCTPayloadLen;
  979. uint8_t HostName[256];
  980. } un;
  981. } ATTRIBUTE_ENTRY;
  982. /*
  983. * HBA Attribute Block
  984. */
  985. typedef struct {
  986. uint32_t EntryCnt; /* Number of HBA attribute entries */
  987. ATTRIBUTE_ENTRY Entry; /* Variable-length array */
  988. } ATTRIBUTE_BLOCK;
  989. /*
  990. * Port Entry
  991. */
  992. typedef struct {
  993. struct lpfc_name PortName;
  994. } PORT_ENTRY;
  995. /*
  996. * HBA Identifier
  997. */
  998. typedef struct {
  999. struct lpfc_name PortName;
  1000. } HBA_IDENTIFIER;
  1001. /*
  1002. * Registered Port List Format
  1003. */
  1004. typedef struct {
  1005. uint32_t EntryCnt;
  1006. PORT_ENTRY pe; /* Variable-length array */
  1007. } REG_PORT_LIST;
  1008. /*
  1009. * Register HBA(RHBA)
  1010. */
  1011. typedef struct {
  1012. HBA_IDENTIFIER hi;
  1013. REG_PORT_LIST rpl; /* variable-length array */
  1014. /* ATTRIBUTE_BLOCK ab; */
  1015. } REG_HBA;
  1016. /*
  1017. * Register HBA Attributes (RHAT)
  1018. */
  1019. typedef struct {
  1020. struct lpfc_name HBA_PortName;
  1021. ATTRIBUTE_BLOCK ab;
  1022. } REG_HBA_ATTRIBUTE;
  1023. /*
  1024. * Register Port Attributes (RPA)
  1025. */
  1026. typedef struct {
  1027. struct lpfc_name PortName;
  1028. ATTRIBUTE_BLOCK ab;
  1029. } REG_PORT_ATTRIBUTE;
  1030. /*
  1031. * Get Registered HBA List (GRHL) Accept Payload Format
  1032. */
  1033. typedef struct {
  1034. uint32_t HBA__Entry_Cnt; /* Number of Registered HBA Identifiers */
  1035. struct lpfc_name HBA_PortName; /* Variable-length array */
  1036. } GRHL_ACC_PAYLOAD;
  1037. /*
  1038. * Get Registered Port List (GRPL) Accept Payload Format
  1039. */
  1040. typedef struct {
  1041. uint32_t RPL_Entry_Cnt; /* Number of Registered Port Entries */
  1042. PORT_ENTRY Reg_Port_Entry[1]; /* Variable-length array */
  1043. } GRPL_ACC_PAYLOAD;
  1044. /*
  1045. * Get Port Attributes (GPAT) Accept Payload Format
  1046. */
  1047. typedef struct {
  1048. ATTRIBUTE_BLOCK pab;
  1049. } GPAT_ACC_PAYLOAD;
  1050. /*
  1051. * Begin HBA configuration parameters.
  1052. * The PCI configuration register BAR assignments are:
  1053. * BAR0, offset 0x10 - SLIM base memory address
  1054. * BAR1, offset 0x14 - SLIM base memory high address
  1055. * BAR2, offset 0x18 - REGISTER base memory address
  1056. * BAR3, offset 0x1c - REGISTER base memory high address
  1057. * BAR4, offset 0x20 - BIU I/O registers
  1058. * BAR5, offset 0x24 - REGISTER base io high address
  1059. */
  1060. /* Number of rings currently used and available. */
  1061. #define MAX_CONFIGURED_RINGS 3
  1062. #define MAX_RINGS 4
  1063. /* IOCB / Mailbox is owned by FireFly */
  1064. #define OWN_CHIP 1
  1065. /* IOCB / Mailbox is owned by Host */
  1066. #define OWN_HOST 0
  1067. /* Number of 4-byte words in an IOCB. */
  1068. #define IOCB_WORD_SZ 8
  1069. /* network headers for Dfctl field */
  1070. #define FC_NET_HDR 0x20
  1071. /* Start FireFly Register definitions */
  1072. #define PCI_VENDOR_ID_EMULEX 0x10df
  1073. #define PCI_DEVICE_ID_FIREFLY 0x1ae5
  1074. #define PCI_DEVICE_ID_PROTEUS_VF 0xe100
  1075. #define PCI_DEVICE_ID_BALIUS 0xe131
  1076. #define PCI_DEVICE_ID_PROTEUS_PF 0xe180
  1077. #define PCI_DEVICE_ID_LANCER_FC 0xe200
  1078. #define PCI_DEVICE_ID_LANCER_FC_VF 0xe208
  1079. #define PCI_DEVICE_ID_LANCER_FCOE 0xe260
  1080. #define PCI_DEVICE_ID_LANCER_FCOE_VF 0xe268
  1081. #define PCI_DEVICE_ID_SAT_SMB 0xf011
  1082. #define PCI_DEVICE_ID_SAT_MID 0xf015
  1083. #define PCI_DEVICE_ID_RFLY 0xf095
  1084. #define PCI_DEVICE_ID_PFLY 0xf098
  1085. #define PCI_DEVICE_ID_LP101 0xf0a1
  1086. #define PCI_DEVICE_ID_TFLY 0xf0a5
  1087. #define PCI_DEVICE_ID_BSMB 0xf0d1
  1088. #define PCI_DEVICE_ID_BMID 0xf0d5
  1089. #define PCI_DEVICE_ID_ZSMB 0xf0e1
  1090. #define PCI_DEVICE_ID_ZMID 0xf0e5
  1091. #define PCI_DEVICE_ID_NEPTUNE 0xf0f5
  1092. #define PCI_DEVICE_ID_NEPTUNE_SCSP 0xf0f6
  1093. #define PCI_DEVICE_ID_NEPTUNE_DCSP 0xf0f7
  1094. #define PCI_DEVICE_ID_SAT 0xf100
  1095. #define PCI_DEVICE_ID_SAT_SCSP 0xf111
  1096. #define PCI_DEVICE_ID_SAT_DCSP 0xf112
  1097. #define PCI_DEVICE_ID_FALCON 0xf180
  1098. #define PCI_DEVICE_ID_SUPERFLY 0xf700
  1099. #define PCI_DEVICE_ID_DRAGONFLY 0xf800
  1100. #define PCI_DEVICE_ID_CENTAUR 0xf900
  1101. #define PCI_DEVICE_ID_PEGASUS 0xf980
  1102. #define PCI_DEVICE_ID_THOR 0xfa00
  1103. #define PCI_DEVICE_ID_VIPER 0xfb00
  1104. #define PCI_DEVICE_ID_LP10000S 0xfc00
  1105. #define PCI_DEVICE_ID_LP11000S 0xfc10
  1106. #define PCI_DEVICE_ID_LPE11000S 0xfc20
  1107. #define PCI_DEVICE_ID_SAT_S 0xfc40
  1108. #define PCI_DEVICE_ID_PROTEUS_S 0xfc50
  1109. #define PCI_DEVICE_ID_HELIOS 0xfd00
  1110. #define PCI_DEVICE_ID_HELIOS_SCSP 0xfd11
  1111. #define PCI_DEVICE_ID_HELIOS_DCSP 0xfd12
  1112. #define PCI_DEVICE_ID_ZEPHYR 0xfe00
  1113. #define PCI_DEVICE_ID_HORNET 0xfe05
  1114. #define PCI_DEVICE_ID_ZEPHYR_SCSP 0xfe11
  1115. #define PCI_DEVICE_ID_ZEPHYR_DCSP 0xfe12
  1116. #define PCI_VENDOR_ID_SERVERENGINE 0x19a2
  1117. #define PCI_DEVICE_ID_TIGERSHARK 0x0704
  1118. #define PCI_DEVICE_ID_TOMCAT 0x0714
  1119. #define JEDEC_ID_ADDRESS 0x0080001c
  1120. #define FIREFLY_JEDEC_ID 0x1ACC
  1121. #define SUPERFLY_JEDEC_ID 0x0020
  1122. #define DRAGONFLY_JEDEC_ID 0x0021
  1123. #define DRAGONFLY_V2_JEDEC_ID 0x0025
  1124. #define CENTAUR_2G_JEDEC_ID 0x0026
  1125. #define CENTAUR_1G_JEDEC_ID 0x0028
  1126. #define PEGASUS_ORION_JEDEC_ID 0x0036
  1127. #define PEGASUS_JEDEC_ID 0x0038
  1128. #define THOR_JEDEC_ID 0x0012
  1129. #define HELIOS_JEDEC_ID 0x0364
  1130. #define ZEPHYR_JEDEC_ID 0x0577
  1131. #define VIPER_JEDEC_ID 0x4838
  1132. #define SATURN_JEDEC_ID 0x1004
  1133. #define HORNET_JDEC_ID 0x2057706D
  1134. #define JEDEC_ID_MASK 0x0FFFF000
  1135. #define JEDEC_ID_SHIFT 12
  1136. #define FC_JEDEC_ID(id) ((id & JEDEC_ID_MASK) >> JEDEC_ID_SHIFT)
  1137. typedef struct { /* FireFly BIU registers */
  1138. uint32_t hostAtt; /* See definitions for Host Attention
  1139. register */
  1140. uint32_t chipAtt; /* See definitions for Chip Attention
  1141. register */
  1142. uint32_t hostStatus; /* See definitions for Host Status register */
  1143. uint32_t hostControl; /* See definitions for Host Control register */
  1144. uint32_t buiConfig; /* See definitions for BIU configuration
  1145. register */
  1146. } FF_REGS;
  1147. /* IO Register size in bytes */
  1148. #define FF_REG_AREA_SIZE 256
  1149. /* Host Attention Register */
  1150. #define HA_REG_OFFSET 0 /* Byte offset from register base address */
  1151. #define HA_R0RE_REQ 0x00000001 /* Bit 0 */
  1152. #define HA_R0CE_RSP 0x00000002 /* Bit 1 */
  1153. #define HA_R0ATT 0x00000008 /* Bit 3 */
  1154. #define HA_R1RE_REQ 0x00000010 /* Bit 4 */
  1155. #define HA_R1CE_RSP 0x00000020 /* Bit 5 */
  1156. #define HA_R1ATT 0x00000080 /* Bit 7 */
  1157. #define HA_R2RE_REQ 0x00000100 /* Bit 8 */
  1158. #define HA_R2CE_RSP 0x00000200 /* Bit 9 */
  1159. #define HA_R2ATT 0x00000800 /* Bit 11 */
  1160. #define HA_R3RE_REQ 0x00001000 /* Bit 12 */
  1161. #define HA_R3CE_RSP 0x00002000 /* Bit 13 */
  1162. #define HA_R3ATT 0x00008000 /* Bit 15 */
  1163. #define HA_LATT 0x20000000 /* Bit 29 */
  1164. #define HA_MBATT 0x40000000 /* Bit 30 */
  1165. #define HA_ERATT 0x80000000 /* Bit 31 */
  1166. #define HA_RXRE_REQ 0x00000001 /* Bit 0 */
  1167. #define HA_RXCE_RSP 0x00000002 /* Bit 1 */
  1168. #define HA_RXATT 0x00000008 /* Bit 3 */
  1169. #define HA_RXMASK 0x0000000f
  1170. #define HA_R0_CLR_MSK (HA_R0RE_REQ | HA_R0CE_RSP | HA_R0ATT)
  1171. #define HA_R1_CLR_MSK (HA_R1RE_REQ | HA_R1CE_RSP | HA_R1ATT)
  1172. #define HA_R2_CLR_MSK (HA_R2RE_REQ | HA_R2CE_RSP | HA_R2ATT)
  1173. #define HA_R3_CLR_MSK (HA_R3RE_REQ | HA_R3CE_RSP | HA_R3ATT)
  1174. #define HA_R0_POS 3
  1175. #define HA_R1_POS 7
  1176. #define HA_R2_POS 11
  1177. #define HA_R3_POS 15
  1178. #define HA_LE_POS 29
  1179. #define HA_MB_POS 30
  1180. #define HA_ER_POS 31
  1181. /* Chip Attention Register */
  1182. #define CA_REG_OFFSET 4 /* Byte offset from register base address */
  1183. #define CA_R0CE_REQ 0x00000001 /* Bit 0 */
  1184. #define CA_R0RE_RSP 0x00000002 /* Bit 1 */
  1185. #define CA_R0ATT 0x00000008 /* Bit 3 */
  1186. #define CA_R1CE_REQ 0x00000010 /* Bit 4 */
  1187. #define CA_R1RE_RSP 0x00000020 /* Bit 5 */
  1188. #define CA_R1ATT 0x00000080 /* Bit 7 */
  1189. #define CA_R2CE_REQ 0x00000100 /* Bit 8 */
  1190. #define CA_R2RE_RSP 0x00000200 /* Bit 9 */
  1191. #define CA_R2ATT 0x00000800 /* Bit 11 */
  1192. #define CA_R3CE_REQ 0x00001000 /* Bit 12 */
  1193. #define CA_R3RE_RSP 0x00002000 /* Bit 13 */
  1194. #define CA_R3ATT 0x00008000 /* Bit 15 */
  1195. #define CA_MBATT 0x40000000 /* Bit 30 */
  1196. /* Host Status Register */
  1197. #define HS_REG_OFFSET 8 /* Byte offset from register base address */
  1198. #define HS_MBRDY 0x00400000 /* Bit 22 */
  1199. #define HS_FFRDY 0x00800000 /* Bit 23 */
  1200. #define HS_FFER8 0x01000000 /* Bit 24 */
  1201. #define HS_FFER7 0x02000000 /* Bit 25 */
  1202. #define HS_FFER6 0x04000000 /* Bit 26 */
  1203. #define HS_FFER5 0x08000000 /* Bit 27 */
  1204. #define HS_FFER4 0x10000000 /* Bit 28 */
  1205. #define HS_FFER3 0x20000000 /* Bit 29 */
  1206. #define HS_FFER2 0x40000000 /* Bit 30 */
  1207. #define HS_FFER1 0x80000000 /* Bit 31 */
  1208. #define HS_CRIT_TEMP 0x00000100 /* Bit 8 */
  1209. #define HS_FFERM 0xFF000100 /* Mask for error bits 31:24 and 8 */
  1210. #define UNPLUG_ERR 0x00000001 /* Indicate pci hot unplug */
  1211. /* Host Control Register */
  1212. #define HC_REG_OFFSET 12 /* Byte offset from register base address */
  1213. #define HC_MBINT_ENA 0x00000001 /* Bit 0 */
  1214. #define HC_R0INT_ENA 0x00000002 /* Bit 1 */
  1215. #define HC_R1INT_ENA 0x00000004 /* Bit 2 */
  1216. #define HC_R2INT_ENA 0x00000008 /* Bit 3 */
  1217. #define HC_R3INT_ENA 0x00000010 /* Bit 4 */
  1218. #define HC_INITHBI 0x02000000 /* Bit 25 */
  1219. #define HC_INITMB 0x04000000 /* Bit 26 */
  1220. #define HC_INITFF 0x08000000 /* Bit 27 */
  1221. #define HC_LAINT_ENA 0x20000000 /* Bit 29 */
  1222. #define HC_ERINT_ENA 0x80000000 /* Bit 31 */
  1223. /* Message Signaled Interrupt eXtension (MSI-X) message identifiers */
  1224. #define MSIX_DFLT_ID 0
  1225. #define MSIX_RNG0_ID 0
  1226. #define MSIX_RNG1_ID 1
  1227. #define MSIX_RNG2_ID 2
  1228. #define MSIX_RNG3_ID 3
  1229. #define MSIX_LINK_ID 4
  1230. #define MSIX_MBOX_ID 5
  1231. #define MSIX_SPARE0_ID 6
  1232. #define MSIX_SPARE1_ID 7
  1233. /* Mailbox Commands */
  1234. #define MBX_SHUTDOWN 0x00 /* terminate testing */
  1235. #define MBX_LOAD_SM 0x01
  1236. #define MBX_READ_NV 0x02
  1237. #define MBX_WRITE_NV 0x03
  1238. #define MBX_RUN_BIU_DIAG 0x04
  1239. #define MBX_INIT_LINK 0x05
  1240. #define MBX_DOWN_LINK 0x06
  1241. #define MBX_CONFIG_LINK 0x07
  1242. #define MBX_CONFIG_RING 0x09
  1243. #define MBX_RESET_RING 0x0A
  1244. #define MBX_READ_CONFIG 0x0B
  1245. #define MBX_READ_RCONFIG 0x0C
  1246. #define MBX_READ_SPARM 0x0D
  1247. #define MBX_READ_STATUS 0x0E
  1248. #define MBX_READ_RPI 0x0F
  1249. #define MBX_READ_XRI 0x10
  1250. #define MBX_READ_REV 0x11
  1251. #define MBX_READ_LNK_STAT 0x12
  1252. #define MBX_REG_LOGIN 0x13
  1253. #define MBX_UNREG_LOGIN 0x14
  1254. #define MBX_CLEAR_LA 0x16
  1255. #define MBX_DUMP_MEMORY 0x17
  1256. #define MBX_DUMP_CONTEXT 0x18
  1257. #define MBX_RUN_DIAGS 0x19
  1258. #define MBX_RESTART 0x1A
  1259. #define MBX_UPDATE_CFG 0x1B
  1260. #define MBX_DOWN_LOAD 0x1C
  1261. #define MBX_DEL_LD_ENTRY 0x1D
  1262. #define MBX_RUN_PROGRAM 0x1E
  1263. #define MBX_SET_MASK 0x20
  1264. #define MBX_SET_VARIABLE 0x21
  1265. #define MBX_UNREG_D_ID 0x23
  1266. #define MBX_KILL_BOARD 0x24
  1267. #define MBX_CONFIG_FARP 0x25
  1268. #define MBX_BEACON 0x2A
  1269. #define MBX_CONFIG_MSI 0x30
  1270. #define MBX_HEARTBEAT 0x31
  1271. #define MBX_WRITE_VPARMS 0x32
  1272. #define MBX_ASYNCEVT_ENABLE 0x33
  1273. #define MBX_READ_EVENT_LOG_STATUS 0x37
  1274. #define MBX_READ_EVENT_LOG 0x38
  1275. #define MBX_WRITE_EVENT_LOG 0x39
  1276. #define MBX_PORT_CAPABILITIES 0x3B
  1277. #define MBX_PORT_IOV_CONTROL 0x3C
  1278. #define MBX_CONFIG_HBQ 0x7C
  1279. #define MBX_LOAD_AREA 0x81
  1280. #define MBX_RUN_BIU_DIAG64 0x84
  1281. #define MBX_CONFIG_PORT 0x88
  1282. #define MBX_READ_SPARM64 0x8D
  1283. #define MBX_READ_RPI64 0x8F
  1284. #define MBX_REG_LOGIN64 0x93
  1285. #define MBX_READ_TOPOLOGY 0x95
  1286. #define MBX_REG_VPI 0x96
  1287. #define MBX_UNREG_VPI 0x97
  1288. #define MBX_WRITE_WWN 0x98
  1289. #define MBX_SET_DEBUG 0x99
  1290. #define MBX_LOAD_EXP_ROM 0x9C
  1291. #define MBX_SLI4_CONFIG 0x9B
  1292. #define MBX_SLI4_REQ_FTRS 0x9D
  1293. #define MBX_MAX_CMDS 0x9E
  1294. #define MBX_RESUME_RPI 0x9E
  1295. #define MBX_SLI2_CMD_MASK 0x80
  1296. #define MBX_REG_VFI 0x9F
  1297. #define MBX_REG_FCFI 0xA0
  1298. #define MBX_UNREG_VFI 0xA1
  1299. #define MBX_UNREG_FCFI 0xA2
  1300. #define MBX_INIT_VFI 0xA3
  1301. #define MBX_INIT_VPI 0xA4
  1302. #define MBX_AUTH_PORT 0xF8
  1303. #define MBX_SECURITY_MGMT 0xF9
  1304. /* IOCB Commands */
  1305. #define CMD_RCV_SEQUENCE_CX 0x01
  1306. #define CMD_XMIT_SEQUENCE_CR 0x02
  1307. #define CMD_XMIT_SEQUENCE_CX 0x03
  1308. #define CMD_XMIT_BCAST_CN 0x04
  1309. #define CMD_XMIT_BCAST_CX 0x05
  1310. #define CMD_QUE_RING_BUF_CN 0x06
  1311. #define CMD_QUE_XRI_BUF_CX 0x07
  1312. #define CMD_IOCB_CONTINUE_CN 0x08
  1313. #define CMD_RET_XRI_BUF_CX 0x09
  1314. #define CMD_ELS_REQUEST_CR 0x0A
  1315. #define CMD_ELS_REQUEST_CX 0x0B
  1316. #define CMD_RCV_ELS_REQ_CX 0x0D
  1317. #define CMD_ABORT_XRI_CN 0x0E
  1318. #define CMD_ABORT_XRI_CX 0x0F
  1319. #define CMD_CLOSE_XRI_CN 0x10
  1320. #define CMD_CLOSE_XRI_CX 0x11
  1321. #define CMD_CREATE_XRI_CR 0x12
  1322. #define CMD_CREATE_XRI_CX 0x13
  1323. #define CMD_GET_RPI_CN 0x14
  1324. #define CMD_XMIT_ELS_RSP_CX 0x15
  1325. #define CMD_GET_RPI_CR 0x16
  1326. #define CMD_XRI_ABORTED_CX 0x17
  1327. #define CMD_FCP_IWRITE_CR 0x18
  1328. #define CMD_FCP_IWRITE_CX 0x19
  1329. #define CMD_FCP_IREAD_CR 0x1A
  1330. #define CMD_FCP_IREAD_CX 0x1B
  1331. #define CMD_FCP_ICMND_CR 0x1C
  1332. #define CMD_FCP_ICMND_CX 0x1D
  1333. #define CMD_FCP_TSEND_CX 0x1F
  1334. #define CMD_FCP_TRECEIVE_CX 0x21
  1335. #define CMD_FCP_TRSP_CX 0x23
  1336. #define CMD_FCP_AUTO_TRSP_CX 0x29
  1337. #define CMD_ADAPTER_MSG 0x20
  1338. #define CMD_ADAPTER_DUMP 0x22
  1339. /* SLI_2 IOCB Command Set */
  1340. #define CMD_ASYNC_STATUS 0x7C
  1341. #define CMD_RCV_SEQUENCE64_CX 0x81
  1342. #define CMD_XMIT_SEQUENCE64_CR 0x82
  1343. #define CMD_XMIT_SEQUENCE64_CX 0x83
  1344. #define CMD_XMIT_BCAST64_CN 0x84
  1345. #define CMD_XMIT_BCAST64_CX 0x85
  1346. #define CMD_QUE_RING_BUF64_CN 0x86
  1347. #define CMD_QUE_XRI_BUF64_CX 0x87
  1348. #define CMD_IOCB_CONTINUE64_CN 0x88
  1349. #define CMD_RET_XRI_BUF64_CX 0x89
  1350. #define CMD_ELS_REQUEST64_CR 0x8A
  1351. #define CMD_ELS_REQUEST64_CX 0x8B
  1352. #define CMD_ABORT_MXRI64_CN 0x8C
  1353. #define CMD_RCV_ELS_REQ64_CX 0x8D
  1354. #define CMD_XMIT_ELS_RSP64_CX 0x95
  1355. #define CMD_XMIT_BLS_RSP64_CX 0x97
  1356. #define CMD_FCP_IWRITE64_CR 0x98
  1357. #define CMD_FCP_IWRITE64_CX 0x99
  1358. #define CMD_FCP_IREAD64_CR 0x9A
  1359. #define CMD_FCP_IREAD64_CX 0x9B
  1360. #define CMD_FCP_ICMND64_CR 0x9C
  1361. #define CMD_FCP_ICMND64_CX 0x9D
  1362. #define CMD_FCP_TSEND64_CX 0x9F
  1363. #define CMD_FCP_TRECEIVE64_CX 0xA1
  1364. #define CMD_FCP_TRSP64_CX 0xA3
  1365. #define CMD_QUE_XRI64_CX 0xB3
  1366. #define CMD_IOCB_RCV_SEQ64_CX 0xB5
  1367. #define CMD_IOCB_RCV_ELS64_CX 0xB7
  1368. #define CMD_IOCB_RET_XRI64_CX 0xB9
  1369. #define CMD_IOCB_RCV_CONT64_CX 0xBB
  1370. #define CMD_GEN_REQUEST64_CR 0xC2
  1371. #define CMD_GEN_REQUEST64_CX 0xC3
  1372. /* Unhandled SLI-3 Commands */
  1373. #define CMD_IOCB_XMIT_MSEQ64_CR 0xB0
  1374. #define CMD_IOCB_XMIT_MSEQ64_CX 0xB1
  1375. #define CMD_IOCB_RCV_SEQ_LIST64_CX 0xC1
  1376. #define CMD_IOCB_RCV_ELS_LIST64_CX 0xCD
  1377. #define CMD_IOCB_CLOSE_EXTENDED_CN 0xB6
  1378. #define CMD_IOCB_ABORT_EXTENDED_CN 0xBA
  1379. #define CMD_IOCB_RET_HBQE64_CN 0xCA
  1380. #define CMD_IOCB_FCP_IBIDIR64_CR 0xAC
  1381. #define CMD_IOCB_FCP_IBIDIR64_CX 0xAD
  1382. #define CMD_IOCB_FCP_ITASKMGT64_CX 0xAF
  1383. #define CMD_IOCB_LOGENTRY_CN 0x94
  1384. #define CMD_IOCB_LOGENTRY_ASYNC_CN 0x96
  1385. /* Data Security SLI Commands */
  1386. #define DSSCMD_IWRITE64_CR 0xF8
  1387. #define DSSCMD_IWRITE64_CX 0xF9
  1388. #define DSSCMD_IREAD64_CR 0xFA
  1389. #define DSSCMD_IREAD64_CX 0xFB
  1390. #define CMD_MAX_IOCB_CMD 0xFB
  1391. #define CMD_IOCB_MASK 0xff
  1392. #define MAX_MSG_DATA 28 /* max msg data in CMD_ADAPTER_MSG
  1393. iocb */
  1394. #define LPFC_MAX_ADPTMSG 32 /* max msg data */
  1395. /*
  1396. * Define Status
  1397. */
  1398. #define MBX_SUCCESS 0
  1399. #define MBXERR_NUM_RINGS 1
  1400. #define MBXERR_NUM_IOCBS 2
  1401. #define MBXERR_IOCBS_EXCEEDED 3
  1402. #define MBXERR_BAD_RING_NUMBER 4
  1403. #define MBXERR_MASK_ENTRIES_RANGE 5
  1404. #define MBXERR_MASKS_EXCEEDED 6
  1405. #define MBXERR_BAD_PROFILE 7
  1406. #define MBXERR_BAD_DEF_CLASS 8
  1407. #define MBXERR_BAD_MAX_RESPONDER 9
  1408. #define MBXERR_BAD_MAX_ORIGINATOR 10
  1409. #define MBXERR_RPI_REGISTERED 11
  1410. #define MBXERR_RPI_FULL 12
  1411. #define MBXERR_NO_RESOURCES 13
  1412. #define MBXERR_BAD_RCV_LENGTH 14
  1413. #define MBXERR_DMA_ERROR 15
  1414. #define MBXERR_ERROR 16
  1415. #define MBXERR_LINK_DOWN 0x33
  1416. #define MBXERR_SEC_NO_PERMISSION 0xF02
  1417. #define MBX_NOT_FINISHED 255
  1418. #define MBX_BUSY 0xffffff /* Attempted cmd to busy Mailbox */
  1419. #define MBX_TIMEOUT 0xfffffe /* time-out expired waiting for */
  1420. #define TEMPERATURE_OFFSET 0xB0 /* Slim offset for critical temperature event */
  1421. /*
  1422. * Begin Structure Definitions for Mailbox Commands
  1423. */
  1424. typedef struct {
  1425. #ifdef __BIG_ENDIAN_BITFIELD
  1426. uint8_t tval;
  1427. uint8_t tmask;
  1428. uint8_t rval;
  1429. uint8_t rmask;
  1430. #else /* __LITTLE_ENDIAN_BITFIELD */
  1431. uint8_t rmask;
  1432. uint8_t rval;
  1433. uint8_t tmask;
  1434. uint8_t tval;
  1435. #endif
  1436. } RR_REG;
  1437. struct ulp_bde {
  1438. uint32_t bdeAddress;
  1439. #ifdef __BIG_ENDIAN_BITFIELD
  1440. uint32_t bdeReserved:4;
  1441. uint32_t bdeAddrHigh:4;
  1442. uint32_t bdeSize:24;
  1443. #else /* __LITTLE_ENDIAN_BITFIELD */
  1444. uint32_t bdeSize:24;
  1445. uint32_t bdeAddrHigh:4;
  1446. uint32_t bdeReserved:4;
  1447. #endif
  1448. };
  1449. typedef struct ULP_BDL { /* SLI-2 */
  1450. #ifdef __BIG_ENDIAN_BITFIELD
  1451. uint32_t bdeFlags:8; /* BDL Flags */
  1452. uint32_t bdeSize:24; /* Size of BDL array in host memory (bytes) */
  1453. #else /* __LITTLE_ENDIAN_BITFIELD */
  1454. uint32_t bdeSize:24; /* Size of BDL array in host memory (bytes) */
  1455. uint32_t bdeFlags:8; /* BDL Flags */
  1456. #endif
  1457. uint32_t addrLow; /* Address 0:31 */
  1458. uint32_t addrHigh; /* Address 32:63 */
  1459. uint32_t ulpIoTag32; /* Can be used for 32 bit I/O Tag */
  1460. } ULP_BDL;
  1461. /*
  1462. * BlockGuard Definitions
  1463. */
  1464. enum lpfc_protgrp_type {
  1465. LPFC_PG_TYPE_INVALID = 0, /* used to indicate errors */
  1466. LPFC_PG_TYPE_NO_DIF, /* no DIF data pointed to by prot grp */
  1467. LPFC_PG_TYPE_EMBD_DIF, /* DIF is embedded (inline) with data */
  1468. LPFC_PG_TYPE_DIF_BUF /* DIF has its own scatter/gather list */
  1469. };
  1470. /* PDE Descriptors */
  1471. #define LPFC_PDE5_DESCRIPTOR 0x85
  1472. #define LPFC_PDE6_DESCRIPTOR 0x86
  1473. #define LPFC_PDE7_DESCRIPTOR 0x87
  1474. /* BlockGuard Opcodes */
  1475. #define BG_OP_IN_NODIF_OUT_CRC 0x0
  1476. #define BG_OP_IN_CRC_OUT_NODIF 0x1
  1477. #define BG_OP_IN_NODIF_OUT_CSUM 0x2
  1478. #define BG_OP_IN_CSUM_OUT_NODIF 0x3
  1479. #define BG_OP_IN_CRC_OUT_CRC 0x4
  1480. #define BG_OP_IN_CSUM_OUT_CSUM 0x5
  1481. #define BG_OP_IN_CRC_OUT_CSUM 0x6
  1482. #define BG_OP_IN_CSUM_OUT_CRC 0x7
  1483. struct lpfc_pde5 {
  1484. uint32_t word0;
  1485. #define pde5_type_SHIFT 24
  1486. #define pde5_type_MASK 0x000000ff
  1487. #define pde5_type_WORD word0
  1488. #define pde5_rsvd0_SHIFT 0
  1489. #define pde5_rsvd0_MASK 0x00ffffff
  1490. #define pde5_rsvd0_WORD word0
  1491. uint32_t reftag; /* Reference Tag Value */
  1492. uint32_t reftagtr; /* Reference Tag Translation Value */
  1493. };
  1494. struct lpfc_pde6 {
  1495. uint32_t word0;
  1496. #define pde6_type_SHIFT 24
  1497. #define pde6_type_MASK 0x000000ff
  1498. #define pde6_type_WORD word0
  1499. #define pde6_rsvd0_SHIFT 0
  1500. #define pde6_rsvd0_MASK 0x00ffffff
  1501. #define pde6_rsvd0_WORD word0
  1502. uint32_t word1;
  1503. #define pde6_rsvd1_SHIFT 26
  1504. #define pde6_rsvd1_MASK 0x0000003f
  1505. #define pde6_rsvd1_WORD word1
  1506. #define pde6_na_SHIFT 25
  1507. #define pde6_na_MASK 0x00000001
  1508. #define pde6_na_WORD word1
  1509. #define pde6_rsvd2_SHIFT 16
  1510. #define pde6_rsvd2_MASK 0x000001FF
  1511. #define pde6_rsvd2_WORD word1
  1512. #define pde6_apptagtr_SHIFT 0
  1513. #define pde6_apptagtr_MASK 0x0000ffff
  1514. #define pde6_apptagtr_WORD word1
  1515. uint32_t word2;
  1516. #define pde6_optx_SHIFT 28
  1517. #define pde6_optx_MASK 0x0000000f
  1518. #define pde6_optx_WORD word2
  1519. #define pde6_oprx_SHIFT 24
  1520. #define pde6_oprx_MASK 0x0000000f
  1521. #define pde6_oprx_WORD word2
  1522. #define pde6_nr_SHIFT 23
  1523. #define pde6_nr_MASK 0x00000001
  1524. #define pde6_nr_WORD word2
  1525. #define pde6_ce_SHIFT 22
  1526. #define pde6_ce_MASK 0x00000001
  1527. #define pde6_ce_WORD word2
  1528. #define pde6_re_SHIFT 21
  1529. #define pde6_re_MASK 0x00000001
  1530. #define pde6_re_WORD word2
  1531. #define pde6_ae_SHIFT 20
  1532. #define pde6_ae_MASK 0x00000001
  1533. #define pde6_ae_WORD word2
  1534. #define pde6_ai_SHIFT 19
  1535. #define pde6_ai_MASK 0x00000001
  1536. #define pde6_ai_WORD word2
  1537. #define pde6_bs_SHIFT 16
  1538. #define pde6_bs_MASK 0x00000007
  1539. #define pde6_bs_WORD word2
  1540. #define pde6_apptagval_SHIFT 0
  1541. #define pde6_apptagval_MASK 0x0000ffff
  1542. #define pde6_apptagval_WORD word2
  1543. };
  1544. struct lpfc_pde7 {
  1545. uint32_t word0;
  1546. #define pde7_type_SHIFT 24
  1547. #define pde7_type_MASK 0x000000ff
  1548. #define pde7_type_WORD word0
  1549. #define pde7_rsvd0_SHIFT 0
  1550. #define pde7_rsvd0_MASK 0x00ffffff
  1551. #define pde7_rsvd0_WORD word0
  1552. uint32_t addrHigh;
  1553. uint32_t addrLow;
  1554. };
  1555. /* Structure for MB Command LOAD_SM and DOWN_LOAD */
  1556. typedef struct {
  1557. #ifdef __BIG_ENDIAN_BITFIELD
  1558. uint32_t rsvd2:25;
  1559. uint32_t acknowledgment:1;
  1560. uint32_t version:1;
  1561. uint32_t erase_or_prog:1;
  1562. uint32_t update_flash:1;
  1563. uint32_t update_ram:1;
  1564. uint32_t method:1;
  1565. uint32_t load_cmplt:1;
  1566. #else /* __LITTLE_ENDIAN_BITFIELD */
  1567. uint32_t load_cmplt:1;
  1568. uint32_t method:1;
  1569. uint32_t update_ram:1;
  1570. uint32_t update_flash:1;
  1571. uint32_t erase_or_prog:1;
  1572. uint32_t version:1;
  1573. uint32_t acknowledgment:1;
  1574. uint32_t rsvd2:25;
  1575. #endif
  1576. uint32_t dl_to_adr_low;
  1577. uint32_t dl_to_adr_high;
  1578. uint32_t dl_len;
  1579. union {
  1580. uint32_t dl_from_mbx_offset;
  1581. struct ulp_bde dl_from_bde;
  1582. struct ulp_bde64 dl_from_bde64;
  1583. } un;
  1584. } LOAD_SM_VAR;
  1585. /* Structure for MB Command READ_NVPARM (02) */
  1586. typedef struct {
  1587. uint32_t rsvd1[3]; /* Read as all one's */
  1588. uint32_t rsvd2; /* Read as all zero's */
  1589. uint32_t portname[2]; /* N_PORT name */
  1590. uint32_t nodename[2]; /* NODE name */
  1591. #ifdef __BIG_ENDIAN_BITFIELD
  1592. uint32_t pref_DID:24;
  1593. uint32_t hardAL_PA:8;
  1594. #else /* __LITTLE_ENDIAN_BITFIELD */
  1595. uint32_t hardAL_PA:8;
  1596. uint32_t pref_DID:24;
  1597. #endif
  1598. uint32_t rsvd3[21]; /* Read as all one's */
  1599. } READ_NV_VAR;
  1600. /* Structure for MB Command WRITE_NVPARMS (03) */
  1601. typedef struct {
  1602. uint32_t rsvd1[3]; /* Must be all one's */
  1603. uint32_t rsvd2; /* Must be all zero's */
  1604. uint32_t portname[2]; /* N_PORT name */
  1605. uint32_t nodename[2]; /* NODE name */
  1606. #ifdef __BIG_ENDIAN_BITFIELD
  1607. uint32_t pref_DID:24;
  1608. uint32_t hardAL_PA:8;
  1609. #else /* __LITTLE_ENDIAN_BITFIELD */
  1610. uint32_t hardAL_PA:8;
  1611. uint32_t pref_DID:24;
  1612. #endif
  1613. uint32_t rsvd3[21]; /* Must be all one's */
  1614. } WRITE_NV_VAR;
  1615. /* Structure for MB Command RUN_BIU_DIAG (04) */
  1616. /* Structure for MB Command RUN_BIU_DIAG64 (0x84) */
  1617. typedef struct {
  1618. uint32_t rsvd1;
  1619. union {
  1620. struct {
  1621. struct ulp_bde xmit_bde;
  1622. struct ulp_bde rcv_bde;
  1623. } s1;
  1624. struct {
  1625. struct ulp_bde64 xmit_bde64;
  1626. struct ulp_bde64 rcv_bde64;
  1627. } s2;
  1628. } un;
  1629. } BIU_DIAG_VAR;
  1630. /* Structure for MB command READ_EVENT_LOG (0x38) */
  1631. struct READ_EVENT_LOG_VAR {
  1632. uint32_t word1;
  1633. #define lpfc_event_log_SHIFT 29
  1634. #define lpfc_event_log_MASK 0x00000001
  1635. #define lpfc_event_log_WORD word1
  1636. #define USE_MAILBOX_RESPONSE 1
  1637. uint32_t offset;
  1638. struct ulp_bde64 rcv_bde64;
  1639. };
  1640. /* Structure for MB Command INIT_LINK (05) */
  1641. typedef struct {
  1642. #ifdef __BIG_ENDIAN_BITFIELD
  1643. uint32_t rsvd1:24;
  1644. uint32_t lipsr_AL_PA:8; /* AL_PA to issue Lip Selective Reset to */
  1645. #else /* __LITTLE_ENDIAN_BITFIELD */
  1646. uint32_t lipsr_AL_PA:8; /* AL_PA to issue Lip Selective Reset to */
  1647. uint32_t rsvd1:24;
  1648. #endif
  1649. #ifdef __BIG_ENDIAN_BITFIELD
  1650. uint8_t fabric_AL_PA; /* If using a Fabric Assigned AL_PA */
  1651. uint8_t rsvd2;
  1652. uint16_t link_flags;
  1653. #else /* __LITTLE_ENDIAN_BITFIELD */
  1654. uint16_t link_flags;
  1655. uint8_t rsvd2;
  1656. uint8_t fabric_AL_PA; /* If using a Fabric Assigned AL_PA */
  1657. #endif
  1658. #define FLAGS_TOPOLOGY_MODE_LOOP_PT 0x00 /* Attempt loop then pt-pt */
  1659. #define FLAGS_LOCAL_LB 0x01 /* link_flags (=1) ENDEC loopback */
  1660. #define FLAGS_TOPOLOGY_MODE_PT_PT 0x02 /* Attempt pt-pt only */
  1661. #define FLAGS_TOPOLOGY_MODE_LOOP 0x04 /* Attempt loop only */
  1662. #define FLAGS_TOPOLOGY_MODE_PT_LOOP 0x06 /* Attempt pt-pt then loop */
  1663. #define FLAGS_UNREG_LOGIN_ALL 0x08 /* UNREG_LOGIN all on link down */
  1664. #define FLAGS_LIRP_LILP 0x80 /* LIRP / LILP is disabled */
  1665. #define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */
  1666. #define FLAGS_LINK_SPEED 0x0800 /* Bit 11 */
  1667. #define FLAGS_IMED_ABORT 0x04000 /* Bit 14 */
  1668. uint32_t link_speed;
  1669. #define LINK_SPEED_AUTO 0x0 /* Auto selection */
  1670. #define LINK_SPEED_1G 0x1 /* 1 Gigabaud */
  1671. #define LINK_SPEED_2G 0x2 /* 2 Gigabaud */
  1672. #define LINK_SPEED_4G 0x4 /* 4 Gigabaud */
  1673. #define LINK_SPEED_8G 0x8 /* 8 Gigabaud */
  1674. #define LINK_SPEED_10G 0x10 /* 10 Gigabaud */
  1675. #define LINK_SPEED_16G 0x11 /* 16 Gigabaud */
  1676. } INIT_LINK_VAR;
  1677. /* Structure for MB Command DOWN_LINK (06) */
  1678. typedef struct {
  1679. uint32_t rsvd1;
  1680. } DOWN_LINK_VAR;
  1681. /* Structure for MB Command CONFIG_LINK (07) */
  1682. typedef struct {
  1683. #ifdef __BIG_ENDIAN_BITFIELD
  1684. uint32_t cr:1;
  1685. uint32_t ci:1;
  1686. uint32_t cr_delay:6;
  1687. uint32_t cr_count:8;
  1688. uint32_t rsvd1:8;
  1689. uint32_t MaxBBC:8;
  1690. #else /* __LITTLE_ENDIAN_BITFIELD */
  1691. uint32_t MaxBBC:8;
  1692. uint32_t rsvd1:8;
  1693. uint32_t cr_count:8;
  1694. uint32_t cr_delay:6;
  1695. uint32_t ci:1;
  1696. uint32_t cr:1;
  1697. #endif
  1698. uint32_t myId;
  1699. uint32_t rsvd2;
  1700. uint32_t edtov;
  1701. uint32_t arbtov;
  1702. uint32_t ratov;
  1703. uint32_t rttov;
  1704. uint32_t altov;
  1705. uint32_t crtov;
  1706. uint32_t citov;
  1707. #ifdef __BIG_ENDIAN_BITFIELD
  1708. uint32_t rrq_enable:1;
  1709. uint32_t rrq_immed:1;
  1710. uint32_t rsvd4:29;
  1711. uint32_t ack0_enable:1;
  1712. #else /* __LITTLE_ENDIAN_BITFIELD */
  1713. uint32_t ack0_enable:1;
  1714. uint32_t rsvd4:29;
  1715. uint32_t rrq_immed:1;
  1716. uint32_t rrq_enable:1;
  1717. #endif
  1718. } CONFIG_LINK;
  1719. /* Structure for MB Command PART_SLIM (08)
  1720. * will be removed since SLI1 is no longer supported!
  1721. */
  1722. typedef struct {
  1723. #ifdef __BIG_ENDIAN_BITFIELD
  1724. uint16_t offCiocb;
  1725. uint16_t numCiocb;
  1726. uint16_t offRiocb;
  1727. uint16_t numRiocb;
  1728. #else /* __LITTLE_ENDIAN_BITFIELD */
  1729. uint16_t numCiocb;
  1730. uint16_t offCiocb;
  1731. uint16_t numRiocb;
  1732. uint16_t offRiocb;
  1733. #endif
  1734. } RING_DEF;
  1735. typedef struct {
  1736. #ifdef __BIG_ENDIAN_BITFIELD
  1737. uint32_t unused1:24;
  1738. uint32_t numRing:8;
  1739. #else /* __LITTLE_ENDIAN_BITFIELD */
  1740. uint32_t numRing:8;
  1741. uint32_t unused1:24;
  1742. #endif
  1743. RING_DEF ringdef[4];
  1744. uint32_t hbainit;
  1745. } PART_SLIM_VAR;
  1746. /* Structure for MB Command CONFIG_RING (09) */
  1747. typedef struct {
  1748. #ifdef __BIG_ENDIAN_BITFIELD
  1749. uint32_t unused2:6;
  1750. uint32_t recvSeq:1;
  1751. uint32_t recvNotify:1;
  1752. uint32_t numMask:8;
  1753. uint32_t profile:8;
  1754. uint32_t unused1:4;
  1755. uint32_t ring:4;
  1756. #else /* __LITTLE_ENDIAN_BITFIELD */
  1757. uint32_t ring:4;
  1758. uint32_t unused1:4;
  1759. uint32_t profile:8;
  1760. uint32_t numMask:8;
  1761. uint32_t recvNotify:1;
  1762. uint32_t recvSeq:1;
  1763. uint32_t unused2:6;
  1764. #endif
  1765. #ifdef __BIG_ENDIAN_BITFIELD
  1766. uint16_t maxRespXchg;
  1767. uint16_t maxOrigXchg;
  1768. #else /* __LITTLE_ENDIAN_BITFIELD */
  1769. uint16_t maxOrigXchg;
  1770. uint16_t maxRespXchg;
  1771. #endif
  1772. RR_REG rrRegs[6];
  1773. } CONFIG_RING_VAR;
  1774. /* Structure for MB Command RESET_RING (10) */
  1775. typedef struct {
  1776. uint32_t ring_no;
  1777. } RESET_RING_VAR;
  1778. /* Structure for MB Command READ_CONFIG (11) */
  1779. typedef struct {
  1780. #ifdef __BIG_ENDIAN_BITFIELD
  1781. uint32_t cr:1;
  1782. uint32_t ci:1;
  1783. uint32_t cr_delay:6;
  1784. uint32_t cr_count:8;
  1785. uint32_t InitBBC:8;
  1786. uint32_t MaxBBC:8;
  1787. #else /* __LITTLE_ENDIAN_BITFIELD */
  1788. uint32_t MaxBBC:8;
  1789. uint32_t InitBBC:8;
  1790. uint32_t cr_count:8;
  1791. uint32_t cr_delay:6;
  1792. uint32_t ci:1;
  1793. uint32_t cr:1;
  1794. #endif
  1795. #ifdef __BIG_ENDIAN_BITFIELD
  1796. uint32_t topology:8;
  1797. uint32_t myDid:24;
  1798. #else /* __LITTLE_ENDIAN_BITFIELD */
  1799. uint32_t myDid:24;
  1800. uint32_t topology:8;
  1801. #endif
  1802. /* Defines for topology (defined previously) */
  1803. #ifdef __BIG_ENDIAN_BITFIELD
  1804. uint32_t AR:1;
  1805. uint32_t IR:1;
  1806. uint32_t rsvd1:29;
  1807. uint32_t ack0:1;
  1808. #else /* __LITTLE_ENDIAN_BITFIELD */
  1809. uint32_t ack0:1;
  1810. uint32_t rsvd1:29;
  1811. uint32_t IR:1;
  1812. uint32_t AR:1;
  1813. #endif
  1814. uint32_t edtov;
  1815. uint32_t arbtov;
  1816. uint32_t ratov;
  1817. uint32_t rttov;
  1818. uint32_t altov;
  1819. uint32_t lmt;
  1820. #define LMT_RESERVED 0x000 /* Not used */
  1821. #define LMT_1Gb 0x004
  1822. #define LMT_2Gb 0x008
  1823. #define LMT_4Gb 0x040
  1824. #define LMT_8Gb 0x080
  1825. #define LMT_10Gb 0x100
  1826. #define LMT_16Gb 0x200
  1827. uint32_t rsvd2;
  1828. uint32_t rsvd3;
  1829. uint32_t max_xri;
  1830. uint32_t max_iocb;
  1831. uint32_t max_rpi;
  1832. uint32_t avail_xri;
  1833. uint32_t avail_iocb;
  1834. uint32_t avail_rpi;
  1835. uint32_t max_vpi;
  1836. uint32_t rsvd4;
  1837. uint32_t rsvd5;
  1838. uint32_t avail_vpi;
  1839. } READ_CONFIG_VAR;
  1840. /* Structure for MB Command READ_RCONFIG (12) */
  1841. typedef struct {
  1842. #ifdef __BIG_ENDIAN_BITFIELD
  1843. uint32_t rsvd2:7;
  1844. uint32_t recvNotify:1;
  1845. uint32_t numMask:8;
  1846. uint32_t profile:8;
  1847. uint32_t rsvd1:4;
  1848. uint32_t ring:4;
  1849. #else /* __LITTLE_ENDIAN_BITFIELD */
  1850. uint32_t ring:4;
  1851. uint32_t rsvd1:4;
  1852. uint32_t profile:8;
  1853. uint32_t numMask:8;
  1854. uint32_t recvNotify:1;
  1855. uint32_t rsvd2:7;
  1856. #endif
  1857. #ifdef __BIG_ENDIAN_BITFIELD
  1858. uint16_t maxResp;
  1859. uint16_t maxOrig;
  1860. #else /* __LITTLE_ENDIAN_BITFIELD */
  1861. uint16_t maxOrig;
  1862. uint16_t maxResp;
  1863. #endif
  1864. RR_REG rrRegs[6];
  1865. #ifdef __BIG_ENDIAN_BITFIELD
  1866. uint16_t cmdRingOffset;
  1867. uint16_t cmdEntryCnt;
  1868. uint16_t rspRingOffset;
  1869. uint16_t rspEntryCnt;
  1870. uint16_t nextCmdOffset;
  1871. uint16_t rsvd3;
  1872. uint16_t nextRspOffset;
  1873. uint16_t rsvd4;
  1874. #else /* __LITTLE_ENDIAN_BITFIELD */
  1875. uint16_t cmdEntryCnt;
  1876. uint16_t cmdRingOffset;
  1877. uint16_t rspEntryCnt;
  1878. uint16_t rspRingOffset;
  1879. uint16_t rsvd3;
  1880. uint16_t nextCmdOffset;
  1881. uint16_t rsvd4;
  1882. uint16_t nextRspOffset;
  1883. #endif
  1884. } READ_RCONF_VAR;
  1885. /* Structure for MB Command READ_SPARM (13) */
  1886. /* Structure for MB Command READ_SPARM64 (0x8D) */
  1887. typedef struct {
  1888. uint32_t rsvd1;
  1889. uint32_t rsvd2;
  1890. union {
  1891. struct ulp_bde sp; /* This BDE points to struct serv_parm
  1892. structure */
  1893. struct ulp_bde64 sp64;
  1894. } un;
  1895. #ifdef __BIG_ENDIAN_BITFIELD
  1896. uint16_t rsvd3;
  1897. uint16_t vpi;
  1898. #else /* __LITTLE_ENDIAN_BITFIELD */
  1899. uint16_t vpi;
  1900. uint16_t rsvd3;
  1901. #endif
  1902. } READ_SPARM_VAR;
  1903. /* Structure for MB Command READ_STATUS (14) */
  1904. typedef struct {
  1905. #ifdef __BIG_ENDIAN_BITFIELD
  1906. uint32_t rsvd1:31;
  1907. uint32_t clrCounters:1;
  1908. uint16_t activeXriCnt;
  1909. uint16_t activeRpiCnt;
  1910. #else /* __LITTLE_ENDIAN_BITFIELD */
  1911. uint32_t clrCounters:1;
  1912. uint32_t rsvd1:31;
  1913. uint16_t activeRpiCnt;
  1914. uint16_t activeXriCnt;
  1915. #endif
  1916. uint32_t xmitByteCnt;
  1917. uint32_t rcvByteCnt;
  1918. uint32_t xmitFrameCnt;
  1919. uint32_t rcvFrameCnt;
  1920. uint32_t xmitSeqCnt;
  1921. uint32_t rcvSeqCnt;
  1922. uint32_t totalOrigExchanges;
  1923. uint32_t totalRespExchanges;
  1924. uint32_t rcvPbsyCnt;
  1925. uint32_t rcvFbsyCnt;
  1926. } READ_STATUS_VAR;
  1927. /* Structure for MB Command READ_RPI (15) */
  1928. /* Structure for MB Command READ_RPI64 (0x8F) */
  1929. typedef struct {
  1930. #ifdef __BIG_ENDIAN_BITFIELD
  1931. uint16_t nextRpi;
  1932. uint16_t reqRpi;
  1933. uint32_t rsvd2:8;
  1934. uint32_t DID:24;
  1935. #else /* __LITTLE_ENDIAN_BITFIELD */
  1936. uint16_t reqRpi;
  1937. uint16_t nextRpi;
  1938. uint32_t DID:24;
  1939. uint32_t rsvd2:8;
  1940. #endif
  1941. union {
  1942. struct ulp_bde sp;
  1943. struct ulp_bde64 sp64;
  1944. } un;
  1945. } READ_RPI_VAR;
  1946. /* Structure for MB Command READ_XRI (16) */
  1947. typedef struct {
  1948. #ifdef __BIG_ENDIAN_BITFIELD
  1949. uint16_t nextXri;
  1950. uint16_t reqXri;
  1951. uint16_t rsvd1;
  1952. uint16_t rpi;
  1953. uint32_t rsvd2:8;
  1954. uint32_t DID:24;
  1955. uint32_t rsvd3:8;
  1956. uint32_t SID:24;
  1957. uint32_t rsvd4;
  1958. uint8_t seqId;
  1959. uint8_t rsvd5;
  1960. uint16_t seqCount;
  1961. uint16_t oxId;
  1962. uint16_t rxId;
  1963. uint32_t rsvd6:30;
  1964. uint32_t si:1;
  1965. uint32_t exchOrig:1;
  1966. #else /* __LITTLE_ENDIAN_BITFIELD */
  1967. uint16_t reqXri;
  1968. uint16_t nextXri;
  1969. uint16_t rpi;
  1970. uint16_t rsvd1;
  1971. uint32_t DID:24;
  1972. uint32_t rsvd2:8;
  1973. uint32_t SID:24;
  1974. uint32_t rsvd3:8;
  1975. uint32_t rsvd4;
  1976. uint16_t seqCount;
  1977. uint8_t rsvd5;
  1978. uint8_t seqId;
  1979. uint16_t rxId;
  1980. uint16_t oxId;
  1981. uint32_t exchOrig:1;
  1982. uint32_t si:1;
  1983. uint32_t rsvd6:30;
  1984. #endif
  1985. } READ_XRI_VAR;
  1986. /* Structure for MB Command READ_REV (17) */
  1987. typedef struct {
  1988. #ifdef __BIG_ENDIAN_BITFIELD
  1989. uint32_t cv:1;
  1990. uint32_t rr:1;
  1991. uint32_t rsvd2:2;
  1992. uint32_t v3req:1;
  1993. uint32_t v3rsp:1;
  1994. uint32_t rsvd1:25;
  1995. uint32_t rv:1;
  1996. #else /* __LITTLE_ENDIAN_BITFIELD */
  1997. uint32_t rv:1;
  1998. uint32_t rsvd1:25;
  1999. uint32_t v3rsp:1;
  2000. uint32_t v3req:1;
  2001. uint32_t rsvd2:2;
  2002. uint32_t rr:1;
  2003. uint32_t cv:1;
  2004. #endif
  2005. uint32_t biuRev;
  2006. uint32_t smRev;
  2007. union {
  2008. uint32_t smFwRev;
  2009. struct {
  2010. #ifdef __BIG_ENDIAN_BITFIELD
  2011. uint8_t ProgType;
  2012. uint8_t ProgId;
  2013. uint16_t ProgVer:4;
  2014. uint16_t ProgRev:4;
  2015. uint16_t ProgFixLvl:2;
  2016. uint16_t ProgDistType:2;
  2017. uint16_t DistCnt:4;
  2018. #else /* __LITTLE_ENDIAN_BITFIELD */
  2019. uint16_t DistCnt:4;
  2020. uint16_t ProgDistType:2;
  2021. uint16_t ProgFixLvl:2;
  2022. uint16_t ProgRev:4;
  2023. uint16_t ProgVer:4;
  2024. uint8_t ProgId;
  2025. uint8_t ProgType;
  2026. #endif
  2027. } b;
  2028. } un;
  2029. uint32_t endecRev;
  2030. #ifdef __BIG_ENDIAN_BITFIELD
  2031. uint8_t feaLevelHigh;
  2032. uint8_t feaLevelLow;
  2033. uint8_t fcphHigh;
  2034. uint8_t fcphLow;
  2035. #else /* __LITTLE_ENDIAN_BITFIELD */
  2036. uint8_t fcphLow;
  2037. uint8_t fcphHigh;
  2038. uint8_t feaLevelLow;
  2039. uint8_t feaLevelHigh;
  2040. #endif
  2041. uint32_t postKernRev;
  2042. uint32_t opFwRev;
  2043. uint8_t opFwName[16];
  2044. uint32_t sli1FwRev;
  2045. uint8_t sli1FwName[16];
  2046. uint32_t sli2FwRev;
  2047. uint8_t sli2FwName[16];
  2048. uint32_t sli3Feat;
  2049. uint32_t RandomData[6];
  2050. } READ_REV_VAR;
  2051. /* Structure for MB Command READ_LINK_STAT (18) */
  2052. typedef struct {
  2053. uint32_t rsvd1;
  2054. uint32_t linkFailureCnt;
  2055. uint32_t lossSyncCnt;
  2056. uint32_t lossSignalCnt;
  2057. uint32_t primSeqErrCnt;
  2058. uint32_t invalidXmitWord;
  2059. uint32_t crcCnt;
  2060. uint32_t primSeqTimeout;
  2061. uint32_t elasticOverrun;
  2062. uint32_t arbTimeout;
  2063. } READ_LNK_VAR;
  2064. /* Structure for MB Command REG_LOGIN (19) */
  2065. /* Structure for MB Command REG_LOGIN64 (0x93) */
  2066. typedef struct {
  2067. #ifdef __BIG_ENDIAN_BITFIELD
  2068. uint16_t rsvd1;
  2069. uint16_t rpi;
  2070. uint32_t rsvd2:8;
  2071. uint32_t did:24;
  2072. #else /* __LITTLE_ENDIAN_BITFIELD */
  2073. uint16_t rpi;
  2074. uint16_t rsvd1;
  2075. uint32_t did:24;
  2076. uint32_t rsvd2:8;
  2077. #endif
  2078. union {
  2079. struct ulp_bde sp;
  2080. struct ulp_bde64 sp64;
  2081. } un;
  2082. #ifdef __BIG_ENDIAN_BITFIELD
  2083. uint16_t rsvd6;
  2084. uint16_t vpi;
  2085. #else /* __LITTLE_ENDIAN_BITFIELD */
  2086. uint16_t vpi;
  2087. uint16_t rsvd6;
  2088. #endif
  2089. } REG_LOGIN_VAR;
  2090. /* Word 30 contents for REG_LOGIN */
  2091. typedef union {
  2092. struct {
  2093. #ifdef __BIG_ENDIAN_BITFIELD
  2094. uint16_t rsvd1:12;
  2095. uint16_t wd30_class:4;
  2096. uint16_t xri;
  2097. #else /* __LITTLE_ENDIAN_BITFIELD */
  2098. uint16_t xri;
  2099. uint16_t wd30_class:4;
  2100. uint16_t rsvd1:12;
  2101. #endif
  2102. } f;
  2103. uint32_t word;
  2104. } REG_WD30;
  2105. /* Structure for MB Command UNREG_LOGIN (20) */
  2106. typedef struct {
  2107. #ifdef __BIG_ENDIAN_BITFIELD
  2108. uint16_t rsvd1;
  2109. uint16_t rpi;
  2110. uint32_t rsvd2;
  2111. uint32_t rsvd3;
  2112. uint32_t rsvd4;
  2113. uint32_t rsvd5;
  2114. uint16_t rsvd6;
  2115. uint16_t vpi;
  2116. #else /* __LITTLE_ENDIAN_BITFIELD */
  2117. uint16_t rpi;
  2118. uint16_t rsvd1;
  2119. uint32_t rsvd2;
  2120. uint32_t rsvd3;
  2121. uint32_t rsvd4;
  2122. uint32_t rsvd5;
  2123. uint16_t vpi;
  2124. uint16_t rsvd6;
  2125. #endif
  2126. } UNREG_LOGIN_VAR;
  2127. /* Structure for MB Command REG_VPI (0x96) */
  2128. typedef struct {
  2129. #ifdef __BIG_ENDIAN_BITFIELD
  2130. uint32_t rsvd1;
  2131. uint32_t rsvd2:7;
  2132. uint32_t upd:1;
  2133. uint32_t sid:24;
  2134. uint32_t wwn[2];
  2135. uint32_t rsvd5;
  2136. uint16_t vfi;
  2137. uint16_t vpi;
  2138. #else /* __LITTLE_ENDIAN */
  2139. uint32_t rsvd1;
  2140. uint32_t sid:24;
  2141. uint32_t upd:1;
  2142. uint32_t rsvd2:7;
  2143. uint32_t wwn[2];
  2144. uint32_t rsvd5;
  2145. uint16_t vpi;
  2146. uint16_t vfi;
  2147. #endif
  2148. } REG_VPI_VAR;
  2149. /* Structure for MB Command UNREG_VPI (0x97) */
  2150. typedef struct {
  2151. uint32_t rsvd1;
  2152. #ifdef __BIG_ENDIAN_BITFIELD
  2153. uint16_t rsvd2;
  2154. uint16_t sli4_vpi;
  2155. #else /* __LITTLE_ENDIAN */
  2156. uint16_t sli4_vpi;
  2157. uint16_t rsvd2;
  2158. #endif
  2159. uint32_t rsvd3;
  2160. uint32_t rsvd4;
  2161. uint32_t rsvd5;
  2162. #ifdef __BIG_ENDIAN_BITFIELD
  2163. uint16_t rsvd6;
  2164. uint16_t vpi;
  2165. #else /* __LITTLE_ENDIAN */
  2166. uint16_t vpi;
  2167. uint16_t rsvd6;
  2168. #endif
  2169. } UNREG_VPI_VAR;
  2170. /* Structure for MB Command UNREG_D_ID (0x23) */
  2171. typedef struct {
  2172. uint32_t did;
  2173. uint32_t rsvd2;
  2174. uint32_t rsvd3;
  2175. uint32_t rsvd4;
  2176. uint32_t rsvd5;
  2177. #ifdef __BIG_ENDIAN_BITFIELD
  2178. uint16_t rsvd6;
  2179. uint16_t vpi;
  2180. #else
  2181. uint16_t vpi;
  2182. uint16_t rsvd6;
  2183. #endif
  2184. } UNREG_D_ID_VAR;
  2185. /* Structure for MB Command READ_TOPOLOGY (0x95) */
  2186. struct lpfc_mbx_read_top {
  2187. uint32_t eventTag; /* Event tag */
  2188. uint32_t word2;
  2189. #define lpfc_mbx_read_top_fa_SHIFT 12
  2190. #define lpfc_mbx_read_top_fa_MASK 0x00000001
  2191. #define lpfc_mbx_read_top_fa_WORD word2
  2192. #define lpfc_mbx_read_top_mm_SHIFT 11
  2193. #define lpfc_mbx_read_top_mm_MASK 0x00000001
  2194. #define lpfc_mbx_read_top_mm_WORD word2
  2195. #define lpfc_mbx_read_top_pb_SHIFT 9
  2196. #define lpfc_mbx_read_top_pb_MASK 0X00000001
  2197. #define lpfc_mbx_read_top_pb_WORD word2
  2198. #define lpfc_mbx_read_top_il_SHIFT 8
  2199. #define lpfc_mbx_read_top_il_MASK 0x00000001
  2200. #define lpfc_mbx_read_top_il_WORD word2
  2201. #define lpfc_mbx_read_top_att_type_SHIFT 0
  2202. #define lpfc_mbx_read_top_att_type_MASK 0x000000FF
  2203. #define lpfc_mbx_read_top_att_type_WORD word2
  2204. #define LPFC_ATT_RESERVED 0x00 /* Reserved - attType */
  2205. #define LPFC_ATT_LINK_UP 0x01 /* Link is up */
  2206. #define LPFC_ATT_LINK_DOWN 0x02 /* Link is down */
  2207. uint32_t word3;
  2208. #define lpfc_mbx_read_top_alpa_granted_SHIFT 24
  2209. #define lpfc_mbx_read_top_alpa_granted_MASK 0x000000FF
  2210. #define lpfc_mbx_read_top_alpa_granted_WORD word3
  2211. #define lpfc_mbx_read_top_lip_alps_SHIFT 16
  2212. #define lpfc_mbx_read_top_lip_alps_MASK 0x000000FF
  2213. #define lpfc_mbx_read_top_lip_alps_WORD word3
  2214. #define lpfc_mbx_read_top_lip_type_SHIFT 8
  2215. #define lpfc_mbx_read_top_lip_type_MASK 0x000000FF
  2216. #define lpfc_mbx_read_top_lip_type_WORD word3
  2217. #define lpfc_mbx_read_top_topology_SHIFT 0
  2218. #define lpfc_mbx_read_top_topology_MASK 0x000000FF
  2219. #define lpfc_mbx_read_top_topology_WORD word3
  2220. #define LPFC_TOPOLOGY_PT_PT 0x01 /* Topology is pt-pt / pt-fabric */
  2221. #define LPFC_TOPOLOGY_LOOP 0x02 /* Topology is FC-AL */
  2222. #define LPFC_TOPOLOGY_MM 0x05 /* maint mode zephtr to menlo */
  2223. /* store the LILP AL_PA position map into */
  2224. struct ulp_bde64 lilpBde64;
  2225. #define LPFC_ALPA_MAP_SIZE 128
  2226. uint32_t word7;
  2227. #define lpfc_mbx_read_top_ld_lu_SHIFT 31
  2228. #define lpfc_mbx_read_top_ld_lu_MASK 0x00000001
  2229. #define lpfc_mbx_read_top_ld_lu_WORD word7
  2230. #define lpfc_mbx_read_top_ld_tf_SHIFT 30
  2231. #define lpfc_mbx_read_top_ld_tf_MASK 0x00000001
  2232. #define lpfc_mbx_read_top_ld_tf_WORD word7
  2233. #define lpfc_mbx_read_top_ld_link_spd_SHIFT 8
  2234. #define lpfc_mbx_read_top_ld_link_spd_MASK 0x000000FF
  2235. #define lpfc_mbx_read_top_ld_link_spd_WORD word7
  2236. #define lpfc_mbx_read_top_ld_nl_port_SHIFT 4
  2237. #define lpfc_mbx_read_top_ld_nl_port_MASK 0x0000000F
  2238. #define lpfc_mbx_read_top_ld_nl_port_WORD word7
  2239. #define lpfc_mbx_read_top_ld_tx_SHIFT 2
  2240. #define lpfc_mbx_read_top_ld_tx_MASK 0x00000003
  2241. #define lpfc_mbx_read_top_ld_tx_WORD word7
  2242. #define lpfc_mbx_read_top_ld_rx_SHIFT 0
  2243. #define lpfc_mbx_read_top_ld_rx_MASK 0x00000003
  2244. #define lpfc_mbx_read_top_ld_rx_WORD word7
  2245. uint32_t word8;
  2246. #define lpfc_mbx_read_top_lu_SHIFT 31
  2247. #define lpfc_mbx_read_top_lu_MASK 0x00000001
  2248. #define lpfc_mbx_read_top_lu_WORD word8
  2249. #define lpfc_mbx_read_top_tf_SHIFT 30
  2250. #define lpfc_mbx_read_top_tf_MASK 0x00000001
  2251. #define lpfc_mbx_read_top_tf_WORD word8
  2252. #define lpfc_mbx_read_top_link_spd_SHIFT 8
  2253. #define lpfc_mbx_read_top_link_spd_MASK 0x000000FF
  2254. #define lpfc_mbx_read_top_link_spd_WORD word8
  2255. #define lpfc_mbx_read_top_nl_port_SHIFT 4
  2256. #define lpfc_mbx_read_top_nl_port_MASK 0x0000000F
  2257. #define lpfc_mbx_read_top_nl_port_WORD word8
  2258. #define lpfc_mbx_read_top_tx_SHIFT 2
  2259. #define lpfc_mbx_read_top_tx_MASK 0x00000003
  2260. #define lpfc_mbx_read_top_tx_WORD word8
  2261. #define lpfc_mbx_read_top_rx_SHIFT 0
  2262. #define lpfc_mbx_read_top_rx_MASK 0x00000003
  2263. #define lpfc_mbx_read_top_rx_WORD word8
  2264. #define LPFC_LINK_SPEED_UNKNOWN 0x0
  2265. #define LPFC_LINK_SPEED_1GHZ 0x04
  2266. #define LPFC_LINK_SPEED_2GHZ 0x08
  2267. #define LPFC_LINK_SPEED_4GHZ 0x10
  2268. #define LPFC_LINK_SPEED_8GHZ 0x20
  2269. #define LPFC_LINK_SPEED_10GHZ 0x40
  2270. #define LPFC_LINK_SPEED_16GHZ 0x80
  2271. };
  2272. /* Structure for MB Command CLEAR_LA (22) */
  2273. typedef struct {
  2274. uint32_t eventTag; /* Event tag */
  2275. uint32_t rsvd1;
  2276. } CLEAR_LA_VAR;
  2277. /* Structure for MB Command DUMP */
  2278. typedef struct {
  2279. #ifdef __BIG_ENDIAN_BITFIELD
  2280. uint32_t rsvd:25;
  2281. uint32_t ra:1;
  2282. uint32_t co:1;
  2283. uint32_t cv:1;
  2284. uint32_t type:4;
  2285. uint32_t entry_index:16;
  2286. uint32_t region_id:16;
  2287. #else /* __LITTLE_ENDIAN_BITFIELD */
  2288. uint32_t type:4;
  2289. uint32_t cv:1;
  2290. uint32_t co:1;
  2291. uint32_t ra:1;
  2292. uint32_t rsvd:25;
  2293. uint32_t region_id:16;
  2294. uint32_t entry_index:16;
  2295. #endif
  2296. uint32_t sli4_length;
  2297. uint32_t word_cnt;
  2298. uint32_t resp_offset;
  2299. } DUMP_VAR;
  2300. #define DMP_MEM_REG 0x1
  2301. #define DMP_NV_PARAMS 0x2
  2302. #define DMP_LMSD 0x3 /* Link Module Serial Data */
  2303. #define DMP_WELL_KNOWN 0x4
  2304. #define DMP_REGION_VPD 0xe
  2305. #define DMP_VPD_SIZE 0x400 /* maximum amount of VPD */
  2306. #define DMP_RSP_OFFSET 0x14 /* word 5 contains first word of rsp */
  2307. #define DMP_RSP_SIZE 0x6C /* maximum of 27 words of rsp data */
  2308. #define DMP_REGION_VPORT 0x16 /* VPort info region */
  2309. #define DMP_VPORT_REGION_SIZE 0x200
  2310. #define DMP_MBOX_OFFSET_WORD 0x5
  2311. #define DMP_REGION_23 0x17 /* fcoe param and port state region */
  2312. #define DMP_RGN23_SIZE 0x400
  2313. #define WAKE_UP_PARMS_REGION_ID 4
  2314. #define WAKE_UP_PARMS_WORD_SIZE 15
  2315. struct vport_rec {
  2316. uint8_t wwpn[8];
  2317. uint8_t wwnn[8];
  2318. };
  2319. #define VPORT_INFO_SIG 0x32324752
  2320. #define VPORT_INFO_REV_MASK 0xff
  2321. #define VPORT_INFO_REV 0x1
  2322. #define MAX_STATIC_VPORT_COUNT 16
  2323. struct static_vport_info {
  2324. uint32_t signature;
  2325. uint32_t rev;
  2326. struct vport_rec vport_list[MAX_STATIC_VPORT_COUNT];
  2327. uint32_t resvd[66];
  2328. };
  2329. /* Option rom version structure */
  2330. struct prog_id {
  2331. #ifdef __BIG_ENDIAN_BITFIELD
  2332. uint8_t type;
  2333. uint8_t id;
  2334. uint32_t ver:4; /* Major Version */
  2335. uint32_t rev:4; /* Revision */
  2336. uint32_t lev:2; /* Level */
  2337. uint32_t dist:2; /* Dist Type */
  2338. uint32_t num:4; /* number after dist type */
  2339. #else /* __LITTLE_ENDIAN_BITFIELD */
  2340. uint32_t num:4; /* number after dist type */
  2341. uint32_t dist:2; /* Dist Type */
  2342. uint32_t lev:2; /* Level */
  2343. uint32_t rev:4; /* Revision */
  2344. uint32_t ver:4; /* Major Version */
  2345. uint8_t id;
  2346. uint8_t type;
  2347. #endif
  2348. };
  2349. /* Structure for MB Command UPDATE_CFG (0x1B) */
  2350. struct update_cfg_var {
  2351. #ifdef __BIG_ENDIAN_BITFIELD
  2352. uint32_t rsvd2:16;
  2353. uint32_t type:8;
  2354. uint32_t rsvd:1;
  2355. uint32_t ra:1;
  2356. uint32_t co:1;
  2357. uint32_t cv:1;
  2358. uint32_t req:4;
  2359. uint32_t entry_length:16;
  2360. uint32_t region_id:16;
  2361. #else /* __LITTLE_ENDIAN_BITFIELD */
  2362. uint32_t req:4;
  2363. uint32_t cv:1;
  2364. uint32_t co:1;
  2365. uint32_t ra:1;
  2366. uint32_t rsvd:1;
  2367. uint32_t type:8;
  2368. uint32_t rsvd2:16;
  2369. uint32_t region_id:16;
  2370. uint32_t entry_length:16;
  2371. #endif
  2372. uint32_t resp_info;
  2373. uint32_t byte_cnt;
  2374. uint32_t data_offset;
  2375. };
  2376. struct hbq_mask {
  2377. #ifdef __BIG_ENDIAN_BITFIELD
  2378. uint8_t tmatch;
  2379. uint8_t tmask;
  2380. uint8_t rctlmatch;
  2381. uint8_t rctlmask;
  2382. #else /* __LITTLE_ENDIAN */
  2383. uint8_t rctlmask;
  2384. uint8_t rctlmatch;
  2385. uint8_t tmask;
  2386. uint8_t tmatch;
  2387. #endif
  2388. };
  2389. /* Structure for MB Command CONFIG_HBQ (7c) */
  2390. struct config_hbq_var {
  2391. #ifdef __BIG_ENDIAN_BITFIELD
  2392. uint32_t rsvd1 :7;
  2393. uint32_t recvNotify :1; /* Receive Notification */
  2394. uint32_t numMask :8; /* # Mask Entries */
  2395. uint32_t profile :8; /* Selection Profile */
  2396. uint32_t rsvd2 :8;
  2397. #else /* __LITTLE_ENDIAN */
  2398. uint32_t rsvd2 :8;
  2399. uint32_t profile :8; /* Selection Profile */
  2400. uint32_t numMask :8; /* # Mask Entries */
  2401. uint32_t recvNotify :1; /* Receive Notification */
  2402. uint32_t rsvd1 :7;
  2403. #endif
  2404. #ifdef __BIG_ENDIAN_BITFIELD
  2405. uint32_t hbqId :16;
  2406. uint32_t rsvd3 :12;
  2407. uint32_t ringMask :4;
  2408. #else /* __LITTLE_ENDIAN */
  2409. uint32_t ringMask :4;
  2410. uint32_t rsvd3 :12;
  2411. uint32_t hbqId :16;
  2412. #endif
  2413. #ifdef __BIG_ENDIAN_BITFIELD
  2414. uint32_t entry_count :16;
  2415. uint32_t rsvd4 :8;
  2416. uint32_t headerLen :8;
  2417. #else /* __LITTLE_ENDIAN */
  2418. uint32_t headerLen :8;
  2419. uint32_t rsvd4 :8;
  2420. uint32_t entry_count :16;
  2421. #endif
  2422. uint32_t hbqaddrLow;
  2423. uint32_t hbqaddrHigh;
  2424. #ifdef __BIG_ENDIAN_BITFIELD
  2425. uint32_t rsvd5 :31;
  2426. uint32_t logEntry :1;
  2427. #else /* __LITTLE_ENDIAN */
  2428. uint32_t logEntry :1;
  2429. uint32_t rsvd5 :31;
  2430. #endif
  2431. uint32_t rsvd6; /* w7 */
  2432. uint32_t rsvd7; /* w8 */
  2433. uint32_t rsvd8; /* w9 */
  2434. struct hbq_mask hbqMasks[6];
  2435. union {
  2436. uint32_t allprofiles[12];
  2437. struct {
  2438. #ifdef __BIG_ENDIAN_BITFIELD
  2439. uint32_t seqlenoff :16;
  2440. uint32_t maxlen :16;
  2441. #else /* __LITTLE_ENDIAN */
  2442. uint32_t maxlen :16;
  2443. uint32_t seqlenoff :16;
  2444. #endif
  2445. #ifdef __BIG_ENDIAN_BITFIELD
  2446. uint32_t rsvd1 :28;
  2447. uint32_t seqlenbcnt :4;
  2448. #else /* __LITTLE_ENDIAN */
  2449. uint32_t seqlenbcnt :4;
  2450. uint32_t rsvd1 :28;
  2451. #endif
  2452. uint32_t rsvd[10];
  2453. } profile2;
  2454. struct {
  2455. #ifdef __BIG_ENDIAN_BITFIELD
  2456. uint32_t seqlenoff :16;
  2457. uint32_t maxlen :16;
  2458. #else /* __LITTLE_ENDIAN */
  2459. uint32_t maxlen :16;
  2460. uint32_t seqlenoff :16;
  2461. #endif
  2462. #ifdef __BIG_ENDIAN_BITFIELD
  2463. uint32_t cmdcodeoff :28;
  2464. uint32_t rsvd1 :12;
  2465. uint32_t seqlenbcnt :4;
  2466. #else /* __LITTLE_ENDIAN */
  2467. uint32_t seqlenbcnt :4;
  2468. uint32_t rsvd1 :12;
  2469. uint32_t cmdcodeoff :28;
  2470. #endif
  2471. uint32_t cmdmatch[8];
  2472. uint32_t rsvd[2];
  2473. } profile3;
  2474. struct {
  2475. #ifdef __BIG_ENDIAN_BITFIELD
  2476. uint32_t seqlenoff :16;
  2477. uint32_t maxlen :16;
  2478. #else /* __LITTLE_ENDIAN */
  2479. uint32_t maxlen :16;
  2480. uint32_t seqlenoff :16;
  2481. #endif
  2482. #ifdef __BIG_ENDIAN_BITFIELD
  2483. uint32_t cmdcodeoff :28;
  2484. uint32_t rsvd1 :12;
  2485. uint32_t seqlenbcnt :4;
  2486. #else /* __LITTLE_ENDIAN */
  2487. uint32_t seqlenbcnt :4;
  2488. uint32_t rsvd1 :12;
  2489. uint32_t cmdcodeoff :28;
  2490. #endif
  2491. uint32_t cmdmatch[8];
  2492. uint32_t rsvd[2];
  2493. } profile5;
  2494. } profiles;
  2495. };
  2496. /* Structure for MB Command CONFIG_PORT (0x88) */
  2497. typedef struct {
  2498. #ifdef __BIG_ENDIAN_BITFIELD
  2499. uint32_t cBE : 1;
  2500. uint32_t cET : 1;
  2501. uint32_t cHpcb : 1;
  2502. uint32_t cMA : 1;
  2503. uint32_t sli_mode : 4;
  2504. uint32_t pcbLen : 24; /* bit 23:0 of memory based port
  2505. * config block */
  2506. #else /* __LITTLE_ENDIAN */
  2507. uint32_t pcbLen : 24; /* bit 23:0 of memory based port
  2508. * config block */
  2509. uint32_t sli_mode : 4;
  2510. uint32_t cMA : 1;
  2511. uint32_t cHpcb : 1;
  2512. uint32_t cET : 1;
  2513. uint32_t cBE : 1;
  2514. #endif
  2515. uint32_t pcbLow; /* bit 31:0 of memory based port config block */
  2516. uint32_t pcbHigh; /* bit 63:32 of memory based port config block */
  2517. uint32_t hbainit[5];
  2518. #ifdef __BIG_ENDIAN_BITFIELD
  2519. uint32_t hps : 1; /* bit 31 word9 Host Pointer in slim */
  2520. uint32_t rsvd : 31; /* least significant 31 bits of word 9 */
  2521. #else /* __LITTLE_ENDIAN */
  2522. uint32_t rsvd : 31; /* least significant 31 bits of word 9 */
  2523. uint32_t hps : 1; /* bit 31 word9 Host Pointer in slim */
  2524. #endif
  2525. #ifdef __BIG_ENDIAN_BITFIELD
  2526. uint32_t rsvd1 : 19; /* Reserved */
  2527. uint32_t cdss : 1; /* Configure Data Security SLI */
  2528. uint32_t casabt : 1; /* Configure async abts status notice */
  2529. uint32_t rsvd2 : 2; /* Reserved */
  2530. uint32_t cbg : 1; /* Configure BlockGuard */
  2531. uint32_t cmv : 1; /* Configure Max VPIs */
  2532. uint32_t ccrp : 1; /* Config Command Ring Polling */
  2533. uint32_t csah : 1; /* Configure Synchronous Abort Handling */
  2534. uint32_t chbs : 1; /* Cofigure Host Backing store */
  2535. uint32_t cinb : 1; /* Enable Interrupt Notification Block */
  2536. uint32_t cerbm : 1; /* Configure Enhanced Receive Buf Mgmt */
  2537. uint32_t cmx : 1; /* Configure Max XRIs */
  2538. uint32_t cmr : 1; /* Configure Max RPIs */
  2539. #else /* __LITTLE_ENDIAN */
  2540. uint32_t cmr : 1; /* Configure Max RPIs */
  2541. uint32_t cmx : 1; /* Configure Max XRIs */
  2542. uint32_t cerbm : 1; /* Configure Enhanced Receive Buf Mgmt */
  2543. uint32_t cinb : 1; /* Enable Interrupt Notification Block */
  2544. uint32_t chbs : 1; /* Cofigure Host Backing store */
  2545. uint32_t csah : 1; /* Configure Synchronous Abort Handling */
  2546. uint32_t ccrp : 1; /* Config Command Ring Polling */
  2547. uint32_t cmv : 1; /* Configure Max VPIs */
  2548. uint32_t cbg : 1; /* Configure BlockGuard */
  2549. uint32_t rsvd2 : 2; /* Reserved */
  2550. uint32_t casabt : 1; /* Configure async abts status notice */
  2551. uint32_t cdss : 1; /* Configure Data Security SLI */
  2552. uint32_t rsvd1 : 19; /* Reserved */
  2553. #endif
  2554. #ifdef __BIG_ENDIAN_BITFIELD
  2555. uint32_t rsvd3 : 19; /* Reserved */
  2556. uint32_t gdss : 1; /* Configure Data Security SLI */
  2557. uint32_t gasabt : 1; /* Grant async abts status notice */
  2558. uint32_t rsvd4 : 2; /* Reserved */
  2559. uint32_t gbg : 1; /* Grant BlockGuard */
  2560. uint32_t gmv : 1; /* Grant Max VPIs */
  2561. uint32_t gcrp : 1; /* Grant Command Ring Polling */
  2562. uint32_t gsah : 1; /* Grant Synchronous Abort Handling */
  2563. uint32_t ghbs : 1; /* Grant Host Backing Store */
  2564. uint32_t ginb : 1; /* Grant Interrupt Notification Block */
  2565. uint32_t gerbm : 1; /* Grant ERBM Request */
  2566. uint32_t gmx : 1; /* Grant Max XRIs */
  2567. uint32_t gmr : 1; /* Grant Max RPIs */
  2568. #else /* __LITTLE_ENDIAN */
  2569. uint32_t gmr : 1; /* Grant Max RPIs */
  2570. uint32_t gmx : 1; /* Grant Max XRIs */
  2571. uint32_t gerbm : 1; /* Grant ERBM Request */
  2572. uint32_t ginb : 1; /* Grant Interrupt Notification Block */
  2573. uint32_t ghbs : 1; /* Grant Host Backing Store */
  2574. uint32_t gsah : 1; /* Grant Synchronous Abort Handling */
  2575. uint32_t gcrp : 1; /* Grant Command Ring Polling */
  2576. uint32_t gmv : 1; /* Grant Max VPIs */
  2577. uint32_t gbg : 1; /* Grant BlockGuard */
  2578. uint32_t rsvd4 : 2; /* Reserved */
  2579. uint32_t gasabt : 1; /* Grant async abts status notice */
  2580. uint32_t gdss : 1; /* Configure Data Security SLI */
  2581. uint32_t rsvd3 : 19; /* Reserved */
  2582. #endif
  2583. #ifdef __BIG_ENDIAN_BITFIELD
  2584. uint32_t max_rpi : 16; /* Max RPIs Port should configure */
  2585. uint32_t max_xri : 16; /* Max XRIs Port should configure */
  2586. #else /* __LITTLE_ENDIAN */
  2587. uint32_t max_xri : 16; /* Max XRIs Port should configure */
  2588. uint32_t max_rpi : 16; /* Max RPIs Port should configure */
  2589. #endif
  2590. #ifdef __BIG_ENDIAN_BITFIELD
  2591. uint32_t max_hbq : 16; /* Max HBQs Host expect to configure */
  2592. uint32_t rsvd5 : 16; /* Max HBQs Host expect to configure */
  2593. #else /* __LITTLE_ENDIAN */
  2594. uint32_t rsvd5 : 16; /* Max HBQs Host expect to configure */
  2595. uint32_t max_hbq : 16; /* Max HBQs Host expect to configure */
  2596. #endif
  2597. uint32_t rsvd6; /* Reserved */
  2598. #ifdef __BIG_ENDIAN_BITFIELD
  2599. uint32_t fips_rev : 3; /* FIPS Spec Revision */
  2600. uint32_t fips_level : 4; /* FIPS Level */
  2601. uint32_t sec_err : 9; /* security crypto error */
  2602. uint32_t max_vpi : 16; /* Max number of virt N-Ports */
  2603. #else /* __LITTLE_ENDIAN */
  2604. uint32_t max_vpi : 16; /* Max number of virt N-Ports */
  2605. uint32_t sec_err : 9; /* security crypto error */
  2606. uint32_t fips_level : 4; /* FIPS Level */
  2607. uint32_t fips_rev : 3; /* FIPS Spec Revision */
  2608. #endif
  2609. } CONFIG_PORT_VAR;
  2610. /* Structure for MB Command CONFIG_MSI (0x30) */
  2611. struct config_msi_var {
  2612. #ifdef __BIG_ENDIAN_BITFIELD
  2613. uint32_t dfltMsgNum:8; /* Default message number */
  2614. uint32_t rsvd1:11; /* Reserved */
  2615. uint32_t NID:5; /* Number of secondary attention IDs */
  2616. uint32_t rsvd2:5; /* Reserved */
  2617. uint32_t dfltPresent:1; /* Default message number present */
  2618. uint32_t addFlag:1; /* Add association flag */
  2619. uint32_t reportFlag:1; /* Report association flag */
  2620. #else /* __LITTLE_ENDIAN_BITFIELD */
  2621. uint32_t reportFlag:1; /* Report association flag */
  2622. uint32_t addFlag:1; /* Add association flag */
  2623. uint32_t dfltPresent:1; /* Default message number present */
  2624. uint32_t rsvd2:5; /* Reserved */
  2625. uint32_t NID:5; /* Number of secondary attention IDs */
  2626. uint32_t rsvd1:11; /* Reserved */
  2627. uint32_t dfltMsgNum:8; /* Default message number */
  2628. #endif
  2629. uint32_t attentionConditions[2];
  2630. uint8_t attentionId[16];
  2631. uint8_t messageNumberByHA[64];
  2632. uint8_t messageNumberByID[16];
  2633. uint32_t autoClearHA[2];
  2634. #ifdef __BIG_ENDIAN_BITFIELD
  2635. uint32_t rsvd3:16;
  2636. uint32_t autoClearID:16;
  2637. #else /* __LITTLE_ENDIAN_BITFIELD */
  2638. uint32_t autoClearID:16;
  2639. uint32_t rsvd3:16;
  2640. #endif
  2641. uint32_t rsvd4;
  2642. };
  2643. /* SLI-2 Port Control Block */
  2644. /* SLIM POINTER */
  2645. #define SLIMOFF 0x30 /* WORD */
  2646. typedef struct _SLI2_RDSC {
  2647. uint32_t cmdEntries;
  2648. uint32_t cmdAddrLow;
  2649. uint32_t cmdAddrHigh;
  2650. uint32_t rspEntries;
  2651. uint32_t rspAddrLow;
  2652. uint32_t rspAddrHigh;
  2653. } SLI2_RDSC;
  2654. typedef struct _PCB {
  2655. #ifdef __BIG_ENDIAN_BITFIELD
  2656. uint32_t type:8;
  2657. #define TYPE_NATIVE_SLI2 0x01
  2658. uint32_t feature:8;
  2659. #define FEATURE_INITIAL_SLI2 0x01
  2660. uint32_t rsvd:12;
  2661. uint32_t maxRing:4;
  2662. #else /* __LITTLE_ENDIAN_BITFIELD */
  2663. uint32_t maxRing:4;
  2664. uint32_t rsvd:12;
  2665. uint32_t feature:8;
  2666. #define FEATURE_INITIAL_SLI2 0x01
  2667. uint32_t type:8;
  2668. #define TYPE_NATIVE_SLI2 0x01
  2669. #endif
  2670. uint32_t mailBoxSize;
  2671. uint32_t mbAddrLow;
  2672. uint32_t mbAddrHigh;
  2673. uint32_t hgpAddrLow;
  2674. uint32_t hgpAddrHigh;
  2675. uint32_t pgpAddrLow;
  2676. uint32_t pgpAddrHigh;
  2677. SLI2_RDSC rdsc[MAX_RINGS];
  2678. } PCB_t;
  2679. /* NEW_FEATURE */
  2680. typedef struct {
  2681. #ifdef __BIG_ENDIAN_BITFIELD
  2682. uint32_t rsvd0:27;
  2683. uint32_t discardFarp:1;
  2684. uint32_t IPEnable:1;
  2685. uint32_t nodeName:1;
  2686. uint32_t portName:1;
  2687. uint32_t filterEnable:1;
  2688. #else /* __LITTLE_ENDIAN_BITFIELD */
  2689. uint32_t filterEnable:1;
  2690. uint32_t portName:1;
  2691. uint32_t nodeName:1;
  2692. uint32_t IPEnable:1;
  2693. uint32_t discardFarp:1;
  2694. uint32_t rsvd:27;
  2695. #endif
  2696. uint8_t portname[8]; /* Used to be struct lpfc_name */
  2697. uint8_t nodename[8];
  2698. uint32_t rsvd1;
  2699. uint32_t rsvd2;
  2700. uint32_t rsvd3;
  2701. uint32_t IPAddress;
  2702. } CONFIG_FARP_VAR;
  2703. /* Structure for MB Command MBX_ASYNCEVT_ENABLE (0x33) */
  2704. typedef struct {
  2705. #ifdef __BIG_ENDIAN_BITFIELD
  2706. uint32_t rsvd:30;
  2707. uint32_t ring:2; /* Ring for ASYNC_EVENT iocb Bits 0-1*/
  2708. #else /* __LITTLE_ENDIAN */
  2709. uint32_t ring:2; /* Ring for ASYNC_EVENT iocb Bits 0-1*/
  2710. uint32_t rsvd:30;
  2711. #endif
  2712. } ASYNCEVT_ENABLE_VAR;
  2713. /* Union of all Mailbox Command types */
  2714. #define MAILBOX_CMD_WSIZE 32
  2715. #define MAILBOX_CMD_SIZE (MAILBOX_CMD_WSIZE * sizeof(uint32_t))
  2716. /* ext_wsize times 4 bytes should not be greater than max xmit size */
  2717. #define MAILBOX_EXT_WSIZE 512
  2718. #define MAILBOX_EXT_SIZE (MAILBOX_EXT_WSIZE * sizeof(uint32_t))
  2719. #define MAILBOX_HBA_EXT_OFFSET 0x100
  2720. /* max mbox xmit size is a page size for sysfs IO operations */
  2721. #define MAILBOX_SYSFS_MAX 4096
  2722. typedef union {
  2723. uint32_t varWords[MAILBOX_CMD_WSIZE - 1]; /* first word is type/
  2724. * feature/max ring number
  2725. */
  2726. LOAD_SM_VAR varLdSM; /* cmd = 1 (LOAD_SM) */
  2727. READ_NV_VAR varRDnvp; /* cmd = 2 (READ_NVPARMS) */
  2728. WRITE_NV_VAR varWTnvp; /* cmd = 3 (WRITE_NVPARMS) */
  2729. BIU_DIAG_VAR varBIUdiag; /* cmd = 4 (RUN_BIU_DIAG) */
  2730. INIT_LINK_VAR varInitLnk; /* cmd = 5 (INIT_LINK) */
  2731. DOWN_LINK_VAR varDwnLnk; /* cmd = 6 (DOWN_LINK) */
  2732. CONFIG_LINK varCfgLnk; /* cmd = 7 (CONFIG_LINK) */
  2733. PART_SLIM_VAR varSlim; /* cmd = 8 (PART_SLIM) */
  2734. CONFIG_RING_VAR varCfgRing; /* cmd = 9 (CONFIG_RING) */
  2735. RESET_RING_VAR varRstRing; /* cmd = 10 (RESET_RING) */
  2736. READ_CONFIG_VAR varRdConfig; /* cmd = 11 (READ_CONFIG) */
  2737. READ_RCONF_VAR varRdRConfig; /* cmd = 12 (READ_RCONFIG) */
  2738. READ_SPARM_VAR varRdSparm; /* cmd = 13 (READ_SPARM(64)) */
  2739. READ_STATUS_VAR varRdStatus; /* cmd = 14 (READ_STATUS) */
  2740. READ_RPI_VAR varRdRPI; /* cmd = 15 (READ_RPI(64)) */
  2741. READ_XRI_VAR varRdXRI; /* cmd = 16 (READ_XRI) */
  2742. READ_REV_VAR varRdRev; /* cmd = 17 (READ_REV) */
  2743. READ_LNK_VAR varRdLnk; /* cmd = 18 (READ_LNK_STAT) */
  2744. REG_LOGIN_VAR varRegLogin; /* cmd = 19 (REG_LOGIN(64)) */
  2745. UNREG_LOGIN_VAR varUnregLogin; /* cmd = 20 (UNREG_LOGIN) */
  2746. CLEAR_LA_VAR varClearLA; /* cmd = 22 (CLEAR_LA) */
  2747. DUMP_VAR varDmp; /* Warm Start DUMP mbx cmd */
  2748. UNREG_D_ID_VAR varUnregDID; /* cmd = 0x23 (UNREG_D_ID) */
  2749. CONFIG_FARP_VAR varCfgFarp; /* cmd = 0x25 (CONFIG_FARP)
  2750. * NEW_FEATURE
  2751. */
  2752. struct config_hbq_var varCfgHbq;/* cmd = 0x7c (CONFIG_HBQ) */
  2753. struct update_cfg_var varUpdateCfg; /* cmd = 0x1B (UPDATE_CFG)*/
  2754. CONFIG_PORT_VAR varCfgPort; /* cmd = 0x88 (CONFIG_PORT) */
  2755. struct lpfc_mbx_read_top varReadTop; /* cmd = 0x95 (READ_TOPOLOGY) */
  2756. REG_VPI_VAR varRegVpi; /* cmd = 0x96 (REG_VPI) */
  2757. UNREG_VPI_VAR varUnregVpi; /* cmd = 0x97 (UNREG_VPI) */
  2758. ASYNCEVT_ENABLE_VAR varCfgAsyncEvent; /*cmd = x33 (CONFIG_ASYNC) */
  2759. struct READ_EVENT_LOG_VAR varRdEventLog; /* cmd = 0x38
  2760. * (READ_EVENT_LOG)
  2761. */
  2762. struct config_msi_var varCfgMSI;/* cmd = x30 (CONFIG_MSI) */
  2763. } MAILVARIANTS;
  2764. /*
  2765. * SLI-2 specific structures
  2766. */
  2767. struct lpfc_hgp {
  2768. __le32 cmdPutInx;
  2769. __le32 rspGetInx;
  2770. };
  2771. struct lpfc_pgp {
  2772. __le32 cmdGetInx;
  2773. __le32 rspPutInx;
  2774. };
  2775. struct sli2_desc {
  2776. uint32_t unused1[16];
  2777. struct lpfc_hgp host[MAX_RINGS];
  2778. struct lpfc_pgp port[MAX_RINGS];
  2779. };
  2780. struct sli3_desc {
  2781. struct lpfc_hgp host[MAX_RINGS];
  2782. uint32_t reserved[8];
  2783. uint32_t hbq_put[16];
  2784. };
  2785. struct sli3_pgp {
  2786. struct lpfc_pgp port[MAX_RINGS];
  2787. uint32_t hbq_get[16];
  2788. };
  2789. union sli_var {
  2790. struct sli2_desc s2;
  2791. struct sli3_desc s3;
  2792. struct sli3_pgp s3_pgp;
  2793. };
  2794. typedef struct {
  2795. #ifdef __BIG_ENDIAN_BITFIELD
  2796. uint16_t mbxStatus;
  2797. uint8_t mbxCommand;
  2798. uint8_t mbxReserved:6;
  2799. uint8_t mbxHc:1;
  2800. uint8_t mbxOwner:1; /* Low order bit first word */
  2801. #else /* __LITTLE_ENDIAN_BITFIELD */
  2802. uint8_t mbxOwner:1; /* Low order bit first word */
  2803. uint8_t mbxHc:1;
  2804. uint8_t mbxReserved:6;
  2805. uint8_t mbxCommand;
  2806. uint16_t mbxStatus;
  2807. #endif
  2808. MAILVARIANTS un;
  2809. union sli_var us;
  2810. } MAILBOX_t;
  2811. /*
  2812. * Begin Structure Definitions for IOCB Commands
  2813. */
  2814. typedef struct {
  2815. #ifdef __BIG_ENDIAN_BITFIELD
  2816. uint8_t statAction;
  2817. uint8_t statRsn;
  2818. uint8_t statBaExp;
  2819. uint8_t statLocalError;
  2820. #else /* __LITTLE_ENDIAN_BITFIELD */
  2821. uint8_t statLocalError;
  2822. uint8_t statBaExp;
  2823. uint8_t statRsn;
  2824. uint8_t statAction;
  2825. #endif
  2826. /* statRsn P/F_RJT reason codes */
  2827. #define RJT_BAD_D_ID 0x01 /* Invalid D_ID field */
  2828. #define RJT_BAD_S_ID 0x02 /* Invalid S_ID field */
  2829. #define RJT_UNAVAIL_TEMP 0x03 /* N_Port unavailable temp. */
  2830. #define RJT_UNAVAIL_PERM 0x04 /* N_Port unavailable perm. */
  2831. #define RJT_UNSUP_CLASS 0x05 /* Class not supported */
  2832. #define RJT_DELIM_ERR 0x06 /* Delimiter usage error */
  2833. #define RJT_UNSUP_TYPE 0x07 /* Type not supported */
  2834. #define RJT_BAD_CONTROL 0x08 /* Invalid link conrtol */
  2835. #define RJT_BAD_RCTL 0x09 /* R_CTL invalid */
  2836. #define RJT_BAD_FCTL 0x0A /* F_CTL invalid */
  2837. #define RJT_BAD_OXID 0x0B /* OX_ID invalid */
  2838. #define RJT_BAD_RXID 0x0C /* RX_ID invalid */
  2839. #define RJT_BAD_SEQID 0x0D /* SEQ_ID invalid */
  2840. #define RJT_BAD_DFCTL 0x0E /* DF_CTL invalid */
  2841. #define RJT_BAD_SEQCNT 0x0F /* SEQ_CNT invalid */
  2842. #define RJT_BAD_PARM 0x10 /* Param. field invalid */
  2843. #define RJT_XCHG_ERR 0x11 /* Exchange error */
  2844. #define RJT_PROT_ERR 0x12 /* Protocol error */
  2845. #define RJT_BAD_LENGTH 0x13 /* Invalid Length */
  2846. #define RJT_UNEXPECTED_ACK 0x14 /* Unexpected ACK */
  2847. #define RJT_LOGIN_REQUIRED 0x16 /* Login required */
  2848. #define RJT_TOO_MANY_SEQ 0x17 /* Excessive sequences */
  2849. #define RJT_XCHG_NOT_STRT 0x18 /* Exchange not started */
  2850. #define RJT_UNSUP_SEC_HDR 0x19 /* Security hdr not supported */
  2851. #define RJT_UNAVAIL_PATH 0x1A /* Fabric Path not available */
  2852. #define RJT_VENDOR_UNIQUE 0xFF /* Vendor unique error */
  2853. #define IOERR_SUCCESS 0x00 /* statLocalError */
  2854. #define IOERR_MISSING_CONTINUE 0x01
  2855. #define IOERR_SEQUENCE_TIMEOUT 0x02
  2856. #define IOERR_INTERNAL_ERROR 0x03
  2857. #define IOERR_INVALID_RPI 0x04
  2858. #define IOERR_NO_XRI 0x05
  2859. #define IOERR_ILLEGAL_COMMAND 0x06
  2860. #define IOERR_XCHG_DROPPED 0x07
  2861. #define IOERR_ILLEGAL_FIELD 0x08
  2862. #define IOERR_BAD_CONTINUE 0x09
  2863. #define IOERR_TOO_MANY_BUFFERS 0x0A
  2864. #define IOERR_RCV_BUFFER_WAITING 0x0B
  2865. #define IOERR_NO_CONNECTION 0x0C
  2866. #define IOERR_TX_DMA_FAILED 0x0D
  2867. #define IOERR_RX_DMA_FAILED 0x0E
  2868. #define IOERR_ILLEGAL_FRAME 0x0F
  2869. #define IOERR_EXTRA_DATA 0x10
  2870. #define IOERR_NO_RESOURCES 0x11
  2871. #define IOERR_RESERVED 0x12
  2872. #define IOERR_ILLEGAL_LENGTH 0x13
  2873. #define IOERR_UNSUPPORTED_FEATURE 0x14
  2874. #define IOERR_ABORT_IN_PROGRESS 0x15
  2875. #define IOERR_ABORT_REQUESTED 0x16
  2876. #define IOERR_RECEIVE_BUFFER_TIMEOUT 0x17
  2877. #define IOERR_LOOP_OPEN_FAILURE 0x18
  2878. #define IOERR_RING_RESET 0x19
  2879. #define IOERR_LINK_DOWN 0x1A
  2880. #define IOERR_CORRUPTED_DATA 0x1B
  2881. #define IOERR_CORRUPTED_RPI 0x1C
  2882. #define IOERR_OUT_OF_ORDER_DATA 0x1D
  2883. #define IOERR_OUT_OF_ORDER_ACK 0x1E
  2884. #define IOERR_DUP_FRAME 0x1F
  2885. #define IOERR_LINK_CONTROL_FRAME 0x20 /* ACK_N received */
  2886. #define IOERR_BAD_HOST_ADDRESS 0x21
  2887. #define IOERR_RCV_HDRBUF_WAITING 0x22
  2888. #define IOERR_MISSING_HDR_BUFFER 0x23
  2889. #define IOERR_MSEQ_CHAIN_CORRUPTED 0x24
  2890. #define IOERR_ABORTMULT_REQUESTED 0x25
  2891. #define IOERR_BUFFER_SHORTAGE 0x28
  2892. #define IOERR_DEFAULT 0x29
  2893. #define IOERR_CNT 0x2A
  2894. #define IOERR_SLER_FAILURE 0x46
  2895. #define IOERR_SLER_CMD_RCV_FAILURE 0x47
  2896. #define IOERR_SLER_REC_RJT_ERR 0x48
  2897. #define IOERR_SLER_REC_SRR_RETRY_ERR 0x49
  2898. #define IOERR_SLER_SRR_RJT_ERR 0x4A
  2899. #define IOERR_SLER_RRQ_RJT_ERR 0x4C
  2900. #define IOERR_SLER_RRQ_RETRY_ERR 0x4D
  2901. #define IOERR_SLER_ABTS_ERR 0x4E
  2902. #define IOERR_ELXSEC_KEY_UNWRAP_ERROR 0xF0
  2903. #define IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR 0xF1
  2904. #define IOERR_ELXSEC_CRYPTO_ERROR 0xF2
  2905. #define IOERR_ELXSEC_CRYPTO_COMPARE_ERROR 0xF3
  2906. #define IOERR_DRVR_MASK 0x100
  2907. #define IOERR_SLI_DOWN 0x101 /* ulpStatus - Driver defined */
  2908. #define IOERR_SLI_BRESET 0x102
  2909. #define IOERR_SLI_ABORTED 0x103
  2910. } PARM_ERR;
  2911. typedef union {
  2912. struct {
  2913. #ifdef __BIG_ENDIAN_BITFIELD
  2914. uint8_t Rctl; /* R_CTL field */
  2915. uint8_t Type; /* TYPE field */
  2916. uint8_t Dfctl; /* DF_CTL field */
  2917. uint8_t Fctl; /* Bits 0-7 of IOCB word 5 */
  2918. #else /* __LITTLE_ENDIAN_BITFIELD */
  2919. uint8_t Fctl; /* Bits 0-7 of IOCB word 5 */
  2920. uint8_t Dfctl; /* DF_CTL field */
  2921. uint8_t Type; /* TYPE field */
  2922. uint8_t Rctl; /* R_CTL field */
  2923. #endif
  2924. #define BC 0x02 /* Broadcast Received - Fctl */
  2925. #define SI 0x04 /* Sequence Initiative */
  2926. #define LA 0x08 /* Ignore Link Attention state */
  2927. #define LS 0x80 /* Last Sequence */
  2928. } hcsw;
  2929. uint32_t reserved;
  2930. } WORD5;
  2931. /* IOCB Command template for a generic response */
  2932. typedef struct {
  2933. uint32_t reserved[4];
  2934. PARM_ERR perr;
  2935. } GENERIC_RSP;
  2936. /* IOCB Command template for XMIT / XMIT_BCAST / RCV_SEQUENCE / XMIT_ELS */
  2937. typedef struct {
  2938. struct ulp_bde xrsqbde[2];
  2939. uint32_t xrsqRo; /* Starting Relative Offset */
  2940. WORD5 w5; /* Header control/status word */
  2941. } XR_SEQ_FIELDS;
  2942. /* IOCB Command template for ELS_REQUEST */
  2943. typedef struct {
  2944. struct ulp_bde elsReq;
  2945. struct ulp_bde elsRsp;
  2946. #ifdef __BIG_ENDIAN_BITFIELD
  2947. uint32_t word4Rsvd:7;
  2948. uint32_t fl:1;
  2949. uint32_t myID:24;
  2950. uint32_t word5Rsvd:8;
  2951. uint32_t remoteID:24;
  2952. #else /* __LITTLE_ENDIAN_BITFIELD */
  2953. uint32_t myID:24;
  2954. uint32_t fl:1;
  2955. uint32_t word4Rsvd:7;
  2956. uint32_t remoteID:24;
  2957. uint32_t word5Rsvd:8;
  2958. #endif
  2959. } ELS_REQUEST;
  2960. /* IOCB Command template for RCV_ELS_REQ */
  2961. typedef struct {
  2962. struct ulp_bde elsReq[2];
  2963. uint32_t parmRo;
  2964. #ifdef __BIG_ENDIAN_BITFIELD
  2965. uint32_t word5Rsvd:8;
  2966. uint32_t remoteID:24;
  2967. #else /* __LITTLE_ENDIAN_BITFIELD */
  2968. uint32_t remoteID:24;
  2969. uint32_t word5Rsvd:8;
  2970. #endif
  2971. } RCV_ELS_REQ;
  2972. /* IOCB Command template for ABORT / CLOSE_XRI */
  2973. typedef struct {
  2974. uint32_t rsvd[3];
  2975. uint32_t abortType;
  2976. #define ABORT_TYPE_ABTX 0x00000000
  2977. #define ABORT_TYPE_ABTS 0x00000001
  2978. uint32_t parm;
  2979. #ifdef __BIG_ENDIAN_BITFIELD
  2980. uint16_t abortContextTag; /* ulpContext from command to abort/close */
  2981. uint16_t abortIoTag; /* ulpIoTag from command to abort/close */
  2982. #else /* __LITTLE_ENDIAN_BITFIELD */
  2983. uint16_t abortIoTag; /* ulpIoTag from command to abort/close */
  2984. uint16_t abortContextTag; /* ulpContext from command to abort/close */
  2985. #endif
  2986. } AC_XRI;
  2987. /* IOCB Command template for ABORT_MXRI64 */
  2988. typedef struct {
  2989. uint32_t rsvd[3];
  2990. uint32_t abortType;
  2991. uint32_t parm;
  2992. uint32_t iotag32;
  2993. } A_MXRI64;
  2994. /* IOCB Command template for GET_RPI */
  2995. typedef struct {
  2996. uint32_t rsvd[4];
  2997. uint32_t parmRo;
  2998. #ifdef __BIG_ENDIAN_BITFIELD
  2999. uint32_t word5Rsvd:8;
  3000. uint32_t remoteID:24;
  3001. #else /* __LITTLE_ENDIAN_BITFIELD */
  3002. uint32_t remoteID:24;
  3003. uint32_t word5Rsvd:8;
  3004. #endif
  3005. } GET_RPI;
  3006. /* IOCB Command template for all FCP Initiator commands */
  3007. typedef struct {
  3008. struct ulp_bde fcpi_cmnd; /* FCP_CMND payload descriptor */
  3009. struct ulp_bde fcpi_rsp; /* Rcv buffer */
  3010. uint32_t fcpi_parm;
  3011. uint32_t fcpi_XRdy; /* transfer ready for IWRITE */
  3012. } FCPI_FIELDS;
  3013. /* IOCB Command template for all FCP Target commands */
  3014. typedef struct {
  3015. struct ulp_bde fcpt_Buffer[2]; /* FCP_CMND payload descriptor */
  3016. uint32_t fcpt_Offset;
  3017. uint32_t fcpt_Length; /* transfer ready for IWRITE */
  3018. } FCPT_FIELDS;
  3019. /* SLI-2 IOCB structure definitions */
  3020. /* IOCB Command template for 64 bit XMIT / XMIT_BCAST / XMIT_ELS */
  3021. typedef struct {
  3022. ULP_BDL bdl;
  3023. uint32_t xrsqRo; /* Starting Relative Offset */
  3024. WORD5 w5; /* Header control/status word */
  3025. } XMT_SEQ_FIELDS64;
  3026. /* IOCB Command template for 64 bit RCV_SEQUENCE64 */
  3027. typedef struct {
  3028. struct ulp_bde64 rcvBde;
  3029. uint32_t rsvd1;
  3030. uint32_t xrsqRo; /* Starting Relative Offset */
  3031. WORD5 w5; /* Header control/status word */
  3032. } RCV_SEQ_FIELDS64;
  3033. /* IOCB Command template for ELS_REQUEST64 */
  3034. typedef struct {
  3035. ULP_BDL bdl;
  3036. #ifdef __BIG_ENDIAN_BITFIELD
  3037. uint32_t word4Rsvd:7;
  3038. uint32_t fl:1;
  3039. uint32_t myID:24;
  3040. uint32_t word5Rsvd:8;
  3041. uint32_t remoteID:24;
  3042. #else /* __LITTLE_ENDIAN_BITFIELD */
  3043. uint32_t myID:24;
  3044. uint32_t fl:1;
  3045. uint32_t word4Rsvd:7;
  3046. uint32_t remoteID:24;
  3047. uint32_t word5Rsvd:8;
  3048. #endif
  3049. } ELS_REQUEST64;
  3050. /* IOCB Command template for GEN_REQUEST64 */
  3051. typedef struct {
  3052. ULP_BDL bdl;
  3053. uint32_t xrsqRo; /* Starting Relative Offset */
  3054. WORD5 w5; /* Header control/status word */
  3055. } GEN_REQUEST64;
  3056. /* IOCB Command template for RCV_ELS_REQ64 */
  3057. typedef struct {
  3058. struct ulp_bde64 elsReq;
  3059. uint32_t rcvd1;
  3060. uint32_t parmRo;
  3061. #ifdef __BIG_ENDIAN_BITFIELD
  3062. uint32_t word5Rsvd:8;
  3063. uint32_t remoteID:24;
  3064. #else /* __LITTLE_ENDIAN_BITFIELD */
  3065. uint32_t remoteID:24;
  3066. uint32_t word5Rsvd:8;
  3067. #endif
  3068. } RCV_ELS_REQ64;
  3069. /* IOCB Command template for RCV_SEQ64 */
  3070. struct rcv_seq64 {
  3071. struct ulp_bde64 elsReq;
  3072. uint32_t hbq_1;
  3073. uint32_t parmRo;
  3074. #ifdef __BIG_ENDIAN_BITFIELD
  3075. uint32_t rctl:8;
  3076. uint32_t type:8;
  3077. uint32_t dfctl:8;
  3078. uint32_t ls:1;
  3079. uint32_t fs:1;
  3080. uint32_t rsvd2:3;
  3081. uint32_t si:1;
  3082. uint32_t bc:1;
  3083. uint32_t rsvd3:1;
  3084. #else /* __LITTLE_ENDIAN_BITFIELD */
  3085. uint32_t rsvd3:1;
  3086. uint32_t bc:1;
  3087. uint32_t si:1;
  3088. uint32_t rsvd2:3;
  3089. uint32_t fs:1;
  3090. uint32_t ls:1;
  3091. uint32_t dfctl:8;
  3092. uint32_t type:8;
  3093. uint32_t rctl:8;
  3094. #endif
  3095. };
  3096. /* IOCB Command template for all 64 bit FCP Initiator commands */
  3097. typedef struct {
  3098. ULP_BDL bdl;
  3099. uint32_t fcpi_parm;
  3100. uint32_t fcpi_XRdy; /* transfer ready for IWRITE */
  3101. } FCPI_FIELDS64;
  3102. /* IOCB Command template for all 64 bit FCP Target commands */
  3103. typedef struct {
  3104. ULP_BDL bdl;
  3105. uint32_t fcpt_Offset;
  3106. uint32_t fcpt_Length; /* transfer ready for IWRITE */
  3107. } FCPT_FIELDS64;
  3108. /* IOCB Command template for Async Status iocb commands */
  3109. typedef struct {
  3110. uint32_t rsvd[4];
  3111. uint32_t param;
  3112. #ifdef __BIG_ENDIAN_BITFIELD
  3113. uint16_t evt_code; /* High order bits word 5 */
  3114. uint16_t sub_ctxt_tag; /* Low order bits word 5 */
  3115. #else /* __LITTLE_ENDIAN_BITFIELD */
  3116. uint16_t sub_ctxt_tag; /* High order bits word 5 */
  3117. uint16_t evt_code; /* Low order bits word 5 */
  3118. #endif
  3119. } ASYNCSTAT_FIELDS;
  3120. #define ASYNC_TEMP_WARN 0x100
  3121. #define ASYNC_TEMP_SAFE 0x101
  3122. #define ASYNC_STATUS_CN 0x102
  3123. /* IOCB Command template for CMD_IOCB_RCV_ELS64_CX (0xB7)
  3124. or CMD_IOCB_RCV_SEQ64_CX (0xB5) */
  3125. struct rcv_sli3 {
  3126. #ifdef __BIG_ENDIAN_BITFIELD
  3127. uint16_t ox_id;
  3128. uint16_t seq_cnt;
  3129. uint16_t vpi;
  3130. uint16_t word9Rsvd;
  3131. #else /* __LITTLE_ENDIAN */
  3132. uint16_t seq_cnt;
  3133. uint16_t ox_id;
  3134. uint16_t word9Rsvd;
  3135. uint16_t vpi;
  3136. #endif
  3137. uint32_t word10Rsvd;
  3138. uint32_t acc_len; /* accumulated length */
  3139. struct ulp_bde64 bde2;
  3140. };
  3141. /* Structure used for a single HBQ entry */
  3142. struct lpfc_hbq_entry {
  3143. struct ulp_bde64 bde;
  3144. uint32_t buffer_tag;
  3145. };
  3146. /* IOCB Command template for QUE_XRI64_CX (0xB3) command */
  3147. typedef struct {
  3148. struct lpfc_hbq_entry buff;
  3149. uint32_t rsvd;
  3150. uint32_t rsvd1;
  3151. } QUE_XRI64_CX_FIELDS;
  3152. struct que_xri64cx_ext_fields {
  3153. uint32_t iotag64_low;
  3154. uint32_t iotag64_high;
  3155. uint32_t ebde_count;
  3156. uint32_t rsvd;
  3157. struct lpfc_hbq_entry buff[5];
  3158. };
  3159. struct sli3_bg_fields {
  3160. uint32_t filler[6]; /* word 8-13 in IOCB */
  3161. uint32_t bghm; /* word 14 - BlockGuard High Water Mark */
  3162. /* Bitfields for bgstat (BlockGuard Status - word 15 of IOCB) */
  3163. #define BGS_BIDIR_BG_PROF_MASK 0xff000000
  3164. #define BGS_BIDIR_BG_PROF_SHIFT 24
  3165. #define BGS_BIDIR_ERR_COND_FLAGS_MASK 0x003f0000
  3166. #define BGS_BIDIR_ERR_COND_SHIFT 16
  3167. #define BGS_BG_PROFILE_MASK 0x0000ff00
  3168. #define BGS_BG_PROFILE_SHIFT 8
  3169. #define BGS_INVALID_PROF_MASK 0x00000020
  3170. #define BGS_INVALID_PROF_SHIFT 5
  3171. #define BGS_UNINIT_DIF_BLOCK_MASK 0x00000010
  3172. #define BGS_UNINIT_DIF_BLOCK_SHIFT 4
  3173. #define BGS_HI_WATER_MARK_PRESENT_MASK 0x00000008
  3174. #define BGS_HI_WATER_MARK_PRESENT_SHIFT 3
  3175. #define BGS_REFTAG_ERR_MASK 0x00000004
  3176. #define BGS_REFTAG_ERR_SHIFT 2
  3177. #define BGS_APPTAG_ERR_MASK 0x00000002
  3178. #define BGS_APPTAG_ERR_SHIFT 1
  3179. #define BGS_GUARD_ERR_MASK 0x00000001
  3180. #define BGS_GUARD_ERR_SHIFT 0
  3181. uint32_t bgstat; /* word 15 - BlockGuard Status */
  3182. };
  3183. static inline uint32_t
  3184. lpfc_bgs_get_bidir_bg_prof(uint32_t bgstat)
  3185. {
  3186. return (bgstat & BGS_BIDIR_BG_PROF_MASK) >>
  3187. BGS_BIDIR_BG_PROF_SHIFT;
  3188. }
  3189. static inline uint32_t
  3190. lpfc_bgs_get_bidir_err_cond(uint32_t bgstat)
  3191. {
  3192. return (bgstat & BGS_BIDIR_ERR_COND_FLAGS_MASK) >>
  3193. BGS_BIDIR_ERR_COND_SHIFT;
  3194. }
  3195. static inline uint32_t
  3196. lpfc_bgs_get_bg_prof(uint32_t bgstat)
  3197. {
  3198. return (bgstat & BGS_BG_PROFILE_MASK) >>
  3199. BGS_BG_PROFILE_SHIFT;
  3200. }
  3201. static inline uint32_t
  3202. lpfc_bgs_get_invalid_prof(uint32_t bgstat)
  3203. {
  3204. return (bgstat & BGS_INVALID_PROF_MASK) >>
  3205. BGS_INVALID_PROF_SHIFT;
  3206. }
  3207. static inline uint32_t
  3208. lpfc_bgs_get_uninit_dif_block(uint32_t bgstat)
  3209. {
  3210. return (bgstat & BGS_UNINIT_DIF_BLOCK_MASK) >>
  3211. BGS_UNINIT_DIF_BLOCK_SHIFT;
  3212. }
  3213. static inline uint32_t
  3214. lpfc_bgs_get_hi_water_mark_present(uint32_t bgstat)
  3215. {
  3216. return (bgstat & BGS_HI_WATER_MARK_PRESENT_MASK) >>
  3217. BGS_HI_WATER_MARK_PRESENT_SHIFT;
  3218. }
  3219. static inline uint32_t
  3220. lpfc_bgs_get_reftag_err(uint32_t bgstat)
  3221. {
  3222. return (bgstat & BGS_REFTAG_ERR_MASK) >>
  3223. BGS_REFTAG_ERR_SHIFT;
  3224. }
  3225. static inline uint32_t
  3226. lpfc_bgs_get_apptag_err(uint32_t bgstat)
  3227. {
  3228. return (bgstat & BGS_APPTAG_ERR_MASK) >>
  3229. BGS_APPTAG_ERR_SHIFT;
  3230. }
  3231. static inline uint32_t
  3232. lpfc_bgs_get_guard_err(uint32_t bgstat)
  3233. {
  3234. return (bgstat & BGS_GUARD_ERR_MASK) >>
  3235. BGS_GUARD_ERR_SHIFT;
  3236. }
  3237. #define LPFC_EXT_DATA_BDE_COUNT 3
  3238. struct fcp_irw_ext {
  3239. uint32_t io_tag64_low;
  3240. uint32_t io_tag64_high;
  3241. #ifdef __BIG_ENDIAN_BITFIELD
  3242. uint8_t reserved1;
  3243. uint8_t reserved2;
  3244. uint8_t reserved3;
  3245. uint8_t ebde_count;
  3246. #else /* __LITTLE_ENDIAN */
  3247. uint8_t ebde_count;
  3248. uint8_t reserved3;
  3249. uint8_t reserved2;
  3250. uint8_t reserved1;
  3251. #endif
  3252. uint32_t reserved4;
  3253. struct ulp_bde64 rbde; /* response bde */
  3254. struct ulp_bde64 dbde[LPFC_EXT_DATA_BDE_COUNT]; /* data BDE or BPL */
  3255. uint8_t icd[32]; /* immediate command data (32 bytes) */
  3256. };
  3257. typedef struct _IOCB { /* IOCB structure */
  3258. union {
  3259. GENERIC_RSP grsp; /* Generic response */
  3260. XR_SEQ_FIELDS xrseq; /* XMIT / BCAST / RCV_SEQUENCE cmd */
  3261. struct ulp_bde cont[3]; /* up to 3 continuation bdes */
  3262. RCV_ELS_REQ rcvels; /* RCV_ELS_REQ template */
  3263. AC_XRI acxri; /* ABORT / CLOSE_XRI template */
  3264. A_MXRI64 amxri; /* abort multiple xri command overlay */
  3265. GET_RPI getrpi; /* GET_RPI template */
  3266. FCPI_FIELDS fcpi; /* FCP Initiator template */
  3267. FCPT_FIELDS fcpt; /* FCP target template */
  3268. /* SLI-2 structures */
  3269. struct ulp_bde64 cont64[2]; /* up to 2 64 bit continuation
  3270. * bde_64s */
  3271. ELS_REQUEST64 elsreq64; /* ELS_REQUEST template */
  3272. GEN_REQUEST64 genreq64; /* GEN_REQUEST template */
  3273. RCV_ELS_REQ64 rcvels64; /* RCV_ELS_REQ template */
  3274. XMT_SEQ_FIELDS64 xseq64; /* XMIT / BCAST cmd */
  3275. FCPI_FIELDS64 fcpi64; /* FCP 64 bit Initiator template */
  3276. FCPT_FIELDS64 fcpt64; /* FCP 64 bit target template */
  3277. ASYNCSTAT_FIELDS asyncstat; /* async_status iocb */
  3278. QUE_XRI64_CX_FIELDS quexri64cx; /* que_xri64_cx fields */
  3279. struct rcv_seq64 rcvseq64; /* RCV_SEQ64 and RCV_CONT64 */
  3280. struct sli4_bls_rsp bls_rsp; /* UNSOL ABTS BLS_RSP params */
  3281. uint32_t ulpWord[IOCB_WORD_SZ - 2]; /* generic 6 'words' */
  3282. } un;
  3283. union {
  3284. struct {
  3285. #ifdef __BIG_ENDIAN_BITFIELD
  3286. uint16_t ulpContext; /* High order bits word 6 */
  3287. uint16_t ulpIoTag; /* Low order bits word 6 */
  3288. #else /* __LITTLE_ENDIAN_BITFIELD */
  3289. uint16_t ulpIoTag; /* Low order bits word 6 */
  3290. uint16_t ulpContext; /* High order bits word 6 */
  3291. #endif
  3292. } t1;
  3293. struct {
  3294. #ifdef __BIG_ENDIAN_BITFIELD
  3295. uint16_t ulpContext; /* High order bits word 6 */
  3296. uint16_t ulpIoTag1:2; /* Low order bits word 6 */
  3297. uint16_t ulpIoTag0:14; /* Low order bits word 6 */
  3298. #else /* __LITTLE_ENDIAN_BITFIELD */
  3299. uint16_t ulpIoTag0:14; /* Low order bits word 6 */
  3300. uint16_t ulpIoTag1:2; /* Low order bits word 6 */
  3301. uint16_t ulpContext; /* High order bits word 6 */
  3302. #endif
  3303. } t2;
  3304. } un1;
  3305. #define ulpContext un1.t1.ulpContext
  3306. #define ulpIoTag un1.t1.ulpIoTag
  3307. #define ulpIoTag0 un1.t2.ulpIoTag0
  3308. #ifdef __BIG_ENDIAN_BITFIELD
  3309. uint32_t ulpTimeout:8;
  3310. uint32_t ulpXS:1;
  3311. uint32_t ulpFCP2Rcvy:1;
  3312. uint32_t ulpPU:2;
  3313. uint32_t ulpIr:1;
  3314. uint32_t ulpClass:3;
  3315. uint32_t ulpCommand:8;
  3316. uint32_t ulpStatus:4;
  3317. uint32_t ulpBdeCount:2;
  3318. uint32_t ulpLe:1;
  3319. uint32_t ulpOwner:1; /* Low order bit word 7 */
  3320. #else /* __LITTLE_ENDIAN_BITFIELD */
  3321. uint32_t ulpOwner:1; /* Low order bit word 7 */
  3322. uint32_t ulpLe:1;
  3323. uint32_t ulpBdeCount:2;
  3324. uint32_t ulpStatus:4;
  3325. uint32_t ulpCommand:8;
  3326. uint32_t ulpClass:3;
  3327. uint32_t ulpIr:1;
  3328. uint32_t ulpPU:2;
  3329. uint32_t ulpFCP2Rcvy:1;
  3330. uint32_t ulpXS:1;
  3331. uint32_t ulpTimeout:8;
  3332. #endif
  3333. union {
  3334. struct rcv_sli3 rcvsli3; /* words 8 - 15 */
  3335. /* words 8-31 used for que_xri_cx iocb */
  3336. struct que_xri64cx_ext_fields que_xri64cx_ext_words;
  3337. struct fcp_irw_ext fcp_ext;
  3338. uint32_t sli3Words[24]; /* 96 extra bytes for SLI-3 */
  3339. /* words 8-15 for BlockGuard */
  3340. struct sli3_bg_fields sli3_bg;
  3341. } unsli3;
  3342. #define ulpCt_h ulpXS
  3343. #define ulpCt_l ulpFCP2Rcvy
  3344. #define IOCB_FCP 1 /* IOCB is used for FCP ELS cmds-ulpRsvByte */
  3345. #define IOCB_IP 2 /* IOCB is used for IP ELS cmds */
  3346. #define PARM_UNUSED 0 /* PU field (Word 4) not used */
  3347. #define PARM_REL_OFF 1 /* PU field (Word 4) = R. O. */
  3348. #define PARM_READ_CHECK 2 /* PU field (Word 4) = Data Transfer Length */
  3349. #define PARM_NPIV_DID 3
  3350. #define CLASS1 0 /* Class 1 */
  3351. #define CLASS2 1 /* Class 2 */
  3352. #define CLASS3 2 /* Class 3 */
  3353. #define CLASS_FCP_INTERMIX 7 /* FCP Data->Cls 1, all else->Cls 2 */
  3354. #define IOSTAT_SUCCESS 0x0 /* ulpStatus - HBA defined */
  3355. #define IOSTAT_FCP_RSP_ERROR 0x1
  3356. #define IOSTAT_REMOTE_STOP 0x2
  3357. #define IOSTAT_LOCAL_REJECT 0x3
  3358. #define IOSTAT_NPORT_RJT 0x4
  3359. #define IOSTAT_FABRIC_RJT 0x5
  3360. #define IOSTAT_NPORT_BSY 0x6
  3361. #define IOSTAT_FABRIC_BSY 0x7
  3362. #define IOSTAT_INTERMED_RSP 0x8
  3363. #define IOSTAT_LS_RJT 0x9
  3364. #define IOSTAT_BA_RJT 0xA
  3365. #define IOSTAT_RSVD1 0xB
  3366. #define IOSTAT_RSVD2 0xC
  3367. #define IOSTAT_RSVD3 0xD
  3368. #define IOSTAT_RSVD4 0xE
  3369. #define IOSTAT_NEED_BUFFER 0xF
  3370. #define IOSTAT_DRIVER_REJECT 0x10 /* ulpStatus - Driver defined */
  3371. #define IOSTAT_DEFAULT 0xF /* Same as rsvd5 for now */
  3372. #define IOSTAT_CNT 0x11
  3373. } IOCB_t;
  3374. #define SLI1_SLIM_SIZE (4 * 1024)
  3375. /* Up to 498 IOCBs will fit into 16k
  3376. * 256 (MAILBOX_t) + 140 (PCB_t) + ( 32 (IOCB_t) * 498 ) = < 16384
  3377. */
  3378. #define SLI2_SLIM_SIZE (64 * 1024)
  3379. /* Maximum IOCBs that will fit in SLI2 slim */
  3380. #define MAX_SLI2_IOCB 498
  3381. #define MAX_SLIM_IOCB_SIZE (SLI2_SLIM_SIZE - \
  3382. (sizeof(MAILBOX_t) + sizeof(PCB_t) + \
  3383. sizeof(uint32_t) * MAILBOX_EXT_WSIZE))
  3384. /* HBQ entries are 4 words each = 4k */
  3385. #define LPFC_TOTAL_HBQ_SIZE (sizeof(struct lpfc_hbq_entry) * \
  3386. lpfc_sli_hbq_count())
  3387. struct lpfc_sli2_slim {
  3388. MAILBOX_t mbx;
  3389. uint32_t mbx_ext_words[MAILBOX_EXT_WSIZE];
  3390. PCB_t pcb;
  3391. IOCB_t IOCBs[MAX_SLIM_IOCB_SIZE];
  3392. };
  3393. /*
  3394. * This function checks PCI device to allow special handling for LC HBAs.
  3395. *
  3396. * Parameters:
  3397. * device : struct pci_dev 's device field
  3398. *
  3399. * return 1 => TRUE
  3400. * 0 => FALSE
  3401. */
  3402. static inline int
  3403. lpfc_is_LC_HBA(unsigned short device)
  3404. {
  3405. if ((device == PCI_DEVICE_ID_TFLY) ||
  3406. (device == PCI_DEVICE_ID_PFLY) ||
  3407. (device == PCI_DEVICE_ID_LP101) ||
  3408. (device == PCI_DEVICE_ID_BMID) ||
  3409. (device == PCI_DEVICE_ID_BSMB) ||
  3410. (device == PCI_DEVICE_ID_ZMID) ||
  3411. (device == PCI_DEVICE_ID_ZSMB) ||
  3412. (device == PCI_DEVICE_ID_SAT_MID) ||
  3413. (device == PCI_DEVICE_ID_SAT_SMB) ||
  3414. (device == PCI_DEVICE_ID_RFLY))
  3415. return 1;
  3416. else
  3417. return 0;
  3418. }
  3419. /*
  3420. * Determine if an IOCB failed because of a link event or firmware reset.
  3421. */
  3422. static inline int
  3423. lpfc_error_lost_link(IOCB_t *iocbp)
  3424. {
  3425. return (iocbp->ulpStatus == IOSTAT_LOCAL_REJECT &&
  3426. (iocbp->un.ulpWord[4] == IOERR_SLI_ABORTED ||
  3427. iocbp->un.ulpWord[4] == IOERR_LINK_DOWN ||
  3428. iocbp->un.ulpWord[4] == IOERR_SLI_DOWN));
  3429. }
  3430. #define MENLO_TRANSPORT_TYPE 0xfe
  3431. #define MENLO_CONTEXT 0
  3432. #define MENLO_PU 3
  3433. #define MENLO_TIMEOUT 30
  3434. #define SETVAR_MLOMNT 0x103107
  3435. #define SETVAR_MLORST 0x103007
  3436. #define BPL_ALIGN_SZ 8 /* 8 byte alignment for bpl and mbufs */