
===================================
	0.Environment Variable Setting
===================================

a.Open header.sh and change The path of wifi config(CONFIG_ROOT_DIR) to the path about you wanting
	For Example :
		CONFIG_ROOT_DIR=/var/rtl8192c
		IWPRIV_PATH=/root

==================================================
	1.device initialize 
==================================================
main interface
./web_wifi_test.sh <interface> <encrypt> <ssid> <MAC address>
	./web_wifi_test.sh wlan0 1 Timmy_0 00:E0:4C:81:86:70

virtual interface
./web_vap_setting.sh <INTERFACE> <ssid> <MAC address>
	./web_vap_set_init.sh wlan0-va0 Timmy_0-va0 00:E0:4C:81:86:80
	./web_vap_set_init.sh wlan0-va1 Timmy_0-va1 00:E0:4C:81:86:81
	./web_vap_set_init.sh wlan0-va2 Timmy_0-va2 00:E0:4C:81:86:82
	./web_vap_set_init.sh wlan0-va3 Timmy_0-va3 00:E0:4C:81:86:83
	



==================================================
1B802.11b/g/n Setting( wlan0 only )
==================================================
	 ./web_set_bgn.sh  <interface> <bgn_mode>
	 re-start device : yes
	 <bgn_mode> : 
	 		b_mode , 	g_mode , n_mode , mixed
	 		
		For Example :
			ifconfig wlan0 down
			./web_set_bgn.sh wlan0 b_mode
			ifconfig wlan0 up
==================================================
2Bmulti-ssid Setting ( wlan0 , wlan0-va0 , wlan0-va0 , wlan0-va1 , wlan0-va2 , wlan0-va3 )
==================================================
	./web_set_ssid.sh <interface>   <ssid> 
	re-start device : no
	For Example :
			./web_set_ssid.sh wlan0 Timmy_SSID
			
==================================================
3Bpower calibration( wlan0 only )
==================================================
There are two way to save the power index.
	1.Save power index into wifi chip internal memory(Efuse).
	2.Save power index in files.

If the power index was saved in (Efuse),you can access the the power value throughput following 2 command.


iwpriv <Interface>  < efuse_set/efuse_get/efuse_sync>

efuse_set : save power index value in one temporary space.
   For Example : 
       iwpriv <Interface>  efuse_set HW_TX_POWER_CCK_A=<power Index>
          iwpriv <Interface>  efuse_set HW_TX_POWER_CCK_B=<power Index>
          ...
          ...

efuse_get : get power index correspond from the temporary space of Efuse
iwpriv <Interface>  efuse_get
   For Example : 
       iwpriv <Interface>  efuse_get HW_TX_POWER_CCK_A
       iwpriv <Interface>  efuse_get HW_TX_POWER_CCK_B
       ...
       ...

efuse_sync : Save the temporary space value into Efuse
    iwpriv <Interface>  efuse_sync




Please refer the web_set_power.sh


How to use the web_set_power.sh
	A.(fill out the values of HW_TX_POWER_CCK_A,
													HW_TX_POWER_CCK_B,
													HW_TX_POWER_HT40_1S_A,
													HW_TX_POWER_HT40_1S_B,
													HW_TX_POWER_DIFF_HT40_2S,
													HW_TX_POWER_DIFF_HT20,
													HW_TX_POWER_DIFF_OFDM and HW_WLAN0_WLAN_ADDR in web_set_power.sh , these value should be get after calibration )
	B.  ./web_set_power.sh wlan0
			these setting value will be saved in Efuse and driver will read these value to initialize wifi device during wifi device initialization
			
	C.	Efuse parameter   				V.S    iwpriv tool parameter
			HW_TX_POWER_CCK_A										pwrlevelCCK_A
			HW_TX_POWER_CCK_B										pwrlevelCCK_B
			HW_TX_POWER_HT40_1S_A								pwrlevelHT40_1S_A
			HW_TX_POWER_HT40_1S_B								pwrlevelHT40_1S_B
			HW_TX_POWER_DIFF_HT40_2S						pwrdiffHT40_2S
			HW_TX_POWER_DIFF_HT20								pwrdiffHT20
			HW_TX_POWER_DIFF_OFDM 							pwrdiffOFDM
			
	D.	About the define of each field , please refer the how_to_K_power_parameter.doc
		
	E.	You also can directly save the setting value in Efuse throughput MP tool.
			The detail refer MP.Tool.Introduction-v1.2.pdf
	
