aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-transaction.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-01-26 00:38:26 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 16:02:47 -0500
commit93c4cceb963ebb133531e5e3f4f6e2da0d222656 (patch)
tree3d53c8720e64a8f02278b0f958251195574d2caa /drivers/firewire/fw-transaction.c
parent746083d86cf5f874741e3ddecf56ea3ed32959c8 (diff)
firewire: Handle access to CSR resources on local node.
Signed-off-by: Kristian Høgsberg <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.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index a116ffa9bf45..780ed2b44983 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -425,7 +425,7 @@ free_response_callback(struct fw_packet *packet,
425 kfree(request); 425 kfree(request);
426} 426}
427 427
428static void 428void
429fw_fill_response(struct fw_packet *response, u32 *request_header, 429fw_fill_response(struct fw_packet *response, u32 *request_header,
430 int rcode, void *payload, size_t length) 430 int rcode, void *payload, size_t length)
431{ 431{
@@ -457,7 +457,10 @@ fw_fill_response(struct fw_packet *response, u32 *request_header,
457 case TCODE_READ_QUADLET_REQUEST: 457 case TCODE_READ_QUADLET_REQUEST:
458 response->header[0] |= 458 response->header[0] |=
459 header_tcode(TCODE_READ_QUADLET_RESPONSE); 459 header_tcode(TCODE_READ_QUADLET_RESPONSE);
460 response->header[3] = *(u32 *)payload; 460 if (payload != NULL)
461 response->header[3] = *(u32 *)payload;
462 else
463 response->header[3] = 0;
461 response->header_length = 16; 464 response->header_length = 16;
462 response->payload_length = 0; 465 response->payload_length = 0;
463 break; 466 break;
@@ -478,6 +481,7 @@ fw_fill_response(struct fw_packet *response, u32 *request_header,
478 return; 481 return;
479 } 482 }
480} 483}
484EXPORT_SYMBOL(fw_fill_response);
481 485
482static struct fw_request * 486static struct fw_request *
483allocate_request(struct fw_packet *p) 487allocate_request(struct fw_packet *p)
@@ -529,9 +533,9 @@ allocate_request(struct fw_packet *p)
529 request->response.generation = p->generation; 533 request->response.generation = p->generation;
530 request->response.callback = free_response_callback; 534 request->response.callback = free_response_callback;
531 request->ack = p->ack; 535 request->ack = p->ack;
532 request->length = p->payload_length; 536 request->length = length;
533 if (data) 537 if (data)
534 memcpy(request->data, p->payload, p->payload_length); 538 memcpy(request->data, p->payload, length);
535 539
536 memcpy(request->request_header, p->header, sizeof p->header); 540 memcpy(request->request_header, p->header, sizeof p->header);
537 541
@@ -656,7 +660,7 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
656 660
657 case TCODE_READ_BLOCK_RESPONSE: 661 case TCODE_READ_BLOCK_RESPONSE:
658 case TCODE_LOCK_RESPONSE: 662 case TCODE_LOCK_RESPONSE:
659 data = &p->header[4]; 663 data = p->payload;
660 data_length = header_get_data_length(p->header[3]); 664 data_length = header_get_data_length(p->header[3]);
661 break; 665 break;
662 666