target_core_rd.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef TARGET_CORE_RD_H
  2. #define TARGET_CORE_RD_H
  3. #include <linux/module.h>
  4. #include <linux/types.h>
  5. #include <target/target_core_base.h>
  6. #define RD_HBA_VERSION "v4.0"
  7. #define RD_MCP_VERSION "4.0"
  8. /* Largest piece of memory kmalloc can allocate */
  9. #define RD_MAX_ALLOCATION_SIZE 65536
  10. #define RD_DEVICE_QUEUE_DEPTH 32
  11. #define RD_MAX_DEVICE_QUEUE_DEPTH 128
  12. #define RD_BLOCKSIZE 512
  13. /* Used in target_core_init_configfs() for virtual LUN 0 access */
  14. int __init rd_module_init(void);
  15. void rd_module_exit(void);
  16. struct rd_dev_sg_table {
  17. u32 page_start_offset;
  18. u32 page_end_offset;
  19. u32 rd_sg_count;
  20. struct scatterlist *sg_table;
  21. } ____cacheline_aligned;
  22. #define RDF_HAS_PAGE_COUNT 0x01
  23. #define RDF_NULLIO 0x02
  24. struct rd_dev {
  25. struct se_device dev;
  26. u32 rd_flags;
  27. /* Unique Ramdisk Device ID in Ramdisk HBA */
  28. u32 rd_dev_id;
  29. /* Total page count for ramdisk device */
  30. u32 rd_page_count;
  31. /* Number of SG tables in sg_table_array */
  32. u32 sg_table_count;
  33. /* Number of SG tables in sg_prot_array */
  34. u32 sg_prot_count;
  35. /* Array of rd_dev_sg_table_t containing scatterlists */
  36. struct rd_dev_sg_table *sg_table_array;
  37. /* Array of rd_dev_sg_table containing protection scatterlists */
  38. struct rd_dev_sg_table *sg_prot_array;
  39. /* Ramdisk HBA device is connected to */
  40. struct rd_host *rd_host;
  41. } ____cacheline_aligned;
  42. struct rd_host {
  43. u32 rd_host_dev_id_count;
  44. u32 rd_host_id; /* Unique Ramdisk Host ID */
  45. } ____cacheline_aligned;
  46. #endif /* TARGET_CORE_RD_H */