MMECode.c.html 21 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. MMECode.c
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='mme.c.html' title=' mme.c '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='MMEMode.c.html' title=' MMEMode.c '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*====================================================================*
  22. *
  23. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  24. *
  25. * All rights reserved.
  26. *
  27. * Redistribution and use in source and binary forms, with or
  28. * without modification, are permitted (subject to the limitations
  29. * in the disclaimer below) provided that the following conditions
  30. * are met:
  31. *
  32. * * Redistributions of source code must retain the above copyright
  33. * notice, this list of conditions and the following disclaimer.
  34. *
  35. * * Redistributions in binary form must reproduce the above
  36. * copyright notice, this list of conditions and the following
  37. * disclaimer in the documentation and/or other materials
  38. * provided with the distribution.
  39. *
  40. * * Neither the name of Qualcomm Atheros nor the names of
  41. * its contributors may be used to endorse or promote products
  42. * derived from this software without specific prior written
  43. * permission.
  44. *
  45. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
  46. * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE
  47. * COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR
  48. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  49. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  50. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  51. * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  52. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  53. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  54. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  55. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  56. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  57. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  58. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  59. *
  60. *--------------------------------------------------------------------*/
  61. /*====================================================================*
  62. *
  63. * char const * MMECode (uint16_t MMTYPE, uint8_t MSTATUS)
  64. *
  65. * mme.h
  66. *
  67. * return text for a given message type and status code; search is
  68. * performed using two nested binary searches;
  69. *
  70. D
  71. * a given vendor specific status code may mean something different
  72. * for each message type; this table maps message types and codes to
  73. * strings; it is bulky but takes less space than many small tables;
  74. * define MMEPASSFAIL as 0 to suppress the table without disturbing
  75. * other code;
  76. *
  77. * the bootloader and firmware share some message types but return
  78. * different status codes for the same message type and error; two
  79. * MMEs in particular, VS_WR_MEM and VS_ST_MAC are normally used
  80. * only with the Bootloader and so we define SOFTLOADER as 1
  81. * causing Bootloader/Softloader codes to replace the firmware
  82. * codes;
  83. *
  84. *
  85. * Contributor(s):
  86. * Charles Maier &lt;cmaier@qca.qualcomm.com&gt;
  87. *
  88. *--------------------------------------------------------------------*/
  89. #ifndef MMECODE_SOURCE
  90. #define MMECODE_SOURCE
  91. #include &lt;stdio.h&gt;
  92. #include &lt;stdint.h&gt;
  93. #include &quot;../mme/mme.h&quot;
  94. #include &quot;../tools/symbol.h&quot;
  95. #include &quot;../tools/endian.h&quot;
  96. #ifndef MMEPASSFAIL
  97. static struct mme_code
  98. {
  99. uint16_t type;
  100. uint8_t code;
  101. char const * text;
  102. }
  103. mme_codes [] =
  104. {
  105. {
  106. 0x8005,
  107. 0x01,
  108. &quot;Read Stopped&quot;
  109. },
  110. {
  111. 0x8005,
  112. 0x03,
  113. &quot;Stopped with Valid Read&quot;
  114. },
  115. {
  116. 0x8005,
  117. 0x05,
  118. &quot;Reached End&quot;
  119. },
  120. {
  121. 0x8005,
  122. 0x07,
  123. &quot;Stopped, Valid Read, Reached End - All Done! Go Away!&quot;
  124. },
  125. {
  126. 0x8005,
  127. 0x80,
  128. &quot;Invalid Index&quot;
  129. },
  130. {
  131. 0x8005,
  132. 0x81,
  133. &quot;Invalid Word Count&quot;
  134. },
  135. {
  136. 0x8005,
  137. 0x82,
  138. &quot;No Stop Before Read&quot;
  139. },
  140. {
  141. 0x8005,
  142. 0x83,
  143. &quot;Invalid MME&quot;
  144. },
  145. #ifdef SOFTLOADER
  146. {
  147. 0xA005,
  148. 0x14,
  149. &quot;Bad Checksum&quot;
  150. },
  151. {
  152. 0xA005,
  153. 0x1C,
  154. &quot;Bad Length&quot;
  155. },
  156. {
  157. 0xA005,
  158. 0x38,
  159. &quot;Bad Address&quot;
  160. },
  161. {
  162. 0xA005,
  163. 0x3C,
  164. &quot;Bad Data Alignment&quot;
  165. },
  166. #else
  167. {
  168. 0xA005,
  169. 0x10,
  170. &quot;Bad Address&quot;
  171. },
  172. {
  173. 0xA005,
  174. 0x14,
  175. &quot;Bad Length&quot;
  176. },
  177. #endif
  178. {
  179. 0xA009,
  180. 0x10,
  181. &quot;Bad Offset&quot;
  182. },
  183. {
  184. 0xA009,
  185. 0x14,
  186. &quot;Bad Length&quot;
  187. },
  188. {
  189. 0xA00D,
  190. 0x10,
  191. &quot;Bad Module ID&quot;
  192. },
  193. #ifdef SOFTLOADER
  194. {
  195. 0xA00D,
  196. 0x14,
  197. &quot;Bad Image Checksum&quot;
  198. },
  199. {
  200. 0xA00D,
  201. 0x1C,
  202. &quot;Bad Image Length&quot;
  203. },
  204. {
  205. 0xA00D,
  206. 0x38,
  207. &quot;Bad Image Load Address&quot;
  208. },
  209. {
  210. 0xA00D,
  211. 0x3C,
  212. &quot;Bad Data Alignment&quot;
  213. },
  214. {
  215. 0xA00D,
  216. 0x40,
  217. &quot;Bad Start Address&quot;
  218. },
  219. #else
  220. {
  221. 0xA00D,
  222. 0x38,
  223. &quot;Bad Command&quot;
  224. },
  225. {
  226. 0xA00D,
  227. 0x40,
  228. &quot;Failed to Lock NVM&quot;
  229. },
  230. #endif
  231. {
  232. 0xA011,
  233. 0x10,
  234. &quot;No Flash Memory&quot;
  235. },
  236. {
  237. 0xA01D,
  238. 0x01,
  239. &quot;Device Failed to Reset&quot;
  240. },
  241. {
  242. 0xA01D,
  243. 0x02,
  244. &quot;Device is Busy&quot;
  245. },
  246. {
  247. 0xA021,
  248. 0x10,
  249. &quot;Bad Module&quot;
  250. },
  251. {
  252. 0xA021,
  253. 0x12,
  254. &quot;Bad Length&quot;
  255. },
  256. {
  257. 0xA021,
  258. 0x14,
  259. &quot;Bad Checksum&quot;
  260. },
  261. {
  262. 0xA021,
  263. 0x20,
  264. &quot;Bad Offset&quot;
  265. },
  266. {
  267. 0xA021,
  268. 0x40,
  269. &quot;Operation Blocked&quot;
  270. },
  271. {
  272. 0xA021,
  273. 0x50,
  274. &quot;Fail to lock NVM&quot;
  275. },
  276. {
  277. 0xA025,
  278. 0x10,
  279. &quot;Bad Module&quot;
  280. },
  281. {
  282. 0xA025,
  283. 0x12,
  284. &quot;Bad Length&quot;
  285. },
  286. {
  287. 0xA025,
  288. 0x14,
  289. &quot;Bad Checksum&quot;
  290. },
  291. {
  292. 0xA025,
  293. 0x20,
  294. &quot;Unexpected Offset&quot;
  295. },
  296. {
  297. 0xA025,
  298. 0x50,
  299. &quot;Fail to lock NVM&quot;
  300. },
  301. {
  302. 0xA025,
  303. 0x58,
  304. &quot;DAK Mismatch&quot;
  305. },
  306. {
  307. 0xA029,
  308. 0x10,
  309. &quot;Bad Module&quot;
  310. },
  311. {
  312. 0xA029,
  313. 0x14,
  314. &quot;No Flash Memory&quot;
  315. },
  316. {
  317. 0xA029,
  318. 0x18,
  319. &quot;Not enough NVRAM&quot;
  320. },
  321. {
  322. 0xA029,
  323. 0x1C,
  324. &quot;Bad Header Checksum&quot;
  325. },
  326. {
  327. 0xA029,
  328. 0x20,
  329. &quot;Bad Image Checksum&quot;
  330. },
  331. {
  332. 0xA029,
  333. 0x24,
  334. &quot;Bad PIB&quot;
  335. },
  336. {
  337. 0xA029,
  338. 0x28,
  339. &quot;Softloader Too Large&quot;
  340. },
  341. {
  342. 0xA029,
  343. 0x2C,
  344. &quot;Firmware Too Large&quot;
  345. },
  346. {
  347. 0xA029,
  348. 0x42,
  349. &quot;Firmware without PIB&quot;
  350. },
  351. {
  352. 0xA029,
  353. 0x44,
  354. &quot;Bad PIB Checksum&quot;
  355. },
  356. {
  357. 0xA029,
  358. 0x46,
  359. &quot;DAK Not Zero&quot;
  360. },
  361. {
  362. 0xA029,
  363. 0x48,
  364. &quot;MAC Mismatch&quot;
  365. },
  366. {
  367. 0xA029,
  368. 0x50,
  369. &quot;MFG HFID Mismatch&quot;
  370. },
  371. {
  372. 0xA029,
  373. 0x52,
  374. &quot;Bad Bind Factory Defaults&quot;
  375. },
  376. {
  377. 0xA029,
  378. 0x54,
  379. &quot;Bad Bind Template PIB&quot;
  380. },
  381. {
  382. 0xA029,
  383. 0x56,
  384. &quot;Bad Bind Working PIB&quot;
  385. },
  386. {
  387. 0xA029,
  388. 0x58,
  389. &quot;Error Computing PIB Checksum&quot;
  390. },
  391. {
  392. 0xA029,
  393. 0x5A,
  394. &quot;Bad Bind Scratch PIB&quot;
  395. },
  396. {
  397. 0xA029,
  398. 0x5C,
  399. &quot;No Firmware Version&quot;
  400. },
  401. {
  402. 0xA029,
  403. 0x5E,
  404. &quot;Version Mismatch&quot;
  405. },
  406. {
  407. 0xA029,
  408. 0x60,
  409. &quot;Bad 01PIB Checksum&quot;
  410. },
  411. {
  412. 0xA029,
  413. 0x62,
  414. &quot;Bad 02PIB Checksum&quot;
  415. },
  416. {
  417. 0xA029,
  418. 0x64,
  419. &quot;Bad WPIB Checksum&quot;
  420. },
  421. {
  422. 0xA029,
  423. 0x66,
  424. &quot;Illegal Firmware Revision&quot;
  425. },
  426. {
  427. 0xA031,
  428. 0x01,
  429. &quot;Bad Control&quot;
  430. },
  431. {
  432. 0xA031,
  433. 0x02,
  434. &quot;Bad Direction&quot;
  435. },
  436. {
  437. 0xA031,
  438. 0x10,
  439. &quot;Bad Link ID&quot;
  440. },
  441. {
  442. 0xA031,
  443. 0x20,
  444. &quot;Bad MAC Address&quot;
  445. },
  446. {
  447. 0xA035,
  448. 0x10,
  449. &quot;Bad Control&quot;
  450. },
  451. {
  452. 0xA049,
  453. 0x20,
  454. &quot;Invalid Duration&quot;
  455. },
  456. {
  457. 0xA049,
  458. 0x12,
  459. &quot;Invalid Length&quot;
  460. },
  461. {
  462. 0xA049,
  463. 0x24,
  464. &quot;Already Set&quot;
  465. },
  466. {
  467. 0xA051,
  468. 0x10,
  469. &quot;Bad PEKS&quot;
  470. },
  471. {
  472. 0xA051,
  473. 0x11,
  474. &quot;Bad PIB&quot;
  475. },
  476. {
  477. 0xA051,
  478. 0x12,
  479. &quot;Bad PEKS Encrypted Payload&quot;
  480. },
  481. {
  482. 0xA051,
  483. 0x13,
  484. &quot;Remote Failure&quot;
  485. },
  486. {
  487. 0xA051,
  488. 0x14,
  489. &quot;Bad Remote Response&quot;
  490. },
  491. {
  492. 0xA051,
  493. 0x15,
  494. &quot;Remote Decryption Failed&quot;
  495. },
  496. {
  497. 0xA059,
  498. 0x10,
  499. &quot;No Flash Memory&quot;
  500. },
  501. {
  502. 0xA05D,
  503. 0x30,
  504. &quot;Bad Checksum&quot;
  505. },
  506. {
  507. 0xA05D,
  508. 0x34,
  509. &quot;BIST Failed&quot;
  510. },
  511. {
  512. 0xA065,
  513. 0x10,
  514. &quot;No Flash Memory&quot;
  515. },
  516. {
  517. 0xA069,
  518. 0x01,
  519. &quot;Failed&quot;
  520. },
  521. {
  522. 0xA069,
  523. 0x02,
  524. &quot;Not Supported&quot;
  525. },
  526. {
  527. 0xA06D,
  528. 0x01,
  529. &quot;Bad Control&quot;
  530. },
  531. {
  532. 0xA06D,
  533. 0x02,
  534. &quot;Success Write&quot;
  535. },
  536. {
  537. 0xA06D,
  538. 0x03,
  539. &quot;Bad Write Parameter&quot;
  540. },
  541. {
  542. 0xA071,
  543. 0x01,
  544. &quot;Bad MAC Address&quot;
  545. },
  546. {
  547. 0xA071,
  548. 0x02,
  549. &quot;Bad TMSLOT&quot;
  550. },
  551. {
  552. 0xA081,
  553. 0x10,
  554. &quot;Bad Module ID&quot;
  555. },
  556. {
  557. 0xA081,
  558. 0x14,
  559. &quot;No Flash Memory&quot;
  560. },
  561. {
  562. 0xA081,
  563. 0x18,
  564. &quot;Not Enough Flash Memory&quot;
  565. },
  566. {
  567. 0xA081,
  568. 0x1C,
  569. &quot;Bad Image Header Checksum&quot;
  570. },
  571. {
  572. 0xA081,
  573. 0x20,
  574. &quot;Bad Image Checksum&quot;
  575. },
  576. {
  577. 0xA081,
  578. 0x24,
  579. &quot;Invalid PIB&quot;
  580. },
  581. {
  582. 0xA081,
  583. 0x28,
  584. &quot;Softloader Too Large&quot;
  585. },
  586. {
  587. 0xA081,
  588. 0x2C,
  589. &quot;Firmware File Too Large&quot;
  590. },
  591. {
  592. 0xA081,
  593. 0x42,
  594. &quot;Firmware without PIB&quot;
  595. },
  596. {
  597. 0xA081,
  598. 0x44,
  599. &quot;Bad PIB Checksum&quot;
  600. },
  601. {
  602. 0xA081,
  603. 0x46,
  604. &quot;DAK Not Zero&quot;
  605. },
  606. {
  607. 0xA081,
  608. 0x48,
  609. &quot;DAC Mismatch&quot;
  610. },
  611. {
  612. 0xA081,
  613. 0x50,
  614. &quot;MFG HFID Mismatch&quot;
  615. },
  616. {
  617. 0xA081,
  618. 0x52,
  619. &quot;Bad Bind Factory Defaults&quot;
  620. },
  621. {
  622. 0xA081,
  623. 0x54,
  624. &quot;Bad Bind Template PIB&quot;
  625. },
  626. {
  627. 0xA081,
  628. 0x56,
  629. &quot;Bad Bind Working PIB&quot;
  630. },
  631. {
  632. 0xA081,
  633. 0x58,
  634. &quot;DAK Mismatch&quot;
  635. },
  636. {
  637. 0xA081,
  638. 0x5A,
  639. &quot;Failed to Lock NVM&quot;
  640. },
  641. {
  642. 0xA089,
  643. 0x01,
  644. &quot;Bad Control&quot;
  645. },
  646. {
  647. 0xA089,
  648. 0x02,
  649. &quot;Bad Volatility&quot;
  650. },
  651. {
  652. 0xA089,
  653. 0x03,
  654. &quot;Bad Classifier&quot;
  655. },
  656. {
  657. 0xA089,
  658. 0x04,
  659. &quot;Classifier table full&quot;
  660. },
  661. {
  662. 0xA089,
  663. 0x05,
  664. &quot;Classifier exists with different action&quot;
  665. },
  666. {
  667. 0xA089,
  668. 0x06,
  669. &quot;Classifier not found&quot;
  670. },
  671. {
  672. 0xA08D,
  673. 0x10,
  674. &quot;Refused&quot;
  675. },
  676. {
  677. 0xA08D,
  678. 0x11,
  679. &quot;Refused&quot;
  680. },
  681. {
  682. 0xA08F,
  683. 0x10,
  684. &quot;Error&quot;
  685. },
  686. {
  687. 0xA091,
  688. 0x01,
  689. &quot;Unknown Peer Address&quot;
  690. },
  691. {
  692. 0xA091,
  693. 0x02,
  694. &quot;Unknown Slot Number&quot;
  695. },
  696. {
  697. 0xA099,
  698. 0x01,
  699. &quot;Destination Address Misaligned&quot;
  700. },
  701. {
  702. 0xA099,
  703. 0x02,
  704. &quot;Entry Point Misaligned&quot;
  705. },
  706. {
  707. 0xA099,
  708. 0x04,
  709. &quot;Entry Point Out-of-Bounds&quot;
  710. },
  711. {
  712. 0xA099,
  713. 0x08,
  714. &quot;Bad Checksum&quot;
  715. },
  716. {
  717. 0xA099,
  718. 0x10,
  719. &quot;Out of Memory&quot;
  720. },
  721. {
  722. 0xA099,
  723. 0x20,
  724. &quot;Offset or Length Mismatch&quot;
  725. },
  726. {
  727. 0xA099,
  728. 0x40,
  729. &quot;Memory not Operational&quot;
  730. },
  731. {
  732. 0xA099,
  733. 0x80,
  734. &quot;Bad Length&quot;
  735. },
  736. {
  737. 0xA0B1,
  738. 0x10,
  739. &quot;Invalid Number of Module Operations&quot;
  740. },
  741. {
  742. 0xA0B1,
  743. 0x11,
  744. &quot;Invalid Module Operation ID&quot;
  745. },
  746. {
  747. 0xA0B1,
  748. 0x12,
  749. &quot;Invalid Session ID&quot;
  750. },
  751. {
  752. 0xA0B1,
  753. 0x13,
  754. &quot;Invalid Num Module Operation Specific Data&quot;
  755. },
  756. {
  757. 0xA0B1,
  758. 0x14,
  759. &quot;Module ID not found&quot;
  760. },
  761. {
  762. 0xA0B1,
  763. 0x15,
  764. &quot;Invalid Module Length&quot;
  765. },
  766. {
  767. 0xA0B1,
  768. 0x16,
  769. &quot;Invalid Module Index&quot;
  770. },
  771. {
  772. 0xA0B1,
  773. 0x17,
  774. &quot;Invalid Data Length&quot;
  775. },
  776. {
  777. 0xA0B1,
  778. 0x18,
  779. &quot;Unexpected Offset&quot;
  780. },
  781. {
  782. 0xA0B1,
  783. 0x19,
  784. &quot;Invalid Commit Action Code&quot;
  785. },
  786. {
  787. 0xA0B1,
  788. 0x1A,
  789. &quot;Operation Block by previous Commit&quot;
  790. },
  791. {
  792. 0xA0B1,
  793. 0x1B,
  794. &quot;Duplicate ModuleID/SubID&quot;
  795. },
  796. {
  797. 0xA0B1,
  798. 0x1C,
  799. &quot;Invalid ModuleID/SubID&quot;
  800. },
  801. {
  802. 0xA0B1,
  803. 0x20,
  804. &quot;No Flash Memory&quot;
  805. },
  806. {
  807. 0xA0B1,
  808. 0x21,
  809. &quot;Not Enough Flash Memory&quot;
  810. },
  811. {
  812. 0xA0B1,
  813. 0x22,
  814. &quot;Unsupported Flash memory Type&quot;
  815. },
  816. {
  817. 0xA0B1,
  818. 0x23,
  819. &quot;Can't Lock Flash Memory&quot;
  820. },
  821. {
  822. 0xA0B1,
  823. 0x24,
  824. &quot;Can't Write Flash Memory&quot;
  825. },
  826. {
  827. 0xA0B1,
  828. 0x30,
  829. &quot;Bad Module Checksum&quot;
  830. },
  831. {
  832. 0xA0B1,
  833. 0x31,
  834. &quot;Individual Module Error&quot;
  835. },
  836. {
  837. 0xA0B1,
  838. 0x32,
  839. &quot;Module not available in NVM or Memory&quot;
  840. },
  841. {
  842. 0xA0B1,
  843. 0x40,
  844. &quot;Invalid Header Checksum&quot;
  845. },
  846. {
  847. 0xA0B1,
  848. 0x41,
  849. &quot;Invalid Firmware Image Checksum&quot;
  850. },
  851. {
  852. 0xA0B1,
  853. 0x42,
  854. &quot;Softloader Image is Too Large&quot;
  855. },
  856. {
  857. 0xA0B1,
  858. 0x43,
  859. &quot;Firmware Image is Too Large&quot;
  860. },
  861. {
  862. 0xA0B1,
  863. 0x44,
  864. &quot;Invalid PIB Checksum&quot;
  865. },
  866. {
  867. 0xA0B1,
  868. 0x45,
  869. &quot;No Firmware Version&quot;
  870. },
  871. {
  872. 0xA0B1,
  873. 0x46,
  874. &quot;FW Commit but no PIB&quot;
  875. },
  876. {
  877. 0xA0B1,
  878. 0x47,
  879. &quot;Major Version Mismatch&quot;
  880. },
  881. {
  882. 0xA0B1,
  883. 0x48,
  884. &quot;Minor Version Mismatch&quot;
  885. },
  886. {
  887. 0xA0B1,
  888. 0x50,
  889. &quot;Invalid PIB&quot;
  890. },
  891. {
  892. 0xA0B1,
  893. 0x51,
  894. &quot;DAK Not Zero&quot;
  895. },
  896. {
  897. 0xA0B1,
  898. 0x52,
  899. &quot;MAC Mismatch&quot;
  900. },
  901. {
  902. 0xA0B1,
  903. 0x53,
  904. &quot;DAK Mismatch&quot;
  905. },
  906. {
  907. 0xA0B1,
  908. 0x54,
  909. &quot;Manufacturer HFID Mismatch&quot;
  910. },
  911. {
  912. 0xA0B1,
  913. 0x55,
  914. &quot;Bad Bind to Factory Default PIB&quot;
  915. },
  916. {
  917. 0xA0B1,
  918. 0x56,
  919. &quot;Bad Bind to Template PIB&quot;
  920. },
  921. {
  922. 0xA0B1,
  923. 0x57,
  924. &quot;Bad Bind to Working PIB&quot;
  925. },
  926. {
  927. 0xA0B1,
  928. 0x58,
  929. &quot;Bad Bind Scratch PIB&quot;
  930. },
  931. {
  932. 0xA0B1,
  933. 0x59,
  934. &quot;Error Generating Checksum Scratch PIB&quot;
  935. },
  936. {
  937. 0xA0B1,
  938. 0x5A,
  939. &quot;Checksum Error O1 PIB&quot;
  940. },
  941. {
  942. 0xA0B1,
  943. 0x5B,
  944. &quot;Checksum Error O2 PIB&quot;
  945. },
  946. {
  947. 0xA0B1,
  948. 0x5C,
  949. &quot;Checksum Error Working PIB&quot;
  950. },
  951. {
  952. 0xA0B1,
  953. 0x61,
  954. &quot;Unexpected Module Operation&quot;
  955. },
  956. {
  957. 0xA0B1,
  958. 0x62,
  959. &quot;Not Enough Resources&quot;
  960. },
  961. {
  962. 0xA0B1,
  963. 0x63,
  964. &quot;Received Module Data Out of Order&quot;
  965. },
  966. {
  967. 0xA0B1,
  968. 0x64,
  969. &quot;No PIB Version&quot;
  970. },
  971. {
  972. 0xA0B1,
  973. 0x70,
  974. &quot;Module Length Mismatch with Module Info&quot;
  975. },
  976. {
  977. 0xA0B1,
  978. 0x71,
  979. &quot;No NVM Softloader Present in Flash Memory&quot;
  980. },
  981. {
  982. 0xA0C1,
  983. 0x03,
  984. &quot;Invalid Classifier&quot;
  985. },
  986. {
  987. 0xA0C1,
  988. 0x04,
  989. &quot;Already too many Classifiers&quot;
  990. },
  991. {
  992. 0xA0C1,
  993. 0x05,
  994. &quot;Classifier exists with different Classification Action&quot;
  995. },
  996. {
  997. 0xA0C1,
  998. 0x07,
  999. &quot;Link Already in Progress&quot;
  1000. },
  1001. {
  1002. 0xA0C1,
  1003. 0x08,
  1004. &quot;Invalid Configuration&quot;
  1005. },
  1006. {
  1007. 0xA0C1,
  1008. 0x10,
  1009. &quot;Invalid CSPEC Version&quot;
  1010. },
  1011. {
  1012. 0xA0C1,
  1013. 0x11,
  1014. &quot;Invalid CSPEC&quot;
  1015. },
  1016. {
  1017. 0xA0C1,
  1018. 0x20,
  1019. &quot;Out of Local Resources&quot;
  1020. },
  1021. {
  1022. 0xA0C1,
  1023. 0x30,
  1024. &quot;Invalid Peer&quot;
  1025. },
  1026. {
  1027. 0xA0C1,
  1028. 0x31,
  1029. &quot;Peer Confirm Timed out&quot;
  1030. },
  1031. {
  1032. 0xA0C1,
  1033. 0x40,
  1034. &quot;Peer rejection&quot;
  1035. },
  1036. {
  1037. 0xA0C5,
  1038. 0x01,
  1039. &quot;Invalid Modification Control&quot;
  1040. },
  1041. {
  1042. 0xA0C5,
  1043. 0x06,
  1044. &quot;CID Not Found&quot;
  1045. },
  1046. {
  1047. 0xA0C5,
  1048. 0x07,
  1049. &quot;Link Update in Progress, try again later&quot;
  1050. },
  1051. {
  1052. 0xA0C9,
  1053. 0x06,
  1054. &quot;CID Not Found&quot;
  1055. },
  1056. {
  1057. 0xA0C9,
  1058. 0x07,
  1059. &quot;Link Update in Progress. Try again later&quot;
  1060. },
  1061. {
  1062. 0xA0C9,
  1063. 0x31,
  1064. &quot;Peer Confirm Timed out&quot;
  1065. },
  1066. {
  1067. 0xA0CD,
  1068. 0x01,
  1069. &quot;Invalid Request Type&quot;
  1070. },
  1071. {
  1072. 0xA0CD,
  1073. 0x04,
  1074. &quot;Too Many Requests&quot;,
  1075. },
  1076. {
  1077. 0xA0CD,
  1078. 0x06,
  1079. &quot;CID Not Found&quot;
  1080. },
  1081. {
  1082. 0xA0CD,
  1083. 0x10,
  1084. &quot;Invalid CSPEC Version&quot;
  1085. },
  1086. {
  1087. 0xA0CD,
  1088. 0x31,
  1089. &quot;Peer Confirm Timed out&quot;
  1090. },
  1091. {
  1092. 0xA0D1,
  1093. 0x01,
  1094. &quot;Unsupported&quot;
  1095. },
  1096. {
  1097. 0xA0D1,
  1098. 0x02,
  1099. &quot;Process Failed&quot;
  1100. },
  1101. {
  1102. 0xA0D1,
  1103. 0x02,
  1104. &quot;Process Failed&quot;
  1105. },
  1106. {
  1107. 0xA0D9,
  1108. 0x01,
  1109. &quot;Bad VersionID or InfoID&quot;
  1110. },
  1111. {
  1112. 0xA0DD,
  1113. 0x01,
  1114. &quot;No Enumeration Table&quot;
  1115. },
  1116. {
  1117. 0xA0F5,
  1118. 0x01,
  1119. &quot;Bad Request Type&quot;
  1120. },
  1121. {
  1122. 0xA0F5,
  1123. 0x02,
  1124. &quot;FMI Not Zero&quot;
  1125. },
  1126. {
  1127. 0xA0F5,
  1128. 0x03,
  1129. &quot;Invalid Command&quot;
  1130. },
  1131. {
  1132. 0xA0F5,
  1133. 0x04,
  1134. &quot;Bad Index&quot;
  1135. },
  1136. {
  1137. 0xA0F5,
  1138. 0x05,
  1139. &quot;Bad Value Count&quot;
  1140. },
  1141. {
  1142. 0xA0F5,
  1143. 0x06,
  1144. &quot;Capture Already Started&quot;
  1145. },
  1146. {
  1147. 0xA0F5,
  1148. 0x07,
  1149. &quot;Data Invalid&quot;
  1150. },
  1151. {
  1152. 0xA0F5,
  1153. 0x08,
  1154. &quot;Bad Gain Value&quot;
  1155. },
  1156. {
  1157. 0xA0F5,
  1158. 0x10,
  1159. &quot;Bad MAC Address&quot;
  1160. },
  1161. {
  1162. 0xA0F5,
  1163. 0x11,
  1164. &quot;Bad Tone Map Index&quot;
  1165. },
  1166. {
  1167. 0xA0F5,
  1168. 0x12,
  1169. &quot;Capture Failed&quot;
  1170. },
  1171. {
  1172. 0xA0F5,
  1173. 0x13,
  1174. &quot;No Data Available&quot;
  1175. },
  1176. {
  1177. 0xA0F9,
  1178. 0x01,
  1179. &quot;Get Property Failure&quot;
  1180. },
  1181. {
  1182. 0xA0F9,
  1183. 0x02,
  1184. &quot;Unsupported Property&quot;
  1185. },
  1186. {
  1187. 0xA0F9,
  1188. 0x03,
  1189. &quot;Unsupported Property Version&quot;
  1190. },
  1191. {
  1192. 0xA101,
  1193. 0x01,
  1194. &quot;Set Property Failure&quot;
  1195. },
  1196. {
  1197. 0xA101,
  1198. 0x02,
  1199. &quot;Unsupported Property&quot;
  1200. },
  1201. {
  1202. 0xA101,
  1203. 0x03,
  1204. &quot;Unsupported Property Version&quot;
  1205. },
  1206. {
  1207. 0xA101,
  1208. 0x04,
  1209. &quot;Property Not Persistent&quot;
  1210. },
  1211. {
  1212. 0xA101,
  1213. 0x05,
  1214. &quot;Flash Memory Failure&quot;
  1215. },
  1216. {
  1217. 0xA101,
  1218. 0x06,
  1219. &quot;Bad Option for Supported Property&quot;
  1220. },
  1221. {
  1222. 0xA101,
  1223. 0x07,
  1224. &quot;Invalid Property Data&quot;
  1225. },
  1226. {
  1227. 0xA101,
  1228. 0x08,
  1229. &quot;Bad Property Data Length&quot;
  1230. },
  1231. {
  1232. 0xA105,
  1233. 0x01,
  1234. &quot;Buffer Not Available&quot;
  1235. },
  1236. {
  1237. 0xA109,
  1238. 0x01,
  1239. &quot;No Flash Memory&quot;
  1240. },
  1241. {
  1242. 0xA109,
  1243. 0x02,
  1244. &quot;Invalid Flash Sector&quot;
  1245. },
  1246. {
  1247. 0xA109,
  1248. 0x03,
  1249. &quot;Current DAK Mismatch&quot;
  1250. },
  1251. {
  1252. 0xA109,
  1253. 0x04,
  1254. &quot;Flash is Busy&quot;
  1255. },
  1256. {
  1257. 0xA109,
  1258. 0x05,
  1259. &quot;No Access to Flash&quot;
  1260. },
  1261. {
  1262. 0xA109,
  1263. 0x06,
  1264. &quot;Unsupported Chip&quot;
  1265. },
  1266. {
  1267. 0xA109,
  1268. 0x07,
  1269. &quot;Unspecified Error&quot;
  1270. },
  1271. {
  1272. 0xA10D,
  1273. 0x01,
  1274. &quot;Option Not Supported&quot;
  1275. },
  1276. {
  1277. 0xA10D,
  1278. 0x02,
  1279. &quot;No Flash Memory&quot;
  1280. },
  1281. {
  1282. 0xA10D,
  1283. 0x03,
  1284. &quot;Pending Self Test&quot;
  1285. },
  1286. {
  1287. 0xA10D,
  1288. 0x04,
  1289. &quot;Flash Activity Conflict&quot;
  1290. },
  1291. {
  1292. 0xA10D,
  1293. 0x05,
  1294. &quot;Bad Parameter&quot;
  1295. },
  1296. {
  1297. 0xA111,
  1298. 0x01,
  1299. &quot;Option Not Supported&quot;
  1300. },
  1301. {
  1302. 0xA111,
  1303. 0x02,
  1304. &quot;Self Test Finished&quot;
  1305. },
  1306. {
  1307. 0xA111,
  1308. 0x03,
  1309. &quot;Self Test Pending&quot;
  1310. },
  1311. {
  1312. 0xA111,
  1313. 0x04,
  1314. &quot;Self Test In Progress&quot;
  1315. },
  1316. {
  1317. 0xA111,
  1318. 0x05,
  1319. &quot;Self Test No Result&quot;
  1320. },
  1321. {
  1322. 0xA111,
  1323. 0x06,
  1324. &quot;Self Test Aborted&quot;
  1325. },
  1326. {
  1327. 0xA111,
  1328. 0x07,
  1329. &quot;No Flash Memory&quot;
  1330. },
  1331. {
  1332. 0xA115,
  1333. 0x01,
  1334. &quot;Interface Not Supported&quot;
  1335. },
  1336. {
  1337. 0xA115,
  1338. 0x02,
  1339. &quot;Slave Not Found&quot;
  1340. },
  1341. {
  1342. 0xA115,
  1343. 0x03,
  1344. &quot;Wrong Parameter&quot;
  1345. },
  1346. {
  1347. 0xA119,
  1348. 0x01,
  1349. &quot;Bad Version&quot;
  1350. },
  1351. {
  1352. 0xA119,
  1353. 0x02,
  1354. &quot;Bad Argument&quot;
  1355. },
  1356. {
  1357. 0xA119,
  1358. 0x03,
  1359. &quot;Too Many Slaves&quot;
  1360. },
  1361. {
  1362. 0xA119,
  1363. 0x04,
  1364. &quot;Too Many VLAN IDs&quot;
  1365. },
  1366. {
  1367. 0xA119,
  1368. 0x05,
  1369. &quot;No Such Slave&quot;
  1370. },
  1371. {
  1372. 0xA119,
  1373. 0x06,
  1374. &quot;Flash Operation Blocked&quot;
  1375. },
  1376. {
  1377. 0xA119,
  1378. 0x07,
  1379. &quot;Unsupported Operation&quot;
  1380. },
  1381. {
  1382. 0xA119,
  1383. 0x08,
  1384. &quot;Flash Activity Conflict&quot;
  1385. },
  1386. {
  1387. 0xA119,
  1388. 0x09,
  1389. &quot;Table Busy&quot;
  1390. },
  1391. {
  1392. 0xA119,
  1393. 0x0A,
  1394. &quot;One Slave Has Duplicate VLAN ID&quot;
  1395. },
  1396. {
  1397. 0xA119,
  1398. 0x0B,
  1399. &quot;Multiple Slaves Have Same VLAN ID&quot;
  1400. },
  1401. {
  1402. 0xA119,
  1403. 0x0C,
  1404. &quot;Multiple Configurations for One Slave&quot;
  1405. },
  1406. {
  1407. 0xA119,
  1408. 0x0D,
  1409. &quot;Can't set VLAN ID for Local Station&quot;
  1410. },
  1411. {
  1412. 0xA119,
  1413. 0x0E,
  1414. &quot;Bad Data Offset&quot;
  1415. },
  1416. {
  1417. 0xA119,
  1418. 0x0F,
  1419. &quot;Bad Data Length&quot;
  1420. },
  1421. {
  1422. 0xA119,
  1423. 0x10,
  1424. &quot;VLAN ID Has Been Configured&quot;
  1425. },
  1426. {
  1427. 0xA119,
  1428. 0x11,
  1429. &quot;Bad MME Source&quot;
  1430. },
  1431. {
  1432. 0xA119,
  1433. 0x12,
  1434. &quot;VLAN ID out of range&quot;
  1435. },
  1436. {
  1437. 0xA119,
  1438. 0x13,
  1439. &quot;Cannot remove nonexistent VLAN ID&quot;
  1440. },
  1441. {
  1442. 0xA149,
  1443. 0x1,
  1444. &quot;Invalid Key Length&quot;
  1445. },
  1446. {
  1447. 0xA149,
  1448. 0x2,
  1449. &quot;Invalid Key&quot;
  1450. },
  1451. {
  1452. 0xA149,
  1453. 0x3,
  1454. &quot;Invalid Access Type&quot;
  1455. },
  1456. {
  1457. 0xA149,
  1458. 0x4,
  1459. &quot;Invalid Level Control&quot;
  1460. }
  1461. };
  1462. #endif
  1463. char const * MMECode (uint16_t MMTYPE, uint8_t MSTATUS)
  1464. {
  1465. #ifndef MMEPASSFAIL
  1466. size_t lower = 0;
  1467. size_t upper = SIZEOF (mme_codes);
  1468. MMTYPE = LE16TOH (MMTYPE);
  1469. while (lower &lt; upper)
  1470. {
  1471. size_t index = (lower + upper) &gt;&gt; 1;
  1472. signed order = MMTYPE - mme_codes [index].type;
  1473. if (order &lt; 0)
  1474. {
  1475. upper = index - 0;
  1476. continue;
  1477. }
  1478. if (order &gt; 0)
  1479. {
  1480. lower = index + 1;
  1481. continue;
  1482. }
  1483. for (lower = index; lower &gt; 0; lower--)
  1484. {
  1485. if (mme_codes [lower - 1].type != mme_codes [index].type)
  1486. {
  1487. break;
  1488. }
  1489. }
  1490. for (upper = index; upper &lt; SIZEOF (mme_codes); upper++)
  1491. {
  1492. if (mme_codes [upper + 0].type != mme_codes [index].type)
  1493. {
  1494. break;
  1495. }
  1496. }
  1497. while (lower &lt; upper)
  1498. {
  1499. index = (lower + upper) &gt;&gt; 1;
  1500. order = MSTATUS - mme_codes [index].code;
  1501. if (order &lt; 0)
  1502. {
  1503. upper = index - 0;
  1504. continue;
  1505. }
  1506. if (order &gt; 0)
  1507. {
  1508. lower = index + 1;
  1509. continue;
  1510. }
  1511. return (mme_codes [index].text);
  1512. }
  1513. }
  1514. #endif
  1515. return ((MSTATUS)? (&quot;Failure&quot;):(&quot;Success&quot;));
  1516. }
  1517. #endif
  1518. </pre>
  1519. <div class='footerlink'>
  1520. [<a href='mme.c.html' title=' mme.c '>PREV</a>]
  1521. [<a href='toolkit.html' title=' Index '>HOME</a>]
  1522. [<a href='MMEMode.c.html' title=' MMEMode.c '>NEXT</a>]
  1523. </div>
  1524. </body>
  1525. </html>