MTK Wi-Fi STA Software Programming Guide 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Version: 
1.2 
Release date: 
2013-01-23 
©  2008 - 2013 MediaTek Inc. 
This document contains information that is proprietary to MediaTek Inc. 
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited. 
 
Specifications are subject to change without notice. 
 
 
 
Document Revision History 
 
Revision 
Date 
2012/10/29 
2012/10/31 
2013/01/23 
1.0 
1.1 
1.2 
 
Author 
Pan Liu 
Pan Liu 
Pan Liu 
Description 
Initial Version 
Add sample code 
Update WirelessMode, Add profile item VHT_BW, iwpriv items 
VhtBW and VhtStbc, and SingleSKU example file 
MediaTek Confidential 
©  2012 - 2013 MediaTek Inc. 
Page 2 of 85 
This document contains information that is proprietary to MediaTek Inc. 
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited. 
 
Table of Contents 
Document Revision History .................................................................................................................. 2 
Table of Contents ................................................................................................................................... 3 
1 
Introduction................................................................................................................................... 8 
2  Wi-Fi STA driver Profile Default Setting ..................................................................................... 9 
2.1  WLAN Profile Description ................................................................................................... 10 
2.1.1 
CountryRegion ................................................................................................... 10 
2.1.2 
CountryRegionForABand ................................................................................... 11 
2.1.3 
CountryCode ...................................................................................................... 11 
2.1.4 
ChannelGeography ............................................................................................ 11 
2.1.5 
SSID ................................................................................................................... 11 
2.1.6 
NetworkType ...................................................................................................... 12 
2.1.7 
WirelessMode ..................................................................................................... 12 
2.1.8 
Channel .............................................................................................................. 12 
2.1.9 
BeaconPeriod ..................................................................................................... 12 
2.1.10 
TxPower ............................................................................................................. 13 
2.1.11 
BGProtection ...................................................................................................... 13 
2.1.12 
TxPreamble ........................................................................................................ 13 
2.1.13 
RTSThreshold .................................................................................................... 13 
2.1.14 
FragThreshold .................................................................................................... 13 
2.1.15 
TxBurst ............................................................................................................... 13 
2.1.16 
PktAggregate ...................................................................................................... 14 
2.1.17  WmmCapable ..................................................................................................... 14 
AckPolicy ............................................................................................................ 14 
2.1.18 
2.1.19 
AuthMode ........................................................................................................... 14 
2.1.20 
EncrypType ........................................................................................................ 15 
2.1.21  WPAPSK ............................................................................................................ 15 
DefaultKeyID ...................................................................................................... 15 
2.1.22 
2.1.23 
Key1Type ........................................................................................................... 15 
Key1Str ............................................................................................................... 15 
2.1.24 
Key2Type ........................................................................................................... 15 
2.1.25 
2.1.26 
Key2Str ............................................................................................................... 16 
Key3Type ........................................................................................................... 16 
2.1.27 
Key3Str ............................................................................................................... 16 
2.1.28 
Key4Type ........................................................................................................... 16 
2.1.29 
2.1.30 
Key4Str ............................................................................................................... 16 
PSMode .............................................................................................................. 17 
2.1.31 
AutoRoaming ...................................................................................................... 17 
2.1.32 
2.1.33 
RoamThreshold .................................................................................................. 17 
APSDCapable .................................................................................................... 17 
2.1.34 
APSDAC ............................................................................................................. 17 
2.1.35 
FixedTxMode ...................................................................................................... 17 
2.1.36 
2.1.37 
HT_RDG ............................................................................................................. 18 
HT_EXTCHA ...................................................................................................... 18 
2.1.38 
2.1.39 
HT_OpMode ....................................................................................................... 18 
Page 3 of 85 
©  2012 - 2013 MediaTek Inc. 
MediaTek Confidential 
This document contains information that is proprietary to MediaTek Inc. 
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited. 
 
