MT7986 Concurrent WPS AN 20211014 v1.0

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

CONFIDENTIAL C

Use
z.c al
tws enti
om
ng@ nfid
gyo Co
MT7986 Concurrent WPS AN

din Tek
2021/10/14
Nishank Aggarwal
ang edia
M

MediaTek Proprietary and


MediaTek Confidential.
Proprietary © 2021©MediaTek
and Confidential. Inc.
2021 MediaTek Inc.All
Allrights reserved.
rights reserved.
CONFIDENTIAL C
Use
Version History

z.c al
tws enti
om
Version Date Author (Optional) Description
0.1 2021-9-27 Nishank Aggarwal Initial draft

ng@ nfid
1.0 2021-10-14 Micheal Su Official release

gyo Co
din Tek
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 2
CONFIDENTIAL C
Use
Outline

z.c al
tws enti
om
 Feature Description

ng@ nfid
How to Configure – runtime command
 WPS Trigger Flow

gyo Co
din Tek
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 3
CONFIDENTIAL C
Use
z.c al
tws enti
om
ng@ nfid
Feature Description

gyo Co
din Tek
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 4
CONFIDENTIAL C
Use
WPS Architecture

z.c al
tws enti
om
A device with the authority to issue and

ng@ nfid
revoke access to a network; it may be
integrated into a wireless access
point (AP), or provided as a separate

gyo Co
device.

din Tek
A device seeking to join a An access point functioning
wireless network. ang edia as a proxy between a
registrar and an enrollee.
M

Internal/Standalone Registrar: Registrar & AP are integrated.


External Registrar (ER): AP and Registrar are separated.
MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 5
CONFIDENTIAL C
Use
Driver WSC File Description

z.c al
tws enti
• wsc.h – WSC Data Structure Definitions

om
• wsc_tlv.h – WSC Data Element Definitions

ng@ nfid
• wsc.c – WSC Function State Machine

gyo Co
• wsc_tlv.c – WSC Messages Build/Process
• wsc_v2.c – New API for WSC V2

din Tek
• wsc_ufd.c – Parse WSC data from USB Flash Drives (UFD)
• nfc.c – WSC Function for Near-Field Communication (NFC)
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 6
CONFIDENTIAL C
Use
WSC IE and EAP FORMAT

z.c al
tws enti
om
ng@ nfid
gyo Co
din Tek
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 7
CONFIDENTIAL C
Use
EAP-WSC Packet Format

z.c al
tws enti
om
802.1x Spec

ng@ nfid
0x00372a
0x00000001 (WFA Simple config)
254 : WIFI Protected setup

gyo Co
din Tek
ang edia
M

Code:
1:request, 2:Response, 3:success, 4:Fail
MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 8
CONFIDENTIAL C
Use
802.1x Authentication (EAP-WSC)

z.c al
tws enti
om
Byte 0 Byte 1 Byte 2 Byte 3
Protocol ver Packet type(EAP type) Body length

ng@ nfid
Code Identifier Length
Type Vender ID (0x00372A)

gyo Co
Vender type (0x1)

din Tek
OP-code Flag
Packet type: Code: Type: The Op-Code field is one of the following values:
• 0x01: WSC_Start
0: EAP-Packet 1: request
ang edia 254: wifi protected setup
1:EAPOL-Start 2:Response • 0x02: WSC_ACK
3:Success • 0x03: WSC_NACK
4:Fail • 0x04: WSC_MSG
M

• 0x05: WSC_Done
• 0x06: WSC_FRAG_ACK

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 9
CONFIDENTIAL C
Use
WSC Frame checklist (From AP view 1/2)

z.c al
tws enti
om
Frame name wsc.c, wsc_tlv.c
Beacon (WSC IE) (TX) WscBuildBeaconIE

ng@ nfid
Probe req (WSC IE)
Probe rsp (WSC IE)(TX) WscBuildProbeRespIE

gyo Co
Auth req

din Tek
Auth rsp
Assoc req (WSC IE) ang edia
Assoc rsp (WSC IE)(TX) WscBuildAssocRespIE
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 10
CONFIDENTIAL C
Use
WSC Frame checklist (From AP view 2/2)

z.c al
tws enti
om
Frame name wsc.c, wsc_tlv.c
EAPOL-START (RX) WscEAPOLStartAction

ng@ nfid
EAP-request-identity (TX) WscSendEapReqId
EAP-response-identity

gyo Co
EAP-Request (start,M2,M4,M6,M8) BuildMessageM2,BuildMessageM4,Build
MessageM6,BuildMessageM8

din Tek
EAP-response (M1, M3, M5,M7,Done) RX ProcessMessageM1, ProcessMessageM3,
ang edia ProcessMessageM5, ProcessMessageM7,
WscEapRegistrarAction
:WSC_MSG_WSC_DONE
M
EAP-FAIL WscSendEapFail
Deauth
MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 11
CONFIDENTIAL C
Use
WSC Frame checklist (From APCLI view)

z.c al
tws enti
om
Frame name comment
Beacon (WSC IE) WscBuildBeaconIE

ng@ nfid
Probe req (WSC IE)
Probe rsp (WSC IE) WscBuildProbeRespIE
Auth req

