Commit e8be8201 authored by Heiko Carstens's avatar Heiko Carstens

s390/tape: fix virtual vs physical address confusion

Fix virtual vs physical address confusion and use new dma types and helper
functions to allow for type checking. This does not fix a bug since virtual
and physical address spaces are currently the same.
Tested-by: default avatarJan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: default avatarJan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 1b2ac5a6
...@@ -305,7 +305,9 @@ tape_ccw_cc(struct ccw1 *ccw, __u8 cmd_code, __u16 memsize, void *cda) ...@@ -305,7 +305,9 @@ tape_ccw_cc(struct ccw1 *ccw, __u8 cmd_code, __u16 memsize, void *cda)
ccw->cmd_code = cmd_code; ccw->cmd_code = cmd_code;
ccw->flags = CCW_FLAG_CC; ccw->flags = CCW_FLAG_CC;
ccw->count = memsize; ccw->count = memsize;
ccw->cda = (__u32)(addr_t) cda; ccw->cda = 0;
if (cda)
ccw->cda = virt_to_dma32(cda);
return ccw + 1; return ccw + 1;
} }
...@@ -315,7 +317,9 @@ tape_ccw_end(struct ccw1 *ccw, __u8 cmd_code, __u16 memsize, void *cda) ...@@ -315,7 +317,9 @@ tape_ccw_end(struct ccw1 *ccw, __u8 cmd_code, __u16 memsize, void *cda)
ccw->cmd_code = cmd_code; ccw->cmd_code = cmd_code;
ccw->flags = 0; ccw->flags = 0;
ccw->count = memsize; ccw->count = memsize;
ccw->cda = (__u32)(addr_t) cda; ccw->cda = 0;
if (cda)
ccw->cda = virt_to_dma32(cda);
return ccw + 1; return ccw + 1;
} }
...@@ -325,7 +329,7 @@ tape_ccw_cmd(struct ccw1 *ccw, __u8 cmd_code) ...@@ -325,7 +329,7 @@ tape_ccw_cmd(struct ccw1 *ccw, __u8 cmd_code)
ccw->cmd_code = cmd_code; ccw->cmd_code = cmd_code;
ccw->flags = 0; ccw->flags = 0;
ccw->count = 0; ccw->count = 0;
ccw->cda = (__u32)(addr_t) &ccw->cmd_code; ccw->cda = virt_to_dma32(&ccw->cmd_code);
return ccw + 1; return ccw + 1;
} }
...@@ -336,7 +340,7 @@ tape_ccw_repeat(struct ccw1 *ccw, __u8 cmd_code, int count) ...@@ -336,7 +340,7 @@ tape_ccw_repeat(struct ccw1 *ccw, __u8 cmd_code, int count)
ccw->cmd_code = cmd_code; ccw->cmd_code = cmd_code;
ccw->flags = CCW_FLAG_CC; ccw->flags = CCW_FLAG_CC;
ccw->count = 0; ccw->count = 0;
ccw->cda = (__u32)(addr_t) &ccw->cmd_code; ccw->cda = virt_to_dma32(&ccw->cmd_code);
ccw++; ccw++;
} }
return ccw; return ccw;
......
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