summaryrefslogtreecommitdiffstats
path: root/src/fw.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Initialize unused fields in ioctl argumentsGravatar Jay Fenlason 2009-11-221-0/+1
| | | | | | | | This change is essentially cosmetic: Set fields of structs passed to the kernel via ioctl so that valgrind will not complain about them. Signed-off-by: Jay Fenlason <fenlason@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (changelog, comments)
* Match only /dev/fw[0-9]* as firewire-core device filesGravatar Stefan Richter 2009-05-311-4/+10
| | | | | | | Previously, /dev/fw* and hence files like /dev/fwmonitor were probed which may have bad effects if the client runs with access privileges. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Fix memory leaks with async requests on firewire-coreGravatar Stefan Richter 2009-05-301-3/+10
| | | | | | Each request allocated a struct request_closure which was never freed. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Use new async stream ioctlGravatar Stefan Richter 2009-05-301-14/+50
| | | | | | | | This implements asynchronous streams on juju, i.e. enables raw1394_async_stream() and raw1394_start_async_stream() to work with the new firewire kernel stack. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Use new iso resource allocation ioctlsGravatar Stefan Richter 2009-05-301-0/+95
| | | | | | | | | | | This allows raw1394_bandwidth_modify() and raw1394_channel_modify() to work on juju without write access to the IRM's character device file. If either the build-time requirement of firewire-cdev header ABI >= v.2 or the runtime requirement of firewire-core ABI >= v.2 is not satisfied, the code falls back to transactions to the IRM as before. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Use new broadcast request ioctlGravatar Stefan Richter 2009-05-301-2/+15
| | | | | | | | This implements broadcast transactions on juju. (Broadcast transactions are write transactions to PHY ID 63, not to be confused with isochronous or asynchronous streams.) Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Change the license of the "juju" fw*.[hc] files to LGPL v2.1 as approvedGravatar Dan Dennedy 2009-02-031-13/+3
| | | | | | | by Kristian Hogsberg in an e-mail to the linux1394-devel mailing list on Feb 3, 2009. Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Set errno = ENOSYS in unimplemented functionsGravatar Stefan Richter 2009-01-121-0/+5
| | | | | | | Most of them do this already, only a few missed it. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Work without permission to access local node's /dev/fw*Gravatar Stefan Richter 2009-01-101-16/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 10 Jan, David Moore wrote: > On Sat, 2009-01-10 at 19:28 +0100, Stefan Richter wrote: >> @@ -161,14 +160,16 @@ scan_devices(fw_handle_t handle) ... >> + for (j = 0; j < i; j++) >> + if (ports[j].card == get_info.card) >> + continue; >> + > > That continue statement doesn't do what you intended I think. From: Stefan Richter <stefanr@s5r6.in-berlin.de> Subject: [PATCH] Work without permission to access local node's /dev/fw* Fix for juju backend: libraw1394 required write permission to the character device file of the local node(s) in order to enumerate cards and for a number of other operations. This forced users to either run applications like dvgrab and kino with elevated privileges, or to configure write permission for all /dev/fw* or at least for local nodes' /dev/fw*. We now use the first accessible file which was found for each card for as many tasks as possible, instead of the local node's file. This allows distributors or admins to implement stricter access rights (default off, e.g. only on for AV/C and IIDC devices) without sacrificing functionality of said class of applications. Access to the local node is now only required by low-level tools like gscanbus. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Fix stack corruption during juju lock transactionsGravatar David Moore 2008-12-291-13/+19
| | | | | | | | | | | | | | | When performing a lock transaction (such as with fw_lock) under Juju, 4 bytes of the stack gets corrupted. This is because the lock transaction has 8 bytes of data sent and 4 bytes received. Since the transaction "length" is specified as 8, handle_device_event() copies 8 bytes into the destination variable instead of the desired 4, and overflows into the stack by 4 bytes. This patch fixes the corruption by adding an extra "out_length" argument to the send_request() function so that both in_length and out_length can be specified separately. Signed-off-by: Dan Dennedy <dan@dennedy.org>
* [libraw1394 patch] Unify {ieee1394,fw}_bandwidth_modify()Gravatar Stefan Richter 2008-12-031-49/+0
| | | | | | | | | | | | because they do the same. We only may want a separate fw_bandwidth_modify() in the future when firewire-core gains a special ioctl() for that. (Not runtime-tested, but it looks good to me.) Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* [libraw1394 patch] Fix raw1394_channel_modify() on firewire-coreGravatar Stefan Richter 2008-12-031-49/+0
| | | | | | | | | | | | | | | | | | | (juju) Reported by Adrian Knoth: fw_channel_modify() was unable to allocate some channels which were actually free. http://marc.info/?l=linux1394-devel&t=122818128900002 This can be easily fixed by replacing fw_channel_modify() by ieee1394_channel_modify() because this is highlevel enough to work with Juju as well. We only may want a separate fw_channel_modify() in the future when firewire-core gains a special ioctl() for that. Also fix a documentation typo: raw1394_channel_modify() did not show up in extracted API documentation due to a cut'n'paste typo in raw1394.h. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Fix segfault in juju's handle_arm_requestGravatar Stefan Richter 2008-10-281-0/+2
| | | | | | | The buffer pointers were uninitialized, leading to segfault in memcpy. Bug report and initial version of the fix by Adrian Knoth. Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Makes extra sure strings are not overrun.Gravatar Erik Hovland 2008-10-281-13/+19
| | | | | | | | | When using strncpy with the exact size of the destination string the string may end up lacking null termination because the source string is bigger then the destination. Signed-off-by: Erik Hovland <erik@hovland.org> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Make sure that we have the right types.Gravatar Erik Hovland 2008-10-281-4/+4
| | | | | | | | When an unsigned type is assigned a signed value, the negatived value is never seen. Signed-off-by: Erik Hovland <erik@hovland.org> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Compare unsigned values instead of subtracting them.Gravatar Erik Hovland 2008-10-281-2/+3
| | | | | | | Unsigned values do not return signed values when subtracted and the right operand is larger then the left operand. Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Protect against resource leaks.Gravatar Erik Hovland 2008-10-281-1/+3
| | | | | Signed-off-by: Erik Hovland <erik@hovland.org> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Plug dir leak and initialize data structsGravatar Philippe Troin 2008-07-051-1/+14
| | | | | | | | | | | | | | While trying to track down some crashes in kino, I found the following problems with libraw1394: * There is a DIR* leak in raw1394_set_port(). * Lots of data structures are not fully initialized when calling IEEE1394 ioctl()s. These cause valgrind errors (benign, as valgrind does not know how to interpret all ioctls. However these also cause kino to crash in libraw1394. I've added a bunch of memset()s to prevent this problem from happening. Forward-ported to libraw1394 git tree by Jarod Wilson.
* Move the source code files in the juju directory into the src directory andGravatar Dan Dennedy 2008-04-301-0/+1369
give them 'fw' names instead of 'juju.'