diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/libnvdimm.h | 28 | ||||
| -rw-r--r-- | include/linux/nd.h | 8 |
2 files changed, 15 insertions, 21 deletions
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h index b519e137b9b7..f4947fda11e7 100644 --- a/include/linux/libnvdimm.h +++ b/include/linux/libnvdimm.h | |||
| @@ -50,23 +50,6 @@ typedef int (*ndctl_fn)(struct nvdimm_bus_descriptor *nd_desc, | |||
| 50 | struct nvdimm *nvdimm, unsigned int cmd, void *buf, | 50 | struct nvdimm *nvdimm, unsigned int cmd, void *buf, |
| 51 | unsigned int buf_len, int *cmd_rc); | 51 | unsigned int buf_len, int *cmd_rc); |
| 52 | 52 | ||
| 53 | struct nd_namespace_label; | ||
| 54 | struct nvdimm_drvdata; | ||
| 55 | |||
| 56 | struct nd_mapping { | ||
| 57 | struct nvdimm *nvdimm; | ||
| 58 | struct nd_namespace_label **labels; | ||
| 59 | u64 start; | ||
| 60 | u64 size; | ||
| 61 | /* | ||
| 62 | * @ndd is for private use at region enable / disable time for | ||
| 63 | * get_ndd() + put_ndd(), all other nd_mapping to ndd | ||
| 64 | * conversions use to_ndd() which respects enabled state of the | ||
| 65 | * nvdimm. | ||
| 66 | */ | ||
| 67 | struct nvdimm_drvdata *ndd; | ||
| 68 | }; | ||
| 69 | |||
| 70 | struct nvdimm_bus_descriptor { | 53 | struct nvdimm_bus_descriptor { |
| 71 | const struct attribute_group **attr_groups; | 54 | const struct attribute_group **attr_groups; |
| 72 | unsigned long cmd_mask; | 55 | unsigned long cmd_mask; |
| @@ -89,9 +72,15 @@ struct nd_interleave_set { | |||
| 89 | u64 cookie; | 72 | u64 cookie; |
| 90 | }; | 73 | }; |
| 91 | 74 | ||
| 75 | struct nd_mapping_desc { | ||
| 76 | struct nvdimm *nvdimm; | ||
| 77 | u64 start; | ||
| 78 | u64 size; | ||
| 79 | }; | ||
| 80 | |||
| 92 | struct nd_region_desc { | 81 | struct nd_region_desc { |
| 93 | struct resource *res; | 82 | struct resource *res; |
| 94 | struct nd_mapping *nd_mapping; | 83 | struct nd_mapping_desc *mapping; |
| 95 | u16 num_mappings; | 84 | u16 num_mappings; |
| 96 | const struct attribute_group **attr_groups; | 85 | const struct attribute_group **attr_groups; |
| 97 | struct nd_interleave_set *nd_set; | 86 | struct nd_interleave_set *nd_set; |
| @@ -129,6 +118,8 @@ static inline struct nd_blk_region_desc *to_blk_region_desc( | |||
| 129 | } | 118 | } |
| 130 | 119 | ||
| 131 | int nvdimm_bus_add_poison(struct nvdimm_bus *nvdimm_bus, u64 addr, u64 length); | 120 | int nvdimm_bus_add_poison(struct nvdimm_bus *nvdimm_bus, u64 addr, u64 length); |
| 121 | void nvdimm_clear_from_poison_list(struct nvdimm_bus *nvdimm_bus, | ||
| 122 | phys_addr_t start, unsigned int len); | ||
| 132 | struct nvdimm_bus *nvdimm_bus_register(struct device *parent, | 123 | struct nvdimm_bus *nvdimm_bus_register(struct device *parent, |
| 133 | struct nvdimm_bus_descriptor *nfit_desc); | 124 | struct nvdimm_bus_descriptor *nfit_desc); |
| 134 | void nvdimm_bus_unregister(struct nvdimm_bus *nvdimm_bus); | 125 | void nvdimm_bus_unregister(struct nvdimm_bus *nvdimm_bus); |
| @@ -139,6 +130,7 @@ struct nd_blk_region *to_nd_blk_region(struct device *dev); | |||
| 139 | struct nvdimm_bus_descriptor *to_nd_desc(struct nvdimm_bus *nvdimm_bus); | 130 | struct nvdimm_bus_descriptor *to_nd_desc(struct nvdimm_bus *nvdimm_bus); |
| 140 | struct device *to_nvdimm_bus_dev(struct nvdimm_bus *nvdimm_bus); | 131 | struct device *to_nvdimm_bus_dev(struct nvdimm_bus *nvdimm_bus); |
| 141 | const char *nvdimm_name(struct nvdimm *nvdimm); | 132 | const char *nvdimm_name(struct nvdimm *nvdimm); |
| 133 | struct kobject *nvdimm_kobj(struct nvdimm *nvdimm); | ||
| 142 | unsigned long nvdimm_cmd_mask(struct nvdimm *nvdimm); | 134 | unsigned long nvdimm_cmd_mask(struct nvdimm *nvdimm); |
| 143 | void *nvdimm_provider_data(struct nvdimm *nvdimm); | 135 | void *nvdimm_provider_data(struct nvdimm *nvdimm); |
| 144 | struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data, | 136 | struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data, |
diff --git a/include/linux/nd.h b/include/linux/nd.h index f1ea426d6a5e..fa66aeed441a 100644 --- a/include/linux/nd.h +++ b/include/linux/nd.h | |||
| @@ -77,11 +77,13 @@ struct nd_namespace_io { | |||
| 77 | * @nsio: device and system physical address range to drive | 77 | * @nsio: device and system physical address range to drive |
| 78 | * @alt_name: namespace name supplied in the dimm label | 78 | * @alt_name: namespace name supplied in the dimm label |
| 79 | * @uuid: namespace name supplied in the dimm label | 79 | * @uuid: namespace name supplied in the dimm label |
| 80 | * @id: ida allocated id | ||
| 80 | */ | 81 | */ |
| 81 | struct nd_namespace_pmem { | 82 | struct nd_namespace_pmem { |
| 82 | struct nd_namespace_io nsio; | 83 | struct nd_namespace_io nsio; |
| 83 | char *alt_name; | 84 | char *alt_name; |
| 84 | u8 *uuid; | 85 | u8 *uuid; |
| 86 | int id; | ||
| 85 | }; | 87 | }; |
| 86 | 88 | ||
| 87 | /** | 89 | /** |
| @@ -105,19 +107,19 @@ struct nd_namespace_blk { | |||
| 105 | struct resource **res; | 107 | struct resource **res; |
| 106 | }; | 108 | }; |
| 107 | 109 | ||
| 108 | static inline struct nd_namespace_io *to_nd_namespace_io(struct device *dev) | 110 | static inline struct nd_namespace_io *to_nd_namespace_io(const struct device *dev) |
| 109 | { | 111 | { |
| 110 | return container_of(dev, struct nd_namespace_io, common.dev); | 112 | return container_of(dev, struct nd_namespace_io, common.dev); |
| 111 | } | 113 | } |
| 112 | 114 | ||
| 113 | static inline struct nd_namespace_pmem *to_nd_namespace_pmem(struct device *dev) | 115 | static inline struct nd_namespace_pmem *to_nd_namespace_pmem(const struct device *dev) |
| 114 | { | 116 | { |
| 115 | struct nd_namespace_io *nsio = to_nd_namespace_io(dev); | 117 | struct nd_namespace_io *nsio = to_nd_namespace_io(dev); |
| 116 | 118 | ||
| 117 | return container_of(nsio, struct nd_namespace_pmem, nsio); | 119 | return container_of(nsio, struct nd_namespace_pmem, nsio); |
| 118 | } | 120 | } |
| 119 | 121 | ||
| 120 | static inline struct nd_namespace_blk *to_nd_namespace_blk(struct device *dev) | 122 | static inline struct nd_namespace_blk *to_nd_namespace_blk(const struct device *dev) |
| 121 | { | 123 | { |
| 122 | return container_of(dev, struct nd_namespace_blk, common.dev); | 124 | return container_of(dev, struct nd_namespace_blk, common.dev); |
| 123 | } | 125 | } |
