AN0004 Realtek Low Power Wi-Fi MP User Guide
AN0004 Realtek Low Power Wi-Fi MP User Guide
Realtek Wan driver supports Mass Production functions. Customers can utilize these
functions to do EMI test and other simple TX and RX test. Command APIs can be used to
get and set I/O control to WLAN driver. Be sure to enable Wlan interface before using MP
Table of Contents
1 Introduction................................................................................................................... 4
2 MP library ...................................................................................................................... 4
2.1 SDK revision v2.x series................................................................................................... 4
2.2 SDK revision v3.x series................................................................................................... 5
3 Command Usage ............................................................................................................ 7
3.1 Start MP mode ................................................................................................................ 7
3.2 Stop MP mode ................................................................................................................ 7
3.3 Set Tx rate ....................................................................................................................... 7
3.4 Set operational channel .................................................................................................. 7
3.5 Set operational bandwidth ............................................................................................. 8
3.6 Set Tx power ................................................................................................................... 8
3.7 Set antenna for Tx ........................................................................................................... 8
3.8 Set antenna for Rx........................................................................................................... 9
3.9 Start air Rx mode ............................................................................................................ 9
3.10 Start continuous Tx mode ............................................................................................... 9
3.11 Query air Rx statistics.................................................................................................... 10
3.12 Reset air Tx/Rx statistics ............................................................................................... 10
4 Example Command ...................................................................................................... 12
4.1 Continuous Tx testing ................................................................................................... 12
4.2 Continuous Packet Tx testing........................................................................................ 12
4.3 Count Packet Tx testing ................................................................................................ 12
4.4 Carrier suppression testing ........................................................................................... 13
4.5 Single Tone Tx testing ................................................................................................... 13
4.6 Air Rx testing ................................................................................................................. 14
5 Data read/write example ............................................................................................. 15
5.1 SDK revision v02.x series............................................................................................... 15
5.1.1 Get efuse ............................................................................................................... 15
5.1.2 Set efuse................................................................................................................ 15
5.2 SDK revision v03.x series............................................................................................... 16
5.2.1 Get config .............................................................................................................. 16
2017-01-20 2
Document Number: AN0004
2017-01-20 3
Document Number: AN0004
1 Introduction
The RTL8195a driver supports driver based Mass Production functions. Customers can utilize
these functions to do EMI test and other simple TX and RX test. Under RTL8195a turnkey, we
command APIs can be used to get and set I/O control to WLAN driver. The MP functions will
only operate after the WLAN interface is opened.
2 MP library
2.1 SDK revision v2.x series
Normal driver and MP driver use separate libraries. WlanLib.a is for normal driver, and
WlanLib_mp.a is for MP mode driver. To initiate driver in MP mode, WlanLib_mp.a must be
used. To activate MP mode driver:
//Config in main.c
#define CONFIG_INIT_NET 1
#define CONFIG_START_STA 0
#define CONFIG_START_AP 0
#define CONFIG_INTERACTIVE_MODE 1
Step 2: Save WlanLib.a with another name such as WlanLib-normal.a for backup and rename
WlanLib-mp.a with WlanLib.a. Rebuild the code.
2017-01-20 4
Document Number: AN0004
For Ameba1
component\soc\realtek\8195a\misc\bsp\lib\common\IAR\lib_wlan.a
Step 2:
Step 3:
Rebuild project.
2017-01-20 5
Document Number: AN0004
For AmebaZ
component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_wlan.a
Step 2:
Step 3:
Rebuild project.
2017-01-20 6
Document Number: AN0004
3 Command Usage
3.1 Start MP mode
iwpriv mp_start
After executing this command, WLAN driver enters MP mode and stops transmitting and
receiving any packets. All connection with other stations will be broken. Beacon
transmitting is also stopped. If the original state is client mode, the roaming will be stopped.
iwpriv mp_stop
After executing this command, WLAN driver will stops transmitting and receiving packets
initialized by other commands. It will not return to normal operation mode. System should
close the WLAN interface and open again to get WLAN work normally.
rate: sets the rate of Tx packets (i.e., 2 for 1M, 4 for 2M, 11 for 5.5M, …, 108 for 54M,
128 for MCS0, 129 for MCS1, …, 142 for MCS15)
2017-01-20 7
Document Number: AN0004
40m: sets the operational bandwidth, 1 for 40M mode, 0 for 20M mode
sgi: sets guard interval of transmitting MCS packet, 1 for short GI, 0 for long GI
Set the operational bandwidth for transmitting and receiving packets. Set the guard interval
for transmitting MCS packets. If the parameters are not given, the default action is set
bandwidth to 20M mode and long GI to transmitting packets.
Set the transmitting power level of path A and path B. If the parameters are not given, the
driver will set Tx power according to the flash setting.
ant: sets the operational antenna for Tx, a for antenna A, b for antenna B, ab for
antenna A and B
2017-01-20 8
Document Number: AN0004
ant: sets the operational antenna for Rx, a for antenna A, b for antenna B, ab for
antenna A and B
phy: shows the count of RF physical received packets, CRC error, false alarm.
This command is for air receiving test. Use start command to accumulate the received
packets. Use stop command to stop counting and show the statistics of correct packets and
CRC-error packets. Use phy command to show the count of RF physical received packets,
CRC error and false alarm.
2017-01-20 9
Document Number: AN0004
This command is for continuous transmitting test. Use time command to assign the time to
send packets. Use count command to assign the number of packets to send. If both of time
and count are not specified, the sending function will continue infinitely. It can be stopped
when any key is pressed (should be specifically implemented in other platform) while
background command is not specified. If cs is specified, the sending signal will be a carrier
suppression signal. Use stone command to send single tone signal for frequency testing. If
stone is specified, the sending signal will be single tone and not a distinguishable packet any
more. Use background command to tell driver to send packets in background. The
command line control will return and packet sending is continuous. It can be stopped by
stop command. By default, packets will be sent by hardware for shorter duty cycle. If pkt is
specified, packets will be sent by software.
iwpriv mp_query
This command is for packet counting. Under packet transmitting, use this command to get
the number of packets being transmitted. Under receiving, use this command to get the
statistics of correct packets and CRC-error packets.
iwpriv mp_reset_stats
2017-01-20 10
Document Number: AN0004
This command is for reset the packet counts. Under packet transmitting, use this command
to reset the number of packets after the transmitted or receiving, use this command to
reset the statistics of correct packets and CRC-error packets.
2017-01-20 11
Document Number: AN0004
4 Example Command
4.1 Continuous Tx testing
(Execute the following commands after WLAN interface is normally opened)
2017-01-20 12
Document Number: AN0004
2017-01-20 13
Document Number: AN0004
2017-01-20 14
Document Number: AN0004
This command is for start of the efuse's logic address 0x0a offset and set the number of
bytes for read the efuse content.
2017-01-20 15
Document Number: AN0004
This command is for start of the config's logic address 0x0a offset and set the number of
bytes for read the config content.
2017-01-20 16
Document Number: AN0004
6 Crystal Calibration
6.1 Set Crystal Calibration
2017-01-20 17