summaryrefslogtreecommitdiff
path: root/ReferenceCode/ME/At/AtAm/Dxe/At.h
blob: cc19c9da144aa228688054c5a74d9933d75c5611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/** @file
  Defines and prototypes for the AT driver.
  This driver implements the AT protocol.

@copyright
  Copyright (c) 2004 - 2012 Intel Corporation. All rights
  reserved This software and associated documentation (if any)
  is furnished under a license and may only be used or copied in
  accordance with the terms of the license. Except as permitted
  by such license, no part of this software or documentation may
  be reproduced, stored in a retrieval system, or transmitted in
  any form or by any means without the express written consent
  of Intel Corporation.

  This file contains an 'Intel Peripheral Driver' and uniquely
  identified as "Intel Reference Module" and is
  licensed for Intel CPUs and chipsets under the terms of your
  license agreement with Intel or your vendor.  This file may
  be modified by the user, subject to additional terms of the
  license agreement

**/
#ifndef _AT_H_
#define _AT_H_
#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000)
#include "EdkIIGlueDxe.h"
#include "AtHi.h"
#include "MeLib.h"
#include "AtAmHelper.h"
#endif

//
// Used during initialization
//
#include EFI_PROTOCOL_CONSUMER (FirmwareVolume)
#include EFI_PROTOCOL_CONSUMER (HECI)

//
// Driver Produced Protocols
//
#include EFI_PROTOCOL_PRODUCER (At)

//
// extern EFI_GUID gDxePlatformAtGuid;
//
#define AT_PRIVATE_DATA_SIGNATURE  EFI_SIGNATURE_32 ('A', 'T', 'D', 'R')

#pragma pack(1)
///
/// MKHI host message header. This header is part of HECI message sent from MEBx via
/// Host Configuration Interface (HCI). ME Configuration Manager or Power Configuration
/// Manager also include this header with appropriate fields set as part of the
/// response message to the HCI.
///
typedef struct {
  UINTN             Signature;
  EFI_HANDLE        Handle;
  EFI_AT_PROTOCOL   AtProtocol;

} AT_INSTANCE;

#define AT_INSTANCE_FROM_AT_PROTOCOL(a) CR (a, AT_INSTANCE, At, AT_PRIVATE_DATA_SIGNATURE)

#pragma pack()

/**
  Entry point for the AT Driver.

  @param[in] ImageHandle          Image handle of this driver.
  @param[in] SystemTable          Global system service table.

  @retval EFI_SUCCESS             Initialization complete.
  @exception EFI_UNSUPPORTED      The chipset is unsupported by this driver.
  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.
  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.
**/
EFI_STATUS
EFIAPI
AtEntryPoint (
  IN EFI_HANDLE                   ImageHandle,
  IN EFI_SYSTEM_TABLE             *SystemTable
  )
;

/**
  This function sends a request to ME AT Services to validate AT
  recovery credentials. The user input is captured in UTF-16
  format and then passed to this funtion. This function converts
  the User recovery password into a HASH by using Salt & Nonce
  and then send the password HASH to ME AT Services for
  validation. ME AT Service compares the Password HASH and
  returns either pass or fail.

  @param[in] This                 The address of protocol
  @param[in] PassPhrase           Passphrase that needs to be authenticated sent to ME
  @param[in] PassType             Password type user or server generated
  @param[in][out] IsAuthenticated The return of the password match 1 for success and 0 for fail

  @retval EFI_OUT_OF_RESOURCES    Unable to allocate necessary data structures
  @retval EFI_SUCCESS             The function completed successfully
**/
EFI_STATUS
EFIAPI
AuthenticateCredential (
  IN     EFI_AT_PROTOCOL            *This,
  IN     UINT8                      *PassPhrase,
  IN     UINT32                     *PassType,
  IN OUT UINT8                      *IsAuthenticated
  )
;

