aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid/megaraid_sas.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 7de267e14458..4f39dd01936d 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -793,6 +793,20 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *))
793 return 0; 793 return 0;
794} 794}
795 795
796static int megasas_slave_configure(struct scsi_device *sdev)
797{
798 /*
799 * Don't export physical disk devices to the disk driver.
800 *
801 * FIXME: Currently we don't export them to the midlayer at all.
802 * That will be fixed once LSI engineers have audited the
803 * firmware for possible issues.
804 */
805 if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == TYPE_DISK)
806 return -ENXIO;
807 return 0;
808}
809
796/** 810/**
797 * megasas_wait_for_outstanding - Wait for all outstanding cmds 811 * megasas_wait_for_outstanding - Wait for all outstanding cmds
798 * @instance: Adapter soft state 812 * @instance: Adapter soft state
@@ -943,6 +957,7 @@ static struct scsi_host_template megasas_template = {
943 .module = THIS_MODULE, 957 .module = THIS_MODULE,
944 .name = "LSI Logic SAS based MegaRAID driver", 958 .name = "LSI Logic SAS based MegaRAID driver",
945 .proc_name = "megaraid_sas", 959 .proc_name = "megaraid_sas",
960 .slave_configure = megasas_slave_configure,
946 .queuecommand = megasas_queue_command, 961 .queuecommand = megasas_queue_command,
947 .eh_device_reset_handler = megasas_reset_device, 962 .eh_device_reset_handler = megasas_reset_device,
948 .eh_bus_reset_handler = megasas_reset_bus_host, 963 .eh_bus_reset_handler = megasas_reset_bus_host,
@@ -1071,20 +1086,6 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
1071 break; 1086 break;
1072 } 1087 }
1073 1088
1074 /*
1075 * Don't export physical disk devices to mid-layer.
1076 */
1077 if (!MEGASAS_IS_LOGICAL(cmd->scmd) &&
1078 (hdr->cmd_status == MFI_STAT_OK) &&
1079 (cmd->scmd->cmnd[0] == INQUIRY)) {
1080
1081 if (((*(u8 *) cmd->scmd->request_buffer) & 0x1F) ==
1082 TYPE_DISK) {
1083 cmd->scmd->result = DID_BAD_TARGET << 16;
1084 exception = 1;
1085 }
1086 }
1087
1088 case MFI_CMD_LD_READ: 1089 case MFI_CMD_LD_READ:
1089 case MFI_CMD_LD_WRITE: 1090 case MFI_CMD_LD_WRITE:
1090 1091