Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef TARGET_CORE_RD_H
0003 #define TARGET_CORE_RD_H
0004 
0005 #include <linux/module.h>
0006 #include <linux/types.h>
0007 #include <target/target_core_base.h>
0008 
0009 #define RD_HBA_VERSION      "v4.0"
0010 #define RD_MCP_VERSION      "4.0"
0011 
0012 /* Largest piece of memory kmalloc can allocate */
0013 #define RD_MAX_ALLOCATION_SIZE  65536
0014 #define RD_DEVICE_QUEUE_DEPTH   32
0015 #define RD_MAX_DEVICE_QUEUE_DEPTH 128
0016 #define RD_BLOCKSIZE        512
0017 
0018 /* Used in target_core_init_configfs() for virtual LUN 0 access */
0019 int __init rd_module_init(void);
0020 void rd_module_exit(void);
0021 
0022 struct rd_dev_sg_table {
0023     u32     page_start_offset;
0024     u32     page_end_offset;
0025     u32     rd_sg_count;
0026     struct scatterlist *sg_table;
0027 } ____cacheline_aligned;
0028 
0029 #define RDF_HAS_PAGE_COUNT  0x01
0030 #define RDF_NULLIO      0x02
0031 #define RDF_DUMMY       0x04
0032 
0033 struct rd_dev {
0034     struct se_device dev;
0035     u32     rd_flags;
0036     /* Unique Ramdisk Device ID in Ramdisk HBA */
0037     u32     rd_dev_id;
0038     /* Total page count for ramdisk device */
0039     u32     rd_page_count;
0040     /* Number of SG tables in sg_table_array */
0041     u32     sg_table_count;
0042     /* Number of SG tables in sg_prot_array */
0043     u32     sg_prot_count;
0044     /* Array of rd_dev_sg_table_t containing scatterlists */
0045     struct rd_dev_sg_table *sg_table_array;
0046     /* Array of rd_dev_sg_table containing protection scatterlists */
0047     struct rd_dev_sg_table *sg_prot_array;
0048     /* Ramdisk HBA device is connected to */
0049     struct rd_host *rd_host;
0050 } ____cacheline_aligned;
0051 
0052 struct rd_host {
0053     u32     rd_host_dev_id_count;
0054     u32     rd_host_id;     /* Unique Ramdisk Host ID */
0055 } ____cacheline_aligned;
0056 
0057 #endif /* TARGET_CORE_RD_H */