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