README 18 KB

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