==================================================
4Bchannel setting( wlan0 only )
==================================================
	./web_channel.sh <interface> <channel>
	re-start device : yes
	For Example :
			ifconfig wlan0 down
			./web_channel.sh wlan0 11
			ifconfig wlan0 up
==================================================
5BTx rate setting( wlan0 only )
==================================================
	./web_tx_rate.sh <interface> <rate>
	re-start device : yes
	<rate> : 
		auto)
		cck_1M)
		cck_2M)
		cck_5.5M)
		cck_11M)
		OFDM_6M)
		OFDM_9M)
		OFDM_12M)
		OFDM_18M)
		OFDM_24M)
		OFDM_36M)
		OFDM_48M)
		OFDM_54M)
		mcs0)
		mcs1)
		mcs2)
		mcs3)
		mcs4)
		mcs5)
		mcs6)
		mcs7)
		mcs8)
		mcs9)
		mcs10)
		mcs11)
		mcs12)
		mcs13)
		mcs14)
		mcs15)
		all)

		For Example :
			ifconfig wlan0 down
			./web_tx_rate.sh wlan0 mcs0
			ifconfig wlan0 up


#using iwpriv wlan0 set_mib rssi_dump=1


==================================================
6BWPS( wlan0 only )
==================================================

First please change following path in wlanapp_8192c.sh to the path of the tools in your system 
	AUTH_PATH=/root/auth
	IWCONTROL_PATH=/root/iwcontrol
	WSCD_PATH=/root/wscd
	SIMPLECFG_PATH=/root/simplecfgservice.xml
	CONFIG_FILE_PATH=/root/wscd.conf

1.Add Bridge interface
2.bridge wifi device into Bridge interface
3.setting IP of Bridge interface
4. Open WPS G ./web_wps_setting.sh wlan0 open
							 iwcontrol wlan0

5. Close WPS G./web_wps_setting.sh wlan0 close



6.For Example
			brctl addbr br0
			brctl addif br0 wlan0
			ifconfig br0 <IP address>
			./web_wps_setting.sh wlan0 open
			iwcontrol wlan0

	Note : WPS2.x only support WPA2 or WPA/WPA2 mixed auth mode
	Note : WPS2.x only support AES or AES/TKIP mixed encrypt mode


==================================================
7BTx/Rx packets statistic
==================================================
	cat /proc/wlan0/stats
	cat /proc/wlan0-va0/stats
	cat /proc/wlan0-va1/stats
	cat /proc/wlan0-va2/stats
	cat /proc/wlan0-va3/stats


==================================================
8BWMM test
==================================================


