• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * \file
3  * Feature ID format and inline decode functions
4  */
5 
6 #pragma once
7 
8 /*****************************************************************************/
9 
10 #define TA_MASK 0xFF000000
11 #define TA_OFFSET 24
12 #define TA_FIELD 8 // Max 256 TAs
13 
14 #define FEATURE_MASK 0x00FFFFFF
15 #define FEATURE_OFFSET 0
16 #define FEATURE_FIELD 24 // Can support up to 2^24 features
17 
18 #define TA_FROM_FEATURE_ID(id)                                                 \
19 	((enum feature_support_app_id)((id & TA_MASK) >> TA_OFFSET))
20 #define MODULE_FROM_FEATURE_ID(id) ((id & FEATURE_MASK) >> FEATURE_OFFSET)
21 /*****************************************************************************/
22 
23 enum feature_support_app_id {
24   feature_id_avb = 0,
25   feature_id_gfa = 1,
26   feature_id_identity = 2,
27   feature_id_keymint = 3,
28   feature_id_nugget = 4,
29   feature_id_weaver = 5,
30 
31   /* Please do not change numbers after they've been released */
32 
33   feature_id_count,       // used in sparse lookup table
34   feature_id_max = 0xff,  // 8-bit TA_FIELD
35 };
36 static_assert(feature_id_count <= feature_id_max,
37               "Too many enum feature_support_app_id values");
38 
39 enum km_feature_list {
40   km_feature_individual_attest = 0,
41   km_feature_batch_attest = 1,
42   km_feature_gnubby_attest = 2,
43   km_feature_rkp = 3,
44   km_feature_rkp_dice = 4,
45   km_feature_dice = 5,
46   km_feature_multimei = 6,
47 
48   /* Please do not change numbers after they've been released */
49 
50   km_feature_max = FEATURE_MASK,  // 24-bit FEATURE_FIELD
51 };
52 
53 enum weaver_feature_list {
54   weaver_feature_api_no_proto = 0,
55 
56   /* Please do not change numbers after they've been released */
57 
58   weaver_feature_max = FEATURE_MASK,  // 24-bit FEATURE_FIELD
59 };
60