aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-transaction.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-transaction.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-transaction.c')
-rw-r--r--drivers/firewire/fw-transaction.c92
1 files changed, 37 insertions, 55 deletions
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index e17ebc42f12..1537737e442 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -64,10 +64,9 @@
64#define PHY_CONFIG_ROOT_ID(node_id) ((((node_id) & 0x3f) << 24) | (1 << 23)) 64#define PHY_CONFIG_ROOT_ID(node_id) ((((node_id) & 0x3f) << 24) | (1 << 23))
65#define PHY_IDENTIFIER(id) ((id) << 30) 65#define PHY_IDENTIFIER(id) ((id) << 30)
66 66
67static int 67static int close_transaction(struct fw_transaction *transaction,
68close_transaction(struct fw_transaction *transaction, 68 struct fw_card *card, int rcode,
69 struct fw_card *card, int rcode, 69 u32 *payload, size_t length)
70 u32 *payload, size_t length)
71{ 70{
72 struct fw_transaction *t; 71 struct fw_transaction *t;
73 unsigned long flags; 72 unsigned long flags;
@@ -94,9 +93,8 @@ close_transaction(struct fw_transaction *transaction,
94 * Only valid for transactions that are potentially pending (ie have 93 * Only valid for transactions that are potentially pending (ie have
95 * been sent). 94 * been sent).
96 */ 95 */
97int 96int fw_cancel_transaction(struct fw_card *card,
98fw_cancel_transaction(struct fw_card *card, 97 struct fw_transaction *transaction)
99 struct fw_transaction *transaction)
100{ 98{
101 /* 99 /*
102 * Cancel the packet transmission if it's still queued. That 100 * Cancel the packet transmission if it's still queued. That
@@ -116,9 +114,8 @@ fw_cancel_transaction(struct fw_card *card,
116} 114}
117EXPORT_SYMBOL(fw_cancel_transaction); 115EXPORT_SYMBOL(fw_cancel_transaction);
118 116
119static void 117static void transmit_complete_callback(struct fw_packet *packet,
120transmit_complete_callback(struct fw_packet *packet, 118 struct fw_card *card, int status)
121 struct fw_card *card, int status)
122{ 119{
123 struct fw_transaction *t = 120 struct fw_transaction *t =
124 container_of(packet, struct fw_transaction, packet); 121 container_of(packet, struct fw_transaction, packet);
@@ -151,8 +148,7 @@ transmit_complete_callback(struct fw_packet *packet,
151 } 148 }
152} 149}
153 150
154static void 151static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
155fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
156 int destination_id, int source_id, int generation, int speed, 152 int destination_id, int source_id, int generation, int speed,
157 unsigned long long offset, void *payload, size_t length) 153 unsigned long long offset, void *payload, size_t length)
158{ 154{
@@ -247,12 +243,10 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
247 * @param callback_data pointer to arbitrary data, which will be 243 * @param callback_data pointer to arbitrary data, which will be
248 * passed to the callback 244 * passed to the callback
249 */ 245 */
250void 246void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
251fw_send_request(struct fw_card *card, struct fw_transaction *t, 247 int destination_id, int generation, int speed,
252 int tcode, int destination_id, int generation, int speed, 248 unsigned long long offset, void *payload, size_t length,
253 unsigned long long offset, 249 fw_transaction_callback_t callback, void *callback_data)
254 void *payload, size_t length,
255 fw_transaction_callback_t callback, void *callback_data)
256{ 250{
257 unsigned long flags; 251 unsigned long flags;
258 int tlabel; 252 int tlabel;
@@ -322,8 +316,8 @@ static void transaction_callback(struct fw_card *card, int rcode,
322 * Returns the RCODE. 316 * Returns the RCODE.
323 */ 317 */
324int fw_run_transaction(struct fw_card *card, int tcode, int destination_id, 318int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
325 int generation, int speed, unsigned long long offset, 319 int generation, int speed, unsigned long long offset,
326 void *data, size_t length) 320 void *data, size_t length)
327{ 321{
328 struct transaction_callback_data d; 322 struct transaction_callback_data d;
329 struct fw_transaction t; 323 struct fw_transaction t;
@@ -399,9 +393,8 @@ void fw_flush_transactions(struct fw_card *card)
399 } 393 }
400} 394}
401 395
402static struct fw_address_handler * 396static struct fw_address_handler *lookup_overlapping_address_handler(
403lookup_overlapping_address_handler(struct list_head *list, 397 struct list_head *list, unsigned long long offset, size_t length)
404 unsigned long long offset, size_t length)
405{ 398{
406 struct fw_address_handler *handler; 399 struct fw_address_handler *handler;
407 400
@@ -414,9 +407,8 @@ lookup_overlapping_address_handler(struct list_head *list,
414 return NULL; 407 return NULL;
415} 408}
416 409
417static struct fw_address_handler * 410static struct fw_address_handler *lookup_enclosing_address_handler(
418lookup_enclosing_address_handler(struct list_head *list, 411 struct list_head *list, unsigned long long offset, size_t length)
419 unsigned long long offset, size_t length)
420{ 412{
421 struct fw_address_handler *handler; 413 struct fw_address_handler *handler;
422 414
@@ -463,9 +455,8 @@ const struct fw_address_region fw_unit_space_region =
463 * The start offset of the handler's address region is determined by 455 * The start offset of the handler's address region is determined by
464 * fw_core_add_address_handler() and is returned in handler->offset. 456 * fw_core_add_address_handler() and is returned in handler->offset.
465 */ 457 */
466int 458int fw_core_add_address_handler(struct fw_address_handler *handler,
467fw_core_add_address_handler(struct fw_address_handler *handler, 459 const struct fw_address_region *region)
468 const struct fw_address_region *region)
469{ 460{
470 struct fw_address_handler *other; 461 struct fw_address_handler *other;
471 unsigned long flags; 462 unsigned long flags;
@@ -522,9 +513,8 @@ struct fw_request {
522 u32 data[0]; 513 u32 data[0];
523}; 514};
524 515
525static void 516static void free_response_callback(struct fw_packet *packet,
526free_response_callback(struct fw_packet *packet, 517 struct fw_card *card, int status)
527 struct fw_card *card, int status)
528{ 518{
529 struct fw_request *request; 519 struct fw_request *request;
530 520
@@ -532,9 +522,8 @@ free_response_callback(struct fw_packet *packet,
532 kfree(request); 522 kfree(request);
533} 523}
534 524
535void 525void fw_fill_response(struct fw_packet *response, u32 *request_header,
536fw_fill_response(struct fw_packet *response, u32 *request_header, 526 int rcode, void *payload, size_t length)
537 int rcode, void *payload, size_t length)
538{ 527{
539 int tcode, tlabel, extended_tcode, source, destination; 528 int tcode, tlabel, extended_tcode, source, destination;
540 529
@@ -592,8 +581,7 @@ fw_fill_response(struct fw_packet *response, u32 *request_header,
592} 581}
593EXPORT_SYMBOL(fw_fill_response); 582EXPORT_SYMBOL(fw_fill_response);
594 583
595static struct fw_request * 584static struct fw_request *allocate_request(struct fw_packet *p)
596allocate_request(struct fw_packet *p)
597{ 585{
598 struct fw_request *request; 586 struct fw_request *request;
599 u32 *data, length; 587 u32 *data, length;
@@ -653,8 +641,8 @@ allocate_request(struct fw_packet *p)
653 return request; 641 return request;
654} 642}
655 643
656void 644void fw_send_response(struct fw_card *card,
657fw_send_response(struct fw_card *card, struct fw_request *request, int rcode) 645 struct fw_request *request, int rcode)
658{ 646{
659 /* unified transaction or broadcast transaction: don't respond */ 647 /* unified transaction or broadcast transaction: don't respond */
660 if (request->ack != ACK_PENDING || 648 if (request->ack != ACK_PENDING ||
@@ -674,8 +662,7 @@ fw_send_response(struct fw_card *card, struct fw_request *request, int rcode)
674} 662}
675EXPORT_SYMBOL(fw_send_response); 663EXPORT_SYMBOL(fw_send_response);
676 664
677void 665void fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
678fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
679{ 666{
680 struct fw_address_handler *handler; 667 struct fw_address_handler *handler;
681 struct fw_request *request; 668 struct fw_request *request;
@@ -723,8 +710,7 @@ fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
723} 710}
724EXPORT_SYMBOL(fw_core_handle_request); 711EXPORT_SYMBOL(fw_core_handle_request);
725 712
726void 713void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
727fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
728{ 714{
729 struct fw_transaction *t; 715 struct fw_transaction *t;
730 unsigned long flags; 716 unsigned long flags;
@@ -797,12 +783,10 @@ static const struct fw_address_region topology_map_region =
797 { .start = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP, 783 { .start = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP,
798 .end = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP_END, }; 784 .end = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP_END, };
799 785
800static void 786static void handle_topology_map(struct fw_card *card, struct fw_request *request,
801handle_topology_map(struct fw_card *card, struct fw_request *request, 787 int tcode, int destination, int source, int generation,
802 int tcode, int destination, int source, 788 int speed, unsigned long long offset,
803 int generation, int speed, 789 void *payload, size_t length, void *callback_data)
804 unsigned long long offset,
805 void *payload, size_t length, void *callback_data)
806{ 790{
807 int i, start, end; 791 int i, start, end;
808 __be32 *map; 792 __be32 *map;
@@ -836,12 +820,10 @@ static const struct fw_address_region registers_region =
836 { .start = CSR_REGISTER_BASE, 820 { .start = CSR_REGISTER_BASE,
837 .end = CSR_REGISTER_BASE | CSR_CONFIG_ROM, }; 821 .end = CSR_REGISTER_BASE | CSR_CONFIG_ROM, };
838 822
839static void 823static void handle_registers(struct fw_card *card, struct fw_request *request,
840handle_registers(struct fw_card *card, struct fw_request *request, 824 int tcode, int destination, int source, int generation,
841 int tcode, int destination, int source, 825 int speed, unsigned long long offset,
842 int generation, int speed, 826 void *payload, size_t length, void *callback_data)
843 unsigned long long offset,
844 void *payload, size_t length, void *callback_data)
845{ 827{
846 int reg = offset & ~CSR_REGISTER_BASE; 828 int reg = offset & ~CSR_REGISTER_BASE;
847 unsigned long long bus_time; 829 unsigned long long bus_time;