1277b024eSKalle Valo# 2*5f27b9afSGanapathi Bhat# Copyright 2011-2020 NXP 3*5f27b9afSGanapathi Bhat# 4*5f27b9afSGanapathi Bhat# This software file (the "File") is distributed by NXP 5*5f27b9afSGanapathi Bhat# under the terms of the GNU General Public License Version 2, June 1991 6277b024eSKalle Valo# (the "License"). You may use, redistribute and/or modify this File in 7277b024eSKalle Valo# accordance with the terms and conditions of the License, a copy of which 8277b024eSKalle Valo# is available by writing to the Free Software Foundation, Inc., 9277b024eSKalle Valo# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the 10277b024eSKalle Valo# worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 11277b024eSKalle Valo# 12277b024eSKalle Valo# THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 13277b024eSKalle Valo# IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 14277b024eSKalle Valo# ARE EXPRESSLY DISCLAIMED. The License provides additional details about 15277b024eSKalle Valo# this warranty disclaimer. 16277b024eSKalle Valo 17277b024eSKalle Valo 18277b024eSKalle Valo=============================================================================== 19277b024eSKalle Valo U S E R M A N U A L 20277b024eSKalle Valo 21277b024eSKalle Valo1) FOR DRIVER INSTALL 22277b024eSKalle Valo 23277b024eSKalle Valo a) Copy sd8787.bin to /lib/firmware/mrvl/ directory, 24277b024eSKalle Valo create the directory if it doesn't exist. 25277b024eSKalle Valo b) Install WLAN driver, 26277b024eSKalle Valo insmod mwifiex.ko 27277b024eSKalle Valo c) Uninstall WLAN driver, 28277b024eSKalle Valo ifconfig mlanX down 29277b024eSKalle Valo rmmod mwifiex 30277b024eSKalle Valo 31277b024eSKalle Valo 32277b024eSKalle Valo2) FOR DRIVER CONFIGURATION AND INFO 33277b024eSKalle Valo The configurations can be done either using the 'iw' user space 34277b024eSKalle Valo utility or debugfs. 35277b024eSKalle Valo 36277b024eSKalle Valo a) 'iw' utility commands 37277b024eSKalle Valo 38277b024eSKalle Valo Following are some useful iw commands:- 39277b024eSKalle Valo 40277b024eSKalle Valoiw dev mlan0 scan 41277b024eSKalle Valo 42277b024eSKalle Valo This command will trigger a scan. 43277b024eSKalle Valo The command will then display the scan table entries 44277b024eSKalle Valo 45277b024eSKalle Valoiw dev mlan0 connect -w <SSID> [<freq in MHz>] [<bssid>] [key 0:abcde d:1123456789a] 46277b024eSKalle Valo The above command can be used to connect to an AP with a particular SSID. 47277b024eSKalle Valo Ap's operating frequency can be specified or even the bssid. If the AP is using 48277b024eSKalle Valo WEP encryption, wep keys can be specified in the command. 49277b024eSKalle Valo Note: Every time before connecting to an AP scan command (iw dev mlan0 scan) should be used by user. 50277b024eSKalle Valo 51277b024eSKalle Valoiw dev mlan0 disconnect 52277b024eSKalle Valo This command will be used to disconnect from an AP. 53277b024eSKalle Valo 54277b024eSKalle Valo 55277b024eSKalle Valoiw dev mlan0 ibss join <SSID> <freq in MHz> [fixed-freq] [fixed-bssid] [key 0:abcde] 56277b024eSKalle Valo The command will be used to join or create an ibss. Optionally, operating frequency, 57277b024eSKalle Valo bssid and the security related parameters can be specified while joining/creating 58277b024eSKalle Valo and ibss. 59277b024eSKalle Valo 60277b024eSKalle Valoiw dev mlan0 ibss leave 61277b024eSKalle Valo The command will be used to leave an ibss network. 62277b024eSKalle Valo 63277b024eSKalle Valoiw dev mlan0 link 64277b024eSKalle Valo The command will be used to get the connection status. The command will return parameters 65277b024eSKalle Valo such as SSID, operating frequency, rx/tx packets, signal strength, tx bitrate. 66277b024eSKalle Valo 67277b024eSKalle Valo Apart from the iw utility all standard configurations using the 'iwconfig' utility are also supported. 68277b024eSKalle Valo 69277b024eSKalle Valo b) Debugfs interface 70277b024eSKalle Valo 71277b024eSKalle Valo The debugfs interface can be used for configurations and for getting 72277b024eSKalle Valo some useful information from the driver. 73277b024eSKalle Valo The section below explains the configurations that can be 74277b024eSKalle Valo done. 75277b024eSKalle Valo 76277b024eSKalle Valo Mount debugfs to /debugfs mount point: 77277b024eSKalle Valo 78277b024eSKalle Valo mkdir /debugfs 79277b024eSKalle Valo mount -t debugfs debugfs /debugfs 80277b024eSKalle Valo 81277b024eSKalle Valo The information is provided in /debugfs/mwifiex/mlanX/: 82277b024eSKalle Valo 83277b024eSKalle Valoiw reg set <country code> 84277b024eSKalle Valo The command will be used to change the regulatory domain. 85277b024eSKalle Valo 86277b024eSKalle Valoiw reg get 87277b024eSKalle Valo The command will be used to get current regulatory domain. 88277b024eSKalle Valo 89277b024eSKalle Valoinfo 90277b024eSKalle Valo This command is used to get driver info. 91277b024eSKalle Valo 92277b024eSKalle Valo Usage: 93277b024eSKalle Valo cat info 94277b024eSKalle Valo 95277b024eSKalle Valo driver_name = "mwifiex" 96277b024eSKalle Valo driver_version = <driver_name, driver_version, (firmware_version)> 97277b024eSKalle Valo interface_name = "mlanX" 98277b024eSKalle Valo bss_mode = "Ad-hoc" | "Managed" | "Auto" | "Unknown" 99277b024eSKalle Valo media_state = "Disconnected" | "Connected" 100277b024eSKalle Valo mac_address = <6-byte adapter MAC address> 101277b024eSKalle Valo multicase_count = <multicast address count> 102277b024eSKalle Valo essid = <current SSID> 103277b024eSKalle Valo bssid = <current BSSID> 104277b024eSKalle Valo channel = <current channel> 105277b024eSKalle Valo region_code = <current region code> 106277b024eSKalle Valo multicasr_address[n] = <multicast address> 107277b024eSKalle Valo num_tx_bytes = <number of bytes sent to device> 108277b024eSKalle Valo num_rx_bytes = <number of bytes received from device and sent to kernel> 109277b024eSKalle Valo num_tx_pkts = <number of packets sent to device> 110277b024eSKalle Valo num_rx_pkts = <number of packets received from device and sent to kernel> 111277b024eSKalle Valo num_tx_pkts_dropped = <number of Tx packets dropped by driver> 112277b024eSKalle Valo num_rx_pkts_dropped = <number of Rx packets dropped by driver> 113277b024eSKalle Valo num_tx_pkts_err = <number of Tx packets failed to send to device> 114277b024eSKalle Valo num_rx_pkts_err = <number of Rx packets failed to receive from device> 115277b024eSKalle Valo carrier "on" | "off" 116277b024eSKalle Valo tx queue "stopped" | "started" 117277b024eSKalle Valo 118277b024eSKalle Valo The following debug info are provided in /debugfs/mwifiex/mlanX/debug: 119277b024eSKalle Valo 120277b024eSKalle Valo int_counter = <interrupt count, cleared when interrupt handled> 121277b024eSKalle Valo wmm_ac_vo = <number of packets sent to device from WMM AcVo queue> 122277b024eSKalle Valo wmm_ac_vi = <number of packets sent to device from WMM AcVi queue> 123277b024eSKalle Valo wmm_ac_be = <number of packets sent to device from WMM AcBE queue> 124277b024eSKalle Valo wmm_ac_bk = <number of packets sent to device from WMM AcBK queue> 125277b024eSKalle Valo tx_buf_size = <current Tx buffer size> 126277b024eSKalle Valo curr_tx_buf_size = <current Tx buffer size> 127277b024eSKalle Valo ps_mode = <0/1, CAM mode/PS mode> 128277b024eSKalle Valo ps_state = <0/1/2/3, full power state/awake state/pre-sleep state/sleep state> 129277b024eSKalle Valo is_deep_sleep = <0/1, not deep sleep state/deep sleep state> 130277b024eSKalle Valo wakeup_dev_req = <0/1, wakeup device not required/required> 131277b024eSKalle Valo wakeup_tries = <wakeup device count, cleared when device awake> 132277b024eSKalle Valo hs_configured = <0/1, host sleep not configured/configured> 133277b024eSKalle Valo hs_activated = <0/1, extended host sleep not activated/activated> 134277b024eSKalle Valo num_tx_timeout = <number of Tx timeout> 135277b024eSKalle Valo is_cmd_timedout = <0/1 command timeout not occurred/occurred> 136277b024eSKalle Valo timeout_cmd_id = <command id of the last timeout command> 137277b024eSKalle Valo timeout_cmd_act = <command action of the last timeout command> 138277b024eSKalle Valo last_cmd_id = <command id of the last several commands sent to device> 139277b024eSKalle Valo last_cmd_act = <command action of the last several commands sent to device> 140277b024eSKalle Valo last_cmd_index = <0 based last command index> 141277b024eSKalle Valo last_cmd_resp_id = <command id of the last several command responses received from device> 142277b024eSKalle Valo last_cmd_resp_index = <0 based last command response index> 143277b024eSKalle Valo last_event = <event id of the last several events received from device> 144277b024eSKalle Valo last_event_index = <0 based last event index> 145277b024eSKalle Valo num_cmd_h2c_fail = <number of commands failed to send to device> 146277b024eSKalle Valo num_cmd_sleep_cfm_fail = <number of sleep confirm failed to send to device> 147277b024eSKalle Valo num_tx_h2c_fail = <number of data packets failed to send to device> 148277b024eSKalle Valo num_evt_deauth = <number of deauthenticated events received from device> 149277b024eSKalle Valo num_evt_disassoc = <number of disassociated events received from device> 150277b024eSKalle Valo num_evt_link_lost = <number of link lost events received from device> 151277b024eSKalle Valo num_cmd_deauth = <number of deauthenticate commands sent to device> 152277b024eSKalle Valo num_cmd_assoc_ok = <number of associate commands with success return> 153277b024eSKalle Valo num_cmd_assoc_fail = <number of associate commands with failure return> 154277b024eSKalle Valo cmd_sent = <0/1, send command resources available/sending command to device> 155277b024eSKalle Valo data_sent = <0/1, send data resources available/sending data to device> 156277b024eSKalle Valo mp_rd_bitmap = <SDIO multi-port read bitmap> 157277b024eSKalle Valo mp_wr_bitmap = <SDIO multi-port write bitmap> 158277b024eSKalle Valo cmd_resp_received = <0/1, no cmd response to process/response received and yet to process> 159277b024eSKalle Valo event_received = <0/1, no event to process/event received and yet to process> 160277b024eSKalle Valo cmd_pending = <number of cmd pending> 161277b024eSKalle Valo tx_pending = <number of Tx packet pending> 162277b024eSKalle Valo rx_pending = <number of Rx packet pending> 163277b024eSKalle Valo 164277b024eSKalle Valo 165277b024eSKalle Valo3) FOR DRIVER CONFIGURATION 166277b024eSKalle Valo 167277b024eSKalle Valoregrdwr 168277b024eSKalle Valo This command is used to read/write the adapter register. 169277b024eSKalle Valo 170277b024eSKalle Valo Usage: 171277b024eSKalle Valo echo " <type> <offset> [value]" > regrdwr 172277b024eSKalle Valo cat regrdwr 173277b024eSKalle Valo 174277b024eSKalle Valo where the parameters are, 175277b024eSKalle Valo <type>: 1:MAC/SOC, 2:BBP, 3:RF, 4:PMIC, 5:CAU 176277b024eSKalle Valo <offset>: offset of register 177277b024eSKalle Valo [value]: value to be written 178277b024eSKalle Valo 179277b024eSKalle Valo Examples: 180277b024eSKalle Valo echo "1 0xa060" > regrdwr : Read the MAC register 181277b024eSKalle Valo echo "1 0xa060 0x12" > regrdwr : Write the MAC register 182277b024eSKalle Valo echo "1 0xa794 0x80000000" > regrdwr 183277b024eSKalle Valo : Write 0x80000000 to MAC register 184a936ea54SAmitkumar Karwar 185a936ea54SAmitkumar Karwarmemrw 186a936ea54SAmitkumar Karwar This command is used to read/write the firmware memory. 187a936ea54SAmitkumar Karwar 188a936ea54SAmitkumar Karwar Usage: 189a936ea54SAmitkumar Karwar 1) For reading firmware memory location. 190a936ea54SAmitkumar Karwar echo r <address> 0 > /sys/kernel/debug/mwifiex/mlan0/memrw 191a936ea54SAmitkumar Karwar cat /sys/kernel/debug/mwifiex/mlan0/memrw 192a936ea54SAmitkumar Karwar 2) For writing value to firmware memory location. 193a936ea54SAmitkumar Karwar echo w <address> [value] > /sys/kernel/debug/mwifiex/mlan0/memrw 194a936ea54SAmitkumar Karwar 195a936ea54SAmitkumar Karwar where the parameters are, 196a936ea54SAmitkumar Karwar <address>: memory address 197a936ea54SAmitkumar Karwar [value]: value to be written 198a936ea54SAmitkumar Karwar 199a936ea54SAmitkumar Karwar Examples: 200a936ea54SAmitkumar Karwar echo r 0x4cf70 0 > /sys/kernel/debug/mwifiex/mlan0/memrw 201a936ea54SAmitkumar Karwar cat /sys/kernel/debug/mwifiex/mlan0/memrw 202a936ea54SAmitkumar Karwar : Read memory address 0x4cf70 203a936ea54SAmitkumar Karwar iwpriv mlan0 memrdwr -0x7fff6000 -0x40000000 204a936ea54SAmitkumar Karwar echo w 0x8000a000 0xc0000000 > /sys/kernel/debug/mwifiex/mlan0/memrw 205a936ea54SAmitkumar Karwar : Write 0xc0000000 to memory address 0x8000a000 206a936ea54SAmitkumar Karwar 207277b024eSKalle Valordeeprom 208277b024eSKalle Valo This command is used to read the EEPROM contents of the card. 209277b024eSKalle Valo 210277b024eSKalle Valo Usage: 211277b024eSKalle Valo echo "<offset> <length>" > rdeeprom 212277b024eSKalle Valo cat rdeeprom 213277b024eSKalle Valo 214277b024eSKalle Valo where the parameters are, 215277b024eSKalle Valo <offset>: multiples of 4 216277b024eSKalle Valo <length>: 4-20, multiples of 4 217277b024eSKalle Valo 218277b024eSKalle Valo Example: 219277b024eSKalle Valo echo "0 20" > rdeeprom : Read 20 bytes of EEPROM data from offset 0 220277b024eSKalle Valo 221277b024eSKalle Valohscfg 222277b024eSKalle Valo This command is used to debug/simulate host sleep feature using 223277b024eSKalle Valo different configuration parameters. 224277b024eSKalle Valo 225277b024eSKalle Valo Usage: 226277b024eSKalle Valo echo "<condition> [GPIO# [gap]]]" > hscfg 227277b024eSKalle Valo cat hscfg 228277b024eSKalle Valo 229277b024eSKalle Valo where the parameters are, 230277b024eSKalle Valo <condition>: bit 0 = 1 -- broadcast data 231277b024eSKalle Valo bit 1 = 1 -- unicast data 232277b024eSKalle Valo bit 2 = 1 -- mac event 233277b024eSKalle Valo bit 3 = 1 -- multicast data 234277b024eSKalle Valo [GPIO#]: pin number of GPIO used to wakeup the host. 235277b024eSKalle Valo GPIO pin# (e.g. 0-7) or 0xff (interface, e.g. SDIO 236277b024eSKalle Valo will be used instead). 237277b024eSKalle Valo [gap]: the gap in milliseconds between wakeup signal and 238277b024eSKalle Valo wakeup event or 0xff for special setting (host 239277b024eSKalle Valo acknowledge required) when GPIO is used to wakeup host. 240277b024eSKalle Valo 241277b024eSKalle Valo Examples: 242277b024eSKalle Valo echo "-1" > hscfg : Cancel host sleep mode 243277b024eSKalle Valo echo "3" > hscfg : Broadcast and unicast data; 244277b024eSKalle Valo Use GPIO and gap set previously 245277b024eSKalle Valo echo "2 3" > hscfg : Unicast data and GPIO 3; 246277b024eSKalle Valo Use gap set previously 247277b024eSKalle Valo echo "2 1 160" > hscfg : Unicast data, GPIO 1 and gap 160 ms 248277b024eSKalle Valo echo "2 1 0xff" > hscfg : Unicast data, GPIO 1; Wait for host 249277b024eSKalle Valo to ack before sending wakeup event 250277b024eSKalle Valo 251277b024eSKalle Valogetlog 252277b024eSKalle Valo This command is used to get the statistics available in the station. 253277b024eSKalle Valo Usage: 254277b024eSKalle Valo 255277b024eSKalle Valo cat getlog 256277b024eSKalle Valo 257277b024eSKalle Valodevice_dump 258277b024eSKalle Valo This command is used to dump driver information and firmware memory 259277b024eSKalle Valo segments. 260277b024eSKalle Valo Usage: 261277b024eSKalle Valo 262277b024eSKalle Valo cat fw_dump 263277b024eSKalle Valo 26417934b6aSXinming Huverext 26517934b6aSXinming Hu This command is used to get extended firmware version string using 26617934b6aSXinming Hu different configuration parameters. 26717934b6aSXinming Hu 26817934b6aSXinming Hu Usage: 26917934b6aSXinming Hu echo "[version_str_sel]" > verext 27017934b6aSXinming Hu cat verext 27117934b6aSXinming Hu 27217934b6aSXinming Hu [version_str_sel]: firmware support several extend version 27317934b6aSXinming Hu string cases, include 0/1/10/20/21/99 274277b024eSKalle Valo=============================================================================== 275