gyo Co
Auth rsp
Assoc req (WSC IE)

din Tek
Assoc rsp (WSC IE)
EAPOL-START
EAP-request-identity ang edia
EAP-response-identity
EAP-Request (start,M2,M4,M6,M8)
EAP-response (M1, M3, M5,M7,Done)
M

EAP-FAIL
Deauth

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 12
CONFIDENTIAL C
Use
MlmeInit

z.c al
tws enti
om
MlmeQueueInit

ng@ nfid
ApMlmeInit
ApCliMlmeInit APCLI_SUPPORT

gyo Co
WscStateMachineInit WSC_INCLUDED
WpaStateMachineInit

din Tek
RTMPInitTimer MlmePeriodicExecTimer, AsicRxAntEvalTimeout, APSDPeriodicExec,
APQuickResponeForRateUpExec,
RTMP_OS_TASK_INIT(pTask, ang edia /* Creat MLME Thread */
"RtmpMlmeTask", pAd); pTask = &pAd->mlmeTask;
RtmpOSTaskAttach (Attach kernel thread) •RtmpOSTaskAttach(pTask, MlmeThread, (ULONG)pTask);
•RtmpOSTaskAttach => __RtmpOSTaskAttach
M

Note: ps –ef can see all kthread


MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 13
CONFIDENTIAL C
Use
EAP-WSC RX PATH

z.c al
tws enti
• RX:

om
– WpsSmProcess

ng@ nfid
- StateMachinePerformAction (This will perform State machine transition function)
- The transition function was register by WscStateMachineInit

gyo Co
– WscEAPOLStartAction (EAPOL-Start)
– WscEAPAction (EAP_REQ / EAP_RSP / EAP_FAIL)

din Tek
- WscEapRegistrarAction
- WscEapApProxyAction
- WscEapEnrolleeAction ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 14
CONFIDENTIAL C
Use
EAP-WSC TX PATH

z.c al
tws enti
• TX:

om
– WscEapRegistrarAction (e.g. Receive M1 then build M2 or M2D)

ng@ nfid
– RTMPSendWirelessEvent (MSG_PATH)
- WscSendMessage

gyo Co
• MAKE_802_3_HEADER
• sizeof(EAP_FRAME) + sizeof(WSC_FRAME) + Len

– (After Received Eapol-start)WscEAPOLStartAction => WscSendEapReqId (Send Identity path)

din Tek
– RTMPToWirelessSta
- wdev->tx_pkt_ct_handle = FullOffloadFrameTx (register in wdev_init )
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 15
CONFIDENTIAL C
Use
z.c al
tws enti
om
ng@ nfid
How to Configure – runtime command

gyo Co
din Tek
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 16
CONFIDENTIAL C
Use
WPS command

z.c al
tws enti
• CLI: iwpriv ra0 set

om
Command Purpose Function

ng@ nfid
=5 Registrar Enrollee (CONPWS)
=4 Registrar(AP)
WscConfMode Set_AP_WscConfMode_Proc
=2 PROXY (AP)

gyo Co
=1 Enrollee (STA)
=1 (PIN)

din Tek
WscMode Set_AP_WscMode_Proc
=2 (PBC)
Set_AP_WscConfStatus_Proc
WscConfStatus =2 ang edia (0x1044 wifi simple configuration state AP must =2)
WscGetConf =1 Trigger WPS 2 mins timer
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 17
CONFIDENTIAL C
Use
Normal WPS (AP)

z.c al
tws enti
• AP PIN

om
– iwpriv ra0 set WscConfMode=4 //Registrar

ng@ nfid
– iwpriv ra0 set WscMode=1
– iwpriv ra0 set WscConfStatus=2

gyo Co
– iwpriv ra0 set WscPinCode=12044085
– iwpriv ra0 set WscGetConf=1

din Tek
• AP PBC
– iwpriv ra0 set WscConfMode=4 //Registrar
ang edia
– iwpriv ra0 set WscMode=2
– iwpriv ra0 set WscConfStatus=2
M

– iwpriv ra0 set WscGetConf=1

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 18
CONFIDENTIAL C
Use
Normal WPS (APCLI)

z.c al
tws enti
• ApCli PIN

om
– iwpriv apcli0 set ApCliEnable=1
– ifconfig apcli0 up

ng@ nfid
– brctl addif br0 apcli0
– iwpriv apcli0 set WscConfMode=1 //Enrollee

gyo Co
– iwpriv apcli0 set WscMode=1 //PIN method
– iwpriv apcli0 show WscPin
– iwpriv apcli0 set ApCliWscSsid=XXXXXXX

din Tek
– iwpriv apcli0 set WscGetConf=1 //Trigger

• ApCli PBC
– iwpriv apclii0 set ApCliEnable=1
– ifconfig apclii0 up
ang edia
– brctl addif br0 apclii0
– iwpriv apclii0 set WscConfMode=1 //Enrollee
M

– iwpriv apclii0 set WscMode=2 //PBC


– iwpriv apclii0 set WscGetConf=1 //Trigger

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 19
CONFIDENTIAL C
Use
iwpriv command - WscAutoTriggerDisable

