aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-02-16 17:34:50 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 16:03:03 -0500
commit21efb3cfc6ed49991638000f58bb23b838c76e25 (patch)
tree30b1b0ed02082b09fa844abf5888b4d3fbdadbe7
parente364cf4e0aa245ba2ce5942289e8a43935505e53 (diff)
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: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r--drivers/firewire/fw-device-cdev.c11
-rw-r--r--drivers/firewire/fw-device-cdev.h5
-rw-r--r--drivers/firewire/fw-iso.c11
-rw-r--r--drivers/firewire/fw-ohci.c4
-rw-r--r--drivers/firewire/fw-transaction.h6
5 files changed, 21 insertions, 16 deletions
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c
index 6545fb8214d8..5c876188677f 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -413,8 +413,16 @@ static int ioctl_create_iso_context(struct client *client, void __user *arg)
413 if (request.type > FW_ISO_CONTEXT_RECEIVE) 413 if (request.type > FW_ISO_CONTEXT_RECEIVE)
414 return -EINVAL; 414 return -EINVAL;
415 415
416 if (request.channel > 63)
417 return -EINVAL;
418
419 if (request.speed > SCODE_3200)
420 return -EINVAL;
421
416 client->iso_context = fw_iso_context_create(client->device->card, 422 client->iso_context = fw_iso_context_create(client->device->card,
417 request.type, 423 request.type,
424 request.channel,
425 request.speed,
418 request.header_size, 426 request.header_size,
419 iso_callback, client); 427 iso_callback, client);
420 if (IS_ERR(client->iso_context)) 428 if (IS_ERR(client->iso_context))
@@ -519,8 +527,7 @@ static int ioctl_start_iso(struct client *client, void __user *arg)
519 if (copy_from_user(&request, arg, sizeof request)) 527 if (copy_from_user(&request, arg, sizeof request))
520 return -EFAULT; 528 return -EFAULT;
521 529
522 return fw_iso_context_start(client->iso_context, request.channel, 530 return fw_iso_context_start(client->iso_context, request.cycle);
523 request.speed, request.cycle);
524} 531}
525 532
526static int ioctl_stop_iso(struct client *client, void __user *arg) 533static int ioctl_stop_iso(struct client *client, void __user *arg)
diff --git a/drivers/firewire/fw-device-cdev.h b/drivers/firewire/fw-device-cdev.h
index e32b39dc7e74..99e6aa629f4a 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -134,7 +134,8 @@ struct fw_cdev_allocate {
134struct fw_cdev_create_iso_context { 134struct fw_cdev_create_iso_context {
135 __u32 type; 135 __u32 type;
136 __u32 header_size; 136 __u32 header_size;
137 __u32 handle; 137 __u32 channel;
138 __u32 speed;
138}; 139};
139 140
140struct fw_cdev_iso_packet { 141struct fw_cdev_iso_packet {
@@ -154,8 +155,6 @@ struct fw_cdev_queue_iso {
154}; 155};
155 156
156struct fw_cdev_start_iso { 157struct fw_cdev_start_iso {
157 __u32 channel;
158 __u32 speed;
159 __s32 cycle; 158 __s32 cycle;
160}; 159};
161 160
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index deff6922a98f..dc5a7e3558ec 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -106,7 +106,8 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
106} 106}
107 107
108struct fw_iso_context * 108struct fw_iso_context *
109fw_iso_context_create(struct fw_card *card, int type, size_t header_size, 109fw_iso_context_create(struct fw_card *card, int type,
110 int channel, int speed, size_t header_size,
110 fw_iso_callback_t callback, void *callback_data) 111 fw_iso_callback_t callback, void *callback_data)
111{ 112{
112 struct fw_iso_context *ctx; 113 struct fw_iso_context *ctx;
@@ -117,6 +118,8 @@ fw_iso_context_create(struct fw_card *card, int type, size_t header_size,
117 118
118 ctx->card = card; 119 ctx->card = card;
119 ctx->type = type; 120 ctx->type = type;
121 ctx->channel = channel;
122 ctx->speed = speed;
120 ctx->header_size = header_size; 123 ctx->header_size = header_size;
121 ctx->callback = callback; 124 ctx->callback = callback;
122 ctx->callback_data = callback_data; 125 ctx->callback_data = callback_data;
@@ -134,12 +137,8 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
134EXPORT_SYMBOL(fw_iso_context_destroy); 137EXPORT_SYMBOL(fw_iso_context_destroy);
135 138
136int 139int
137fw_iso_context_start(struct fw_iso_context *ctx, 140fw_iso_context_start(struct fw_iso_context *ctx, int cycle)
138 int channel, int speed, int cycle)
139{ 141{
140 ctx->channel = channel;
141 ctx->speed = speed;
142
143 return ctx->card->driver->start_iso(ctx, cycle); 142 return ctx->card->driver->start_iso(ctx, cycle);
144} 143}
145EXPORT_SYMBOL(fw_iso_context_start); 144EXPORT_SYMBOL(fw_iso_context_start);
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 12f109da4d8d..0088acd7718e 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1413,7 +1413,7 @@ static int ohci_start_iso(struct fw_iso_context *base, s32 cycle)
1413 if (cycle > 0) 1413 if (cycle > 0)
1414 cycle_match = IT_CONTEXT_CYCLE_MATCH_ENABLE | 1414 cycle_match = IT_CONTEXT_CYCLE_MATCH_ENABLE |
1415 (cycle & 0x7fff) << 16; 1415 (cycle & 0x7fff) << 16;
1416 1416
1417 reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 1 << index); 1417 reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 1 << index);
1418 reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1 << index); 1418 reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1 << index);
1419 context_run(&ctx->context, cycle_match); 1419 context_run(&ctx->context, cycle_match);
@@ -1638,7 +1638,7 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
1638 1638
1639 return 0; 1639 return 0;
1640} 1640}
1641 1641
1642static int 1642static int
1643ohci_queue_iso_receive_bufferfill(struct fw_iso_context *base, 1643ohci_queue_iso_receive_bufferfill(struct fw_iso_context *base,
1644 struct fw_iso_packet *packet, 1644 struct fw_iso_packet *packet,
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index 1bbcbb341f2f..22e45ccd7b1d 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -373,7 +373,8 @@ void
373fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); 373fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card);
374 374
375struct fw_iso_context * 375struct fw_iso_context *
376fw_iso_context_create(struct fw_card *card, int type, size_t header_size, 376fw_iso_context_create(struct fw_card *card, int type,
377 int channel, int speed, size_t header_size,
377 fw_iso_callback_t callback, void *callback_data); 378 fw_iso_callback_t callback, void *callback_data);
378 379
379void 380void
@@ -386,8 +387,7 @@ fw_iso_context_queue(struct fw_iso_context *ctx,
386 unsigned long payload); 387 unsigned long payload);
387 388
388int 389int
389fw_iso_context_start(struct fw_iso_context *ctx, 390fw_iso_context_start(struct fw_iso_context *ctx, int cycle);
390 int channel, int speed, int cycle);
391 391
392int 392int
393fw_iso_context_stop(struct fw_iso_context *ctx); 393fw_iso_context_stop(struct fw_iso_context *ctx);