Lines Matching refs:iter
97 struct mlx4_icm_iter *iter) in mlx4_icm_first() argument
99 iter->icm = icm; in mlx4_icm_first()
100 iter->chunk = list_empty(&icm->chunk_list) ? in mlx4_icm_first()
103 iter->page_idx = 0; in mlx4_icm_first()
106 static inline int mlx4_icm_last(struct mlx4_icm_iter *iter) in mlx4_icm_last() argument
108 return !iter->chunk; in mlx4_icm_last()
111 static inline void mlx4_icm_next(struct mlx4_icm_iter *iter) in mlx4_icm_next() argument
113 if (++iter->page_idx >= iter->chunk->nsg) { in mlx4_icm_next()
114 if (iter->chunk->list.next == &iter->icm->chunk_list) { in mlx4_icm_next()
115 iter->chunk = NULL; in mlx4_icm_next()
119 iter->chunk = list_entry(iter->chunk->list.next, in mlx4_icm_next()
121 iter->page_idx = 0; in mlx4_icm_next()
125 static inline dma_addr_t mlx4_icm_addr(struct mlx4_icm_iter *iter) in mlx4_icm_addr() argument
127 if (iter->chunk->coherent) in mlx4_icm_addr()
128 return iter->chunk->buf[iter->page_idx].dma_addr; in mlx4_icm_addr()
130 return sg_dma_address(&iter->chunk->sg[iter->page_idx]); in mlx4_icm_addr()
133 static inline unsigned long mlx4_icm_size(struct mlx4_icm_iter *iter) in mlx4_icm_size() argument
135 if (iter->chunk->coherent) in mlx4_icm_size()
136 return iter->chunk->buf[iter->page_idx].size; in mlx4_icm_size()
138 return sg_dma_len(&iter->chunk->sg[iter->page_idx]); in mlx4_icm_size()