﻿===============================================================================
		[ Table of Contents ]
===============================================================================
1. Features.
2. Software Package.
3. Quick Start Guide.

---3.1  Build MP Driver module.
---3.2 Build Android wireless tools

---3.3   MP Use Example.				Chinese translation:
------3.3.1   [ Continuous Tx testing ] 		(無間斷調制訊號發送測試 )
------3.3.2   [ Continuous Packet Tx testing ]    	(不限封包數量調制訊號發送測試 )
------3.3.3   [ Count Packet Tx testing ]		(有限封包數量調制訊號發送測試 )
------3.3.4   [ Carrier suppression testing ] 		(載波抑制發送測試 )
------3.3.5   [ Single Tone Tx testing ]		(無調制訊號單頻載波發送測試 ) 
------3.3.6   [ Air Rx testing ]			(接收封包測試 )
------3.3.7   [ Enable/Disable Tx Power Tracking ] 

4. Phy Efuse Read/Write Use Example.

------4.1 efuse_get
------4.2 efuse_get
------4.3 Efuse's spec.

===============================================================================
		[1. Features]
===============================================================================
	The following steps demonstrate Realtek Wireless Adapter Mass
Production Linux Tool. This is a simple install guide, 
we use Linux utility “iwpriv” to get and set I/O control to WLAN driver. 

if need more detail or example information, Please refer to UserGuide.doc .


===============================================================================
		[2. Software Package] - To check have the Component .tar.gz files.
===============================================================================
1. Driver source - rtXXX_linux_MP_vX.X.X.tar.gz
2. Wireless tool Source -(If want to use for Android system) - Android_wireless_tools.tar
3. Documents
	- LinuxDriver_MP_Iwpriv_UserGuide.doc

===============================================================================
		[3. Quick Start Guide]
===============================================================================

===========================================================
		[3.1. Build Driver module]
===========================================================
Note: Use su/sudo su for root authentication with following command.

1. Unzip Driver source folder -
	# tar -xvzf rtlXXX_linux_MP_linux_vx.x.x.tar.gz

2. Change to driver source code directory -
	# cd rtlXXX_linux_MP__linux_vx.x.x

3. To choose interface for 8723A WiFi Driver.
	# chmod 777 make_drv
	#./make_drv
	# input 1 or 2 for 8723AS/8723AU
	 
4.Config compile Setting-

   Edit the "Makefile", and modify the line 21 "CONFIG_MP_INCLUDED = n"  to "CONFIG_MP_INCLUDED = y"
   
   If your target platform is the platform you're compiling driver,
   maybe you don't need to change any setting.
   Otherwise you need to do some configuration manually,
   like cross compiler and kernel source tree directory.
	ex.
		ARCH := arm
		CROSS_COMPILE := arm-none-linux-gnueabi-
		KSRC := /usr/src/linux-2.6.34.1

5. Do the Compile the driver source code -
	# make

If nothing goes wrong, the driver "/8188eu_mp.ko" will be generated.
(ps. If the interface is USB, the driver file name would be 8xxx.ko)

If there're still some problems or need more detail compile driver guide,
please check normal driver package for more reference.


===========================================================
	3.2 Build Android wireless tools
===========================================================

If want to use for Android system, we need to Build iwpriv(wireless tools) for android.

#tar zxvf Android_wireless_tools-iwpriv.tar.gz

#cp wireless_tools froyo-x86/external/

root@realtek-desktop:~/Desktop/froyo-x86/external/wireless_tools# . ../../build/envsetup.sh 
root@realtek-desktop:~/Desktop/froyo-x86/external/wireless_tools# mm

.....

target Non-prelinked: iwpriv (out/target/product/eeepc/symbols/system/bin/iwpriv)
target Unstripped: iwpriv (out/target/product/eeepc/obj/EXECUTABLES/iwpriv_intermediates/iwpriv)
Install: out/target/product/eeepc/system/xbin/iwpriv

#cp " out/target/product/eeepc/system/xbin/iwpriv "  to target platform file system " system/xbin/iwpriv ".


