diff options
| -rw-r--r-- | drivers/scsi/aacraid/aachba.c | 237 | ||||
| -rw-r--r-- | drivers/scsi/aacraid/aacraid.h | 74 | ||||
| -rw-r--r-- | drivers/scsi/aacraid/commctrl.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/aacraid/comminit.c | 54 | ||||
| -rw-r--r-- | drivers/scsi/aacraid/commsup.c | 22 | ||||
| -rw-r--r-- | drivers/scsi/aacraid/dpcsup.c | 6 | ||||
| -rw-r--r-- | drivers/scsi/aacraid/linit.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/aacraid/src.c | 85 |
8 files changed, 357 insertions, 125 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 52551662d107..d79457ac8bef 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c | |||
| @@ -135,6 +135,8 @@ struct inquiry_data { | |||
| 135 | static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* sgmap); | 135 | static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* sgmap); |
| 136 | static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* psg); | 136 | static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* psg); |
| 137 | static unsigned long aac_build_sgraw(struct scsi_cmnd* scsicmd, struct sgmapraw* psg); | 137 | static unsigned long aac_build_sgraw(struct scsi_cmnd* scsicmd, struct sgmapraw* psg); |
| 138 | static unsigned long aac_build_sgraw2(struct scsi_cmnd *scsicmd, struct aac_raw_io2 *rio2, int sg_max); | ||
| 139 | static int aac_convert_sgraw2(struct aac_raw_io2 *rio2, int pages, int nseg, int nseg_new); | ||
| 138 | static int aac_send_srb_fib(struct scsi_cmnd* scsicmd); | 140 | static int aac_send_srb_fib(struct scsi_cmnd* scsicmd); |
| 139 | #ifdef AAC_DETAILED_STATUS_INFO | 141 | #ifdef AAC_DETAILED_STATUS_INFO |
| 140 | static char *aac_get_status_string(u32 status); | 142 | static char *aac_get_status_string(u32 status); |
| @@ -152,10 +154,14 @@ int aac_commit = -1; | |||
| 152 | int startup_timeout = 180; | 154 | int startup_timeout = 180; |
| 153 | int aif_timeout = 120; | 155 | int aif_timeout = 120; |
| 154 | int aac_sync_mode; /* Only Sync. transfer - disabled */ | 156 | int aac_sync_mode; /* Only Sync. transfer - disabled */ |
| 157 | int aac_convert_sgl = 1; /* convert non-conformable s/g list - enabled */ | ||
| 155 | 158 | ||
| 156 | module_param(aac_sync_mode, int, S_IRUGO|S_IWUSR); | 159 | module_param(aac_sync_mode, int, S_IRUGO|S_IWUSR); |
| 157 | MODULE_PARM_DESC(aac_sync_mode, "Force sync. transfer mode" | 160 | MODULE_PARM_DESC(aac_sync_mode, "Force sync. transfer mode" |
| 158 | " 0=off, 1=on"); | 161 | " 0=off, 1=on"); |
| 162 | module_param(aac_convert_sgl, int, S_IRUGO|S_IWUSR); | ||
| 163 | MODULE_PARM_DESC(aac_convert_sgl, "Convert non-conformable s/g list" | ||
| 164 | " 0=off, 1=on"); | ||
| 159 | module_param(nondasd, int, S_IRUGO|S_IWUSR); | 165 | module_param(nondasd, int, S_IRUGO|S_IWUSR); |
| 160 | MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices." | 166 | MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices." |
| 161 | " 0=off, 1=on"); | 167 | " 0=off, 1=on"); |
| @@ -963,25 +969,44 @@ static void io_callback(void *context, struct fib * fibptr); | |||
| 963 | 969 | ||
| 964 | static int aac_read_raw_io(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 count) | 970 | static int aac_read_raw_io(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 count) |
| 965 | { | 971 | { |
| 966 | u16 fibsize; | 972 | struct aac_dev *dev = fib->dev; |
| 967 | struct aac_raw_io *readcmd; | 973 | u16 fibsize, command; |
| 974 | |||
| 968 | aac_fib_init(fib); | 975 | aac_fib_init(fib); |
| 969 | readcmd = (struct aac_raw_io *) fib_data(fib); | 976 | if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE2 && !dev->sync_mode) { |
| 970 | readcmd->block[0] = cpu_to_le32((u32)(lba&0xffffffff)); | 977 | struct aac_raw_io2 *readcmd2; |
| 971 | readcmd->block[1] = cpu_to_le32((u32)((lba&0xffffffff00000000LL)>>32)); | 978 | readcmd2 = (struct aac_raw_io2 *) fib_data(fib); |
| 972 | readcmd->count = cpu_to_le32(count<<9); | 979 | memset(readcmd2, 0, sizeof(struct aac_raw_io2)); |
| 973 | readcmd->cid = cpu_to_le16(scmd_id(cmd)); | 980 | readcmd2->blockLow = cpu_to_le32((u32)(lba&0xffffffff)); |
| 974 | readcmd->flags = cpu_to_le16(IO_TYPE_READ); | 981 | readcmd2->blockHigh = cpu_to_le32((u32)((lba&0xffffffff00000000LL)>>32)); |
| 975 | readcmd->bpTotal = 0; | 982 | readcmd2->byteCount = cpu_to_le32(count<<9); |
| 976 | readcmd->bpComplete = 0; | 983 | readcmd2->cid = cpu_to_le16(scmd_id(cmd)); |
| 984 | readcmd2->flags = cpu_to_le16(RIO2_IO_TYPE_READ); | ||
| 985 | aac_build_sgraw2(cmd, readcmd2, dev->scsi_host_ptr->sg_tablesize); | ||
| 986 | command = ContainerRawIo2; | ||
| 987 | fibsize = sizeof(struct aac_raw_io2) + | ||
| 988 | ((le32_to_cpu(readcmd2->sgeCnt)-1) * sizeof(struct sge_ieee1212)); | ||
| 989 | } else { | ||
| 990 | struct aac_raw_io *readcmd; | ||
| 991 | readcmd = (struct aac_raw_io *) fib_data(fib); | ||
| 992 | readcmd->block[0] = cpu_to_le32((u32)(lba&0xffffffff)); | ||
| 993 | readcmd->block[1] = cpu_to_le32((u32)((lba&0xffffffff00000000LL)>>32)); | ||
| 994 | readcmd->count = cpu_to_le32(count<<9); | ||
| 995 | readcmd->cid = cpu_to_le16(scmd_id(cmd)); | ||
| 996 | readcmd->flags = cpu_to_le16(RIO_TYPE_READ); | ||
| 997 | readcmd->bpTotal = 0; | ||
| 998 | readcmd->bpComplete = 0; | ||
| 999 | aac_build_sgraw(cmd, &readcmd->sg); | ||
| 1000 | command = ContainerRawIo; | ||
| 1001 | fibsize = sizeof(struct aac_raw_io) + | ||
| 1002 | ((le32_to_cpu(readcmd->sg.count)-1) * sizeof(struct sgentryraw)); | ||
| 1003 | } | ||
| 977 | 1004 | ||
| 978 | aac_build_sgraw(cmd, &readcmd->sg); | ||
| 979 | fibsize = sizeof(struct aac_raw_io) + ((le32_to_cpu(readcmd->sg.count) - 1) * sizeof (struct sgentryraw)); | ||
| 980 | BUG_ON(fibsize > (fib->dev->max_fib_size - sizeof(struct aac_fibhdr))); | 1005 | BUG_ON(fibsize > (fib->dev->max_fib_size - sizeof(struct aac_fibhdr))); |
| 981 | /* | 1006 | /* |
| 982 | * Now send the Fib to the adapter | 1007 | * Now send the Fib to the adapter |
| 983 | */ | 1008 | */ |
| 984 | return aac_fib_send(ContainerRawIo, | 1009 | return aac_fib_send(command, |
| 985 | fib, | 1010 | fib, |
| 986 | fibsize, | 1011 | fibsize, |
| 987 | FsaNormal, | 1012 | FsaNormal, |
| @@ -1052,28 +1077,50 @@ static int aac_read_block(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 | |||
| 1052 | 1077 | ||
| 1053 | static int aac_write_raw_io(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 count, int fua) | 1078 | static int aac_write_raw_io(struct fib * fib, struct scsi_cmnd * cmd, u64 lba, u32 count, int fua) |
| 1054 | { | 1079 | { |
| 1055 | u16 fibsize; | 1080 | struct aac_dev *dev = fib->dev; |
| 1056 | struct aac_raw_io *writecmd; | 1081 | u16 fibsize, command; |
| 1082 | |||
| 1057 | aac_fib_init(fib); | 1083 | aac_fib_init(fib); |
| 1058 | writecmd = (struct aac_raw_io *) fib_data(fib); | 1084 | if (dev->comm_interface == AAC_COMM_MESSAGE_TYPE2 && !dev->sync_mode) { |
| 1059 | writecmd->block[0] = cpu_to_le32((u32)(lba&0xffffffff)); | 1085 | struct aac_raw_io2 *writecmd2; |
| 1060 | writecmd->block[1] = cpu_to_le32((u32)((lba&0xffffffff00000000LL)>>32)); | 1086 | writecmd2 = (struct aac_raw_io2 *) fib_data(fib); |
| 1061 | writecmd->count = cpu_to_le32(count<<9); | 1087 | memset(writecmd2, 0, sizeof(struct aac_raw_io2)); |
| 1062 | writecmd->cid = cpu_to_le16(scmd_id(cmd)); | 1088 | writecmd2->blockLow = cpu_to_le32((u32)(lba&0xffffffff)); |
| 1063 | writecmd->flags = (fua && ((aac_cache & 5) != 1) && | 1089 | writecmd2->blockHigh = cpu_to_le32((u32)((lba&0xffffffff00000000LL)>>32)); |
| 1064 | (((aac_cache & 5) != 5) || !fib->dev->cache_protected)) ? | 1090 | writecmd2->byteCount = cpu_to_le32(count<<9); |
| 1065 | cpu_to_le16(IO_TYPE_WRITE|IO_SUREWRITE) : | 1091 | writecmd2->cid = cpu_to_le16(scmd_id(cmd)); |
| 1066 | cpu_to_le16(IO_TYPE_WRITE); | 1092 | writecmd2->flags = (fua && ((aac_cache & 5) != 1) && |
| 1067 | writecmd->bpTotal = 0; | 1093 | (((aac_cache & 5) != 5) || !fib->dev->cache_protected)) ? |
| 1068 | writecmd->bpComplete = 0; | 1094 | cpu_to_le16(RIO2_IO_TYPE_WRITE|RIO2_IO_SUREWRITE) : |
| 1069 | 1095 | cpu_to_le16(RIO2_IO_TYPE_WRITE); | |
| 1070 | aac_build_sgraw(cmd, &writecmd->sg); | 1096 | aac_build_sgraw2(cmd, writecmd2, dev->scsi_host_ptr->sg_tablesize); |
| 1071 | fibsize = sizeof(struct aac_raw_io) + ((le32_to_cpu(writecmd->sg.count) - 1) * sizeof (struct sgentryraw)); | 1097 | command = ContainerRawIo2; |
| 1098 | fibsize = sizeof(struct aac_raw_io2) + | ||
| 1099 | ((le32_to_cpu(writecmd2->sgeCnt)-1) * sizeof(struct sge_ieee1212)); | ||
| 1100 | } else { | ||
| 1101 | struct aac_raw_io *writecmd; | ||
| 1102 | writecmd = (struct aac_raw_io *) fib_data(fib); | ||
| 1103 | writecmd->block[0] = cpu_to_le32((u32)(lba&0xffffffff)); | ||
| 1104 | writecmd->block[1] = cpu_to_le32((u32)((lba&0xffffffff00000000LL)>>32)); | ||
| 1105 | writecmd->count = cpu_to_le32(count<<9); | ||
| 1106 | writecmd->cid = cpu_to_le16(scmd_id(cmd)); | ||
| 1107 | writecmd->flags = (fua && ((aac_cache & 5) != 1) && | ||
| 1108 | (((aac_cache & 5) != 5) || !fib->dev->cache_protected)) ? | ||
| 1109 | cpu_to_le16(RIO_TYPE_WRITE|RIO_SUREWRITE) : | ||
| 1110 | cpu_to_le16(RIO_TYPE_WRITE); | ||
| 1111 | writecmd->bpTotal = 0; | ||
| 1112 | writecmd->bpComplete = 0; | ||
| 1113 | aac_build_sgraw(cmd, &writecmd->sg); | ||
| 1114 | command = ContainerRawIo; | ||
| 1115 | fibsize = sizeof(struct aac_raw_io) + | ||
| 1116 | ((le32_to_cpu(writecmd->sg.count)-1) * sizeof (struct sgentryraw)); | ||
| 1117 | } | ||
| 1118 | |||
| 1072 | BUG_ON(fibsize > (fib->dev->max_fib_size - sizeof(struct aac_fibhdr))); | 1119 | BUG_ON(fibsize > (fib->dev->max_fib_size - sizeof(struct aac_fibhdr))); |
| 1073 | /* | 1120 | /* |
| 1074 | * Now send the Fib to the adapter | 1121 | * Now send the Fib to the adapter |
| 1075 | */ | 1122 | */ |
| 1076 | return aac_fib_send(ContainerRawIo, | 1123 | return aac_fib_send(command, |
| 1077 | fib, | 1124 | fib, |
| 1078 | fibsize, | 1125 | fibsize, |
| 1079 | FsaNormal, | 1126 | FsaNormal, |
| @@ -1492,8 +1539,6 @@ int aac_get_adapter_info(struct aac_dev* dev) | |||
| 1492 | dev->a_ops.adapter_write = aac_write_block; | 1539 | dev->a_ops.adapter_write = aac_write_block; |
| 1493 | } | 1540 | } |
| 1494 | dev->scsi_host_ptr->max_sectors = AAC_MAX_32BIT_SGBCOUNT; | 1541 | dev->scsi_host_ptr->max_sectors = AAC_MAX_32BIT_SGBCOUNT; |
| 1495 | if (dev->adapter_info.options & AAC_OPT_NEW_COMM_TYPE1) | ||
| 1496 | dev->adapter_info.options |= AAC_OPT_NEW_COMM; | ||
| 1497 | if (!(dev->adapter_info.options & AAC_OPT_NEW_COMM)) { | 1542 | if (!(dev->adapter_info.options & AAC_OPT_NEW_COMM)) { |
| 1498 | /* | 1543 | /* |
| 1499 | * Worst case size that could cause sg overflow when | 1544 | * Worst case size that could cause sg overflow when |
| @@ -2616,12 +2661,18 @@ static void aac_srb_callback(void *context, struct fib * fibptr) | |||
