1 #include <linux/kernel.h>
11 struct request_pm_state rqpm;
16 if ((drive->
dn & 1) == 0 || pair ==
NULL)
20 memset(&rqpm, 0,
sizeof(rqpm));
22 rq->cmd_type = REQ_TYPE_PM_SUSPEND;
27 rqpm.pm_state = mesg.
event;
34 if ((drive->
dn & 1) || pair ==
NULL)
47 struct request_pm_state rqpm;
52 if ((drive->
dn & 1) == 0 || pair ==
NULL) {
60 memset(&rqpm, 0,
sizeof(rqpm));
62 rq->cmd_type = REQ_TYPE_PM_RESUME;
71 if (err == 0 && dev->
driver) {
83 struct request_pm_state *
pm = rq->special;
87 drive->
name, pm->pm_step);
92 switch (pm->pm_step) {
113 struct request_pm_state *
pm = rq->special;
116 switch (pm->pm_step) {
121 if (ata_id_flush_enabled(drive->
id) == 0 ||
126 if (ata_id_flush_ext_enabled(drive->
id))
135 ide_set_max_pio(drive);
185 struct request_pm_state *
pm = rq->special;
193 printk(
"%s: completing PM request, %s\n", drive->
name,
194 (rq->cmd_type == REQ_TYPE_PM_SUSPEND) ?
"suspend" :
"resume");
197 if (rq->cmd_type == REQ_TYPE_PM_SUSPEND)
201 spin_unlock_irqrestore(q->queue_lock, flags);
211 struct request_pm_state *
pm = rq->special;
213 if (rq->cmd_type == REQ_TYPE_PM_SUSPEND &&
217 else if (rq->cmd_type == REQ_TYPE_PM_RESUME &&
233 printk(
"%s: Wakeup request inited, waiting for !BSY...\n", drive->
name);
246 spin_unlock_irqrestore(q->queue_lock, flags);