1 ================================================================================
4 (c) Copyright © 2003-2006, Marvell International Ltd.
7 This software file (the "File") is distributed by Marvell International
8 Ltd. under the terms of the GNU General Public License Version 2, June 1991
9 (the "License"). You may use, redistribute and/or modify this File in
10 accordance with the terms and conditions of the License, a copy of which
11 is available along with the File in the license.txt file or by writing to
12 the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
13 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
15 THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
16 IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
17 ARE EXPRESSLY DISCLAIMED. The License provides additional details about
18 this warranty disclaimer.
19 ================================================================================
25 o. Copy the firmware image (e.g. usb8388.bin) to /lib/firmware/
27 o. Load driver by using the following command:
29 insmod usb8388.ko [fw_name=usb8388.bin]
36 This manual describes the usage of private commands used in Marvell WLAN
37 Linux Driver. All the commands available in Wlanconfig will not be available
41 iwpriv <ethX> <command> [sub-command] ...
43 iwpriv ethX setregioncode <n>
44 iwpriv ethX getregioncode
47 iwpriv ethX ledgpio <n>
50 The blinding table (BT) contains a list of mac addresses that will be,
51 by default, ignored by the firmware. It is also possible to invert this
52 behavior so that we will ignore all traffic except for the portion
53 coming from mac addresess in the list. It is primarily used for
54 debugging and testing networks. It can be edited and inspected with
55 the following commands:
58 iwpriv ethX bt_add <mac_address>
59 iwpriv ethX bt_del <mac_address>
60 iwpriv ethX bt_list <id>
61 iwpriv ethX bt_get_invert <n>
62 iwpriv ethX bt_set_invert <n>
65 The forwarding table (FWT) is a feature used to manage mesh network
66 routing in the firmware. The FWT is essentially a routing table that
67 associates a destination mac address (da) with a next hop receiver
68 address (ra). The FWT can be inspected and edited with the following
69 iwpriv commands, which are described in greater detail below.
70 Eventually, the table will be automatically maintained by a custom
73 NOTE: FWT commands replace the previous DFT commands. What were the DFT
74 commands?, you might ask. They were an earlier API to the firmware that
75 implemented a simple MAC-layer forwarding mechanism. In the unlikely
76 event that you were using these commands, you must migrate to the new
77 FWT commands which can be used to achieve the same functionality.
79 iwpriv ethX fwt_add [parameters]
80 iwpriv ethX fwt_del [parameters]
81 iwpriv ethX fwt_lookup [parameters]
82 iwpriv ethX fwt_list [parameters]
83 iwpriv ethX fwt_list_route [parameters]
84 iwpriv ethX fwt_list_neigh [parameters]
85 iwpriv ethX fwt_reset [parameters]
86 iwpriv ethX fwt_cleanup
91 The MESH commands are used to configure various features of the mesh
92 routing protocol. The following commands are supported:
94 iwpriv ethX mesh_get_ttl
95 iwpriv ethX mesh_set_ttl ttl
96 iwpriv ethX mesh_get_bcastr rate
97 iwpriv ethX mesh_set_bcastr rate
98 iwpriv ethX get_rreq_delay
99 iwpriv ethX set_rreq_delay delay
100 iwpriv ethX get_route_exp
101 iwpriv ethX set_route_exp time
102 iwpriv ethX get_link_costs
103 iwpriv ethX set_link_costs "cost54 cost36 cost11 cost1"
106 Those commands are used to send additional commands to the Marvell WLAN
107 card via the Linux device driver.
109 The ethX parameter specifies the network device that is to be used to
110 perform this command on. it could be eth0, eth1 etc.
113 This command is used to set the region code in the station.
114 where value is 'region code' for various regions like
115 USA FCC, Canada IC, Spain, France, Europe ETSI, Japan ...
118 iwpriv ethX setregioncode 0x10: set region code to USA (0x10).
121 This command is used to get the region code information set in the
125 This command is used to set/get LEDs.
127 iwpriv ethX ledgpio <LEDs>
128 will set the corresponding LED for the GPIO Line.
131 will give u which LEDs are Enabled.
134 iwpriv eth1 ledgpio 1 0 2 1 3 4
141 shows LED information in the format as mentioned above.
143 Note: LED0 is invalid
144 Note: Maximum Number of LEDs are 16.
147 This command is used to enable disable beacons. This can also be used
148 to set beacon interval.
151 iwpriv ethX bcn_control [enable] [beacon_interval]
153 enable: 0 to disable beacon. 1 to enable beacon.
154 beacon_interval: 20 - 1000ms.
157 1. iwpriv ethX bcn_control
158 Returns (x, y), where x if 1, indicates beacon is enabled, y
160 2. iwpriv ethX bcn_control 0
161 Turns off beacon transmission.
162 3. iwpriv ethX bcn_control 1 500
163 Enable beacon with beacon interval 500ms.
167 Command iwpriv mshX ledbhv can be used to change default LEDs behaviors.
168 A given LED behavior can be on, off or blinking. The duty/cycle can be set
169 when behavior is programmed as blinking.
173 1. To get default LED behavior
174 iwpriv mshX ledbhv <firmware state>
176 2. To set or change default LED behavior
177 iwpriv mshX ledbhv <firmware state> <lednum> <behavior> <arg>
179 firmware state: The following are some of the relevant states.
181 01: firmware is scanning
182 02: firmware is connected and awake
183 03: firmware is sleeping
184 04: connected deep sleep
185 06: firmware disconnected link lost
186 07: firmware disconnected disassociated
187 09: data transfer while firmware is associated and not scanning.
188 If firmware is already in this state, LED behavior does not change
189 on this data transfer.
190 10: firmware idle, not scanning, not disconnected or disassociated.
192 lednum: 1 or 2 for first and second LED.
194 behavior: 0 for steady ON, 1 - steady off and 2- blinking.
196 arg: It is used when behavior is 2 to set duty and cycle. It is defined as
197 (duty << 4 | cycle). Here duty could be 0..4 and cycle 0..5 for 34,
198 74, 149, 298, 596, 1192 ms respectively.
202 1. To get default behavior for scan
205 2. To get default behavior while data transfer
209 iwpriv mshX ledbhv 2 2 1 0
210 iwpriv mshX ledbhv 10 2 1 0
212 4. To enable LED 2 and blink LED 1 while data transfer.
213 iwpriv mshX ledbhv 9 2 0 0
214 iwpriv mshX ledbhv 9 1 2 4
216 5. To change duty cycle of LED 2 during data transfer
217 iwpriv mshX ledbhv 9 2 2 36
219 6. To turn ON LED 2 when firmware is disassociated/disconnected.
220 iwpriv mshX ledbhv 0 2 0 0
224 This command is used to insert an entry into the FWT table. The list of
225 parameters must follow the following structure:
227 iwpriv ethX fwt_add da ra [metric dir rate ssn dsn hopcount ttl expiration sleepmode snr]
229 The parameters between brackets are optional, but they must appear in
230 the order specified. For example, if you want to specify the metric,
231 you must also specify the dir, ssn, and dsn but you need not specify the
232 hopcount, expiration, sleepmode, or snr. Any unspecified parameters
233 will be assigned the defaults specified below.
235 The different parameters are:-
236 da -- DA MAC address in the form 00:11:22:33:44:55
237 ra -- RA MAC address in the form 00:11:22:33:44:55
238 metric -- route metric (cost: smaller-metric routes are
239 preferred, default is 0)
240 dir -- direction (1 for direct, 0 for reverse,
242 rate -- data rate used for transmission to the RA,
243 as specified for the rateadapt command,
244 default is 3 (11Mbps)
245 ssn -- Source Sequence Number (time at the RA for
246 reverse routes. Default is 0)
247 dsn -- Destination Sequence Number (time at the DA
248 for direct routes. Default is 0)
249 hopcount -- hop count (currently unused, default is 0)
250 ttl -- TTL (Only used in reverse entries)
251 expiration -- entry expiration (in ticks, where a tick is
252 1024us, or ~ 1ms. Use 0 for an indefinite
254 sleepmode -- RA's sleep mode (currently unused, default is
256 snr -- SNR in the link to RA (currently unused,
259 The command does not return anything.
262 This command is used to remove an entry to the FWT table. The list of
263 parameters must follow the following structure:
265 iwpriv ethX fwt_del da ra [dir]
267 where the different parameters are:-
268 da -- DA MAC address (in the form "00:11:22:33:44:55")
269 ra -- RA MAC address (in the form "00:11:22:33:44:55")
270 dir -- direction (1 for direct, 0 for reverse,
273 The command does not return anything.
276 This command is used to get the best route in the FWT table to a given
277 host. The only parameter is the MAC address of the host that is being
280 iwpriv ethX fwt_lookup da
283 da -- DA MAC address (in the form "00:11:22:33:44:55")
285 The command returns an output string identical to the one returned by
286 fwt_list described below.
290 This command is used to list a route from the FWT table. The only
291 parameter is the index into the table. If you want to list all the
292 routes in a table, start with index=0, and keep listing until you get a
293 "(null)" string. Note that the indicies may change as the fwt is
294 updated. It is expected that most users will not use fwt_list directly,
295 but that a utility similar to the traditional route command will be used
296 to invoke fwt_list over and over.
298 iwpriv ethX fwt_list index
300 The output is a string of the following form:
302 da ra valid metric dir rate ssn dsn hopcount ttl expiration
303 sleepmode snr precursor
305 where the different fields are:-
306 da -- DA MAC address (in the form "00:11:22:33:44:55")
307 ra -- RA MAC address (in the form "00:11:22:33:44:55")
308 valid -- whether the route is valid (0 if not valid)
309 metric -- route metric (cost: smaller-metric routes are preferred)
310 dir -- direction (1 for direct, 0 for reverse)
311 rate -- data rate used for transmission to the RA,
312 as specified for the rateadapt command
313 ssn -- Source Sequence Number (time at the RA for reverse routes)
314 dsn -- Destination Sequence Number (time at the DA for direct routes)
315 hopcount -- hop count (currently unused)
316 ttl -- TTL (only used in reverse entries)
317 expiration -- entry expiration (in ticks, where a tick is 1024us, or ~ 1ms. Use 0 for an indefinite entry)
318 sleepmode -- RA's sleep mode (currently unused)
319 snr -- SNR in the link to RA (currently unused)
320 precursor -- predecessor in direct routes
323 This command is equivalent to fwt_list.
326 This command is used to list a neighbor from the FWT table. The only
327 parameter is the neighbor ID. If you want to list all the neighbors in a
328 table, start with nid=0, and keep incrementing nid until you get a
329 "(null)" string. Note that the nid from a fwt_list_route command can be
330 used as an input to this command. Also note that this command is meant
331 mostly for debugging. It is expected that users will use fwt_lookup.
332 One important reason for this is that the neighbor id may change as the
333 neighbor table is altered.
335 iwpriv ethX fwt_list_neigh nid
337 The output is a string of the following form:
339 ra sleepmode snr references
341 where the different fields are:-
342 ra -- RA MAC address (in the form "00:11:22:33:44:55")
343 sleepmode -- RA's sleep mode (currently unused)
344 snr -- SNR in the link to RA (currently unused)
345 references -- RA's reference counter
348 This command is used to reset the FWT table, getting rid of all the
349 entries. There are no input parameters.
351 iwpriv ethX fwt_reset
353 The command does not return anything.
356 This command is used to perform user-based garbage recollection. The
357 FWT table is checked, and all the entries that are expired or invalid
358 are cleaned. Note that this is exported to the driver for debugging
359 purposes, as garbage collection is also fired by the firmware when in
360 space problems. There are no input parameters.
362 iwpriv ethX fwt_cleanup
364 The command does returns the number of invalid/expired routes deleted.
367 This command returns a card's internal time representation. It is this
368 time that is used to represent the expiration times of FWT entries. The
369 number is not consistent from card to card; it is simply a timer count.
370 The fwt_time command is used to inspect the timer so that expiration
371 times reported by fwt_list can be properly interpreted.
377 The mesh ttl is the number of hops a mesh packet can traverse before it
378 is dropped. This parameter is used to prevent infinite loops in the
379 mesh network. The value returned by this function is the ttl assigned
380 to all mesh packets. Currently there is no way to control the ttl on a
381 per packet or per socket basis.
383 iwpriv ethX mesh_get_ttl
387 Set the ttl. The argument must be between 0 and 255.
389 iwpriv ethX mesh_set_ttl <ttl>
393 Shows the rate index used for mesh broadcast and multicast packets.
394 Rates are expressed in 2 * Mb/s, ie 11Mb/s is 22, 5.5Mb/s is 11, etc.
396 iwpriv ethX mesh_get_bcastr rate
400 Sets the rate index for mesh broadcast and muticast packets. Rates are
401 expressed in expressed in 2 * Mb/s, ie 11Mb/s is 22, 5.5Mb/s is 11, etc.
403 iwpriv ethX mesh_set_bcastr rate
407 Shows the delay to forward a RREQ frame. This delay allows the node to
408 forward just the best route in case the same RREQ arrives to the node
409 through different routes. The argument is shown in 1/100 seconds.
411 iwpriv ethX get_rreq_delay
415 Sets the RREQ forward delay. The delay is interpreted as 1/100 seconds.
417 iwpriv ethX set_rreq_delay delay
421 Shows the mesh route expiration time, in seconds.
423 iwpriv ethX get_route_exp
427 Gets the mesh route, expiration time, in seconds.
429 iwpriv ethX set_route_exp time
433 Gets the mesh hop base cost for each used rate. The output gives us the
434 base cost for hops at 54Mbps, 36Mbps, 11Mbps and 1Mbps, in that order.
435 The base cost gets divided by a battery state factor to get the actual
436 cost. A cost of 0 means that rate is deactivated.
438 iwpriv ethX get_link_costs
440 set_link_costs "cost54 cost36 cost11 cost1"
442 Sets the mesh hop base cost for the used speeds. The input parameter
443 will specify the cost for hops at 54Mbps, 36Mbps, 11Mbps and 1Mbps, in
444 that order. A cost of 0 will disable a specific rate.
446 iwpriv ethX set_link_costs "cost54 cost36 cost11 cost1"
448 =========================
450 =========================
453 Use the -i option to retrieve version information from the driver.
457 version: COMM-USB8388-318.p4
458 firmware-version: 5.110.7
461 Use the -e option to read the EEPROM contents of the card.
464 ethtool -e ethX [raw on|off] [offset N] [length N]
466 -e retrieves and prints an EEPROM dump for the specified ethernet
467 device. When raw is enabled, then it dumps the raw EEPROM data
468 to stdout. The length and offset parameters allow dumping cer-
469 tain portions of the EEPROM. Default is to dump the entire EEP-
472 # ethtool -e eth0 offset 0 length 16
475 0x0000 38 33 30 58 00 00 34 f4 00 00 10 00 00 c4 17 00
477 ========================
479 ========================
481 those commands are used via debugfs interface
487 These commands are used to read the MAC, BBP and RF registers from the
488 card. These commands take one parameter that specifies the offset
489 location that is to be read. This parameter must be specified in
490 hexadecimal (its possible to preceed preceding the number with a "0x").
492 Path: /debugfs/libertas_wireless/ethX/registers/
495 echo "0xa123" > rdmac ; cat rdmac
496 echo "0xa123" > rdbbp ; cat rdbbp
497 echo "0xa123" > rdrf ; cat rdrf
501 These commands are used to write the MAC, BBP and RF registers in the
502 card. These commands take two parameters that specify the offset
503 location and the value that is to be written. This parameters must
504 be specified in hexadecimal (its possible to preceed the number
508 echo "0xa123 0xaa" > wrmac
509 echo "0xa123 0xaa" > wrbbp
510 echo "0xa123 0xaa" > wrrf
513 This command is used to set the sleepclock configurations
515 Path: /debugfs/libertas_wireless/ethX/
518 cat sleepparams: reads the current sleepclock configuration
520 echo "p1 p2 p3 p4 p5 p6" > sleepparams: writes the sleepclock configuration.
523 p1 is Sleep clock error in ppm (0-65535)
524 p2 is Wakeup offset in usec (0-65535)
525 p3 is Clock stabilization time in usec (0-65535)
526 p4 is Control periodic calibration (0-2)
527 p5 is Control the use of external sleep clock (0-2)
528 p6 is reserved for debug (0-65535)
532 The subscribed_events directory contains the interface for the
533 subscribed events API.
535 Path: /debugfs/libertas_wireless/ethX/subscribed_events/
537 Each event is represented by a filename. Each filename consists of the
538 following three fields:
539 Value Frequency Subscribed
541 To read the current values for a given event, do:
543 To set the current values, do:
544 echo "60 2 1" > event
546 Frequency field specifies the reporting frequency for this event.
547 If it is set to 0, then the event is reported only once, and then
548 automatically unsubscribed. If it is set to 1, then the event is
549 reported every time it occurs. If it is set to N, then the event is
550 reported every Nth time it occurs.
553 Value field specifies the number of consecutive missing beacons which
554 triggers the LINK_LOSS event. This event is generated only once after
555 which the firmware resets its state. At initialization, the LINK_LOSS
556 event is subscribed by default. The default value of MissedBeacons is
560 Value field specifies the consecutive failure count threshold which
561 triggers the generation of the MAX_FAIL event. Once this event is
562 generated, the consecutive failure count is reset to 0.
563 At initialization, the MAX_FAIL event is NOT subscribed by
567 This event is generated when the average received RSSI in beacons goes
568 above a threshold, specified by Value.
571 This event is generated when the average received RSSI in beacons goes
572 below a threshold, specified by Value.
575 This event is generated when the average received SNR in beacons goes
576 above a threshold, specified by Value.
579 This event is generated when the average received SNR in beacons goes
580 below a threshold, specified by Value.
583 This command is used to do a specific scan.
585 Path: /debugfs/libertas_wireless/ethX/
587 Usage: echo "SSID" > extscan
590 echo "LINKSYS-AP" > extscan
592 To see the results of use getscantable command.
596 Display the current contents of the driver scan table (ie. get the
599 Path: /debugfs/libertas_wireless/ethX/
605 Initiate a customized scan and retrieve the results
608 Path: /debugfs/libertas_wireless/ethX/
611 echo "[ARGS]" > setuserscan
615 bssid=xx:xx:xx:xx:xx:xx specify a BSSID filter for the scan
616 ssid="[SSID]" specify a SSID filter for the scan
617 keep=[0 or 1] keep the previous scan results (1), discard (0)
618 dur=[scan time] time to scan for each channel in milliseconds
619 type=[1,2,3] BSS type: 1 (Infra), 2(Adhoc), 3(Any)
621 Any combination of the above arguments can be supplied on the command
622 line. If dur tokens are absent, the driver default setting will be used.
623 The bssid and ssid fields, if blank, will produce an unfiltered scan.
624 The type field will default to 3 (Any) and the keep field will default
628 1) Perform a passive scan on all channels for 20 ms per channel:
629 echo "dur=20" > setuserscan
631 2) Perform an active scan for a specific SSID:
632 echo "ssid="TestAP"" > setuserscan
634 3) Scan all available channels (B/G, A bands) for a specific BSSID, keep
635 the current scan table intact, update existing or append new scan data:
636 echo "bssid=00:50:43:20:12:82 keep=1" > setuserscan
638 4) Scan for all infrastructure networks.
639 Keep the previous scan table intact. Update any duplicate BSSID/SSID
640 matches with the new scan data:
641 echo "type=1 keep=1" > setuserscan
643 All entries in the scan table (not just the new scan data when keep=1)
644 will be displayed upon completion by use of the getscantable ioctl.
646 ==============================================================================