return -ENODEV;
}
-static struct fw_iso_context *dummy_allocate_iso_context(struct fw_card *card,
- int type, int channel, size_t header_size)
+static struct fw_iso_context *dummy_allocate_iso_context(struct fw_card *card, int type,
+ int channel, size_t header_size, size_t header_storage_size)
{
return ERR_PTR(-ENODEV);
}
}
struct fw_iso_context *__fw_iso_context_create(struct fw_card *card, int type, int channel,
- int speed, size_t header_size, union fw_iso_callback callback, void *callback_data)
+ int speed, size_t header_size, size_t header_storage_size,
+ union fw_iso_callback callback, void *callback_data)
{
struct fw_iso_context *ctx;
- ctx = card->driver->allocate_iso_context(card,
- type, channel, header_size);
+ ctx = card->driver->allocate_iso_context(card, type, channel, header_size,
+ header_storage_size);
if (IS_ERR(ctx))
return ctx;
ctx->speed = speed;
ctx->flags = 0;
ctx->header_size = header_size;
+ ctx->header_storage_size = header_storage_size;
ctx->callback = callback;
ctx->callback_data = callback_data;
void (*write_csr)(struct fw_card *card, int csr_offset, u32 value);
struct fw_iso_context *
- (*allocate_iso_context)(struct fw_card *card,
- int type, int channel, size_t header_size);
+ (*allocate_iso_context)(struct fw_card *card, int type, int channel, size_t header_size,
+ size_t header_storage_size);
void (*free_iso_context)(struct fw_iso_context *ctx);
int (*start_iso)(struct fw_iso_context *ctx,
{
union fw_iso_callback cb = { .mc = callback };
- return __fw_iso_context_create(card, FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL, 0, 0, 0, cb,
+ return __fw_iso_context_create(card, FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL, 0, 0, 0, 0, cb,
callback_data);
}
{
u32 *ctx_hdr;
- if (ctx->sc.header_length + ctx->base.header_size > PAGE_SIZE) {
+ if (ctx->sc.header_length + ctx->base.header_size > ctx->base.header_storage_size) {
if (ctx->base.flags & FW_ISO_CONTEXT_FLAG_DROP_OVERFLOW_HEADERS)
return;
flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERFLOW);
sync_it_packet_for_cpu(context, d);
- if (ctx->sc.header_length + 4 > PAGE_SIZE) {
+ if (ctx->sc.header_length + 4 > ctx->base.header_storage_size) {
if (ctx->base.flags & FW_ISO_CONTEXT_FLAG_DROP_OVERFLOW_HEADERS)
return 1;
flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERFLOW);
ohci->mc_channels = channels;
}
-static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card,
- int type, int channel, size_t header_size)
+static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card, int type, int channel,
+ size_t header_size, size_t header_storage_size)
{
struct fw_ohci *ohci = fw_ohci(card);
void *header __free(kvfree) = NULL;
if (type != FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) {
ctx->sc.header_length = 0;
- header = kvmalloc(PAGE_SIZE, GFP_KERNEL);
+ header = kvmalloc(header_storage_size, GFP_KERNEL);
if (!header) {
ret = -ENOMEM;
goto out;
int speed;
int flags;
size_t header_size;
+ size_t header_storage_size;
union fw_iso_callback callback;
void *callback_data;
};
struct fw_iso_context *__fw_iso_context_create(struct fw_card *card, int type, int channel,
- int speed, size_t header_size, union fw_iso_callback callback, void *callback_data);
+ int speed, size_t header_size, size_t header_storage_size,
+ union fw_iso_callback callback, void *callback_data);
int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels);
int fw_iso_context_queue(struct fw_iso_context *ctx,
struct fw_iso_packet *packet,
{
union fw_iso_callback cb = { .sc = callback };
- return __fw_iso_context_create(card, type, channel, speed, header_size, cb, callback_data);
+ return __fw_iso_context_create(card, type, channel, speed, header_size, PAGE_SIZE, cb,
+ callback_data);
}
/**