|
1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // eka\include\drivers\rpmb\rpmbpacket.h |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 #ifndef RPMBPACKET_H |
|
23 #define RPMBPACKET_H |
|
24 |
|
25 // RPMB packet constants |
|
26 |
|
27 const TInt KRpmbOneFramePacketLength = 512; |
|
28 |
|
29 // request field offsets |
|
30 const TUint KRpmbRequestLsbOffset = 511; |
|
31 const TUint KRpmbRequestMsbOffset = 510; |
|
32 // request field values |
|
33 const TUint KRpmbRequestWriteKey = 0x0001; |
|
34 const TUint KRpmbRequestReadWriteCounter = 0x0002; |
|
35 const TUint KRpmbRequestWriteData = 0x0003; |
|
36 const TUint KRpmbRequestReadData = 0x0004; |
|
37 const TUint KRpmbRequestReadResultRegister = 0x0005; |
|
38 |
|
39 // response field offsets |
|
40 const TUint KRpmbResponseLsbOffset = 511; |
|
41 const TUint KRpmbResponseMsbOffset = 510; |
|
42 // response field values |
|
43 const TUint KRpmbResponseWriteKey = 0x0100; |
|
44 const TUint KRpmbResponseReadWriteCounter = 0x0200; |
|
45 const TUint KRpmbResponseWriteData = 0x0300; |
|
46 const TUint KRpmbResponseReadData = 0x0400; |
|
47 |
|
48 // result field offsets |
|
49 const TUint KRpmbResultLsbOffset = 509; |
|
50 const TUint KRpmbResultMsbOffset = 508; |
|
51 // result field counter expired mask |
|
52 const TUint KRpmbResultCounterExpiredMask = 0x007F; |
|
53 // result field values |
|
54 const TUint KRpmbResultOk = 0x0000; |
|
55 const TUint KRpmbResultGeneralFailure = 0x0001; |
|
56 const TUint KRpmbResultAuthenticationFailure = 0x0002; |
|
57 const TUint KRpmbResultKeyNotProgrammed = 0x0007; |
|
58 |
|
59 // counter field offsets |
|
60 const TUint KRpmbCounterByteOneOffset = 503; |
|
61 const TUint KRpmbCounterByteTwoOffset = 502; |
|
62 const TUint KRpmbCounterByteThreeOffset = 501; |
|
63 const TUint KRpmbCounterByteFourOffset = 500; |
|
64 |
|
65 // key field |
|
66 const TUint KRpmbKeyLength = 32; |
|
67 const TUint KRpmbKeyOffset = 196; |
|
68 |
|
69 // data field |
|
70 const TUint KRpmbDataLength = 256; |
|
71 const TUint KRpmbDataOffset = 228; |
|
72 |
|
73 #endif /* #ifndef RPMBPACKET_H */ |