patch-2.4.0-test8 linux/include/asm-arm/pci.h

Next file: linux/include/asm-arm/pgalloc.h
Previous file: linux/include/asm-arm/mmu_context.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test7/linux/include/asm-arm/pci.h linux/include/asm-arm/pci.h
@@ -93,8 +93,10 @@
 {
 	int i;
 
-	for (i = 0; i < nents; i++, sg++)
+	for (i = 0; i < nents; i++, sg++) {
 		consistent_sync(sg->address, sg->length, direction);
+		sg->dma_address = virt_to_bus(sg->address);
+	}
 
 	return nents;
 }
@@ -136,7 +138,7 @@
 	int i;
 
 	for (i = 0; i < nelems; i++, sg++)
-		consistent_sync(sg->address, sg->length, 3);
+		consistent_sync(sg->address, sg->length, direction);
 }
 
 /* Return whether the given PCI device DMA address mask can
@@ -148,15 +150,6 @@
 {
 	return 1;
 }
-
-/* These macros should be used after a pci_map_sg call has been done
- * to get bus addresses of each of the SG entries and their lengths.
- * You should only work with the number of sg entries pci_map_sg
- * returns, or alternatively stop on the first sg_dma_len(sg) which
- * is 0.
- */
-#define sg_dma_address(sg)      (virt_to_bus((sg)->address))
-#define sg_dma_len(sg)          ((sg)->length)
 
 #endif /* __KERNEL__ */
  

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)