blob: 59528b3c9de8eb4cfb4978bbf12a1fc2484c997b [file] [log] [blame]
Dan Williamsb94d5232015-05-19 22:54:31 -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_CORE_H__
14#define __ND_CORE_H__
15#include <linux/libnvdimm.h>
16#include <linux/device.h>
17
Dan Williamse6dfb2d2015-04-25 03:56:17 -040018extern struct list_head nvdimm_bus_list;
19extern struct mutex nvdimm_bus_list_mutex;
20extern struct bus_type nvdimm_bus_type;
Dan Williams62232e452015-06-08 14:27:06 -040021extern int nvdimm_major;
Dan Williamse6dfb2d2015-04-25 03:56:17 -040022
Dan Williamsb94d5232015-05-19 22:54:31 -040023struct nvdimm_bus {
24 struct nvdimm_bus_descriptor *nd_desc;
Dan Williams45def222015-04-26 19:26:48 -040025 struct list_head list;
Dan Williamsb94d5232015-05-19 22:54:31 -040026 struct device dev;
27 int id;
28};
Dan Williams45def222015-04-26 19:26:48 -040029
Dan Williamse6dfb2d2015-04-25 03:56:17 -040030struct nvdimm {
31 unsigned long flags;
32 void *provider_data;
Dan Williams62232e452015-06-08 14:27:06 -040033 unsigned long *dsm_mask;
Dan Williamse6dfb2d2015-04-25 03:56:17 -040034 struct device dev;
35 int id;
36};
37
Dan Williams62232e452015-06-08 14:27:06 -040038bool is_nvdimm(struct device *dev);
Dan Williamse6dfb2d2015-04-25 03:56:17 -040039struct nvdimm_bus *walk_to_nvdimm_bus(struct device *nd_dev);
Dan Williams45def222015-04-26 19:26:48 -040040int __init nvdimm_bus_init(void);
41void __exit nvdimm_bus_exit(void);
42int nvdimm_bus_create_ndctl(struct nvdimm_bus *nvdimm_bus);
43void nvdimm_bus_destroy_ndctl(struct nvdimm_bus *nvdimm_bus);
Dan Williamsb94d5232015-05-19 22:54:31 -040044#endif /* __ND_CORE_H__ */