fpga-region.h 1007 B

1234567891011121314151617181920212223242526272829303132333435
  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. int fpga_region_program_fpga(struct fpga_region *region);
  27. int fpga_region_register(struct device *dev, struct fpga_region *region);
  28. int fpga_region_unregister(struct fpga_region *region);
  29. #endif /* _FPGA_REGION_H */