Commit d1786713 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[SCSI] ultrastor: convert to use the data buffer accessors

- remove the unnecessary map_single path.

- convert to use the new accessors for the sg lists and the
parameters.

Jens Axboe <jens.axboe@oracle.com> did the for_each_sg cleanup.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent e7d6cf55
...@@ -675,16 +675,15 @@ static const char *ultrastor_info(struct Scsi_Host * shpnt) ...@@ -675,16 +675,15 @@ static const char *ultrastor_info(struct Scsi_Host * shpnt)
static inline void build_sg_list(struct mscp *mscp, struct scsi_cmnd *SCpnt) static inline void build_sg_list(struct mscp *mscp, struct scsi_cmnd *SCpnt)
{ {
struct scatterlist *sl; struct scatterlist *sg;
long transfer_length = 0; long transfer_length = 0;
int i, max; int i, max;
sl = (struct scatterlist *) SCpnt->request_buffer; max = scsi_sg_count(SCpnt);
max = SCpnt->use_sg; scsi_for_each_sg(SCpnt, sg, max, i) {
for (i = 0; i < max; i++) { mscp->sglist[i].address = isa_page_to_bus(sg->page) + sg->offset;
mscp->sglist[i].address = isa_page_to_bus(sl[i].page) + sl[i].offset; mscp->sglist[i].num_bytes = sg->length;
mscp->sglist[i].num_bytes = sl[i].length; transfer_length += sg->length;
transfer_length += sl[i].length;
} }
mscp->number_of_sg_list = max; mscp->number_of_sg_list = max;
mscp->transfer_data = isa_virt_to_bus(mscp->sglist); mscp->transfer_data = isa_virt_to_bus(mscp->sglist);
...@@ -730,15 +729,15 @@ static int ultrastor_queuecommand(struct scsi_cmnd *SCpnt, ...@@ -730,15 +729,15 @@ static int ultrastor_queuecommand(struct scsi_cmnd *SCpnt,
my_mscp->target_id = SCpnt->device->id; my_mscp->target_id = SCpnt->device->id;
my_mscp->ch_no = 0; my_mscp->ch_no = 0;
my_mscp->lun = SCpnt->device->lun; my_mscp->lun = SCpnt->device->lun;
if (SCpnt->use_sg) { if (scsi_sg_count(SCpnt)) {
/* Set scatter/gather flag in SCSI command packet */ /* Set scatter/gather flag in SCSI command packet */
my_mscp->sg = TRUE; my_mscp->sg = TRUE;
build_sg_list(my_mscp, SCpnt); build_sg_list(my_mscp, SCpnt);
} else { } else {
/* Unset scatter/gather flag in SCSI command packet */ /* Unset scatter/gather flag in SCSI command packet */
my_mscp->sg = FALSE; my_mscp->sg = FALSE;
my_mscp->transfer_data = isa_virt_to_bus(SCpnt->request_buffer); my_mscp->transfer_data = isa_virt_to_bus(scsi_sglist(SCpnt));
my_mscp->transfer_data_length = SCpnt->request_bufflen; my_mscp->transfer_data_length = scsi_bufflen(SCpnt);
} }
my_mscp->command_link = 0; /*???*/ my_mscp->command_link = 0; /*???*/
my_mscp->scsi_command_link_id = 0; /*???*/ my_mscp->scsi_command_link_id = 0; /*???*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment