Commit 0ac21092 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB storage drivers

fix for scsi memory address changes.  Now the datafab and jumpshot drivers build properly.
parent 0d4a3ac6
......@@ -265,7 +265,7 @@ static int datafab_read_data(struct us_data *us,
while (sg_idx < use_sg && transferred < len) {
if (len - transferred >= sg[sg_idx].length - current_sg_offset) {
US_DEBUGP("datafab_read_data: adding %d bytes to %d byte sg buffer\n", sg[sg_idx].length - current_sg_offset, sg[sg_idx].length);
memcpy(sg[sg_idx].address + current_sg_offset,
memcpy(page_address(sg[sg_idx].page) + sg[sg_idx].offset + current_sg_offset,
buffer + transferred,
sg[sg_idx].length - current_sg_offset);
transferred += sg[sg_idx].length - current_sg_offset;
......@@ -274,7 +274,7 @@ static int datafab_read_data(struct us_data *us,
++sg_idx;
} else {
US_DEBUGP("datafab_read_data: adding %d bytes to %d byte sg buffer\n", len - transferred, sg[sg_idx].length);
memcpy(sg[sg_idx].address + current_sg_offset,
memcpy(page_address(sg[sg_idx].page) + sg[sg_idx].offset + current_sg_offset,
buffer + transferred,
len - transferred);
current_sg_offset += len - transferred;
......@@ -356,7 +356,7 @@ static int datafab_write_data(struct us_data *us,
if (len - transferred >= sg[sg_idx].length - current_sg_offset) {
US_DEBUGP("datafab_write_data: getting %d bytes from %d byte sg buffer\n", sg[sg_idx].length - current_sg_offset, sg[sg_idx].length);
memcpy(ptr + transferred,
sg[sg_idx].address + current_sg_offset,
page_address(sg[sg_idx].page) + sg[sg_idx].offset + current_sg_offset,
sg[sg_idx].length - current_sg_offset);
transferred += sg[sg_idx].length - current_sg_offset;
current_sg_offset = 0;
......@@ -365,7 +365,7 @@ static int datafab_write_data(struct us_data *us,
} else {
US_DEBUGP("datafab_write_data: getting %d bytes from %d byte sg buffer\n", len - transferred, sg[sg_idx].length);
memcpy(ptr + transferred,
sg[sg_idx].address + current_sg_offset,
page_address(sg[sg_idx].page) + sg[sg_idx].offset + current_sg_offset,
len - transferred);
current_sg_offset += len - transferred;
// we only copied part of this sg buffer
......
......@@ -341,7 +341,7 @@ static int jumpshot_read_data(struct us_data *us,
while (sg_idx < use_sg && transferred < len) {
if (len - transferred >= sg[sg_idx].length - current_sg_offset) {
US_DEBUGP("jumpshot_read_data: adding %d bytes to %d byte sg buffer\n", sg[sg_idx].length - current_sg_offset, sg[sg_idx].length);
memcpy(sg[sg_idx].address + current_sg_offset,
memcpy(page_address(sg[sg_idx].page) + sg[sg_idx].offset + current_sg_offset,
buffer + transferred,
sg[sg_idx].length - current_sg_offset);
transferred += sg[sg_idx].length - current_sg_offset;
......@@ -350,7 +350,7 @@ static int jumpshot_read_data(struct us_data *us,
++sg_idx;
} else {
US_DEBUGP("jumpshot_read_data: adding %d bytes to %d byte sg buffer\n", len - transferred, sg[sg_idx].length);
memcpy(sg[sg_idx].address + current_sg_offset,
memcpy(page_address(sg[sg_idx].page) + sg[sg_idx].offset + current_sg_offset,
buffer + transferred,
len - transferred);
current_sg_offset += len - transferred;
......@@ -423,7 +423,7 @@ static int jumpshot_write_data(struct us_data *us,
if (len - transferred >= sg[sg_idx].length - current_sg_offset) {
US_DEBUGP("jumpshot_write_data: getting %d bytes from %d byte sg buffer\n", sg[sg_idx].length - current_sg_offset, sg[sg_idx].length);
memcpy(ptr + transferred,
sg[sg_idx].address + current_sg_offset,
page_address(sg[sg_idx].page) + sg[sg_idx].offset + current_sg_offset,
sg[sg_idx].length - current_sg_offset);
transferred += sg[sg_idx].length - current_sg_offset;
current_sg_offset = 0;
......@@ -432,7 +432,7 @@ static int jumpshot_write_data(struct us_data *us,
} else {
US_DEBUGP("jumpshot_write_data: getting %d bytes from %d byte sg buffer\n", len - transferred, sg[sg_idx].length);
memcpy(ptr + transferred,
sg[sg_idx].address + current_sg_offset,
page_address(sg[sg_idx].page) + sg[sg_idx].offset + current_sg_offset,
len - transferred);
current_sg_offset += len - transferred;
// we only copied part of this sg buffer
......
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