xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/marvell/mwifiex/README (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# Copyright (C) 2011-2014, Marvell International Ltd.
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# This software file (the "File") is distributed by Marvell International
4*4882a593Smuzhiyun# Ltd. under the terms of the GNU General Public License Version 2, June 1991
5*4882a593Smuzhiyun# (the "License").  You may use, redistribute and/or modify this File in
6*4882a593Smuzhiyun# accordance with the terms and conditions of the License, a copy of which
7*4882a593Smuzhiyun# is available by writing to the Free Software Foundation, Inc.,
8*4882a593Smuzhiyun# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
9*4882a593Smuzhiyun# worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10*4882a593Smuzhiyun#
11*4882a593Smuzhiyun# THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
12*4882a593Smuzhiyun# IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
13*4882a593Smuzhiyun# ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
14*4882a593Smuzhiyun# this warranty disclaimer.
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun===============================================================================
18*4882a593Smuzhiyun			U S E R  M A N U A L
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun1) FOR DRIVER INSTALL
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun	a) Copy sd8787.bin to /lib/firmware/mrvl/ directory,
23*4882a593Smuzhiyun	   create the directory if it doesn't exist.
24*4882a593Smuzhiyun	b) Install WLAN driver,
25*4882a593Smuzhiyun		insmod mwifiex.ko
26*4882a593Smuzhiyun	c) Uninstall WLAN driver,
27*4882a593Smuzhiyun		ifconfig mlanX down
28*4882a593Smuzhiyun		rmmod mwifiex
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun2) FOR DRIVER CONFIGURATION AND INFO
32*4882a593Smuzhiyun	The configurations can be done either using the 'iw' user space
33*4882a593Smuzhiyun	utility or debugfs.
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun	a) 'iw' utility commands
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun	Following are some useful iw commands:-
38*4882a593Smuzhiyun
39*4882a593Smuzhiyuniw dev mlan0 scan
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun	This command will trigger a scan.
42*4882a593Smuzhiyun	The command will then display the scan table entries
43*4882a593Smuzhiyun
44*4882a593Smuzhiyuniw dev mlan0 connect -w <SSID> [<freq in MHz>] [<bssid>] [key 0:abcde d:1123456789a]
45*4882a593Smuzhiyun	The above command can be used to connect to an AP with a particular SSID.
46*4882a593Smuzhiyun	Ap's operating frequency can be specified or even the bssid. If the AP is using
47*4882a593Smuzhiyun	WEP encryption, wep keys can be specified in the command.
48*4882a593Smuzhiyun	Note: Every time before connecting to an AP scan command (iw dev mlan0 scan) should be used by user.
49*4882a593Smuzhiyun
50*4882a593Smuzhiyuniw dev mlan0 disconnect
51*4882a593Smuzhiyun	This command will be used to disconnect from an AP.
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun
54*4882a593Smuzhiyuniw dev mlan0 ibss join <SSID> <freq in MHz> [fixed-freq] [fixed-bssid] [key 0:abcde]
55*4882a593Smuzhiyun	The command will be used to join or create an ibss. Optionally, operating frequency,
56*4882a593Smuzhiyun	bssid and the security related parameters can be specified while joining/creating
57*4882a593Smuzhiyun	and ibss.
58*4882a593Smuzhiyun
59*4882a593Smuzhiyuniw dev mlan0 ibss leave
60*4882a593Smuzhiyun	The command will be used to leave an ibss network.
61*4882a593Smuzhiyun
62*4882a593Smuzhiyuniw dev mlan0 link
63*4882a593Smuzhiyun	The command will be used to get the connection status. The command will return parameters
64*4882a593Smuzhiyun	such as SSID, operating frequency, rx/tx packets, signal strength, tx bitrate.
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun	Apart from the iw utility all standard configurations using the 'iwconfig' utility are also supported.
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun	b) Debugfs interface
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun	The debugfs interface can be used for configurations and for getting
71*4882a593Smuzhiyun	some useful information from the driver.
72*4882a593Smuzhiyun	The section below explains the configurations that can be
73*4882a593Smuzhiyun	done.
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun	Mount debugfs to /debugfs mount point:
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun		mkdir /debugfs
78*4882a593Smuzhiyun		mount -t debugfs debugfs /debugfs
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun	The information is provided in /debugfs/mwifiex/mlanX/:
81*4882a593Smuzhiyun
82*4882a593Smuzhiyuniw reg set <country code>
83*4882a593Smuzhiyun	The command will be used to change the regulatory domain.
84*4882a593Smuzhiyun
85*4882a593Smuzhiyuniw reg get
86*4882a593Smuzhiyun	The command will be used to get current regulatory domain.
87*4882a593Smuzhiyun
88*4882a593Smuzhiyuninfo
89*4882a593Smuzhiyun	This command is used to get driver info.
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun	Usage:
92*4882a593Smuzhiyun		cat info
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun	driver_name = "mwifiex"
95*4882a593Smuzhiyun	driver_version = <driver_name, driver_version, (firmware_version)>
96*4882a593Smuzhiyun	interface_name = "mlanX"
97*4882a593Smuzhiyun	bss_mode = "Ad-hoc" | "Managed" | "Auto" | "Unknown"
98*4882a593Smuzhiyun	media_state = "Disconnected" | "Connected"
99*4882a593Smuzhiyun	mac_address = <6-byte adapter MAC address>
100*4882a593Smuzhiyun	multicase_count = <multicast address count>
101*4882a593Smuzhiyun	essid = <current SSID>
102*4882a593Smuzhiyun	bssid = <current BSSID>
103*4882a593Smuzhiyun	channel = <current channel>
104*4882a593Smuzhiyun	region_code = <current region code>
105*4882a593Smuzhiyun	multicasr_address[n] = <multicast address>
106*4882a593Smuzhiyun	num_tx_bytes = <number of bytes sent to device>
107*4882a593Smuzhiyun	num_rx_bytes = <number of bytes received from device and sent to kernel>
108*4882a593Smuzhiyun	num_tx_pkts = <number of packets sent to device>
109*4882a593Smuzhiyun	num_rx_pkts = <number of packets received from device and sent to kernel>
110*4882a593Smuzhiyun	num_tx_pkts_dropped = <number of Tx packets dropped by driver>
111*4882a593Smuzhiyun	num_rx_pkts_dropped = <number of Rx packets dropped by driver>
112*4882a593Smuzhiyun	num_tx_pkts_err = <number of Tx packets failed to send to device>
113*4882a593Smuzhiyun	num_rx_pkts_err = <number of Rx packets failed to receive from device>
114*4882a593Smuzhiyun	carrier "on" | "off"
115*4882a593Smuzhiyun	tx queue "stopped" | "started"
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun	The following debug info are provided in /debugfs/mwifiex/mlanX/debug:
118*4882a593Smuzhiyun
119*4882a593Smuzhiyun	int_counter = <interrupt count, cleared when interrupt handled>
120*4882a593Smuzhiyun	wmm_ac_vo = <number of packets sent to device from WMM AcVo queue>
121*4882a593Smuzhiyun	wmm_ac_vi = <number of packets sent to device from WMM AcVi queue>
122*4882a593Smuzhiyun	wmm_ac_be = <number of packets sent to device from WMM AcBE queue>
123*4882a593Smuzhiyun	wmm_ac_bk = <number of packets sent to device from WMM AcBK queue>
124*4882a593Smuzhiyun	tx_buf_size = <current Tx buffer size>
125*4882a593Smuzhiyun	curr_tx_buf_size = <current Tx buffer size>
126*4882a593Smuzhiyun	ps_mode = <0/1, CAM mode/PS mode>
127*4882a593Smuzhiyun	ps_state = <0/1/2/3, full power state/awake state/pre-sleep state/sleep state>
128*4882a593Smuzhiyun	is_deep_sleep = <0/1, not deep sleep state/deep sleep state>
129*4882a593Smuzhiyun	wakeup_dev_req = <0/1, wakeup device not required/required>
130*4882a593Smuzhiyun	wakeup_tries = <wakeup device count, cleared when device awake>
131*4882a593Smuzhiyun	hs_configured = <0/1, host sleep not configured/configured>
132*4882a593Smuzhiyun	hs_activated = <0/1, extended host sleep not activated/activated>
133*4882a593Smuzhiyun	num_tx_timeout = <number of Tx timeout>
134*4882a593Smuzhiyun	is_cmd_timedout = <0/1 command timeout not occurred/occurred>
135*4882a593Smuzhiyun	timeout_cmd_id = <command id of the last timeout command>
136*4882a593Smuzhiyun	timeout_cmd_act = <command action of the last timeout command>
137*4882a593Smuzhiyun	last_cmd_id = <command id of the last several commands sent to device>
138*4882a593Smuzhiyun	last_cmd_act = <command action of the last several commands sent to device>
139*4882a593Smuzhiyun	last_cmd_index = <0 based last command index>
140*4882a593Smuzhiyun	last_cmd_resp_id = <command id of the last several command responses received from device>
141*4882a593Smuzhiyun	last_cmd_resp_index = <0 based last command response index>
142*4882a593Smuzhiyun	last_event = <event id of the last several events received from device>
143*4882a593Smuzhiyun	last_event_index = <0 based last event index>
144*4882a593Smuzhiyun	num_cmd_h2c_fail = <number of commands failed to send to device>
145*4882a593Smuzhiyun	num_cmd_sleep_cfm_fail = <number of sleep confirm failed to send to device>
146*4882a593Smuzhiyun	num_tx_h2c_fail = <number of data packets failed to send to device>
147*4882a593Smuzhiyun	num_evt_deauth = <number of deauthenticated events received from device>
148*4882a593Smuzhiyun	num_evt_disassoc = <number of disassociated events received from device>
149*4882a593Smuzhiyun	num_evt_link_lost = <number of link lost events received from device>
150*4882a593Smuzhiyun	num_cmd_deauth = <number of deauthenticate commands sent to device>
151*4882a593Smuzhiyun	num_cmd_assoc_ok = <number of associate commands with success return>
152*4882a593Smuzhiyun	num_cmd_assoc_fail = <number of associate commands with failure return>
153*4882a593Smuzhiyun	cmd_sent = <0/1, send command resources available/sending command to device>
154*4882a593Smuzhiyun	data_sent = <0/1, send data resources available/sending data to device>
155*4882a593Smuzhiyun	mp_rd_bitmap = <SDIO multi-port read bitmap>
156*4882a593Smuzhiyun	mp_wr_bitmap = <SDIO multi-port write bitmap>
157*4882a593Smuzhiyun	cmd_resp_received = <0/1, no cmd response to process/response received and yet to process>
158*4882a593Smuzhiyun	event_received = <0/1, no event to process/event received and yet to process>
159*4882a593Smuzhiyun	cmd_pending = <number of cmd pending>
160*4882a593Smuzhiyun	tx_pending = <number of Tx packet pending>
161*4882a593Smuzhiyun	rx_pending = <number of Rx packet pending>
162*4882a593Smuzhiyun
163*4882a593Smuzhiyun
164*4882a593Smuzhiyun3) FOR DRIVER CONFIGURATION
165*4882a593Smuzhiyun
166*4882a593Smuzhiyunregrdwr
167*4882a593Smuzhiyun	This command is used to read/write the adapter register.
168*4882a593Smuzhiyun
169*4882a593Smuzhiyun	Usage:
170*4882a593Smuzhiyun		echo " <type> <offset> [value]" > regrdwr
171*4882a593Smuzhiyun		cat regrdwr
172*4882a593Smuzhiyun
173*4882a593Smuzhiyun	where the parameters are,
174*4882a593Smuzhiyun		<type>:     1:MAC/SOC, 2:BBP, 3:RF, 4:PMIC, 5:CAU
175*4882a593Smuzhiyun		<offset>:   offset of register
176*4882a593Smuzhiyun		[value]:    value to be written
177*4882a593Smuzhiyun
178*4882a593Smuzhiyun	Examples:
179*4882a593Smuzhiyun		echo "1 0xa060" > regrdwr           : Read the MAC register
180*4882a593Smuzhiyun		echo "1 0xa060 0x12" > regrdwr      : Write the MAC register
181*4882a593Smuzhiyun		echo "1 0xa794 0x80000000" > regrdwr
182*4882a593Smuzhiyun		                                    : Write 0x80000000 to MAC register
183*4882a593Smuzhiyun
184*4882a593Smuzhiyunmemrw
185*4882a593Smuzhiyun	This command is used to read/write the firmware memory.
186*4882a593Smuzhiyun
187*4882a593Smuzhiyun	Usage:
188*4882a593Smuzhiyun		1) For reading firmware memory location.
189*4882a593Smuzhiyun			echo r <address> 0 > /sys/kernel/debug/mwifiex/mlan0/memrw
190*4882a593Smuzhiyun			cat /sys/kernel/debug/mwifiex/mlan0/memrw
191*4882a593Smuzhiyun		2) For writing value to firmware memory location.
192*4882a593Smuzhiyun			echo w <address> [value] > /sys/kernel/debug/mwifiex/mlan0/memrw
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun	where the parameters are,
195*4882a593Smuzhiyun		<address>:  memory address
196*4882a593Smuzhiyun		[value]:    value to be written
197*4882a593Smuzhiyun
198*4882a593Smuzhiyun	Examples:
199*4882a593Smuzhiyun		echo r 0x4cf70 0 > /sys/kernel/debug/mwifiex/mlan0/memrw
200*4882a593Smuzhiyun		cat /sys/kernel/debug/mwifiex/mlan0/memrw
201*4882a593Smuzhiyun						: Read memory address 0x4cf70
202*4882a593Smuzhiyun		iwpriv mlan0 memrdwr -0x7fff6000 -0x40000000
203*4882a593Smuzhiyun		echo w 0x8000a000 0xc0000000 > /sys/kernel/debug/mwifiex/mlan0/memrw
204*4882a593Smuzhiyun						: Write 0xc0000000 to memory address 0x8000a000
205*4882a593Smuzhiyun
206*4882a593Smuzhiyunrdeeprom
207*4882a593Smuzhiyun	This command is used to read the EEPROM contents of the card.
208*4882a593Smuzhiyun
209*4882a593Smuzhiyun	Usage:
210*4882a593Smuzhiyun		echo "<offset> <length>" > rdeeprom
211*4882a593Smuzhiyun		cat rdeeprom
212*4882a593Smuzhiyun
213*4882a593Smuzhiyun	where the parameters are,
214*4882a593Smuzhiyun		<offset>:   multiples of 4
215*4882a593Smuzhiyun		<length>:   4-20, multiples of 4
216*4882a593Smuzhiyun
217*4882a593Smuzhiyun	Example:
218*4882a593Smuzhiyun		echo "0 20" > rdeeprom      : Read 20 bytes of EEPROM data from offset 0
219*4882a593Smuzhiyun
220*4882a593Smuzhiyunhscfg
221*4882a593Smuzhiyun	This command is used to debug/simulate host sleep feature using
222*4882a593Smuzhiyun	different configuration parameters.
223*4882a593Smuzhiyun
224*4882a593Smuzhiyun	Usage:
225*4882a593Smuzhiyun		echo "<condition> [GPIO# [gap]]]" > hscfg
226*4882a593Smuzhiyun		cat hscfg
227*4882a593Smuzhiyun
228*4882a593Smuzhiyun	where the parameters are,
229*4882a593Smuzhiyun		<condition>: bit 0 = 1   -- broadcast data
230*4882a593Smuzhiyun			     bit 1 = 1   -- unicast data
231*4882a593Smuzhiyun			     bit 2 = 1   -- mac event
232*4882a593Smuzhiyun			     bit 3 = 1   -- multicast data
233*4882a593Smuzhiyun		[GPIO#]: pin number of GPIO used to wakeup the host.
234*4882a593Smuzhiyun			 GPIO pin# (e.g. 0-7) or 0xff (interface, e.g. SDIO
235*4882a593Smuzhiyun			 will be used instead).
236*4882a593Smuzhiyun		[gap]:   the gap in milliseconds between wakeup signal and
237*4882a593Smuzhiyun			 wakeup event or 0xff for special setting (host
238*4882a593Smuzhiyun			 acknowledge required) when GPIO is used to wakeup host.
239*4882a593Smuzhiyun
240*4882a593Smuzhiyun	Examples:
241*4882a593Smuzhiyun		echo "-1" > hscfg        : Cancel host sleep mode
242*4882a593Smuzhiyun		echo "3" > hscfg         : Broadcast and unicast data;
243*4882a593Smuzhiyun					   Use GPIO and gap set previously
244*4882a593Smuzhiyun		echo "2 3" > hscfg       : Unicast data and GPIO 3;
245*4882a593Smuzhiyun					   Use gap set previously
246*4882a593Smuzhiyun		echo "2 1 160" > hscfg   : Unicast data, GPIO 1 and gap 160 ms
247*4882a593Smuzhiyun		echo "2 1 0xff" > hscfg  : Unicast data, GPIO 1; Wait for host
248*4882a593Smuzhiyun					   to ack before sending wakeup event
249*4882a593Smuzhiyun
250*4882a593Smuzhiyungetlog
251*4882a593Smuzhiyun        This command is used to get the statistics available in the station.
252*4882a593Smuzhiyun	Usage:
253*4882a593Smuzhiyun
254*4882a593Smuzhiyun	cat getlog
255*4882a593Smuzhiyun
256*4882a593Smuzhiyundevice_dump
257*4882a593Smuzhiyun	This command is used to dump driver information and firmware memory
258*4882a593Smuzhiyun	segments.
259*4882a593Smuzhiyun	Usage:
260*4882a593Smuzhiyun
261*4882a593Smuzhiyun	cat fw_dump
262*4882a593Smuzhiyun
263*4882a593Smuzhiyunverext
264*4882a593Smuzhiyun	This command is used to get extended firmware version string using
265*4882a593Smuzhiyun	different configuration parameters.
266*4882a593Smuzhiyun
267*4882a593Smuzhiyun	Usage:
268*4882a593Smuzhiyun		echo "[version_str_sel]" > verext
269*4882a593Smuzhiyun		cat verext
270*4882a593Smuzhiyun
271*4882a593Smuzhiyun		[version_str_sel]: firmware support several extend version
272*4882a593Smuzhiyun				   string cases, include 0/1/10/20/21/99
273*4882a593Smuzhiyun===============================================================================
274