aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fmc-sdb.h
diff options
context:
space:
mode:
authorAlessandro Rubini <rubini@gnudd.com>2013-06-12 09:13:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-17 16:38:57 -0700
commite34fae7841b12d77f2621bd28fd41929879ef951 (patch)
treebdaefafd01ed704886d1d99badce309a902a2ece /include/linux/fmc-sdb.h
parentFMC: create drivers/fmc and toplevel Kconfig question (diff)
downloadlinux-dev-e34fae7841b12d77f2621bd28fd41929879ef951.tar.xz
linux-dev-e34fae7841b12d77f2621bd28fd41929879ef951.zip
FMC: add needed headers
This set of headers comes from commit ab23167f (current master of the project on ohwr.org). They define the basic data structures for FMC and its SDB support. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Juan David Gonzalez Cobas <dcobas@cern.ch> Acked-by: Emilio G. Cota <cota@braap.org> Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/fmc-sdb.h')
-rw-r--r--include/linux/fmc-sdb.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/linux/fmc-sdb.h b/include/linux/fmc-sdb.h
new file mode 100644
index 000000000000..1974317a9b3d
--- /dev/null
+++ b/include/linux/fmc-sdb.h
@@ -0,0 +1,36 @@
+/*
+ * This file is separate from sdb.h, because I want that one to remain
+ * unchanged (as far as possible) from the official sdb distribution
+ *
+ * This file and associated functionality are a playground for me to
+ * understand stuff which will later be implemented in more generic places.
+ */
+#include <linux/sdb.h>
+
+/* This is the union of all currently defined types */
+union sdb_record {
+ struct sdb_interconnect ic;
+ struct sdb_device dev;
+ struct sdb_bridge bridge;
+ struct sdb_integration integr;
+ struct sdb_empty empty;
+};
+
+struct fmc_device;
+
+/* Every sdb table is turned into this structure */
+struct sdb_array {
+ int len;
+ int level;
+ unsigned long baseaddr;
+ struct fmc_device *fmc; /* the device that hosts it */
+ struct sdb_array *parent; /* NULL at root */
+ union sdb_record *record; /* copies of the struct */
+ struct sdb_array **subtree; /* only valid for bridge items */
+};
+
+extern int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
+extern void fmc_show_sdb_tree(const struct fmc_device *fmc);
+extern signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor,
+ uint32_t device, unsigned long *sz);
+extern int fmc_free_sdb_tree(struct fmc_device *fmc);