patch-2.4.13 linux/include/asm-alpha/pci.h

Next file: linux/include/asm-alpha/scatterlist.h
Previous file: linux/include/asm-alpha/machvec.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.12/linux/include/asm-alpha/pci.h linux/include/asm-alpha/pci.h
@@ -15,6 +15,7 @@
 struct pci_bus;
 struct resource;
 struct pci_iommu_arena;
+struct page;
 
 /* A controller.  Used to manage multiple PCI busses.  */
 
@@ -60,12 +61,17 @@
 
 /* IOMMU controls.  */
 
+/* The PCI address space does not equal the physical memory address space.
+   The networking and block device layers use this boolean for bounce buffer
+   decisions.  */
+#define PCI_DMA_BUS_IS_PHYS  0
+
 /* Allocate and map kernel buffer using consistant mode DMA for PCI
    device.  Returns non-NULL cpu-view pointer to the buffer if
    successful and sets *DMA_ADDRP to the pci side dma address as well,
    else DMA_ADDRP is undefined.  */
 
-extern void *pci_alloc_consistent(struct pci_dev *, long, dma_addr_t *);
+extern void *pci_alloc_consistent(struct pci_dev *, size_t, dma_addr_t *);
 
 /* Free and unmap a consistant DMA buffer.  CPU_ADDR and DMA_ADDR must
    be values that were returned from pci_alloc_consistant.  SIZE must
@@ -73,14 +79,18 @@
    References to the memory and mappings assosciated with CPU_ADDR or
    DMA_ADDR past this call are illegal.  */
 
-extern void pci_free_consistent(struct pci_dev *, long, void *, dma_addr_t);
+extern void pci_free_consistent(struct pci_dev *, size_t, void *, dma_addr_t);
 
 /* Map a single buffer of the indicate size for PCI DMA in streaming
    mode.  The 32-bit PCI bus mastering address to use is returned.
    Once the device is given the dma address, the device owns this memory
    until either pci_unmap_single or pci_dma_sync_single is performed.  */
 
-extern dma_addr_t pci_map_single(struct pci_dev *, void *, long, int);
+extern dma_addr_t pci_map_single(struct pci_dev *, void *, size_t, int);
+
+/* Likewise, but for a page instead of an address.  */
+extern dma_addr_t pci_map_page(struct pci_dev *, struct page *,
+			       unsigned long, size_t, int);
 
 /* Unmap a single streaming mode DMA translation.  The DMA_ADDR and
    SIZE must match what was provided for in a previous pci_map_single
@@ -88,7 +98,8 @@
    the cpu to the buffer are guarenteed to see whatever the device
    wrote there.  */
 
-extern void pci_unmap_single(struct pci_dev *, dma_addr_t, long, int);
+extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
+extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int);
 
 /* Map a set of buffers described by scatterlist in streaming mode for
    PCI DMA.  This is the scather-gather version of the above
@@ -121,7 +132,7 @@
    point you give the PCI dma address back to the card, the device
    again owns the buffer.  */
 
-extern inline void
+static inline void
 pci_dma_sync_single(struct pci_dev *dev, dma_addr_t dma_addr, long size,
 		    int direction)
 {
@@ -132,7 +143,7 @@
    translations after a transfer.  The same as pci_dma_sync_single but
    for a scatter-gather list, same rules and usage.  */
 
-extern inline void
+static inline void
 pci_dma_sync_sg(struct pci_dev *dev, struct scatterlist *sg, int nents,
 	        int direction)
 {
@@ -144,7 +155,22 @@
    only drive the low 24-bits during PCI bus mastering, then
    you would pass 0x00ffffff as the mask to this function.  */
 
-extern int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask);
+extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
+
+/* True if the machine supports DAC addressing, and DEV can
+   make use of it given MASK.  */
+extern int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask);
+
+/* Convert to/from DAC dma address and struct page.  */
+extern dma64_addr_t pci_dac_page_to_dma(struct pci_dev *, struct page *, unsigned long, int);
+extern struct page *pci_dac_dma_to_page(struct pci_dev *, dma64_addr_t);
+extern unsigned long pci_dac_dma_to_offset(struct pci_dev *, dma64_addr_t);
+
+static __inline__ void
+pci_dac_dma_sync_single(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
+{
+	/* Nothing to do. */
+}
 
 /* Return the index of the PCI controller for device PDEV. */
 extern int pci_controller_num(struct pci_dev *pdev);

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