HT_MpduDensity ................................................................................................ 18 
2.1.40 
HT_BW ............................................................................................................... 19 
2.1.41 
HT_BADecline .................................................................................................... 19 
2.1.42 
HT_AutoBA ........................................................................................................ 19 
2.1.43 
HT_AMSDU ........................................................................................................ 19 
2.1.44 
HT_BAWinSize ................................................................................................... 19 
2.1.45 
HT_GI ................................................................................................................. 20 
2.1.46 
HT_MCS ............................................................................................................. 20 
2.1.47 
HT_MIMOPSMode ............................................................................................. 20 
2.1.48 
HT_DisallowTKIP ............................................................................................... 20 
2.1.49 
HT_STBC ........................................................................................................... 20 
2.1.50 
VHT_BW ............................................................................................................ 21 
2.1.51 
2.1.52 
IEEE80211H ....................................................................................................... 21 
2.1.53  WirelessEvent .................................................................................................... 21 
2.1.54 
CarrierDetect ...................................................................................................... 21 
AntDiversity ........................................................................................................ 21 
2.1.55 
BeaconLostTime ................................................................................................ 22 
2.1.56 
2.1.57 
PSP_XLINK_MODE ........................................................................................... 22 
2.1.58  WscManufacturer ............................................................................................... 22 
2.1.59  WscModelName ................................................................................................. 22 
2.1.60  WscDeviceName ................................................................................................ 22 
2.1.61  WscModelNumber .............................................................................................. 22 
2.1.62  WscSerialNumber .............................................................................................. 23 
2.1.63 
RadioOn ............................................................................................................. 23 
2.1.64  Wsc4digitPinCode .............................................................................................. 23 
3  Wi-Fi STA driver iwpriv command ............................................................................................ 24 
3.1  Debug ................................................................................................................................. 24 
3.2  DriverVersion ...................................................................................................................... 24 
3.3  CountryRegion .................................................................................................................... 24 
3.4  CountryRegionABand ......................................................................................................... 25 
3.5  SSID ................................................................................................................................... 25 
3.6  WirelessMode ..................................................................................................................... 25 
3.7  TxBurst ............................................................................................................................... 26 
3.8  TxPreamble ........................................................................................................................ 26 
3.9  TxPower .............................................................................................................................. 26 
3.10  Channel .............................................................................................................................. 26 
3.11  BGProtection ...................................................................................................................... 26 
3.12  RTSThreshold..................................................................................................................... 27 
3.13  FragThreshold .................................................................................................................... 27 
3.14  HtBw ................................................................................................................................... 27 
3.15  HtMcs .................................................................................................................................. 27 
3.16  HtGi ..................................................................................................................................... 27 
3.17  HtOpMode .......................................................................................................................... 28 
3.18  HtStbc ................................................................................................................................. 28 
3.19  HtExtcha ............................................................................................................................. 28 
3.20  HtMpduDensity ................................................................................................................... 28 
3.21  HtBaWinSize....................................................................................................................... 28 
3.22  HtRdg .................................................................................................................................. 29 
MediaTek Confidential 
©  2012 - 2013 MediaTek Inc. 
Page 4 of 85 
This document contains information that is proprietary to MediaTek Inc. 
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited. 
 
