aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-18 02:56:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-18 02:56:30 -0400
commit1e42198609d73ed1a9adcba2af275c24c2678420 (patch)
tree32fd4d9073bfc0f3909af8f9fb4bcff38951d01a /drivers/ata/libata-core.c
parent794eb6bf20ebf992c040ea831cd3a9c64b0c1f7a (diff)
parent4b119e21d0c66c22e8ca03df05d9de623d0eb50f (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 48519887f94a..be95fdb69726 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -326,6 +326,44 @@ static void ata_force_horkage(struct ata_device *dev)
326} 326}
327 327
328/** 328/**
329 * atapi_cmd_type - Determine ATAPI command type from SCSI opcode
330 * @opcode: SCSI opcode
331 *
332 * Determine ATAPI command type from @opcode.
333 *
334 * LOCKING:
335 * None.
336 *
337 * RETURNS:
338 * ATAPI_{READ|WRITE|READ_CD|PASS_THRU|MISC}
339 */
340int atapi_cmd_type(u8 opcode)
341{
342 switch (opcode) {
343 case GPCMD_READ_10:
344 case GPCMD_READ_12:
345 return ATAPI_READ;
346
347 case GPCMD_WRITE_10:
348 case GPCMD_WRITE_12:
349 case GPCMD_WRITE_AND_VERIFY_10:
350 return ATAPI_WRITE;
351
352 case GPCMD_READ_CD:
353 case GPCMD_READ_CD_MSF:
354 return ATAPI_READ_CD;
355
356 case ATA_16:
357 case ATA_12:
358 if (atapi_passthru16)
359 return ATAPI_PASS_THRU;
360 /* fall thru */
361 default:
362 return ATAPI_MISC;
363 }
364}
365
366/**
329 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure 367 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
330 * @tf: Taskfile to convert 368 * @tf: Taskfile to convert
331 * @pmp: Port multiplier port 369 * @pmp: Port multiplier port
@@ -2660,7 +2698,7 @@ int ata_bus_probe(struct ata_port *ap)
2660 specific sequence bass-ackwards so that PDIAG- is released by 2698 specific sequence bass-ackwards so that PDIAG- is released by
2661 the slave device */ 2699 the slave device */
2662 2700
2663 ata_link_for_each_dev(dev, &ap->link) { 2701 ata_link_for_each_dev_reverse(dev, &ap->link) {
2664 if (tries[dev->devno]) 2702 if (tries[dev->devno])
2665 dev->class = classes[dev->devno]; 2703 dev->class = classes[dev->devno];
2666 2704
@@ -7774,6 +7812,7 @@ EXPORT_SYMBOL_GPL(ata_tf_read);
7774EXPORT_SYMBOL_GPL(ata_noop_dev_select); 7812EXPORT_SYMBOL_GPL(ata_noop_dev_select);
7775EXPORT_SYMBOL_GPL(ata_std_dev_select); 7813EXPORT_SYMBOL_GPL(ata_std_dev_select);
7776EXPORT_SYMBOL_GPL(sata_print_link_status); 7814EXPORT_SYMBOL_GPL(sata_print_link_status);
7815EXPORT_SYMBOL_GPL(atapi_cmd_type);
7777EXPORT_SYMBOL_GPL(ata_tf_to_fis); 7816EXPORT_SYMBOL_GPL(ata_tf_to_fis);
7778EXPORT_SYMBOL_GPL(ata_tf_from_fis); 7817EXPORT_SYMBOL_GPL(ata_tf_from_fis);
7779EXPORT_SYMBOL_GPL(ata_pack_xfermask); 7818EXPORT_SYMBOL_GPL(ata_pack_xfermask);