diff options
Diffstat (limited to 'include/target/target_core_backend.h')
-rw-r--r-- | include/target/target_core_backend.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index e475531565fd..e150e391878b 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define TARGET_CORE_BACKEND_H | 2 | #define TARGET_CORE_BACKEND_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <asm/unaligned.h> | ||
5 | #include <target/target_core_base.h> | 6 | #include <target/target_core_base.h> |
6 | 7 | ||
7 | #define TRANSPORT_FLAG_PASSTHROUGH 0x1 | 8 | #define TRANSPORT_FLAG_PASSTHROUGH 0x1 |
@@ -29,16 +30,13 @@ struct target_backend_ops { | |||
29 | 30 | ||
30 | struct se_device *(*alloc_device)(struct se_hba *, const char *); | 31 | struct se_device *(*alloc_device)(struct se_hba *, const char *); |
31 | int (*configure_device)(struct se_device *); | 32 | int (*configure_device)(struct se_device *); |
33 | void (*destroy_device)(struct se_device *); | ||
32 | void (*free_device)(struct se_device *device); | 34 | void (*free_device)(struct se_device *device); |
33 | 35 | ||
34 | ssize_t (*set_configfs_dev_params)(struct se_device *, | 36 | ssize_t (*set_configfs_dev_params)(struct se_device *, |
35 | const char *, ssize_t); | 37 | const char *, ssize_t); |
36 | ssize_t (*show_configfs_dev_params)(struct se_device *, char *); | 38 | ssize_t (*show_configfs_dev_params)(struct se_device *, char *); |
37 | 39 | ||
38 | void (*transport_complete)(struct se_cmd *cmd, | ||
39 | struct scatterlist *, | ||
40 | unsigned char *); | ||
41 | |||
42 | sense_reason_t (*parse_cdb)(struct se_cmd *cmd); | 40 | sense_reason_t (*parse_cdb)(struct se_cmd *cmd); |
43 | u32 (*get_device_type)(struct se_device *); | 41 | u32 (*get_device_type)(struct se_device *); |
44 | sector_t (*get_blocks)(struct se_device *); | 42 | sector_t (*get_blocks)(struct se_device *); |
@@ -71,6 +69,8 @@ void target_backend_unregister(const struct target_backend_ops *); | |||
71 | void target_complete_cmd(struct se_cmd *, u8); | 69 | void target_complete_cmd(struct se_cmd *, u8); |
72 | void target_complete_cmd_with_length(struct se_cmd *, u8, int); | 70 | void target_complete_cmd_with_length(struct se_cmd *, u8, int); |
73 | 71 | ||
72 | void transport_copy_sense_to_cmd(struct se_cmd *, unsigned char *); | ||
73 | |||
74 | sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); | 74 | sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); |
75 | sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); | 75 | sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); |
76 | sense_reason_t spc_emulate_inquiry_std(struct se_cmd *, unsigned char *); | 76 | sense_reason_t spc_emulate_inquiry_std(struct se_cmd *, unsigned char *); |
@@ -104,9 +104,18 @@ bool target_lun_is_rdonly(struct se_cmd *); | |||
104 | sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd, | 104 | sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd, |
105 | sense_reason_t (*exec_cmd)(struct se_cmd *cmd)); | 105 | sense_reason_t (*exec_cmd)(struct se_cmd *cmd)); |
106 | 106 | ||
107 | struct se_device *target_find_device(int id, bool do_depend); | ||
108 | |||
107 | bool target_sense_desc_format(struct se_device *dev); | 109 | bool target_sense_desc_format(struct se_device *dev); |
108 | sector_t target_to_linux_sector(struct se_device *dev, sector_t lb); | 110 | sector_t target_to_linux_sector(struct se_device *dev, sector_t lb); |
109 | bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib, | 111 | bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib, |
110 | struct request_queue *q); | 112 | struct request_queue *q); |
111 | 113 | ||
114 | |||
115 | /* Only use get_unaligned_be24() if reading p - 1 is allowed. */ | ||
116 | static inline uint32_t get_unaligned_be24(const uint8_t *const p) | ||
117 | { | ||
118 | return get_unaligned_be32(p - 1) & 0xffffffU; | ||
119 | } | ||
120 | |||
112 | #endif /* TARGET_CORE_BACKEND_H */ | 121 | #endif /* TARGET_CORE_BACKEND_H */ |