4 
5 
6 
3.23  HtAmsdu ............................................................................................................................. 29 
3.24  HtAutoBa ............................................................................................................................ 29 
3.25  HtBaDecline ........................................................................................................................ 29 
3.26  HtProtect ............................................................................................................................. 29 
3.27  HtMimoPs ........................................................................................................................... 30 
3.28  HtDisallowTKIP ................................................................................................................... 30 
3.29  HtBssCoex .......................................................................................................................... 30 
3.30  VhtBw ................................................................................................................................. 30 
3.31  VhtStbc ............................................................................................................................... 30 
3.32  PktAggregate ...................................................................................................................... 31 
3.33  WmmCapable ..................................................................................................................... 31 
3.34  IEEE80211H ....................................................................................................................... 31 
3.35  NetworkType....................................................................................................................... 31 
3.36  AuthMode ........................................................................................................................... 31 
3.37  EncrypType......................................................................................................................... 32 
3.38  DefaultKeyID....................................................................................................................... 32 
3.39  Key1 .................................................................................................................................... 32 
3.40  Key2 .................................................................................................................................... 32 
3.41  Key3 .................................................................................................................................... 33 
3.42  Key4 .................................................................................................................................... 33 
3.43  WPAPSK ............................................................................................................................ 33 
3.44  ResetCounter...................................................................................................................... 33 
3.45  PSMode .............................................................................................................................. 33 
3.46  FixedTXMode ..................................................................................................................... 34 
3.47  BeaconLostTime ................................................................................................................. 34 
3.48  AutoRoaming ...................................................................................................................... 34 
3.49  SiteSurvey .......................................................................................................................... 34 
3.50  AutoReconnect ................................................................................................................... 34 
3.51  AdhocN ............................................................................................................................... 35 
iwpriv ra0 usage ......................................................................................................................... 36 
4.1 
connStatus .......................................................................................................................... 36 
4.2  driverVer ............................................................................................................................. 36 
4.3  bainfo .................................................................................................................................. 36 
rxbulk .................................................................................................................................. 36 
4.4 
4.5 
txbulk .................................................................................................................................. 36 
radio_off .............................................................................................................................. 36 
4.6 
4.7 
radio_on .............................................................................................................................. 37 
4.8  get_site_survey .................................................................................................................. 37 
4.9 
stat ...................................................................................................................................... 37 
4.10  bbp (Debug only) ................................................................................................................ 37 
4.11  mac (Debug only) ............................................................................................................... 37 
4.12  rf (Debug only) .................................................................................................................... 38 
4.13  e2p (Debug only) ................................................................................................................ 38 
iwpriv ra0 show command ........................................................................................................ 39 
iwpriv examples .......................................................................................................................... 40 
Infrastructure Security Mode .............................................................................................. 40 
6.1 
6.1.1 
OPEN/NONE ...................................................................................................... 40 
MediaTek Confidential 
©  2012 - 2013 MediaTek Inc. 
Page 5 of 85 
This document contains information that is proprietary to MediaTek Inc. 
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited. 
 
6.2.1 
6.2.2 
6.1.2 
6.1.3 
6.1.4 
6.1.5 
SHARED/WEP ................................................................................................... 40 
WPAPSK/TKIP ................................................................................................... 40 
WPAPSK/AES .................................................................................................... 40 
WPA2PSK/TKIP ................................................................................................. 41 
6.2  Ad-hoc mode ...................................................................................................................... 41 
OPEN/NONE ...................................................................................................... 41 
WPANONE/TKIP ................................................................................................ 41 
6.3  Get Site Survey result ......................................................................................................... 41 
6.4  Get WLAN Statistics ........................................................................................................... 41 
6.5  To Link with AP ................................................................................................................... 42 
7  WPS Wi-Fi PROTECTED SETUP ............................................................................................... 43 
7.1  WPS iwpriv command ........................................................................................................ 43 
wsc_conf_mode ................................................................................................. 43 
7.1.1 
wsc_mode .......................................................................................................... 44 
7.1.2 
wsc_pin .............................................................................................................. 44 
7.1.3 
wsc_ssid ............................................................................................................. 44 
7.1.4 
wsc_bssid ........................................................................................................... 44 
7.1.5 
wsc_start ............................................................................................................ 44 
7.1.6 
wsc_stop ............................................................................................................ 44 
7.1.7 
wsc_gen_pincode ............................................................................................... 45 
7.1.8 
wsc_cred_count ................................................................................................. 45 
7.1.9 
wsc_cred_ssid .................................................................................................... 45 
7.1.10 
wsc_cred_auth ................................................................................................... 45 
7.1.11 
wsc_cred_encr ................................................................................................... 45 
7.1.12 
wsc_cred_keyIdx ................................................................................................ 46 
7.1.13 
wsc_cred_key ..................................................................................................... 46 
7.1.14 
wsc_cred_mac ................................................................................................... 46 
7.1.15 
wsc_conn_by_idx ............................................................................................... 46 
7.1.16 
wsc_auto_conn .................................................................................................. 47 
7.1.17 
7.1.18 
wsc_ap_band ..................................................................................................... 47 
7.1.19  Wsc4digitPinCode .............................................................................................. 47 
7.2  WPS STA as an Enrollee or Registrar ............................................................................... 47 
Enrollee Mode .................................................................................................... 47 
PBC mode .......................................................................................................... 48 
7.3  Registrar Mode ................................................................................................................... 48 
PIN Mode ........................................................................................................... 48 
PBC Mode .......................................................................................................... 49 
7.4  WPS Command & OID Example ........................................................................................ 49 
Iwpriv command without argument .................................................................... 49 
Iwpriv command with one INT argument............................................................ 50 
Iwpriv command with string argument ................................................................ 50 
7.5  WPS OID Sample Program ................................................................................................ 51 
8  Wi-Fi DIRECT (P2P) .................................................................................................................... 53 
8.1  Wi-Fi DIRECT iwpriv Command ......................................................................................... 53 
P2pOpMode ....................................................................................................... 53 
p2pEnable .......................................................................................................... 54 
p2pScan ............................................................................................................. 54 
8.1.1 
8.1.2 
8.1.3 
7.2.1 
7.2.2 
7.3.1 
7.3.2 
7.4.1 
7.4.2 
7.4.3 
MediaTek Confidential 
©  2012 - 2013 MediaTek Inc. 
Page 6 of 85 
This document contains information that is proprietary to MediaTek Inc. 
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited. 
 
