Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 1 | #ifndef TARGET_CORE_RD_H |
| 2 | #define TARGET_CORE_RD_H |
| 3 | |
| 4 | #define RD_HBA_VERSION "v4.0" |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 5 | #define RD_MCP_VERSION "4.0" |
| 6 | |
| 7 | /* Largest piece of memory kmalloc can allocate */ |
| 8 | #define RD_MAX_ALLOCATION_SIZE 65536 |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 9 | #define RD_DEVICE_QUEUE_DEPTH 32 |
| 10 | #define RD_MAX_DEVICE_QUEUE_DEPTH 128 |
| 11 | #define RD_BLOCKSIZE 512 |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 12 | |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 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 | |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 17 | struct rd_dev_sg_table { |
| 18 | u32 page_start_offset; |
| 19 | u32 page_end_offset; |
| 20 | u32 rd_sg_count; |
| 21 | struct scatterlist *sg_table; |
| 22 | } ____cacheline_aligned; |
| 23 | |
| 24 | #define RDF_HAS_PAGE_COUNT 0x01 |
Nicholas Bellinger | 52c0742 | 2013-05-11 16:16:49 -0700 | [diff] [blame] | 25 | #define RDF_NULLIO 0x02 |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 26 | |
| 27 | struct rd_dev { |
Christoph Hellwig | 0fd97cc | 2012-10-08 00:03:19 -0400 | [diff] [blame] | 28 | struct se_device dev; |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 29 | u32 rd_flags; |
| 30 | /* Unique Ramdisk Device ID in Ramdisk HBA */ |
| 31 | u32 rd_dev_id; |
| 32 | /* Total page count for ramdisk device */ |
| 33 | u32 rd_page_count; |
| 34 | /* Number of SG tables in sg_table_array */ |
| 35 | u32 sg_table_count; |
Nicholas Bellinger | d7e8eb5 | 2014-01-07 23:24:14 +0000 | [diff] [blame] | 36 | /* Number of SG tables in sg_prot_array */ |
| 37 | u32 sg_prot_count; |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 38 | /* Array of rd_dev_sg_table_t containing scatterlists */ |
| 39 | struct rd_dev_sg_table *sg_table_array; |
Nicholas Bellinger | d7e8eb5 | 2014-01-07 23:24:14 +0000 | [diff] [blame] | 40 | /* Array of rd_dev_sg_table containing protection scatterlists */ |
| 41 | struct rd_dev_sg_table *sg_prot_array; |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 42 | /* Ramdisk HBA device is connected to */ |
| 43 | struct rd_host *rd_host; |
| 44 | } ____cacheline_aligned; |
| 45 | |
| 46 | struct rd_host { |
| 47 | u32 rd_host_dev_id_count; |
| 48 | u32 rd_host_id; /* Unique Ramdisk Host ID */ |
| 49 | } ____cacheline_aligned; |
| 50 | |
| 51 | #endif /* TARGET_CORE_RD_H */ |