Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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)
+2 −3
Original line number Diff line number Diff line
@@ -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;
};

+5 −6
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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);
+2 −2

File changed.

Contains only whitespace changes.