target_core_rd.h 1.4 KB

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