fmc-sdb.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. struct sdb_synthesis synthesis;
  17. struct sdb_repo_url repo_url;
  18. };
  19. struct fmc_device;
  20. /* Every sdb table is turned into this structure */
  21. struct sdb_array {
  22. int len;
  23. int level;
  24. unsigned long baseaddr;
  25. struct fmc_device *fmc; /* the device that hosts it */
  26. struct sdb_array *parent; /* NULL at root */
  27. union sdb_record *record; /* copies of the struct */
  28. struct sdb_array **subtree; /* only valid for bridge items */
  29. };
  30. extern int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
  31. extern void fmc_show_sdb_tree(const struct fmc_device *fmc);
  32. extern signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor,
  33. uint32_t device, unsigned long *sz);
  34. extern int fmc_free_sdb_tree(struct fmc_device *fmc);