aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-ohci.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-12-14 15:47:04 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-03-24 15:56:40 -0400
commit53dca51175cc2f66d21aeb1e70146cca65c53dad (patch)
treeda729da20cc4ca1cb994fa6659be7f23259f7097 /drivers/firewire/fw-ohci.c
parent2dbd7d7e2327b0c2cc4e2de903e1cfa19980a504 (diff)
firewire: remove line breaks before function names
type function_name(parameters); is nice to look at but was not used consistently. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-ohci.c')
-rw-r--r--drivers/firewire/fw-ohci.c100
1 files changed, 44 insertions, 56 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index b941ab3da18e..4c7cf15986ae 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -441,9 +441,8 @@ static inline void flush_writes(const struct fw_ohci *ohci)
441 reg_read(ohci, OHCI1394_Version); 441 reg_read(ohci, OHCI1394_Version);
442} 442}
443 443
444static int 444static int ohci_update_phy_reg(struct fw_card *card, int addr,
445ohci_update_phy_reg(struct fw_card *card, int addr, 445 int clear_bits, int set_bits)
446 int clear_bits, int set_bits)
447{ 446{
448 struct fw_ohci *ohci = fw_ohci(card); 447 struct fw_ohci *ohci = fw_ohci(card);
449 u32 val, old; 448 u32 val, old;
@@ -658,8 +657,8 @@ static void ar_context_tasklet(unsigned long data)
658 } 657 }
659} 658}
660 659
661static int 660static int ar_context_init(struct ar_context *ctx,
662ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, u32 regs) 661 struct fw_ohci *ohci, u32 regs)
663{ 662{
664 struct ar_buffer ab; 663 struct ar_buffer ab;
665 664
@@ -690,8 +689,7 @@ static void ar_context_run(struct ar_context *ctx)
690 flush_writes(ctx->ohci); 689 flush_writes(ctx->ohci);
691} 690}
692 691
693static struct descriptor * 692static struct descriptor *find_branch_descriptor(struct descriptor *d, int z)
694find_branch_descriptor(struct descriptor *d, int z)
695{ 693{
696 int b, key; 694 int b, key;
697 695
@@ -751,8 +749,7 @@ static void context_tasklet(unsigned long data)
751 * Allocate a new buffer and add it to the list of free buffers for this 749 * Allocate a new buffer and add it to the list of free buffers for this
752 * context. Must be called with ohci->lock held. 750 * context. Must be called with ohci->lock held.
753 */ 751 */
754static int 752static int context_add_buffer(struct context *ctx)
755context_add_buffer(struct context *ctx)
756{ 753{
757 struct descriptor_buffer *desc; 754 struct descriptor_buffer *desc;
758 dma_addr_t uninitialized_var(bus_addr); 755 dma_addr_t uninitialized_var(bus_addr);
@@ -781,9 +778,8 @@ context_add_buffer(struct context *ctx)
781 return 0; 778 return 0;
782} 779}
783 780
784static int 781static int context_init(struct context *ctx, struct fw_ohci *ohci,
785context_init(struct context *ctx, struct fw_ohci *ohci, 782 u32 regs, descriptor_callback_t callback)
786 u32 regs, descriptor_callback_t callback)
787{ 783{
788 ctx->ohci = ohci; 784 ctx->ohci = ohci;
789 ctx->regs = regs; 785 ctx->regs = regs;
@@ -814,8 +810,7 @@ context_init(struct context *ctx, struct fw_ohci *ohci,
814 return 0; 810 return 0;
815} 811}
816 812
817static void 813static void context_release(struct context *ctx)
818context_release(struct context *ctx)
819{ 814{
820 struct fw_card *card = &ctx->ohci->card; 815 struct fw_card *card = &ctx->ohci->card;
821 struct descriptor_buffer *desc, *tmp; 816 struct descriptor_buffer *desc, *tmp;
@@ -827,8 +822,8 @@ context_release(struct context *ctx)
827} 822}
828 823
829/* Must be called with ohci->lock held */ 824/* Must be called with ohci->lock held */
830static struct descriptor * 825static struct descriptor *context_get_descriptors(struct context *ctx,
831context_get_descriptors(struct context *ctx, int z, dma_addr_t *d_bus) 826 int z, dma_addr_t *d_bus)
832{ 827{
833 struct descriptor *d = NULL; 828 struct descriptor *d = NULL;
834 struct descriptor_buffer *desc = ctx->buffer_tail; 829 struct descriptor_buffer *desc = ctx->buffer_tail;
@@ -912,8 +907,8 @@ struct driver_data {
912 * Must always be called with the ochi->lock held to ensure proper 907 * Must always be called with the ochi->lock held to ensure proper
913 * generation handling and locking around packet queue manipulation. 908 * generation handling and locking around packet queue manipulation.
914 */ 909 */
915static int 910static int at_context_queue_packet(struct context *ctx,
916at_context_queue_packet(struct context *ctx, struct fw_packet *packet) 911 struct fw_packet *packet)
917{ 912{
918 struct fw_ohci *ohci = ctx->ohci; 913 struct fw_ohci *ohci = ctx->ohci;
919 dma_addr_t d_bus, uninitialized_var(payload_bus); 914 dma_addr_t d_bus, uninitialized_var(payload_bus);
@@ -1095,8 +1090,8 @@ static int handle_at_packet(struct context *context,
1095#define HEADER_GET_DATA_LENGTH(q) (((q) >> 16) & 0xffff) 1090#define HEADER_GET_DATA_LENGTH(q) (((q) >> 16) & 0xffff)
1096#define HEADER_GET_EXTENDED_TCODE(q) (((q) >> 0) & 0xffff) 1091#define HEADER_GET_EXTENDED_TCODE(q) (((q) >> 0) & 0xffff)
1097 1092
1098static void 1093static void handle_local_rom(struct fw_ohci *ohci,
1099handle_local_rom(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr) 1094 struct fw_packet *packet, u32 csr)
1100{ 1095{
1101 struct fw_packet response; 1096 struct fw_packet response;
1102 int tcode, length, i; 1097 int tcode, length, i;
@@ -1122,8 +1117,8 @@ handle_local_rom(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr)
1122 fw_core_handle_response(&ohci->card, &response); 1117 fw_core_handle_response(&ohci->card, &response);
1123} 1118}
1124 1119
1125static void 1120static void handle_local_lock(struct fw_ohci *ohci,
1126handle_local_lock(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr) 1121 struct fw_packet *packet, u32 csr)
1127{ 1122{
1128 struct fw_packet response; 1123 struct fw_packet response;
1129 int tcode, length, ext_tcode, sel; 1124 int tcode, length, ext_tcode, sel;
@@ -1164,8 +1159,7 @@ handle_local_lock(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr)
1164 fw_core_handle_response(&ohci->card, &response); 1159 fw_core_handle_response(&ohci->card, &response);
1165} 1160}
1166 1161
1167static void 1162static void handle_local_request(struct context *ctx, struct fw_packet *packet)
1168handle_local_request(struct context *ctx, struct fw_packet *packet)
1169{ 1163{
1170 u64 offset; 1164 u64 offset;
1171 u32 csr; 1165 u32 csr;
@@ -1205,8 +1199,7 @@ handle_local_request(struct context *ctx, struct fw_packet *packet)
1205 } 1199 }
1206} 1200}
1207 1201
1208static void 1202static void at_context_transmit(struct context *ctx, struct fw_packet *packet)
1209at_context_transmit(struct context *ctx, struct fw_packet *packet)
1210{ 1203{
1211 unsigned long flags; 1204 unsigned long flags;
1212 int ret; 1205 int ret;
@@ -1590,8 +1583,8 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
1590 return 0; 1583 return 0;
1591} 1584}
1592 1585
1593static int 1586static int ohci_set_config_rom(struct fw_card *card,
1594ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length) 1587 u32 *config_rom, size_t length)
1595{ 1588{
1596 struct fw_ohci *ohci; 1589 struct fw_ohci *ohci;
1597 unsigned long flags; 1590 unsigned long flags;
@@ -1711,8 +1704,8 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
1711 return ret; 1704 return ret;
1712} 1705}
1713 1706
1714static int 1707static int ohci_enable_phys_dma(struct fw_card *card,
1715ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation) 1708 int node_id, int generation)
1716{ 1709{
1717#ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA 1710#ifdef CONFIG_FIREWIRE_OHCI_REMOTE_DMA
1718 return 0; 1711 return 0;
@@ -1752,8 +1745,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
1752#endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */ 1745#endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */
1753} 1746}
1754 1747
1755static u64 1748static u64 ohci_get_bus_time(struct fw_card *card)
1756ohci_get_bus_time(struct fw_card *card)
1757{ 1749{
1758 struct fw_ohci *ohci = fw_ohci(card); 1750 struct fw_ohci *ohci = fw_ohci(card);
1759 u32 cycle_time; 1751 u32 cycle_time;
@@ -1884,8 +1876,8 @@ static int handle_it_packet(struct context *context,
1884 return 1; 1876 return 1;
1885} 1877}
1886 1878
1887static struct fw_iso_context * 1879static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card,
1888ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size) 1880 int type, size_t header_size)
1889{ 1881{
1890 struct fw_ohci *ohci = fw_ohci(card); 1882 struct fw_ohci *ohci = fw_ohci(card);
1891 struct iso_context *ctx, *list; 1883 struct iso_context *ctx, *list;
@@ -2025,11 +2017,10 @@ static void ohci_free_iso_context(struct fw_iso_context *base)
2025 spin_unlock_irqrestore(&ohci->lock, flags); 2017 spin_unlock_irqrestore(&ohci->lock, flags);
2026} 2018}
2027 2019
2028static int 2020static int ohci_queue_iso_transmit(struct fw_iso_context *base,
2029ohci_queue_iso_transmit(struct fw_iso_context *base, 2021 struct fw_iso_packet *packet,
2030 struct fw_iso_packet *packet, 2022 struct fw_iso_buffer *buffer,
2031 struct fw_iso_buffer *buffer, 2023 unsigned long payload)
2032 unsigned long payload)
2033{ 2024{
2034 struct iso_context *ctx = container_of(base, struct iso_context, base); 2025 struct iso_context *ctx = container_of(base, struct iso_context, base);
2035 struct descriptor *d, *last, *pd; 2026 struct descriptor *d, *last, *pd;
@@ -2124,11 +2115,10 @@ ohci_queue_iso_transmit(struct fw_iso_context *base,
2124 return 0; 2115 return 0;
2125} 2116}
2126 2117
2127static int 2118static int ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
2128ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base, 2119 struct fw_iso_packet *packet,
2129 struct fw_iso_packet *packet, 2120 struct fw_iso_buffer *buffer,
2130 struct fw_iso_buffer *buffer, 2121 unsigned long payload)
2131 unsigned long payload)
2132{ 2122{
2133 struct iso_context *ctx = container_of(base, struct iso_context, base); 2123 struct iso_context *ctx = container_of(base, struct iso_context, base);
2134 struct db_descriptor *db = NULL; 2124 struct db_descriptor *db = NULL;
@@ -2205,11 +2195,10 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
2205 return 0; 2195 return 0;
2206} 2196}
2207 2197
2208static int 2198static int ohci_queue_iso_receive_packet_per_buffer(struct fw_iso_context *base,
2209ohci_queue_iso_receive_packet_per_buffer(struct fw_iso_context *base, 2199 struct fw_iso_packet *packet,
2210 struct fw_iso_packet *packet, 2200 struct fw_iso_buffer *buffer,
2211 struct fw_iso_buffer *buffer, 2201 unsigned long payload)
2212 unsigned long payload)
2213{ 2202{
2214 struct iso_context *ctx = container_of(base, struct iso_context, base); 2203 struct iso_context *ctx = container_of(base, struct iso_context, base);
2215 struct descriptor *d = NULL, *pd = NULL; 2204 struct descriptor *d = NULL, *pd = NULL;
@@ -2283,11 +2272,10 @@ ohci_queue_iso_receive_packet_per_buffer(struct fw_iso_context *base,
2283 return 0; 2272 return 0;
2284} 2273}
2285 2274
2286static int 2275static int ohci_queue_iso(struct fw_iso_context *base,
2287ohci_queue_iso(struct fw_iso_context *base, 2276 struct fw_iso_packet *packet,
2288 struct fw_iso_packet *packet, 2277 struct fw_iso_buffer *buffer,
2289 struct fw_iso_buffer *buffer, 2278 unsigned long payload)
2290 unsigned long payload)
2291{ 2279{
2292 struct iso_context *ctx = container_of(base, struct iso_context, base); 2280 struct iso_context *ctx = container_of(base, struct iso_context, base);
2293 unsigned long flags; 2281 unsigned long flags;
@@ -2353,8 +2341,8 @@ static void ohci_pmac_off(struct pci_dev *dev)
2353#define ohci_pmac_off(dev) 2341#define ohci_pmac_off(dev)
2354#endif /* CONFIG_PPC_PMAC */ 2342#endif /* CONFIG_PPC_PMAC */
2355 2343
2356static int __devinit 2344static int __devinit pci_probe(struct pci_dev *dev,
2357pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) 2345 const struct pci_device_id *ent)
2358{ 2346{
2359 struct fw_ohci *ohci; 2347 struct fw_ohci *ohci;
2360 u32 bus_options, max_receive, link_speed, version; 2348 u32 bus_options, max_receive, link_speed, version;