target_core_rd.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. /* Maximum queuedepth for the Ramdisk HBA */
  9. #define RD_HBA_QUEUE_DEPTH 256
  10. #define RD_DEVICE_QUEUE_DEPTH 32
  11. #define RD_MAX_DEVICE_QUEUE_DEPTH 128
  12. #define RD_BLOCKSIZE 512
  13. #define RD_MAX_SECTORS 1024
  14. /* Used in target_core_init_configfs() for virtual LUN 0 access */
  15. int __init rd_module_init(void);
  16. void rd_module_exit(void);
  17. #define RRF_EMULATE_CDB 0x01
  18. #define RRF_GOT_LBA 0x02
  19. struct rd_request {
  20. struct se_task rd_task;
  21. /* SCSI CDB from iSCSI Command PDU */
  22. unsigned char rd_scsi_cdb[TCM_MAX_COMMAND_SIZE];
  23. /* Offset from start of page */
  24. u32 rd_offset;
  25. /* Starting page in Ramdisk for request */
  26. u32 rd_page;
  27. /* Total number of pages needed for request */
  28. u32 rd_page_count;
  29. /* Scatterlist count */
  30. u32 rd_size;
  31. /* Ramdisk device */
  32. struct rd_dev *rd_dev;
  33. } ____cacheline_aligned;
  34. struct rd_dev_sg_table {
  35. u32 page_start_offset;
  36. u32 page_end_offset;
  37. u32 rd_sg_count;
  38. struct scatterlist *sg_table;
  39. } ____cacheline_aligned;
  40. #define RDF_HAS_PAGE_COUNT 0x01
  41. struct rd_dev {
  42. int rd_direct;
  43. u32 rd_flags;
  44. /* Unique Ramdisk Device ID in Ramdisk HBA */
  45. u32 rd_dev_id;
  46. /* Total page count for ramdisk device */
  47. u32 rd_page_count;
  48. /* Number of SG tables in sg_table_array */
  49. u32 sg_table_count;
  50. u32 rd_queue_depth;
  51. /* Array of rd_dev_sg_table_t containing scatterlists */
  52. struct rd_dev_sg_table *sg_table_array;
  53. /* Ramdisk HBA device is connected to */
  54. struct rd_host *rd_host;
  55. } ____cacheline_aligned;
  56. struct rd_host {
  57. u32 rd_host_dev_id_count;
  58. u32 rd_host_id; /* Unique Ramdisk Host ID */
  59. } ____cacheline_aligned;
  60. #endif /* TARGET_CORE_RD_H */