0039-fix-UBNT-XM-model-detection.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From: Neal Oakey <neal.oakey@bingo-ev.de>
  2. Date: Sun, 14 Feb 2016 20:58:20 +0100
  3. Subject: fix UBNT XM model detection
  4. Signed-off-by: Neal Oakey <neal.oakey@bingo-ev.de>
  5. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  6. index d0abf42..f345fae 100755
  7. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  8. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  9. @@ -64,6 +64,40 @@ wndr3700_board_detect() {
  10. AR71XX_MODEL="$machine"
  11. }
  12. +ubnt_get_mtd_part_magic() {
  13. + ar71xx_get_mtd_offset_size_format EEPROM 4118 2 %02x
  14. +}
  15. +
  16. +ubnt_xm_board_detect() {
  17. + local model
  18. + local magic
  19. +
  20. + magic="$(ubnt_get_mtd_part_magic)"
  21. + case ${magic:0:3} in
  22. + "e00"|\
  23. + "e01"|\
  24. + "e80") # It seams that there are different Versions of the Nanostation
  25. + model="Ubiquiti NanoStation M"
  26. + ;;
  27. + "e0a")
  28. + model="Ubiquiti NanoStation loco M"
  29. + ;;
  30. + "e1b") # Note: the M5 has not been tested!
  31. + # and the Ti Versions are still missing
  32. + model="Ubiquiti Rocket M"
  33. + ;;
  34. + "e20"|\
  35. + "e2d") # Bullet Ti M
  36. + model="Ubiquiti Bullet M"
  37. + ;;
  38. + "e30")
  39. + model="Ubiquiti PicoStation M"
  40. + ;;
  41. + esac
  42. +
  43. + [ ! -z "$model" ] && AR71XX_MODEL="${model}${magic:3:1}"
  44. +}
  45. +
  46. cybertan_get_hw_magic() {
  47. local part
  48. @@ -472,12 +506,14 @@ ar71xx_board_detect() {
  49. ;;
  50. *"Bullet M")
  51. name="bullet-m"
  52. + ubnt_xm_board_detect
  53. ;;
  54. *"Loco M XW")
  55. name="loco-m-xw"
  56. ;;
  57. *"Nanostation M")
  58. name="nanostation-m"
  59. + ubnt_xm_board_detect
  60. ;;
  61. *"Nanostation M XW")
  62. name="nanostation-m-xw"
  63. @@ -664,6 +700,7 @@ ar71xx_board_detect() {
  64. ;;
  65. *"Rocket M")
  66. name="rocket-m"
  67. + ubnt_xm_board_detect
  68. ;;
  69. *"Rocket M XW")
  70. name="rocket-m-xw"