===========================================================
		[3.3 MP Use Example]
===========================================================
(Execute the following commands after WLAN interface is normally opened)
If you want to change the input parameter(rate、channel、txpower、bandwidth),please must input advance the command "iwpriv wlan0 mp_ctx stop".
Please refer the doc "iwpriv_mp_settings_for_different_data_rate.xls " for set data rate.
------------------------------------------------------------------------------------------
Insert and enable the MP Mode Driver
------------------------------------------------------------------------------------------

insmod 8723au.ko rtw_mp_init=1

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.3.1  [ Continuous Tx testing ] :	"iwpriv wlan0 mp_ctx background"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ifconfig wlan0 up					# Enable Device for MP operation
iwpriv wlan0 mp_start					# enter MP mode								
iwpriv wlan0 mp_channel 1				# set channel to 1 . 2, 3, 4~13 etc.
iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0               # set 20M mode and long GI,set 40M is 40M=1.
iwpriv wlan0 mp_ant_tx a				# Select antenna A for operation,if device have 2x2 antennam select antenna "a" or "b" and "ab" for operation.
iwpriv wlan0 mp_txpower patha=44,pathb=44               # set path A and path B Tx power level,the Range is 0~63.
iwpriv wlan0 mp_rate 108				# set OFDM data rate to 54Mbps,ex: CCK 1M = 2, CCK 5.5M = 11 ;OFDM 6M=12、54M = 108;N Rate: MCS0 = 128,MCS1 = 129,MCS 2=130....MCS15 = 143 etc.
iwpriv wlan0 mp_ctx background				# start continuous Tx
iwpriv wlan0 mp_ctx stop				# stop continuous Tx
iwpriv wlan0 mp_stop					# exit MP mode
ifconfig wlan0 down					# close WLAN interface

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.3.2	[ Continuous Packet Tx testing] :	"iwpriv wlan0 mp_ctx background,pkt"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ifconfig wlan0 up					# Enable Device for MP operation
iwpriv wlan0 mp_start					# enter MP mode								
iwpriv wlan0 mp_channel 1				# set channel to 1 . 2, 3, 4~13 etc.
iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0               # set 20M mode and long GI,set 40M is 40M=1.
iwpriv wlan0 mp_ant_tx a				# Select antenna A for operation,if device have 2x2 antennam select antenna "a" or "b" and "ab" for operation.
iwpriv wlan0 mp_txpower patha=44,pathb=44               # set path A and path B Tx power level , the Range is 0~63.
iwpriv wlan0 mp_rate 108				# set OFDM data rate to 54Mbps,ex: CCK 1M = 2, CCK 5.5M = 11 ;OFDM 6M=12、54M = 108 ; N Rate: MCS0 = 128, MCS1 = 129 MCS 2=130....MCS15 = 143 etc.
iwpriv wlan0 mp_ctx background,pkt			# start continuous Packet Tx
iwpriv wlan0 mp_ctx stop				# stop continuous Tx
iwpriv wlan0 mp_stop					# exit MP mode
ifconfig wlan0 down					# close WLAN interface

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.3.3	[ Count Packet Tx testing ]:	"iwpriv wlan0 mp_ctx count=%d,pkt"
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ifconfig wlan0 up						# Enable Device for MP operation
iwpriv wlan0 mp_start						# Enter MP mode
iwpriv wlan0 mp_channel 1					# Set channel to 1 . 2, 3, 4~13 etc.
iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0  			# Set 20M mode and long GI,set 40M is 40M=1.
iwpriv wlan0 mp_ant_tx a					# Select antenna A for operation,if device have 2x2 antennam select antenna "a" or "b" and "ab" for operation.
iwpriv wlan0 mp_txpower patha=44,pathb=44   			# Set path A and path B Tx power level , the Range is 0~63.
iwpriv wlan0 mp_rate 108					# Set OFDM data rate to 54Mbps,ex: CCK 1M = 2, CCK 5.5M = 11 ;OFDM 6M=12、54M = 108 ; N Rate: MCS0 = 128, MCS1 = 129 MCS 2=130....MCS15 = 143 etc.
iwpriv wlan0 mp_ctx count=%d,pkt	    			# "%d" Number of packets start packet Tx
iwpriv wlan0 mp_ctx stop					# stop continuous Tx
iwpriv wlan0 mp_stop						# exit MP mode
ifconfig wlan0 down						# close WLAN interface

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.3.4	[ Carrier suppression testing ]: 	"iwpriv wlan0 mp_ctx background,cs"
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ifconfig wlan0 up					# Enable Device for MP operation
iwpriv wlan0 mp_start					# enter MP mode								
iwpriv wlan0 mp_channel 1				# set channel to 1 . 2, 3, 4~13 etc.
iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0               # set 20M mode and long GI,set 40M is 40M=1.
iwpriv wlan0 mp_ant_tx a				# Select antenna A for operation,if device have 2x2 antennam select antenna "a" or "b" and "ab" for operation.
iwpriv wlan0 mp_txpower patha=44,pathb=44               # set path A and path B Tx power level , the Range is 0~63.
iwpriv wlan0 mp_rate 108				# set OFDM data rate to 54Mbps,ex: CCK 1M = 2, CCK 5.5M = 11 ;OFDM 6M=12、54M = 108 ; N Rate: MCS0 = 128, MCS1 = 129 MCS 2=130....MCS15 = 143 etc.
iwpriv wlan0 mp_ctx background,cs			# start sending carrier suppression signal
iwpriv wlan0 mp_ctx stop				# stop continuous Tx
iwpriv wlan0 mp_stop					# exit MP mode
ifconfig wlan0 down					# close WLAN interface


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.3.5	[ Single Tone Tx testing ]:  	"iwpriv wlan0 mp_ctx background,stone"
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ifconfig wlan0 up					# Enable Device for MP operation
iwpriv wlan0 mp_start					# enter MP mode								
iwpriv wlan0 mp_channel 1				# set channel to 1 . 2, 3, 4~13 etc.
iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0               # set 20M mode and long GI,set 40M is 40M=1.
iwpriv wlan0 mp_ant_tx a				# Select antenna A for operation,if device have 2x2 antennam select antenna "a" or "b" and "ab" for operation.
iwpriv wlan0 mp_txpower patha=44,pathb=44               # set path A and path B Tx power level , the Range is 0~63.
iwpriv wlan0 mp_rate 108				# set OFDM data rate to 54Mbps,ex: CCK 1M = 2, CCK 5.5M = 11 ;OFDM 6M=12、54M = 108 ; N Rate: MCS0 = 128, MCS1 = 129 MCS 2=130....MCS15 = 143 etc.
iwpriv wlan0 mp_ctx background,stone			# start sending single tone signal
iwpriv wlan0 mp_ctx stop				# stop continuous Tx
iwpriv wlan0 mp_stop					# exit MP mode
ifconfig wlan0 down					# close WLAN interface

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.3.6	[ Air Rx testing ]:  	"iwpriv wlan0 mp_arx start"
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ifconfig wlan0 up					# Enable Device for MP operation
iwpriv wlan0 mp_start					# Enter MP mode								
iwpriv wlan0 mp_channel 1				# Set channel to 1 . 2, 3, 4~13 etc.
iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0               # Set 20M mode and long GI or set to 40M is 40M=1.
iwpriv wlan0 mp_ant_rx a				# Select antenna A for operation,if device have 2x2 antennam select antenna "a" or "b" and "ab" for operation.
iwpriv wlan0 mp_arx start				# start air Rx teseting.
iwpriv wlan0 mp_query					# get the statistics.
iwpriv wlan0 mp_arx stop or iwpriv wlan0 mp_reset_stats	# Stop air Rx test and show the Statistics / Reset Counter. 
iwpriv wlan0 mp_stop					# exit MP mode
ifconfig wlan0 down					# close WLAN interface


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.3.6	[Enable/Disable Tx Power Tracking ]:  	"iwpriv wlan0 mp_pwrctldm start/stop"
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
iwpriv wlan0 mp_pwrctldm start				#Enable the power tracking for Tx.
iwpriv wlan0 mp_pwrctldm stop				#Disable the power tracking for Tx.