/**
  This API compute the SHA1 hash of the user enterted password

  @param[in] This                 The address of protocol
  @param[in] PassPhrase           The passphrase for which SHA1 hash to be computed
  @param[in][out] Hash            The return value of the SHA1 hash

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
EFIAPI
ComputeHash (
  IN     EFI_AT_PROTOCOL          *This,
  IN     UINT8                    *PassPhrase,
  IN OUT UINT8                    *Hash
  )
;

/**
  This API get the AT Unlock Timer values

  @param[in] This                 The address of protocol
  @param[in] Interval             The return value of the Unlock Time Interval that was set by AT Server
  @param[in] TimeLeft             The Timeleft in the Unlock Timer

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
EFIAPI
GetTimerInfo (
  IN     EFI_AT_PROTOCOL          *This,
  IN OUT UINT32                   *Interval,
  IN OUT UINT32                   *TimeLeft
  )
;

/**
  This gets the ME nonce
  @param[in] This                 The address of protocol
  @param[in][out] Nonce           The return value of the 16 Byte nonce received from ME

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
EFIAPI
GetNonce (
  IN     EFI_AT_PROTOCOL          *This,
  IN OUT UINT8                    *Nonce
  )
;

/**
  This retrives the ISV String stored by AT Server that BIOS will display during Platform lock state

  @param[in] This                 The address of protocol
  @param[in] StringId             The String buffer ID to retrive the ISV String
  @param[out] IsvString           256 Bytes of ISV string array, the
  @param[out] IsvStringLength     The String length

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
EFIAPI
GetRecoveryString (
  IN  EFI_AT_PROTOCOL             *This,
  IN  UINT32                      *StringId,
  OUT UINT8                       *IsvString,
  OUT UINT32                      *IsvStringLength
  )
;

/**
  This send an AssertStolen Message to ME when OEM has set the AllowAssertStolen bit to be accepted by BIOS.

  @param[in] This                 The address of protocol
  @param[out] CompletionCode      The return ME Firmware return code for this request

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
EFIAPI
SendAssertStolen (
  IN     EFI_AT_PROTOCOL          *This,
  OUT    UINT8                    *CompletionCode
  )
;

/**
  This receives the ISV ID from ME and display the ID, when the platform is in stolen state

  @param[in] This                 The address of protocol
  @param[out] IsvId               The pointer to 4 byte ISV ID

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
EFIAPI
GetIsvId (
  IN     EFI_AT_PROTOCOL          *This,
  OUT    UINT32                   *IsvId
  )
;

/**
  This requests FW to enter or exit Suspend mode based on user input

  @param[in] This                 The address of protocol
  @param[in] TransitionState      0: Exit Suspend Mode
                                  1: Enter Suspend Mode
  @param[in] Token                SRTK generated Token

  @retval EFI_SUCCESS             The function completed successfully.
  @retval EFI_OUT_OF_RESOURCES    Unable to allocate necessary data structures.
**/
EFI_STATUS
EFIAPI
SetSuspendState (
  IN     EFI_AT_PROTOCOL          *This,
  IN     UINT32                   TransitionState,
  IN     UINT8                    *Token
  )
;

/**
  This instructs FW that a WWAN recovery is desired and thus the Radio needs to be initialized.

  This command in not supported.

  @param[in] This                 The address of protocol
**/
EFI_STATUS
InitWWANREcov (
  IN     EFI_AT_PROTOCOL          *This
  )
;

/**
  This queries FW of the NIC Radio Status

  This command in not supported.

  @param[in] This                 The address of protocol
  @param[in] RadioStatus          Radio status
  @param[in] NetworkStatus        Network status
**/
EFI_STATUS
GetWWANNicStatus (
  IN     EFI_AT_PROTOCOL          *This,
  IN OUT UINT8                    *RadioStatus,
  IN OUT UINT8                    *NetworkStatus
  )
;

/**
  This queries FW of the AT Status in Unsigned mode

  @param[in] This                 The address of protocol
  @param[out] StateUnsigned       Structure retrieved from ME describing current AT state

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
GetStateUnsigned (
  IN    EFI_AT_PROTOCOL           *This,
  OUT   AT_STATE_INFO             *StateUnsigned
  )
;

#endif