diff options
author | Hannes Reinecke <hare@suse.de> | 2012-12-17 03:53:35 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-02-13 14:27:22 -0500 |
commit | 0dfa1c5da3e4b6849d40f4c3fc43212b6359a09d (patch) | |
tree | a3417bdc2868a2c8bfa3f8670949038e8cebd512 | |
parent | 836dc9e3fbbab0c30aa6e664417225f5c1fb1c39 (diff) |
target: Export SPC inquiry emulation
Some target drivers might need to access the inquiry data
directly, without sending out the actual command.
So export these functions.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Nicholas Bellinger <nab@risingtidesystems.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_spc.c | 8 | ||||
-rw-r--r-- | include/target/target_core_backend.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 2d88f087d961..fa2447004006 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c | |||
@@ -66,8 +66,8 @@ static void spc_fill_alua_data(struct se_port *port, unsigned char *buf) | |||
66 | spin_unlock(&tg_pt_gp_mem->tg_pt_gp_mem_lock); | 66 | spin_unlock(&tg_pt_gp_mem->tg_pt_gp_mem_lock); |
67 | } | 67 | } |
68 | 68 | ||
69 | static sense_reason_t | 69 | sense_reason_t |
70 | spc_emulate_inquiry_std(struct se_cmd *cmd, char *buf) | 70 | spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf) |
71 | { | 71 | { |
72 | struct se_lun *lun = cmd->se_lun; | 72 | struct se_lun *lun = cmd->se_lun; |
73 | struct se_device *dev = cmd->se_dev; | 73 | struct se_device *dev = cmd->se_dev; |
@@ -104,6 +104,7 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, char *buf) | |||
104 | 104 | ||
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | EXPORT_SYMBOL(spc_emulate_inquiry_std); | ||
107 | 108 | ||
108 | /* unit serial number */ | 109 | /* unit serial number */ |
109 | static sense_reason_t | 110 | static sense_reason_t |
@@ -160,7 +161,7 @@ static void spc_parse_naa_6h_vendor_specific(struct se_device *dev, | |||
160 | * Device identification VPD, for a complete list of | 161 | * Device identification VPD, for a complete list of |
161 | * DESIGNATOR TYPEs see spc4r17 Table 459. | 162 | * DESIGNATOR TYPEs see spc4r17 Table 459. |
162 | */ | 163 | */ |
163 | static sense_reason_t | 164 | sense_reason_t |
164 | spc_emulate_evpd_83(struct se_cmd *cmd, unsigned char *buf) | 165 | spc_emulate_evpd_83(struct se_cmd *cmd, unsigned char *buf) |
165 | { | 166 | { |
166 | struct se_device *dev = cmd->se_dev; | 167 | struct se_device *dev = cmd->se_dev; |
@@ -404,6 +405,7 @@ check_scsi_name: | |||
404 | buf[3] = (len & 0xff); /* Page Length for VPD 0x83 */ | 405 | buf[3] = (len & 0xff); /* Page Length for VPD 0x83 */ |
405 | return 0; | 406 | return 0; |
406 | } | 407 | } |
408 | EXPORT_SYMBOL(spc_emulate_evpd_83); | ||
407 | 409 | ||
408 | /* Extended INQUIRY Data VPD Page */ | 410 | /* Extended INQUIRY Data VPD Page */ |
409 | static sense_reason_t | 411 | static sense_reason_t |
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index 507910992c59..819b0fc45215 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
@@ -53,6 +53,8 @@ void target_complete_cmd(struct se_cmd *, u8); | |||
53 | sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); | 53 | sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); |
54 | sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); | 54 | sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); |
55 | sector_t spc_get_write_same_sectors(struct se_cmd *cmd); | 55 | sector_t spc_get_write_same_sectors(struct se_cmd *cmd); |
56 | sense_reason_t spc_emulate_inquiry_std(struct se_cmd *, unsigned char *); | ||
57 | sense_reason_t spc_emulate_evpd_83(struct se_cmd *, unsigned char *); | ||
56 | 58 | ||
57 | sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); | 59 | sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); |
58 | u32 sbc_get_device_rev(struct se_device *dev); | 60 | u32 sbc_get_device_rev(struct se_device *dev); |