8.1.4 
8.1.5 
8.1.6 
8.1.7 
8.1.8 
8.1.9 
8.1.10 
8.1.11 
8.1.12 
8.1.13 
8.1.14 
8.1.15 
8.1.16 
8.1.17 
8.1.18 
8.1.19 
p2pTable ............................................................................................................ 54 
p2pGoInt ............................................................................................................. 54 
p2pDevName ..................................................................................................... 54 
p2pWscMode ..................................................................................................... 54 
p2pWscConf ....................................................................................................... 55 
p2pLisCh ............................................................................................................ 55 
p2pOpCh ............................................................................................................ 55 
p2pLink ............................................................................................................... 55 
p2pInv ................................................................................................................. 55 
p2pProv .............................................................................................................. 56 
p2pCfg ................................................................................................................ 56 
p2pStat ............................................................................................................... 56 
p2pReset ............................................................................................................ 56 
p2pDefConfMthd ................................................................................................ 56 
p2pDevDisc ........................................................................................................ 56 
p2pLinkDown ...................................................................................................... 57 
8.2  P2P Example iwpriv command ........................................................................................... 57 
Configure WLAN driver as Autonomous GO ..................................................... 57 
Configure WLAN driver as Autonomous GO start WPS PBC ............................ 57 
Configure WLAN driver as autonomous GO start WPS PIN-Display ................ 58 
Configure WLAN driver as autonomous GO start WPS  PIN-KeyPad ............... 58 
Configure WLAN driver as P2P device start WPS PIN-Display ......................... 59 
Configure WLAN driver as P2P device start WPS PBC .................................... 59 
OID programming ....................................................................................................................... 61 
9.1  OID Set Data ...................................................................................................................... 61 
9.2  OID Get Data ...................................................................................................................... 61 
9.3  OID set Raw Data with flags ............................................................................................... 61 
9.4  OID Get Raw Data with Flags ............................................................................................ 66 
IOCTL Sample Code ................................................................................................................... 71 
10.1  Check connection status .................................................................................................... 71 
10.2  Polling WPS status ............................................................................................................. 73 
10.3  Site survey .......................................................................................................................... 74 
10.4  Display Rate and BW ......................................................................................................... 82 
11  SingleSKU Example file (New feature for MT76XX) ................................................................ 85 
8.2.1 
8.2.2 
8.2.3 
8.2.4 
8.2.5 
8.2.6 
9 
10 
 
MediaTek Confidential 
©  2012 - 2013 MediaTek Inc. 
Page 7 of 85 
This document contains information that is proprietary to MediaTek Inc. 
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited. 
 
1 
Introduction 
This  document  is  the  Software  programming  guide  for  Mediatek  Wi-Fi  STA  driver.  The  Software 
Programming  guide  covers  profile  setting,  command  list,  and  OID  examples  to  demonstrate  how  to 
programming the WLAN driver. 
 
MediaTek Confidential 
©  2012 - 2013 MediaTek Inc. 
Page 8 of 85 
This document contains information that is proprietary to MediaTek Inc. 
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited.