summaryrefslogtreecommitdiff
path: root/ReferenceCode/ME/Protocol/AtAm/ATAM.h
blob: 5d75f3398ea318f9f70a8e09773decda0eacb3a2 (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
/** @file
  Header file for ATAM

@copyright
  Copyright (c) 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 _DXE_ATAM_PROTOCOL_H_
#define _DXE_ATAM_PROTOCOL_H_

#include "MkhiMsgs.h"

///
/// Define the  protocol GUID
///
#define EFI_ATAM_PROTOCOL_GUID \
  { \
    0x8aebaa5a, 0x556f, 0x404b, 0x96, 0x05, 0x38, 0xe0, 0xde, 0x29, 0x76, 0x2f \
  }

//
// Extern the GUID for protocol users.
//
extern EFI_GUID gEfiAtProtocolGuid;

#define ATAM_PROTOCOL_REVISION  3

//
// Forward reference for ANSI C compatibility
//

#define ISV_PLATFORM_ID_LENGTH  16
#define SERVER_SHORTCODE_LENGTH 16
#define DEFAULT_LANGUAGE_STRING 4

//
// Forward reference for ANSI C compatibility
//
EFI_FORWARD_DECLARATION (EFI_ATAM_PROTOCOL);

#pragma pack(1)
typedef struct {

  UINT8   BiosLanguageSupport[DEFAULT_LANGUAGE_STRING];
  UINT8   Reserved[2];

  ///
  /// Defines the number which will be used by BIOS before making BIOS AM as a
  /// default recovery mechanism
  ///
  UINT16  PbaOverRideThreshold;

  ///
  /// The value used by BIOS to try sending GPS location when AT stolen
  ///
  UINT8   BiosLocationBeconing;

  ///
  /// This will be used for Notebook transfer authorization request
  ///
  UINT8   PlatformAuthReq;

  ///
  /// This will be used for Notebook transfer authorization acknowledgement
  ///
  UINT8   PlatformAuthAck;

  ///
  /// This will be used for AT Server short code
  ///
  UINT8   ServerShortCode[SERVER_SHORTCODE_LENGTH];

  ///
  /// This allow ISV to set unique platform ID and will be used for displayed on need basis
  ///
  UINT16  IsvPlatformId[ISV_PLATFORM_ID_LENGTH];

} AT_BIOS_RECOVERY_CONFIG;
#pragma pack()

///
/// Protocol definitions
///

/**
  This function gets the ISV Strings stored by AT Server that BIOS will display.

  @param[in] This        The address of protocol
  @param[out] IsvString  Isv string pointer
  @param[out] IsvId      Intel(R) Anti-Theft service provider Id

  @retval EFI_SUCCESS   The function completed successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ATAM_GET_ISV_ID) (
  IN  EFI_ATAM_PROTOCOL *This,
  OUT UINT8             *IsvString,
  OUT UINT32            *IsvId
  );

/**
  This function gets recovery config.

  @param[in]  This                The address of protocol
  @param[out] RecoveryConfig      Pointer to structure

  @retval EFI_SUCCESS             The function completed successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ATAM_GET_RECOVERY_CONFIG) (
  IN  EFI_ATAM_PROTOCOL           *This,
  OUT AT_BIOS_RECOVERY_CONFIG     *RecoveryConfig
  );

/**
  This function returns time left to enter password.

  @param[in] This                 The address of protocol
  @param[out] TimeLeft            Time
  @param[out] TimeInterval        Time interval

  @retval EFI_SUCCESS             The function completed
          successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ATAM_GET_TIMER) (
  IN  EFI_ATAM_PROTOCOL           *This,
  OUT UINT32                      *TimeLeft,
  OUT UINT32                      *TimeInterval
  );

/**
  This function gets 16 bytes nonce from firmware and also converts it to string according to format "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX".

  @param[in] This                 The address of protocol
  @param[out] NonceStr            Pointer to Nonce string

  @retval EFI_SUCCESS             The function completed
          successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ATAM_GET_NONCE) (
  IN  EFI_ATAM_PROTOCOL           *This,
  OUT UINT8                       *NonceStr
  );

/**
  This routine receives the data (passphrase or SRTK) from UI and verifies it if the password (either passphrase or SRTK) is acceptable.

  @param[in] This                 The address of protocol
  @param[in] PasswordEntered      Pointer to string
  @param[in] PassType             Password type
  @param[out] IsAuthenticated     Pointer to result of verification

  @retval EFI_SUCCESS             The function completed successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ATAM_VERIFY_PASSWORD) (
  IN  EFI_ATAM_PROTOCOL           *This,
  IN  UINT8                       *PasswordEntered,
  IN  UINT32                      PassType,
  OUT UINT8                       *IsAuthenticated
  );

/**
  This routine receives the SRTK from UI and verifies it if the password is acceptable. This requests FW to enter or exit Suspend mode based on user input.

  @param[in] This                 The address of protocol
  @param[in] TransitionState      1- enter suspend state, 0 - exit suspend state
  @param[in] Token                Pointer to token

  @retval EFI_SUCCESS             The function completed successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ATAM_SET_SUSPEND_STATE) (
  IN EFI_ATAM_PROTOCOL            *This,
  IN UINT32                       TransitionState,
  IN UINT8                        *Token
  );

/**
  This routine gets AT state.

  @param[in]  This                The address of protocol
  @param[out] AtStateInfo         State of AT

  @retval EFI_SUCCESS             The function completed
          successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ATAM_GET_AT_STATE_INFO) (
  IN  EFI_ATAM_PROTOCOL           *This,
  OUT AT_STATE_INFO               *AtStateInfo
  );

/**
  This routine gets PBA failed count value.

  @param[out] PbaFailedExceeded   TRUE when the PbaOverrideThreshold is exceeded
  @param[out] PbaFailedAttempts   Number of failed attempts
  @param[out] PbaFailedThreshold  Pba failed count treshold

  @retval EFI_SUCCESS             The function completed
          successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ATAM_GET_PBA_COUNTER) (
  OUT UINT8*                      PbaFailedExceeded,
  OUT UINT16*                     PbaFailedAttempts,
  OUT UINT16*                     PbaFailedThreshold
  );

///
/// Protocol definition
///
struct _EFI_ATAM_PROTOCOL {
  UINT8                           Revision;
  EFI_ATAM_GET_ISV_ID             AtAmGetIsvId;
  EFI_ATAM_GET_RECOVERY_CONFIG    AtAmGetRecoveryConfig;
  EFI_ATAM_GET_TIMER              AtAmGetTimer;
  EFI_ATAM_GET_NONCE              AtAmGetNonce;
  EFI_ATAM_VERIFY_PASSWORD        AtAmVerifyPassword;
  EFI_ATAM_SET_SUSPEND_STATE      AtAmSetSuspendState;
  EFI_ATAM_GET_AT_STATE_INFO      AtAmGetAtStateInfo;
  EFI_ATAM_GET_PBA_COUNTER        AtAmGetPbaCounter;
};

#endif