0001-fix-UBNT-model-detection.patch 3.8 KB

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