aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-01-22 23:09:37 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-26 23:01:29 -0500
commit9506437921504df18c6601f7d09bb23d72d2f6ba (patch)
tree9cac6bc442d39cdbd9251009ee1b7cabb161728b /drivers
parenta72ec4ce6d3ae92e76baf5b2c65cc26e5e775e83 (diff)
[PATCH] libata: create pio/atapi task queueing wrappers
Wrap pio/atapi task queueing in correspondingly named functions. This change doesn't change anything. It's preparation for follow-up pio-task/eh sync patch. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-core.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 93ae2dcc837c..71de697e2327 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1072,6 +1072,24 @@ static unsigned int ata_pio_modes(const struct ata_device *adev)
1072 timing API will get this right anyway */ 1072 timing API will get this right anyway */
1073} 1073}
1074 1074
1075static inline void
1076ata_queue_packet_task(struct ata_port *ap)
1077{
1078 queue_work(ata_wq, &ap->packet_task);
1079}
1080
1081static inline void
1082ata_queue_pio_task(struct ata_port *ap)
1083{
1084 queue_work(ata_wq, &ap->pio_task);
1085}
1086
1087static inline void
1088ata_queue_delayed_pio_task(struct ata_port *ap, unsigned long delay)
1089{
1090 queue_delayed_work(ata_wq, &ap->pio_task, delay);
1091}
1092
1075void ata_qc_complete_internal(struct ata_queued_cmd *qc) 1093void ata_qc_complete_internal(struct ata_queued_cmd *qc)
1076{ 1094{
1077 struct completion *waiting = qc->private_data; 1095 struct completion *waiting = qc->private_data;
@@ -3414,7 +3432,7 @@ fsm_start:
3414 } 3432 }
3415 3433
3416 if (timeout) 3434 if (timeout)
3417 queue_delayed_work(ata_wq, &ap->pio_task, timeout); 3435 ata_queue_delayed_pio_task(ap, timeout);
3418 else if (!qc_completed) 3436 else if (!qc_completed)
3419 goto fsm_start; 3437 goto fsm_start;
3420} 3438}
@@ -3737,26 +3755,26 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
3737 ata_qc_set_polling(qc); 3755 ata_qc_set_polling(qc);
3738 ata_tf_to_host(ap, &qc->tf); 3756 ata_tf_to_host(ap, &qc->tf);
3739 ap->hsm_task_state = HSM_ST; 3757 ap->hsm_task_state = HSM_ST;
3740 queue_work(ata_wq, &ap->pio_task); 3758 ata_queue_pio_task(ap);
3741 break; 3759 break;
3742 3760
3743 case ATA_PROT_ATAPI: 3761 case ATA_PROT_ATAPI:
3744 ata_qc_set_polling(qc); 3762 ata_qc_set_polling(qc);
3745 ata_tf_to_host(ap, &qc->tf); 3763 ata_tf_to_host(ap, &qc->tf);
3746 queue_work(ata_wq, &ap->packet_task); 3764 ata_queue_packet_task(ap);
3747 break; 3765 break;
3748 3766
3749 case ATA_PROT_ATAPI_NODATA: 3767 case ATA_PROT_ATAPI_NODATA:
3750 ap->flags |= ATA_FLAG_NOINTR; 3768 ap->flags |= ATA_FLAG_NOINTR;
3751 ata_tf_to_host(ap, &qc->tf); 3769 ata_tf_to_host(ap, &qc->tf);
3752 queue_work(ata_wq, &ap->packet_task); 3770 ata_queue_packet_task(ap);
3753 break; 3771 break;
3754 3772
3755 case ATA_PROT_ATAPI_DMA: 3773 case ATA_PROT_ATAPI_DMA:
3756 ap->flags |= ATA_FLAG_NOINTR; 3774 ap->flags |= ATA_FLAG_NOINTR;
3757 ap->ops->tf_load(ap, &qc->tf); /* load tf registers */ 3775 ap->ops->tf_load(ap, &qc->tf); /* load tf registers */
3758 ap->ops->bmdma_setup(qc); /* set up bmdma */ 3776 ap->ops->bmdma_setup(qc); /* set up bmdma */
3759 queue_work(ata_wq, &ap->packet_task); 3777 ata_queue_packet_task(ap);
3760 break; 3778 break;
3761 3779
3762 default: 3780 default:
@@ -4187,7 +4205,7 @@ static void atapi_packet_task(void *_data)
4187 4205
4188 /* PIO commands are handled by polling */ 4206 /* PIO commands are handled by polling */
4189 ap->hsm_task_state = HSM_ST; 4207 ap->hsm_task_state = HSM_ST;
4190 queue_work(ata_wq, &ap->pio_task); 4208 ata_queue_pio_task(ap);
4191 } 4209 }
4192 4210
4193 return; 4211 return;