From 7e8a75f4dfbff173977b2f58799c3eceb7b09afd Mon Sep 17 00:00:00 2001 From: "Yang, Bo" Date: Tue, 6 Oct 2009 14:50:17 -0600 Subject: [SCSI] megaraid_sas: Add the support for updating the OS after adding/removing the devices from FW Driver will update the OS devices after adding and deleting the device from FW. When driver receive add or delete AEN from FW, driver will send the DCMD cmd to get the System PD list from FW. Then driver will check if this device already in the OS: If add event and OS don't have the device (but it is in the list), driver add the device to OS, otherwise driver will not add. If remove event, driver will check the list, if is not in the list, but OS have the device, driver will remove the device. Signed-off-by Bo Yang Signed-off-by: James Bottomley --- drivers/scsi/megaraid/megaraid_sas.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/scsi/megaraid/megaraid_sas.h') diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 13ac37e80075..cd1c008f9ab8 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -285,6 +285,17 @@ enum MR_PD_QUERY_TYPE { MR_PD_QUERY_TYPE_EXPOSED_TO_HOST = 5, }; +#define MR_EVT_CFG_CLEARED 0x0004 +#define MR_EVT_LD_STATE_CHANGE 0x0051 +#define MR_EVT_PD_INSERTED 0x005b +#define MR_EVT_PD_REMOVED 0x0070 +#define MR_EVT_LD_CREATED 0x008a +#define MR_EVT_LD_DELETED 0x008b +#define MR_EVT_FOREIGN_CFG_IMPORTED 0x00db +#define MR_EVT_LD_OFFLINE 0x00fc +#define MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED 0x0152 +#define MAX_LOGICAL_DRIVES 64 + enum MR_PD_STATE { MR_PD_STATE_UNCONFIGURED_GOOD = 0x00, MR_PD_STATE_UNCONFIGURED_BAD = 0x01, @@ -1157,6 +1168,11 @@ struct megasas_evt_detail { } __attribute__ ((packed)); +struct megasas_aen_event { + struct work_struct hotplug_work; + struct megasas_instance *instance; +}; + struct megasas_instance { u32 *producer; @@ -1176,6 +1192,7 @@ struct megasas_instance { u16 max_num_sge; u16 max_fw_cmds; u32 max_sectors_per_req; + struct megasas_aen_event *ev; struct megasas_cmd **cmd_list; struct list_head cmd_pool; -- cgit v1.2.2