target_core_rd.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef TARGET_CORE_RD_H
  2. #define TARGET_CORE_RD_H
  3. #define RD_HBA_VERSION "v4.0"
  4. #define RD_DR_VERSION "4.0"
  5. #define RD_MCP_VERSION "4.0"
  6. /* Largest piece of memory kmalloc can allocate */
  7. #define RD_MAX_ALLOCATION_SIZE 65536
  8. #define RD_DEVICE_QUEUE_DEPTH 32
  9. #define RD_MAX_DEVICE_QUEUE_DEPTH 128
  10. #define RD_BLOCKSIZE 512
  11. #define RD_MAX_SECTORS 1024
  12. /* Used in target_core_init_configfs() for virtual LUN 0 access */
  13. int __init rd_module_init(void);
  14. void rd_module_exit(void);
  15. #define RRF_EMULATE_CDB 0x01
  16. #define RRF_GOT_LBA 0x02
  17. struct rd_request {
  18. struct se_task rd_task;
  19. /* Offset from start of page */
  20. u32 rd_offset;
  21. /* Starting page in Ramdisk for request */
  22. u32 rd_page;
  23. /* Total number of pages needed for request */
  24. u32 rd_page_count;
  25. /* Scatterlist count */
  26. u32 rd_size;
  27. } ____cacheline_aligned;
  28. struct rd_dev_sg_table {
  29. u32 page_start_offset;
  30. u32 page_end_offset;
  31. u32 rd_sg_count;
  32. struct scatterlist *sg_table;
  33. } ____cacheline_aligned;
  34. #define RDF_HAS_PAGE_COUNT 0x01
  35. struct rd_dev {
  36. int rd_direct;
  37. u32 rd_flags;
  38. /* Unique Ramdisk Device ID in Ramdisk HBA */
  39. u32 rd_dev_id;
  40. /* Total page count for ramdisk device */
  41. u32 rd_page_count;
  42. /* Number of SG tables in sg_table_array */
  43. u32 sg_table_count;
  44. u32 rd_queue_depth;
  45. /* Array of rd_dev_sg_table_t containing scatterlists */
  46. struct rd_dev_sg_table *sg_table_array;
  47. /* Ramdisk HBA device is connected to */
  48. struct rd_host *rd_host;
  49. } ____cacheline_aligned;
  50. struct rd_host {
  51. u32 rd_host_dev_id_count;
  52. u32 rd_host_id; /* Unique Ramdisk Host ID */
  53. } ____cacheline_aligned;
  54. #endif /* TARGET_CORE_RD_H */