diff options
author | Christoph Hellwig <hch@lst.de> | 2015-11-28 15:03:49 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-12-01 18:59:39 +0100 |
commit | 5fd4ce1b005bd6ede913763f65efae9af6f7f386 (patch) | |
tree | 8affb57680ec92a39c6beeef20efcf5f7b22ccaa /drivers/nvme/host/nvme.h | |
parent | nvme: move remaining CC setup into nvme_enable_ctrl (diff) | |
download | linux-5fd4ce1b005bd6ede913763f65efae9af6f7f386.tar.xz linux-5fd4ce1b005bd6ede913763f65efae9af6f7f386.zip |
nvme: move nvme_{enable,disable,shutdown}_ctrl to common code
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r-- | drivers/nvme/host/nvme.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index f7f16e32104f..b6c5a55ed59f 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -27,6 +27,9 @@ extern unsigned char nvme_io_timeout; extern unsigned char admin_timeout; #define ADMIN_TIMEOUT (admin_timeout * HZ) +extern unsigned char shutdown_timeout; +#define SHUTDOWN_TIMEOUT (shutdown_timeout * HZ) + enum { NVME_NS_LBA = 0, NVME_NS_LIGHTNVM = 1, @@ -55,6 +58,10 @@ struct nvme_ctrl { char serial[20]; char model[40]; char firmware_rev[8]; + + u32 ctrl_config; + + u32 page_size; u16 oncs; u16 abort_limit; u8 event_limit; @@ -85,6 +92,7 @@ struct nvme_ns { struct nvme_ctrl_ops { int (*reg_read32)(struct nvme_ctrl *ctrl, u32 off, u32 *val); + int (*reg_write32)(struct nvme_ctrl *ctrl, u32 off, u32 val); void (*free_ctrl)(struct nvme_ctrl *ctrl); }; @@ -165,6 +173,9 @@ static inline int nvme_error_status(u16 status) } } +int nvme_disable_ctrl(struct nvme_ctrl *ctrl, u64 cap); +int nvme_enable_ctrl(struct nvme_ctrl *ctrl, u64 cap); +int nvme_shutdown_ctrl(struct nvme_ctrl *ctrl); void nvme_put_ctrl(struct nvme_ctrl *ctrl); void nvme_put_ns(struct nvme_ns *ns); |