==================================================
9BEncryption
==================================================
	A. WPA Setting
		re-start device : yes
			1.Initialize WPA(default value)
			./web_wpa_setting.sh <interface> <wpa/wpa2/wpa_wpa2_mixed> <tkip/aes/tkip_aes_mixed> 
				
		
			2.Setting PSK key
			./web_wpa_password.sh <interface>  <PSK key>
			
		
			3.For Example
				a.	ifconfig wlan0 down
				b.	./web_wpa_setting.sh wlan0 wpa2 aes
				c.	./web_wpa_password.sh wlan0 1234567890
				d.	ifconfig wlan0 up

				Example2 : 
				a.	ifconfig wlan0 down
				b.	./web_wpa_setting.sh wlan0 wpa2 tkip
				c.	./web_wpa_password.sh wlan0 1234567890
				d.	ifconfig wlan0 up

			note : 
				If set WEP mode , The use40M & band of The MIBs will be modified automatically.
				use40M = 0
				band = 3

	B.  WEP Setting
			If set WEP mode , The use40M & band of The MIBs will be modified automatically.
			use40M = 0
			band = 3
			
			
			1.initialize WEP
				./web_wep_setting.sh  <INTERFACE> <key_num>  < default key > 

			2.SETTING KEY
				./web_wep_key.sh wlan0 < key type > <key_num> <key>


			3.For Example
				a.	./web_wep_setting.sh wlan0 open wep_64 1
				b.	./web_wep_key.sh wlan0 64_hex 1 1111111111
				c.	./web_wep_key.sh wlan0 64_hex 2 2222222222
				d. ./web_wep_key.sh wlan0 64_hex 3 3333333333
				e.	./web_wep_key.sh wlan0 64_hex 4 4444444444
				f.	ifconfig wlan0 down
				g.	ifconfig wlan0 up

				a.	./web_wep_setting.sh wlan0-va0 open wep_64 1
				b.	./web_wep_key.sh wlan0-va0 64_hex 1 1111111111
				c.	./web_wep_key.sh wlan0-va0 64_hex 2 2222222222
				d.	./web_wep_key.sh wlan0-va0 64_hex 3 3333333333
				e.	./web_wep_key.sh wlan0-va0 64_hex 4 4444444444
				f.	ifconfig wlan0-va0 down
				g.	ifconfig wlan0-va0 up


				ifconfig wlan0-va0 down
				./web_wep_setting.sh wlan0-va0 open wep_64 1
				./web_wep_key.sh wlan0-va0 64_hex 1 1111111111
				./web_wep_key.sh wlan0-va0 64_hex 2 2222222222
				./web_wep_key.sh wlan0-va0 64_hex 3 3333333333
				./web_wep_key.sh wlan0-va0 64_hex 4 4444444444
				ifconfig wlan0-va0 up


				ifconfig wlan0-va1 down
				./web_wep_setting.sh wlan0-va1 open wep_64 2
				./web_wep_key.sh wlan0-va1 64_asc 1 3131313131
				./web_wep_key.sh wlan0-va1 64_asc 2 3232323232
				./web_wep_key.sh wlan0-va1 64_asc 3 3333333333
				./web_wep_key.sh wlan0-va1 64_asc 4 3434343434
				ifconfig wlan0-va1 up


				ifconfig wlan0-va2 down
				./web_wep_setting.sh wlan0-va2 open wep_128 3
				./web_wep_key.sh wlan0-va2 128_hex 1 11111111111111111111111111
				./web_wep_key.sh wlan0-va2 128_hex 2 22222222222222222222222222
				./web_wep_key.sh wlan0-va2 128_hex 3 33333333333333333333333333
				./web_wep_key.sh wlan0-va2 128_hex 4 44444444444444444444444444
				ifconfig wlan0-va2 up

				ifconfig wlan0-va3 down
				./web_wep_setting.sh wlan0-va3 open wep_128 4
				./web_wep_key.sh wlan0-va3 128_asc 1 31313131313131313131313131
				./web_wep_key.sh wlan0-va3 128_asc 2 32323232323232323232323232
				./web_wep_key.sh wlan0-va3 128_asc 3 33333333333333333333333333
				./web_wep_key.sh wlan0-va3 128_asc 4 34343434343434343434343434
				ifconfig wlan0-va3 up


	C.no-encrypt Setting
				./web_no_encry.sh <interface>
				For Example
					ifconfig wlan0-va3 down
					./web_no_encry.sh wlan0-va3
					ifconfig wlan0-va3 up


	D.WAPI 
				1.WPAI PSK
					ifconfig wlan0 down
					./web_wapi_psk.sh <interface>  <password>
					ifconfig wlan0 up

				For Example
					ifconfig wlan0 down
					./web_wapi_psk.sh wlan0 1234567890abcdef
					ifconfig wlan0 up

				2.WAPI Certification 
					ifconfig wlan0 down
					./web_wapi_cert.sh <interface>  <AS server IP>
					ifconfig wlan0 up

				For Example
					ifconfig wlan0 down
					./web_wapi_cert.sh wlan0 192.168.1.253
					ifconfig wlan0 up


==================================================
10Bssid fast path for Fast-path
==================================================

==================================================
11.Set hidden AP
==================================================
	./web_set_hiddenAP.sh <INTERFACE> <option>
		<option> : 
			0:show ssid ; 1:hidden ssid

		For Example
			ifconfig wlan0 down
			./web_set_hiddenAP.sh wlan0 1
			ifconfig wlan0 up



==================================================
11.Radius Server
==================================================
Execute radius server
./radius_server.sh "<interface> <radius_serveer_ip> <auth interface>  <radius server password> <radius using port>"
<option> :
		<radius_serveer_ip>
				radius server IP avvress
		<auth interface>
				The interface located the side of radius server