3. Detail manual command and more example please refer the "LinuxDriver_MP_Iwpriv_UserGuide.doc".

===============================================================================================================
			[4. Efuse Read/Write Use Example]
===============================================================================================================

use example:
[4.1 WiFi efuse_get]
iwpriv wlan0 efuse_get realmap       # read form driver for all efuse logic map.
iwpriv wlan0 efuse_get drvmap        # read form current driver of efuse logic map.
iwpriv wlan0 efuse_get realraw       # read form all phy efuse map.
iwpriv wlan0 efuse_get mac           # read mac address  ( Direct to use the cmd for raed mac address from the efuse content )
iwpriv wlan0 efuse_get rmap,16,6     # fix offset :cmd,offset,byteCounts ( Specified a start of the efuse's address and set the number of bytes for raed from the efuse content)
iwpriv wlan0 efuse_get wlrfkmap,16,6	     # read form fake WiFi for efuse logic map.
------------------------------------------------------------------------------------------------------
[4.2 WiFi efuse_set]
iwpriv wlan0 efuse_set wmap,16,00e04c871234       #  cmd,offset,Data bytes[hex] ( Specified a offset address for write 6 bytes data "0x00,0xe0,0x4c,0x87,0x12,0x34" to the 0x16 start of the efuse content address )
iwpriv wlan0 efuse_set mac,00e04c871234           #  cmd,Data bytes[hex] (Use set mac cmd to write 6 bytes data "0x00,0xe0,0x4c,0x87,0x12,0x34" to the  efuse content)
iwpriv wlan0 efuse_set wlwfake,16,00e04c871234    #  cmd,offset,Data bytes[hex] ( Specified a offset address for write 6 bytes data "0x00,0xe0,0x4c,0x87,0x12,0x34" to the 0x16 start of the Fake efuse content address )
iwpriv wlan0 efuse_set wldumpfake			#  Dump WiFI HW efuse to Fake WiFI efuse Map.
iwpriv wlan0 efuse_set wlfk2map				#  Wirte WiFi Fake efuse to HW WiFi efuse Map.


