patch-2.4.22 linux-2.4.22/include/asm-mips64/pci.h

Next file: linux-2.4.22/include/asm-mips64/pci_channel.h
Previous file: linux-2.4.22/include/asm-mips64/param.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-mips64/pci.h linux-2.4.22/include/asm-mips64/pci.h
@@ -23,10 +23,7 @@
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
 
-static inline void pcibios_set_master(struct pci_dev *dev)
-{
-	/* No special bus mastering setup handling */
-}
+extern void pcibios_set_master(struct pci_dev *dev);
 
 static inline void pcibios_penalize_isa_irq(int irq)
 {
@@ -100,7 +97,7 @@
 
 	dma_cache_wback_inv(addr, size);
 
-	return bus_to_baddr(hwdev->bus->number, __pa(ptr));
+	return bus_to_baddr(hwdev->bus, __pa(ptr));
 }
 
 /*
@@ -120,7 +117,7 @@
 	if (direction != PCI_DMA_TODEVICE) {
 		unsigned long addr;
 
-		addr = baddr_to_bus(hwdev, dma_addr) + PAGE_OFFSET;
+		addr = baddr_to_bus(hwdev->bus, dma_addr) + PAGE_OFFSET;
 		dma_cache_wback_inv(addr, size);
 	}
 }
@@ -141,7 +138,7 @@
 	addr = (unsigned long) page_address(page) + offset;
 	dma_cache_wback_inv(addr, size);
 
-	return bus_to_baddr(hwdev, page_to_phys(page) + offset);
+	return bus_to_baddr(hwdev->bus, page_to_phys(page) + offset);
 }
 
 static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
@@ -153,7 +150,7 @@
 	if (direction != PCI_DMA_TODEVICE) {
 		unsigned long addr;
 
-		addr = baddr_to_bus(hwdev, dma_address) + PAGE_OFFSET;
+		addr = baddr_to_bus(hwdev->bus, dma_address) + PAGE_OFFSET;
 		dma_cache_wback_inv(addr, size);
 	}
 }
@@ -199,10 +196,14 @@
 		if (sg->address) {
 			dma_cache_wback_inv((unsigned long)sg->address,
 			                    sg->length);
-			sg->dma_address = bus_to_baddr(hwdev, __pa(sg->address));
-		} else
+			sg->dma_address = bus_to_baddr(hwdev->bus, __pa(sg->address));
+		} else {
 			sg->dma_address = page_to_bus(sg->page) +
 			                  sg->offset;
+			dma_cache_wback_inv((unsigned long)
+				(page_address(sg->page) + sg->offset),
+				sg->length);
+		}
 	}
 
 	return nents;
@@ -255,7 +256,7 @@
 	if (direction == PCI_DMA_NONE)
 		out_of_line_bug();
 
-	addr = baddr_to_bus(hwdev, dma_handle) + PAGE_OFFSET;
+	addr = baddr_to_bus(hwdev->bus, dma_handle) + PAGE_OFFSET;
 	dma_cache_wback_inv(addr, size);
 }
 
@@ -313,13 +314,13 @@
 {
 	dma64_addr_t addr = page_to_phys(page) + offset;
 
-	return (dma64_addr_t) bus_to_baddr(hwdev->bus->number, addr);
+	return (dma64_addr_t) bus_to_baddr(pdev->bus, addr);
 }
 
 static inline struct page *pci_dac_dma_to_page(struct pci_dev *pdev,
 	dma64_addr_t dma_addr)
 {
-	unsigned long poff = baddr_to_bus(hwdev, dma_addr) >> PAGE_SHIFT;
+	unsigned long poff = baddr_to_bus(pdev->bus, dma_addr) >> PAGE_SHIFT;
 
 	return mem_map + poff;
 }
@@ -338,14 +339,14 @@
 	if (direction == PCI_DMA_NONE)
 		BUG();
 
-	addr = baddr_to_bus(hwdev->bus->number, dma_addr) + PAGE_OFFSET;
+	addr = baddr_to_bus(pdev->bus, dma_addr) + PAGE_OFFSET;
 	dma_cache_wback_inv(addr, len);
 }
 
 /*
  * Return the index of the PCI controller for device.
  */
-#define pci_controller_num(pdev)	(0)
+#define pci_controller_num(pdev)	({ (void)(pdev); 0; })
 
 /*
  * These macros should be used after a pci_map_sg call has been done

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