Lines Matching refs:sg
183 static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, in pci_map_sg() argument
191 for (i = 0; i < nents; i++, sg++) { in pci_map_sg()
192 if (sg->address && sg->page) in pci_map_sg()
194 else if (!sg->address && !sg->page) in pci_map_sg()
197 if (sg->address) { in pci_map_sg()
198 dma_cache_wback_inv((unsigned long)sg->address, in pci_map_sg()
199 sg->length); in pci_map_sg()
200 sg->dma_address = bus_to_baddr(hwdev->bus, __pa(sg->address)); in pci_map_sg()
202 sg->dma_address = page_to_bus(sg->page) + in pci_map_sg()
203 sg->offset; in pci_map_sg()
205 (page_address(sg->page) + sg->offset), in pci_map_sg()
206 sg->length); in pci_map_sg()
218 static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, in pci_unmap_sg() argument
229 for (i = 0; i < nents; i++, sg++) { in pci_unmap_sg()
230 if (sg->address && sg->page) in pci_unmap_sg()
232 else if (!sg->address && !sg->page) in pci_unmap_sg()
235 if (!sg->address) in pci_unmap_sg()
237 dma_cache_wback_inv((unsigned long)sg->address, sg->length); in pci_unmap_sg()
272 struct scatterlist *sg, in pci_dma_sync_sg() argument
284 for (i = 0; i < nelems; i++, sg++) in pci_dma_sync_sg()
285 dma_cache_wback_inv((unsigned long)sg->address, sg->length); in pci_dma_sync_sg()
359 #define sg_dma_address(sg) ((sg)->dma_address) argument
360 #define sg_dma_len(sg) ((sg)->length) argument