aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-10-07 19:46:24 -0400
committerDan Williams <dan.j.williams@intel.com>2016-10-07 19:46:24 -0400
commit178d6f4be8bf42b298bedf8ea2a00754100e0c4e (patch)
treea71865455adc31082a4ad21a942286520a7b5da1 /include/linux
parentdb58028ee4e360430de8e3b48f657dc798ee6591 (diff)
parent98a29c39dc689298d2f834f40102cba752eb49c0 (diff)
Merge branch 'for-4.9/libnvdimm' into libnvdimm-for-next
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/libnvdimm.h28
-rw-r--r--include/linux/nd.h8
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
53struct nd_namespace_label;
54struct nvdimm_drvdata;
55
56struct 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
70struct nvdimm_bus_descriptor { 53struct 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
75struct nd_mapping_desc {
76 struct nvdimm *nvdimm;
77 u64 start;
78 u64 size;
79};
80
92struct nd_region_desc { 81struct 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
131int nvdimm_bus_add_poison(struct nvdimm_bus *nvdimm_bus, u64 addr, u64 length); 120int nvdimm_bus_add_poison(struct nvdimm_bus *nvdimm_bus, u64 addr, u64 length);
121void nvdimm_clear_from_poison_list(struct nvdimm_bus *nvdimm_bus,
122 phys_addr_t start, unsigned int len);
132struct nvdimm_bus *nvdimm_bus_register(struct device *parent, 123struct nvdimm_bus *nvdimm_bus_register(struct device *parent,
133 struct nvdimm_bus_descriptor *nfit_desc); 124 struct nvdimm_bus_descriptor *nfit_desc);
134void nvdimm_bus_unregister(struct nvdimm_bus *nvdimm_bus); 125void nvdimm_bus_unregister(struct nvdimm_bus *nvdimm_bus);
@@ -139,6 +130,7 @@ struct nd_blk_region *to_nd_blk_region(struct device *dev);
139struct nvdimm_bus_descriptor *to_nd_desc(struct nvdimm_bus *nvdimm_bus); 130struct nvdimm_bus_descriptor *to_nd_desc(struct nvdimm_bus *nvdimm_bus);
140struct device *to_nvdimm_bus_dev(struct nvdimm_bus *nvdimm_bus); 131struct device *to_nvdimm_bus_dev(struct nvdimm_bus *nvdimm_bus);
141const char *nvdimm_name(struct nvdimm *nvdimm); 132const char *nvdimm_name(struct nvdimm *nvdimm);
133struct kobject *nvdimm_kobj(struct nvdimm *nvdimm);
142unsigned long nvdimm_cmd_mask(struct nvdimm *nvdimm); 134unsigned long nvdimm_cmd_mask(struct nvdimm *nvdimm);
143void *nvdimm_provider_data(struct nvdimm *nvdimm); 135void *nvdimm_provider_data(struct nvdimm *nvdimm);
144struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data, 136struct 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 */
81struct nd_namespace_pmem { 82struct 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
108static inline struct nd_namespace_io *to_nd_namespace_io(struct device *dev) 110static 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
113static inline struct nd_namespace_pmem *to_nd_namespace_pmem(struct device *dev) 115static 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
120static inline struct nd_namespace_blk *to_nd_namespace_blk(struct device *dev) 122static 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}