e3d6f909ed
This patch contains the squashed version of a number of cleanups and minor fixes from Andy's initial series (round 1) for target core this past spring. The condensed log looks like: target: use errno values instead of returning -1 for everything target: Rename transport_calc_sg_num to transport_init_task_sg target: Fix leak in error path in transport_init_task_sg target/pscsi: Remove pscsi_get_sh() usage target: Make two runtime checks into WARN_ONs target: Remove hba queue depth and convert to spin_lock_irq usage target: dev->dev_status_queue_obj is unused target: Make struct se_queue_req.cmd type struct se_cmd * target: Remove __transport_get_qr_from_queue() target: Rename se_dev->g_se_dev_list to se_dev_node target: Remove struct se_global target: Simplify scsi mib index table code target: Make dev_queue_obj a member of se_device instead of a pointer target: remove extraneous returns at end of void functions target: Ensure transport_dump_vpd_ident_type returns null-terminated str target: Function pointers don't need to use '&' to be assigned target: Fix comment in __transport_execute_tasks() target: Misc style cleanups target: rename struct pr_reservation_template to pr_reservation target: Remove #defines that just perform indirection target: Inline transport_get_task_from_execute_queue() target: Minor header comment fixes Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
70 lines
1.7 KiB
C
70 lines
1.7 KiB
C
#ifndef TARGET_CORE_RD_H
|
|
#define TARGET_CORE_RD_H
|
|
|
|
#define RD_HBA_VERSION "v4.0"
|
|
#define RD_DR_VERSION "4.0"
|
|
#define RD_MCP_VERSION "4.0"
|
|
|
|
/* Largest piece of memory kmalloc can allocate */
|
|
#define RD_MAX_ALLOCATION_SIZE 65536
|
|
#define RD_DEVICE_QUEUE_DEPTH 32
|
|
#define RD_MAX_DEVICE_QUEUE_DEPTH 128
|
|
#define RD_BLOCKSIZE 512
|
|
#define RD_MAX_SECTORS 1024
|
|
|
|
/* Used in target_core_init_configfs() for virtual LUN 0 access */
|
|
int __init rd_module_init(void);
|
|
void rd_module_exit(void);
|
|
|
|
#define RRF_EMULATE_CDB 0x01
|
|
#define RRF_GOT_LBA 0x02
|
|
|
|
struct rd_request {
|
|
struct se_task rd_task;
|
|
|
|
/* SCSI CDB from iSCSI Command PDU */
|
|
unsigned char rd_scsi_cdb[TCM_MAX_COMMAND_SIZE];
|
|
/* Offset from start of page */
|
|
u32 rd_offset;
|
|
/* Starting page in Ramdisk for request */
|
|
u32 rd_page;
|
|
/* Total number of pages needed for request */
|
|
u32 rd_page_count;
|
|
/* Scatterlist count */
|
|
u32 rd_size;
|
|
/* Ramdisk device */
|
|
struct rd_dev *rd_dev;
|
|
} ____cacheline_aligned;
|
|
|
|
struct rd_dev_sg_table {
|
|
u32 page_start_offset;
|
|
u32 page_end_offset;
|
|
u32 rd_sg_count;
|
|
struct scatterlist *sg_table;
|
|
} ____cacheline_aligned;
|
|
|
|
#define RDF_HAS_PAGE_COUNT 0x01
|
|
|
|
struct rd_dev {
|
|
int rd_direct;
|
|
u32 rd_flags;
|
|
/* Unique Ramdisk Device ID in Ramdisk HBA */
|
|
u32 rd_dev_id;
|
|
/* Total page count for ramdisk device */
|
|
u32 rd_page_count;
|
|
/* Number of SG tables in sg_table_array */
|
|
u32 sg_table_count;
|
|
u32 rd_queue_depth;
|
|
/* Array of rd_dev_sg_table_t containing scatterlists */
|
|
struct rd_dev_sg_table *sg_table_array;
|
|
/* Ramdisk HBA device is connected to */
|
|
struct rd_host *rd_host;
|
|
} ____cacheline_aligned;
|
|
|
|
struct rd_host {
|
|
u32 rd_host_dev_id_count;
|
|
u32 rd_host_id; /* Unique Ramdisk Host ID */
|
|
} ____cacheline_aligned;
|
|
|
|
#endif /* TARGET_CORE_RD_H */
|