README 10 KB

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