nvme.h: untangle AEN notice definitions

Stop including the event type in the definitions for the notice type.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
This commit is contained in:
Christoph Hellwig 2018-05-22 11:09:54 +02:00
Родитель 1367bc8285
Коммит 868c2392a7
2 изменённых файлов: 31 добавлений и 21 удалений

Просмотреть файл

@ -3321,26 +3321,9 @@ static void nvme_fw_act_work(struct work_struct *work)
nvme_get_fw_slot_info(ctrl); nvme_get_fw_slot_info(ctrl);
} }
void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status, static void nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
volatile union nvme_result *res)
{ {
u32 result = le32_to_cpu(res->u32); switch ((result & 0xff00) >> 8) {
if (le16_to_cpu(status) >> 1 != NVME_SC_SUCCESS)
return;
switch (result & 0x7) {
case NVME_AER_ERROR:
case NVME_AER_SMART:
case NVME_AER_CSS:
case NVME_AER_VS:
ctrl->aen_result = result;
break;
default:
break;
}
switch (result & 0xff07) {
case NVME_AER_NOTICE_NS_CHANGED: case NVME_AER_NOTICE_NS_CHANGED:
dev_info(ctrl->device, "rescanning\n"); dev_info(ctrl->device, "rescanning\n");
nvme_queue_scan(ctrl); nvme_queue_scan(ctrl);
@ -3351,6 +3334,29 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
default: default:
dev_warn(ctrl->device, "async event result %08x\n", result); dev_warn(ctrl->device, "async event result %08x\n", result);
} }
}
void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
volatile union nvme_result *res)
{
u32 result = le32_to_cpu(res->u32);
if (le16_to_cpu(status) >> 1 != NVME_SC_SUCCESS)
return;
switch (result & 0x7) {
case NVME_AER_NOTICE:
nvme_handle_aen_notice(ctrl, result);
break;
case NVME_AER_ERROR:
case NVME_AER_SMART:
case NVME_AER_CSS:
case NVME_AER_VS:
ctrl->aen_result = result;
break;
default:
break;
}
queue_work(nvme_wq, &ctrl->async_event_work); queue_work(nvme_wq, &ctrl->async_event_work);
} }
EXPORT_SYMBOL_GPL(nvme_complete_async_event); EXPORT_SYMBOL_GPL(nvme_complete_async_event);

Просмотреть файл

@ -436,10 +436,14 @@ enum {
enum { enum {
NVME_AER_ERROR = 0, NVME_AER_ERROR = 0,
NVME_AER_SMART = 1, NVME_AER_SMART = 1,
NVME_AER_NOTICE = 2,
NVME_AER_CSS = 6, NVME_AER_CSS = 6,
NVME_AER_VS = 7, NVME_AER_VS = 7,
NVME_AER_NOTICE_NS_CHANGED = 0x0002, };
NVME_AER_NOTICE_FW_ACT_STARTING = 0x0102,
enum {
NVME_AER_NOTICE_NS_CHANGED = 0x00,
NVME_AER_NOTICE_FW_ACT_STARTING = 0x01,
}; };
struct nvme_lba_range_type { struct nvme_lba_range_type {