if (request.type > FW_ISO_CONTEXT_RECEIVE)
return -EINVAL;
+ if (request.channel > 63)
+ return -EINVAL;
+
+ if (request.speed > SCODE_3200)
+ return -EINVAL;
+
client->iso_context = fw_iso_context_create(client->device->card,
request.type,
+ request.channel,
+ request.speed,
request.header_size,
iso_callback, client);
if (IS_ERR(client->iso_context))
if (copy_from_user(&request, arg, sizeof request))
return -EFAULT;
- return fw_iso_context_start(client->iso_context, request.channel,
- request.speed, request.cycle);
+ return fw_iso_context_start(client->iso_context, request.cycle);
}
static int ioctl_stop_iso(struct client *client, void __user *arg)
struct fw_cdev_create_iso_context {
__u32 type;
__u32 header_size;
- __u32 handle;
+ __u32 channel;
+ __u32 speed;
};
struct fw_cdev_iso_packet {
};
struct fw_cdev_start_iso {
- __u32 channel;
- __u32 speed;
__s32 cycle;
};
}
struct fw_iso_context *
-fw_iso_context_create(struct fw_card *card, int type, size_t header_size,
+fw_iso_context_create(struct fw_card *card, int type,
+ int channel, int speed, size_t header_size,
fw_iso_callback_t callback, void *callback_data)
{
struct fw_iso_context *ctx;
ctx->card = card;
ctx->type = type;
+ ctx->channel = channel;
+ ctx->speed = speed;
ctx->header_size = header_size;
ctx->callback = callback;
ctx->callback_data = callback_data;
EXPORT_SYMBOL(fw_iso_context_destroy);
int
-fw_iso_context_start(struct fw_iso_context *ctx,
- int channel, int speed, int cycle)
+fw_iso_context_start(struct fw_iso_context *ctx, int cycle)
{
- ctx->channel = channel;
- ctx->speed = speed;
-
return ctx->card->driver->start_iso(ctx, cycle);
}
EXPORT_SYMBOL(fw_iso_context_start);
if (cycle > 0)
cycle_match = IT_CONTEXT_CYCLE_MATCH_ENABLE |
(cycle & 0x7fff) << 16;
-
+
reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 1 << index);
reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1 << index);
context_run(&ctx->context, cycle_match);
return 0;
}
-
+
static int
ohci_queue_iso_receive_bufferfill(struct fw_iso_context *base,
struct fw_iso_packet *packet,
fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card);
struct fw_iso_context *
-fw_iso_context_create(struct fw_card *card, int type, size_t header_size,
+fw_iso_context_create(struct fw_card *card, int type,
+ int channel, int speed, size_t header_size,
fw_iso_callback_t callback, void *callback_data);
void
unsigned long payload);
int
-fw_iso_context_start(struct fw_iso_context *ctx,
- int channel, int speed, int cycle);
+fw_iso_context_start(struct fw_iso_context *ctx, int cycle);
int
fw_iso_context_stop(struct fw_iso_context *ctx);