Rev 6082 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6082 | Rev 6102 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | */ |
11 | */ |
Line 12... | Line 12... | ||
12 | 12 | ||
13 | #ifndef _DEVICE_H_ |
13 | #ifndef _DEVICE_H_ |
Line -... | Line 14... | ||
- | 14 | #define _DEVICE_H_ |
|
- | 15 | ||
14 | #define _DEVICE_H_ |
16 | #include |
15 | 17 | #include |
|
16 | #include |
18 | #include |
17 | #include |
19 | #include |
- | 20 | #include |
|
- | 21 | #include |
|
- | 22 | #include |
|
18 | #include |
23 | #include |
19 | #include |
24 | #include |
20 | struct device; |
25 | struct device; |
21 | enum probe_type { |
26 | enum probe_type { |
22 | PROBE_DEFAULT_STRATEGY, |
27 | PROBE_DEFAULT_STRATEGY, |
Line 33... | Line 38... | ||
33 | }; |
38 | }; |
Line 34... | Line 39... | ||
34 | 39 | ||
35 | struct device { |
40 | struct device { |
Line -... | Line 41... | ||
- | 41 | struct device *parent; |
|
36 | struct device *parent; |
42 | |
37 | 43 | struct kobject kobj; |
|
38 | const char *init_name; /* initial name of the device */ |
44 | const char *init_name; /* initial name of the device */ |
39 | struct device_driver *driver; /* which driver has allocated this |
45 | struct device_driver *driver; /* which driver has allocated this |
40 | device */ |
46 | device */ |
Line 53... | Line 59... | ||
53 | #endif |
59 | #endif |
Line 54... | Line 60... | ||
54 | 60 | ||
55 | #ifdef CONFIG_NUMA |
61 | #ifdef CONFIG_NUMA |
56 | int numa_node; /* NUMA node this device is close to */ |
62 | int numa_node; /* NUMA node this device is close to */ |
- | 63 | #endif |
|
- | 64 | u64 *dma_mask; /* dma mask (if dma'able device) */ |
|
- | 65 | u64 coherent_dma_mask;/* Like dma_mask, but for |
|
- | 66 | alloc_coherent mappings as |
|
- | 67 | not all hardware supports |
|
- | 68 | 64 bit addresses for consistent |
|
- | 69 | allocations such descriptors. */ |
|
57 | #endif |
70 | unsigned long dma_pfn_offset; |
58 | #ifdef CONFIG_DMA_CMA |
71 | #ifdef CONFIG_DMA_CMA |
59 | struct cma *cma_area; /* contiguous memory area for dma |
72 | struct cma *cma_area; /* contiguous memory area for dma |
60 | allocations */ |
73 | allocations */ |
61 | #endif |
74 | #endif |
Line -... | Line 75... | ||
- | 75 | }; |
|
- | 76 | ||
- | 77 | static inline struct device *kobj_to_dev(struct kobject *kobj) |
|
- | 78 | { |
|
- | 79 | return container_of(kobj, struct device, kobj); |
|
- | 80 | } |
|
- | 81 | ||
- | 82 | ||
- | 83 | static inline const char *dev_name(const struct device *dev) |
|
- | 84 | { |
|
- | 85 | /* Use the init name until the kobject becomes available */ |
|
- | 86 | if (dev->init_name) |
|
- | 87 | return dev->init_name; |
|
- | 88 | ||
- | 89 | return kobject_name(&dev->kobj); |
|
62 | }; |
90 | } |
63 | 91 | ||
Line 64... | Line 92... | ||
64 | extern __printf(2, 3) |
92 | extern __printf(2, 3) |
65 | int dev_set_name(struct device *dev, const char *name, ...); |
93 | int dev_set_name(struct device *dev, const char *name, ...); |