|
1 /* |
|
2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declaration of the WlanDmaUsableMemory class. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 7 % |
|
20 */ |
|
21 |
|
22 #ifndef C_WLANDMAUSABLEMEMORY_H |
|
23 #define C_WLANDMAUSABLEMEMORY_H |
|
24 |
|
25 class DPlatChunkHw; |
|
26 |
|
27 /** |
|
28 * Encapsulates DMA usable memory |
|
29 * |
|
30 * @since S60 v3.1 |
|
31 */ |
|
32 class WlanDmaUsableMemory |
|
33 { |
|
34 |
|
35 public: |
|
36 |
|
37 WlanDmaUsableMemory() : |
|
38 iSizeInBytes( 0 ), iPhysicalRamAddr( 0 ), iFlags( 0 ), iChunk( NULL ) {}; |
|
39 |
|
40 /** |
|
41 * Init method of the class |
|
42 * |
|
43 * @since S60 3.1 |
|
44 * @param aSizeInBytes size of memory in bytes required |
|
45 * @param aUseCachedMemory ETrue if cached memory shall be used |
|
46 * EFalse otherwise |
|
47 * @return if not 0 -> actual size of memory acquired |
|
48 * (rounded to a multiple of page size). |
|
49 * operation failure upon 0 |
|
50 */ |
|
51 TUint32 Init( TUint32 aSizeInBytes, TBool aUseCachedMemory ); |
|
52 |
|
53 /** |
|
54 * Finit method of the class |
|
55 * Can be called even when the init of the class failed |
|
56 * |
|
57 * @since S60 3.1 |
|
58 */ |
|
59 void Finit(); |
|
60 |
|
61 /** |
|
62 * Get the linear address of the memory buffer |
|
63 * |
|
64 * @since S60 3.1 |
|
65 * @param aSizeInBytes size of memory in bytes required |
|
66 * @returns begin of the memory that can be used for DMA xfer |
|
67 */ |
|
68 TLinAddr Addr( TUint32 aSizeInBytes ); |
|
69 |
|
70 /** |
|
71 * Get the linear address of the memory buffer |
|
72 * |
|
73 * @since S60 3.1 |
|
74 * @returns begin of the memory that can be used for DMA xfer |
|
75 */ |
|
76 TLinAddr Addr(); |
|
77 |
|
78 protected: |
|
79 |
|
80 private: |
|
81 |
|
82 // Prohibit copy constructor. |
|
83 WlanDmaUsableMemory ( const WlanDmaUsableMemory& ); |
|
84 // Prohibit assigment operator. |
|
85 WlanDmaUsableMemory& operator= ( const WlanDmaUsableMemory& ); |
|
86 |
|
87 private: // data |
|
88 |
|
89 static const TUint32 KResourceAcquired = (1 << 0); |
|
90 |
|
91 /** |
|
92 * size of memory in bytes |
|
93 */ |
|
94 TInt iSizeInBytes; |
|
95 |
|
96 /** |
|
97 * physical memory address |
|
98 */ |
|
99 TPhysAddr iPhysicalRamAddr; |
|
100 |
|
101 /** |
|
102 * internal flags |
|
103 */ |
|
104 TUint32 iFlags; |
|
105 |
|
106 /** |
|
107 * the actual chunk of memory |
|
108 */ |
|
109 DPlatChunkHw* iChunk; |
|
110 |
|
111 }; |
|
112 |
|
113 |
|
114 #endif // C_WLANDMAUSABLEMEMORY_H |