0001-fix-ubnt-model-detection.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. From: Karsten Böddeker <freifunk@kb-light.de>
  2. Date: Mon, 4 Apr 2016 17:02:55 +0200
  3. Subject: [PATCH] fix UBNT model detection
  4. ---
  5. .../openwrt/1000-fix-UBNT-XM-model-detection.patch | 74 ++++++++++++++++++++++
  6. targets/ar71xx-generic/profiles.mk | 15 +++--
  7. 2 files changed, 85 insertions(+), 4 deletions(-)
  8. create mode 100644 patches/openwrt/1000-fix-UBNT-XM-model-detection.patch
  9. diff --git a/patches/openwrt/1000-fix-UBNT-XM-model-detection.patch b/patches/openwrt/1000-fix-UBNT-XM-model-detection.patch
  10. new file mode 100644
  11. index 0000000..79180b4
  12. --- /dev/null
  13. +++ b/patches/openwrt/1000-fix-UBNT-XM-model-detection.patch
  14. @@ -0,0 +1,74 @@
  15. +From: Neal Oakey <neal.oakey@bingo-ev.de>
  16. +Date: Sun, 14 Feb 2016 20:58:20 +0100
  17. +Subject: fix UBNT XM model detection
  18. +
  19. +Signed-off-by: Neal Oakey <neal.oakey@bingo-ev.de>
  20. +
  21. +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  22. +index dab4d2c..e7b3cd2 100755
  23. +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  24. ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  25. +@@ -64,6 +64,40 @@ wndr3700_board_detect() {
  26. + AR71XX_MODEL="$machine"
  27. + }
  28. +
  29. ++ubnt_get_mtd_part_magic() {
  30. ++ ar71xx_get_mtd_offset_size_format EEPROM 4118 2 %02x
  31. ++}
  32. ++
  33. ++ubnt_xm_board_detect() {
  34. ++ local model
  35. ++ local magic
  36. ++
  37. ++ magic="$(ubnt_get_mtd_part_magic)"
  38. ++ case ${magic:0:3} in
  39. ++ "e00"|\
  40. ++ "e01"|\
  41. ++ "e80") # It seams that there are different Versions of the Nanostation
  42. ++ model="Ubiquiti NanoStation M"
  43. ++ ;;
  44. ++ "e0a")
  45. ++ model="Ubiquiti NanoStation loco M"
  46. ++ ;;
  47. ++ "e1b") # Note: the M5 has not been tested!
  48. ++ # and the Ti Versions are still missing
  49. ++ model="Ubiquiti Rocket M"
  50. ++ ;;
  51. ++ "e20"|\
  52. ++ "e2d") # Bullet Ti M
  53. ++ model="Ubiquiti Bullet M"
  54. ++ ;;
  55. ++ "e30")
  56. ++ model="Ubiquiti PicoStation M"
  57. ++ ;;
  58. ++ esac
  59. ++
  60. ++ [ ! -z "$model" ] && AR71XX_MODEL="${model}${magic:3:1}"
  61. ++}
  62. ++
  63. + cybertan_get_hw_magic() {
  64. + local part
  65. +
  66. +@@ -475,12 +509,14 @@ ar71xx_board_detect() {
  67. + ;;
  68. + *"Bullet M")
  69. + name="bullet-m"
  70. ++ ubnt_xm_board_detect
  71. + ;;
  72. + *"Loco M XW")
  73. + name="loco-m-xw"
  74. + ;;
  75. + *"Nanostation M")
  76. + name="nanostation-m"
  77. ++ ubnt_xm_board_detect
  78. + ;;
  79. + *"Nanostation M XW")
  80. + name="nanostation-m-xw"
  81. +@@ -667,6 +703,7 @@ ar71xx_board_detect() {
  82. + ;;
  83. + *"Rocket M")
  84. + name="rocket-m"
  85. ++ ubnt_xm_board_detect
  86. + ;;
  87. + *"Rocket M XW")
  88. + name="rocket-m-xw"
  89. diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk
  90. index 4a63667..da178ea 100644
  91. --- a/targets/ar71xx-generic/profiles.mk
  92. +++ b/targets/ar71xx-generic/profiles.mk
  93. @@ -162,12 +162,19 @@ $(eval $(call GluonModel,UBNT,ubnt-air-gateway,ubiquiti-airgateway))
  94. $(eval $(call GluonModel,UBNT,ubnt-airrouter,ubiquiti-airrouter))
  95. $(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-bullet-m))
  96. -$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-loco-m))
  97. -$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-picostation-m))
  98. -$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m))
  99. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-nanostation-loco-m2))
  100. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-nanostation-loco-m5))
  101. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m2))
  102. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m5))
  103. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-bullet-m2))
  104. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-bullet-m5))
  105. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-picostation-m2))
  106. -$(eval $(call GluonModel,UBNT,ubnt-loco-m-xw,ubiquiti-loco-m-xw))
  107. $(eval $(call GluonModel,UBNT,ubnt-nano-m,ubiquiti-nanostation-m))
  108. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-nanostation-m,ubiquiti-nanostation-m2))
  109. +$(eval $(call GluonModelAlias,UBNT,ubiquiti-nanostation-m,ubiquiti-nanostation-m5))
  110. +
  111. +$(eval $(call GluonModel,UBNT,ubnt-loco-m-xw,ubiquiti-loco-m-xw))
  112. $(eval $(call GluonModel,UBNT,ubnt-nano-m-xw,ubiquiti-nanostation-m-xw))
  113. $(eval $(call GluonModel,UBNT,ubnt-rocket-m-xw,ubiquiti-rocket-m-xw))
  114. $(eval $(call GluonModel,UBNT,ubnt-uap-pro,ubiquiti-unifi-ap-pro))
  115. --
  116. 2.1.4