From 93c4cceb963ebb133531e5e3f4f6e2da0d222656 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 26 Jan 2007 00:38:26 -0500 Subject: firewire: Handle access to CSR resources on local node. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristian Høgsberg Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'drivers/firewire/fw-transaction.c') 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; -- cgit v1.2.3