lpfc_hw.h 109 KB

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