13 static inline void dma_to_sec4_sg_one(
struct sec4_sg_entry *sec4_sg_ptr,
22 print_hex_dump(
KERN_ERR,
"sec4_sg_ptr@: ",
40 sg = scatterwalk_sg_next(sg);
43 return sec4_sg_ptr - 1;
50 static inline void sg_to_sec4_sg_last(
struct scatterlist *sg,
int sg_count,
54 sec4_sg_ptr = sg_to_sec4_sg(sg, sg_count, sec4_sg_ptr, offset);
70 sg = scatterwalk_sg_next(sg);
80 int sg_nents = __sg_count(sg_list, nbytes, chained);
94 for (i = 0; i < nents; i++) {
96 sg = scatterwalk_sg_next(sg);
110 for (i = 0; i < nents; i++) {
112 sg = scatterwalk_sg_next(sg);
124 int cpy_index = 0, next_cpy_index = current_sg->
length;
126 while (next_cpy_index < len) {
127 memcpy(dest + cpy_index, (
u8 *) sg_virt(current_sg),
129 current_sg = scatterwalk_sg_next(current_sg);
130 cpy_index = next_cpy_index;
131 next_cpy_index += current_sg->
length;
134 memcpy(dest + cpy_index, (
u8 *) sg_virt(current_sg),
139 static inline void sg_copy_part(
u8 *dest,
struct scatterlist *sg,
140 int to_skip,
unsigned int end)
143 int sg_index, cpy_index;
145 sg_index = current_sg->
length;
146 while (sg_index <= to_skip) {
147 current_sg = scatterwalk_sg_next(current_sg);
148 sg_index += current_sg->
length;
150 cpy_index = sg_index - to_skip;
151 memcpy(dest, (
u8 *) sg_virt(current_sg) +
152 current_sg->
length - cpy_index, cpy_index);
153 current_sg = scatterwalk_sg_next(current_sg);
155 sg_copy(dest + cpy_index, current_sg, end - sg_index);