diff options
author | Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com> | 2015-03-26 10:41:31 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 19:56:18 -0400 |
commit | dab04b0151975103ed6c56a0c03e66dd85f6c158 (patch) | |
tree | 408b0da094f097e75777cec6cb0cd31c37a3b27c | |
parent | ef6162333a6910007c0ae2237e750ffd5bf25811 (diff) |
aacraid: AIF raw device remove support
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r-- | drivers/scsi/aacraid/aacraid.h | 3 | ||||
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 33 |
2 files changed, 36 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 2ba158b50fa2..fe014a6e69f9 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h | |||
@@ -2065,6 +2065,9 @@ extern struct aac_common aac_config; | |||
2065 | /* PMC NEW COMM: Request the event data */ | 2065 | /* PMC NEW COMM: Request the event data */ |
2066 | #define AifReqEvent 200 | 2066 | #define AifReqEvent 200 |
2067 | 2067 | ||
2068 | /* RAW device deleted */ | ||
2069 | #define AifRawDeviceRemove 203 | ||
2070 | |||
2068 | /* | 2071 | /* |
2069 | * Adapter Initiated FIB command structures. Start with the adapter | 2072 | * Adapter Initiated FIB command structures. Start with the adapter |
2070 | * initiated FIBs that really come from the adapter, and get responded | 2073 | * initiated FIBs that really come from the adapter, and get responded |
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 1a3c0e0068de..4da574925284 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c | |||
@@ -883,6 +883,39 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) | |||
883 | switch (le32_to_cpu(aifcmd->command)) { | 883 | switch (le32_to_cpu(aifcmd->command)) { |
884 | case AifCmdDriverNotify: | 884 | case AifCmdDriverNotify: |
885 | switch (le32_to_cpu(((__le32 *)aifcmd->data)[0])) { | 885 | switch (le32_to_cpu(((__le32 *)aifcmd->data)[0])) { |
886 | case AifRawDeviceRemove: | ||
887 | container = le32_to_cpu(((__le32 *)aifcmd->data)[1]); | ||
888 | if ((container >> 28)) { | ||
889 | container = (u32)-1; | ||
890 | break; | ||
891 | } | ||
892 | channel = (container >> 24) & 0xF; | ||
893 | if (channel >= dev->maximum_num_channels) { | ||
894 | container = (u32)-1; | ||
895 | break; | ||
896 | } | ||
897 | id = container & 0xFFFF; | ||
898 | if (id >= dev->maximum_num_physicals) { | ||
899 | container = (u32)-1; | ||
900 | break; | ||
901 | } | ||
902 | lun = (container >> 16) & 0xFF; | ||
903 | container = (u32)-1; | ||
904 | channel = aac_phys_to_logical(channel); | ||
905 | device_config_needed = | ||
906 | (((__le32 *)aifcmd->data)[0] == | ||
907 | cpu_to_le32(AifRawDeviceRemove)) ? DELETE : ADD; | ||
908 | |||
909 | if (device_config_needed == ADD) { | ||
910 | device = scsi_device_lookup( | ||
911 | dev->scsi_host_ptr, | ||
912 | channel, id, lun); | ||
913 | if (device) { | ||
914 | scsi_remove_device(device); | ||
915 | scsi_device_put(device); | ||
916 | } | ||
917 | } | ||
918 | break; | ||
886 | /* | 919 | /* |
887 | * Morph or Expand complete | 920 | * Morph or Expand complete |
888 | */ | 921 | */ |