Dan Williams | b94d523 | 2015-05-19 22:54:31 -0400 | [diff] [blame] | 1 | /* |
| 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 Williams | e6dfb2d | 2015-04-25 03:56:17 -0400 | [diff] [blame] | 18 | extern struct list_head nvdimm_bus_list; |
| 19 | extern struct mutex nvdimm_bus_list_mutex; |
| 20 | extern struct bus_type nvdimm_bus_type; |
Dan Williams | 62232e45 | 2015-06-08 14:27:06 -0400 | [diff] [blame^] | 21 | extern int nvdimm_major; |
Dan Williams | e6dfb2d | 2015-04-25 03:56:17 -0400 | [diff] [blame] | 22 | |
Dan Williams | b94d523 | 2015-05-19 22:54:31 -0400 | [diff] [blame] | 23 | struct nvdimm_bus { |
| 24 | struct nvdimm_bus_descriptor *nd_desc; |
Dan Williams | 45def22 | 2015-04-26 19:26:48 -0400 | [diff] [blame] | 25 | struct list_head list; |
Dan Williams | b94d523 | 2015-05-19 22:54:31 -0400 | [diff] [blame] | 26 | struct device dev; |
| 27 | int id; |
| 28 | }; |
Dan Williams | 45def22 | 2015-04-26 19:26:48 -0400 | [diff] [blame] | 29 | |
Dan Williams | e6dfb2d | 2015-04-25 03:56:17 -0400 | [diff] [blame] | 30 | struct nvdimm { |
| 31 | unsigned long flags; |
| 32 | void *provider_data; |
Dan Williams | 62232e45 | 2015-06-08 14:27:06 -0400 | [diff] [blame^] | 33 | unsigned long *dsm_mask; |
Dan Williams | e6dfb2d | 2015-04-25 03:56:17 -0400 | [diff] [blame] | 34 | struct device dev; |
| 35 | int id; |
| 36 | }; |
| 37 | |
Dan Williams | 62232e45 | 2015-06-08 14:27:06 -0400 | [diff] [blame^] | 38 | bool is_nvdimm(struct device *dev); |
Dan Williams | e6dfb2d | 2015-04-25 03:56:17 -0400 | [diff] [blame] | 39 | struct nvdimm_bus *walk_to_nvdimm_bus(struct device *nd_dev); |
Dan Williams | 45def22 | 2015-04-26 19:26:48 -0400 | [diff] [blame] | 40 | int __init nvdimm_bus_init(void); |
| 41 | void __exit nvdimm_bus_exit(void); |
| 42 | int nvdimm_bus_create_ndctl(struct nvdimm_bus *nvdimm_bus); |
| 43 | void nvdimm_bus_destroy_ndctl(struct nvdimm_bus *nvdimm_bus); |
Dan Williams | b94d523 | 2015-05-19 22:54:31 -0400 | [diff] [blame] | 44 | #endif /* __ND_CORE_H__ */ |