This source file includes following definitions.
- mic_map_error
1
2
3
4
5
6
7
8
9 #ifndef MIC_SMPT_H
10 #define MIC_SMPT_H
11
12
13
14
15
16 struct mic_smpt_ops {
17 void (*init)(struct mic_device *mdev);
18 void (*set)(struct mic_device *mdev, dma_addr_t dma_addr, u8 index);
19 };
20
21
22
23
24
25
26 struct mic_smpt {
27 dma_addr_t dma_addr;
28 s64 ref_count;
29 };
30
31
32
33
34
35
36
37
38 struct mic_smpt_hw_info {
39 u8 num_reg;
40 u8 page_shift;
41 u64 page_size;
42 u64 base;
43 };
44
45
46
47
48
49
50
51
52
53
54 struct mic_smpt_info {
55 struct mic_smpt *entry;
56 spinlock_t smpt_lock;
57 struct mic_smpt_hw_info info;
58 s64 ref_count;
59 s64 map_count;
60 s64 unmap_count;
61 };
62
63 dma_addr_t mic_map_single(struct mic_device *mdev, void *va, size_t size);
64 void mic_unmap_single(struct mic_device *mdev,
65 dma_addr_t mic_addr, size_t size);
66 dma_addr_t mic_map(struct mic_device *mdev,
67 dma_addr_t dma_addr, size_t size);
68 void mic_unmap(struct mic_device *mdev, dma_addr_t mic_addr, size_t size);
69 dma_addr_t mic_to_dma_addr(struct mic_device *mdev, dma_addr_t mic_addr);
70
71
72
73
74
75
76
77
78 static inline bool mic_map_error(dma_addr_t mic_addr)
79 {
80 return !mic_addr;
81 }
82
83 int mic_smpt_init(struct mic_device *mdev);
84 void mic_smpt_uninit(struct mic_device *mdev);
85 void mic_smpt_restore(struct mic_device *mdev);
86
87 #endif