README 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. ================================================================================
  2. README for USB8388
  3. (c) Copyright © 2003-2006, Marvell International Ltd.
  4. All Rights Reserved
  5. This software file (the "File") is distributed by Marvell International
  6. Ltd. under the terms of the GNU General Public License Version 2, June 1991
  7. (the "License"). You may use, redistribute and/or modify this File in
  8. accordance with the terms and conditions of the License, a copy of which
  9. is available along with the File in the license.txt file or by writing to
  10. the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  11. 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
  12. THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
  13. IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  14. ARE EXPRESSLY DISCLAIMED. The License provides additional details about
  15. this warranty disclaimer.
  16. ================================================================================
  17. =====================
  18. DRIVER LOADING
  19. =====================
  20. o. Copy the firmware image (e.g. usb8388.bin) to /lib/firmware/
  21. o. Load driver by using the following command:
  22. insmod usb8388.ko [fw_name=usb8388.bin]
  23. =====================
  24. IWPRIV COMMAND
  25. =====================
  26. NAME
  27. This manual describes the usage of private commands used in Marvell WLAN
  28. Linux Driver. All the commands available in Wlanconfig will not be available
  29. in the iwpriv.
  30. SYNOPSIS
  31. iwpriv <ethX> <command> [sub-command] ...
  32. iwpriv ethX setregioncode <n>
  33. iwpriv ethX getregioncode
  34. Version 5 Command:
  35. iwpriv ethX ledgpio <n>
  36. BT Commands:
  37. The blinding table (BT) contains a list of mac addresses that will be,
  38. by default, ignored by the firmware. It is also possible to invert this
  39. behavior so that we will ignore all traffic except for the portion
  40. coming from mac addresess in the list. It is primarily used for
  41. debugging and testing networks. It can be edited and inspected with
  42. the following commands:
  43. iwpriv ethX bt_reset
  44. iwpriv ethX bt_add <mac_address>
  45. iwpriv ethX bt_del <mac_address>
  46. iwpriv ethX bt_list <id>
  47. iwpriv ethX bt_get_invert <n>
  48. iwpriv ethX bt_set_invert <n>
  49. FWT Commands:
  50. The forwarding table (FWT) is a feature used to manage mesh network
  51. routing in the firmware. The FWT is essentially a routing table that
  52. associates a destination mac address (da) with a next hop receiver
  53. address (ra). The FWT can be inspected and edited with the following
  54. iwpriv commands, which are described in greater detail below.
  55. Eventually, the table will be automatically maintained by a custom
  56. routing protocol.
  57. NOTE: FWT commands replace the previous DFT commands. What were the DFT
  58. commands?, you might ask. They were an earlier API to the firmware that
  59. implemented a simple MAC-layer forwarding mechanism. In the unlikely
  60. event that you were using these commands, you must migrate to the new
  61. FWT commands which can be used to achieve the same functionality.
  62. iwpriv ethX fwt_add [parameters]
  63. iwpriv ethX fwt_del [parameters]
  64. iwpriv ethX fwt_lookup [parameters]
  65. iwpriv ethX fwt_list [parameters]
  66. iwpriv ethX fwt_list_route [parameters]
  67. iwpriv ethX fwt_list_neigh [parameters]
  68. iwpriv ethX fwt_reset [parameters]
  69. iwpriv ethX fwt_cleanup
  70. iwpriv ethX fwt_time
  71. MESH Commands:
  72. The MESH commands are used to configure various features of the mesh
  73. routing protocol. The following commands are supported:
  74. iwpriv ethX mesh_get_ttl
  75. iwpriv ethX mesh_set_ttl ttl
  76. DESCRIPTION
  77. Those commands are used to send additional commands to the Marvell WLAN
  78. card via the Linux device driver.
  79. The ethX parameter specifies the network device that is to be used to
  80. perform this command on. it could be eth0, eth1 etc.
  81. setregioncode
  82. This command is used to set the region code in the station.
  83. where value is 'region code' for various regions like
  84. USA FCC, Canada IC, Spain, France, Europe ETSI, Japan ...
  85. Usage:
  86. iwpriv ethX setregioncode 0x10: set region code to USA (0x10).
  87. getregioncode
  88. This command is used to get the region code information set in the
  89. station.
  90. ledgpio
  91. This command is used to set/get LEDs.
  92. iwpriv ethX ledgpio <LEDs>
  93. will set the corresponding LED for the GPIO Line.
  94. iwpriv ethX ledgpio
  95. will give u which LEDs are Enabled.
  96. Usage:
  97. iwpriv eth1 ledgpio 1 0 2 1 3 4
  98. will enable
  99. LED 1 -> GPIO 0
  100. LED 2 -> GPIO 1
  101. LED 3 -> GPIO 4
  102. iwpriv eth1 ledgpio
  103. shows LED information in the format as mentioned above.
  104. Note: LED0 is invalid
  105. Note: Maximum Number of LEDs are 16.
  106. fwt_add
  107. This command is used to insert an entry into the FWT table. The list of
  108. parameters must follow the following structure:
  109. iwpriv ethX fwt_add da ra [metric dir rate ssn dsn hopcount ttl expiration sleepmode snr]
  110. The parameters between brackets are optional, but they must appear in
  111. the order specified. For example, if you want to specify the metric,
  112. you must also specify the dir, ssn, and dsn but you need not specify the
  113. hopcount, expiration, sleepmode, or snr. Any unspecified parameters
  114. will be assigned the defaults specified below.
  115. The different parameters are:-
  116. da -- DA MAC address in the form 00:11:22:33:44:55
  117. ra -- RA MAC address in the form 00:11:22:33:44:55
  118. metric -- route metric (cost: smaller-metric routes are
  119. preferred, default is 0)
  120. dir -- direction (1 for direct, 0 for reverse,
  121. default is 1)
  122. rate -- data rate used for transmission to the RA,
  123. as specified for the rateadapt command,
  124. default is 3 (11Mbps)
  125. ssn -- Source Sequence Number (time at the RA for
  126. reverse routes. Default is 0)
  127. dsn -- Destination Sequence Number (time at the DA
  128. for direct routes. Default is 0)
  129. hopcount -- hop count (currently unused, default is 0)
  130. ttl -- TTL (Only used in reverse entries)
  131. expiration -- entry expiration (in ticks, where a tick is
  132. 1024us, or ~ 1ms. Use 0 for an indefinite
  133. entry, default is 0)
  134. sleepmode -- RA's sleep mode (currently unused, default is
  135. 0)
  136. snr -- SNR in the link to RA (currently unused,
  137. default is 0)
  138. The command does not return anything.
  139. fwt_del
  140. This command is used to remove an entry to the FWT table. The list of
  141. parameters must follow the following structure:
  142. iwpriv ethX fwt_del da ra [dir]
  143. where the different parameters are:-
  144. da -- DA MAC address (in the form "00:11:22:33:44:55")
  145. ra -- RA MAC address (in the form "00:11:22:33:44:55")
  146. dir -- direction (1 for direct, 0 for reverse,
  147. default is 1)
  148. The command does not return anything.
  149. fwt_lookup
  150. This command is used to get the best route in the FWT table to a given
  151. host. The only parameter is the MAC address of the host that is being
  152. looked for.
  153. iwpriv ethX fwt_lookup da
  154. where:-
  155. da -- DA MAC address (in the form "00:11:22:33:44:55")
  156. The command returns an output string identical to the one returned by
  157. fwt_list described below.
  158. fwt_list
  159. This command is used to list a route from the FWT table. The only
  160. parameter is the index into the table. If you want to list all the
  161. routes in a table, start with index=0, and keep listing until you get a
  162. "(null)" string. Note that the indicies may change as the fwt is
  163. updated. It is expected that most users will not use fwt_list directly,
  164. but that a utility similar to the traditional route command will be used
  165. to invoke fwt_list over and over.
  166. iwpriv ethX fwt_list index
  167. The output is a string of the following form:
  168. da ra valid metric dir rate ssn dsn hopcount ttl expiration
  169. sleepmode snr precursor
  170. where the different fields are:-
  171. da -- DA MAC address (in the form "00:11:22:33:44:55")
  172. ra -- RA MAC address (in the form "00:11:22:33:44:55")
  173. valid -- whether the route is valid (0 if not valid)
  174. metric -- route metric (cost: smaller-metric routes are preferred)
  175. dir -- direction (1 for direct, 0 for reverse)
  176. rate -- data rate used for transmission to the RA,
  177. as specified for the rateadapt command
  178. ssn -- Source Sequence Number (time at the RA for reverse routes)
  179. dsn -- Destination Sequence Number (time at the DA for direct routes)
  180. hopcount -- hop count (currently unused)
  181. ttl -- TTL (only used in reverse entries)
  182. expiration -- entry expiration (in ticks, where a tick is 1024us, or ~ 1ms. Use 0 for an indefinite entry)
  183. sleepmode -- RA's sleep mode (currently unused)
  184. snr -- SNR in the link to RA (currently unused)
  185. precursor -- predecessor in direct routes
  186. fwt_list_route
  187. This command is equivalent to fwt_list.
  188. fwt_list_neigh
  189. This command is used to list a neighbor from the FWT table. The only
  190. parameter is the neighbor ID. If you want to list all the neighbors in a
  191. table, start with nid=0, and keep incrementing nid until you get a
  192. "(null)" string. Note that the nid from a fwt_list_route command can be
  193. used as an input to this command. Also note that this command is meant
  194. mostly for debugging. It is expected that users will use fwt_lookup.
  195. One important reason for this is that the neighbor id may change as the
  196. neighbor table is altered.
  197. iwpriv ethX fwt_list_neigh nid
  198. The output is a string of the following form:
  199. ra sleepmode snr references
  200. where the different fields are:-
  201. ra -- RA MAC address (in the form "00:11:22:33:44:55")
  202. sleepmode -- RA's sleep mode (currently unused)
  203. snr -- SNR in the link to RA (currently unused)
  204. references -- RA's reference counter
  205. fwt_reset
  206. This command is used to reset the FWT table, getting rid of all the
  207. entries. There are no input parameters.
  208. iwpriv ethX fwt_reset
  209. The command does not return anything.
  210. fwt_cleanup
  211. This command is used to perform user-based garbage recollection. The
  212. FWT table is checked, and all the entries that are expired or invalid
  213. are cleaned. Note that this is exported to the driver for debugging
  214. purposes, as garbage collection is also fired by the firmware when in
  215. space problems. There are no input parameters.
  216. iwpriv ethX fwt_cleanup
  217. The command does returns the number of invalid/expired routes deleted.
  218. fwt_time
  219. This command returns a card's internal time representation. It is this
  220. time that is used to represent the expiration times of FWT entries. The
  221. number is not consistent from card to card; it is simply a timer count.
  222. The fwt_time command is used to inspect the timer so that expiration
  223. times reported by fwt_list can be properly interpreted.
  224. iwpriv ethX fwt_time
  225. mesh_get_ttl
  226. The mesh ttl is the number of hops a mesh packet can traverse before it
  227. is dropped. This parameter is used to prevent infinite loops in the
  228. mesh network. The value returned by this function is the ttl assigned
  229. to all mesh packets. Currently there is no way to control the ttl on a
  230. per packet or per socket basis.
  231. iwpriv ethX mesh_get_ttl
  232. mesh_set_ttl ttl
  233. Set the ttl. The argument must be between 0 and 255.
  234. iwpriv ethX mesh_set_ttl <ttl>
  235. =========================
  236. ETHTOOL
  237. =========================
  238. Use the -i option to retrieve version information from the driver.
  239. # ethtool -i eth0
  240. driver: libertas
  241. version: COMM-USB8388-318.p4
  242. firmware-version: 5.110.7
  243. bus-info:
  244. Use the -e option to read the EEPROM contents of the card.
  245. Usage:
  246. ethtool -e ethX [raw on|off] [offset N] [length N]
  247. -e retrieves and prints an EEPROM dump for the specified ethernet
  248. device. When raw is enabled, then it dumps the raw EEPROM data
  249. to stdout. The length and offset parameters allow dumping cer-
  250. tain portions of the EEPROM. Default is to dump the entire EEP-
  251. ROM.
  252. # ethtool -e eth0 offset 0 length 16
  253. Offset Values
  254. ------ ------
  255. 0x0000 38 33 30 58 00 00 34 f4 00 00 10 00 00 c4 17 00
  256. ========================
  257. DEBUGFS COMMANDS
  258. ========================
  259. those commands are used via debugfs interface
  260. ===========
  261. rdmac
  262. rdbbp
  263. rdrf
  264. These commands are used to read the MAC, BBP and RF registers from the
  265. card. These commands take one parameter that specifies the offset
  266. location that is to be read. This parameter must be specified in
  267. hexadecimal (its possible to preceed preceding the number with a "0x").
  268. Path: /debugfs/libertas_wireless/ethX/registers/
  269. Usage:
  270. echo "0xa123" > rdmac ; cat rdmac
  271. echo "0xa123" > rdbbp ; cat rdbbp
  272. echo "0xa123" > rdrf ; cat rdrf
  273. wrmac
  274. wrbbp
  275. wrrf
  276. These commands are used to write the MAC, BBP and RF registers in the
  277. card. These commands take two parameters that specify the offset
  278. location and the value that is to be written. This parameters must
  279. be specified in hexadecimal (its possible to preceed the number
  280. with a "0x").
  281. Usage:
  282. echo "0xa123 0xaa" > wrmac
  283. echo "0xa123 0xaa" > wrbbp
  284. echo "0xa123 0xaa" > wrrf
  285. sleepparams
  286. This command is used to set the sleepclock configurations
  287. Path: /debugfs/libertas_wireless/ethX/
  288. Usage:
  289. cat sleepparams: reads the current sleepclock configuration
  290. echo "p1 p2 p3 p4 p5 p6" > sleepparams: writes the sleepclock configuration.
  291. where:
  292. p1 is Sleep clock error in ppm (0-65535)
  293. p2 is Wakeup offset in usec (0-65535)
  294. p3 is Clock stabilization time in usec (0-65535)
  295. p4 is Control periodic calibration (0-2)
  296. p5 is Control the use of external sleep clock (0-2)
  297. p6 is reserved for debug (0-65535)
  298. subscribed_events
  299. The subscribed_events directory contains the interface for the
  300. subscribed events API.
  301. Path: /debugfs/libertas_wireless/ethX/subscribed_events/
  302. Each event is represented by a filename. Each filename consists of the
  303. following three fields:
  304. Value Frequency Subscribed
  305. To read the current values for a given event, do:
  306. cat event
  307. To set the current values, do:
  308. echo "60 2 1" > event
  309. Frequency field specifies the reporting frequency for this event.
  310. If it is set to 0, then the event is reported only once, and then
  311. automatically unsubscribed. If it is set to 1, then the event is
  312. reported every time it occurs. If it is set to N, then the event is
  313. reported every Nth time it occurs.
  314. beacon_missed
  315. Value field specifies the number of consecutive missing beacons which
  316. triggers the LINK_LOSS event. This event is generated only once after
  317. which the firmware resets its state. At initialization, the LINK_LOSS
  318. event is subscribed by default. The default value of MissedBeacons is
  319. 60.
  320. failure_count
  321. Value field specifies the consecutive failure count threshold which
  322. triggers the generation of the MAX_FAIL event. Once this event is
  323. generated, the consecutive failure count is reset to 0.
  324. At initialization, the MAX_FAIL event is NOT subscribed by
  325. default.
  326. high_rssi
  327. This event is generated when the average received RSSI in beacons goes
  328. above a threshold, specified by Value.
  329. low_rssi
  330. This event is generated when the average received RSSI in beacons goes
  331. below a threshold, specified by Value.
  332. high_snr
  333. This event is generated when the average received SNR in beacons goes
  334. above a threshold, specified by Value.
  335. low_snr
  336. This event is generated when the average received SNR in beacons goes
  337. below a threshold, specified by Value.
  338. extscan
  339. This command is used to do a specific scan.
  340. Path: /debugfs/libertas_wireless/ethX/
  341. Usage: echo "SSID" > extscan
  342. Example:
  343. echo "LINKSYS-AP" > extscan
  344. To see the results of use getscantable command.
  345. getscantable
  346. Display the current contents of the driver scan table (ie. get the
  347. scan results).
  348. Path: /debugfs/libertas_wireless/ethX/
  349. Usage:
  350. cat getscantable
  351. setuserscan
  352. Initiate a customized scan and retrieve the results
  353. Path: /debugfs/libertas_wireless/ethX/
  354. Usage:
  355. echo "[ARGS]" > setuserscan
  356. where [ARGS]:
  357. chan=[chan#][band][mode] where band is [a,b,g] and mode is
  358. blank for active or 'p' for passive
  359. bssid=xx:xx:xx:xx:xx:xx specify a BSSID filter for the scan
  360. ssid="[SSID]" specify a SSID filter for the scan
  361. keep=[0 or 1] keep the previous scan results (1), discard (0)
  362. dur=[scan time] time to scan for each channel in milliseconds
  363. probes=[#] number of probe requests to send on each chan
  364. type=[1,2,3] BSS type: 1 (Infra), 2(Adhoc), 3(Any)
  365. Any combination of the above arguments can be supplied on the command line.
  366. If the chan token is absent, a full channel scan will be completed by
  367. the driver. If the dur or probes tokens are absent, the driver default
  368. setting will be used. The bssid and ssid fields, if blank,
  369. will produce an unfiltered scan. The type field will default to 3 (Any)
  370. and the keep field will default to 0 (Discard).
  371. Examples:
  372. 1) Perform an active scan on channels 1, 6, and 11 in the 'g' band:
  373. echo "chan=1g,6g,11g" > setuserscan
  374. 2) Perform a passive scan on channel 11 for 20 ms:
  375. echo "chan=11gp dur=20" > setuserscan
  376. 3) Perform an active scan on channels 1, 6, and 11; and a passive scan on
  377. channel 36 in the 'a' band:
  378. echo "chan=1g,6g,11g,36ap" > setuserscan
  379. 4) Perform an active scan on channel 6 and 36 for a specific SSID:
  380. echo "chan=6g,36a ssid="TestAP"" > setuserscan
  381. 5) Scan all available channels (B/G, A bands) for a specific BSSID, keep
  382. the current scan table intact, update existing or append new scan data:
  383. echo "bssid=00:50:43:20:12:82 keep=1" > setuserscan
  384. 6) Scan channel 6, for all infrastructure networks, sending two probe
  385. requests. Keep the previous scan table intact. Update any duplicate
  386. BSSID/SSID matches with the new scan data:
  387. echo "chan=6g type=1 probes=2 keep=1" > setuserscan
  388. All entries in the scan table (not just the new scan data when keep=1)
  389. will be displayed upon completion by use of the getscantable ioctl.
  390. ==============================================================================