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