diff options
author | Kristian Høgsberg <krh@redhat.com> | 2007-01-26 06:38:26 +0100 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-09 22:02:47 +0100 |
commit | 93c4cceb963ebb133531e5e3f4f6e2da0d222656 (patch) | |
tree | 3d53c8720e64a8f02278b0f958251195574d2caa /drivers/firewire/fw-transaction.c | |
parent | firewire: Add lock transaction opcodes to fw-device-cdev.h. (diff) | |
download | linux-93c4cceb963ebb133531e5e3f4f6e2da0d222656.tar.xz linux-93c4cceb963ebb133531e5e3f4f6e2da0d222656.zip |
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.c | 14 |
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, kfree(request); } -static void +void fw_fill_response(struct fw_packet *response, u32 *request_header, int rcode, void *payload, size_t length) { @@ -457,7 +457,10 @@ fw_fill_response(struct fw_packet *response, u32 *request_header, case TCODE_READ_QUADLET_REQUEST: response->header[0] |= header_tcode(TCODE_READ_QUADLET_RESPONSE); - response->header[3] = *(u32 *)payload; + if (payload != NULL) + response->header[3] = *(u32 *)payload; + else + response->header[3] = 0; response->header_length = 16; response->payload_length = 0; break; @@ -478,6 +481,7 @@ fw_fill_response(struct fw_packet *response, u32 *request_header, return; } } +EXPORT_SYMBOL(fw_fill_response); static struct fw_request * allocate_request(struct fw_packet *p) @@ -529,9 +533,9 @@ allocate_request(struct fw_packet *p) request->response.generation = p->generation; request->response.callback = free_response_callback; request->ack = p->ack; - request->length = p->payload_length; + request->length = length; if (data) - memcpy(request->data, p->payload, p->payload_length); + memcpy(request->data, p->payload, length); memcpy(request->request_header, p->header, sizeof p->header); @@ -656,7 +660,7 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p) case TCODE_READ_BLOCK_RESPONSE: case TCODE_LOCK_RESPONSE: - data = &p->header[4]; + data = p->payload; data_length = header_get_data_length(p->header[3]); break; |