From 08e6bbacf25014f6bafa75ca322de2fa3dba145f Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 10 Jan 2017 14:10:19 -0800 Subject: [PATCH] supplicant(interface): Add interface for WPS Add the methods/callbacks required for WPS functionality through wpa_supplicant. Bug: 34198758 Test: Compiles Change-Id: Iff1450621a4b039307ad6098f98326c35e53d4c6 --- wifi/supplicant/1.0/ISupplicantP2pIface.hal | 53 ++++++++++++++++ wifi/supplicant/1.0/ISupplicantStaIface.hal | 60 +++++++++++++++++++ .../1.0/ISupplicantStaIfaceCallback.hal | 58 ++++++++++++++++++ 3 files changed, 171 insertions(+) diff --git a/wifi/supplicant/1.0/ISupplicantP2pIface.hal b/wifi/supplicant/1.0/ISupplicantP2pIface.hal index 35985fcb1d..ddf05cca51 100644 --- a/wifi/supplicant/1.0/ISupplicantP2pIface.hal +++ b/wifi/supplicant/1.0/ISupplicantP2pIface.hal @@ -537,4 +537,57 @@ interface ISupplicantP2pIface extends ISupplicantIface { */ setMiracastMode(MiracastMode mode) generates (SupplicantStatus status); + + /** + * Initiate WPS Push Button setup. + * The PBC operation requires that a button is also pressed at the + * AP/Registrar at about the same time (2 minute window). + * + * @param groupIfName Group interface name to use. + * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard. + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + startWpsPbc(string groupIfName, Bssid bssid) + generates (SupplicantStatus status); + + /** + * Initiate WPS Pin Keypad setup. + * + * @param groupIfName Group interface name to use. + * @param pin 8 digit pin to be used. + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + startWpsPinKeypad(string groupIfName, string pin) + generates (SupplicantStatus status); + + /** + * Initiate WPS Pin Display setup. + * + * @param groupIfName Group interface name to use. + * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard. + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + * @return generatedPin 8 digit pin generated. + */ + startWpsPinDisplay(string groupIfName, Bssid bssid) + generates (SupplicantStatus status, string generatedPin); + + /** + * Cancel any ongoing WPS operations. + * + * @param groupIfName Group interface name to use. + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + cancelWps(string groupIfName) generates (SupplicantStatus status); }; diff --git a/wifi/supplicant/1.0/ISupplicantStaIface.hal b/wifi/supplicant/1.0/ISupplicantStaIface.hal index 2fc4d0fe74..0f0d41bb6b 100644 --- a/wifi/supplicant/1.0/ISupplicantStaIface.hal +++ b/wifi/supplicant/1.0/ISupplicantStaIface.hal @@ -319,4 +319,64 @@ interface ISupplicantStaIface extends ISupplicantIface { */ setCountryCode(int8_t[2] code) generates (SupplicantStatus status); + + /** + * Initiate WPS setup in registrar role to learn the current AP configuration. + * + * @param bssid BSSID of the AP. + * @param pin Pin of the AP. + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + startWpsRegistrar(Bssid bssid, string pin) + generates (SupplicantStatus status); + + /** + * Initiate WPS Push Button setup. + * The PBC operation requires that a button is also pressed at the + * AP/Registrar at about the same time (2 minute window). + * + * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard. + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + startWpsPbc(Bssid bssid) generates (SupplicantStatus status); + + /** + * Initiate WPS Pin Keypad setup. + * + * @param pin 8 digit pin to be used. + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + startWpsPinKeypad(string pin) generates (SupplicantStatus status); + + /** + * Initiate WPS Pin Display setup. + * + * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard. + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + * @return generatedPin 8 digit pin generated. + */ + startWpsPinDisplay(Bssid bssid) + generates (SupplicantStatus status, string generatedPin); + + /** + * Cancel any ongoing WPS operations. + * + * @return status Status of the operation. + * Possible status codes: + * |SupplicantStatusCode.SUCCESS|, + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + cancelWps() generates (SupplicantStatus status); }; diff --git a/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal index 8a894a03ac..55ff9a84d6 100644 --- a/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal +++ b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal @@ -138,6 +138,43 @@ interface ISupplicantStaIfaceCallback { vec osuProvidersList; }; + /** + * WPS Configuration Error. + */ + enum WpsConfigError : uint16_t { + NO_ERROR = 0, + OOB_IFACE_READ_ERROR = 1, + DECRYPTION_CRC_FAILURE = 2, + CHAN_24_NOT_SUPPORTED = 3, + CHAN_50_NOT_SUPPORTED = 4, + SIGNAL_TOO_WEAK = 5, + NETWORK_AUTH_FAILURE = 6, + NETWORK_ASSOC_FAILURE = 7, + NO_DHCP_RESPONSE = 8, + FAILED_DHCP_CONFIG = 9, + IP_ADDR_CONFLICT = 10, + NO_CONN_TO_REGISTRAR = 11, + MULTIPLE_PBC_DETECTED = 12, + ROGUE_SUSPECTED = 13, + DEVICE_BUSY = 14, + SETUP_LOCKED = 15, + MSG_TIMEOUT = 16, + REG_SESS_TIMEOUT = 17, + DEV_PASSWORD_AUTH_FAILURE = 18, + CHAN_60G_NOT_SUPPORTED = 19, + PUBLIC_KEY_HASH_MISMATCH = 20 + }; + + /** + * Vendor specific Error Indication for WPS event messages. + */ + enum WpsErrorIndication : uint16_t { + NO_ERROR = 0, + SECURITY_TKIP_ONLY_PROHIBITED = 1, + SECURITY_WEP_PROHIBITED = 2, + AUTH_FAILURE = 3 + }; + /** * Used to indicate that a new network has been added. * @@ -242,4 +279,25 @@ interface ISupplicantStaIfaceCallback { * Refer to section 8.4.1.9 of IEEE 802.11 spec. */ oneway onAssociationRejected(Bssid bssid, uint32_t statusCode); + + /** + * Used to indicate the success of a WPS connection attempt. + */ + oneway onWpsEventSuccess(); + + /** + * Used to indicate the failure of a WPS connection attempt. + * + * @param bssid BSSID of the AP to which we initiated WPS + * connection. + * @param configError Configuration error code. + * @param errorInd Error indication code. + */ + oneway onWpsEventFail( + Bssid bssid, WpsConfigError configError, WpsErrorIndication errorInd); + + /** + * Used to indicate the overlap of a WPS PBC connection attempt. + */ + oneway onWpsEventPbcOverlap(); };