From 0b6c4857f7684f6d3f59e0506f62953575346978 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Mon, 9 Apr 2012 20:51:18 +0200 Subject: firewire: core: fix DMA mapping direction Seen with recent libdc1394: If a client mmap()s the buffer of an isochronous reception buffer with PROT_READ|PROT_WRITE instead of just PROT_READ, firewire-core sets the wrong DMA mapping direction during buffer initialization. The fix is to split fw_iso_buffer_init() into allocation and DMA mapping and to perform the latter after both buffer and DMA context were allocated. Buffer allocation and context allocation may happen in any order, but we need the context type (reception or transmission) in order to set the DMA direction of the buffer. Signed-off-by: Stefan Richter --- include/linux/firewire.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/firewire.h') diff --git a/include/linux/firewire.h b/include/linux/firewire.h index cdc9b719e9c7..0a1905719f6f 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -391,6 +391,7 @@ struct fw_iso_buffer { enum dma_data_direction direction; struct page **pages; int page_count; + int page_count_mapped; }; int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, -- cgit v1.2.1 From 7bdbff6762a573b911e4ee5715779d8ee6a62631 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Wed, 11 Apr 2012 17:38:10 +0200 Subject: firewire: move rcode_string() to core There is nothing audio-specific about the rcode_string() helper, so move it from snd-firewire-lib into firewire-core to allow other code to use it. Signed-off-by: Clemens Ladisch Signed-off-by: Stefan Richter (fixed sound/firewire/cmp.c) --- include/linux/firewire.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/firewire.h') diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 0a1905719f6f..584826ba2eb7 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -334,6 +334,7 @@ int fw_cancel_transaction(struct fw_card *card, int fw_run_transaction(struct fw_card *card, int tcode, int destination_id, int generation, int speed, unsigned long long offset, void *payload, size_t length); +const char *fw_rcode_string(int rcode); static inline int fw_stream_packet_destination_id(int tag, int channel, int sy) { -- cgit v1.2.1