aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/dv1394.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-04-10ieee1394: mark char device files as not seekableStefan Richter1-5/+6
The - raw1394 (/dev/raw1394), - video1394 (/dev/video1394/*), - dv1394 (/dev/dv1394/*) character device file ABIs do not make any use of lseek(), pread(), or pwrite(). Therefore use nonseekable_open() and, redundantly, set file_operations.llseek to no_llseek to remove any doubt whether the BKL- grabbing default_llseek handler is used. Although all this is legacy code which should be left in peace until it is eventually removed (as it is superseded by firewire-core's <linux/firewire-cdev.h> ABI), this change seems still worth doing to further minimize the presence of BKL usage in the kernel. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa1-1/+1
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-11fs: Remove i_cindex from struct inodeTheodore Ts'o1-2/+3
The only user of the i_cindex element in the inode structure is used is by the firewire drivers. As part of an attempt to slim down the inode structure to save memory --- since a typical Linux system will have hundreds of thousands if not millions of inodes cached, a reduction in the size inode has high leverage. The firewire driver does not need i_cindex in any fast path, so it's simple enough to calculate when it is needed, instead of wasting space in the inode structure. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: krh@redhat.com Cc: stefanr@s5r6.in-berlin.de Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2009-03-27Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6Linus Torvalds1-1/+1
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (53 commits) DVB: firedtv: FireDTV S2 problems with tuning solved DVB: firedtv: fix printk format mismatch ieee1394: constify device ID tables ieee1394: raw1394: add sparse annotations to raw1394_compat_write ieee1394: Storage class should be before const qualifier ieee1394: sbp2: follow up on "ieee1394: inherit ud vendor_id from node vendor_id" firewire: core: optimize propagation of BROADCAST_CHANNEL firewire: core: simplify broadcast channel allocation firewire: core: increase bus manager grace period firewire: core: drop unused call parameters of close_transaction firewire: cdev: add closure to async stream ioctl firewire: cdev: simplify FW_CDEV_IOC_SEND_REQUEST return value firewire: cdev: fix race of ioctl_send_request with bus reset firewire: cdev: secure add_descriptor ioctl firewire: cdev: amendment to "add ioctl to query maximum transmission speed" firewire: broadcast channel support firewire: implement asynchronous stream transmission firewire: core: normalize a function argument name firewire: normalize a variable name firewire: core: remove condition which is always false ...
2009-03-24ieee1394: constify device ID tablesStefan Richter1-1/+1
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2009-03-16Rationalize fasync return valuesJonathan Corbet1-5/+1
Most fasync implementations do something like: return fasync_helper(...); But fasync_helper() will return a positive value at times - a feature used in at least one place. Thus, a number of other drivers do: err = fasync_helper(...); if (err < 0) return err; return 0; In the interests of consistency and more concise code, it makes sense to map positive return values onto zero where ->fasync() is called. Cc: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2009-02-06ieee1394: dv1394: move deprecation message from module init to file openStefan Richter1-4/+4
On many Linux installations, the dv1394 driver will be auto-loaded whenever an AV/C device (e.g. camcorder or audio device) is plugged in. An irritating message would then appear in the kernel log. Defer this message to until a dv1394 character device file is actually used by a program. Also include the program name in the message and update the message slightly. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2009-01-04ieee1934: dv1394: interrupt enabling/disabling broken on big-endianHarvey Harrison1-4/+4
After annotating the frame structs, this was left: drivers/ieee1394/dv1394.c:2113:23: warning: invalid assignment: |= drivers/ieee1394/dv1394.c:2113:23: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2113:23: right side has type int drivers/ieee1394/dv1394.c:2121:24: warning: invalid assignment: &= drivers/ieee1394/dv1394.c:2121:24: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2121:24: right side has type int drivers/ieee1394/dv1394.c:2123:24: warning: invalid assignment: |= drivers/ieee1394/dv1394.c:2123:24: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2123:24: right side has type int Which looks like a real bug on a big-endian arch as it would set/clear the wrong bit. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Bill Fink writes: I finally got a chance to test the patch on my kernel, and live DV viewing using xine still worked fine. Although I admit to being mystified how it works both before and after the patch, since the cpu_to_le32() calls that were added should result in byte swapping on PPC that wasn't being done before. I guess that either the code paths involved aren't actually being triggered by my xine DV viewing, or there's some fortuitous palindromic setting of bits. Tested-by: Bill Fink <billfink@mindspring.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2009-01-04ieee1394: dv1394: annotate frame input/output structs as little endianHarvey Harrison1-2/+2
No Functional changes. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-11-06Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6Linus Torvalds1-2/+8
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: dv1394: fix possible deadlock in multithreaded clients ieee1394: raw1394: fix possible deadlock in multithreaded clients ieee1394: struct device - replace bus_id with dev_name(), dev_set_name() firewire: struct device - replace bus_id with dev_name(), dev_set_name()
2008-11-01saner FASYNC handling on file closeAl Viro1-3/+0
As it is, all instances of ->release() for files that have ->fasync() need to remember to evict file from fasync lists; forgetting that creates a hole and we actually have a bunch that *does* forget. So let's keep our lives simple - let __fput() check FASYNC in file->f_flags and call ->fasync() there if it's been set. And lose that crap in ->release() instances - leaving it there is still valid, but we don't have to bother anymore. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-31ieee1394: dv1394: fix possible deadlock in multithreaded clientsStefan Richter1-2/+8
Fix a possible though highly unlikely deadlock: Thread A: Thread B: - acquire mmap_sem - dv1394_ioctl/read/write() - dv1394_mmap() - acquire video->mtx - acquire video->mtx - copy_to/from_user(), possible page fault: acquire mmap_sem The simplest fix is to use mutex_trylock() instead of mutex_lock() in dv1394_mmap(). This changes the behavior under contention in a way which is visible to userspace clients. However, my guess is that no clients exist which use mmap vs. ioctl/read/write on the dv1394 character device file interface in concurrent threads. Reported-by: Johannes Weiner <hannes@saeurebad.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-10-16Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6Linus Torvalds1-1/+1
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: firewire: Add more documentation to firewire-cdev.h firewire: fix ioctl() return code firewire: fix setting tag and sy in iso transmission firewire: fw-sbp2: fix another small generation access bug firewire: fw-sbp2: enforce s/g segment size limit firewire: fw_send_request_sync() ieee1394: survive a few seconds connection loss ieee1394: nodemgr clean up class iterators ieee1394: dv1394, video1394: remove unnecessary expressions ieee1394: raw1394: make write() thread-safe ieee1394: raw1394: narrow down the state_mutex protected region ieee1394: raw1394: replace BKL by local mutex, make ioctl() and mmap() thread-safe ieee1394: sbp2: enforce s/g segment size limit ieee1394: sbp2: check for DMA mapping failures ieee1394: sbp2: stricter dma_sync ieee1394: Use DIV_ROUND_UP
2008-10-16device create: ieee1394: convert device_create_drvdata to device_createGreg Kroah-Hartman1-4/+4
Now that device_create() has been audited, rename things back to the original call to be sane. Cc: Ben Collins <ben.collins@ubuntu.com> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-15ieee1394: dv1394, video1394: remove unnecessary expressionsStefan Richter1-1/+1
init->channel and v.buffer are unsigned and tests for < 0 therefore always false. gcc knows this and eliminates the code, but anyway... Reported by Roel Kluin. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-07-21device create: ieee1394: convert device_create to device_create_drvdataGreg Kroah-Hartman1-3/+4
device_create() is race-prone, so use the race-free device_create_drvdata() instead as device_create() is going away. Cc: Ben Collins <ben.collins@ubuntu.com> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-25ieee1394: silence defined but not used warning in non-modular buildsTony Breeds1-0/+2
Currently the kernel will issue the following warning: drivers/ieee1394/raw1394.c:2938: warning: 'raw1394_id_table' defined but not used Add #ifdef MODULE guards around the declaration. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Ditto with dv1394_id_table and video1394_id_table. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-04-18ieee1394: Remove superfluous calls to kobject_set_name().Robert P. J. Day1-1/+0
Unless you're adding a kobject to the sysfs hierarchy, there is no point setting its kobject name. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-04-18ieee1394: prevent device binding of raw1394, video1394, dv1394Stefan Richter1-2/+1
These drivers don't need to match any unit_directory type device. They just need the id_table for module autoloading per module alias. Not binding any of these drivers allows special-purpose drivers with similar or same IDs to bind to devices. This currently only benefits out-of-tree drivers; on the other hand it is in no way detrimental to in-tree drivers. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-07-10ieee1394: convert ieee1394 from "struct class_device" to "struct device"Kay Sievers1-4/+4
Here is a straightforward conversion to "struct device". The "struct class_device" will be removed from the kernel. It seems to work fine for me with and without CONFIG_SYSFS_DEPRECATED set. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap1-1/+0
Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-09ieee1394: change deprecation status of dv1394Stefan Richter1-2/+2
Nobody ported ffmpeg from dv1394 to rawiso yet, and there is no justification to remove dv1394 right now. Nevertheless, a strong deprecation of this ABI makes a lot of sense, especially as Kristian H's drivers shape up to be an attractive alternative to the existing ones. But we don't have a schedule at the moment. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-12[PATCH] mark struct file_operations const 3Arjan van de Ven1-1/+1
Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-08ieee1394: dv1394: tidy up card removalStefan Richter1-23/+13
small coding style touch-up and terser coding Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: dv1394: fix CardBus card ejectionStefan Richter1-7/+5
Fix NULL pointer dereference on hot ejection of a FireWire card while dv1394 was loaded. http://bugzilla.kernel.org/show_bug.cgi?id=7121 I did not test card ejection with open /dev/dv1394 files yet. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: Consolidate driver registeringBen Collins1-5/+1
This patch consolidates some bookkeeping for driver registering. It closely models what pci_register_driver() does. The main addition is that the owner of the driver is set, so we get a proper symlink for /sys/bus/ieee1394/driver/*/module. Also moves setting of name and bus type into nodemgr. Because of this, we can remove the EXPORT_SYMBOL for ieee1394_bus_type, since it's now only used in ieee1394.ko. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: dv1394: schedule for feature removalStefan Richter1-0/+4
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07dv1394: remove BKL contentionStefan Richter1-11/+3
Purges the one remaining call to lock_kernel() from the 1394 subsystem. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: safer definition of empty macrosStefan Richter1-2/+2
A deactivated macro, defined as "#define foo(bar)", will result in silent corruption if somebody forgets a semicolon after a call to foo. Replace it by "#define foo(bar) do {} while (0)" which will reveal any respective syntax errors. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-07-03[PATCH] ieee1394: dv1394: sem2mutex conversionStefan Richter1-15/+16
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (not runtime-tested) Signed-off-by: Ben Collins <bcollins@ubuntu.com>
2006-07-03[PATCH] ieee1394: update #include directives in midlayer header filesStefan Richter1-6/+6
Remove unnecessary includes, add missing includes. Use forward type declarations for some structs. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Ben Collins <bcollins@ubuntu.com>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel1-1/+0
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-28ieee1394: remove devfs supportStefan Richter1-39/+2
Devfs has been disabled in the last kernel releases, so let's remove it from ieee1394core, raw1394, video1394, dv1394. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Dan Dennedy <dan@dennedy.org> Signed-off-by: Jody McIntyre <scjody@modernduck.com>
2006-01-10[PATCH] don't include ioctl32.h in driversChristoph Hellwig1-1/+0
These days ioctl32.h is only used for communication of fs/compat.c and fs/compat_ioctl.c and doesn't contain anything of interest to drivers. Remove inclusion in various drivers. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07Remove definitions of unreferenced macros virt_to_page and vmalloc_32 fromStefan Richter1-9/+0
dv1394 and video1394. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jody McIntyre <scjody@modernduck.com>
2005-11-07kmalloc/kzalloc changes:Stefan Richter1-3/+1
dv1394, eth1394, ieee1394, ohci1394, pcilynx, raw1394, sbp2c, video1394: - use kzalloc - provide safer size arguments to kmalloc and kzalloc - omit some casts Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jody McIntyre <scjody@modernduck.com>
2005-10-28[PATCH] Driver Core: fix up all callers of class_device_create()Greg Kroah-Hartman1-1/+1
The previous patch adding the ability to nest struct class_device changed the paramaters to the call class_device_create(). This patch fixes up all in-kernel users of the function. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-30[PATCH] ieee1394: delete legacy module aliasesJody McIntyre1-1/+0
amdtp, dv1394, raw1394, video1394: Delete legacy module aliases. The macros did not work and the aliases are not needed nowadays. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Ben Collins <bcollins@debian.org> Signed-off-by: Jody McIntyre <scjody@steamballoon.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-20[PATCH] class: convert drivers/ieee1394/* to use the new class api instead of class_simplegregkh@suse.de1-3/+3
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+2663
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!