diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-02 17:28:46 +0900 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-04-04 02:43:35 -0400 |
commit | 436d34b36202ef724778ded1e9cb10f8c37b32bc (patch) | |
tree | 45671994cf049263a25e7f540ae488b97bb7d01f /drivers | |
parent | a4ba7fe2a6c2b61419b290035bff398ab2591c54 (diff) |
libata: uninline atapi_cmd_type()
Uninline atapi_cmd_type(). It doesn't really have to be inline and
more case will be added which need to access unexported libata
variable.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 2db5c9c9ca1..e9b69ba489d 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -326,6 +326,39 @@ static void ata_force_horkage(struct ata_device *dev) } /** + * atapi_cmd_type - Determine ATAPI command type from SCSI opcode + * @opcode: SCSI opcode + * + * Determine ATAPI command type from @opcode. + * + * LOCKING: + * None. + * + * RETURNS: + * ATAPI_{READ|WRITE|READ_CD|PASS_THRU|MISC} + */ +int atapi_cmd_type(u8 opcode) +{ + switch (opcode) { + case GPCMD_READ_10: + case GPCMD_READ_12: + return ATAPI_READ; + + case GPCMD_WRITE_10: + case GPCMD_WRITE_12: + case GPCMD_WRITE_AND_VERIFY_10: + return ATAPI_WRITE; + + case GPCMD_READ_CD: + case GPCMD_READ_CD_MSF: + return ATAPI_READ_CD; + + default: + return ATAPI_MISC; + } +} + +/** * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure * @tf: Taskfile to convert * @pmp: Port multiplier port @@ -7774,6 +7807,7 @@ EXPORT_SYMBOL_GPL(ata_tf_read); EXPORT_SYMBOL_GPL(ata_noop_dev_select); EXPORT_SYMBOL_GPL(ata_std_dev_select); EXPORT_SYMBOL_GPL(sata_print_link_status); +EXPORT_SYMBOL_GPL(atapi_cmd_type); EXPORT_SYMBOL_GPL(ata_tf_to_fis); EXPORT_SYMBOL_GPL(ata_tf_from_fis); EXPORT_SYMBOL_GPL(ata_pack_xfermask); |