If config the Driver to use File Map,you can use the following cmd to read current Drv logic map.
iwpriv wlan0 efuse_get drvmap
=====================================================================================================

[ 4.4 BT Efuse Function ]

[--> 4.4.1 BT Get Function <--]
iwpriv wlan0 efuse_get btfmap		# read form HW BT of front efuse logic map.
iwpriv wlan0 efuse_get btbmap		# read form HW BT of back efuse logic map.
iwpriv wlan0 efuse_get btrmap,16,6	# fix offset :cmd,offset,byteCounts
 					( Specified BT start of the efuse's address and set the number of bytes for raed from the BT efuse content)
iwpriv wlan0 efuse_get btffake		# read form fake BT of front efuse logic map.
iwpriv wlan0 efuse_get btbfake		# read form fake BT of back efuse logic map.

[--> 4.4.2 BT Set Function <--]
iwpriv wlan0 efuse_set btwmap,16,00e04c871234		#  cmd,offset,Data bytes[hex] 
							( Specified a offset address for write 6 bytes data "0x00,0xe0,0x4c,0x87,0x12,0x34" to the 0x16 start of the efuse content address )
iwpriv wlan0 efuse_set btwfake,16,00e04c871234		#  cmd,offset,Data bytes[hex] 
							( Specified a offset address for write 6 bytes data "0x00,0xe0,0x4c,0x87,0x12,0x34" to the 0x16 start of the Fake efuse content address )
iwpriv wlan0 efuse_set btdumpfake			#  Dump BT HW efuse to Fake BT efuse Map.
iwpriv wlan0 efuse_set btfk2map				#  Wirte BT Fake efuse to HW BT efuse Map.


=====================================================================================================
[Efuse's spec].
If you want a clearer definition of reference, you can refer to the Efuse's spec "AN_RTL8XXX_EEPROM_SPEC_V1.1_20100519.pdf"

