aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-transaction.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-05-07 20:33:35 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-05-10 12:24:13 -0400
commita77754a75d58d534fd34a5add8ac1bb91d4ffc0f (patch)
tree773885568a19a8ed354acba1bf5c1d5a63a828d1 /drivers/firewire/fw-transaction.c
parenta98e27198771d066934a263177673ebde797e8fb (diff)
firewire: Uppercase most macro names.
Signed-off-by: Kristian Hoegsberg <krh@redhat.com> 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.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index e4355de710fa..01c438f1c670 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -34,29 +34,29 @@
34#include "fw-topology.h" 34#include "fw-topology.h"
35#include "fw-device.h" 35#include "fw-device.h"
36 36
37#define header_pri(pri) ((pri) << 0) 37#define HEADER_PRI(pri) ((pri) << 0)
38#define header_tcode(tcode) ((tcode) << 4) 38#define HEADER_TCODE(tcode) ((tcode) << 4)
39#define header_retry(retry) ((retry) << 8) 39#define HEADER_RETRY(retry) ((retry) << 8)
40#define header_tlabel(tlabel) ((tlabel) << 10) 40#define HEADER_TLABEL(tlabel) ((tlabel) << 10)
41#define header_destination(destination) ((destination) << 16) 41#define HEADER_DESTINATION(destination) ((destination) << 16)
42#define header_source(source) ((source) << 16) 42#define HEADER_SOURCE(source) ((source) << 16)
43#define header_rcode(rcode) ((rcode) << 12) 43#define HEADER_RCODE(rcode) ((rcode) << 12)
44#define header_offset_high(offset_high) ((offset_high) << 0) 44#define HEADER_OFFSET_HIGH(offset_high) ((offset_high) << 0)
45#define header_data_length(length) ((length) << 16) 45#define HEADER_DATA_LENGTH(length) ((length) << 16)
46#define header_extended_tcode(tcode) ((tcode) << 0) 46#define HEADER_EXTENDED_TCODE(tcode) ((tcode) << 0)
47 47
48#define header_get_tcode(q) (((q) >> 4) & 0x0f) 48#define HEADER_GET_TCODE(q) (((q) >> 4) & 0x0f)
49#define header_get_tlabel(q) (((q) >> 10) & 0x3f) 49#define HEADER_GET_TLABEL(q) (((q) >> 10) & 0x3f)
50#define header_get_rcode(q) (((q) >> 12) & 0x0f) 50#define HEADER_GET_RCODE(q) (((q) >> 12) & 0x0f)
51#define header_get_destination(q) (((q) >> 16) & 0xffff) 51#define HEADER_GET_DESTINATION(q) (((q) >> 16) & 0xffff)
52#define header_get_source(q) (((q) >> 16) & 0xffff) 52#define HEADER_GET_SOURCE(q) (((q) >> 16) & 0xffff)
53#define header_get_offset_high(q) (((q) >> 0) & 0xffff) 53#define HEADER_GET_OFFSET_HIGH(q) (((q) >> 0) & 0xffff)
54#define header_get_data_length(q) (((q) >> 16) & 0xffff) 54#define HEADER_GET_DATA_LENGTH(q) (((q) >> 16) & 0xffff)
55#define header_get_extended_tcode(q) (((q) >> 0) & 0xffff) 55#define HEADER_GET_EXTENDED_TCODE(q) (((q) >> 0) & 0xffff)
56 56
57#define phy_config_gap_count(gap_count) (((gap_count) << 16) | (1 << 22)) 57#define PHY_CONFIG_GAP_COUNT(gap_count) (((gap_count) << 16) | (1 << 22))
58#define phy_config_root_id(node_id) ((((node_id) & 0x3f) << 24) | (1 << 23)) 58#define PHY_CONFIG_ROOT_ID(node_id) ((((node_id) & 0x3f) << 24) | (1 << 23))
59#define phy_identifier(id) ((id) << 30) 59#define PHY_IDENTIFIER(id) ((id) << 30)
60 60
61static int 61static int
62close_transaction(struct fw_transaction *transaction, 62close_transaction(struct fw_transaction *transaction,
@@ -159,12 +159,12 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
159 ext_tcode = 0; 159 ext_tcode = 0;
160 160
161 packet->header[0] = 161 packet->header[0] =
162 header_retry(RETRY_X) | 162 HEADER_RETRY(RETRY_X) |
163 header_tlabel(tlabel) | 163 HEADER_TLABEL(tlabel) |
164 header_tcode(tcode) | 164 HEADER_TCODE(tcode) |
165 header_destination(node_id); 165 HEADER_DESTINATION(node_id);
166 packet->header[1] = 166 packet->header[1] =
167 header_offset_high(offset >> 32) | header_source(source_id); 167 HEADER_OFFSET_HIGH(offset >> 32) | HEADER_SOURCE(source_id);
168 packet->header[2] = 168 packet->header[2] =
169 offset; 169 offset;
170 170
@@ -178,8 +178,8 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
178 case TCODE_LOCK_REQUEST: 178 case TCODE_LOCK_REQUEST:
179 case TCODE_WRITE_BLOCK_REQUEST: 179 case TCODE_WRITE_BLOCK_REQUEST:
180 packet->header[3] = 180 packet->header[3] =
181 header_data_length(length) | 181 HEADER_DATA_LENGTH(length) |
182 header_extended_tcode(ext_tcode); 182 HEADER_EXTENDED_TCODE(ext_tcode);
183 packet->header_length = 16; 183 packet->header_length = 16;
184 packet->payload = payload; 184 packet->payload = payload;
185 packet->payload_length = length; 185 packet->payload_length = length;
@@ -192,8 +192,8 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
192 192
193 case TCODE_READ_BLOCK_REQUEST: 193 case TCODE_READ_BLOCK_REQUEST:
194 packet->header[3] = 194 packet->header[3] =
195 header_data_length(length) | 195 HEADER_DATA_LENGTH(length) |
196 header_extended_tcode(ext_tcode); 196 HEADER_EXTENDED_TCODE(ext_tcode);
197 packet->header_length = 16; 197 packet->header_length = 16;
198 packet->payload_length = 0; 198 packet->payload_length = 0;
199 break; 199 break;
@@ -325,9 +325,9 @@ void fw_send_phy_config(struct fw_card *card,
325{ 325{
326 u32 q; 326 u32 q;
327 327
328 q = phy_identifier(PHY_PACKET_CONFIG) | 328 q = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
329 phy_config_root_id(node_id) | 329 PHY_CONFIG_ROOT_ID(node_id) |
330 phy_config_gap_count(gap_count); 330 PHY_CONFIG_GAP_COUNT(gap_count);
331 331
332 send_phy_packet(card, q, generation); 332 send_phy_packet(card, q, generation);
333} 333}
@@ -485,32 +485,32 @@ fw_fill_response(struct fw_packet *response, u32 *request_header,
485{ 485{
486 int tcode, tlabel, extended_tcode, source, destination; 486 int tcode, tlabel, extended_tcode, source, destination;
487 487
488 tcode = header_get_tcode(request_header[0]); 488 tcode = HEADER_GET_TCODE(request_header[0]);
489 tlabel = header_get_tlabel(request_header[0]); 489 tlabel = HEADER_GET_TLABEL(request_header[0]);
490 source = header_get_destination(request_header[0]); 490 source = HEADER_GET_DESTINATION(request_header[0]);
491 destination = header_get_source(request_header[1]); 491 destination = HEADER_GET_SOURCE(request_header[1]);
492 extended_tcode = header_get_extended_tcode(request_header[3]); 492 extended_tcode = HEADER_GET_EXTENDED_TCODE(request_header[3]);
493 493
494 response->header[0] = 494 response->header[0] =
495 header_retry(RETRY_1) | 495 HEADER_RETRY(RETRY_1) |
496 header_tlabel(tlabel) | 496 HEADER_TLABEL(tlabel) |
497 header_destination(destination); 497 HEADER_DESTINATION(destination);
498 response->header[1] = 498 response->header[1] =
499 header_source(source) | 499 HEADER_SOURCE(source) |
500 header_rcode(rcode); 500 HEADER_RCODE(rcode);
501 response->header[2] = 0; 501 response->header[2] = 0;
502 502
503 switch (tcode) { 503 switch (tcode) {
504 case TCODE_WRITE_QUADLET_REQUEST: 504 case TCODE_WRITE_QUADLET_REQUEST:
505 case TCODE_WRITE_BLOCK_REQUEST: 505 case TCODE_WRITE_BLOCK_REQUEST:
506 response->header[0] |= header_tcode(TCODE_WRITE_RESPONSE); 506 response->header[0] |= HEADER_TCODE(TCODE_WRITE_RESPONSE);
507 response->header_length = 12; 507 response->header_length = 12;
508 response->payload_length = 0; 508 response->payload_length = 0;
509 break; 509 break;
510 510
511 case TCODE_READ_QUADLET_REQUEST: 511 case TCODE_READ_QUADLET_REQUEST:
512 response->header[0] |= 512 response->header[0] |=
513 header_tcode(TCODE_READ_QUADLET_RESPONSE); 513 HEADER_TCODE(TCODE_READ_QUADLET_RESPONSE);
514 if (payload != NULL) 514 if (payload != NULL)
515 response->header[3] = *(u32 *)payload; 515 response->header[3] = *(u32 *)payload;
516 else 516 else
@@ -521,10 +521,10 @@ fw_fill_response(struct fw_packet *response, u32 *request_header,
521 521
522 case TCODE_READ_BLOCK_REQUEST: 522 case TCODE_READ_BLOCK_REQUEST:
523 case TCODE_LOCK_REQUEST: 523 case TCODE_LOCK_REQUEST:
524 response->header[0] |= header_tcode(tcode + 2); 524 response->header[0] |= HEADER_TCODE(tcode + 2);
525 response->header[3] = 525 response->header[3] =
526 header_data_length(length) | 526 HEADER_DATA_LENGTH(length) |
527 header_extended_tcode(extended_tcode); 527 HEADER_EXTENDED_TCODE(extended_tcode);
528 response->header_length = 16; 528 response->header_length = 16;
529 response->payload = payload; 529 response->payload = payload;
530 response->payload_length = length; 530 response->payload_length = length;
@@ -544,7 +544,7 @@ allocate_request(struct fw_packet *p)
544 u32 *data, length; 544 u32 *data, length;
545 int request_tcode, t; 545 int request_tcode, t;
546 546
547 request_tcode = header_get_tcode(p->header[0]); 547 request_tcode = HEADER_GET_TCODE(p->header[0]);
548 switch (request_tcode) { 548 switch (request_tcode) {
549 case TCODE_WRITE_QUADLET_REQUEST: 549 case TCODE_WRITE_QUADLET_REQUEST:
550 data = &p->header[3]; 550 data = &p->header[3];
@@ -554,7 +554,7 @@ allocate_request(struct fw_packet *p)
554 case TCODE_WRITE_BLOCK_REQUEST: 554 case TCODE_WRITE_BLOCK_REQUEST:
555 case TCODE_LOCK_REQUEST: 555 case TCODE_LOCK_REQUEST:
556 data = p->payload; 556 data = p->payload;
557 length = header_get_data_length(p->header[3]); 557 length = HEADER_GET_DATA_LENGTH(p->header[3]);
558 break; 558 break;
559 559
560 case TCODE_READ_QUADLET_REQUEST: 560 case TCODE_READ_QUADLET_REQUEST:
@@ -564,7 +564,7 @@ allocate_request(struct fw_packet *p)
564 564
565 case TCODE_READ_BLOCK_REQUEST: 565 case TCODE_READ_BLOCK_REQUEST:
566 data = NULL; 566 data = NULL;
567 length = header_get_data_length(p->header[3]); 567 length = HEADER_GET_DATA_LENGTH(p->header[3]);
568 break; 568 break;
569 569
570 default: 570 default:
@@ -644,10 +644,10 @@ fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
644 644
645 offset = 645 offset =
646 ((unsigned long long) 646 ((unsigned long long)
647 header_get_offset_high(p->header[1]) << 32) | p->header[2]; 647 HEADER_GET_OFFSET_HIGH(p->header[1]) << 32) | p->header[2];
648 tcode = header_get_tcode(p->header[0]); 648 tcode = HEADER_GET_TCODE(p->header[0]);
649 destination = header_get_destination(p->header[0]); 649 destination = HEADER_GET_DESTINATION(p->header[0]);
650 source = header_get_source(p->header[0]); 650 source = HEADER_GET_SOURCE(p->header[0]);
651 651
652 spin_lock_irqsave(&address_handler_lock, flags); 652 spin_lock_irqsave(&address_handler_lock, flags);
653 handler = lookup_enclosing_address_handler(&address_handler_list, 653 handler = lookup_enclosing_address_handler(&address_handler_list,
@@ -682,11 +682,11 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
682 size_t data_length; 682 size_t data_length;
683 int tcode, tlabel, destination, source, rcode; 683 int tcode, tlabel, destination, source, rcode;
684 684
685 tcode = header_get_tcode(p->header[0]); 685 tcode = HEADER_GET_TCODE(p->header[0]);
686 tlabel = header_get_tlabel(p->header[0]); 686 tlabel = HEADER_GET_TLABEL(p->header[0]);
687 destination = header_get_destination(p->header[0]); 687 destination = HEADER_GET_DESTINATION(p->header[0]);
688 source = header_get_source(p->header[1]); 688 source = HEADER_GET_SOURCE(p->header[1]);
689 rcode = header_get_rcode(p->header[1]); 689 rcode = HEADER_GET_RCODE(p->header[1]);
690 690
691 spin_lock_irqsave(&card->lock, flags); 691 spin_lock_irqsave(&card->lock, flags);
692 list_for_each_entry(t, &card->transaction_list, link) { 692 list_for_each_entry(t, &card->transaction_list, link) {
@@ -723,7 +723,7 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
723 case TCODE_READ_BLOCK_RESPONSE: 723 case TCODE_READ_BLOCK_RESPONSE:
724 case TCODE_LOCK_RESPONSE: 724 case TCODE_LOCK_RESPONSE:
725 data = p->payload; 725 data = p->payload;
726 data_length = header_get_data_length(p->header[3]); 726 data_length = HEADER_GET_DATA_LENGTH(p->header[3]);
727 break; 727 break;
728 728
729 default: 729 default: