diff options
author | 2007-10-15 08:19:33 -0700 | |
---|---|---|
committer | 2007-10-15 08:19:33 -0700 | |
commit | df3d80f5a5c74168be42788364d13cf6c83c7b9c (patch) | |
tree | 892a964c2fd28d028f2fb7471e8543d3f4006a58 /drivers/scsi/ps3rom.c | |
parent | Merge branch 'agp-patches' of master.kernel.org:/pub/scm/linux/kernel/git/air... (diff) | |
parent | [SCSI] gdth: fix CONFIG_ISA build failure (diff) | |
download | linux-df3d80f5a5c74168be42788364d13cf6c83c7b9c.tar.gz linux-df3d80f5a5c74168be42788364d13cf6c83c7b9c.tar.bz2 linux-df3d80f5a5c74168be42788364d13cf6c83c7b9c.zip |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (207 commits)
[SCSI] gdth: fix CONFIG_ISA build failure
[SCSI] esp_scsi: remove __dev{init,exit}
[SCSI] gdth: !use_sg cleanup and use of scsi accessors
[SCSI] gdth: Move members from SCp to gdth_cmndinfo, stage 2
[SCSI] gdth: Setup proper per-command private data
[SCSI] gdth: Remove gdth_ctr_tab[]
[SCSI] gdth: switch to modern scsi host registration
[SCSI] gdth: gdth_interrupt() gdth_get_status() & gdth_wait() fixes
[SCSI] gdth: clean up host private data
[SCSI] gdth: Remove virt hosts
[SCSI] gdth: Reorder scsi_host_template intitializers
[SCSI] gdth: kill gdth_{read,write}[bwl] wrappers
[SCSI] gdth: Remove 2.4.x support, in-kernel changelog
[SCSI] gdth: split out pci probing
[SCSI] gdth: split out eisa probing
[SCSI] gdth: split out isa probing
gdth: Make one abuse of scsi_cmnd less obvious
[SCSI] NCR5380: Use scsi_eh API for REQUEST_SENSE invocation
[SCSI] usb storage: use scsi_eh API in REQUEST_SENSE execution
[SCSI] scsi_error: Refactoring scsi_error to facilitate in synchronous REQUEST_SENSE
...
Diffstat (limited to 'drivers/scsi/ps3rom.c')
-rw-r--r-- | drivers/scsi/ps3rom.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c index b50f1e14f2a5..0f43d1d046d9 100644 --- a/drivers/scsi/ps3rom.c +++ b/drivers/scsi/ps3rom.c @@ -100,16 +100,16 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf) struct scatterlist *sgpnt; unsigned int buflen; - buflen = cmd->request_bufflen; + buflen = scsi_bufflen(cmd); if (!buflen) return 0; - if (!cmd->request_buffer) + if (!scsi_sglist(cmd)) return -1; - sgpnt = cmd->request_buffer; active = 1; - for (k = 0, req_len = 0, act_len = 0; k < cmd->use_sg; ++k, ++sgpnt) { + req_len = act_len = 0; + scsi_for_each_sg(cmd, sgpnt, scsi_sg_count(cmd), k) { if (active) { kaddr = kmap_atomic(sgpnt->page, KM_IRQ0); len = sgpnt->length; @@ -124,7 +124,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf) } req_len += sgpnt->length; } - cmd->resid = req_len - act_len; + scsi_set_resid(cmd, req_len - act_len); return 0; } @@ -138,15 +138,15 @@ static int fetch_to_dev_buffer(struct scsi_cmnd *cmd, void *buf) struct scatterlist *sgpnt; unsigned int buflen; - buflen = cmd->request_bufflen; + buflen = scsi_bufflen(cmd); if (!buflen) return 0; - if (!cmd->request_buffer) + if (!scsi_sglist(cmd)) return -1; - sgpnt = cmd->request_buffer; - for (k = 0, req_len = 0, fin = 0; k < cmd->use_sg; ++k, ++sgpnt) { + req_len = fin = 0; + scsi_for_each_sg(cmd, sgpnt, scsi_sg_count(cmd), k) { kaddr = kmap_atomic(sgpnt->page, KM_IRQ0); len = sgpnt->length; if ((req_len + len) > buflen) { @@ -177,12 +177,12 @@ static int ps3rom_atapi_request(struct ps3_storage_device *dev, memcpy(&atapi_cmnd.pkt, cmd->cmnd, 12); atapi_cmnd.pktlen = 12; atapi_cmnd.block_size = 1; /* transfer size is block_size * blocks */ - atapi_cmnd.blocks = atapi_cmnd.arglen = cmd->request_bufflen; + atapi_cmnd.blocks = atapi_cmnd.arglen = scsi_bufflen(cmd); atapi_cmnd.buffer = dev->bounce_lpar; switch (cmd->sc_data_direction) { case DMA_FROM_DEVICE: - if (cmd->request_bufflen >= CD_FRAMESIZE) + if (scsi_bufflen(cmd) >= CD_FRAMESIZE) atapi_cmnd.proto = DMA_PROTO; else atapi_cmnd.proto = PIO_DATA_IN_PROTO; @@ -190,7 +190,7 @@ static int ps3rom_atapi_request(struct ps3_storage_device *dev, break; case DMA_TO_DEVICE: - if (cmd->request_bufflen >= CD_FRAMESIZE) + if (scsi_bufflen(cmd) >= CD_FRAMESIZE) atapi_cmnd.proto = DMA_PROTO; else atapi_cmnd.proto = PIO_DATA_OUT_PROTO; |