From e1d118f16dca0f54faba3e8dd5b6adbbf7ac68c8 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Mon, 3 Jul 2006 12:02:28 -0400 Subject: [PATCH] ieee1394: coding style and comment fixes in midlayer header files Adjust tabulators, line wraps, empty lines, and comment style. Update comments in ieee1394_transactions.h and highlevel.h. Fix typo in comment in csr.h. Signed-off-by: Stefan Richter Signed-off-by: Ben Collins --- drivers/ieee1394/dma.h | 81 +++++++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 31 deletions(-) (limited to 'drivers/ieee1394/dma.h') diff --git a/drivers/ieee1394/dma.h b/drivers/ieee1394/dma.h index 061550a6fb9..b0f0885c455 100644 --- a/drivers/ieee1394/dma.h +++ b/drivers/ieee1394/dma.h @@ -13,66 +13,85 @@ #include #include -/* struct dma_prog_region - - a small, physically-contiguous DMA buffer with random-access, - synchronous usage characteristics -*/ - +/** + * struct dma_prog_region - small contiguous DMA buffer + * @kvirt: kernel virtual address + * @dev: PCI device + * @n_pages: number of kernel pages + * @bus_addr: base bus address + * + * a small, physically contiguous DMA buffer with random-access, synchronous + * usage characteristics + */ struct dma_prog_region { - unsigned char *kvirt; /* kernel virtual address */ - struct pci_dev *dev; /* PCI device */ - unsigned int n_pages; /* # of kernel pages */ - dma_addr_t bus_addr; /* base bus address */ + unsigned char *kvirt; + struct pci_dev *dev; + unsigned int n_pages; + dma_addr_t bus_addr; }; /* clear out all fields but do not allocate any memory */ void dma_prog_region_init(struct dma_prog_region *prog); -int dma_prog_region_alloc(struct dma_prog_region *prog, unsigned long n_bytes, struct pci_dev *dev); +int dma_prog_region_alloc(struct dma_prog_region *prog, unsigned long n_bytes, + struct pci_dev *dev); void dma_prog_region_free(struct dma_prog_region *prog); -static inline dma_addr_t dma_prog_region_offset_to_bus(struct dma_prog_region *prog, unsigned long offset) +static inline dma_addr_t dma_prog_region_offset_to_bus( + struct dma_prog_region *prog, unsigned long offset) { return prog->bus_addr + offset; } -/* struct dma_region - - a large, non-physically-contiguous DMA buffer with streaming, - asynchronous usage characteristics -*/ - +/** + * struct dma_region - large non-contiguous DMA buffer + * @virt: kernel virtual address + * @dev: PCI device + * @n_pages: number of kernel pages + * @n_dma_pages: number of IOMMU pages + * @sglist: IOMMU mapping + * @direction: PCI_DMA_TODEVICE, etc. + * + * a large, non-physically-contiguous DMA buffer with streaming, asynchronous + * usage characteristics + */ struct dma_region { - unsigned char *kvirt; /* kernel virtual address */ - struct pci_dev *dev; /* PCI device */ - unsigned int n_pages; /* # of kernel pages */ - unsigned int n_dma_pages; /* # of IOMMU pages */ - struct scatterlist *sglist; /* IOMMU mapping */ - int direction; /* PCI_DMA_TODEVICE, etc */ + unsigned char *kvirt; + struct pci_dev *dev; + unsigned int n_pages; + unsigned int n_dma_pages; + struct scatterlist *sglist; + int direction; }; /* clear out all fields but do not allocate anything */ void dma_region_init(struct dma_region *dma); /* allocate the buffer and map it to the IOMMU */ -int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes, struct pci_dev *dev, int direction); +int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes, + struct pci_dev *dev, int direction); /* unmap and free the buffer */ void dma_region_free(struct dma_region *dma); /* sync the CPU's view of the buffer */ -void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset, unsigned long len); +void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset, + unsigned long len); + /* sync the IO bus' view of the buffer */ -void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, unsigned long len); +void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, + unsigned long len); /* map the buffer into a user space process */ -int dma_region_mmap(struct dma_region *dma, struct file *file, struct vm_area_struct *vma); +int dma_region_mmap(struct dma_region *dma, struct file *file, + struct vm_area_struct *vma); /* macro to index into a DMA region (or dma_prog_region) */ -#define dma_region_i(_dma, _type, _index) ( ((_type*) ((_dma)->kvirt)) + (_index) ) +#define dma_region_i(_dma, _type, _index) \ + ( ((_type*) ((_dma)->kvirt)) + (_index) ) /* return the DMA bus address of the byte with the given offset - relative to the beginning of the dma_region */ -dma_addr_t dma_region_offset_to_bus(struct dma_region *dma, unsigned long offset); + * relative to the beginning of the dma_region */ +dma_addr_t dma_region_offset_to_bus(struct dma_region *dma, + unsigned long offset); #endif /* IEEE1394_DMA_H */ -- cgit v1.2.3 From de4394f13cc843fae2a3ba2df752ee20e6e779a8 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Mon, 3 Jul 2006 12:02:29 -0400 Subject: [PATCH] ieee1394: update #include directives in midlayer header files Remove unnecessary includes, add missing includes. Use forward type declarations for some structs. Signed-off-by: Stefan Richter Signed-off-by: Ben Collins --- drivers/ieee1394/dma.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/ieee1394/dma.h') diff --git a/drivers/ieee1394/dma.h b/drivers/ieee1394/dma.h index b0f0885c455..a1682aba71c 100644 --- a/drivers/ieee1394/dma.h +++ b/drivers/ieee1394/dma.h @@ -10,8 +10,11 @@ #ifndef IEEE1394_DMA_H #define IEEE1394_DMA_H -#include -#include +#include + +struct pci_dev; +struct scatterlist; +struct vm_area_struct; /** * struct dma_prog_region - small contiguous DMA buffer -- cgit v1.2.3