block: move PM request support to IDE

This removes the request types and hacks from the block code and into the
old IDE driver.  There is a small amunt of code duplication due to this,
but it's not too bad.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Christoph Hellwig 2015-04-17 22:37:20 +02:00 committed by Jens Axboe
parent ac7cdff00a
commit a7928c1578
9 changed files with 70 additions and 51 deletions

View file

@ -44,8 +44,14 @@ enum ata_cmd_type_bits {
REQ_TYPE_ATA_TASKFILE = REQ_TYPE_DRV_PRIV + 1,
REQ_TYPE_ATA_PC,
REQ_TYPE_ATA_SENSE, /* sense request */
REQ_TYPE_ATA_PM_SUSPEND,/* suspend request */
REQ_TYPE_ATA_PM_RESUME, /* resume request */
};
#define ata_pm_request(rq) \
((rq)->cmd_type == REQ_TYPE_ATA_PM_SUSPEND || \
(rq)->cmd_type == REQ_TYPE_ATA_PM_RESUME)
/* Error codes returned in rq->errors to the higher part of the driver. */
enum {
IDE_DRV_ERROR_GENERAL = 101,
@ -1321,6 +1327,19 @@ struct ide_port_info {
u8 udma_mask;
};
/*
* State information carried for REQ_TYPE_ATA_PM_SUSPEND and REQ_TYPE_ATA_PM_RESUME
* requests.
*/
struct ide_pm_state {
/* PM state machine step value, currently driver specific */
int pm_step;
/* requested PM state value (S1, S2, S3, S4, ...) */
u32 pm_state;
void* data; /* for driver use */
};
int ide_pci_init_one(struct pci_dev *, const struct ide_port_info *, void *);
int ide_pci_init_two(struct pci_dev *, struct pci_dev *,
const struct ide_port_info *, void *);