fpga-region.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _FPGA_REGION_H
  2. #define _FPGA_REGION_H
  3. #include <linux/device.h>
  4. #include <linux/fpga/fpga-mgr.h>
  5. #include <linux/fpga/fpga-bridge.h>
  6. /**
  7. * struct fpga_region - FPGA Region structure
  8. * @dev: FPGA Region device
  9. * @mutex: enforces exclusive reference to region
  10. * @bridge_list: list of FPGA bridges specified in region
  11. * @mgr: FPGA manager
  12. * @info: FPGA image info
  13. * @priv: private data
  14. * @get_bridges: optional function to get bridges to a list
  15. */
  16. struct fpga_region {
  17. struct device dev;
  18. struct mutex mutex; /* for exclusive reference to region */
  19. struct list_head bridge_list;
  20. struct fpga_manager *mgr;
  21. struct fpga_image_info *info;
  22. void *priv;
  23. int (*get_bridges)(struct fpga_region *region);
  24. };
  25. #define to_fpga_region(d) container_of(d, struct fpga_region, dev)
  26. struct fpga_region *fpga_region_class_find(
  27. struct device *start, const void *data,
  28. int (*match)(struct device *, const void *));
  29. int fpga_region_program_fpga(struct fpga_region *region);
  30. struct fpga_region
  31. *fpga_region_create(struct device *dev, struct fpga_manager *mgr,
  32. int (*get_bridges)(struct fpga_region *));
  33. void fpga_region_free(struct fpga_region *region);
  34. int fpga_region_register(struct fpga_region *region);
  35. void fpga_region_unregister(struct fpga_region *region);
  36. #endif /* _FPGA_REGION_H */