diff options
author | Christoph Hellwig <hch@lst.de> | 2005-09-09 10:25:54 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-19 13:42:31 -0400 |
commit | 82ffb67164064752a56669511545316075b41e1d (patch) | |
tree | 7b5c92f76e25ddf66419668412db147cde35a410 /drivers/message/fusion/mptscsih.c | |
parent | 3ed7a4704beb66a155acd67b78b7e9a5674d55fb (diff) |
[SCSI] fusion core changes for SAS support
- various bits for SAS support from the LSI driver.
- use the device private data for the fusion target private data.
this should be using the midlayer target data framework, but we
can't move over to that until fusion has been switched to the
generic DV code
- use target ID and channel from the fusion target private data,
because those in scsi_device will be different for mptsas
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptscsih.c')
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 4a003dc5fde8..58b5fdee009a 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -1256,8 +1256,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
1256 | MPT_SCSI_HOST *hd; | 1256 | MPT_SCSI_HOST *hd; |
1257 | MPT_FRAME_HDR *mf; | 1257 | MPT_FRAME_HDR *mf; |
1258 | SCSIIORequest_t *pScsiReq; | 1258 | SCSIIORequest_t *pScsiReq; |
1259 | VirtDevice *pTarget; | 1259 | VirtDevice *pTarget = SCpnt->device->hostdata; |
1260 | int target; | ||
1261 | int lun; | 1260 | int lun; |
1262 | u32 datalen; | 1261 | u32 datalen; |
1263 | u32 scsictl; | 1262 | u32 scsictl; |
@@ -1267,12 +1266,9 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
1267 | int ii; | 1266 | int ii; |
1268 | 1267 | ||
1269 | hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata; | 1268 | hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata; |
1270 | target = SCpnt->device->id; | ||
1271 | lun = SCpnt->device->lun; | 1269 | lun = SCpnt->device->lun; |
1272 | SCpnt->scsi_done = done; | 1270 | SCpnt->scsi_done = done; |
1273 | 1271 | ||
1274 | pTarget = hd->Targets[target]; | ||
1275 | |||
1276 | dmfprintk((MYIOC_s_INFO_FMT "qcmd: SCpnt=%p, done()=%p\n", | 1272 | dmfprintk((MYIOC_s_INFO_FMT "qcmd: SCpnt=%p, done()=%p\n", |
1277 | (hd && hd->ioc) ? hd->ioc->name : "ioc?", SCpnt, done)); | 1273 | (hd && hd->ioc) ? hd->ioc->name : "ioc?", SCpnt, done)); |
1278 | 1274 | ||
@@ -1315,7 +1311,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
1315 | /* Default to untagged. Once a target structure has been allocated, | 1311 | /* Default to untagged. Once a target structure has been allocated, |
1316 | * use the Inquiry data to determine if device supports tagged. | 1312 | * use the Inquiry data to determine if device supports tagged. |
1317 | */ | 1313 | */ |
1318 | if ( pTarget | 1314 | if (pTarget |
1319 | && (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES) | 1315 | && (pTarget->tflags & MPT_TARGET_FLAGS_Q_YES) |
1320 | && (SCpnt->device->tagged_supported)) { | 1316 | && (SCpnt->device->tagged_supported)) { |
1321 | scsictl = scsidir | MPI_SCSIIO_CONTROL_SIMPLEQ; | 1317 | scsictl = scsidir | MPI_SCSIIO_CONTROL_SIMPLEQ; |
@@ -1325,8 +1321,8 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
1325 | 1321 | ||
1326 | /* Use the above information to set up the message frame | 1322 | /* Use the above information to set up the message frame |
1327 | */ | 1323 | */ |
1328 | pScsiReq->TargetID = (u8) target; | 1324 | pScsiReq->TargetID = (u8) pTarget->target_id; |
1329 | pScsiReq->Bus = (u8) SCpnt->device->channel; | 1325 | pScsiReq->Bus = pTarget->bus_id; |
1330 | pScsiReq->ChainOffset = 0; | 1326 | pScsiReq->ChainOffset = 0; |
1331 | pScsiReq->Function = MPI_FUNCTION_SCSI_IO_REQUEST; | 1327 | pScsiReq->Function = MPI_FUNCTION_SCSI_IO_REQUEST; |
1332 | pScsiReq->CDBLength = SCpnt->cmd_len; | 1328 | pScsiReq->CDBLength = SCpnt->cmd_len; |
@@ -1378,7 +1374,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
1378 | 1374 | ||
1379 | #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION | 1375 | #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION |
1380 | if (hd->ioc->bus_type == SCSI) { | 1376 | if (hd->ioc->bus_type == SCSI) { |
1381 | int dvStatus = hd->ioc->spi_data.dvStatus[target]; | 1377 | int dvStatus = hd->ioc->spi_data.dvStatus[pTarget->target_id]; |
1382 | int issueCmd = 1; | 1378 | int issueCmd = 1; |
1383 | 1379 | ||
1384 | if (dvStatus || hd->ioc->spi_data.forceDv) { | 1380 | if (dvStatus || hd->ioc->spi_data.forceDv) { |
@@ -2180,6 +2176,7 @@ mptscsih_slave_alloc(struct scsi_device *device) | |||
2180 | 2176 | ||
2181 | out: | 2177 | out: |
2182 | vdev->num_luns++; | 2178 | vdev->num_luns++; |
2179 | device->hostdata = vdev; | ||
2183 | return 0; | 2180 | return 0; |
2184 | } | 2181 | } |
2185 | 2182 | ||