fdm.sh 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. #!/bin/sh
  2. # ====================================================================
  3. #
  4. # --------------------------------------------------------------------
  5. ETH=eth1
  6. DIR=prescaler
  7. PIB=tmp.pib
  8. DEV=local
  9. MODE=${1}
  10. # ====================================================================
  11. #
  12. # --------------------------------------------------------------------
  13. if [ ! -d ${DIR} ]; then
  14. echo "Folder ${DIR} does not exist."
  15. exit 1
  16. elif [ "$#" = "0" ]; then
  17. echo
  18. echo "Intellon fdm mode utility"
  19. echo
  20. echo "usage: fdm mode"
  21. echo
  22. echo "mode = \"1\" 2.01MHz to 27.90Mhz w/HAM bands notched"
  23. echo "mode = \"2\" 2.01Mhz to 7.08MHz w/no notches"
  24. echo "mode = \"3\" 2.01Mhz to 7.54MHz w/HAM and Aero notches"
  25. echo "mode = \"4\" 2.01Mhz to 11.91Mhz w/no notches"
  26. echo "mode = \"5\" 2.01MHz to 11.91MHz w/ HAM and Aero notches"
  27. echo "mode = \"6a\" 2.0Mhz to 13.0Mhz w/HAM bands notched"
  28. echo "mode = \"6b\" 17.0Mhz to 28.0Mhz w/HAM bands notched"
  29. echo "mode = \"7a\" 2.0MHz to 10.1MHz w/HAM bands notched"
  30. echo "mode = \"7b\" 14.3MHz to 28.0MHz w/HAM bands notched"
  31. echo "mode = \"8a\" 2.0MHz to 16.0MHz w/HAM bands notched"
  32. echo "mode = \"8b\" 21.0MHz to 28.0MHz w/HAM bands notched"
  33. echo "mode = \"9a\" 2.0MHz to 9.0MHz w/HAM bands notched"
  34. echo "mode = \"9b\" 11.0MHz to 17.0MHz w/HAM bands notched"
  35. echo "mode = \"9c\" 22.0MHz to 28.0MHz w/HAM bands notched"
  36. exit 1
  37. elif [ "$MODE" = "1" ]; then
  38. echo
  39. echo "Setting modem to 2.01 to 27.90Mhz w/Ham bands notched..."
  40. echo
  41. rm -f ${PIB}
  42. int6k -i ${ETH} -p ${PIB} ${DEV}
  43. psin < ${DIR}/INT6400-Wall-NA.txt ${PIB}
  44. setpib ${PIB} a0c byte 0
  45. int6k -i ${ETH} -P ${PIB} ${DEV}
  46. echo "programming and resetting ..."
  47. int6k -i ${ETH} -C2 ${DEV}
  48. rm ${PIB}
  49. exit 1
  50. elif [ "$MODE" = "2" ]; then
  51. echo
  52. echo "Setting modem to 2.01Mhz to 7.08MHz w/no notches"
  53. echo
  54. rm -f ${PIB}
  55. int6k -i ${ETH} -p ${PIB} ${DEV}
  56. psin < ${DIR}/2To7.txt ${PIB}
  57. setpib ${PIB} a0c byte 13
  58. echo "programming and resetting ..."
  59. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  60. rm ${PIB}
  61. exit 1
  62. elif [ "$MODE" = "3" ]; then
  63. echo
  64. echo "Setting modem to 2.01Mhz to 7.54MHz w/HAM and Aero notches"
  65. echo
  66. rm -f ${PIB}
  67. int6k -i ${ETH} -p ${PIB} ${DEV}
  68. psin < ${DIR}/2To75_notched.txt ${PIB}
  69. setpib ${PIB} a0c byte 14
  70. echo "programming and resetting ..."
  71. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  72. rm ${PIB}
  73. exit 1
  74. elif [ "$MODE" = "4" ]; then
  75. echo
  76. echo "Setting modem to 2.01Mhz to 11.91Mhz w/no notches"
  77. echo
  78. rm -f ${PIB}
  79. int6k -i ${ETH} -p ${PIB} ${DEV}
  80. psin < ${DIR}/2To12.txt ${PIB}
  81. setpib ${PIB} a0c byte 15
  82. echo "programming and resetting ..."
  83. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  84. rm ${PIB}
  85. exit 1
  86. elif [ "$MODE" = "5" ]; then
  87. echo
  88. echo "Setting modem to 2.01MHz to 11.91MHz w/ HAM and Aero notches"
  89. echo
  90. rm -f ${PIB}
  91. int6k -i ${ETH} -p ${PIB} ${DEV}
  92. psin < ${DIR}/2To12_notched.txt ${PIB}
  93. setpib ${PIB} a0c byte 16
  94. echo "programming and resetting ..."
  95. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  96. rm ${PIB}
  97. exit 1
  98. elif [ "$MODE" = "6a" ]; then
  99. echo
  100. echo "Setting modem to 2.0Mhz to 13.0Mhz w/HAM bands notched"
  101. echo
  102. rm -f ${PIB}
  103. int6k -i ${ETH} -p ${PIB} ${DEV}
  104. psin < ${DIR}/2To13_notched.txt ${PIB}
  105. setpib ${PIB} a0c byte 5
  106. echo "programming and resetting ..."
  107. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  108. rm ${PIB}
  109. exit 1
  110. elif [ "$MODE" = "6b" ]; then
  111. echo
  112. echo "Setting modem to 17.0Mhz to 28.0Mhz w/HAM bands notched"
  113. echo
  114. rm -f ${PIB}
  115. int6k -i ${ETH} -p ${PIB} ${DEV}
  116. psin < ${DIR}/17To28_notched.txt ${PIB}
  117. setpib ${PIB} a0c byte 6
  118. echo "programming and resetting ..."
  119. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  120. rm ${PIB}
  121. exit 1
  122. elif [ "$MODE" = "7a" ]; then
  123. echo
  124. echo "Setting modem to 2.0MHz to 10.1MHz w/HAM bands notched"
  125. echo
  126. rm -f ${PIB}
  127. int6k -i ${ETH} -p ${PIB} ${DEV}
  128. psin < ${DIR}/2To101_notched.txt ${PIB}
  129. setpib ${PIB} a0c byte 7
  130. echo "programming and resetting ..."
  131. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  132. rm ${PIB}
  133. exit 1
  134. elif [ "$MODE" = "7b" ]; then
  135. echo
  136. echo "Setting modem to 14.3MHz to 28.0MHz w/HAM bands notched"
  137. echo
  138. rm -f ${PIB}
  139. int6k -i ${ETH} -p ${PIB} ${DEV}
  140. psin < ${DIR}/143To28_notched.txt ${PIB}
  141. setpib ${PIB} a0c byte 8
  142. echo "programming and resetting ..."
  143. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  144. rm ${PIB}
  145. exit 1
  146. elif [ "$MODE" = "8a" ]; then
  147. echo
  148. echo "Setting modem to 2.0MHz to 16.0MHz w/HAM bands notched"
  149. echo
  150. rm -f ${PIB}
  151. int6k -i ${ETH} -p ${PIB} ${DEV}
  152. psin < ${DIR}/2To16_notched.txt ${PIB}
  153. setpib ${PIB} a0c byte 9
  154. echo "programming and resetting ..."
  155. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  156. rm ${PIB}
  157. exit 1
  158. elif [ "$MODE" = "8b" ]; then
  159. echo
  160. echo "Setting modem to 21.0MHz to 28.0MHz w/HAM bands notched"
  161. echo
  162. rm -f ${PIB}
  163. int6k -i ${ETH} -p ${PIB} ${DEV}
  164. psin < ${DIR}/21To28_notched.txt ${PIB}
  165. setpib ${PIB} a0c byte 10
  166. echo "programming and resetting ..."
  167. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  168. rm ${PIB}
  169. exit 1
  170. elif [ "$MODE" = "9a" ]; then
  171. echo
  172. echo "Setting modem to 2.0MHz to 9.0MHz w/HAM bands notched"
  173. echo
  174. rm -f ${PIB}
  175. int6k -i ${ETH} -p ${PIB} ${DEV}
  176. psin < ${DIR}/2To9_notched.txt ${PIB}
  177. setpib ${PIB} a0c byte 2
  178. echo "programming and resetting ..."
  179. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  180. rm ${PIB}
  181. exit 1
  182. elif [ "$MODE" = "9b" ]; then
  183. echo
  184. echo "Setting modem to 11.0MHz to 17.0MHz w/HAM bands notched"
  185. echo
  186. rm -f ${PIB}
  187. int6k -i ${ETH} -p ${PIB} ${DEV}
  188. psin < ${DIR}/11To17_notched.txt ${PIB}
  189. setpib ${PIB} a0c byte 3
  190. echo "programming and resetting ..."
  191. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  192. rm ${PIB}
  193. exit 1
  194. elif [ "$MODE" = "9c" ]; then
  195. echo
  196. echo "Setting modem to 22.0MHz to 28.0MHz w/HAM bands notched"
  197. echo
  198. rm -f ${PIB}
  199. int6k -i ${ETH} -p ${PIB} ${DEV}
  200. psin < ${DIR}/22To28_notched.txt ${PIB}
  201. setpib ${PIB} a0c byte 4
  202. echo "programming and resetting ..."
  203. int6k -i ${ETH} -P ${PIB} -C2 ${DEV}
  204. rm ${PIB}
  205. exit 1
  206. else
  207. echo "ERROR: not a valid mode number"
  208. exit 0
  209. fi