Commit | Line | Data |
---|---|---|
b94d5230 DW |
1 | /* |
2 | * libnvdimm - Non-volatile-memory Devices Subsystem | |
3 | * | |
4 | * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of version 2 of the GNU General Public License as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but | |
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * General Public License for more details. | |
14 | */ | |
15 | #ifndef __LIBNVDIMM_H__ | |
16 | #define __LIBNVDIMM_H__ | |
45def22c DW |
17 | extern struct attribute_group nvdimm_bus_attribute_group; |
18 | ||
b94d5230 DW |
19 | struct nvdimm; |
20 | struct nvdimm_bus_descriptor; | |
21 | typedef int (*ndctl_fn)(struct nvdimm_bus_descriptor *nd_desc, | |
22 | struct nvdimm *nvdimm, unsigned int cmd, void *buf, | |
23 | unsigned int buf_len); | |
24 | ||
25 | struct nvdimm_bus_descriptor { | |
45def22c | 26 | const struct attribute_group **attr_groups; |
b94d5230 DW |
27 | unsigned long dsm_mask; |
28 | char *provider_name; | |
29 | ndctl_fn ndctl; | |
30 | }; | |
31 | ||
32 | struct device; | |
b94d5230 DW |
33 | struct nvdimm_bus *nvdimm_bus_register(struct device *parent, |
34 | struct nvdimm_bus_descriptor *nfit_desc); | |
35 | void nvdimm_bus_unregister(struct nvdimm_bus *nvdimm_bus); | |
45def22c DW |
36 | struct nvdimm_bus *to_nvdimm_bus(struct device *dev); |
37 | struct nvdimm_bus_descriptor *to_nd_desc(struct nvdimm_bus *nvdimm_bus); | |
b94d5230 | 38 | #endif /* __LIBNVDIMM_H__ */ |