ar71xx.sh 15 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2009-2011 OpenWrt.org
  4. #
  5. AR71XX_BOARD_NAME=
  6. AR71XX_MODEL=
  7. ar71xx_get_mtd_offset_size_format() {
  8. local mtd="$1"
  9. local offset="$2"
  10. local size="$3"
  11. local format="$4"
  12. local dev
  13. dev=$(find_mtd_part $mtd)
  14. [ -z "$dev" ] && return
  15. dd if=$dev bs=1 skip=$offset count=$size 2>/dev/null | hexdump -v -e "1/1 \"$format\""
  16. }
  17. ar71xx_get_mtd_part_magic() {
  18. local mtd="$1"
  19. ar71xx_get_mtd_offset_size_format "$mtd" 0 4 %02x
  20. }
  21. wndr3700_board_detect() {
  22. local machine="$1"
  23. local magic
  24. local name
  25. name="wndr3700"
  26. magic="$(ar71xx_get_mtd_part_magic firmware)"
  27. case $magic in
  28. "33373030")
  29. machine="NETGEAR WNDR3700"
  30. ;;
  31. "33373031")
  32. model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)"
  33. # Use awk to remove everything unprintable
  34. model_stripped="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
  35. case $model in
  36. $'\xff'*)
  37. if [ "${model:24:1}" = 'N' ]; then
  38. machine="NETGEAR WNDRMAC"
  39. else
  40. machine="NETGEAR WNDR3700v2"
  41. fi
  42. ;;
  43. '29763654+16+64'*)
  44. machine="NETGEAR ${model_stripped:14}"
  45. ;;
  46. '29763654+16+128'*)
  47. machine="NETGEAR ${model_stripped:15}"
  48. ;;
  49. *)
  50. # Unknown ID
  51. machine="NETGEAR ${model_stripped}"
  52. esac
  53. esac
  54. AR71XX_BOARD_NAME="$name"
  55. AR71XX_MODEL="$machine"
  56. }
  57. cybertan_get_hw_magic() {
  58. local part
  59. part=$(find_mtd_part firmware)
  60. [ -z "$part" ] && return 1
  61. dd bs=8 count=1 skip=0 if=$part 2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"'
  62. }
  63. tplink_get_hwid() {
  64. local part
  65. part=$(find_mtd_part firmware)
  66. [ -z "$part" ] && return 1
  67. dd if=$part bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
  68. }
  69. tplink_get_mid() {
  70. local part
  71. part=$(find_mtd_part firmware)
  72. [ -z "$part" ] && return 1
  73. dd if=$part bs=4 count=1 skip=17 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
  74. }
  75. tplink_board_detect() {
  76. local model="$1"
  77. local hwid
  78. local hwver
  79. hwid=$(tplink_get_hwid)
  80. mid=$(tplink_get_mid)
  81. hwver=${hwid:6:2}
  82. hwver="v${hwver#0}"
  83. case "$hwid" in
  84. "015000"*)
  85. model="EasyLink EL-M150"
  86. ;;
  87. "015300"*)
  88. model="EasyLink EL-MINI"
  89. ;;
  90. "044401"*)
  91. model="ANTMINER-S1"
  92. ;;
  93. "044403"*)
  94. model="ANTMINER-S3"
  95. ;;
  96. "120000"*)
  97. model="MERCURY MAC1200R"
  98. ;;
  99. "3C0001"*)
  100. model="OOLITE"
  101. ;;
  102. "3C0002"*)
  103. model="MINIBOX_V1"
  104. ;;
  105. "070301"*)
  106. model="TP-Link TL-WR703N"
  107. ;;
  108. "071000"*)
  109. model="TP-Link TL-WR710N"
  110. ;;
  111. "072001"*)
  112. model="TP-Link TL-WR720N"
  113. ;;
  114. "070100"*)
  115. model="TP-Link TL-WA701N/ND"
  116. ;;
  117. "073000"*)
  118. model="TP-Link TL-WA730RE"
  119. ;;
  120. "074000"*)
  121. model="TP-Link TL-WR740N/ND"
  122. ;;
  123. "074100"*)
  124. model="TP-Link TL-WR741N/ND"
  125. ;;
  126. "074300"*)
  127. model="TP-Link TL-WR743N/ND"
  128. ;;
  129. "075000"*)
  130. model="TP-Link TL-WA750RE"
  131. ;;
  132. "721000"*)
  133. model="TP-Link TL-WA7210N"
  134. ;;
  135. "751000"*)
  136. model="TP-Link TL-WA7510N"
  137. ;;
  138. "080100"*)
  139. model="TP-Link TL-WA801N/ND"
  140. ;;
  141. "083000"*)
  142. model="TP-Link TL-WA830RE"
  143. if [ "$hwver" = 'v10' ]; then
  144. hwver='v1'
  145. fi
  146. ;;
  147. "084100"*)
  148. model="TP-Link TL-WR841N/ND"
  149. ;;
  150. "084200"*)
  151. model="TP-Link TL-WR842N/ND"
  152. ;;
  153. "084300"*)
  154. model="TP-Link TL-WR843N/ND"
  155. ;;
  156. "085000"*)
  157. model="TP-Link TL-WA850RE"
  158. ;;
  159. "086000"*)
  160. model="TP-Link TL-WA860RE"
  161. ;;
  162. "090100"*)
  163. model="TP-Link TL-WA901N/ND"
  164. ;;
  165. "094100"*)
  166. if [ "$hwid" = "09410002" -a "$mid" = "00420001" ]; then
  167. model="Rosewill RNX-N360RT"
  168. hwver=""
  169. else
  170. model="TP-Link TL-WR941N/ND"
  171. fi
  172. ;;
  173. "104100"*)
  174. model="TP-Link TL-WR1041N/ND"
  175. ;;
  176. "104300"*)
  177. model="TP-Link TL-WR1043N/ND"
  178. ;;
  179. "254300"*)
  180. model="TP-Link TL-WR2543N/ND"
  181. ;;
  182. "001001"*)
  183. model="TP-Link TL-MR10U"
  184. ;;
  185. "001101"*)
  186. model="TP-Link TL-MR11U"
  187. ;;
  188. "001201"*)
  189. model="TP-Link TL-MR12U"
  190. ;;
  191. "001301"*)
  192. model="TP-Link TL-MR13U"
  193. ;;
  194. "302000"*)
  195. model="TP-Link TL-MR3020"
  196. ;;
  197. "304000"*)
  198. model="TP-Link TL-MR3040"
  199. ;;
  200. "322000"*)
  201. model="TP-Link TL-MR3220"
  202. ;;
  203. "342000"*)
  204. model="TP-Link TL-MR3420"
  205. ;;
  206. "350000"*)
  207. model="TP-Link TL-WDR3500"
  208. ;;
  209. "360000"*)
  210. model="TP-Link TL-WDR3600"
  211. ;;
  212. "430000"*)
  213. model="TP-Link TL-WDR4300"
  214. ;;
  215. "430080"*)
  216. iw reg set IL
  217. model="TP-Link TL-WDR4300 (IL)"
  218. ;;
  219. "431000"*)
  220. model="TP-Link TL-WDR4310"
  221. ;;
  222. "49000002")
  223. model="TP-Link TL-WDR4900"
  224. ;;
  225. "453000"*)
  226. model="MERCURY MW4530R"
  227. ;;
  228. "934100"*)
  229. model="NC-LINK SMART-300"
  230. ;;
  231. "c50000"*)
  232. model="TP-Link Archer C5"
  233. ;;
  234. "750000"*|\
  235. "c70000"*)
  236. model="TP-Link Archer C7"
  237. ;;
  238. *)
  239. hwver=""
  240. ;;
  241. esac
  242. AR71XX_MODEL="$model $hwver"
  243. }
  244. tplink_pharos_get_model_string() {
  245. local part
  246. part=$(find_mtd_part 'product-info')
  247. [ -z "$part" ] && return 1
  248. # The returned string will end with \r\n, but we don't remove it here
  249. # to simplify matching against it in the sysupgrade image check
  250. dd if=$part bs=1 skip=4360 2>/dev/null | head -n 1
  251. }
  252. tplink_pharos_board_detect() {
  253. local model_string="$(tplink_pharos_get_model_string | tr -d '\r')"
  254. local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS"
  255. local model
  256. case "$1" in
  257. 'CPE210(TP-LINK|UN|N300-2)')
  258. model='TP-Link CPE210'
  259. ;;
  260. 'CPE220(TP-LINK|UN|N300-2)')
  261. model='TP-Link CPE220'
  262. ;;
  263. 'CPE510(TP-LINK|UN|N300-5)')
  264. model='TP-Link CPE510'
  265. ;;
  266. 'CPE520(TP-LINK|UN|N300-5)')
  267. model='TP-Link CPE520'
  268. ;;
  269. esac
  270. [ -n "$model" ] && AR71XX_MODEL="$model v$2"
  271. }
  272. gl_inet_board_detect() {
  273. local size="$(mtd_get_part_size 'firmware')"
  274. case "$size" in
  275. 8192000)
  276. AR71XX_MODEL='GL-iNet 6408A v1'
  277. ;;
  278. 16580608)
  279. AR71XX_MODEL='GL-iNet 6416A v1'
  280. ;;
  281. esac
  282. }
  283. ar71xx_board_detect() {
  284. local machine
  285. local name
  286. machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
  287. case "$machine" in
  288. *"Oolite V1.0")
  289. name="oolite"
  290. ;;
  291. *"AC1750DB")
  292. name="f9k1115v2"
  293. ;;
  294. *"AirGateway")
  295. name="airgateway"
  296. ;;
  297. *"AirRouter")
  298. name="airrouter"
  299. ;;
  300. *"ALFA Network AP120C")
  301. name="alfa-ap120c"
  302. ;;
  303. *"ALFA Network AP96")
  304. name="alfa-ap96"
  305. ;;
  306. *"ALFA Network N2/N5")
  307. name="alfa-nx"
  308. ;;
  309. *ALL0258N)
  310. name="all0258n"
  311. ;;
  312. *ALL0305)
  313. name="all0305"
  314. ;;
  315. *ALL0315N)
  316. name="all0315n"
  317. ;;
  318. *Antminer-S1)
  319. name="antminer-s1"
  320. ;;
  321. *Antminer-S3)
  322. name="antminer-s3"
  323. ;;
  324. *AP113)
  325. name="ap113"
  326. ;;
  327. *AP121)
  328. name="ap121"
  329. ;;
  330. *AP121-MINI)
  331. name="ap121-mini"
  332. ;;
  333. *"AP132 reference board")
  334. name="ap132"
  335. ;;
  336. *"AP136-010 reference board")
  337. name="ap136-010"
  338. ;;
  339. *"AP136-020 reference board")
  340. name="ap136-020"
  341. ;;
  342. *"AP135-020 reference board")
  343. name="ap135-020"
  344. ;;
  345. *AP81)
  346. name="ap81"
  347. ;;
  348. *AP83)
  349. name="ap83"
  350. ;;
  351. *"Archer C5")
  352. name="archer-c5"
  353. ;;
  354. *"Archer C7")
  355. name="archer-c7"
  356. ;;
  357. *"Atheros AP96")
  358. name="ap96"
  359. ;;
  360. *AW-NR580)
  361. name="aw-nr580"
  362. ;;
  363. *CAP4200AG)
  364. name="cap4200ag"
  365. ;;
  366. *"CPE210/220/510/520")
  367. name="cpe510"
  368. tplink_pharos_board_detect
  369. ;;
  370. *"DB120 reference board")
  371. name="db120"
  372. ;;
  373. *"DGL-5500 rev. A1")
  374. name="dgl-5500-a1"
  375. ;;
  376. *"DHP-1565 rev. A1")
  377. name="dhp-1565-a1"
  378. ;;
  379. *"DIR-505 rev. A1")
  380. name="dir-505-a1"
  381. ;;
  382. *"DIR-600 rev. A1")
  383. name="dir-600-a1"
  384. ;;
  385. *"DIR-615 rev. E1")
  386. name="dir-615-e1"
  387. ;;
  388. *"DIR-615 rev. E4")
  389. name="dir-615-e4"
  390. ;;
  391. *"DIR-615 rev. I1")
  392. name="dir-615-i1"
  393. ;;
  394. *"DIR-825 rev. B1")
  395. name="dir-825-b1"
  396. ;;
  397. *"DIR-825 rev. C1")
  398. name="dir-825-c1"
  399. ;;
  400. *"DIR-835 rev. A1")
  401. name="dir-835-a1"
  402. ;;
  403. *"dLAN pro 500 Wireless+")
  404. name="dlan-pro-500-wp"
  405. ;;
  406. *"dLAN pro 1200+ WiFi ac")
  407. name="dlan-pro-1200-ac"
  408. ;;
  409. *"Dragino v2")
  410. name="dragino2"
  411. ;;
  412. *"DW33D")
  413. name="dw33d"
  414. ;;
  415. *"EAP300 v2")
  416. name="eap300v2"
  417. ;;
  418. *EAP7660D)
  419. name="eap7660d"
  420. ;;
  421. *EL-M150)
  422. name="el-m150"
  423. ;;
  424. *EL-MINI)
  425. name="el-mini"
  426. ;;
  427. *"GL-CONNECT INET v1")
  428. name="gl-inet"
  429. gl_inet_board_detect
  430. ;;
  431. *"EnGenius EPG5000")
  432. name="epg5000"
  433. ;;
  434. *"EnGenius ESR1750")
  435. name="esr1750"
  436. ;;
  437. *"EnGenius ESR900")
  438. name="esr900"
  439. ;;
  440. *JA76PF)
  441. name="ja76pf"
  442. ;;
  443. *JA76PF2)
  444. name="ja76pf2"
  445. ;;
  446. *"Bullet M")
  447. name="bullet-m"
  448. ;;
  449. *"Loco M XW")
  450. name="loco-m-xw"
  451. ;;
  452. *"Nanostation M")
  453. name="nanostation-m"
  454. ;;
  455. *"Nanostation M XW")
  456. name="nanostation-m-xw"
  457. ;;
  458. *JWAP003)
  459. name="jwap003"
  460. ;;
  461. *"Hornet-UB")
  462. local size
  463. size=$(awk '/firmware/ { print $2 }' /proc/mtd)
  464. if [ "x$size" = "x00790000" ]; then
  465. name="hornet-ub"
  466. fi
  467. if [ "x$size" = "x00f90000" ]; then
  468. name="hornet-ub-x2"
  469. fi
  470. ;;
  471. *LS-SR71)
  472. name="ls-sr71"
  473. ;;
  474. *"MAC1200R")
  475. name="mc-mac1200r"
  476. ;;
  477. *"MiniBox V1.0")
  478. name="minibox-v1"
  479. ;;
  480. *MR12)
  481. name="mr12"
  482. ;;
  483. *MR16)
  484. name="mr16"
  485. ;;
  486. *MR600v2)
  487. name="mr600v2"
  488. ;;
  489. *MR1750)
  490. name="mr1750"
  491. ;;
  492. *MR1750v2)
  493. name="mr1750v2"
  494. ;;
  495. *MR600)
  496. name="mr600"
  497. ;;
  498. *MR900)
  499. name="mr900"
  500. ;;
  501. *MR900v2)
  502. name="mr900v2"
  503. ;;
  504. *"My Net N600")
  505. name="mynet-n600"
  506. ;;
  507. *"My Net N750")
  508. name="mynet-n750"
  509. ;;
  510. *"WD My Net Wi-Fi Range Extender")
  511. name="mynet-rext"
  512. ;;
  513. *MZK-W04NU)
  514. name="mzk-w04nu"
  515. ;;
  516. *MZK-W300NH)
  517. name="mzk-w300nh"
  518. ;;
  519. *"NBG460N/550N/550NH")
  520. name="nbg460n_550n_550nh"
  521. ;;
  522. *"Zyxel NBG6716")
  523. name="nbg6716"
  524. ;;
  525. *OM2P)
  526. name="om2p"
  527. ;;
  528. *OM2Pv2)
  529. name="om2pv2"
  530. ;;
  531. *"OM2P HS")
  532. name="om2p-hs"
  533. ;;
  534. *"OM2P HSv2")
  535. name="om2p-hsv2"
  536. ;;
  537. *"OM2P HSv3")
  538. name="om2p-hsv3"
  539. ;;
  540. *"OM2P LC")
  541. name="om2p-lc"
  542. ;;
  543. *OM5P)
  544. name="om5p"
  545. ;;
  546. *"OM5P AN")
  547. name="om5p-an"
  548. ;;
  549. *"OM5P AC")
  550. name="om5p-ac"
  551. ;;
  552. *"OM5P ACv2")
  553. name="om5p-acv2"
  554. ;;
  555. *"Onion Omega")
  556. name="onion-omega"
  557. ;;
  558. *PB42)
  559. name="pb42"
  560. ;;
  561. *"PB44 reference board")
  562. name="pb44"
  563. ;;
  564. *PB92)
  565. name="pb92"
  566. ;;
  567. *"Qihoo 360 C301")
  568. name="qihoo-c301"
  569. ;;
  570. *"RouterBOARD 411/A/AH")
  571. name="rb-411"
  572. ;;
  573. *"RouterBOARD 411U")
  574. name="rb-411u"
  575. ;;
  576. *"RouterBOARD 433/AH")
  577. name="rb-433"
  578. ;;
  579. *"RouterBOARD 433UAH")
  580. name="rb-433u"
  581. ;;
  582. *"RouterBOARD 435G")
  583. name="rb-435g"
  584. ;;
  585. *"RouterBOARD 450")
  586. name="rb-450"
  587. ;;
  588. *"RouterBOARD 450G")
  589. name="rb-450g"
  590. ;;
  591. *"RouterBOARD 493/AH")
  592. name="rb-493"
  593. ;;
  594. *"RouterBOARD 493G")
  595. name="rb-493g"
  596. ;;
  597. *"RouterBOARD 750")
  598. name="rb-750"
  599. ;;
  600. *"RouterBOARD 750GL")
  601. name="rb-750gl"
  602. ;;
  603. *"RouterBOARD 751")
  604. name="rb-751"
  605. ;;
  606. *"RouterBOARD 751G")
  607. name="rb-751g"
  608. ;;
  609. *"RouterBOARD 911G-2HPnD")
  610. name="rb-911g-2hpnd"
  611. ;;
  612. *"RouterBOARD 911G-5HPnD")
  613. name="rb-911g-5hpnd"
  614. ;;
  615. *"RouterBOARD 911G-5HPacD")
  616. name="rb-911g-5hpacd"
  617. ;;
  618. *"RouterBOARD 912UAG-2HPnD")
  619. name="rb-912uag-2hpnd"
  620. ;;
  621. *"RouterBOARD 912UAG-5HPnD")
  622. name="rb-912uag-5hpnd"
  623. ;;
  624. *"RouterBOARD 951G-2HnD")
  625. name="rb-951g-2hnd"
  626. ;;
  627. *"RouterBOARD 951Ui-2HnD")
  628. name="rb-951ui-2hnd"
  629. ;;
  630. *"RouterBOARD 2011L")
  631. name="rb-2011l"
  632. ;;
  633. *"RouterBOARD 2011UAS")
  634. name="rb-2011uas"
  635. ;;
  636. *"RouterBOARD 2011UiAS")
  637. name="rb-2011uias"
  638. ;;
  639. *"RouterBOARD 2011UAS-2HnD")
  640. name="rb-2011uas-2hnd"
  641. ;;
  642. *"RouterBOARD 2011UiAS-2HnD")
  643. name="rb-2011uias-2hnd"
  644. ;;
  645. *"RouterBOARD SXT Lite2")
  646. name="rb-sxt2n"
  647. ;;
  648. *"RouterBOARD SXT Lite5")
  649. name="rb-sxt5n"
  650. ;;
  651. *"Rocket M")
  652. name="rocket-m"
  653. ;;
  654. *"Rocket M XW")
  655. name="rocket-m-xw"
  656. ;;
  657. *RouterStation)
  658. name="routerstation"
  659. ;;
  660. *"RouterStation Pro")
  661. name="routerstation-pro"
  662. ;;
  663. *RW2458N)
  664. name="rw2458n"
  665. ;;
  666. *"SMART-300")
  667. name="smart-300"
  668. ;;
  669. "Smart Electronics Black Swift board"*)
  670. name="bsb"
  671. ;;
  672. *TEW-632BRP)
  673. name="tew-632brp"
  674. ;;
  675. *TEW-673GRU)
  676. name="tew-673gru"
  677. ;;
  678. *TEW-712BR)
  679. name="tew-712br"
  680. ;;
  681. *TEW-732BR)
  682. name="tew-732br"
  683. ;;
  684. *"TL-WR1041N v2")
  685. name="tl-wr1041n-v2"
  686. ;;
  687. *TL-WR1043ND)
  688. name="tl-wr1043nd"
  689. ;;
  690. *"TL-WR1043ND v2")
  691. name="tl-wr1043nd-v2"
  692. ;;
  693. *TL-WR2543N*)
  694. name="tl-wr2543n"
  695. ;;
  696. *"DIR-615 rev. C1")
  697. name="dir-615-c1"
  698. ;;
  699. *TL-MR3020)
  700. name="tl-mr3020"
  701. ;;
  702. *TL-MR3040)
  703. name="tl-mr3040"
  704. ;;
  705. *"TL-MR3040 v2")
  706. name="tl-mr3040-v2"
  707. ;;
  708. *TL-MR3220)
  709. name="tl-mr3220"
  710. ;;
  711. *"TL-MR3220 v2")
  712. name="tl-mr3220-v2"
  713. ;;
  714. *TL-MR3420)
  715. name="tl-mr3420"
  716. ;;
  717. *"TL-MR3420 v2")
  718. name="tl-mr3420-v2"
  719. ;;
  720. *"TL-WA701ND v2")
  721. name="tl-wa701nd-v2"
  722. ;;
  723. *"TL-WA7210N v2")
  724. name="tl-wa7210n-v2"
  725. ;;
  726. *TL-WA750RE)
  727. name="tl-wa750re"
  728. ;;
  729. *"TL-WA7510N v1")
  730. name="tl-wa7510n"
  731. ;;
  732. *TL-WA850RE)
  733. name="tl-wa850re"
  734. ;;
  735. *TL-WA860RE)
  736. name="tl-wa860re"
  737. ;;
  738. *"TL-WA830RE v2")
  739. name="tl-wa830re-v2"
  740. ;;
  741. *"TL-WA801ND v2")
  742. name="tl-wa801nd-v2"
  743. ;;
  744. *TL-WA901ND)
  745. name="tl-wa901nd"
  746. ;;
  747. *"TL-WA901ND v2")
  748. name="tl-wa901nd-v2"
  749. ;;
  750. *"TL-WA901ND v3")
  751. name="tl-wa901nd-v3"
  752. ;;
  753. *"TL-WA901ND v4")
  754. name="tl-wa901nd-v4"
  755. ;;
  756. *"TL-WDR3500")
  757. name="tl-wdr3500"
  758. ;;
  759. *"TL-WDR3600/4300/4310")
  760. name="tl-wdr4300"
  761. ;;
  762. *"TL-WDR4900 v2")
  763. name="tl-wdr4900-v2"
  764. ;;
  765. *TL-WR741ND)
  766. name="tl-wr741nd"
  767. ;;
  768. *"TL-WR741ND v4")
  769. name="tl-wr741nd-v4"
  770. ;;
  771. *"TL-WR841N v1")
  772. name="tl-wr841n-v1"
  773. ;;
  774. *"TL-WR841N/ND v7")
  775. name="tl-wr841n-v7"
  776. ;;
  777. *"TL-WR841N/ND v8")
  778. name="tl-wr841n-v8"
  779. ;;
  780. *"TL-WR841N/ND v9")
  781. name="tl-wr841n-v9"
  782. ;;
  783. *"TL-WR841N/ND v11")
  784. name="tl-wr841n-v11"
  785. ;;
  786. *"TL-WR842N/ND v2")
  787. name="tl-wr842n-v2"
  788. ;;
  789. *TL-WR941ND)
  790. name="tl-wr941nd"
  791. ;;
  792. *"TL-WR941N/ND v5")
  793. name="tl-wr941nd-v5"
  794. ;;
  795. *"TL-WR941N/ND v6")
  796. name="tl-wr941nd-v6"
  797. ;;
  798. *"TL-WR703N v1")
  799. name="tl-wr703n"
  800. ;;
  801. *"TL-WR710N v1")
  802. name="tl-wr710n"
  803. ;;
  804. *"TL-WR720N"*)
  805. name="tl-wr720n-v3"
  806. ;;
  807. *"TL-MR10U")
  808. name="tl-mr10u"
  809. ;;
  810. *"TL-MR11U")
  811. name="tl-mr11u"
  812. ;;
  813. *"TL-MR12U")
  814. name="tl-mr12u"
  815. ;;
  816. *"TL-MR13U v1")
  817. name="tl-mr13u"
  818. ;;
  819. *"Tube2H")
  820. name="tube2h"
  821. ;;
  822. *UniFi)
  823. name="unifi"
  824. ;;
  825. *"UniFi AP Pro")
  826. name="uap-pro"
  827. ;;
  828. "WeIO"*)
  829. name="weio"
  830. ;;
  831. *WHR-G301N)
  832. name="whr-g301n"
  833. ;;
  834. *WHR-HP-GN)
  835. name="whr-hp-gn"
  836. ;;
  837. *WLAE-AG300N)
  838. name="wlae-ag300n"
  839. ;;
  840. *"UniFiAP Outdoor")
  841. name="unifi-outdoor"
  842. ;;
  843. *"UniFiAP Outdoor+")
  844. name="unifi-outdoor-plus"
  845. ;;
  846. *WP543)
  847. name="wp543"
  848. ;;
  849. *WPE72)
  850. name="wpe72"
  851. ;;
  852. *WPJ344)
  853. name="wpj344"
  854. ;;
  855. *WPJ531)
  856. name="wpj531"
  857. ;;
  858. *WPJ558)
  859. name="wpj558"
  860. ;;
  861. *WNDAP360)
  862. name="wndap360"
  863. ;;
  864. *"WNDR3700/WNDR3800/WNDRMAC")
  865. wndr3700_board_detect "$machine"
  866. ;;
  867. *"R6100")
  868. name="r6100"
  869. ;;
  870. *"WNDR3700v4")
  871. name="wndr3700v4"
  872. ;;
  873. *"WNDR4300")
  874. name="wndr4300"
  875. ;;
  876. *"WNR2000 V4")
  877. name="wnr2000-v4"
  878. ;;
  879. *"WNR2000 V3")
  880. name="wnr2000-v3"
  881. ;;
  882. *WNR2000)
  883. name="wnr2000"
  884. ;;
  885. *WNR2200)
  886. name="wnr2200"
  887. ;;
  888. *"WNR612 V2")
  889. name="wnr612-v2"
  890. ;;
  891. *"WNR1000 V2")
  892. name="wnr1000-v2"
  893. ;;
  894. *WPN824N)
  895. name="wpn824n"
  896. ;;
  897. *WRT160NL)
  898. name="wrt160nl"
  899. ;;
  900. *E2100L)
  901. name="e2100l"
  902. ;;
  903. *WRT400N)
  904. name="wrt400n"
  905. ;;
  906. *"WZR-450HP2")
  907. name="wzr-450hp2"
  908. ;;
  909. *"WZR-HP-AG300H/WZR-600DHP")
  910. name="wzr-hp-ag300h"
  911. ;;
  912. *WZR-HP-G300NH)
  913. name="wzr-hp-g300nh"
  914. ;;
  915. *WZR-HP-G450H)
  916. name="wzr-hp-g450h"
  917. ;;
  918. *WZR-HP-G300NH2)
  919. name="wzr-hp-g300nh2"
  920. ;;
  921. *WHR-HP-G300N)
  922. name="whr-hp-g300n"
  923. ;;
  924. *ZCN-1523H-2)
  925. name="zcn-1523h-2"
  926. ;;
  927. *ZCN-1523H-5)
  928. name="zcn-1523h-5"
  929. ;;
  930. *EmbWir-Dorin)
  931. name="ew-dorin"
  932. ;;
  933. *EmbWir-Dorin-Router)
  934. name="ew-dorin-router"
  935. ;;
  936. "8devices Carambola2"*)
  937. name="carambola2"
  938. ;;
  939. *"Sitecom WLR-8100")
  940. name="wlr8100"
  941. ;;
  942. *"BHU BXU2000n-2 rev. A1")
  943. name="bxu2000n-2-a1"
  944. ;;
  945. *"HiWiFi HC6361")
  946. name="hiwifi-hc6361"
  947. ;;
  948. esac
  949. [ -z "$AR71XX_MODEL" ] && [ "${machine:0:8}" = 'TP-LINK ' ] && \
  950. tplink_board_detect "$machine"
  951. [ -z "$name" ] && name="unknown"
  952. [ -z "$AR71XX_BOARD_NAME" ] && AR71XX_BOARD_NAME="$name"
  953. [ -z "$AR71XX_MODEL" ] && AR71XX_MODEL="$machine"
  954. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  955. echo "$AR71XX_BOARD_NAME" > /tmp/sysinfo/board_name
  956. echo "$AR71XX_MODEL" > /tmp/sysinfo/model
  957. }
  958. ar71xx_board_name() {
  959. local name
  960. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  961. [ -z "$name" ] && name="unknown"
  962. echo "$name"
  963. }