blob: ea0cca337aa6605f61bc9ae36c7c57d35cf45861 [file] [log] [blame]
Dan Williams4d88a972015-05-31 14:41:48 -04001/*
2 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 */
13#ifndef __ND_H__
14#define __ND_H__
Dan Williams1f7df6f2015-06-09 20:13:14 -040015#include <linux/libnvdimm.h>
Dan Williams4d88a972015-05-31 14:41:48 -040016#include <linux/device.h>
17#include <linux/mutex.h>
18#include <linux/ndctl.h>
19
20struct nvdimm_drvdata {
21 struct device *dev;
22 struct nd_cmd_get_config_size nsarea;
23 void *data;
24};
25
Dan Williams1f7df6f2015-06-09 20:13:14 -040026struct nd_region {
27 struct device dev;
28 u16 ndr_mappings;
29 u64 ndr_size;
30 u64 ndr_start;
31 int id;
32 void *provider_data;
33 struct nd_mapping mapping[0];
34};
35
Dan Williams4d88a972015-05-31 14:41:48 -040036enum nd_async_mode {
37 ND_SYNC,
38 ND_ASYNC,
39};
40
41void nd_device_register(struct device *dev);
42void nd_device_unregister(struct device *dev, enum nd_async_mode mode);
43int __init nvdimm_init(void);
44void nvdimm_exit(void);
45int nvdimm_init_nsarea(struct nvdimm_drvdata *ndd);
46int nvdimm_init_config_data(struct nvdimm_drvdata *ndd);
47#endif /* __ND_H__ */