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