z.c al
tws enti
• To disable AP Enrollee auto trigger capability

om
– iwpriv ra0 set WscAutoTriggerDisable=1

ng@ nfid
• To enable AP Enrollee auto trigger capability again
– iwpriv ra0 set WscAutoTriggerDisable=0

gyo Co
din Tek
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 20
CONFIDENTIAL C
Use
CONCURRENT WPS

z.c al
tws enti
• Quick set up Dual Band concurrent WPS

om
– ifconfig apcli0 up

ng@ nfid
– ifconfig apclii0 up
– iwpriv apcli0 set ApCliEnable=1

gyo Co
– iwpriv apclii0 set ApCliEnable=1
– iwpriv ra0 set ConWpsApcliPreferIface=1

din Tek
– iwpriv apcli0 set ConWpsApCliMode=0 //Enable the Auto selection CON_WPS
– //Push one button ang edia
– iwpriv ra0 set WscConfMode=5 //Trigger
– iwpriv rai0 set WscConfMode=5 //Trigger
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 21
CONFIDENTIAL C
Use
CONCURRENT WPS

z.c al
tws enti
• iwpriv apcli0 set ConWpsApCliMode=0

om
– 0: Auto Band Selection (probe req without wps IE)

ng@ nfid
– 1: 2G Band Preferred
– 2: 5G Band Preferred

gyo Co
• iwpriv ra0 set ConWpsApcliPreferIface=1 (Auto prefer 1)

din Tek
• iwpriv apcli0 set ConWpsApCliDisabled=0
– 0: means disabled (Default)

ang edia
1: means enabled the behavior as “Extender must not acts as Enrollee if it’s connected to an AP
already”
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 22
CONFIDENTIAL C
Use
z.c al
tws enti
om
ng@ nfid
WPS Trigger Flow

gyo Co
din Tek
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 23
CONFIDENTIAL C
Use
Normal WPS

z.c al
tws enti
om
1 2
WscPushPBCAction
Wsc2MinsTimer:120sec WscScanExec

ng@ nfid
(6)WscPBCTimerRunning:10sec 9
10 sec timeout
3

gyo Co
6 ApSiteSurvey
WscPBCTimeOutAction
WscPBCTimer: cancel Enqueue
4

din Tek
10
10 sec timeout
APMlmeScanReqAction
WscScanTimeOutAction ang edia
(10)WscPBCTimer:10sec
8
1 sec timeout 7 Unknow timeout
WscPBCExec
M
(10)WscScanTimer:1sec 5
APMlmeScanCompleteAction

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 24
CONFIDENTIAL C
Use
CONCURRENT WPS

z.c al
tws enti
om
1 2
WscPushPBCAction
WscScanExec

ng@ nfid
Wsc2MinsTimer:120sec
9
3

gyo Co
6 ApSiteSurvey
WscPBCTimeOutAction
WscPBCTimer: cancel Enqueue
4

din Tek
APMlmeScanReqAction

WscScanTimeOutAction
ang edia
8
1 sec timeout 7 Unknow timeout
WscPBCExec
M
(10)WscScanTimer:1sec 5
APMlmeScanCompleteAction
5 sec timeout (6)WscPBCTimerRunning:5 sec

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved. 25
Use
z.c al
tws enti
om
ng@ nfid
gyo Co
din Tek
MediaTek Proprietary and Confidential

© 2021 MediaTek Inc. All rights reserved. The term “MediaTek” refers to MediaTek Inc. and/or its affiliates.
ang edia
This document has been prepared solely for informational purposes. The content herein is made available to a restricted number of clients or partners, for internal
use, pursuant to a license agreement or any other applicable agreement and subject to this notice. THIS DOCUMENT AND ANY ORAL INFORMATION PROVIDED BY
MEDIATEK IN CONNECTION WITH THIS DOCUMENT (COLLECTIVELY THIS “DOCUMENT”), IF ANY, ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND,
WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE. MEDIATEK DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS OR GUARANTEE REGARDING THE
M
USE OR THE RESULT OF THE USE OF THIS DOCUMENT IN TERMS OF CORRECTNESS, ACCURACY, TIMELINESS, RELIABILITY, OR OTHERWISE. MEDIATEK SPECIFICALLY
DISCLAIMS ALL WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTIES ARISING OUT OF
COURSE OF PERFORMANCE, COURSE OF DEALING OR USAGE OF TRADE. This Document must be held in strict confidence and may not be communicated,
reproduced, distributed or disclosed to any third party or to any other person, or being referred to publicly, in whole or in part at any time except with MediaTek’s
prior written consent, which MediaTek reserves the right to deny for any reason. You agree to indemnify MediaTek for any loss or damages suffered by MediaTek
for your unauthorized use or disclosure of this Document, in whole or in part. If you are not the intended recipient of this document, please delete and destroy all
copies immediately.
CONFIDENTIAL C
Use
z.c al
tws enti
om
ng@ nfid
gyo Co
din Tek
ang edia
M

MediaTek Proprietary and Confidential. © 2021 MediaTek Inc. All rights reserved.

You might also like