For Example

		Example 1 : 
			A.wlan0 run in 802.1x mode
			B.Radius server IP is 172.20.10.250
			C.eth0 is same subnet with Radius Server
			D.Execute:
				radius_server.sh open wlan0 172.20.10.250 eth0 realtek_123 1812
				iwcontrol wlan0 wlan0-va0 wlan0-va1 wlan0-va2 wlan0-va3

		Example 2 :
			A. If you want to run wlan0 wlan0-va0 wlan0-va2 in 802.1x mode
			B. Radius server IP is 172.20.10.250
			C. eth0 is same subnet with Radius Server
				radius_server.sh open wlan0 172.20.10.250 eth0
				radius_server.sh open wlan0-va0 172.20.10.250 eth0
				radius_server.sh open wlan0-va2 172.20.10.250 eth0
				ifconfig eth0 <IP address>
				iwcontrol wlan0 wlan0-va0 wlan0-va1 wlan0-va2 wlan0-va3

		Example 3 :	
			If you want to close 802.1x mode from wlan0 wlan0-va1
					radius_server.sh close wlan0 wlan0-va1
					iwcontrol wlan0 wlan0-va0 wlan0-va1 wlan0-va2 wlan0-va3
				
		Example 5 :
			A. wlan0 using WPS
			B. wlan0-va0 wlan0-va1 wlan0-va2 wlan0-va3 run in 802.1x 
					radius server IP : 172.20.10.250
					interface        : br0
			
			
				web_wps_setting.sh wlan0 open
				radius_server.sh open wlan0-va0 172.20.10.250 br0
				radius_server.sh open wlan0-va1 172.20.10.250 br0
				radius_server.sh open wlan0-va2 172.20.10.250 br0
				radius_server.sh open wlan0-va3 172.20.10.250 br0
				iwcontrol wlan0 wlan0-va0 wlan0-va1 wlan0-va2 wlan0-va3
			
		Example 6 :
			Close WPS :    wlan0
			Close 802.1x : wlan0-va0
			
			web_wps_setting.sh wlan0 close
			radius_server.sh close wlan0-va0 172.20.10.250 br0
			iwcontrol wlan0 wlan0-va0 wlan0-va1 wlan0-va2 wlan0-va3
			
		Note : 
			If you have re-start the wifi device.
			A.	device is root device ( wlan0 )
					You must re-start the auth daemon of every wifi device.
			
					For Example : 
					A. wlan0 is in 802.1x mode 
					B. If you re-start wlan0 
			   		ifconfig wlan0 down
			   		ifconfig wlan0 up
					C.
			   		The you must re-start all 802.1x from each wifi device
			   		./radius_server.sh close wlan0 , wlan0-va0 , wlan0-va1 , wlan0-va2 , wlan0-va3
			   		./radius_server.sh open wlan0 172.20.10.250 br0
			   		./radius_server.sh open wlan0-va0 172.20.10.250 br0
			   		./radius_server.sh open wlan0-va1 172.20.10.250 br0
			   		./radius_server.sh open wlan0-va2 172.20.10.250 br0
			   		./radius_server.sh open wlan0-va3 172.20.10.250 br0
			   		./iwcontrol wlan0 wlan0-va0 wlan0-va1 wlan0-va2 wlan0-va3
			
			
			B.	device is virtual device ( wlan0 )
					You only need re-start the auth daemon of correspond wifi device.
		
					For Example : 
					A. wlan0-va0 is in 802.1x mode 
					B. If you re-start wlan0 -va0
			   		ifconfig wlan0-va0 down
			   		ifconfig wlan0-va0 up
					C.
			   		The you only need re-start the auth daemon of wlan0-va0
			   		./radius_server.sh close wlan0-va0
			   		./radius_server.sh open wlan0-va0 172.20.10.250 br0
			   		./iwcontrol wlan0 wlan0-va0 wlan0-va1 wlan0-va2 wlan0-va3

==================================================
12.IWCONTROL DAEMON FORMAT
==================================================
	iwcontrol <interface 1> ... <<interface N>
	If you don't have using -wscd_path & -auth_path patameters , the daemon will use default path.
	
==================================================
Client Mode
==================================================
./web_client_init.sh <interface name> <AP ssid> <INTERFACE MAC address>
	