aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-iso.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-07 20:09:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-07 20:09:24 -0400
commit2d53056973079e6c2ffc0d7ae3afbdd3d4f18ae3 (patch)
treee921596d80cd0a6434629dbd8d22c0ca3ec14b88 /drivers/firewire/core-iso.c
parent9e50ab91d025afc17ca14a1764be2e1d0c24245d (diff)
parente78483c5aeb0d7fbb0e365802145f1045e62957e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (82 commits) firewire: core: add forgotten dummy driver methods, remove unused ones firewire: add isochronous multichannel reception firewire: core: small clarifications in core-cdev firewire: core: remove unused code firewire: ohci: release channel in error path firewire: ohci: use memory barriers to order descriptor updates tools/firewire: nosy-dump: increment program version tools/firewire: nosy-dump: remove unused code tools/firewire: nosy-dump: use linux/firewire-constants.h tools/firewire: nosy-dump: break up a deeply nested function tools/firewire: nosy-dump: make some symbols static or const tools/firewire: nosy-dump: change to kernel coding style tools/firewire: nosy-dump: work around segfault in decode_fcp tools/firewire: nosy-dump: fix it on x86-64 tools/firewire: add userspace front-end of nosy firewire: nosy: note ioctls in ioctl-number.txt firewire: nosy: use generic printk macros firewire: nosy: endianess fixes and annotations firewire: nosy: annotate __user pointers and __iomem pointers firewire: nosy: fix device shutdown with active client ...
Diffstat (limited to 'drivers/firewire/core-iso.c')
-rw-r--r--drivers/firewire/core-iso.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c
index 8f5aebfb29df..c003fa4e2db1 100644
--- a/drivers/firewire/core-iso.c
+++ b/drivers/firewire/core-iso.c
@@ -118,6 +118,23 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
118} 118}
119EXPORT_SYMBOL(fw_iso_buffer_destroy); 119EXPORT_SYMBOL(fw_iso_buffer_destroy);
120 120
121/* Convert DMA address to offset into virtually contiguous buffer. */
122size_t fw_iso_buffer_lookup(struct fw_iso_buffer *buffer, dma_addr_t completed)
123{
124 int i;
125 dma_addr_t address;
126 ssize_t offset;
127
128 for (i = 0; i < buffer->page_count; i++) {
129 address = page_private(buffer->pages[i]);
130 offset = (ssize_t)completed - (ssize_t)address;
131 if (offset > 0 && offset <= PAGE_SIZE)
132 return (i << PAGE_SHIFT) + offset;
133 }
134
135 return 0;
136}
137
121struct fw_iso_context *fw_iso_context_create(struct fw_card *card, 138struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
122 int type, int channel, int speed, size_t header_size, 139 int type, int channel, int speed, size_t header_size,
123 fw_iso_callback_t callback, void *callback_data) 140 fw_iso_callback_t callback, void *callback_data)
@@ -134,7 +151,7 @@ struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
134 ctx->channel = channel; 151 ctx->channel = channel;
135 ctx->speed = speed; 152 ctx->speed = speed;
136 ctx->header_size = header_size; 153 ctx->header_size = header_size;
137 ctx->callback = callback; 154 ctx->callback.sc = callback;
138 ctx->callback_data = callback_data; 155 ctx->callback_data = callback_data;
139 156
140 return ctx; 157 return ctx;
@@ -143,9 +160,7 @@ EXPORT_SYMBOL(fw_iso_context_create);
143 160
144void fw_iso_context_destroy(struct fw_iso_context *ctx) 161void fw_iso_context_destroy(struct fw_iso_context *ctx)
145{ 162{
146 struct fw_card *card = ctx->card; 163 ctx->card->driver->free_iso_context(ctx);
147
148 card->driver->free_iso_context(ctx);
149} 164}
150EXPORT_SYMBOL(fw_iso_context_destroy); 165EXPORT_SYMBOL(fw_iso_context_destroy);
151 166
@@ -156,14 +171,17 @@ int fw_iso_context_start(struct fw_iso_context *ctx,
156} 171}
157EXPORT_SYMBOL(fw_iso_context_start); 172EXPORT_SYMBOL(fw_iso_context_start);
158 173
174int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels)
175{
176 return ctx->card->driver->set_iso_channels(ctx, channels);
177}
178
159int fw_iso_context_queue(struct fw_iso_context *ctx, 179int fw_iso_context_queue(struct fw_iso_context *ctx,
160 struct fw_iso_packet *packet, 180 struct fw_iso_packet *packet,
161 struct fw_iso_buffer *buffer, 181 struct fw_iso_buffer *buffer,
162 unsigned long payload) 182 unsigned long payload)
163{ 183{
164 struct fw_card *card = ctx->card; 184 return ctx->card->driver->queue_iso(ctx, packet, buffer, payload);
165
166 return card->driver->queue_iso(ctx, packet, buffer, payload);
167} 185}
168EXPORT_SYMBOL(fw_iso_context_queue); 186EXPORT_SYMBOL(fw_iso_context_queue);
169 187
@@ -279,7 +297,7 @@ static void deallocate_channel(struct fw_card *card, int irm_id,
279} 297}
280 298
281/** 299/**
282 * fw_iso_resource_manage - Allocate or deallocate a channel and/or bandwidth 300 * fw_iso_resource_manage() - Allocate or deallocate a channel and/or bandwidth
283 * 301 *
284 * In parameters: card, generation, channels_mask, bandwidth, allocate 302 * In parameters: card, generation, channels_mask, bandwidth, allocate
285 * Out parameters: channel, bandwidth 303 * Out parameters: channel, bandwidth