fmc-sdb.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * This file is separate from sdb.h, because I want that one to remain
  3. * unchanged (as far as possible) from the official sdb distribution
  4. *
  5. * This file and associated functionality are a playground for me to
  6. * understand stuff which will later be implemented in more generic places.
  7. */
  8. #include <linux/sdb.h>
  9. /* This is the union of all currently defined types */
  10. union sdb_record {
  11. struct sdb_interconnect ic;
  12. struct sdb_device dev;
  13. struct sdb_bridge bridge;
  14. struct sdb_integration integr;
  15. struct sdb_empty empty;
  16. };
  17. struct fmc_device;
  18. /* Every sdb table is turned into this structure */
  19. struct sdb_array {
  20. int len;
  21. int level;
  22. unsigned long baseaddr;
  23. struct fmc_device *fmc; /* the device that hosts it */
  24. struct sdb_array *parent; /* NULL at root */
  25. union sdb_record *record; /* copies of the struct */
  26. struct sdb_array **subtree; /* only valid for bridge items */
  27. };
  28. extern int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
  29. extern void fmc_show_sdb_tree(const struct fmc_device *fmc);
  30. extern signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor,
  31. uint32_t device, unsigned long *sz);
  32. extern int fmc_free_sdb_tree(struct fmc_device *fmc);