Commit 21efb3cf authored by Kristian Høgsberg's avatar Kristian Høgsberg Committed by Stefan Richter

firewire: Configure channel and speed at context creation time.

We need the channel number as we queue up iso packets for transmission
so we can fill out the header correctly.
Signed-off-by: default avatarKristian Høgsberg <krh@redhat.com>
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent e364cf4e
......@@ -413,8 +413,16 @@ static int ioctl_create_iso_context(struct client *client, void __user *arg)
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))
......@@ -519,8 +527,7 @@ static int ioctl_start_iso(struct client *client, void __user *arg)
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)
......
......@@ -134,7 +134,8 @@ struct fw_cdev_allocate {
struct fw_cdev_create_iso_context {
__u32 type;
__u32 header_size;
__u32 handle;
__u32 channel;
__u32 speed;
};
struct fw_cdev_iso_packet {
......@@ -154,8 +155,6 @@ struct fw_cdev_queue_iso {
};
struct fw_cdev_start_iso {
__u32 channel;
__u32 speed;
__s32 cycle;
};
......
......@@ -106,7 +106,8 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
}
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;
......@@ -117,6 +118,8 @@ fw_iso_context_create(struct fw_card *card, int type, size_t header_size,
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;
......@@ -134,12 +137,8 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
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);
......
......@@ -1413,7 +1413,7 @@ static int ohci_start_iso(struct fw_iso_context *base, s32 cycle)
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);
......@@ -1638,7 +1638,7 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
return 0;
}
static int
ohci_queue_iso_receive_bufferfill(struct fw_iso_context *base,
struct fw_iso_packet *packet,
......
......@@ -373,7 +373,8 @@ void
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
......@@ -386,8 +387,7 @@ fw_iso_context_queue(struct fw_iso_context *ctx,
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment