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) ...@@ -413,8 +413,16 @@ static int ioctl_create_iso_context(struct client *client, void __user *arg)
if (request.type > FW_ISO_CONTEXT_RECEIVE) if (request.type > FW_ISO_CONTEXT_RECEIVE)
return -EINVAL; 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, client->iso_context = fw_iso_context_create(client->device->card,
request.type, request.type,
request.channel,
request.speed,
request.header_size, request.header_size,
iso_callback, client); iso_callback, client);
if (IS_ERR(client->iso_context)) if (IS_ERR(client->iso_context))
...@@ -519,8 +527,7 @@ static int ioctl_start_iso(struct client *client, void __user *arg) ...@@ -519,8 +527,7 @@ static int ioctl_start_iso(struct client *client, void __user *arg)
if (copy_from_user(&request, arg, sizeof request)) if (copy_from_user(&request, arg, sizeof request))
return -EFAULT; return -EFAULT;
return fw_iso_context_start(client->iso_context, request.channel, return fw_iso_context_start(client->iso_context, request.cycle);
request.speed, request.cycle);
} }
static int ioctl_stop_iso(struct client *client, void __user *arg) static int ioctl_stop_iso(struct client *client, void __user *arg)
......
...@@ -134,7 +134,8 @@ struct fw_cdev_allocate { ...@@ -134,7 +134,8 @@ struct fw_cdev_allocate {
struct fw_cdev_create_iso_context { struct fw_cdev_create_iso_context {
__u32 type; __u32 type;
__u32 header_size; __u32 header_size;
__u32 handle; __u32 channel;
__u32 speed;
}; };
struct fw_cdev_iso_packet { struct fw_cdev_iso_packet {
...@@ -154,8 +155,6 @@ struct fw_cdev_queue_iso { ...@@ -154,8 +155,6 @@ struct fw_cdev_queue_iso {
}; };
struct fw_cdev_start_iso { struct fw_cdev_start_iso {
__u32 channel;
__u32 speed;
__s32 cycle; __s32 cycle;
}; };
......
...@@ -106,7 +106,8 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, ...@@ -106,7 +106,8 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
} }
struct fw_iso_context * 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) fw_iso_callback_t callback, void *callback_data)
{ {
struct fw_iso_context *ctx; struct fw_iso_context *ctx;
...@@ -117,6 +118,8 @@ fw_iso_context_create(struct fw_card *card, int type, size_t header_size, ...@@ -117,6 +118,8 @@ fw_iso_context_create(struct fw_card *card, int type, size_t header_size,
ctx->card = card; ctx->card = card;
ctx->type = type; ctx->type = type;
ctx->channel = channel;
ctx->speed = speed;
ctx->header_size = header_size; ctx->header_size = header_size;
ctx->callback = callback; ctx->callback = callback;
ctx->callback_data = callback_data; ctx->callback_data = callback_data;
...@@ -134,12 +137,8 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx) ...@@ -134,12 +137,8 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
EXPORT_SYMBOL(fw_iso_context_destroy); EXPORT_SYMBOL(fw_iso_context_destroy);
int int
fw_iso_context_start(struct fw_iso_context *ctx, fw_iso_context_start(struct fw_iso_context *ctx, int cycle)
int channel, int speed, int cycle)
{ {
ctx->channel = channel;
ctx->speed = speed;
return ctx->card->driver->start_iso(ctx, cycle); return ctx->card->driver->start_iso(ctx, cycle);
} }
EXPORT_SYMBOL(fw_iso_context_start); EXPORT_SYMBOL(fw_iso_context_start);
......
...@@ -1413,7 +1413,7 @@ static int ohci_start_iso(struct fw_iso_context *base, s32 cycle) ...@@ -1413,7 +1413,7 @@ static int ohci_start_iso(struct fw_iso_context *base, s32 cycle)
if (cycle > 0) if (cycle > 0)
cycle_match = IT_CONTEXT_CYCLE_MATCH_ENABLE | cycle_match = IT_CONTEXT_CYCLE_MATCH_ENABLE |
(cycle & 0x7fff) << 16; (cycle & 0x7fff) << 16;
reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 1 << index); reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 1 << index);
reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1 << index); reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1 << index);
context_run(&ctx->context, cycle_match); context_run(&ctx->context, cycle_match);
...@@ -1638,7 +1638,7 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base, ...@@ -1638,7 +1638,7 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
return 0; return 0;
} }
static int static int
ohci_queue_iso_receive_bufferfill(struct fw_iso_context *base, ohci_queue_iso_receive_bufferfill(struct fw_iso_context *base,
struct fw_iso_packet *packet, struct fw_iso_packet *packet,
......
...@@ -373,7 +373,8 @@ void ...@@ -373,7 +373,8 @@ void
fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card);
struct fw_iso_context * 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); fw_iso_callback_t callback, void *callback_data);
void void
...@@ -386,8 +387,7 @@ fw_iso_context_queue(struct fw_iso_context *ctx, ...@@ -386,8 +387,7 @@ fw_iso_context_queue(struct fw_iso_context *ctx,
unsigned long payload); unsigned long payload);
int int
fw_iso_context_start(struct fw_iso_context *ctx, fw_iso_context_start(struct fw_iso_context *ctx, int cycle);
int channel, int speed, int cycle);
int int
fw_iso_context_stop(struct fw_iso_context *ctx); 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