Advertisement
Guest User

Untitled

a guest
Aug 17th, 2011
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 11.00 KB | None | 0 0
  1. #The contents of this file, to the extent that they are copyrightable, are hereby placed in the public domain.  If anyone reading this wishes to contact me with more information or patches, send e-mail to mm201108 at zzxc dot net.
  2.  
  3. #Sprint 4G on Ubuntu 11.04+ with a 250U modem.  These instructions correct omissions in the official documentation and patch the driver to work in modern Linux kernels.
  4.  
  5. #Because the wimax modem in the 250U doesn't actually work unless the Windows driver and Sprint SmartView initialize it first, this also contains a patch for the sierra kernel driver and a python script to simulate SmartView.
  6.  
  7. #This guide keeps all the installed files in the working directory instead of installing them to the system - so as to prevent conflicts when the system is upgraded later.
  8.  
  9.  
  10. #0) Create a working directory for the big mess you're about to create.
  11. mkdir ~/sprint
  12. cd ~/sprint
  13.  
  14.  
  15. #1) Get prerequisites
  16. sudo apt-get install libnl-dev
  17. sudo apt-get install linux-kernel-headers
  18. sudo apt-get install libssl-dev
  19.  
  20.  
  21. #2) Get Sprint4GDeveloperPack-1.6.1.2.2.tar.gz and extract it.  Inside, extract Rel_6.1.2.2_USB-Updated.zip.  Read the enclosed instructions and ensure that you extract the correct wimaxd.conf, the correct macxvi.cfg file, and the USB_350 folder.
  22.  
  23. #3) Copy firmware
  24. sudo cp macxvi.cfg /lib/firmware
  25. sudo cp USB_350/Binaries/Firmware/macxvi350.bin /lib/firmware
  26.  
  27.  
  28. #4) Build the API files
  29. cd USB_350/Source/API
  30. dos2unix build.sh
  31. chmod 755 build.sh
  32. ./build.sh
  33. cd tgtxvi020
  34. sudo make install
  35.  
  36.  
  37. #5) Fix the build file, as we're in unix
  38. cd ../../CSCM
  39. chmod 755 build.sh
  40. dos2unix build.sh
  41.  
  42.  
  43. #6) Now let's fix the wpa_supplicant.  Nix the DOS drive letters in the file to prevent syntax errors.
  44. sed -i 's/C:\//\//g' wpa_supplicant/*.d
  45.  
  46. #7) Copy libxvi020.so to the right place
  47. cp ../API/bin_linux/bin/libxvi* bin_pc_linux/bin/
  48.  
  49. #8) Build it:
  50. ./build.sh pc_linux
  51.  
  52. #9) Exit this folder
  53. cd ../../..
  54.  
  55.  
  56. #10) kill the bcm_wimax driver - it doesn't work with any existing software.  Also, kill the sierra driver because you will be replacing it later.
  57. /bin/echo -e "blacklist sierra\nblacklist bcm_wimax" >> /etc/modprobe.d/blacklist.conf
  58.  
  59.  
  60. #11) Build the Beceem driver from your Sprint 4G Developer Pack.
  61. cd USB_350/Source/Driver/Network/OSAL/Linux/usb
  62.  
  63. #12) IMPORTANT: FIX LINE ENDINGS SO THAT THE FOLLOWING PATCH APPLIES CLEANLY!!!
  64. dos2unix Include/Common/led_control.h
  65. dos2unix Include/Common/osal_misc.h
  66. dos2unix Interface/usb/InterfaceInit.c
  67.  
  68.  
  69. #13) Edit the Makefile to point to the right location of your kernel headers.  Patch the Beceem driver to take care of http://git390.marist.edu/cgi-bin/gitweb.cgi?p=linux-2.6.git;a=commitdiff_plain;h=9bbdf1e0afe771ca7650f9f476769310bee9d8f3 , http://kerneltrap.org/mailarchive/git-commits-head/2010/4/30/32383 , http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626790 , and http://www.gossamer-threads.com/lists/linux/kernel/1263098
  70.  
  71. #I wrote a patch to do that.  Un-base64 the following blob of data, then decompress it with xz.  Apply the patch to the 'usb' folder you're in right now. (hint: pipe it to "patch -p1")
  72. : <<'END'
  73.  
  74. /Td6WFoAAATm1rRGAgAhARwAAAAQz1jM4BaoB6VdADIaSQnC/BF9UN4KT0fXHd5NuXXL0v4hZC+B
  75. rifuihGksiZISn8tIyzOA+Gryvp3JUMcKa6YDlyOzXAmVm2aWF1keWKA3gBNN4rqQISA0TFVELjU
  76. wL34HVKY5PFlNQ/5uZXFiZ65nOpzKNvb2faW3E1MhC35k8yHHOKN1M/y2k5NWvcqAk1c3j8J3qyx
  77. HcOAi4GgcP+gx9FYP8HlHfz4KSlLvMahyAzmNlIopThl570Mrc620lm5KsejT79/+mPyVqhlyhwm
  78. TfK57ZA/U/oAkytPBX9DFzma/oGaay9ZHlI1Syi/odqKyy4kWephvHqFTaL7EOhSR/BVPCuad8rX
  79. tgKecy0ymU0WcedFFfbzC/mJn5fxk2wYmgkG+rKcww/o2PEeVVHv6TasSGtuBjV9OWZCNVCqYRxS
  80. uAM4wK2gkzuik+1t1BhVP9ITWyNndzkKpgcn7/hbjAZMaibAAaM3YGECRReAsGpfZXc7bFYqPOae
  81. aRugkZh26jz33DSNBX4uaptwWc7VBXS7F0k21vnAi4DQqB52cyzN/lAE0R2AI/fyptPI5NtAxWth
  82. pnQCywxMnW8l7evOX2U1zw786ioAFF6hbBKebd92qaHF38bWRQb9+I1DcQn4Hq5vD07kC/a62q8n
  83. sNjK8EsWgtDbPCC2ApnLQ6wWV33g9pvJfG0yhZG9pgYf1hcvz4ct+1prP9aOcBITiU4Pv58xx42c
  84. 9mWmNfKBmAOJlS2YfQe0qEb0oowT/kCvXR4geNUJA/FU9qqd0/RW4uoLzNgjxEo5CjVDFxfg04Dt
  85. gybL9GC//zjdylJOignb069JYvx39N3e0Ny8MIf3qX6Imqrx9a86/AzSj5Vz/Z8f5v2kPv4HcNMJ
  86. pWmbRj/Y/Pf7b9x26+KoqBcD3qx6iCT5FirEV8l98wHxrbte2Ko684PlZqEPxntgAa5upK/EOsUg
  87. ppYWpv4k/Nw6TawM8um7eSr/mRvJBCTI7xDsRuoXdb2IKscB6sYjh3dNqckxzawHOkzinRICgv0P
  88. KP90gRMBIIcnxZiYRVQaKo+NjKhdmu3LIp5pszJaxs9MXParvbgGgk5nedWHQFsq7LwcMfsATnW6
  89. T34qbisD9gIA9F6zYuOOkzyYo7o3mfaHkAOc9bmJZq6eJemqkBSUt4fTrqfDNs7zl4DfCkSJcTN5
  90. gUSsIw5CCBH7e9TXU80v0/mTqQApuyZXFYVorwwo1f3FCvwx8EJIzmY/MD9muJLe75Ktowjpinsd
  91. uExHSh5Y3bW3xgZVhbRJpKu4sGFbIFzlHW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H+X+qYCGLbJzSTt0FBOhfY+
  105. 6rWRanHDXylJxATMGPU9tWq/aQ1oRXFws7Tg+oKrlUDKF2JpUuuDJZYyV6ynv/4cJQKU2IT9EBLH
  106. TPD0lAQjcJZya2IvajS6j8HhQJe5o7GXZxqq4dAgwx2aQjE3gzJtSeHaNw1EfXB0HUYsZbvsjJ/j
  107. 8An2H4PAZUdPbd9ZHt6hK7S0T2AMcfewpD4uRLXAjGNsw7W0ZCsH0/OXJvRY6d4pgQEyX5SsGuR6
  108. /gEw6xOg2AQd+4/WQRhdKvPCddA21qILmbSHZaDtRAg2DYh34ThC+5W8kWxcWlAFXzwAAAAAkfP6
  109. wI+eWcEAAcEPqS0AACENR5uxxGf7AgAAAAAEWVo=
  110.  
  111.  
  112. END
  113.  
  114. #14) Build it.
  115. make
  116.  
  117. #15) Insert your new module
  118. sudo insmod drxvi314.ko
  119.  
  120. #16) Build the sierra250 module, a slightly modified version of the sierra driver.  Un-base64 this additional blob of binary data, decompress it with xz, and untar it with tar.  You will have a new folder named sierra250.  Enter it and follow the instructions in the README.
  121.  
  122. : <<'END'
  123.  
  124. /Td6WFoAAATm1rRGAgAhARwAAAAQz1jM4Cf/BT1dADmaSNSNlVi+WvxHRwuVR4pFXtmxf4+D7gVJ
  125. OGzGCm/RRTNTnsDuJbGWZBSuJ+R86kOAkI/D6DdSBBCXFins4Ft6IkYLNRw0TZuii8GeeAwkHO53
  126. kWFH1IPiRAWiixJdIda7bal+wb3OS6YWj/HBmwXnf8ygAgEe4iO0V4V3yLT9zTil8TmiHFHUDise
  127. hGO8Kd5PEEM7/8qk7J8SD4VWKv7LR6irgqJ4WXcq3FCkkzNPmYglSxApvRUKwjH6q0VzqFlCCTSr
  128. hYPAXvPmXzo63KMy2eNXEf0EuJIv5DRf7IWMjM05eOcc+gKNZ6nu9bI8Md/t/1OWP0oYa0qWmXue
  129. A1RKoiy0qlHQyusOWNuyvR5UzGk95HiHppWtev0N/cyimmAT9HCalRIOCDvKo4Lv1OPFroFaATEM
  130. 1LV94yJ89Qs2N1yqvHYR8w9vNg3PDKnXtOha6+Ltx12V3LwKNbaMkccVIfP5hIrfCO6v7RuPNVj2
  131. sAiDV5Qc1hgIAUKas97zH3UB6SLZZQbivC6AUMMlYrJ7p4faP+uiPRCRq6qqM9izNK3aS07Q3w7h
  132. GytHPChzYswREeqlIOnaItaAZb0s38ij12taRdOGxwwgYrpwmf2NJ7DOIlUsQaNC5WSdVVs3uyKH
  133. UIB1B3oBzXjyqpG1GeJU7R6CXGEEe7s4BfVaq2tuKm3XaYSvz1RmAOATlJGXmq9Hxw68TPvoHoid
  134. Rx3sIjwktUwkM2O3KPfS1a/p4IMOg5Galo9bcsm8tPe+1FHSC2vXGc2B57MF+DAl1QpQ64WAcKiO
  135. ekl6dycUch8EEZ2M/M39GYv9tJj217evBpiqUa8UlnAO5d9i1ArKNX/kAOGNFouObfaNb5IPME2U
  136. fxzgMCqTcH8xQUaC2HnShgHUF5R5h8Jmu5jVcTWfcFAO1Axoi5oUc7Iv4nmsESTPCqz+KPGmdug6
  137. dADOj1xqj4CkefgDFv3ioTwv+TzROcyE2zwEpS8AJ3DCiLVYMjPJxWZNJChLGZ3jxmky1IR7O0lE
  138. 3KnhEPbRWzalTkApTlCrzJjqLpmRLj7C0IhyF2lZ6EFy0LJU1NSX3g2IzLWBwZicEPP6HR8sQmxU
  139. TPJY4B5ZDUkMmEqi8NaD5iTMgWYVO7eUuVojkHjXLmbjcEhktcg4ihsQh8DhMM5idOhBtEBzEycn
  140. xZwaZDN+UaxO+z8xL5/Dih34+Yid8O89M2l6oOvzISO8S+my7ThoExWZFGq3wMGjaRYju4HR5hRW
  141. xMkEY9mTJo2ihEYRAIVPTsjEhjQizbArRc+rTzfLb6Vx4G3e96otuO2s+AkEx2TwOuuJh+cY1aAu
  142. IXmnsPD74OQ+c4aPF4OgDVyynJK7kTdXorRxKclgxtgqHKdXJYncDrpCNuSk7SJFNPanyzGHMRvF
  143. xP814PcYXOAsY203z4PVGRumZGELUeV9/TbmrorQsTKAVv/Ik+FQd0pLc+Ztm+sOOSZo/44eKpOu
  144. 6Jf4dillKWQvX4cIiTbM9Jp3hW5xg4rDMaRuf8wT1+AkETbDa6hsQZT8XTbT3HaG0i5lYrn4yigU
  145. 1pmUK9OhAHoYUyz2OvxJUKVu4yCs6rhfc8fmFPJ4HdvdmIpGLvsbPtEsLhLBvwAA9rOQ+mFCEMwr
  146. HNyEHGurhabjc1Vb9eiTJFsiupWKGD+6aIsdF6om1SI8HGKoMlGn2UoP/2Ln9uPik69+fzCr7OLn
  147. CD0W+1zY4l5PV7E5M0PImnSJVWuoGV30Lh9l+InkB//AEmBZfIcxJQ/PMjqqSh1TRxsFk1dxZEaP
  148. vJwkAAAAAAA9LPxWDtq92QAB2QqAUAAAEBkxPbHEZ/sCAAAAAARZWg==
  149.  
  150.  
  151. END
  152.  
  153. cd sierra250
  154. sudo insmod sierra250.ko
  155.  
  156. #17) You'll now have /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, and /dev/ttyUSB3.  The first is a serial modem port, and the second is a "CNS" (binary proprietary protocol from Sierra Wireless).  Unfortunately, you'll need to issue a CNS command to turn off the CDMA modem before your WiMAX modem will work.  I wrote a simple Python script to do that - decode (un-base64), decompress (xzip), and save the following data to cns1075.py
  157.  
  158. : <<'END'
  159.  
  160. /Td6WFoAAATm1rRGAgAhARwAAAAQz1jM4Ay/A7ldABGIQkeKIzPDdw8z/VhnH14++zRlb+ysPMFG
  161. kEy/AsNgVesP59jLMFt1tj4k8GrUQ3n0yH+jmUcWDYlJfPVRgcIrz+ViYV2f+xEtQeTQZhl9eqp3
  162. WYMYmjIVe4PvmxehA6Z5RB2Gd3mdcNEhTIvgko3MO0ql+Q8I3CqG34W30u/MupFh15JJ4bc/FFdZ
  163. T8vAlvHk5WtmjFaYv7wPKsBzxzQCj1OftYFZpygKaaXefGRztN5ZikIX0mw/c0faxJ2kbJ2ibPfa
  164. qkD9cpvfNih9bNhNuvqsMY0XBXsauY7qY4Uqexcsbu4ktbKAYMY3YC6XdJkDevQTNllohUTa3tTA
  165. dBkD4skYW9ovZYnT515rdjv10soootATFoVikgbRvzTDSlTD40HvYv3w7Sf55gImP2n1b/ZLpLen
  166. N90UmxIzGeJdHDTUrcEjlBSzr4/OXsB1dRU3tKhLw+2yuVYn9b1od4s6021mBG78r37RMA6wetw7
  167. C0lUJZw+ZC4W7BWki1QU6z1UZ7jyksUP9/pyvvLpwjV4hAaI8wpStxnCTEm8rxyf6Wdb4Ik2X4aP
  168. /8/TuKOIAweaJo0Qlrvf1DMmX1eT5SXgrNsShmxwKoKrEri1Bem5IELHm1yAESiS5Xa/eF7x58Sv
  169. 3eRfCD6k09or6lCDPyge4Bku+7McAArIYBQan63N1r8rlAhSaXIZwa031wYYk/bifyijZRWO1Gxw
  170. meKsRBj/jiLcppy0aeYTBPZXTE4zI7lIRA4FBXYkN9AoDUz6oNDtkm8CB17Rzzt89xs968q2cqdv
  171. zhZdHhbflls7N5jAifbFz1CCFD8BCykq9G1qbDmlf6GV3beJDO9NzPfw37Ms1CAht8PNkvb0grfb
  172. 77tCo570W1g8IyztHENb6nTevJSlG/znbiZCORdJagBrcg4NmY9nE1vDus14QAHPl6l4oy70Wqs6
  173. jMAaA9amQsSkzSy0mx9+KRDI/thKZ9vsgz+Ui/X2Jfsd4zzE5NU4/f/HZ3Pj6JmJUgpneu9uq3F5
  174. ixYXVbD0/NocKt7be1onaiKRd3f9Mc2FZkfpApxMUZx5FwqTkxTMvf8OYQ1d7a60Zd+2LmVHn9xh
  175. OarcXqxIUPIkGxdG/oD184Lf74fd3wr2ojcE4Lm+HwD1OvUycWUcMMmapW4gbG/lxDyJ/QrePg0V
  176. dIZt9jZWPoWaT1cI3qZuFhRDa36Z9CJ2BJPT//v78lE9d0CLe+NILzrG/a2iWvwULXHwdwRqoaZC
  177. zLjcTEknJ4SxIjTGgswAAAAAAHMTYlKG//KRAAHVB8AZAACo8zxWscRn+wIAAAAABFla
  178.  
  179. END
  180.  
  181. #18) Execute the python script.  It puts your terminal in character-mode input and awaits commands:
  182. # q = quit the program  (You can also use CTRL+C)
  183. # C = CDMA radio on
  184. # c = CDMA radio off
  185. # W = wimax LED on
  186. # w = wimax LED off
  187. # ? = make the wimax LED blink
  188. # D = Cancel DM session (sometimes necessary, if the 3G modem is in use)
  189.  
  190. sudo ./cns1075.py
  191.  
  192. #You want to execute only the c (lowercase letter c) and q commands, to turn off the CDMA radio and quit.  Optionally, you can turn the wimax LED on/off or change its color.
  193.  
  194. #19) Finally - test it
  195. cd ../../../../../CSCM/bin_pc_linux/bin/
  196. sudo env LD_LIBRARY_PATH=. ./wimaxd -c ~/sprint/wimaxd.conf -D
  197. #Open another shell and start the client:
  198. env LD_LIBRARY_PATH=. ./wimaxc -i
  199. search
  200.  
  201.  
  202. #20) Follow the instructions in the Sprint 4G PDF to configure EAP.  When it's working, use a shell script to insmod the driver, establish your connection, launch dhcpd, and fix network routes.  (When the bcm_wimax kernel driver is finished, and NetworkManager 0.9+ is in use, this should work automagically.  Until then, it's ugly.)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement