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