Home | History | Annotate | Download | only in Protocol
      1 /** @file
      2   This file provides management service interfaces of 802.11 MAC layer. It is used by
      3   network applications (and drivers) to establish wireless connection with an access
      4   point (AP).
      5 
      6   Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
      7   This program and the accompanying materials
      8   are licensed and made available under the terms and conditions of the BSD License
      9   which accompanies this distribution. The full text of the license may be found at
     10   http://opensource.org/licenses/bsd-license.php
     11 
     12   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     13   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     14 
     15   @par Revision Reference:
     16   This Protocol is introduced in UEFI Specification 2.5
     17 
     18 **/
     19 
     20 #ifndef __EFI_WIFI_PROTOCOL_H__
     21 #define __EFI_WIFI_PROTOCOL_H__
     22 
     23 #include <Protocol/WiFi2.h>
     24 
     25 #define EFI_WIRELESS_MAC_CONNECTION_PROTOCOL_GUID \
     26   { \
     27     0xda55bc9, 0x45f8, 0x4bb4, {0x87, 0x19, 0x52, 0x24, 0xf1, 0x8a, 0x4d, 0x45 } \
     28   }
     29 
     30 typedef struct _EFI_WIRELESS_MAC_CONNECTION_PROTOCOL EFI_WIRELESS_MAC_CONNECTION_PROTOCOL;
     31 
     32 ///
     33 /// EFI_80211_ACC_NET_TYPE
     34 ///
     35 typedef enum {
     36   IeeePrivate           = 0,
     37   IeeePrivatewithGuest  = 1,
     38   IeeeChargeablePublic  = 2,
     39   IeeeFreePublic        = 3,
     40   IeeePersonal          = 4,
     41   IeeeEmergencyServOnly = 5,
     42   IeeeTestOrExp         = 14,
     43   IeeeWildcard          = 15
     44 } EFI_80211_ACC_NET_TYPE;
     45 
     46 ///
     47 /// EFI_80211_ASSOCIATE_RESULT_CODE
     48 ///
     49 typedef enum {
     50   AssociateSuccess,
     51   AssociateRefusedReasonUnspecified,
     52   AssociateRefusedCapsMismatch,
     53   AssociateRefusedExtReason,
     54   AssociateRefusedAPOutOfMemory,
     55   AssociateRefusedBasicRatesMismatch,
     56   AssociateRejectedEmergencyServicesNotSupported,
     57   AssociateRefusedTemporarily
     58 } EFI_80211_ASSOCIATE_RESULT_CODE;
     59 
     60 ///
     61 /// EFI_80211_SCAN_RESULT_CODE
     62 ///
     63 typedef enum {
     64   ///
     65   /// The scan operation finished successfully.
     66   ///
     67   ScanSuccess,
     68   ///
     69   /// The scan operation is not supported in current implementation.
     70   ///
     71   ScanNotSupported
     72 } EFI_80211_SCAN_RESULT_CODE;
     73 
     74 ///
     75 /// EFI_80211_REASON_CODE
     76 ///
     77 typedef enum {
     78   Ieee80211UnspecifiedReason           = 1,
     79   Ieee80211PreviousAuthenticateInvalid = 2,
     80   Ieee80211DeauthenticatedSinceLeaving = 3,
     81   Ieee80211DisassociatedDueToInactive  = 4,
     82   Ieee80211DisassociatedSinceApUnable  = 5,
     83   Ieee80211Class2FrameNonauthenticated = 6,
     84   Ieee80211Class3FrameNonassociated    = 7,
     85   Ieee80211DisassociatedSinceLeaving   = 8,
     86   // ...
     87 } EFI_80211_REASON_CODE;
     88 
     89 ///
     90 /// EFI_80211_DISASSOCIATE_RESULT_CODE
     91 ///
     92 typedef enum {
     93   ///
     94   /// Disassociation process completed successfully.
     95   ///
     96   DisassociateSuccess,
     97   ///
     98   /// Disassociation failed due to any input parameter is invalid.
     99   ///
    100   DisassociateInvalidParameters
    101 } EFI_80211_DISASSOCIATE_RESULT_CODE;
    102 
    103 ///
    104 /// EFI_80211_AUTHENTICATION_TYPE
    105 ///
    106 typedef enum {
    107   ///
    108   /// Open system authentication, admits any STA to the DS.
    109   ///
    110   OpenSystem,
    111   ///
    112   /// Shared Key authentication relies on WEP to demonstrate knowledge of a WEP
    113   /// encryption key.
    114   ///
    115   SharedKey,
    116   ///
    117   /// FT authentication relies on keys derived during the initial mobility domain
    118   /// association to authenticate the stations.
    119   ///
    120   FastBSSTransition,
    121   ///
    122   /// SAE authentication uses finite field cryptography to prove knowledge of a shared
    123   /// password.
    124   ///
    125   SAE
    126 } EFI_80211_AUTHENTICATION_TYPE;
    127 
    128 ///
    129 /// EFI_80211_AUTHENTICATION_RESULT_CODE
    130 ///
    131 typedef enum {
    132   AuthenticateSuccess,
    133   AuthenticateRefused,
    134   AuthenticateAnticLoggingTokenRequired,
    135   AuthenticateFiniteCyclicGroupNotSupported,
    136   AuthenticationRejected,
    137   AuthenticateInvalidParameter
    138 } EFI_80211_AUTHENTICATE_RESULT_CODE;
    139 
    140 ///
    141 /// EFI_80211_ELEMENT_HEADER
    142 ///
    143 typedef struct {
    144   ///
    145   /// A unique element ID defined in IEEE 802.11 specification.
    146   ///
    147   UINT8                              ElementID;
    148   ///
    149   /// Specifies the number of octets in the element body.
    150   ///
    151   UINT8                              Length;
    152 } EFI_80211_ELEMENT_HEADER;
    153 
    154 ///
    155 /// EFI_80211_ELEMENT_REQ
    156 ///
    157 typedef struct {
    158   ///
    159   /// Common header of an element.
    160   ///
    161   EFI_80211_ELEMENT_HEADER           Hdr;
    162   ///
    163   /// Start of elements that are requested to be included in the Probe Response frame.
    164   /// The elements are listed in order of increasing element ID.
    165   ///
    166   UINT8                              RequestIDs[1];
    167 } EFI_80211_ELEMENT_REQ;
    168 
    169 ///
    170 /// EFI_80211_ELEMENT_SSID
    171 ///
    172 typedef struct {
    173   ///
    174   /// Common header of an element.
    175   ///
    176   EFI_80211_ELEMENT_HEADER           Hdr;
    177   ///
    178   /// Service set identifier. If Hdr.Length is zero, this field is ignored.
    179   ///
    180   UINT8                              SSId[32];
    181 } EFI_80211_ELEMENT_SSID;
    182 
    183 ///
    184 /// EFI_80211_SCAN_DATA
    185 ///
    186 typedef struct {
    187   ///
    188   /// Determines whether infrastructure BSS, IBSS, MBSS, or all, are included in the
    189   /// scan.
    190   ///
    191   EFI_80211_BSS_TYPE                 BSSType;
    192   ///
    193   /// Indicates a specific or wildcard BSSID. Use all binary 1s to represent all SSIDs.
    194   ///
    195   EFI_80211_MAC_ADDRESS              BSSId;
    196   ///
    197   /// Length in bytes of the SSId. If zero, ignore SSId field.
    198   ///
    199   UINT8                              SSIdLen;
    200   ///
    201   /// Specifies the desired SSID or the wildcard SSID. Use NULL to represent all SSIDs.
    202   ///
    203   UINT8                              *SSId;
    204   ///
    205   /// Indicates passive scanning if TRUE.
    206   ///
    207   BOOLEAN                            PassiveMode;
    208   ///
    209   /// The delay in microseconds to be used prior to transmitting a Probe frame during
    210   /// active scanning. If zero, the value can be overridden by an
    211   /// implementation-dependent default value.
    212   ///
    213   UINT32                             ProbeDelay;
    214   ///
    215   /// Specifies a list of channels that are examined when scanning for a BSS. If set to
    216   /// NULL, all valid channels will be scanned.
    217   ///
    218   UINT32                             *ChannelList;
    219   ///
    220   /// Indicates the minimum time in TU to spend on each channel when scanning. If zero,
    221   /// the value can be overridden by an implementation-dependent default value.
    222   ///
    223   UINT32                             MinChannelTime;
    224   ///
    225   /// Indicates the maximum time in TU to spend on each channel when scanning. If zero,
    226   /// the value can be overridden by an implementation-dependent default value.
    227   ///
    228   UINT32                             MaxChannelTime;
    229   ///
    230   /// Points to an optionally present element. This is an optional parameter and may be
    231   /// NULL.
    232   ///
    233   EFI_80211_ELEMENT_REQ              *RequestInformation;
    234   ///
    235   /// Indicates one or more SSID elements that are optionally present. This is an
    236   /// optional parameter and may be NULL.
    237   ///
    238   EFI_80211_ELEMENT_SSID             *SSIDList;
    239   ///
    240   /// Specifies a desired specific access network type or the wildcard access network
    241   /// type. Use 15 as wildcard access network type.
    242   ///
    243   EFI_80211_ACC_NET_TYPE             AccessNetworkType;
    244   ///
    245   ///  Specifies zero or more elements. This is an optional parameter and may be NULL.
    246   ///
    247   UINT8                              *VendorSpecificInfo;
    248 } EFI_80211_SCAN_DATA;
    249 
    250 ///
    251 /// EFI_80211_COUNTRY_TRIPLET_SUBBAND
    252 ///
    253 typedef struct {
    254   ///
    255   /// Indicates the lowest channel number in the subband. It has a positive integer
    256   /// value less than 201.
    257   ///
    258   UINT8                              FirstChannelNum;
    259   ///
    260   /// Indicates the number of channels in the subband.
    261   ///
    262   UINT8                              NumOfChannels;
    263   ///
    264   /// Indicates the maximum power in dBm allowed to be transmitted.
    265   ///
    266   UINT8                              MaxTxPowerLevel;
    267 } EFI_80211_COUNTRY_TRIPLET_SUBBAND;
    268 
    269 ///
    270 /// EFI_80211_COUNTRY_TRIPLET_OPERATE
    271 ///
    272 typedef struct {
    273   ///
    274   /// Indicates the operating extension identifier. It has a positive integer value of
    275   /// 201 or greater.
    276   ///
    277   UINT8                              OperatingExtId;
    278   ///
    279   /// Index into a set of values for radio equipment set of rules.
    280   ///
    281   UINT8                              OperatingClass;
    282   ///
    283   /// Specifies aAirPropagationTime characteristics used in BSS operation. Refer the
    284   /// definition of aAirPropagationTime in IEEE 802.11 specification.
    285   ///
    286   UINT8                              CoverageClass;
    287 } EFI_80211_COUNTRY_TRIPLET_OPERATE;
    288 
    289 ///
    290 /// EFI_80211_COUNTRY_TRIPLET
    291 ///
    292 typedef union {
    293   ///
    294   /// The subband triplet.
    295   ///
    296   EFI_80211_COUNTRY_TRIPLET_SUBBAND  Subband;
    297   ///
    298   /// The operating triplet.
    299   ///
    300   EFI_80211_COUNTRY_TRIPLET_OPERATE  Operating;
    301 } EFI_80211_COUNTRY_TRIPLET;
    302 
    303 ///
    304 /// EFI_80211_ELEMENT_COUNTRY
    305 ///
    306 typedef struct {
    307   ///
    308   /// Common header of an element.
    309   ///
    310   EFI_80211_ELEMENT_HEADER           Hdr;
    311   ///
    312   /// Specifies country strings in 3 octets.
    313   ///
    314   UINT8                              CountryStr[3];
    315   ///
    316   /// Indicates a triplet that repeated in country element. The number of triplets is
    317   /// determined by the Hdr.Length field.
    318   ///
    319   EFI_80211_COUNTRY_TRIPLET          CountryTriplet[1];
    320 } EFI_80211_ELEMENT_COUNTRY;
    321 
    322 ///
    323 /// EFI_80211_ELEMENT_DATA_RSN
    324 ///
    325 typedef struct {
    326   ///
    327   /// Indicates the version number of the RSNA protocol. Value 1 is defined in current
    328   /// IEEE 802.11 specification.
    329   ///
    330   UINT16                             Version;
    331   ///
    332   /// Specifies the cipher suite selector used by the BSS to protect group address frames.
    333   ///
    334   UINT32                             GroupDataCipherSuite;
    335   ///
    336   /// Indicates the number of pairwise cipher suite selectors that are contained in
    337   /// PairwiseCipherSuiteList.
    338   ///
    339 //UINT16                             PairwiseCipherSuiteCount;
    340   ///
    341   /// Contains a series of cipher suite selectors that indicate the pairwise cipher
    342   /// suites contained in this element.
    343   ///
    344 //UINT32                             PairwiseCipherSuiteList[PairwiseCipherSuiteCount];
    345   ///
    346   /// Indicates the number of AKM suite selectors that are contained in AKMSuiteList.
    347   ///
    348 //UINT16                             AKMSuiteCount;
    349   ///
    350   /// Contains a series of AKM suite selectors that indicate the AKM suites contained in
    351   /// this element.
    352   ///
    353 //UINT32                             AKMSuiteList[AKMSuiteCount];
    354   ///
    355   /// Indicates requested or advertised capabilities.
    356   ///
    357 //UINT16                             RSNCapabilities;
    358   ///
    359   /// Indicates the number of PKMIDs in the PMKIDList.
    360   ///
    361 //UINT16                             PMKIDCount;
    362   ///
    363   /// Contains zero or more PKMIDs that the STA believes to be valid for the destination
    364   /// AP.
    365 //UINT8                              PMKIDList[PMKIDCount][16];
    366   ///
    367   /// Specifies the cipher suite selector used by the BSS to protect group addressed
    368   /// robust management frames.
    369   ///
    370 //UINT32                             GroupManagementCipherSuite;
    371 } EFI_80211_ELEMENT_DATA_RSN;
    372 
    373 ///
    374 /// EFI_80211_ELEMENT_RSN
    375 ///
    376 typedef struct {
    377   ///
    378   /// Common header of an element.
    379   ///
    380   EFI_80211_ELEMENT_HEADER           Hdr;
    381   ///
    382   /// Points to RSN element. The size of a RSN element is limited to 255 octets.
    383   ///
    384   EFI_80211_ELEMENT_DATA_RSN         *Data;
    385 } EFI_80211_ELEMENT_RSN;
    386 
    387 ///
    388 /// EFI_80211_ELEMENT_EXT_CAP
    389 ///
    390 typedef struct {
    391   ///
    392   /// Common header of an element.
    393   ///
    394   EFI_80211_ELEMENT_HEADER           Hdr;
    395   ///
    396   /// Indicates the capabilities being advertised by the STA transmitting the element.
    397   /// This is a bit field with variable length. Refer to IEEE 802.11 specification for
    398   /// bit value.
    399   ///
    400   UINT8                              Capabilities[1];
    401 } EFI_80211_ELEMENT_EXT_CAP;
    402 
    403 ///
    404 /// EFI_80211_BSS_DESCRIPTION
    405 ///
    406 typedef struct {
    407   ///
    408   /// Indicates a specific BSSID of the found BSS.
    409   ///
    410   EFI_80211_MAC_ADDRESS              BSSId;
    411   ///
    412   /// Specifies the SSID of the found BSS. If NULL, ignore SSIdLen field.
    413   ///
    414   UINT8                              *SSId;
    415   ///
    416   /// Specifies the SSID of the found BSS. If NULL, ignore SSIdLen field.
    417   ///
    418   UINT8                              SSIdLen;
    419   ///
    420   /// Specifies the type of the found BSS.
    421   ///
    422   EFI_80211_BSS_TYPE                 BSSType;
    423   ///
    424   /// The beacon period in TU of the found BSS.
    425   ///
    426   UINT16                             BeaconPeriod;
    427   ///
    428   /// The timestamp of the received frame from the found BSS.
    429   ///
    430   UINT64                             Timestamp;
    431   ///
    432   /// The advertised capabilities of the BSS.
    433   ///
    434   UINT16                             CapabilityInfo;
    435   ///
    436   /// The set of data rates that shall be supported by all STAs that desire to join this
    437   /// BSS.
    438   ///
    439   UINT8                              *BSSBasicRateSet;
    440   ///
    441   /// The set of data rates that the peer STA desires to use for communication within
    442   /// the BSS.
    443   ///
    444   UINT8                              *OperationalRateSet;
    445   ///
    446   /// The information required to identify the regulatory domain in which the peer STA
    447   /// is located.
    448   ///
    449   EFI_80211_ELEMENT_COUNTRY          *Country;
    450   ///
    451   /// The cipher suites and AKM suites supported in the BSS.
    452   ///
    453   EFI_80211_ELEMENT_RSN              RSN;
    454   ///
    455   /// Specifies the RSSI of the received frame.
    456   ///
    457   UINT8                              RSSI;
    458   ///
    459   /// Specifies the RCPI of the received frame.
    460   ///
    461   UINT8                              RCPIMeasurement;
    462   ///
    463   /// Specifies the RSNI of the received frame.
    464   ///
    465   UINT8                              RSNIMeasurement;
    466   ///
    467   /// Specifies the elements requested by the request element of the Probe Request frame.
    468   /// This is an optional parameter and may be NULL.
    469   ///
    470   UINT8                              *RequestedElements;
    471   ///
    472   /// Specifies the BSS membership selectors that represent the set of features that
    473   /// shall be supported by all STAs to join this BSS.
    474   ///
    475   UINT8                              *BSSMembershipSelectorSet;
    476   ///
    477   /// Specifies the parameters within the Extended Capabilities element that are
    478   /// supported by the MAC entity. This is an optional parameter and may be NULL.
    479   ///
    480   EFI_80211_ELEMENT_EXT_CAP          *ExtCapElement;
    481 } EFI_80211_BSS_DESCRIPTION;
    482 
    483 ///
    484 /// EFI_80211_SUBELEMENT_INFO
    485 ///
    486 typedef struct {
    487   ///
    488   /// Indicates the unique identifier within the containing element or sub-element.
    489   ///
    490   UINT8                              SubElementID;
    491   ///
    492   /// Specifies the number of octets in the Data field.
    493   ///
    494   UINT8                              Length;
    495   ///
    496   /// A variable length data buffer.
    497   ///
    498   UINT8                              Data[1];
    499 } EFI_80211_SUBELEMENT_INFO;
    500 
    501 ///
    502 /// EFI_80211_MULTIPLE_BSSID
    503 ///
    504 typedef struct {
    505   ///
    506   /// Common header of an element.
    507   ///
    508   EFI_80211_ELEMENT_HEADER           Hdr;
    509   ///
    510   /// Indicates the maximum number of BSSIDs in the multiple BSSID set. When Indicator
    511   /// is set to n, 2n is the maximum number.
    512   ///
    513   UINT8                              Indicator;
    514   ///
    515   /// Contains zero or more sub-elements.
    516   ///
    517   EFI_80211_SUBELEMENT_INFO          SubElement[1];
    518 } EFI_80211_MULTIPLE_BSSID;
    519 
    520 ///
    521 /// EFI_80211_BSS_DESP_PILOT
    522 ///
    523 typedef struct {
    524   ///
    525   /// Indicates a specific BSSID of the found BSS.
    526   ///
    527   EFI_80211_MAC_ADDRESS              BSSId;
    528   ///
    529   /// Specifies the type of the found BSS.
    530   ///
    531   EFI_80211_BSS_TYPE                 BSSType;
    532   ///
    533   /// One octet field to report condensed capability information.
    534   ///
    535   UINT8                              ConCapInfo;
    536   ///
    537   /// Two octet's field to report condensed country string.
    538   ///
    539   UINT8                              ConCountryStr[2];
    540   ///
    541   /// Indicates the operating class value for the operating channel.
    542   ///
    543   UINT8                              OperatingClass;
    544   ///
    545   /// Indicates the operating channel.
    546   ///
    547   UINT8                              Channel;
    548   ///
    549   /// Indicates the measurement pilot interval in TU.
    550   ///
    551   UINT8                              Interval;
    552   ///
    553   /// Indicates that the BSS is within a multiple BSSID set.
    554   ///
    555   EFI_80211_MULTIPLE_BSSID           *MultipleBSSID;
    556   ///
    557   /// Specifies the RCPI of the received frame.
    558   ///
    559   UINT8                              RCPIMeasurement;
    560   ///
    561   /// Specifies the RSNI of the received frame.
    562   ///
    563   UINT8                              RSNIMeasurement;
    564 } EFI_80211_BSS_DESP_PILOT;
    565 
    566 ///
    567 /// EFI_80211_SCAN_RESULT
    568 ///
    569 typedef struct {
    570   ///
    571   /// The number of EFI_80211_BSS_DESCRIPTION in BSSDespSet. If zero, BSSDespSet should
    572   /// be ignored.
    573   ///
    574   UINTN                              NumOfBSSDesp;
    575   ///
    576   /// Points to zero or more instances of EFI_80211_BSS_DESCRIPTION.
    577   ///
    578   EFI_80211_BSS_DESCRIPTION          **BSSDespSet;
    579   ///
    580   /// The number of EFI_80211_BSS_DESP_PILOT in BSSDespFromPilotSet. If zero,
    581   /// BSSDespFromPilotSet should be ignored.
    582   ///
    583   UINTN                              NumofBSSDespFromPilot;
    584   ///
    585   /// Points to zero or more instances of EFI_80211_BSS_DESP_PILOT.
    586   ///
    587   EFI_80211_BSS_DESP_PILOT           **BSSDespFromPilotSet;
    588   ///
    589   /// Specifies zero or more elements. This is an optional parameter and may be NULL.
    590   ///
    591   UINT8                              *VendorSpecificInfo;
    592 } EFI_80211_SCAN_RESULT;
    593 
    594 ///
    595 /// EFI_80211_SCAN_DATA_TOKEN
    596 ///
    597 typedef struct {
    598   ///
    599   /// This Event will be signaled after the Status field is updated by the EFI Wireless
    600   /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
    601   ///
    602   EFI_EVENT                          Event;
    603   ///
    604   /// Will be set to one of the following values:
    605   ///   EFI_SUCCESS:       Scan operation completed successfully.
    606   ///   EFI_NOT_FOUND:     Failed to find available BSS.
    607   ///   EFI_DEVICE_ERROR:  An unexpected network or system error occurred.
    608   ///   EFI_ACCESS_DENIED: The scan operation is not completed due to some underlying
    609   ///                      hardware or software state.
    610   ///   EFI_NOT_READY:     The scan operation is started but not yet completed.
    611   EFI_STATUS                         Status;
    612   ///
    613   /// Pointer to the scan data.
    614   ///
    615   EFI_80211_SCAN_DATA                *Data;
    616   ///
    617   /// Indicates the scan state.
    618   ///
    619   EFI_80211_SCAN_RESULT_CODE         ResultCode;
    620   ///
    621   /// Indicates the scan result. It is caller's responsibility to free this buffer.
    622   ///
    623   EFI_80211_SCAN_RESULT              *Result;
    624 } EFI_80211_SCAN_DATA_TOKEN;
    625 
    626 ///
    627 /// EFI_80211_ELEMENT_SUPP_CHANNEL_TUPLE
    628 ///
    629 typedef struct {
    630   ///
    631   /// The first channel number in a subband of supported channels.
    632   ///
    633   UINT8                              FirstChannelNumber;
    634   ///
    635   /// The number of channels in a subband of supported channels.
    636   ///
    637   UINT8                              NumberOfChannels;
    638 } EFI_80211_ELEMENT_SUPP_CHANNEL_TUPLE;
    639 
    640 ///
    641 /// EFI_80211_ELEMENT_SUPP_CHANNEL
    642 ///
    643 typedef struct {
    644   ///
    645   /// Common header of an element.
    646   ///
    647   EFI_80211_ELEMENT_HEADER                Hdr;
    648   ///
    649   /// Indicates one or more tuples of (first channel, number of channels).
    650   ///
    651   EFI_80211_ELEMENT_SUPP_CHANNEL_TUPLE    Subband[1];
    652 } EFI_80211_ELEMENT_SUPP_CHANNEL;
    653 
    654 ///
    655 /// EFI_80211_ASSOCIATE_DATA
    656 ///
    657 typedef struct {
    658   ///
    659   /// Specifies the address of the peer MAC entity to associate with.
    660   ///
    661   EFI_80211_MAC_ADDRESS              BSSId;
    662   ///
    663   /// Specifies the requested operational capabilities to the AP in 2 octets.
    664   ///
    665   UINT16                             CapabilityInfo;
    666   ///
    667   /// Specifies a time limit in TU, after which the associate procedure is terminated.
    668   ///
    669   UINT32                             FailureTimeout;
    670   ///
    671   /// Specifies if in power save mode, how often the STA awakes and listens for the next
    672   /// beacon frame in TU.
    673   ///
    674   UINT32                             ListenInterval;
    675   ///
    676   /// Indicates a list of channels in which the STA is capable of operating.
    677   ///
    678   EFI_80211_ELEMENT_SUPP_CHANNEL     *Channels;
    679   ///
    680   /// The cipher suites and AKM suites selected by the STA.
    681   ///
    682   EFI_80211_ELEMENT_RSN              RSN;
    683   ///
    684   /// Specifies the parameters within the Extended Capabilities element that are
    685   /// supported by the MAC entity.  This is an optional parameter and may be NULL.
    686   ///
    687   EFI_80211_ELEMENT_EXT_CAP          *ExtCapElement;
    688   ///
    689   /// Specifies zero or more elements. This is an optional parameter and may be NULL.
    690   ///
    691   UINT8                              *VendorSpecificInfo;
    692 } EFI_80211_ASSOCIATE_DATA;
    693 
    694 ///
    695 /// EFI_80211_ELEMENT_TIMEOUT_VAL
    696 ///
    697 typedef struct {
    698   ///
    699   /// Common header of an element.
    700   ///
    701   EFI_80211_ELEMENT_HEADER           Hdr;
    702   ///
    703   /// Specifies the timeout interval type.
    704   ///
    705   UINT8                              Type;
    706   ///
    707   /// Specifies the timeout interval value.
    708   ///
    709   UINT32                             Value;
    710 } EFI_80211_ELEMENT_TIMEOUT_VAL;
    711 
    712 ///
    713 /// EFI_80211_ASSOCIATE_RESULT
    714 ///
    715 typedef struct {
    716   ///
    717   /// Specifies the address of the peer MAC entity from which the association request
    718   /// was received.
    719   ///
    720   EFI_80211_MAC_ADDRESS              BSSId;
    721   ///
    722   /// Specifies the operational capabilities advertised by the AP.
    723   ///
    724   UINT16                             CapabilityInfo;
    725   ///
    726   /// Specifies the association ID value assigned by the AP.
    727   ///
    728   UINT16                             AssociationID;
    729   ///
    730   /// Indicates the measured RCPI of the corresponding association request frame. It is
    731   /// an optional parameter and is set to zero if unavailable.
    732   ///
    733   UINT8                              RCPIValue;
    734   ///
    735   /// Indicates the measured RSNI at the time the corresponding association request
    736   /// frame was received. It is an optional parameter and is set to zero if unavailable.
    737   ///
    738   UINT8                              RSNIValue;
    739   ///
    740   /// Specifies the parameters within the Extended Capabilities element that are
    741   /// supported by the MAC entity.  This is an optional parameter and may be NULL.
    742   ///
    743   EFI_80211_ELEMENT_EXT_CAP          *ExtCapElement;
    744   ///
    745   /// Specifies the timeout interval when the result code is AssociateRefusedTemporarily.
    746   ///
    747   EFI_80211_ELEMENT_TIMEOUT_VAL      TimeoutInterval;
    748   ///
    749   /// Specifies zero or more elements. This is an optional parameter and may be NULL.
    750   ///
    751   UINT8                              *VendorSpecificInfo;
    752 } EFI_80211_ASSOCIATE_RESULT;
    753 
    754 ///
    755 /// EFI_80211_ASSOCIATE_DATA_TOKEN
    756 ///
    757 typedef struct {
    758   ///
    759   /// This Event will be signaled after the Status field is updated by the EFI Wireless
    760   /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
    761   ///
    762   EFI_EVENT                          Event;
    763   ///
    764   /// Will be set to one of the following values:
    765   ///   EFI_SUCCESS:      Association operation completed successfully.
    766   ///   EFI_DEVICE_ERROR: An unexpected network or system error occurred.
    767   ///
    768   EFI_STATUS                         Status;
    769   ///
    770   /// Pointer to the association data.
    771   ///
    772   EFI_80211_ASSOCIATE_DATA           *Data;
    773   ///
    774   /// Indicates the association state.
    775   ///
    776   EFI_80211_ASSOCIATE_RESULT_CODE    ResultCode;
    777   ///
    778   /// Indicates the association result. It is caller's responsibility to free this
    779   /// buffer.
    780   ///
    781   EFI_80211_ASSOCIATE_RESULT         *Result;
    782 } EFI_80211_ASSOCIATE_DATA_TOKEN;
    783 
    784 ///
    785 /// EFI_80211_DISASSOCIATE_DATA
    786 ///
    787 typedef struct {
    788   ///
    789   /// Specifies the address of the peer MAC entity with which to perform the
    790   /// disassociation process.
    791   ///
    792   EFI_80211_MAC_ADDRESS              BSSId;
    793   ///
    794   /// Specifies the reason for initiating the disassociation process.
    795   ///
    796   EFI_80211_REASON_CODE              ReasonCode;
    797   ///
    798   /// Zero or more elements, may be NULL.
    799   ///
    800   UINT8                              *VendorSpecificInfo;
    801 } EFI_80211_DISASSOCIATE_DATA;
    802 
    803 ///
    804 /// EFI_80211_DISASSOCIATE_DATA_TOKEN
    805 ///
    806 typedef struct {
    807   ///
    808   /// This Event will be signaled after the Status field is updated by the EFI Wireless
    809   /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
    810   ///
    811   EFI_EVENT                          Event;
    812   ///
    813   /// Will be set to one of the following values:
    814   ///   EFI_SUCCESS:       Disassociation operation completed successfully.
    815   ///   EFI_DEVICE_ERROR:  An unexpected network or system error occurred.
    816   ///   EFI_ACCESS_DENIED: The disassociation operation is not completed due to some
    817   ///                      underlying hardware or software state.
    818   ///   EFI_NOT_READY:     The disassociation operation is started but not yet completed.
    819   ///
    820   EFI_STATUS                         Status;
    821   ///
    822   /// Pointer to the disassociation data.
    823   ///
    824   EFI_80211_DISASSOCIATE_DATA        *Data;
    825   ///
    826   /// Indicates the disassociation state.
    827   ///
    828   EFI_80211_DISASSOCIATE_RESULT_CODE ResultCode;
    829 } EFI_80211_DISASSOCIATE_DATA_TOKEN;
    830 
    831 ///
    832 /// EFI_80211_AUTHENTICATION_DATA
    833 ///
    834 typedef struct {
    835   ///
    836   /// Specifies the address of the peer MAC entity with which to perform the
    837   /// authentication process.
    838   ///
    839   EFI_80211_MAC_ADDRESS              BSSId;
    840   ///
    841   /// Specifies the type of authentication algorithm to use during the authentication
    842   /// process.
    843   ///
    844   EFI_80211_AUTHENTICATION_TYPE      AuthType;
    845   ///
    846   /// Specifies a time limit in TU after which the authentication procedure is
    847   /// terminated.
    848   ///
    849   UINT32                             FailureTimeout;
    850   ///
    851   /// Specifies the set of elements to be included in the first message of the FT
    852   /// authentication sequence, may be NULL.
    853   ///
    854   UINT8                              *FTContent;
    855   ///
    856   /// Specifies the set of elements to be included in the SAE Commit Message or SAE
    857   /// Confirm Message, may be NULL.
    858   ///
    859   UINT8                              *SAEContent;
    860   ///
    861   /// Zero or more elements, may be NULL.
    862   ///
    863   UINT8                              *VendorSpecificInfo;
    864 } EFI_80211_AUTHENTICATE_DATA;
    865 
    866 ///
    867 /// EFI_80211_AUTHENTICATION_RESULT
    868 ///
    869 typedef struct {
    870   ///
    871   /// Specifies the address of the peer MAC entity from which the authentication request
    872   /// was received.
    873   ///
    874   EFI_80211_MAC_ADDRESS              BSSId;
    875   ///
    876   /// Specifies the set of elements to be included in the second message of the FT
    877   /// authentication sequence, may be NULL.
    878   ///
    879   UINT8                              *FTContent;
    880   ///
    881   /// Specifies the set of elements to be included in the SAE Commit Message or SAE
    882   /// Confirm Message, may be NULL.
    883   ///
    884   UINT8                              *SAEContent;
    885   ///
    886   /// Zero or more elements, may be NULL.
    887   ///
    888   UINT8                              *VendorSpecificInfo;
    889 } EFI_80211_AUTHENTICATE_RESULT;
    890 
    891 ///
    892 /// EFI_80211_AUTHENTICATE_DATA_TOKEN
    893 ///
    894 typedef struct {
    895   ///
    896   /// This Event will be signaled after the Status field is updated by the EFI Wireless
    897   /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
    898   ///
    899   EFI_EVENT                          Event;
    900   ///
    901   /// Will be set to one of the following values:
    902   ///   EFI_SUCCESS: Authentication operation completed successfully.
    903   ///   EFI_PROTOCOL_ERROR: Peer MAC entity rejects the authentication.
    904   ///   EFI_NO_RESPONSE:    Peer MAC entity does not response the authentication request.
    905   ///   EFI_DEVICE_ERROR:   An unexpected network or system error occurred.
    906   ///   EFI_ACCESS_DENIED:  The authentication operation is not completed due to some
    907   ///                       underlying hardware or software state.
    908   ///   EFI_NOT_READY:      The authentication operation is started but not yet completed.
    909   ///
    910   EFI_STATUS                         Status;
    911   ///
    912   /// Pointer to the authentication data.
    913   ///
    914   EFI_80211_AUTHENTICATE_DATA        *Data;
    915   ///
    916   /// Indicates the association state.
    917   ///
    918   EFI_80211_AUTHENTICATE_RESULT_CODE ResultCode;
    919   ///
    920   /// Indicates the association result. It is caller's responsibility to free this
    921   /// buffer.
    922   ///
    923   EFI_80211_AUTHENTICATE_RESULT      *Result;
    924 } EFI_80211_AUTHENTICATE_DATA_TOKEN;
    925 
    926 ///
    927 /// EFI_80211_DEAUTHENTICATE_DATA
    928 ///
    929 typedef struct {
    930   ///
    931   /// Specifies the address of the peer MAC entity with which to perform the
    932   /// deauthentication process.
    933   ///
    934   EFI_80211_MAC_ADDRESS              BSSId;
    935   ///
    936   /// Specifies the reason for initiating the deauthentication process.
    937   ///
    938   EFI_80211_REASON_CODE              ReasonCode;
    939   ///
    940   /// Zero or more elements, may be NULL.
    941   ///
    942   UINT8                              *VendorSpecificInfo;
    943 } EFI_80211_DEAUTHENTICATE_DATA;
    944 
    945 ///
    946 /// EFI_80211_DEAUTHENTICATE_DATA_TOKEN
    947 ///
    948 typedef struct {
    949   ///
    950   /// This Event will be signaled after the Status field is updated by the EFI Wireless
    951   /// MAC Connection Protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
    952   ///
    953   EFI_EVENT                          Event;
    954   ///
    955   /// Will be set to one of the following values:
    956   ///   EFI_SUCCESS:       Deauthentication operation completed successfully.
    957   ///   EFI_DEVICE_ERROR:  An unexpected network or system error occurred.
    958   ///   EFI_ACCESS_DENIED: The deauthentication operation is not completed due to some
    959   ///                      underlying hardware or software state.
    960   ///   EFI_NOT_READY:     The deauthentication operation is started but not yet
    961   ///                      completed.
    962   ///
    963   EFI_STATUS                         Status;
    964   ///
    965   /// Pointer to the deauthentication data.
    966   ///
    967   EFI_80211_DEAUTHENTICATE_DATA      *Data;
    968 } EFI_80211_DEAUTHENTICATE_DATA_TOKEN;
    969 
    970 /**
    971   Request a survey of potential BSSs that administrator can later elect to try to join.
    972 
    973   The Scan() function returns the description of the set of BSSs detected by the scan
    974   process. Passive scan operation is performed by default.
    975 
    976   @param[in]  This                Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
    977                                   instance.
    978   @param[in]  Data                Pointer to the scan token.
    979 
    980   @retval EFI_SUCCESS             The operation completed successfully.
    981   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:
    982                                   This is NULL.
    983                                   Data is NULL.
    984                                   Data->Data is NULL.
    985   @retval EFI_UNSUPPORTED         One or more of the input parameters are not supported
    986                                   by this implementation.
    987   @retval EFI_ALREADY_STARTED     The scan operation is already started.
    988 **/
    989 typedef
    990 EFI_STATUS
    991 (EFIAPI *EFI_WIRELESS_MAC_CONNECTION_SCAN)(
    992   IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL        *This,
    993   IN EFI_80211_SCAN_DATA_TOKEN                   *Data
    994   );
    995 
    996 /**
    997   Request an association with a specified peer MAC entity that is within an AP.
    998 
    999   The Associate() function provides the capability for MAC layer to become associated
   1000   with an AP.
   1001 
   1002   @param[in]  This                Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
   1003                                   instance.
   1004   @param[in]  Data                Pointer to the association token.
   1005 
   1006   @retval EFI_SUCCESS             The operation completed successfully.
   1007   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:
   1008                                   This is NULL.
   1009                                   Data is NULL.
   1010                                   Data->Data is NULL.
   1011   @retval EFI_UNSUPPORTED         One or more of the input parameters are not supported
   1012                                   by this implementation.
   1013   @retval EFI_ALREADY_STARTED     The association process is already started.
   1014   @retval EFI_NOT_READY           Authentication is not performed before this association
   1015                                   process.
   1016   @retval EFI_NOT_FOUND           The specified peer MAC entity is not found.
   1017   @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.
   1018 **/
   1019 typedef
   1020 EFI_STATUS
   1021 (EFIAPI *EFI_WIRELESS_MAC_CONNECTION_ASSOCIATE)(
   1022   IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL        *This,
   1023   IN EFI_80211_ASSOCIATE_DATA_TOKEN              *Data
   1024   );
   1025 
   1026 /**
   1027   Request a disassociation with a specified peer MAC entity.
   1028 
   1029   The Disassociate() function is invoked to terminate an existing association.
   1030   Disassociation is a notification and cannot be refused by the receiving peer except
   1031   when management frame protection is negotiated and the message integrity check fails.
   1032 
   1033   @param[in]  This                Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
   1034                                   instance.
   1035   @param[in]  Data                Pointer to the disassociation token.
   1036 
   1037   @retval EFI_SUCCESS             The operation completed successfully.
   1038   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:
   1039                                   This is NULL.
   1040                                   Data is NULL.
   1041   @retval EFI_ALREADY_STARTED     The disassociation process is already started.
   1042   @retval EFI_NOT_READY           The disassociation service is invoked to a
   1043                                   nonexistent association relationship.
   1044   @retval EFI_NOT_FOUND           The specified peer MAC entity is not found.
   1045   @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.
   1046 **/
   1047 typedef
   1048 EFI_STATUS
   1049 (EFIAPI *EFI_WIRELESS_MAC_CONNECTION_DISASSOCIATE)(
   1050   IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL        *This,
   1051   IN EFI_80211_DISASSOCIATE_DATA_TOKEN           *Data
   1052   );
   1053 
   1054 /**
   1055   Request the process of establishing an authentication relationship with a peer MAC
   1056   entity.
   1057 
   1058   The Authenticate() function requests authentication with a specified peer MAC entity.
   1059   This service might be time-consuming thus is designed to be invoked independently of
   1060   the association service.
   1061 
   1062   @param[in]  This                Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
   1063                                   instance.
   1064   @param[in]  Data                Pointer to the authentication token.
   1065 
   1066   @retval EFI_SUCCESS             The operation completed successfully.
   1067   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:
   1068                                   This is NULL.
   1069                                   Data is NULL.
   1070                                   Data.Data is NULL.
   1071   @retval EFI_UNSUPPORTED         One or more of the input parameters are not supported
   1072                                   by this implementation.
   1073   @retval EFI_ALREADY_STARTED     The authentication process is already started.
   1074   @retval EFI_NOT_FOUND           The specified peer MAC entity is not found.
   1075   @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.
   1076 **/
   1077 typedef
   1078 EFI_STATUS
   1079 (EFIAPI *EFI_WIRELESS_MAC_CONNECTION_AUTHENTICATE)(
   1080   IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL        *This,
   1081   IN EFI_80211_AUTHENTICATE_DATA_TOKEN           *Data
   1082   );
   1083 
   1084 /**
   1085   Invalidate the authentication relationship with a peer MAC entity.
   1086 
   1087   The Deauthenticate() function requests that the authentication relationship with a
   1088   specified peer MAC entity be invalidated. Deauthentication is a notification and when
   1089   it is sent out the association at the transmitting station is terminated.
   1090 
   1091   @param[in]  This                Pointer to the EFI_WIRELESS_MAC_CONNECTION_PROTOCOL
   1092                                   instance.
   1093   @param[in]  Data                Pointer to the deauthentication token.
   1094 
   1095   @retval EFI_SUCCESS             The operation completed successfully.
   1096   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:
   1097                                   This is NULL.
   1098                                   Data is NULL.
   1099                                   Data.Data is NULL.
   1100   @retval EFI_ALREADY_STARTED     The deauthentication process is already started.
   1101   @retval EFI_NOT_READY           The deauthentication service is invoked to a
   1102                                   nonexistent association or authentication relationship.
   1103   @retval EFI_NOT_FOUND           The specified peer MAC entity is not found.
   1104   @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.
   1105 **/
   1106 typedef
   1107 EFI_STATUS
   1108 (EFIAPI *EFI_WIRELESS_MAC_CONNECTION_DEAUTHENTICATE)(
   1109   IN EFI_WIRELESS_MAC_CONNECTION_PROTOCOL        *This,
   1110   IN EFI_80211_DEAUTHENTICATE_DATA_TOKEN         *Data
   1111   );
   1112 
   1113 ///
   1114 /// The EFI_WIRELESS_MAC_CONNECTION_PROTOCOL is designed to provide management service
   1115 /// interfaces for the EFI wireless network stack to establish wireless connection with
   1116 /// AP. An EFI Wireless MAC Connection Protocol instance will be installed on each
   1117 /// communication device that the EFI wireless network stack runs on.
   1118 ///
   1119 struct _EFI_WIRELESS_MAC_CONNECTION_PROTOCOL {
   1120   EFI_WIRELESS_MAC_CONNECTION_SCAN               Scan;
   1121   EFI_WIRELESS_MAC_CONNECTION_ASSOCIATE          Associate;
   1122   EFI_WIRELESS_MAC_CONNECTION_DISASSOCIATE       Disassociate;
   1123   EFI_WIRELESS_MAC_CONNECTION_AUTHENTICATE       Authenticate;
   1124   EFI_WIRELESS_MAC_CONNECTION_DEAUTHENTICATE     Deauthenticate;
   1125 };
   1126 
   1127 extern EFI_GUID gEfiWiFiProtocolGuid;
   1128 
   1129 #endif
   1130