summaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-ohci.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-02-16 17:34:38 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 22:02:57 +0100
commit9aad8125389a7a2990dee72d7892e22330a945eb (patch)
tree2566a8985837b000990db7e16b17547d3747141b /drivers/firewire/fw-ohci.c
parent6e2e8424d310507fa044649435114217826ed78a (diff)
firewire: Split the iso buffer out from fw_iso_context and avoid vmalloc.
This patch splits out the iso buffer so we can initialize it at mmap time with the size provided in the mmap call. Furthermore, allocate the backing pages using alloc_page to avoid setting up kernel side virtual memory mappings for the pages. 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-ohci.c')
-rw-r--r--drivers/firewire/fw-ohci.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 72f80361fc4..8499d70bf9e 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1251,14 +1251,16 @@ static void ohci_free_iso_context(struct fw_iso_context *base)
static int
ohci_queue_iso(struct fw_iso_context *base,
- struct fw_iso_packet *packet, void *payload)
+ struct fw_iso_packet *packet,
+ struct fw_iso_buffer *buffer,
+ unsigned long payload)
{
struct iso_context *ctx = (struct iso_context *)base;
struct fw_ohci *ohci = fw_ohci(ctx->base.card);
struct descriptor *d, *end, *last, *tail, *pd;
struct fw_iso_packet *p;
__le32 *header;
- dma_addr_t d_bus;
+ dma_addr_t d_bus, page_bus;
u32 z, header_z, payload_z, irq;
u32 payload_index, payload_end_index, next_page_index;
int index, page, end_page, i, length, offset;
@@ -1267,7 +1269,7 @@ ohci_queue_iso(struct fw_iso_context *base,
* packet, retransmit or terminate.. */
p = packet;
- payload_index = payload - ctx->base.buffer;
+ payload_index = payload;
d = ctx->head_descriptor;
tail = ctx->tail_descriptor;
end = ctx->buffer + ISO_BUFFER_SIZE / sizeof(struct descriptor);
@@ -1337,7 +1339,9 @@ ohci_queue_iso(struct fw_iso_context *base,
length =
min(next_page_index, payload_end_index) - payload_index;
pd[i].req_count = cpu_to_le16(length);
- pd[i].data_address = cpu_to_le32(ctx->base.pages[page] + offset);
+
+ page_bus = page_private(buffer->pages[page]);
+ pd[i].data_address = cpu_to_le32(page_bus + offset);
payload_index += length;
}