summaryrefslogtreecommitdiffstats
path: root/drivers/firewire
Commit message (Collapse)AuthorAgeFilesLines
* headers: remove sched.h from poll.hAlexey Dobriyan2009-10-041-0/+1
| | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'for-linus' of ↵Linus Torvalds2009-09-235-19/+30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: sbp2: remove a workaround for Momobay FX-3A firewire: sbp2: remove a workaround for Momobay FX-3A firewire: sbp2: fix status reception firewire: core: fix topology map response handler firewire: core: fix race with parallel PCI device probe firewire: core: header file cleanup firewire: ohci: fix Self ID Count register mask (safeguard against buffer overflow) ieee1394: raw1394: Do not leak memory on failed trylock.
| * firewire: sbp2: remove a workaround for Momobay FX-3AStefan Richter2009-09-121-2/+1
| | | | | | | | | | | | The inquiry delay does more harm than good in tests on a recent kernel. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: sbp2: fix status receptionStefan Richter2009-09-121-6/+7
| | | | | | | | | | | | | | | | | | Per SBP-2 clause 5.3, a target shall store 8...32 bytes of status information. Trailing zeros after the first 8 bytes don't need to be stored, they are implicit. Fix the status write handler to clear all unwritten status data. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: fix topology map response handlerStefan Richter2009-09-121-1/+1
| | | | | | | | | | | | | | | | This register is 1 kBytes large. Adjust topology_map.length to prevent registration of other response handlers in this region and to make sure that we respond to requests to the upper half of the register. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: fix race with parallel PCI device probeStefan Richter2009-09-121-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The config ROM buffer received from generate_config_rom is a globally shared static buffer. Extend the card_mutex protection in fw_add_card until after the config ROM was copied into the card driver's buffer. Otherwise, parallelized card driver probes may end up with ROM contents that were meant for a different card. firewire-ohci's card->driver->enable hook is safe to be called within the card_mutex. Furthermore, it is safe to reorder card_list update versus card enable, which simplifies the code a little. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: header file cleanupStefan Richter2009-09-121-0/+14
| | | | | | | | | | | | | | | | fw_card_get, fw_card_put, fw_card_release are currently not exported for use outside the firewire-core. Move their definitions/ declarations from the subsystem header file to the core header file. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: ohci: fix Self ID Count register mask (safeguard against buffer ↵Stefan Richter2009-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | overflow) The selfIDSize field of Self ID Count is 9 bits wide, and we are only interested in the high 8 bits. Fix the mask accordingly. The previously too large mask didn't do damage though because the next few bits in the register are reserved and therefore zero with presently existing hardware. Also, check for the maximum possible self ID count of 252 (according to OHCI 1.1 clause 11.2 and IEEE 1394a-2000 clause 4.3.4.1, i.e. up to four self IDs of up to 63 nodes, even though IEEE 1394 up to edition 2008 defines only up to three self IDs per node). More than 252 self IDs would only happen if the self ID receive DMA unit malfunctioned, which would likely be caught by other self ID buffer checks. However, check it early to be sure. More than 253 quadlets would overflow the Topology Map CSR. Reported-By: PaX Team Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* | driver model: constify attribute groupsDavid Brownell2009-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | Let attribute group vectors be declared "const". We'd like to let most attribute metadata live in read-only sections... this is a start. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6Linus Torvalds2009-09-141-4/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1623 commits) netxen: update copyright netxen: fix tx timeout recovery netxen: fix file firmware leak netxen: improve pci memory access netxen: change firmware write size tg3: Fix return ring size breakage netxen: build fix for INET=n cdc-phonet: autoconfigure Phonet address Phonet: back-end for autoconfigured addresses Phonet: fix netlink address dump error handling ipv6: Add IFA_F_DADFAILED flag net: Add DEVTYPE support for Ethernet based devices mv643xx_eth.c: remove unused txq_set_wrr() ucc_geth: Fix hangs after switching from full to half duplex ucc_geth: Rearrange some code to avoid forward declarations phy/marvell: Make non-aneg speed/duplex forcing work for 88E1111 PHYs drivers/net/phy: introduce missing kfree drivers/net/wan: introduce missing kfree net: force bridge module(s) to be GPL Subject: [PATCH] appletalk: Fix skb leak when ipddp interface is not loaded ... Fixed up trivial conflicts: - arch/x86/include/asm/socket.h converted to <asm-generic/socket.h> in the x86 tree. The generic header has the same new #define's, so that works out fine. - drivers/net/tun.c fix conflict between 89f56d1e9 ("tun: reuse struct sock fields") that switched over to using 'tun->socket.sk' instead of the redundantly available (and thus removed) 'tun->sk', and 2b980dbd ("lsm: Add hooks to the TUN driver") which added a new 'tun->sk' use. Noted in 'next' by Stephen Rothwell.
| * drivers: Kill now superfluous ->last_rx storesEric Dumazet2009-09-021-2/+0
| | | | | | | | | | | | | | | | | | | | The generic packet receive code takes care of setting netdev->last_rx when necessary, for the sake of the bonding ARP monitor. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Neil Horman <nhorman@txudriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * netdev: drivers should make ethtool_ops constStephen Hemminger2009-09-021-1/+1
| | | | | | | | | | | | | | No need to put ethtool_ops in data, they should be const. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * netdev: convert pseudo drivers to netdev_tx_tStephen Hemminger2009-09-011-1/+1
| | | | | | | | | | | | | | These are all drivers that don't touch real hardware. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'for-linus' of ↵Linus Torvalds2009-09-053-6/+20
|\ \ | |/ |/| | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: firewire: sbp2: fix freeing of unallocated memory firewire: ohci: fix Ricoh R5C832, video reception firewire: ohci: fix Agere FW643 and multiple cameras firewire: core: fix crash in iso resource management
| * firewire: sbp2: fix freeing of unallocated memoryStefan Richter2009-09-051-4/+4
| | | | | | | | | | | | | | | | If a target writes invalid status (typically status of a command that already timed out), firewire-sbp2 attempts to put away an ORB that doesn't exist. https://bugzilla.redhat.com/show_bug.cgi?id=519772 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: ohci: fix Ricoh R5C832, video receptionStefan Richter2009-09-051-0/+5
| | | | | | | | | | | | | | | | | | In dual-buffer DMA mode, no video frames are ever received from R5C832 by libdc1394. Fallback to packet-per-buffer DMA works reliably. http://thread.gmane.org/gmane.linux.kernel.firewire.devel/13393/focus=13476 Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: ohci: fix Agere FW643 and multiple camerasStefan Richter2009-09-051-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An Agere FW643 OHCI 1.1 card works fine for video reception from one camera but fails early if receiving from two cameras. After a short while, no IR IRQ events occur and the context control register does not react anymore. This happens regardless whether both IR DMA contexts are dual-buffer or one is dual-buffer and the other packet-per-buffer. This can be worked around by disabling dual buffer DMA mode entirely. http://sourceforge.net/mailarchive/message.php?msg_name=4A7C0594.2020208%40gmail.com (Reported by Samuel Audet.) In another report (by Jonathan Cameron), an FW643 works OK with two cameras in dual buffer mode. Whether this is due to different chip revisions or different usage patterns (different video formats) is not yet clear. However, as far as the current capabilities of firewire-core's isochronous I/O interface are concerned, simply switching off dual-buffer on non-working and working FW643s alike is not a problem in practice. We only need to revisit this issue if we are going to enhance the interface, e.g. so that applications can explicitly choose modes. Reported-by: Samuel Audet <samuel.audet@gmail.com> Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: fix crash in iso resource managementStefan Richter2009-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression due to post 2.6.30 commit "firewire: core: do not DMA-map stack addresses" 6fdc03709433ccc2005f0f593ae9d9dd04f7b485. As David Moore noted, a previously correct sizeof() expression became wrong since the commit changed its argument from an array to a pointer. This resulted in an oops in ohci_cancel_packet in the shared workqueue thread's context when an isochronous resource was to be freed. Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* | Merge branch 'for-linus' of ↵Linus Torvalds2009-07-065-21/+34
|\ \ | |/ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs) firewire: sbp2: add support for disks >2 TB (and 16 bytes long CDBs) firewire: core: do not DMA-map stack addresses
| * firewire: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)Stefan Richter2009-07-021-1/+9
| | | | | | | | | | | | | | | | | | Increase the command ORB data structure to transport up to 16 bytes long CDBs (instead of 12 bytes), and tell the SCSI mid layer about it. This is notably necessary for READ CAPACITY(16) and friends, i.e. support of large disks. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: do not DMA-map stack addressesStefan Richter2009-06-254-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The DMA mapping API cannot map on-stack addresses, as explained in Documentation/DMA-mapping.txt. Convert the two cases of on-stack packet payload buffers in firewire-core (payload of lock requests in the bus manager work and in iso resource management) to slab-allocated memory. There are a number on-stack buffers for quadlet write or quadlet read requests in firewire-core and firewire-sbp2. These are harmless; they are copied to/ from card driver internal DMA buffers since quadlet payloads are inlined with packet headers. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* | Merge branch 'for-linus' of ↵Linus Torvalds2009-06-226-123/+1714
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: firewire: new stack is no longer experimental firewire: net: better FIFO address range check and rcodes firewire: net: fix card driver reloading firewire: core: fix iso context shutdown on card removal firewire: core: fix DMA unmapping in iso buffer removal firewire: net: adjust net_device ops firewire: net: remove unused code firewire: net: allow for unordered unit discovery firewire: net: style changes firewire: net: add Kconfig item, rename driver firewire: add IPv4 support
| * firewire: new stack is no longer experimentalStefan Richter2009-06-211-28/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new stack is now recommended over the old one if used for industrial video (IIDC/DCAM) or for storage devices (SBP-2) due to better performance, improved compatibility, added features, and security. It should also be functionally on par with and is more secure than the old ieee1394 stack in the use case of consumer video devices. IP-over-1394 support for the new stack is currently emerging, and a backend of the firedtv DVB driver to the new stack should be available soon. The one remaining area where the old stack is still required are audio devices, as the new stack is not yet able to support the FFADO FireWire audio framework. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: net: better FIFO address range check and rcodesStefan Richter2009-06-161-16/+14
| | | | | | | | | | | | | | | | | | | | | | The AR req handler should not check the generation; higher level code is the better place to handle bus generation changes. The target node ID just needs to be checked for not being the "all nodes" address; in this case don't handle the request and don't respond. Use Address_Error and Type_Error rcodes as appropriate. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: net: fix card driver reloadingStefan Richter2009-06-161-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix some problems from "firewire: net: allow for unordered unit discovery": - fwnet_remove was missing a list_del, causing fwnet_probe to crash if called after fwnet_remove, e.g. if firewire-ohci was unloaded and reloaded. - fwnet_probe should set its new_netdev flag only if it actually allocated a net_device. - Use dev_set_drvdata and dev_get_drvdata instead of deprecated direct access to device.driver_data. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: fix iso context shutdown on card removalStefan Richter2009-06-161-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If isochronous contexts existed when firewire-ohci was unloaded, the core iso shutdown functions crashed with NULL dereferences, and buffers etc. weren't released. How the fix works: We first copy the card driver's iso shutdown hooks into the dummy driver, then fw_destroy_nodes notifies upper layers of devices going away, these should shut down (including their iso contexts), wait_for_completion(&card->done) will be triggered after upper layers gave up all fw_device references, after which the card driver's shutdown proceeds. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: fix DMA unmapping in iso buffer removalStefan Richter2009-06-161-2/+2
| | | | | | | | | | | | dmap_unmap_page() shall use the same direction as dma_map_page(). Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: net: adjust net_device opsStefan Richter2009-06-141-10/+2
| | | | | | | | | | | | | | | | | | | | | | The .ndo_tx_timeout callback is currently without function; delete it. Give .watchdog_timeo a proper time value; lower it to 2 seconds. Decrease the .tx_queue_len from 1000 (as in Ethernet card drivers) to 10 because we have only 64 transaction labels available, and responders might have further limits of their AR req contexts. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: net: remove unused codeStefan Richter2009-06-141-6/+1
| | | | | | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: net: allow for unordered unit discoveryStefan Richter2009-06-142-249/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decouple the creation and destruction of the net_device from the order of discovery and removal of nodes with RFC 2734 unit directories since there is no reliable order. The net_device is now created when the first RFC 2734 unit on a card is discovered, and destroyed when the last RFC 2734 unit on a card went away. This includes all remote units as well as the local unit, which is therefore tracked as a peer now too. Also, locking around the list of peers is slightly extended to guard against peer removal. As a side effect, fwnet_peer.pdg_lock has become superfluous and is deleted. Peer data (max_rec, speed, node ID, generation) are updated more carefully. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: net: style changesStefan Richter2009-06-142-1077/+966
| | | | | | | | | | | | | | | | | | | | | | Change names of types, variables, functions. Omit debug code. Use get_unaligned*, put_unaligned*. Annotate big endian data. Handle errors in __init. Change whitespace. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: net: add Kconfig item, rename driverStefan Richter2009-06-143-4/+16
| | | | | | | | | | | | | | The driver is now called firewire-net. It might implement the transport of other networking protocols in the future, notably IPv6 per RFC 3146. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: add IPv4 supportJay Fenlason2009-06-145-87/+1832
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement IPv4 over IEEE 1394 as per RFC 2734 for the newer firewire stack. This feature has only been present in the older ieee1394 stack via the eth1394 driver. Still to do: - fix ipv4_priv and ipv4_node lifetime logic - fix determination of speeds and max payloads - fix bus reset handling - fix unaligned memory accesses - fix coding style - further testing/ improvement of fragment reassembly - perhaps multicast support Signed-off-by: Jay Fenlason <fenlason@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (rebased, copyright note, changelog)
* | Merge branch 'for-linus' of ↵Linus Torvalds2009-06-1614-829/+544
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: firewire: core: use more outbound tlabels firewire: core: don't update Broadcast_Channel if RFC 2734 conditions aren't met firewire: core: prepare for non-core children of card devices firewire: core: include linux/uaccess.h instead of asm/uaccess.h firewire: add parent-of-unit accessor firewire: rename source files firewire: reorganize header files firewire: clean up includes firewire: ohci: access bus_seconds atomically firewire: also use vendor ID in root directory for driver matches firewire: share device ID table type with ieee1394 firewire: core: add sysfs attribute for easier udev rules firewire: core: check for missing struct update at build time, not run time firewire: core: improve check for local node
| * firewire: core: use more outbound tlabelsStefan Richter2009-06-141-4/+4
| | | | | | | | | | | | | | | | | | Tlabel is a 6 bits wide datum. Wrap it after 63 rather than 31 for more safety against transaction label exhaustion and potential responders' transaction layer bugs. (As noted by Guus Sliepen, this change requires an expansion of tlabel_mask to 64 bits.) Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: don't update Broadcast_Channel if RFC 2734 conditions aren't metStefan Richter2009-06-141-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | This extra check will avoid Broadcast_Channel register related traffic to many IIDC, SBP-2, and AV/C devices which aren't IRMC or have a max_rec < 8 (i.e. support < 512 bytes async payload). This avoids a little bit of traffic after bus reset and is even more careful with devices which don't implement this CSR. The assumption is that no other protocol than IP over 1394 uses the broadcast channel for streams. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: prepare for non-core children of card devicesStefan Richter2009-06-063-12/+22
| | | | | | | | | | | | | | | | | | | | | | The IP-over-1394 driver will add child devices beneath card devices which are not of type fw_device. Hence firewire-core's callbacks in device_for_each_child() and device_find_child() need to check for the device type now. Initial version written by Jay Fenlason. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: include linux/uaccess.h instead of asm/uaccess.hStefan Richter2009-06-061-1/+1
| | | | | | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: add parent-of-unit accessorStefan Richter2009-06-062-18/+23
| | | | | | | | | | | | | | Retrieval of an fw_unit's parent is a common pattern in high-level code. Wrap it up as device = fw_parent_device(unit). Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: rename source filesStefan Richter2009-06-059-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The source files of firewire-core, firewire-ohci, firewire-sbp2, i.e. "drivers/firewire/fw-*.c" are renamed to "drivers/firewire/core-*.c", "drivers/firewire/ohci.c", "drivers/firewire/sbp2.c". The old fw- prefix was redundant to the directory name. The new core- prefix distinguishes the files according to which driver they belong to. This change comes a little late, but still before further firewire drivers are added as anticipated RSN. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: reorganize header filesStefan Richter2009-06-0513-737/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The three header files of firewire-core, i.e. "drivers/firewire/fw-device.h", "drivers/firewire/fw-topology.h", "drivers/firewire/fw-transaction.h", are replaced by "drivers/firewire/core.h", "include/linux/firewire.h". The latter includes everything which a firewire high-level driver (like firewire-sbp2) needs besides linux/firewire-constants.h, while core.h contains the rest which is needed by firewire-core itself and by low- level drivers (card drivers) like firewire-ohci. High-level drivers can now also reside outside of drivers/firewire without having to add drivers/firewire to the header file search path in makefiles. At least the firedtv driver will be such a driver. I also considered to spread the contents of core.h over several files, one for each .c file where the respective implementation resides. But it turned out that most core .c files will end up including most of the core .h files. Also, the combined core.h isn't unreasonably big, and it will lose more of its contents to linux/firewire.h anyway soon when more firewire drivers are added. (IP-over-1394, firedtv, and there are plans for one or two more.) Furthermore, fw-ohci.h is renamed to ohci.h. The name of core.h and ohci.h is chosen with regard to name changes of the .c files in a follow-up change. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: clean up includesStefan Richter2009-06-057-22/+61
| | | | | | | | | | | | | | Include required headers which were only indirectly included. Remove unused includes and an unused constant. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: ohci: access bus_seconds atomicallyStefan Richter2009-06-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | In the unlikely event that card->driver->get_bus_time() is called during a cycle64Seconds interrupt, we could read garbage unless atomic accesses are used. The switch to atomic ops requires to change the 64 seconds counter from unsigned to signed, but this shouldn't matter to the end result. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: also use vendor ID in root directory for driver matchesStefan Richter2009-06-051-6/+16
| | | | | | | | | | | | | | | | Due to AV/C protocol extensions, FireDTV devices need a vendor-specific driver. But their configuration ROM features a vendor ID only in the root directory, not in the unit directory. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: share device ID table type with ieee1394Stefan Richter2009-06-053-25/+15
| | | | | | | | | | | | | | That way, the new firedtv driver will be able to use a single ID table in builds against ieee1394 core and/or against firewire core. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: add sysfs attribute for easier udev rulesStefan Richter2009-06-012-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the attribute /sys/bus/firewire/devices/fw[0-9]+/units. It can be used in udev rules like the following ones: # IIDC devices: industrial cameras and some webcams SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010?*", GROUP="video" # AV/C devices: camcorders, set-top boxes, TV sets, audio devices, ... SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video" Background: firewire-core manages two device types: - fw_device is a FireWire node. A character device file is associated with it. - fw_unit is a unit directory on a node. Each fw_device may have 0..n children of type fw_unit. The units tell us what kinds of protocols a node implements. We want to set ownership or ACLs or permissions of the character device file of an fw_device, or/and create symlinks to it, based on available protocols. Until now udev rules had to look at the fw_unit devices and then modify their parent's character device file accordingly. This is problematic for two reasons: 1) It happens sometime after the creation of the fw_device, 2) an access policy may require that information from all children is evaluated before a decision about the parent is made. Problem 1) can ultimately not be avoided since this is the nature of FireWire nodes: They may add or remove unit directories at any point in time. However, we can still help userland a lot by providing the protocol type information of all units in a summary sysfs attribute directly at the fw_device. This way, - the information is immediately available at the affected device when userspace goes about to handle an ADD or CHANGE event of the fw_device, - with most policies, it won't be necessary anymore to dig through child attributes. The new attribute is called "units". It contains space-separated tuples of specifier_id and version of each present unit. The delimiter within tuples is a colon. Specifier_id and version are printed as 0x%06x. Here is an example of a node which implements an IPv4 unit and an IPv6 unit: $ cat /sys/bus/firewire/devices/fw2/units 0x00005e:0x000001 0x00005e:0x000002 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: check for missing struct update at build time, not run timeStefan Richter2009-06-011-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | struct fw_attribute_group.attrs.[] must have enough room for all attributes. This can and should be checked at build time. Our previous check at run time was a little late and not reliable since most of the time less than the available attributes are populated. Furthermore, omit an increment of an index at its last usage. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| * firewire: core: improve check for local nodeStefan Richter2009-05-173-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My recently added test for a device being local in fw-cdev.c got it slightly wrong: Comparisons of node IDs are only valid if the generation is current, which I forgot to check. Normally, serialization by card->lock takes care of this, but a device in FW_DEVICE_GONE state will necessarily have a wrong generation and invalid node_id. The "is it local?" check is made 100% correct and simpler now by means of a struct fw_device flag which is set at fw_device creation. Besides the fw-cdev site which was to be fixed, there is another site which can make use of the new flag, and an RFC-2734 driver will benefit from it too. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* | firewire: remove driver_data direct access of struct deviceGreg Kroah-Hartman2009-06-151-3/+3
|/ | | | | | | | | | | | | | In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux1394-devel@lists.sourceforge.net Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Kristian Hoegsberg <krh@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* firewire: core: optimize propagation of BROADCAST_CHANNELStefan Richter2009-03-245-90/+52
| | | | | | | | | | | | | | | | | Cache the test result of whether a device implements BROADCAST_CHANNEL. This minimizes traffic on the bus after each bus reset. A majority of devices does not implement BROADCAST_CHANNEL. Remove busy retries; just rely on the hardware to retry requests to busy responders. Remove unnecessary log messages. Rename the flag is_irm to broadcast_channel_allocated to better reflect its meaning. Reset the flag earlier in fw_core_handle_bus_reset. Pass the generation down as a call parameter; that way generation can't be newer than card->broadcast_channel_allocated and device->node_id. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
OpenPOWER on IntegriCloud