target_core_rd.h 1.8 KB

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