summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Always imply iso shutdown in fw_destroy_handleGravatar Stefan Richter 2010-09-072-2/+4
| | | | | | | | | | | | because ieee1394_destroy_handle does it too. Otherwise, clients which rely on the ieee1394 backend behaviour leak memory when running on the juju backend. Also add the ability to call fw_iso_shutdown multiple times or before a successful context initialization. Faulty clients might rely on it based on ieee1394 backend behaviour. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Treat the kernel's iso context handle as opaque itemGravatar Stefan Richter 2010-09-072-6/+8
| | | | | | | | Libraw1394 must not rely on the kernel always handing out the value 0 as handle of the (first) allocated isochronous I/O context. For now this assumption is true but it may not stay that way forever. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Fix raw1394_iso_stop on firewire-coreGravatar Stefan Richter 2010-09-071-1/+1
| | | | | | The argument to FW_CDEV_IOC_STOP_ISO was missing. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Add missing malloc failure checksGravatar Stefan Richter 2010-09-072-5/+19
| | | | | | | Also add errno = ENOMEM because it is said that that some malloc implementations might miss to do so. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Fix for overlooked device HUP with 'firewire' stackGravatar Peter Hurley 2010-04-171-1/+1
| | | | | | | | | | | | | | When EPOLLHUP event is received in fw_loop_iterate(), it is or'd with EPOLLERR. The EPOLLHUP event was then overlooked in handle_device_event() with unpredictable-but-generally bad results. This problem has been rediscovered several times. http://thread.gmane.org/gmane.linux.kernel.firewire.devel/13330 http://thread.gmane.org/gmane.linux.kernel.firewire.devel/13779 Reported-by: B.J. Buchalter <bj@mhlabs.com> Reported-by: Michael Thireos <mthireos@vanteon.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Fix documentation of return values of raw1394_start_ family of functionsGravatar Stefan Richter 2010-02-011-7/+7
| | | | | | | | | | | | | | | | | | | If running on top of the raw1394 kernel driver (any kernel version) or on top of firewire-core (kernel version <= 2.6.29), raw1394_start_* functions will return a value > 0 on success, not == 0. Only with firewire-core of kernel 2.6.30 or later, == 0 is returned on success. The exact value depends on which driver is used, on CPU architecture, and on request payload size in case of some types of requests. In any case, only that the value is > or == 0 on success (but == -1 on failure) is significant to libraw1394 client applications. This mismatch between documentation and implementation was already present in older libraw1394 versions, including v1.x. For the time being, do not change the implementation, only adjust the documentation. Reported-by: Dr. David Alan Gilbert Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* doc: let "make clean" remove generated HTML filesGravatar Stefan Richter 2010-02-011-1/+1
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Document contact address (linux1394-devel) more clearlyGravatar Stefan Richter 2010-02-012-5/+13
| | | | | | | | Questions and patches should be posted to the list rather than just sent as personal mail to Dan. That way, more people can answer or review it without Dan having to forward libraw1394 mails to the list all the time. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* update README: replace outdated link to wikiGravatar Sebastian Schüppel 2010-02-011-1/+1
| | | | | Signed-off-by: Sebastian <schseb@ubuntu.(none)> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Fix "make doc".Gravatar Stefan Richter 2010-01-102-16/+12
| | | | | | | | | | | | | | | | | | | | Reported by Guus Sliepen: "make doc" failed due to missing doctype, unknown elements, and duplicate element IDs in libraw1394.sgml. The fix is to declare a recent DTD (matching the one which is used in current Linux kernel documentation docbooks) and to make the conflicting element IDs unique. The latter part of the fix is just temporary. In order to avoid the conflict when the documentation is updated the next time, also fix the kerneldoc comments of the respective API elements: These are typedefs, hence kernel-doc needs their comments prepended by "typedef ". Tested with Gentoo's docbook-xml-dtd 4.5, docbook-xsl-stylesheets 1.75.2, docbook-sgml-utils 0.6.14, and openjade 1.3.2-r1. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Update ChangeLog for release.v2.0.5Gravatar Dan Dennedy 2009-12-261-0/+4
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Set to version 2.0.5.Gravatar Dan Dennedy 2009-12-262-2/+4
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Update ChangeLog for release.Gravatar Dan Dennedy 2009-12-261-0/+36
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Update release notes.Gravatar Dan Dennedy 2009-12-261-1/+2
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Addendum to 'Calculate iso receive cycles on firewire-core'Gravatar Stefan Richter 2009-11-231-2/+5
| | | | | | | The number of packets is a 4th of the number of header bytes (in case of ABI version 1). Also, wrap after an increment over 8000. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Initialize unused fields in ioctl argumentsGravatar Jay Fenlason 2009-11-222-0/+3
| | | | | | | | 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)
* Calculate iso receive cycles on firewire-core at ABI version 1Gravatar Jay Fenlason 2009-11-221-2/+17
| | | | | | | | | More accurately report the cycle on which isochronous packets were received. Only affects libraw1394 when used with kernel 2.6.29 or older. Signed-off-by: Jay Fenlason <fenlason@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (changelog, whitespace)
* Fix reporting of isochronous transmit cycles on firewire-coreGravatar Jay Fenlason 2009-11-221-10/+46
| | | | | | | | | | | | | | | | While firewire-core's iso reception ABI was fixed in its version 2 to report the cycle of each received packet to userspace like rawiso does, this same enhancement was forgotten to add to the iso transmission ABI, causing FFADO to fail to set up and maintain streaming. Since kernel commit 31769cef2e973544164aa7d0db2e2024660d5e21, we also get iso xmit cycles in fw_cdev_event_iso_interrupt.header. Pass these to the iso receive handler. In case of older kernels, calculate cycles based on the cycle of the iso interrupt event. These are inaccurate but better than nothing. Signed-off-by: Jay Fenlason <fenlason@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (changelog, whitespace)
* Fix default isochronous IRQ interval on firewire-coreGravatar Jay Fenlason 2009-11-221-4/+7
| | | | | | | | | libraw1394 takes a negative IRQ interval to mean "every 256 packets" with the juju backend, which doesn't work well if you don't queue that many. Use buf_packets / 4 like the ieee1394 version. Signed-off-by: Jay Fenlason <fenlason@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (order, comment)
* Update reference docs using kernel-doc.v2.0.4Gravatar Dan Dennedy 2009-08-301-785/+1338
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Fix build due to incomplete tarball.Gravatar Dan Dennedy 2009-06-304-2/+7
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Update ChangeLog from git log.v2.0.3Gravatar Dan Dennedy 2009-06-291-10/+982
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Bump to v2.0.3 and update release notes.Gravatar Dan Dennedy 2009-06-292-1/+4
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Fix build always expecting FW_DIR.Gravatar Dan Dennedy 2009-06-182-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Date: Sun, 14 Jun 2009 11:51:33 +0100 From: Mike Auty <mike.auty@gmail.com> Subject: [patch libraw1394-2] src/makefile.am expects FW_DIR to be set, but configure only sets it if given --with-fw-dir Here's a very small patch for the configure system of libraw1394-2.0.{0,1,2}. At the moment, if configure is called without --with-fw-dir, then FW_DIR doesn't get specified. The Makefile includes the line INCLUDES=-I$(FW_DIR) and so in the compilation we get a -I not followed by anything sensible. That can cause compilation issues in certain circumstances (see Gentoo bug 272540), so this patch ensures that INCLUDES is only set if --with-fw-dir was specified. Please let me know if there's any problems with the patch or if I've submitted it to the wrong place or in the wrong way. Thanks... Mike 5:) [1] http://bugs.gentoo.org/272540 Signed-off-by: Dan Dennedy <dan@dennedy.org>
* 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>
* Remove an unused struct memberGravatar Stefan Richter 2009-05-301-1/+0
| | | | 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-303-16/+52
| | | | | | | | 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>
* Iso reception: Use packet timestamps in juju ABI v2Gravatar Stefan Richter 2009-05-301-3/+13
| | | | | | | | | | | | In the firewire-cdev ABI v1, the kernel exported only the timestamp of interrupt packets. libraw1394 estimated the cycle of all packets between interrupt packets by continuously incrementing the cycle. In v2 of the ABI, we can obtain an accurate timestamp of each packet as provided by the OHCI controller. AFAIU, this is also what you got from raw1394/ ohci1394. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Use new iso resource allocation ioctlsGravatar Stefan Richter 2009-05-303-2/+110
| | | | | | | | | | | 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>
* testlibraw: fix printing of local config ROMGravatar Stefan Richter 2009-05-271-1/+1
| | | | | | | | | Since "testlibraw: test all cards instead of only the first", the actual ROM content wasn't printed anymore due to a mistake in a printf format string. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* bump version to 2.0.2 and add release notesv2.0.2Gravatar Dan Dennedy 2009-02-032-1/+5
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Change the license of the "juju" fw*.[hc] files to LGPL v2.1 as approvedGravatar Dan Dennedy 2009-02-033-39/+9
| | | | | | | 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>
* bump version and add release notesv2.0.1Gravatar Dan Dennedy 2009-01-142-2/+6
| | | | 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-103-21/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix iso_shutdown with juju firewire stackGravatar Jarod Wilson 2008-12-082-3/+22
| | | | | | | | | | | | | | | | | | Make iso start/stop/start sequences on the same handle, such as those used by apps such as MythTV behave as expected. I can finally watch video off my cable box over FireWire using MythTV w/the juju stack now. :) Initially, seemed a one-liner might be the ticket (setting handle->iso.fd = -1 at the end of fw_iso_shutdown()), but that led to memory corruption and a locked up system. What ultimately worked was essentially mimicking what the old stack did to track iso state, and call fw_iso_stop() from fw_iso_shutdown() as needed. Nb: Only lightly tested with iso receive via MythTV, but its all fairly straight-forward, I think. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Checking /dev/raw1394 and recommendation for creating it for the install ↵Gravatar Dan Dennedy 2008-12-071-23/+0
| | | | | | make target is no longer relevant because opf firewire and udev. Signed-off-by: Dan Dennedy <dan@dennedy.org>
* testlibraw: test raw1394_read_cycle_timer()Gravatar Stefan Richter 2008-12-071-0/+23
| | | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* testlibraw: test all cards instead of only the firstGravatar Stefan Richter 2008-12-071-120/+143
| | | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Let fw_read_cycle_timer() use the local fd instead of requiring iso to be ↵Gravatar Dan Dennedy 2008-12-071-1/+1
| | | | | | initialized Signed-off-by: Dan Dennedy <dan@dennedy.org>
* [libraw1394 patch] Unify {ieee1394,fw}_bandwidth_modify()Gravatar Stefan Richter 2008-12-033-56/+1
| | | | | | | | | | | | 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-034-57/+2
| | | | | | | | | | | | | | | | | | | (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>
* Reduce nesting depth in new_handle dispatchersGravatar Stefan Richter 2008-10-281-47/+49
| | | | Signed-off-by: Dan Dennedy <dan@dennedy.org>
* Address some compiler warningsGravatar Stefan Richter 2008-10-285-10/+5
| | | | | | 7x unused variable, 1x assignment used as truth value, 1x pointer signedness 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>
* Makes sure to check any return valuesGravatar Erik Hovland 2008-10-281-1/+2
| | | | | | | | The return value of any function should be checked if that function uses the return value to provide some sort of status information. Signed-off-by: Erik Hovland <erik@hovland.org> Signed-off-by: Dan Dennedy <dan@dennedy.org>