Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>

authored by

Stefan Richter and committed by
Ben Collins
e1d118f1 2b01b80b

+440 -432
+48 -48
drivers/ieee1394/csr.h
··· 8 8 9 9 #include "csr1212.h" 10 10 11 - #define CSR_REGISTER_BASE 0xfffff0000000ULL 11 + #define CSR_REGISTER_BASE 0xfffff0000000ULL 12 12 13 13 /* register offsets relative to CSR_REGISTER_BASE */ 14 - #define CSR_STATE_CLEAR 0x0 15 - #define CSR_STATE_SET 0x4 16 - #define CSR_NODE_IDS 0x8 17 - #define CSR_RESET_START 0xc 18 - #define CSR_SPLIT_TIMEOUT_HI 0x18 19 - #define CSR_SPLIT_TIMEOUT_LO 0x1c 20 - #define CSR_CYCLE_TIME 0x200 21 - #define CSR_BUS_TIME 0x204 22 - #define CSR_BUSY_TIMEOUT 0x210 23 - #define CSR_BUS_MANAGER_ID 0x21c 24 - #define CSR_BANDWIDTH_AVAILABLE 0x220 25 - #define CSR_CHANNELS_AVAILABLE 0x224 26 - #define CSR_CHANNELS_AVAILABLE_HI 0x224 27 - #define CSR_CHANNELS_AVAILABLE_LO 0x228 28 - #define CSR_BROADCAST_CHANNEL 0x234 29 - #define CSR_CONFIG_ROM 0x400 30 - #define CSR_CONFIG_ROM_END 0x800 31 - #define CSR_FCP_COMMAND 0xB00 32 - #define CSR_FCP_RESPONSE 0xD00 33 - #define CSR_FCP_END 0xF00 34 - #define CSR_TOPOLOGY_MAP 0x1000 35 - #define CSR_TOPOLOGY_MAP_END 0x1400 36 - #define CSR_SPEED_MAP 0x2000 37 - #define CSR_SPEED_MAP_END 0x3000 14 + #define CSR_STATE_CLEAR 0x0 15 + #define CSR_STATE_SET 0x4 16 + #define CSR_NODE_IDS 0x8 17 + #define CSR_RESET_START 0xc 18 + #define CSR_SPLIT_TIMEOUT_HI 0x18 19 + #define CSR_SPLIT_TIMEOUT_LO 0x1c 20 + #define CSR_CYCLE_TIME 0x200 21 + #define CSR_BUS_TIME 0x204 22 + #define CSR_BUSY_TIMEOUT 0x210 23 + #define CSR_BUS_MANAGER_ID 0x21c 24 + #define CSR_BANDWIDTH_AVAILABLE 0x220 25 + #define CSR_CHANNELS_AVAILABLE 0x224 26 + #define CSR_CHANNELS_AVAILABLE_HI 0x224 27 + #define CSR_CHANNELS_AVAILABLE_LO 0x228 28 + #define CSR_BROADCAST_CHANNEL 0x234 29 + #define CSR_CONFIG_ROM 0x400 30 + #define CSR_CONFIG_ROM_END 0x800 31 + #define CSR_FCP_COMMAND 0xB00 32 + #define CSR_FCP_RESPONSE 0xD00 33 + #define CSR_FCP_END 0xF00 34 + #define CSR_TOPOLOGY_MAP 0x1000 35 + #define CSR_TOPOLOGY_MAP_END 0x1400 36 + #define CSR_SPEED_MAP 0x2000 37 + #define CSR_SPEED_MAP_END 0x3000 38 38 39 39 /* IEEE 1394 bus specific Configuration ROM Key IDs */ 40 40 #define IEEE1394_KV_ID_POWER_REQUIREMENTS (0x30) 41 41 42 - /* IEEE 1394 Bus Inforamation Block specifics */ 42 + /* IEEE 1394 Bus Information Block specifics */ 43 43 #define CSR_BUS_INFO_SIZE (5 * sizeof(quadlet_t)) 44 44 45 - #define CSR_IRMC_SHIFT 31 46 - #define CSR_CMC_SHIFT 30 47 - #define CSR_ISC_SHIFT 29 48 - #define CSR_BMC_SHIFT 28 49 - #define CSR_PMC_SHIFT 27 50 - #define CSR_CYC_CLK_ACC_SHIFT 16 51 - #define CSR_MAX_REC_SHIFT 12 52 - #define CSR_MAX_ROM_SHIFT 8 53 - #define CSR_GENERATION_SHIFT 4 45 + #define CSR_IRMC_SHIFT 31 46 + #define CSR_CMC_SHIFT 30 47 + #define CSR_ISC_SHIFT 29 48 + #define CSR_BMC_SHIFT 28 49 + #define CSR_PMC_SHIFT 27 50 + #define CSR_CYC_CLK_ACC_SHIFT 16 51 + #define CSR_MAX_REC_SHIFT 12 52 + #define CSR_MAX_ROM_SHIFT 8 53 + #define CSR_GENERATION_SHIFT 4 54 54 55 55 #define CSR_SET_BUS_INFO_GENERATION(csr, gen) \ 56 56 ((csr)->bus_info_data[2] = \ 57 57 cpu_to_be32((be32_to_cpu((csr)->bus_info_data[2]) & \ 58 - ~(0xf << CSR_GENERATION_SHIFT)) | \ 58 + ~(0xf << CSR_GENERATION_SHIFT)) | \ 59 59 (gen) << CSR_GENERATION_SHIFT)) 60 60 61 61 struct csr_control { 62 - spinlock_t lock; 62 + spinlock_t lock; 63 63 64 - quadlet_t state; 65 - quadlet_t node_ids; 66 - quadlet_t split_timeout_hi, split_timeout_lo; 67 - unsigned long expire; // Calculated from split_timeout 68 - quadlet_t cycle_time; 69 - quadlet_t bus_time; 70 - quadlet_t bus_manager_id; 71 - quadlet_t bandwidth_available; 72 - quadlet_t channels_available_hi, channels_available_lo; 64 + quadlet_t state; 65 + quadlet_t node_ids; 66 + quadlet_t split_timeout_hi, split_timeout_lo; 67 + unsigned long expire; /* Calculated from split_timeout */ 68 + quadlet_t cycle_time; 69 + quadlet_t bus_time; 70 + quadlet_t bus_manager_id; 71 + quadlet_t bandwidth_available; 72 + quadlet_t channels_available_hi, channels_available_lo; 73 73 quadlet_t broadcast_channel; 74 74 75 75 /* Bus Info */ ··· 84 84 85 85 struct csr1212_csr *rom; 86 86 87 - quadlet_t topology_map[256]; 88 - quadlet_t speed_map[1024]; 87 + quadlet_t topology_map[256]; 88 + quadlet_t speed_map[1024]; 89 89 }; 90 90 91 91 extern struct csr1212_bus_ops csr_bus_ops;
+50 -31
drivers/ieee1394/dma.h
··· 13 13 #include <linux/pci.h> 14 14 #include <asm/scatterlist.h> 15 15 16 - /* struct dma_prog_region 17 - 18 - a small, physically-contiguous DMA buffer with random-access, 19 - synchronous usage characteristics 20 - */ 21 - 16 + /** 17 + * struct dma_prog_region - small contiguous DMA buffer 18 + * @kvirt: kernel virtual address 19 + * @dev: PCI device 20 + * @n_pages: number of kernel pages 21 + * @bus_addr: base bus address 22 + * 23 + * a small, physically contiguous DMA buffer with random-access, synchronous 24 + * usage characteristics 25 + */ 22 26 struct dma_prog_region { 23 - unsigned char *kvirt; /* kernel virtual address */ 24 - struct pci_dev *dev; /* PCI device */ 25 - unsigned int n_pages; /* # of kernel pages */ 26 - dma_addr_t bus_addr; /* base bus address */ 27 + unsigned char *kvirt; 28 + struct pci_dev *dev; 29 + unsigned int n_pages; 30 + dma_addr_t bus_addr; 27 31 }; 28 32 29 33 /* clear out all fields but do not allocate any memory */ 30 34 void dma_prog_region_init(struct dma_prog_region *prog); 31 - int dma_prog_region_alloc(struct dma_prog_region *prog, unsigned long n_bytes, struct pci_dev *dev); 35 + int dma_prog_region_alloc(struct dma_prog_region *prog, unsigned long n_bytes, 36 + struct pci_dev *dev); 32 37 void dma_prog_region_free(struct dma_prog_region *prog); 33 38 34 - static inline dma_addr_t dma_prog_region_offset_to_bus(struct dma_prog_region *prog, unsigned long offset) 39 + static inline dma_addr_t dma_prog_region_offset_to_bus( 40 + struct dma_prog_region *prog, unsigned long offset) 35 41 { 36 42 return prog->bus_addr + offset; 37 43 } 38 44 39 - /* struct dma_region 40 - 41 - a large, non-physically-contiguous DMA buffer with streaming, 42 - asynchronous usage characteristics 43 - */ 44 - 45 + /** 46 + * struct dma_region - large non-contiguous DMA buffer 47 + * @virt: kernel virtual address 48 + * @dev: PCI device 49 + * @n_pages: number of kernel pages 50 + * @n_dma_pages: number of IOMMU pages 51 + * @sglist: IOMMU mapping 52 + * @direction: PCI_DMA_TODEVICE, etc. 53 + * 54 + * a large, non-physically-contiguous DMA buffer with streaming, asynchronous 55 + * usage characteristics 56 + */ 45 57 struct dma_region { 46 - unsigned char *kvirt; /* kernel virtual address */ 47 - struct pci_dev *dev; /* PCI device */ 48 - unsigned int n_pages; /* # of kernel pages */ 49 - unsigned int n_dma_pages; /* # of IOMMU pages */ 50 - struct scatterlist *sglist; /* IOMMU mapping */ 51 - int direction; /* PCI_DMA_TODEVICE, etc */ 58 + unsigned char *kvirt; 59 + struct pci_dev *dev; 60 + unsigned int n_pages; 61 + unsigned int n_dma_pages; 62 + struct scatterlist *sglist; 63 + int direction; 52 64 }; 53 65 54 66 /* clear out all fields but do not allocate anything */ 55 67 void dma_region_init(struct dma_region *dma); 56 68 57 69 /* allocate the buffer and map it to the IOMMU */ 58 - int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes, struct pci_dev *dev, int direction); 70 + int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes, 71 + struct pci_dev *dev, int direction); 59 72 60 73 /* unmap and free the buffer */ 61 74 void dma_region_free(struct dma_region *dma); 62 75 63 76 /* sync the CPU's view of the buffer */ 64 - void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset, unsigned long len); 77 + void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset, 78 + unsigned long len); 79 + 65 80 /* sync the IO bus' view of the buffer */ 66 - void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, unsigned long len); 81 + void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, 82 + unsigned long len); 67 83 68 84 /* map the buffer into a user space process */ 69 - int dma_region_mmap(struct dma_region *dma, struct file *file, struct vm_area_struct *vma); 85 + int dma_region_mmap(struct dma_region *dma, struct file *file, 86 + struct vm_area_struct *vma); 70 87 71 88 /* macro to index into a DMA region (or dma_prog_region) */ 72 - #define dma_region_i(_dma, _type, _index) ( ((_type*) ((_dma)->kvirt)) + (_index) ) 89 + #define dma_region_i(_dma, _type, _index) \ 90 + ( ((_type*) ((_dma)->kvirt)) + (_index) ) 73 91 74 92 /* return the DMA bus address of the byte with the given offset 75 - relative to the beginning of the dma_region */ 76 - dma_addr_t dma_region_offset_to_bus(struct dma_region *dma, unsigned long offset); 93 + * relative to the beginning of the dma_region */ 94 + dma_addr_t dma_region_offset_to_bus(struct dma_region *dma, 95 + unsigned long offset); 77 96 78 97 #endif /* IEEE1394_DMA_H */
+95 -98
drivers/ieee1394/highlevel.h
··· 1 - 2 1 #ifndef IEEE1394_HIGHLEVEL_H 3 2 #define IEEE1394_HIGHLEVEL_H 4 3 5 - 4 + /* internal to ieee1394 core */ 6 5 struct hpsb_address_serve { 7 - struct list_head host_list; /* per host list */ 8 - 9 - struct list_head hl_list; /* hpsb_highlevel list */ 10 - 11 - struct hpsb_address_ops *op; 12 - 6 + struct list_head host_list; /* per host list */ 7 + struct list_head hl_list; /* hpsb_highlevel list */ 8 + struct hpsb_address_ops *op; 13 9 struct hpsb_host *host; 14 - 15 - /* first address handled and first address behind, quadlet aligned */ 16 - u64 start, end; 10 + u64 start; /* first address handled, quadlet aligned */ 11 + u64 end; /* first address behind, quadlet aligned */ 17 12 }; 18 13 19 - 20 - /* 21 - * The above structs are internal to highlevel driver handling. Only the 22 - * following structures are of interest to actual highlevel drivers. 23 - */ 14 + /* Only the following structures are of interest to actual highlevel drivers. */ 24 15 25 16 struct hpsb_highlevel { 26 17 struct module *owner; 27 18 const char *name; 28 19 29 - /* Any of the following pointers can legally be NULL, except for 30 - * iso_receive which can only be NULL when you don't request 31 - * channels. */ 20 + /* Any of the following pointers can legally be NULL, except for 21 + * iso_receive which can only be NULL when you don't request 22 + * channels. */ 32 23 33 - /* New host initialized. Will also be called during 34 - * hpsb_register_highlevel for all hosts already installed. */ 35 - void (*add_host) (struct hpsb_host *host); 24 + /* New host initialized. Will also be called during 25 + * hpsb_register_highlevel for all hosts already installed. */ 26 + void (*add_host)(struct hpsb_host *host); 36 27 37 - /* Host about to be removed. Will also be called during 38 - * hpsb_unregister_highlevel once for each host. */ 39 - void (*remove_host) (struct hpsb_host *host); 28 + /* Host about to be removed. Will also be called during 29 + * hpsb_unregister_highlevel once for each host. */ 30 + void (*remove_host)(struct hpsb_host *host); 40 31 41 - /* Host experienced bus reset with possible configuration changes. 32 + /* Host experienced bus reset with possible configuration changes. 42 33 * Note that this one may occur during interrupt/bottom half handling. 43 34 * You can not expect to be able to do stock hpsb_reads. */ 44 - void (*host_reset) (struct hpsb_host *host); 35 + void (*host_reset)(struct hpsb_host *host); 45 36 46 - /* An isochronous packet was received. Channel contains the channel 47 - * number for your convenience, it is also contained in the included 48 - * packet header (first quadlet, CRCs are missing). You may get called 49 - * for channel/host combinations you did not request. */ 50 - void (*iso_receive) (struct hpsb_host *host, int channel, 51 - quadlet_t *data, size_t length); 37 + /* An isochronous packet was received. Channel contains the channel 38 + * number for your convenience, it is also contained in the included 39 + * packet header (first quadlet, CRCs are missing). You may get called 40 + * for channel/host combinations you did not request. */ 41 + void (*iso_receive)(struct hpsb_host *host, int channel, 42 + quadlet_t *data, size_t length); 52 43 53 - /* A write request was received on either the FCP_COMMAND (direction = 54 - * 0) or the FCP_RESPONSE (direction = 1) register. The cts arg 55 - * contains the cts field (first byte of data). */ 56 - void (*fcp_request) (struct hpsb_host *host, int nodeid, int direction, 57 - int cts, u8 *data, size_t length); 44 + /* A write request was received on either the FCP_COMMAND (direction = 45 + * 0) or the FCP_RESPONSE (direction = 1) register. The cts arg 46 + * contains the cts field (first byte of data). */ 47 + void (*fcp_request)(struct hpsb_host *host, int nodeid, int direction, 48 + int cts, u8 *data, size_t length); 58 49 59 50 /* These are initialized by the subsystem when the 60 51 * hpsb_higlevel is registered. */ ··· 58 67 }; 59 68 60 69 struct hpsb_address_ops { 61 - /* 62 - * Null function pointers will make the respective operation complete 63 - * with RCODE_TYPE_ERROR. Makes for easy to implement read-only 64 - * registers (just leave everything but read NULL). 65 - * 66 - * All functions shall return appropriate IEEE 1394 rcodes. 67 - */ 70 + /* 71 + * Null function pointers will make the respective operation complete 72 + * with RCODE_TYPE_ERROR. Makes for easy to implement read-only 73 + * registers (just leave everything but read NULL). 74 + * 75 + * All functions shall return appropriate IEEE 1394 rcodes. 76 + */ 68 77 69 - /* These functions have to implement block reads for themselves. */ 70 - /* These functions either return a response code 71 - or a negative number. In the first case a response will be generated; in the 72 - later case, no response will be sent and the driver, that handled the request 73 - will send the response itself 74 - */ 75 - int (*read) (struct hpsb_host *host, int nodeid, quadlet_t *buffer, 76 - u64 addr, size_t length, u16 flags); 77 - int (*write) (struct hpsb_host *host, int nodeid, int destid, 78 - quadlet_t *data, u64 addr, size_t length, u16 flags); 78 + /* These functions have to implement block reads for themselves. 79 + * 80 + * These functions either return a response code or a negative number. 81 + * In the first case a response will be generated. In the latter case, 82 + * no response will be sent and the driver which handled the request 83 + * will send the response itself. */ 84 + int (*read)(struct hpsb_host *host, int nodeid, quadlet_t *buffer, 85 + u64 addr, size_t length, u16 flags); 86 + int (*write)(struct hpsb_host *host, int nodeid, int destid, 87 + quadlet_t *data, u64 addr, size_t length, u16 flags); 79 88 80 - /* Lock transactions: write results of ext_tcode operation into 81 - * *store. */ 82 - int (*lock) (struct hpsb_host *host, int nodeid, quadlet_t *store, 83 - u64 addr, quadlet_t data, quadlet_t arg, int ext_tcode, u16 flags); 84 - int (*lock64) (struct hpsb_host *host, int nodeid, octlet_t *store, 85 - u64 addr, octlet_t data, octlet_t arg, int ext_tcode, u16 flags); 89 + /* Lock transactions: write results of ext_tcode operation into 90 + * *store. */ 91 + int (*lock)(struct hpsb_host *host, int nodeid, quadlet_t *store, 92 + u64 addr, quadlet_t data, quadlet_t arg, int ext_tcode, 93 + u16 flags); 94 + int (*lock64)(struct hpsb_host *host, int nodeid, octlet_t *store, 95 + u64 addr, octlet_t data, octlet_t arg, int ext_tcode, 96 + u16 flags); 86 97 }; 87 - 88 98 89 99 void highlevel_add_host(struct hpsb_host *host); 90 100 void highlevel_remove_host(struct hpsb_host *host); 91 101 void highlevel_host_reset(struct hpsb_host *host); 92 102 93 - 94 - /* these functions are called to handle transactions. They are called, when 95 - a packet arrives. The flags argument contains the second word of the first header 96 - quadlet of the incoming packet (containing transaction label, retry code, 97 - transaction code and priority). These functions either return a response code 98 - or a negative number. In the first case a response will be generated; in the 99 - later case, no response will be sent and the driver, that handled the request 100 - will send the response itself. 101 - */ 102 - int highlevel_read(struct hpsb_host *host, int nodeid, void *data, 103 - u64 addr, unsigned int length, u16 flags); 104 - int highlevel_write(struct hpsb_host *host, int nodeid, int destid, 105 - void *data, u64 addr, unsigned int length, u16 flags); 103 + /* 104 + * These functions are called to handle transactions. They are called when a 105 + * packet arrives. The flags argument contains the second word of the first 106 + * header quadlet of the incoming packet (containing transaction label, retry 107 + * code, transaction code and priority). These functions either return a 108 + * response code or a negative number. In the first case a response will be 109 + * generated. In the latter case, no response will be sent and the driver which 110 + * handled the request will send the response itself. 111 + */ 112 + int highlevel_read(struct hpsb_host *host, int nodeid, void *data, u64 addr, 113 + unsigned int length, u16 flags); 114 + int highlevel_write(struct hpsb_host *host, int nodeid, int destid, void *data, 115 + u64 addr, unsigned int length, u16 flags); 106 116 int highlevel_lock(struct hpsb_host *host, int nodeid, quadlet_t *store, 107 - u64 addr, quadlet_t data, quadlet_t arg, int ext_tcode, u16 flags); 117 + u64 addr, quadlet_t data, quadlet_t arg, int ext_tcode, 118 + u16 flags); 108 119 int highlevel_lock64(struct hpsb_host *host, int nodeid, octlet_t *store, 109 - u64 addr, octlet_t data, octlet_t arg, int ext_tcode, u16 flags); 120 + u64 addr, octlet_t data, octlet_t arg, int ext_tcode, 121 + u16 flags); 110 122 111 - void highlevel_iso_receive(struct hpsb_host *host, void *data, 112 - size_t length); 123 + void highlevel_iso_receive(struct hpsb_host *host, void *data, size_t length); 113 124 void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction, 114 - void *data, size_t length); 115 - 125 + void *data, size_t length); 116 126 117 127 /* 118 128 * Register highlevel driver. The name pointer has to stay valid at all times ··· 124 132 125 133 /* 126 134 * Register handlers for host address spaces. Start and end are 48 bit pointers 127 - * and have to be quadlet aligned (end points to the first address behind the 128 - * handled addresses. This function can be called multiple times for a single 129 - * hpsb_highlevel to implement sparse register sets. The requested region must 130 - * not overlap any previously allocated region, otherwise registering will fail. 135 + * and have to be quadlet aligned. Argument "end" points to the first address 136 + * behind the handled addresses. This function can be called multiple times for 137 + * a single hpsb_highlevel to implement sparse register sets. The requested 138 + * region must not overlap any previously allocated region, otherwise 139 + * registering will fail. 131 140 * 132 - * It returns true for successful allocation. There is no unregister function, 133 - * all address spaces are deallocated together with the hpsb_highlevel. 141 + * It returns true for successful allocation. Address spaces can be 142 + * unregistered with hpsb_unregister_addrspace. All remaining address spaces 143 + * are automatically deallocated together with the hpsb_highlevel. 134 144 */ 135 145 u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, 136 146 struct hpsb_host *host, ··· 140 146 u64 size, u64 alignment, 141 147 u64 start, u64 end); 142 148 int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, 143 - struct hpsb_address_ops *ops, u64 start, u64 end); 144 - 149 + struct hpsb_address_ops *ops, u64 start, u64 end); 145 150 int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, 146 - u64 start); 151 + u64 start); 147 152 148 153 /* 149 154 * Enable or disable receving a certain isochronous channel through the 150 155 * iso_receive op. 151 156 */ 152 157 int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 153 - unsigned int channel); 158 + unsigned int channel); 154 159 void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 155 - unsigned int channel); 156 - 160 + unsigned int channel); 157 161 158 162 /* Retrieve a hostinfo pointer bound to this driver/host */ 159 163 void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host); ··· 164 172 void hpsb_destroy_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host); 165 173 166 174 /* Set an alternate lookup key for the hostinfo bound to this driver/host */ 167 - void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host, unsigned long key); 175 + void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host, 176 + unsigned long key); 168 177 169 - /* Retrieve the alternate lookup key for the hostinfo bound to this driver/host */ 170 - unsigned long hpsb_get_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host); 178 + /* Retrieve the alternate lookup key for the hostinfo bound to this 179 + * driver/host */ 180 + unsigned long hpsb_get_hostinfo_key(struct hpsb_highlevel *hl, 181 + struct hpsb_host *host); 171 182 172 183 /* Retrieve a hostinfo pointer bound to this driver using its alternate key */ 173 184 void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key); 174 185 175 186 /* Set the hostinfo pointer to something useful. Usually follows a call to 176 187 * hpsb_create_hostinfo, where the size is 0. */ 177 - int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, void *data); 188 + int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, 189 + void *data); 178 190 179 191 /* Retrieve hpsb_host using a highlevel handle and a key */ 180 - struct hpsb_host *hpsb_get_host_bykey(struct hpsb_highlevel *hl, unsigned long key); 192 + struct hpsb_host *hpsb_get_host_bykey(struct hpsb_highlevel *hl, 193 + unsigned long key); 181 194 182 195 #endif /* IEEE1394_HIGHLEVEL_H */
+8 -7
drivers/ieee1394/hosts.h
··· 112 112 113 113 enum isoctl_cmd { 114 114 /* rawiso API - see iso.h for the meanings of these commands 115 - (they correspond exactly to the hpsb_iso_* API functions) 115 + * (they correspond exactly to the hpsb_iso_* API functions) 116 116 * INIT = allocate resources 117 117 * START = begin transmission/reception 118 118 * STOP = halt transmission/reception ··· 160 160 /* The hardware driver may optionally support a function that is used 161 161 * to set the hardware ConfigROM if the hardware supports handling 162 162 * reads to the ConfigROM on its own. */ 163 - void (*set_hw_config_rom) (struct hpsb_host *host, quadlet_t *config_rom); 163 + void (*set_hw_config_rom)(struct hpsb_host *host, 164 + quadlet_t *config_rom); 164 165 165 166 /* This function shall implement packet transmission based on 166 167 * packet->type. It shall CRC both parts of the packet (unless ··· 171 170 * called. Return 0 on success, negative errno on failure. 172 171 * NOTE: The function must be callable in interrupt context. 173 172 */ 174 - int (*transmit_packet) (struct hpsb_host *host, 175 - struct hpsb_packet *packet); 173 + int (*transmit_packet)(struct hpsb_host *host, 174 + struct hpsb_packet *packet); 176 175 177 176 /* This function requests miscellanous services from the driver, see 178 177 * above for command codes and expected actions. Return -1 for unknown 179 178 * command, though that should never happen. 180 179 */ 181 - int (*devctl) (struct hpsb_host *host, enum devctl_cmd command, int arg); 180 + int (*devctl)(struct hpsb_host *host, enum devctl_cmd command, int arg); 182 181 183 182 /* ISO transmission/reception functions. Return 0 on success, -1 184 183 * (or -EXXX errno code) on failure. If the low-level driver does not 185 184 * support the new ISO API, set isoctl to NULL. 186 185 */ 187 - int (*isoctl) (struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg); 186 + int (*isoctl)(struct hpsb_iso *iso, enum isoctl_cmd command, 187 + unsigned long arg); 188 188 189 189 /* This function is mainly to redirect local CSR reads/locks to the iso 190 190 * management registers (bus manager id, bandwidth available, channels ··· 197 195 quadlet_t (*hw_csr_reg) (struct hpsb_host *host, int reg, 198 196 quadlet_t data, quadlet_t compare); 199 197 }; 200 - 201 198 202 199 struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, 203 200 struct device *dev);
+5 -4
drivers/ieee1394/ieee1394-ioctl.h
··· 1 - /* Base file for all ieee1394 ioctl's. Linux-1394 has allocated base '#' 2 - * with a range of 0x00-0x3f. */ 1 + /* 2 + * Base file for all ieee1394 ioctl's. 3 + * Linux-1394 has allocated base '#' with a range of 0x00-0x3f. 4 + */ 3 5 4 6 #ifndef __IEEE1394_IOCTL_H 5 7 #define __IEEE1394_IOCTL_H ··· 98 96 _IOW ('#', 0x27, struct raw1394_iso_packets) 99 97 #define RAW1394_IOC_ISO_XMIT_SYNC \ 100 98 _IO ('#', 0x28) 101 - #define RAW1394_IOC_ISO_RECV_FLUSH \ 99 + #define RAW1394_IOC_ISO_RECV_FLUSH \ 102 100 _IO ('#', 0x29) 103 - 104 101 105 102 #endif /* __IEEE1394_IOCTL_H */
+150 -152
drivers/ieee1394/ieee1394.h
··· 5 5 #ifndef _IEEE1394_IEEE1394_H 6 6 #define _IEEE1394_IEEE1394_H 7 7 8 - #define TCODE_WRITEQ 0x0 9 - #define TCODE_WRITEB 0x1 10 - #define TCODE_WRITE_RESPONSE 0x2 11 - #define TCODE_READQ 0x4 12 - #define TCODE_READB 0x5 13 - #define TCODE_READQ_RESPONSE 0x6 14 - #define TCODE_READB_RESPONSE 0x7 15 - #define TCODE_CYCLE_START 0x8 16 - #define TCODE_LOCK_REQUEST 0x9 17 - #define TCODE_ISO_DATA 0xa 18 - #define TCODE_STREAM_DATA 0xa 19 - #define TCODE_LOCK_RESPONSE 0xb 8 + #define TCODE_WRITEQ 0x0 9 + #define TCODE_WRITEB 0x1 10 + #define TCODE_WRITE_RESPONSE 0x2 11 + #define TCODE_READQ 0x4 12 + #define TCODE_READB 0x5 13 + #define TCODE_READQ_RESPONSE 0x6 14 + #define TCODE_READB_RESPONSE 0x7 15 + #define TCODE_CYCLE_START 0x8 16 + #define TCODE_LOCK_REQUEST 0x9 17 + #define TCODE_ISO_DATA 0xa 18 + #define TCODE_STREAM_DATA 0xa 19 + #define TCODE_LOCK_RESPONSE 0xb 20 20 21 - #define RCODE_COMPLETE 0x0 22 - #define RCODE_CONFLICT_ERROR 0x4 23 - #define RCODE_DATA_ERROR 0x5 24 - #define RCODE_TYPE_ERROR 0x6 25 - #define RCODE_ADDRESS_ERROR 0x7 21 + #define RCODE_COMPLETE 0x0 22 + #define RCODE_CONFLICT_ERROR 0x4 23 + #define RCODE_DATA_ERROR 0x5 24 + #define RCODE_TYPE_ERROR 0x6 25 + #define RCODE_ADDRESS_ERROR 0x7 26 26 27 - #define EXTCODE_MASK_SWAP 0x1 28 - #define EXTCODE_COMPARE_SWAP 0x2 29 - #define EXTCODE_FETCH_ADD 0x3 30 - #define EXTCODE_LITTLE_ADD 0x4 31 - #define EXTCODE_BOUNDED_ADD 0x5 32 - #define EXTCODE_WRAP_ADD 0x6 27 + #define EXTCODE_MASK_SWAP 0x1 28 + #define EXTCODE_COMPARE_SWAP 0x2 29 + #define EXTCODE_FETCH_ADD 0x3 30 + #define EXTCODE_LITTLE_ADD 0x4 31 + #define EXTCODE_BOUNDED_ADD 0x5 32 + #define EXTCODE_WRAP_ADD 0x6 33 33 34 - #define ACK_COMPLETE 0x1 35 - #define ACK_PENDING 0x2 36 - #define ACK_BUSY_X 0x4 37 - #define ACK_BUSY_A 0x5 38 - #define ACK_BUSY_B 0x6 39 - #define ACK_TARDY 0xb 40 - #define ACK_CONFLICT_ERROR 0xc 41 - #define ACK_DATA_ERROR 0xd 42 - #define ACK_TYPE_ERROR 0xe 43 - #define ACK_ADDRESS_ERROR 0xf 34 + #define ACK_COMPLETE 0x1 35 + #define ACK_PENDING 0x2 36 + #define ACK_BUSY_X 0x4 37 + #define ACK_BUSY_A 0x5 38 + #define ACK_BUSY_B 0x6 39 + #define ACK_TARDY 0xb 40 + #define ACK_CONFLICT_ERROR 0xc 41 + #define ACK_DATA_ERROR 0xd 42 + #define ACK_TYPE_ERROR 0xe 43 + #define ACK_ADDRESS_ERROR 0xf 44 44 45 45 /* Non-standard "ACK codes" for internal use */ 46 - #define ACKX_NONE (-1) 47 - #define ACKX_SEND_ERROR (-2) 48 - #define ACKX_ABORTED (-3) 49 - #define ACKX_TIMEOUT (-4) 46 + #define ACKX_NONE (-1) 47 + #define ACKX_SEND_ERROR (-2) 48 + #define ACKX_ABORTED (-3) 49 + #define ACKX_TIMEOUT (-4) 50 50 51 + #define IEEE1394_SPEED_100 0x00 52 + #define IEEE1394_SPEED_200 0x01 53 + #define IEEE1394_SPEED_400 0x02 54 + #define IEEE1394_SPEED_800 0x03 55 + #define IEEE1394_SPEED_1600 0x04 56 + #define IEEE1394_SPEED_3200 0x05 51 57 52 - #define IEEE1394_SPEED_100 0x00 53 - #define IEEE1394_SPEED_200 0x01 54 - #define IEEE1394_SPEED_400 0x02 55 - #define IEEE1394_SPEED_800 0x03 56 - #define IEEE1394_SPEED_1600 0x04 57 - #define IEEE1394_SPEED_3200 0x05 58 58 /* The current highest tested speed supported by the subsystem */ 59 - #define IEEE1394_SPEED_MAX IEEE1394_SPEED_800 59 + #define IEEE1394_SPEED_MAX IEEE1394_SPEED_800 60 60 61 61 /* Maps speed values above to a string representation */ 62 62 extern const char *hpsb_speedto_str[]; 63 63 64 - 65 64 /* 1394a cable PHY packets */ 66 - #define SELFID_PWRCL_NO_POWER 0x0 67 - #define SELFID_PWRCL_PROVIDE_15W 0x1 68 - #define SELFID_PWRCL_PROVIDE_30W 0x2 69 - #define SELFID_PWRCL_PROVIDE_45W 0x3 70 - #define SELFID_PWRCL_USE_1W 0x4 71 - #define SELFID_PWRCL_USE_3W 0x5 72 - #define SELFID_PWRCL_USE_6W 0x6 73 - #define SELFID_PWRCL_USE_10W 0x7 65 + #define SELFID_PWRCL_NO_POWER 0x0 66 + #define SELFID_PWRCL_PROVIDE_15W 0x1 67 + #define SELFID_PWRCL_PROVIDE_30W 0x2 68 + #define SELFID_PWRCL_PROVIDE_45W 0x3 69 + #define SELFID_PWRCL_USE_1W 0x4 70 + #define SELFID_PWRCL_USE_3W 0x5 71 + #define SELFID_PWRCL_USE_6W 0x6 72 + #define SELFID_PWRCL_USE_10W 0x7 74 73 75 - #define SELFID_PORT_CHILD 0x3 76 - #define SELFID_PORT_PARENT 0x2 77 - #define SELFID_PORT_NCONN 0x1 78 - #define SELFID_PORT_NONE 0x0 74 + #define SELFID_PORT_CHILD 0x3 75 + #define SELFID_PORT_PARENT 0x2 76 + #define SELFID_PORT_NCONN 0x1 77 + #define SELFID_PORT_NONE 0x0 79 78 80 79 #define SELFID_SPEED_UNKNOWN 0x3 /* 1394b PHY */ 81 80 ··· 92 93 93 94 #define EXTPHYPACKET_TYPEMASK 0xC0FC0000 94 95 95 - #define PHYPACKET_PORT_SHIFT 24 96 - #define PHYPACKET_GAPCOUNT_SHIFT 16 96 + #define PHYPACKET_PORT_SHIFT 24 97 + #define PHYPACKET_GAPCOUNT_SHIFT 16 97 98 98 99 /* 1394a PHY register map bitmasks */ 99 - #define PHY_00_PHYSICAL_ID 0xFC 100 - #define PHY_00_R 0x02 /* Root */ 101 - #define PHY_00_PS 0x01 /* Power Status*/ 102 - #define PHY_01_RHB 0x80 /* Root Hold-Off */ 103 - #define PHY_01_IBR 0x80 /* Initiate Bus Reset */ 104 - #define PHY_01_GAP_COUNT 0x3F 105 - #define PHY_02_EXTENDED 0xE0 /* 0x7 for 1394a-compliant PHY */ 106 - #define PHY_02_TOTAL_PORTS 0x1F 107 - #define PHY_03_MAX_SPEED 0xE0 108 - #define PHY_03_DELAY 0x0F 109 - #define PHY_04_LCTRL 0x80 /* Link Active Report Control */ 110 - #define PHY_04_CONTENDER 0x40 111 - #define PHY_04_JITTER 0x38 112 - #define PHY_04_PWR_CLASS 0x07 /* Power Class */ 113 - #define PHY_05_WATCHDOG 0x80 114 - #define PHY_05_ISBR 0x40 /* Initiate Short Bus Reset */ 115 - #define PHY_05_LOOP 0x20 /* Loop Detect */ 116 - #define PHY_05_PWR_FAIL 0x10 /* Cable Power Failure Detect */ 117 - #define PHY_05_TIMEOUT 0x08 /* Arbitration State Machine Timeout */ 118 - #define PHY_05_PORT_EVENT 0x04 /* Port Event Detect */ 119 - #define PHY_05_ENAB_ACCEL 0x02 /* Enable Arbitration Acceleration */ 120 - #define PHY_05_ENAB_MULTI 0x01 /* Ena. Multispeed Packet Concatenation */ 100 + #define PHY_00_PHYSICAL_ID 0xFC 101 + #define PHY_00_R 0x02 /* Root */ 102 + #define PHY_00_PS 0x01 /* Power Status*/ 103 + #define PHY_01_RHB 0x80 /* Root Hold-Off */ 104 + #define PHY_01_IBR 0x80 /* Initiate Bus Reset */ 105 + #define PHY_01_GAP_COUNT 0x3F 106 + #define PHY_02_EXTENDED 0xE0 /* 0x7 for 1394a-compliant PHY */ 107 + #define PHY_02_TOTAL_PORTS 0x1F 108 + #define PHY_03_MAX_SPEED 0xE0 109 + #define PHY_03_DELAY 0x0F 110 + #define PHY_04_LCTRL 0x80 /* Link Active Report Control */ 111 + #define PHY_04_CONTENDER 0x40 112 + #define PHY_04_JITTER 0x38 113 + #define PHY_04_PWR_CLASS 0x07 /* Power Class */ 114 + #define PHY_05_WATCHDOG 0x80 115 + #define PHY_05_ISBR 0x40 /* Initiate Short Bus Reset */ 116 + #define PHY_05_LOOP 0x20 /* Loop Detect */ 117 + #define PHY_05_PWR_FAIL 0x10 /* Cable Power Failure Detect */ 118 + #define PHY_05_TIMEOUT 0x08 /* Arbitration State Machine Timeout */ 119 + #define PHY_05_PORT_EVENT 0x04 /* Port Event Detect */ 120 + #define PHY_05_ENAB_ACCEL 0x02 /* Enable Arbitration Acceleration */ 121 + #define PHY_05_ENAB_MULTI 0x01 /* Ena. Multispeed Packet Concatenation */ 121 122 122 123 #include <asm/byteorder.h> 123 124 124 125 #ifdef __BIG_ENDIAN_BITFIELD 125 126 126 127 struct selfid { 127 - u32 packet_identifier:2; /* always binary 10 */ 128 - u32 phy_id:6; 129 - /* byte */ 130 - u32 extended:1; /* if true is struct ext_selfid */ 131 - u32 link_active:1; 132 - u32 gap_count:6; 133 - /* byte */ 134 - u32 speed:2; 135 - u32 phy_delay:2; 136 - u32 contender:1; 137 - u32 power_class:3; 138 - /* byte */ 139 - u32 port0:2; 140 - u32 port1:2; 141 - u32 port2:2; 142 - u32 initiated_reset:1; 143 - u32 more_packets:1; 128 + u32 packet_identifier:2; /* always binary 10 */ 129 + u32 phy_id:6; 130 + /* byte */ 131 + u32 extended:1; /* if true is struct ext_selfid */ 132 + u32 link_active:1; 133 + u32 gap_count:6; 134 + /* byte */ 135 + u32 speed:2; 136 + u32 phy_delay:2; 137 + u32 contender:1; 138 + u32 power_class:3; 139 + /* byte */ 140 + u32 port0:2; 141 + u32 port1:2; 142 + u32 port2:2; 143 + u32 initiated_reset:1; 144 + u32 more_packets:1; 144 145 } __attribute__((packed)); 145 146 146 147 struct ext_selfid { 147 - u32 packet_identifier:2; /* always binary 10 */ 148 - u32 phy_id:6; 149 - /* byte */ 150 - u32 extended:1; /* if false is struct selfid */ 151 - u32 seq_nr:3; 152 - u32 reserved:2; 153 - u32 porta:2; 154 - /* byte */ 155 - u32 portb:2; 156 - u32 portc:2; 157 - u32 portd:2; 158 - u32 porte:2; 159 - /* byte */ 160 - u32 portf:2; 161 - u32 portg:2; 162 - u32 porth:2; 163 - u32 reserved2:1; 164 - u32 more_packets:1; 148 + u32 packet_identifier:2; /* always binary 10 */ 149 + u32 phy_id:6; 150 + /* byte */ 151 + u32 extended:1; /* if false is struct selfid */ 152 + u32 seq_nr:3; 153 + u32 reserved:2; 154 + u32 porta:2; 155 + /* byte */ 156 + u32 portb:2; 157 + u32 portc:2; 158 + u32 portd:2; 159 + u32 porte:2; 160 + /* byte */ 161 + u32 portf:2; 162 + u32 portg:2; 163 + u32 porth:2; 164 + u32 reserved2:1; 165 + u32 more_packets:1; 165 166 } __attribute__((packed)); 166 167 167 168 #elif defined __LITTLE_ENDIAN_BITFIELD /* __BIG_ENDIAN_BITFIELD */ ··· 172 173 */ 173 174 174 175 struct selfid { 175 - u32 phy_id:6; 176 - u32 packet_identifier:2; /* always binary 10 */ 177 - /* byte */ 178 - u32 gap_count:6; 179 - u32 link_active:1; 180 - u32 extended:1; /* if true is struct ext_selfid */ 181 - /* byte */ 182 - u32 power_class:3; 183 - u32 contender:1; 184 - u32 phy_delay:2; 185 - u32 speed:2; 186 - /* byte */ 187 - u32 more_packets:1; 188 - u32 initiated_reset:1; 189 - u32 port2:2; 190 - u32 port1:2; 191 - u32 port0:2; 176 + u32 phy_id:6; 177 + u32 packet_identifier:2; /* always binary 10 */ 178 + /* byte */ 179 + u32 gap_count:6; 180 + u32 link_active:1; 181 + u32 extended:1; /* if true is struct ext_selfid */ 182 + /* byte */ 183 + u32 power_class:3; 184 + u32 contender:1; 185 + u32 phy_delay:2; 186 + u32 speed:2; 187 + /* byte */ 188 + u32 more_packets:1; 189 + u32 initiated_reset:1; 190 + u32 port2:2; 191 + u32 port1:2; 192 + u32 port0:2; 192 193 } __attribute__((packed)); 193 194 194 195 struct ext_selfid { 195 - u32 phy_id:6; 196 - u32 packet_identifier:2; /* always binary 10 */ 197 - /* byte */ 198 - u32 porta:2; 199 - u32 reserved:2; 200 - u32 seq_nr:3; 201 - u32 extended:1; /* if false is struct selfid */ 202 - /* byte */ 203 - u32 porte:2; 204 - u32 portd:2; 205 - u32 portc:2; 206 - u32 portb:2; 207 - /* byte */ 208 - u32 more_packets:1; 209 - u32 reserved2:1; 210 - u32 porth:2; 211 - u32 portg:2; 212 - u32 portf:2; 196 + u32 phy_id:6; 197 + u32 packet_identifier:2; /* always binary 10 */ 198 + /* byte */ 199 + u32 porta:2; 200 + u32 reserved:2; 201 + u32 seq_nr:3; 202 + u32 extended:1; /* if false is struct selfid */ 203 + /* byte */ 204 + u32 porte:2; 205 + u32 portd:2; 206 + u32 portc:2; 207 + u32 portb:2; 208 + /* byte */ 209 + u32 more_packets:1; 210 + u32 reserved2:1; 211 + u32 porth:2; 212 + u32 portg:2; 213 + u32 portf:2; 213 214 } __attribute__((packed)); 214 215 215 216 #else 216 217 #error What? PDP endian? 217 218 #endif /* __BIG_ENDIAN_BITFIELD */ 218 - 219 219 220 220 #endif /* _IEEE1394_IEEE1394_H */
+9 -8
drivers/ieee1394/ieee1394_core.h
··· 58 58 size_t header_size; 59 59 size_t data_size; 60 60 61 - 62 61 struct hpsb_host *host; 63 62 unsigned int generation; 64 63 ··· 79 80 80 81 /* Set a task for when a packet completes */ 81 82 void hpsb_set_packet_complete_task(struct hpsb_packet *packet, 82 - void (*routine)(void *), void *data); 83 + void (*routine)(void *), void *data); 83 84 84 85 static inline struct hpsb_packet *driver_packet(struct list_head *l) 85 86 { ··· 90 91 91 92 struct hpsb_packet *hpsb_alloc_packet(size_t data_size); 92 93 void hpsb_free_packet(struct hpsb_packet *packet); 93 - 94 94 95 95 /* 96 96 * Generation counter for the complete 1394 subsystem. Generation gets ··· 202 204 #define IEEE1394_MINOR_BLOCK_EXPERIMENTAL 15 203 205 204 206 #define IEEE1394_CORE_DEV MKDEV(IEEE1394_MAJOR, 0) 205 - #define IEEE1394_RAW1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16) 206 - #define IEEE1394_VIDEO1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_VIDEO1394 * 16) 207 - #define IEEE1394_DV1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16) 208 - #define IEEE1394_EXPERIMENTAL_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_EXPERIMENTAL * 16) 207 + #define IEEE1394_RAW1394_DEV MKDEV(IEEE1394_MAJOR, \ 208 + IEEE1394_MINOR_BLOCK_RAW1394 * 16) 209 + #define IEEE1394_VIDEO1394_DEV MKDEV(IEEE1394_MAJOR, \ 210 + IEEE1394_MINOR_BLOCK_VIDEO1394 * 16) 211 + #define IEEE1394_DV1394_DEV MKDEV(IEEE1394_MAJOR, \ 212 + IEEE1394_MINOR_BLOCK_DV1394 * 16) 213 + #define IEEE1394_EXPERIMENTAL_DEV MKDEV(IEEE1394_MAJOR, \ 214 + IEEE1394_MINOR_BLOCK_EXPERIMENTAL * 16) 209 215 210 216 /* return the index (within a minor number block) of a file */ 211 217 static inline unsigned char ieee1394_file_to_instance(struct file *file) ··· 225 223 extern struct class *hpsb_protocol_class; 226 224 227 225 #endif /* _IEEE1394_CORE_H */ 228 -
+13 -19
drivers/ieee1394/ieee1394_transactions.h
··· 3 3 4 4 #include "ieee1394_core.h" 5 5 6 - 7 - /* 8 - * Get and free transaction labels. 9 - */ 10 6 int hpsb_get_tlabel(struct hpsb_packet *packet); 11 7 void hpsb_free_tlabel(struct hpsb_packet *packet); 12 - 13 8 struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node, 14 9 u64 addr, size_t length); 15 10 struct hpsb_packet *hpsb_make_lockpacket(struct hpsb_host *host, nodeid_t node, 16 - u64 addr, int extcode, quadlet_t *data, 11 + u64 addr, int extcode, quadlet_t *data, 17 12 quadlet_t arg); 18 - struct hpsb_packet *hpsb_make_lock64packet(struct hpsb_host *host, nodeid_t node, 19 - u64 addr, int extcode, octlet_t *data, 20 - octlet_t arg); 21 - struct hpsb_packet *hpsb_make_phypacket(struct hpsb_host *host, 22 - quadlet_t data) ; 23 - struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host, 24 - int length, int channel, 25 - int tag, int sync); 26 - struct hpsb_packet *hpsb_make_writepacket (struct hpsb_host *host, nodeid_t node, 27 - u64 addr, quadlet_t *buffer, size_t length); 13 + struct hpsb_packet *hpsb_make_lock64packet(struct hpsb_host *host, 14 + nodeid_t node, u64 addr, int extcode, 15 + octlet_t *data, octlet_t arg); 16 + struct hpsb_packet *hpsb_make_phypacket(struct hpsb_host *host, quadlet_t data); 17 + struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host, int length, 18 + int channel, int tag, int sync); 19 + struct hpsb_packet *hpsb_make_writepacket(struct hpsb_host *host, 20 + nodeid_t node, u64 addr, 21 + quadlet_t *buffer, size_t length); 28 22 struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer, 29 - int length, int channel, int tag, int sync); 23 + int length, int channel, int tag, 24 + int sync); 30 25 31 26 /* 32 27 * hpsb_packet_success - Make sense of the ack and reply codes and ··· 35 40 */ 36 41 int hpsb_packet_success(struct hpsb_packet *packet); 37 42 38 - 39 43 /* 40 - * The generic read, write and lock functions. All recognize the local node ID 44 + * The generic read and write functions. All recognize the local node ID 41 45 * and act accordingly. Read and write automatically use quadlet commands if 42 46 * length == 4 and and block commands otherwise (however, they do not yet 43 47 * support lengths that are not a multiple of 4). You must explicitly specifiy
+14 -17
drivers/ieee1394/ieee1394_types.h
··· 31 31 sema_init(&(_tp)->count, 63); \ 32 32 } while (0) 33 33 34 - 35 34 typedef u32 quadlet_t; 36 35 typedef u64 octlet_t; 37 36 typedef u16 nodeid_t; ··· 53 54 #define NODE_BUS_ARGS(__host, __nodeid) \ 54 55 __host->id, NODEID_TO_NODE(__nodeid), NODEID_TO_BUS(__nodeid) 55 56 56 - #define HPSB_PRINT(level, fmt, args...) printk(level "ieee1394: " fmt "\n" , ## args) 57 + #define HPSB_PRINT(level, fmt, args...) \ 58 + printk(level "ieee1394: " fmt "\n" , ## args) 57 59 58 - #define HPSB_DEBUG(fmt, args...) HPSB_PRINT(KERN_DEBUG, fmt , ## args) 59 - #define HPSB_INFO(fmt, args...) HPSB_PRINT(KERN_INFO, fmt , ## args) 60 - #define HPSB_NOTICE(fmt, args...) HPSB_PRINT(KERN_NOTICE, fmt , ## args) 61 - #define HPSB_WARN(fmt, args...) HPSB_PRINT(KERN_WARNING, fmt , ## args) 62 - #define HPSB_ERR(fmt, args...) HPSB_PRINT(KERN_ERR, fmt , ## args) 60 + #define HPSB_DEBUG(fmt, args...) HPSB_PRINT(KERN_DEBUG, fmt , ## args) 61 + #define HPSB_INFO(fmt, args...) HPSB_PRINT(KERN_INFO, fmt , ## args) 62 + #define HPSB_NOTICE(fmt, args...) HPSB_PRINT(KERN_NOTICE, fmt , ## args) 63 + #define HPSB_WARN(fmt, args...) HPSB_PRINT(KERN_WARNING, fmt , ## args) 64 + #define HPSB_ERR(fmt, args...) HPSB_PRINT(KERN_ERR, fmt , ## args) 63 65 64 66 #ifdef CONFIG_IEEE1394_VERBOSEDEBUG 65 - #define HPSB_VERBOSE(fmt, args...) HPSB_PRINT(KERN_DEBUG, fmt , ## args) 67 + #define HPSB_VERBOSE(fmt, args...) HPSB_PRINT(KERN_DEBUG, fmt , ## args) 66 68 #else 67 69 #define HPSB_VERBOSE(fmt, args...) 68 70 #endif ··· 77 77 78 78 static inline void *memcpy_le32(u32 *dest, const u32 *__src, size_t count) 79 79 { 80 - void *tmp = dest; 80 + void *tmp = dest; 81 81 u32 *src = (u32 *)__src; 82 82 83 - count /= 4; 84 - 85 - while (count--) { 86 - *dest++ = swab32p(src++); 87 - } 88 - 89 - return tmp; 83 + count /= 4; 84 + while (count--) 85 + *dest++ = swab32p(src++); 86 + return tmp; 90 87 } 91 88 92 89 #else 93 90 94 91 static __inline__ void *memcpy_le32(u32 *dest, const u32 *src, size_t count) 95 92 { 96 - return memcpy(dest, src, count); 93 + return memcpy(dest, src, count); 97 94 } 98 95 99 96 #endif /* __BIG_ENDIAN */
+43 -37
drivers/ieee1394/iso.h
··· 17 17 18 18 /* high-level ISO interface */ 19 19 20 - /* This API sends and receives isochronous packets on a large, 21 - virtually-contiguous kernel memory buffer. The buffer may be mapped 22 - into a user-space process for zero-copy transmission and reception. 23 - 24 - There are no explicit boundaries between packets in the buffer. A 25 - packet may be transmitted or received at any location. However, 26 - low-level drivers may impose certain restrictions on alignment or 27 - size of packets. (e.g. in OHCI no packet may cross a page boundary, 28 - and packets should be quadlet-aligned) 29 - */ 20 + /* 21 + * This API sends and receives isochronous packets on a large, 22 + * virtually-contiguous kernel memory buffer. The buffer may be mapped 23 + * into a user-space process for zero-copy transmission and reception. 24 + * 25 + * There are no explicit boundaries between packets in the buffer. A 26 + * packet may be transmitted or received at any location. However, 27 + * low-level drivers may impose certain restrictions on alignment or 28 + * size of packets. (e.g. in OHCI no packet may cross a page boundary, 29 + * and packets should be quadlet-aligned) 30 + */ 30 31 31 32 /* Packet descriptor - the API maintains a ring buffer of these packet 32 - descriptors in kernel memory (hpsb_iso.infos[]). */ 33 - 33 + * descriptors in kernel memory (hpsb_iso.infos[]). */ 34 34 struct hpsb_iso_packet_info { 35 35 /* offset of data payload relative to the first byte of the buffer */ 36 36 __u32 offset; 37 37 38 - /* length of the data payload, in bytes (not including the isochronous header) */ 38 + /* length of the data payload, in bytes (not including the isochronous 39 + * header) */ 39 40 __u16 len; 40 41 41 - /* (recv only) the cycle number (mod 8000) on which the packet was received */ 42 + /* (recv only) the cycle number (mod 8000) on which the packet was 43 + * received */ 42 44 __u16 cycle; 43 45 44 46 /* (recv only) channel on which the packet was received */ ··· 50 48 __u8 tag; 51 49 __u8 sy; 52 50 53 - /* 54 - * length in bytes of the packet including header/trailer. 55 - * MUST be at structure end, since the first part of this structure is also 56 - * defined in raw1394.h (i.e. struct raw1394_iso_packet_info), is copied to 57 - * userspace and is accessed there through libraw1394. 58 - */ 51 + /* length in bytes of the packet including header/trailer. 52 + * MUST be at structure end, since the first part of this structure is 53 + * also defined in raw1394.h (i.e. struct raw1394_iso_packet_info), is 54 + * copied to userspace and is accessed there through libraw1394. */ 59 55 __u16 total_len; 60 56 }; 61 57 ··· 75 75 void *hostdata; 76 76 77 77 /* a function to be called (from interrupt context) after 78 - outgoing packets have been sent, or incoming packets have 79 - arrived */ 78 + * outgoing packets have been sent, or incoming packets have 79 + * arrived */ 80 80 void (*callback)(struct hpsb_iso*); 81 81 82 82 /* wait for buffer space */ ··· 88 88 89 89 90 90 /* greatest # of packets between interrupts - controls 91 - the maximum latency of the buffer */ 91 + * the maximum latency of the buffer */ 92 92 int irq_interval; 93 93 94 94 /* the buffer for packet data payloads */ ··· 112 112 int pkt_dma; 113 113 114 114 /* how many packets, starting at first_packet: 115 - (transmit) are ready to be filled with data 116 - (receive) contain received data */ 115 + * (transmit) are ready to be filled with data 116 + * (receive) contain received data */ 117 117 int n_ready_packets; 118 118 119 119 /* how many times the buffer has overflowed or underflowed */ ··· 134 134 int start_cycle; 135 135 136 136 /* cycle at which next packet will be transmitted, 137 - -1 if not known */ 137 + * -1 if not known */ 138 138 int xmit_cycle; 139 139 140 140 /* ringbuffer of packet descriptors in regular kernel memory ··· 170 170 int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask); 171 171 172 172 /* start/stop DMA */ 173 - int hpsb_iso_xmit_start(struct hpsb_iso *iso, int start_on_cycle, int prebuffer); 174 - int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle, int tag_mask, int sync); 173 + int hpsb_iso_xmit_start(struct hpsb_iso *iso, int start_on_cycle, 174 + int prebuffer); 175 + int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle, 176 + int tag_mask, int sync); 175 177 void hpsb_iso_stop(struct hpsb_iso *iso); 176 178 177 179 /* deallocate buffer and DMA context */ 178 180 void hpsb_iso_shutdown(struct hpsb_iso *iso); 179 181 180 - /* queue a packet for transmission. 'offset' is relative to the beginning of the 181 - DMA buffer, where the packet's data payload should already have been placed */ 182 - int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len, u8 tag, u8 sy); 182 + /* queue a packet for transmission. 183 + * 'offset' is relative to the beginning of the DMA buffer, where the packet's 184 + * data payload should already have been placed. */ 185 + int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len, 186 + u8 tag, u8 sy); 183 187 184 188 /* wait until all queued packets have been transmitted to the bus */ 185 189 int hpsb_iso_xmit_sync(struct hpsb_iso *iso); 186 190 187 191 /* N packets have been read out of the buffer, re-use the buffer space */ 188 - int hpsb_iso_recv_release_packets(struct hpsb_iso *recv, unsigned int n_packets); 192 + int hpsb_iso_recv_release_packets(struct hpsb_iso *recv, 193 + unsigned int n_packets); 189 194 190 195 /* check for arrival of new packets immediately (even if irq_interval 191 - has not yet been reached) */ 196 + * has not yet been reached) */ 192 197 int hpsb_iso_recv_flush(struct hpsb_iso *iso); 193 198 194 199 /* returns # of packets ready to send or receive */ ··· 202 197 /* the following are callbacks available to low-level drivers */ 203 198 204 199 /* call after a packet has been transmitted to the bus (interrupt context is OK) 205 - 'cycle' is the _exact_ cycle the packet was sent on 206 - 'error' should be non-zero if some sort of error occurred when sending the packet 207 - */ 200 + * 'cycle' is the _exact_ cycle the packet was sent on 201 + * 'error' should be non-zero if some sort of error occurred when sending the 202 + * packet */ 208 203 void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error); 209 204 210 205 /* call after a packet has been received (interrupt context OK) */ 211 206 void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len, 212 - u16 total_len, u16 cycle, u8 channel, u8 tag, u8 sy); 207 + u16 total_len, u16 cycle, u8 channel, u8 tag, 208 + u8 sy); 213 209 214 210 /* call to wake waiting processes after buffer space has opened up. */ 215 211 void hpsb_iso_wake(struct hpsb_iso *iso);
+5 -11
drivers/ieee1394/nodemgr.h
··· 44 44 u16 max_rec; /* Maximum packet size node can receive */ 45 45 }; 46 46 47 - 48 47 #define UNIT_DIRECTORY_VENDOR_ID 0x01 49 48 #define UNIT_DIRECTORY_MODEL_ID 0x02 50 49 #define UNIT_DIRECTORY_SPECIFIER_ID 0x04 ··· 58 59 * unit directory for each of these protocols. 59 60 */ 60 61 struct unit_directory { 61 - struct node_entry *ne; /* The node which this directory belongs to */ 62 - octlet_t address; /* Address of the unit directory on the node */ 62 + struct node_entry *ne; /* The node which this directory belongs to */ 63 + octlet_t address; /* Address of the unit directory on the node */ 63 64 u8 flags; /* Indicates which entries were read */ 64 65 65 66 quadlet_t vendor_id; ··· 78 79 int length; /* Number of quadlets */ 79 80 80 81 struct device device; 81 - 82 82 struct class_device class_dev; 83 83 84 84 struct csr1212_keyval *ud_kv; 85 - u32 lun; /* logical unit number immediate value */ 85 + u32 lun; /* logical unit number immediate value */ 86 86 }; 87 87 88 88 struct node_entry { ··· 104 106 struct hpsb_tlabel_pool *tpool; 105 107 106 108 struct device device; 107 - 108 109 struct class_device class_dev; 109 110 110 111 /* Means this node is not attached anymore */ ··· 150 153 /* 151 154 * This will fill in the given, pre-initialised hpsb_packet with the current 152 155 * information from the node entry (host, node ID, generation number). It will 153 - * return false if the node owning the GUID is not accessible (and not modify the 154 - * hpsb_packet) and return true otherwise. 156 + * return false if the node owning the GUID is not accessible (and not modify 157 + * the hpsb_packet) and return true otherwise. 155 158 * 156 159 * Note that packet sending may still fail in hpsb_send_packet if a bus reset 157 160 * happens while you are trying to set up the packet (due to obsolete generation ··· 167 170 int hpsb_node_lock(struct node_entry *ne, u64 addr, 168 171 int extcode, quadlet_t *data, quadlet_t arg); 169 172 170 - 171 173 /* Iterate the hosts, calling a given function with supplied data for each 172 174 * host. */ 173 175 int nodemgr_for_each_host(void *__data, int (*cb)(struct hpsb_host *, void *)); 174 176 175 - 176 177 int init_ieee1394_nodemgr(void); 177 178 void cleanup_ieee1394_nodemgr(void); 178 - 179 179 180 180 /* The template for a host device */ 181 181 extern struct device nodemgr_dev_template_host;