aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-12 11:02:03 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-12 11:02:03 -0400
commit82681a318f9f028ea64e61f24bbd9ac535531921 (patch)
tree529b6a5b4fd040fb54b7672b1a224ebd47445876 /drivers/message/fusion/mptsas.c
parent3860c97bd60a4525bb62eb90e3e7d2f02662ac59 (diff)
parent8ebf975608aaebd7feb33d77f07ba21a6380e086 (diff)
[SCSI] Merge branch 'linus'
Conflicts: drivers/message/fusion/mptsas.c fixed up conflict between req->data_len accessors and mptsas driver updates. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 14c490a767a4..20e0b447e8e8 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -2135,8 +2135,8 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
2135 /* do we need to support multiple segments? */ 2135 /* do we need to support multiple segments? */
2136 if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) { 2136 if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) {
2137 printk(MYIOC_s_ERR_FMT "%s: multiple segments req %u %u, rsp %u %u\n", 2137 printk(MYIOC_s_ERR_FMT "%s: multiple segments req %u %u, rsp %u %u\n",
2138 ioc->name, __func__, req->bio->bi_vcnt, req->data_len, 2138 ioc->name, __func__, req->bio->bi_vcnt, blk_rq_bytes(req),
2139 rsp->bio->bi_vcnt, rsp->data_len); 2139 rsp->bio->bi_vcnt, blk_rq_bytes(rsp));
2140 return -EINVAL; 2140 return -EINVAL;
2141 } 2141 }
2142 2142
@@ -2153,7 +2153,7 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
2153 smpreq = (SmpPassthroughRequest_t *)mf; 2153 smpreq = (SmpPassthroughRequest_t *)mf;
2154 memset(smpreq, 0, sizeof(*smpreq)); 2154 memset(smpreq, 0, sizeof(*smpreq));
2155 2155
2156 smpreq->RequestDataLength = cpu_to_le16(req->data_len - 4); 2156 smpreq->RequestDataLength = cpu_to_le16(blk_rq_bytes(req) - 4);
2157 smpreq->Function = MPI_FUNCTION_SMP_PASSTHROUGH; 2157 smpreq->Function = MPI_FUNCTION_SMP_PASSTHROUGH;
2158 2158
2159 if (rphy) 2159 if (rphy)
@@ -2179,10 +2179,10 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
2179 MPI_SGE_FLAGS_END_OF_BUFFER | 2179 MPI_SGE_FLAGS_END_OF_BUFFER |
2180 MPI_SGE_FLAGS_DIRECTION) 2180 MPI_SGE_FLAGS_DIRECTION)
2181 << MPI_SGE_FLAGS_SHIFT; 2181 << MPI_SGE_FLAGS_SHIFT;
2182 flagsLength |= (req->data_len - 4); 2182 flagsLength |= (blk_rq_bytes(req) - 4);
2183 2183
2184 dma_addr_out = pci_map_single(ioc->pcidev, bio_data(req->bio), 2184 dma_addr_out = pci_map_single(ioc->pcidev, bio_data(req->bio),
2185 req->data_len, PCI_DMA_BIDIRECTIONAL); 2185 blk_rq_bytes(req), PCI_DMA_BIDIRECTIONAL);
2186 if (!dma_addr_out) 2186 if (!dma_addr_out)
2187 goto put_mf; 2187 goto put_mf;
2188 ioc->add_sge(psge, flagsLength, dma_addr_out); 2188 ioc->add_sge(psge, flagsLength, dma_addr_out);
@@ -2195,9 +2195,9 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
2195 MPI_SGE_FLAGS_END_OF_BUFFER; 2195 MPI_SGE_FLAGS_END_OF_BUFFER;
2196 2196
2197 flagsLength = flagsLength << MPI_SGE_FLAGS_SHIFT; 2197 flagsLength = flagsLength << MPI_SGE_FLAGS_SHIFT;
2198 flagsLength |= rsp->data_len + 4; 2198 flagsLength |= blk_rq_bytes(rsp) + 4;
2199 dma_addr_in = pci_map_single(ioc->pcidev, bio_data(rsp->bio), 2199 dma_addr_in = pci_map_single(ioc->pcidev, bio_data(rsp->bio),
2200 rsp->data_len, PCI_DMA_BIDIRECTIONAL); 2200 blk_rq_bytes(rsp), PCI_DMA_BIDIRECTIONAL);
2201 if (!dma_addr_in) 2201 if (!dma_addr_in)
2202 goto unmap; 2202 goto unmap;
2203 ioc->add_sge(psge, flagsLength, dma_addr_in); 2203 ioc->add_sge(psge, flagsLength, dma_addr_in);
@@ -2221,8 +2221,8 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
2221 smprep = (SmpPassthroughReply_t *)ioc->sas_mgmt.reply; 2221 smprep = (SmpPassthroughReply_t *)ioc->sas_mgmt.reply;
2222 memcpy(req->sense, smprep, sizeof(*smprep)); 2222 memcpy(req->sense, smprep, sizeof(*smprep));
2223 req->sense_len = sizeof(*smprep); 2223 req->sense_len = sizeof(*smprep);
2224 req->data_len = 0; 2224 req->resid_len = 0;
2225 rsp->data_len -= smprep->ResponseDataLength; 2225 rsp->resid_len -= smprep->ResponseDataLength;
2226 } else { 2226 } else {
2227 printk(MYIOC_s_ERR_FMT 2227 printk(MYIOC_s_ERR_FMT
2228 "%s: smp passthru reply failed to be returned\n", 2228 "%s: smp passthru reply failed to be returned\n",
@@ -2231,10 +2231,10 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
2231 } 2231 }
2232unmap: 2232unmap:
2233 if (dma_addr_out) 2233 if (dma_addr_out)
2234 pci_unmap_single(ioc->pcidev, dma_addr_out, req->data_len, 2234 pci_unmap_single(ioc->pcidev, dma_addr_out, blk_rq_bytes(req),
2235 PCI_DMA_BIDIRECTIONAL); 2235 PCI_DMA_BIDIRECTIONAL);
2236 if (dma_addr_in) 2236 if (dma_addr_in)
2237 pci_unmap_single(ioc->pcidev, dma_addr_in, rsp->data_len, 2237 pci_unmap_single(ioc->pcidev, dma_addr_in, blk_rq_bytes(rsp),
2238 PCI_DMA_BIDIRECTIONAL); 2238 PCI_DMA_BIDIRECTIONAL);
2239put_mf: 2239put_mf:
2240 if (mf) 2240 if (mf)