IEEE 1394 updates for Linux 2.6.28.y (v950 2009-05-17) drivers/firewire/fw-card.c | 181 ++- drivers/firewire/fw-cdev.c | 1046 +++++++++++++++------ drivers/firewire/fw-device.c | 352 ++++--- drivers/firewire/fw-device.h | 27 drivers/firewire/fw-iso.c | 227 ++++ drivers/firewire/fw-ohci.c | 264 ++--- drivers/firewire/fw-sbp2.c | 124 +- drivers/firewire/fw-topology.c | 53 - drivers/firewire/fw-topology.h | 19 drivers/firewire/fw-transaction.c | 187 +-- drivers/firewire/fw-transaction.h | 156 +-- drivers/ieee1394/csr.c | 12 drivers/ieee1394/csr.h | 10 drivers/ieee1394/csr1212.c | 45 drivers/ieee1394/csr1212.h | 9 drivers/ieee1394/dma.h | 1 drivers/ieee1394/dv1394-private.h | 44 drivers/ieee1394/dv1394.c | 22 drivers/ieee1394/eth1394.c | 30 drivers/ieee1394/eth1394.h | 16 drivers/ieee1394/highlevel.c | 9 drivers/ieee1394/highlevel.h | 7 drivers/ieee1394/hosts.c | 6 drivers/ieee1394/hosts.h | 2 drivers/ieee1394/ieee1394.h | 7 drivers/ieee1394/ieee1394_core.c | 19 drivers/ieee1394/ieee1394_transactions.c | 31 drivers/ieee1394/ieee1394_transactions.h | 2 drivers/ieee1394/iso.h | 1 drivers/ieee1394/nodemgr.c | 34 drivers/ieee1394/nodemgr.h | 23 drivers/ieee1394/ohci1394.c | 26 drivers/ieee1394/pcilynx.c | 2 drivers/ieee1394/pcilynx.h | 2 drivers/ieee1394/raw1394.c | 14 drivers/ieee1394/sbp2.c | 55 - drivers/ieee1394/video1394.c | 2 drivers/media/dvb/Kconfig | 4 drivers/media/dvb/Makefile | 2 drivers/media/dvb/firesat/Kconfig | 11 drivers/media/dvb/firesat/Makefile | 12 drivers/media/dvb/firesat/avc_api.c | 848 ----------------- drivers/media/dvb/firesat/avc_api.h | 381 ------- drivers/media/dvb/firesat/cmp.c | 230 ---- drivers/media/dvb/firesat/cmp.h | 9 drivers/media/dvb/firesat/firesat-ci.c | 95 - drivers/media/dvb/firesat/firesat-ci.h | 9 drivers/media/dvb/firesat/firesat-rc.c | 84 - drivers/media/dvb/firesat/firesat-rc.h | 9 drivers/media/dvb/firesat/firesat.h | 85 - drivers/media/dvb/firesat/firesat_1394.c | 468 --------- drivers/media/dvb/firesat/firesat_dvb.c | 350 ------- drivers/media/dvb/firesat/firesat_fe.c | 263 ----- drivers/media/dvb/firesat/firesat_iso.c | 106 -- drivers/media/dvb/firewire/Kconfig | 26 drivers/media/dvb/firewire/Makefile | 17 drivers/media/dvb/firewire/avc.c | 1051 ---------------------- drivers/media/dvb/firewire/avc.h | 432 --------- drivers/media/dvb/firewire/cmp.c | 171 --- drivers/media/dvb/firewire/cmp.h | 9 drivers/media/dvb/firewire/firedtv-1394.c | 376 +++---- drivers/media/dvb/firewire/firedtv-avc.c | 88 + drivers/media/dvb/firewire/firedtv-ci.c | 173 +-- drivers/media/dvb/firewire/firedtv-ci.h | 9 drivers/media/dvb/firewire/firedtv-dvb.c | 376 ++++--- drivers/media/dvb/firewire/firedtv-fe.c | 170 +-- drivers/media/dvb/firewire/firedtv-iso.c | 111 -- drivers/media/dvb/firewire/firedtv-rc.c | 19 drivers/media/dvb/firewire/firedtv-rc.h | 11 drivers/media/dvb/firewire/firedtv.h | 279 ++--- include/linux/firewire-cdev.h | 226 +++- 71 files changed, 2927 insertions(+), 6650 deletions(-) Date: Wed, 13 May 2009 21:42:14 +0200 (CEST) From: Stefan Richter firewire: core: improve check for local node 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 --- drivers/firewire/fw-cdev.c | 6 +----- drivers/firewire/fw-device.c | 3 ++- drivers/firewire/fw-device.h | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) Date: Thu, Mar 26, 2009 22:36:52 +0100 (CET) From: Beat Michel Liechti DVB: firedtv: FireDTV S2 problems with tuning solved Signed-off-by: Beat Michel Liechti Tuning was broken on FireDTV S2 (and presumably FloppyDTV S2) because a wrong opcode was sent. The box only gave "not implemented" responses. Changing the opcode to _TUNE_QPSK2 fixes this for good. Cc: stable@kernel.org Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-avc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Date: Tue, 10 Mar 2009 21:09:28 +0100 (CET) From: Stefan Richter firewire: core: optimize propagation of BROADCAST_CHANNEL 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 --- drivers/firewire/fw-card.c | 85 +----------------------------- drivers/firewire/fw-device.c | 45 ++++++++++++++- drivers/firewire/fw-device.h | 5 + drivers/firewire/fw-topology.c | 1 drivers/firewire/fw-transaction.h | 6 -- 5 files changed, 52 insertions(+), 90 deletions(-) Date: Tue, 10 Mar 2009 21:08:37 +0100 (CET) From: Stefan Richter firewire: core: simplify broadcast channel allocation fw-iso.c has channel allocation code now, use it. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 124 +++++++++---------------------------- 1 file changed, 33 insertions(+), 91 deletions(-) Date: Tue, 10 Mar 2009 21:07:46 +0100 (CET) From: Stefan Richter firewire: core: increase bus manager grace period Per IEEE 1394 clause 8.4.2.5, bus manager capable nodes which are not incumbent shall wait at least 125ms before trying to establish themselves as bus manager. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) Date: Tue, 10 Mar 2009 21:07:06 +0100 (CET) From: Stefan Richter firewire: core: drop unused call parameters of close_transaction All callers inserted NULL and 0 here. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) Date: Tue, 10 Mar 2009 21:02:21 +0100 (CET) From: Stefan Richter firewire: cdev: add closure to async stream ioctl This changes the as yet unreleased FW_CDEV_IOC_SEND_STREAM_PACKET ioctl to generate an fw_cdev_event_response event just like the other two ioctls for asynchronous request transmission do. This way, clients get feedback on successful or unsuccessful transmission. This also adds input validation for length, tag, channel, sy, speed. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 46 ++++++++++++------------------ drivers/firewire/fw-transaction.c | 42 ++++++++++----------------- drivers/firewire/fw-transaction.h | 9 +++-- include/linux/firewire-cdev.h | 31 ++++++++++---------- 4 files changed, 56 insertions(+), 72 deletions(-) Date: Tue, 10 Mar 2009 21:01:54 +0100 (CET) From: Stefan Richter firewire: cdev: simplify FW_CDEV_IOC_SEND_REQUEST return value This changes the ioctl() return value of FW_CDEV_IOC_SEND_REQUEST and of the as yet unreleased FW_CDEV_IOC_SEND_BROADCAST_REQUEST. They used to return sizeof(struct fw_cdev_send_request *) + data_length which is obviously a failed attempt to emulate the return value of raw1394's respective interface which uses write() instead of ioctl(). However, the first summand, as size of a kernel pointer, is entirely meaningless to clients and the second summand is already known to clients. And the result does not resemble raw1394's write() return code anyway. So simplify it to a constant non-negative value, i.e. 0. The only dangers here would be that future client implementations check for error by ret != 0 instead of ret < 0 when running on top of an old kernel; or that current clients interpret ret = 0 or more as failure. But both are hypothetical cases which don't justify to return irritating values. While we touch this code, also remove "& 0x1f" from tcode in the call of fw_send_request. The tcode cannot be bigger than 0x1f at this point. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) Date: Tue, 10 Mar 2009 21:01:08 +0100 (CET) From: Stefan Richter firewire: cdev: fix race of ioctl_send_request with bus reset The bus reset handler concurrently frees client->device->node. Use device->node_id instead. This is equivalent to device->node->node_id while device->generation is current. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Tue, 10 Mar 2009 21:00:23 +0100 (CET) From: Stefan Richter firewire: cdev: secure add_descriptor ioctl The access permissions and ownership or ACL of /dev/fw* character device files will typically be set based on the device type of the respective nodes, as obtained by firewire-core from descriptors in the device's configuration ROM. An example policy is to deny write permission by default but grant write permission to files of AV/C video and audio devices and IIDC video devices. The FW_CDEV_IOC_ADD_DESCRIPTOR ioctl could be used to partly subvert such a policy: Find a device file with relaxed permissions, use the ioctl to add a descriptor with AV/C marker to the local node's ROM, thus gain access to the local node's character device file. (This is only possible if there are udev scripts installed which actively relax permissions for known device types and if there is a device of such a type connected.) Accessibility of the local node's device file is relevant to host security if the host contains two or more IEEE 1394 link layer controllers which are plugged into a single bus. Therefore change the ABI to deny FW_CDEV_IOC_ADD_DESCRIPTOR if the file belongs to a remote node. (This change has no impact on known implementers of the ABI: None of them uses the ioctl yet.) Also clarify the documentation: The ioctl affects all local nodes, not just one local node. Cc: stable@kernel.org Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 8 ++++++++ include/linux/firewire-cdev.h | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) Date: Tue, 10 Mar 2009 20:59:16 +0100 (CET) From: Stefan Richter firewire: cdev: amendment to "add ioctl to query maximum transmission speed" The as yet unreleased FW_CDEV_IOC_GET_SPEED ioctl puts only a single integer into the parameter buffer. We can use ioctl()'s return value instead. (Also: Some whitespace change in firewire-cdev.h.) Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 11 +++++----- include/linux/firewire-cdev.h | 37 ++++++++++++---------------------- 2 files changed, 20 insertions(+), 28 deletions(-) Date: Thu, 5 Mar 2009 19:13:43 +0100 (CET) From: Stefan Richter DVB: firedtv: fix printk format mismatch Eliminate drivers/media/dvb/firewire/firedtv-avc.c: In function 'debug_fcp': drivers/media/dvb/firewire/firedtv-avc.c:156: warning: format '%d' expects type 'int', but argument 5 has type 'size_t' Acked-by: Mauro Carvalho Chehab Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-avc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Mon, 23 Feb 2009 15:59:34 -0500 From: Jay Fenlason firewire: broadcast channel support This patch adds the ISO broadcast channel support that is required of a 1394a IRM. In specific, if the local device the IRM, it allocates ISO channel 31 and sets the broadcast channel register of all devices on the local bus to BROADCAST_CHANNEL_INITIAL | BROADCAST_CHANNEL_VALID to indicate that channel 31 can be use for broadcast messages. One minor complication is that on startup the local device may become IRM before all the devices on the bus have been enumerated by the stack. Therefore we have to keep a "the local device is IRM" flag and possibly set the broadcast channel register of new devices at enumeration time. Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 172 ++++++++++++++++++++++++++++-- drivers/firewire/fw-device.c | 3 drivers/firewire/fw-transaction.h | 8 + 3 files changed, 177 insertions(+), 6 deletions(-) Date: Thu, 5 Mar 2009 19:08:40 +0100 (CET) From: Jay Fenlason firewire: implement asynchronous stream transmission Allow userspace and other firewire drivers (fw-ipv4 I'm looking at you!) to send Asynchronous Transmit Streams as described in 7.8.3 of release 1.1 of the 1394 Open Host Controller Interface Specification. Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter (tweaks) --- drivers/firewire/fw-cdev.c | 33 ++++++++++++++++++++++++++++++ drivers/firewire/fw-ohci.c | 21 +++++++++++++++++-- drivers/firewire/fw-transaction.c | 25 ++++++++++++++++++++++ drivers/firewire/fw-transaction.h | 4 +++ include/linux/firewire-cdev.h | 27 ++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 2 deletions(-) Date: Thu, 5 Mar 2009 19:07:00 +0100 (CET) From: Stefan Richter firewire: core: normalize a function argument name It's called "payload" rather than "data" almost everywhere in fw-transaction.c. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 6 +++--- drivers/firewire/fw-transaction.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) Date: Sun, 15 Feb 2009 23:11:38 +0100 (CET) From: Stefan Richter ieee1394: constify device ID tables Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394.c | 2 +- drivers/ieee1394/eth1394.c | 2 +- drivers/ieee1394/nodemgr.c | 4 ++-- drivers/ieee1394/nodemgr.h | 2 +- drivers/ieee1394/raw1394.c | 2 +- drivers/ieee1394/sbp2.c | 2 +- drivers/ieee1394/video1394.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) Date: Sun, 15 Feb 2009 22:49:24 +0100 (CET) From: Stefan Richter ieee1394: raw1394: add sparse annotations to raw1394_compat_write Eliminate the following warnings in raw1394_compat_write()'s error return path, seen on x86-64 with CONFIG_COMPAT=y: drivers/ieee1394/raw1394.c:381:17: warning: incorrect type in return expression (different address spaces) drivers/ieee1394/raw1394.c:381:17: expected char const [noderef] * drivers/ieee1394/raw1394.c:381:17: got void * drivers/ieee1394/raw1394.c:2252:14: warning: incorrect type in argument 1 (different address spaces) drivers/ieee1394/raw1394.c:2252:14: expected void const *ptr drivers/ieee1394/raw1394.c:2252:14: got char const [noderef] *[assigned] buffer drivers/ieee1394/raw1394.c:2253:19: warning: incorrect type in argument 1 (different address spaces) drivers/ieee1394/raw1394.c:2253:19: expected void const *ptr drivers/ieee1394/raw1394.c:2253:19: got char const [noderef] *[assigned] buffer Signed-off-by: Stefan Richter --- drivers/ieee1394/raw1394.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) Date: Mon, 9 Feb 2009 22:05:06 +0100 From: Tobias Klauser ieee1394: Storage class should be before const qualifier The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by: Tobias Klauser Signed-off-by: Stefan Richter --- drivers/ieee1394/csr.c | 8 ++++---- drivers/ieee1394/eth1394.c | 2 +- drivers/ieee1394/highlevel.c | 2 +- drivers/ieee1394/raw1394.c | 2 +- drivers/ieee1394/sbp2.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) Date: Tue, 3 Feb 2009 17:55:19 +0100 (CET) From: Stefan Richter firewire: normalize a variable name Standardize on if (err) handle_error; and if (ret < 0) handle_error; Don't call a variable err if we store values in it which mean success. Also, offset some return statements by a blank line since this how we do it in drivers/firewire. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 9 +++++---- drivers/firewire/fw-device.c | 6 +++--- drivers/firewire/fw-iso.c | 10 ++++++---- drivers/firewire/fw-ohci.c | 3 ++- 4 files changed, 16 insertions(+), 12 deletions(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter ieee1394: sbp2: follow up on "ieee1394: inherit ud vendor_id from node vendor_id" Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Date: Sat, 17 Jan 2009 22:45:54 +0100 (CET) From: Stefan Richter firewire: core: remove condition which is always false reread_bus_info_block() only gets to see devices whose config_rom_length is at least 6 (ROM header, bus info block, root directory header). Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sat, 17 Jan 2009 22:45:54 +0100 (CET) From: Stefan Richter firewire: core: move some functions Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 90 +++++++++++++++++------------------ 1 file changed, 44 insertions(+), 46 deletions(-) Date: Sat, 17 Jan 2009 22:45:54 +0100 (CET) From: Stefan Richter firewire: core: clean up includes Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 20 +++++++++++--------- drivers/firewire/fw-device.h | 13 +++++++++++-- 2 files changed, 22 insertions(+), 11 deletions(-) Date: Sun, 11 Jan 2009 13:44:46 +0100 (CET) From: Stefan Richter firewire: cdev: simplify a schedule_delayed_work wrapper The kernel API documentation says that queue_delayed_work() returns 0 (only) if the work was already queued. The return codes of schedule_delayed_work() are not documented but the same. In init_iso_resource(), the work has never been queued yet, hence we can assume schedule_delayed_work() to be a guaranteed success there. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) Date: Fri, 09 Jan 2009 16:20:31 -0800 From: David Moore firewire: cdev: Workaround bug in idr_remove_all() There is a memory clearing problem in idr_remove_all(). Specifically, idr_remove_all() should be clearing some idr data structures before returning them to the idr free list but it's not. Because the idr kmem_cache is persistent, that's why different instantiations of the firewire client would interact with each other. Here's a workaround while I work on a patch to idr.c: Purposefully clear new memory allocated by the idr API to workaround a bug in idr_remove_all. Signed-off-by: David Moore Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Thu, 8 Jan 2009 23:07:40 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctls for iso resource management, amendment Some fixes: - Remove stale documentation. - Fix a != vs. == thinko that got in the way of channel management. - Try bandwidth deallocation even if channel deallocation failed. A simplification: - fw_cdev_allocate_iso_resource.channels is now ordered like libdc1394's dc1394_iso_allocate_channel() channels_allowed argument. By the way, I looked closer at cards from NEC, TI, and VIA, and noticed that they all don't implement IEEE 1394a behaviour which is meant to deviate from IEEE 1212's notion of lock compare-swap. This means that we have to do two lock transactions instead of one in many cases where one transaction would already succeed on a fully 1394a compliant IRM. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 2 - drivers/firewire/fw-iso.c | 38 +++++++++++++++++++--------------- include/linux/firewire-cdev.h | 10 +++----- 3 files changed, 27 insertions(+), 23 deletions(-) Date: Wed, 7 Jan 2009 20:14:53 +0100 (CET) From: Stefan Richter firewire: cdev: increment fw_cdev_version, update documentation Necessary due to Date: Tue, 22 Jul 2008 23:23:40 -0700 From: David Moore Subject: firewire: Include iso timestamp in headers when header_size > 4 Side note: The lack of upwards compatibility sounds worse than it is. All existing client implementations, libraw1394 and libdc1394, set header_size = 4. And since the ABI v1 behaviour does not offer any advantages over the new behaviour, we deliberately do not provide the old behaviour anymore. Also add documentation about the format of fw_cdev_get_cycle_timer which may be used in conjunction with the timestamp of iso packets but has a different format. Signed-off-by: Stefan Richter --- include/linux/firewire-cdev.h | 35 +++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) Date: Mon, 5 Jan 2009 20:28:10 +0100 (CET) From: Stefan Richter firewire: cdev: shut down iso context before freeing the buffer DMA must be halted before we DMA-unmap and free the DMA buffer. Since we cannot rely on the client to stop the context before it closes the fd, we have to reorder fw_iso_buffer_destroy vs. fw_iso_context_destroy. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: replace some spin_lock_irqsave by spin_lock_irq All of these functions are entered with IRQs enabled. Hence the unconditional spin_unlock_irq can be used. Function: Caller context: dequeue_event() client process, via read(2) fill_bus_reset_event() fw-device.c update worqueue job release_client_resource() client process, via ioctl(2) fw_device_op_release() client process, via close(2) Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: extend transaction payload size check Make the size check of ioctl_send_request and ioctl_send_broadcast_request speed dependent. Also change the error return code from -EINVAL to -EIO to distinguish this from other errors concerning the ioctl parameters. Another payload size limit for which we don't check here though is the remote node's Bus_Info_Block.max_rec. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: restrict broadcast write requests to Units Space We don't want random users write to Memory Space (e.g. PCs with physical DMA filters down) or to core CSRs like Reset_Start. This does not protect SBP-2 target CSRs. But properly behaving SBP-2 targets ignore broadcast write requests to these registers, and the maximum damage which can happen with laxer targets is DOS. But there are ways to create DOS situations anyway if there are devices with weak device file permissions (like audio/video devices) present at the same bus as an SBP-2 target. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 4 ++++ 1 file changed, 4 insertions(+) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctl for broadcast write requests Write transactions to the broadcast node ID are a convenient way to trigger functions of multiple nodes at once. IIDC is a protocol which can make use of this if multiple cameras with same command_regs_base are connected at the same bus. Based on Date: Wed, 10 Sep 2008 11:32:16 -0400 From: Jay Fenlason Subject: [patch] SEND_BROADCAST_REQUEST Changes: ioctl_send_request() and ioctl_send_broadcast_request() now share code. Broadcast speed corrected to S100. Check for proper tcode. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 74 +++++++++++++++++++++------------- include/linux/firewire-cdev.h | 1 2 files changed, 48 insertions(+), 27 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctl to query maximum transmission speed While the speed of asynchronous transactions is automatically chosen by the kernel, the speed of isochronous streams has to be chosen by the initiating client. In case of 1394a bus topologies, the maximum possible speed could be figured out with some effort by evaluation of the remote node's link speed field in the config ROM, the local node's link speed field, and the PHY speeds and topologic information in the local node's or IRM's topology map CSR. However, this does not work in case of 1394b buses. Hence add an ioctl to export the maximum speed which the kernel already determined. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 10 ++++++++++ include/linux/firewire-cdev.h | 10 ++++++++++ 2 files changed, 20 insertions(+) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctls for manual iso resource management This adds ioctls for allocation and deallocation of a channel or/and bandwidth without auto-reallocation and without auto-deallocation. The benefit of these ioctls is that libraw1394-style isochronous resource management can be implemented without write access to the IRM's character device file. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 67 +++++++++++++++++++++++++++------- include/linux/firewire-cdev.h | 42 ++++++++++++++++----- 2 files changed, 86 insertions(+), 23 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctls for isochronous resource management Based on Date: Tue, 18 Nov 2008 11:41:27 -0500 From: Jay Fenlason Subject: [Patch V4] Add ISO resource management support with several changes to the ABI and implementation. Only the part of the ABI which enables auto-reallocation and auto-deallocation is included here. This implements ioctls for kernel-assisted allocation of isochronous channels and isochronous bandwidth. The benefits are: - The client does not have to have write access to the /dev/fw* device corresponding to the IRM. - The client does not have to perform reallocation after bus resets. - Channel and bandwidth are deallocated by the kernel if the file is closed before the client deallocated the resources. Thus resources are released even if the client crashes. It is anticipated that future in-kernel code (firewire-core IRM code; the firewire port of firedtv), will use the fw-iso.c portions of this code too. Signed-off-by: Stefan Richter Tested-by: David Moore --- drivers/firewire/fw-cdev.c | 215 +++++++++++++++++++++++++++++- drivers/firewire/fw-iso.c | 176 +++++++++++++++++++++++- drivers/firewire/fw-transaction.h | 4 include/linux/firewire-cdev.h | 100 ++++++++++++- 4 files changed, 475 insertions(+), 20 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: core: topology header fix Signed-off-by: Stefan Richter --- drivers/firewire/fw-topology.h | 6 ++++++ 1 file changed, 6 insertions(+) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: sort includes Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: unify names of struct types and of their instances to indicate that they are specializations of struct event or of struct client_resource, respectively. struct response was both an event and a client_resource; it is now split into struct outbound_transaction_resource and ~_event in order to document more explicitly which types of client resources exist. struct request and struct_request_event are renamed to struct inbound_transaction_resource and ~_event because requests and responses occur in outbound and in inbound transactions. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 337 ++++++++++++++++++------------------- 1 file changed, 169 insertions(+), 168 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: reference-count client instances The lifetime of struct client instances must be longer than the lifetime of any client resource. This fixes a possible race between fw_device_op_release and transaction completions. It also prepares for new ioctls for isochronous resource management which will involve delayed processing of client resources. Signed-off-by: Stefan Richter Reviewed-by: David Moore --- drivers/firewire/fw-cdev.c | 55 ++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 9 deletions(-) Date: Fri, 2 Jan 2009 12:47:13 +0100 (CET) From: Stefan Richter firewire: cdev: fix documentation of FW_CDEV_IOC_GET_INFO The FW_CDEV_IOC_GET_INFO ioctl looks at client->device->config_rom, not at the local node's config ROM. We could fix the implementation or the documentation. I believe the way how it is currently implemented is more useful than the way how it is currently documented. In fact, libdc1394 uses the ABI already as implemented, not as documented. Hence let's change the documentation. Signed-off-by: Stefan Richter --- include/linux/firewire-cdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sun, 21 Dec 2008 16:39:46 +0100 (CET) From: Stefan Richter firewire: prevent creation of multiple IR DMA contexts for the same channel OHCI-1394 1.1 clause 10.4.3 says: "If more than one IR DMA context specifies receives for packets from the same isochronous channel, the context destination for that channel's packets is undefined." Any userspace client and in the future also kernelspace clients can allocate IR DMA contexts for any channel. We don't want them to interfere with each other, hence it is preferable to return -EBUSY if allocation of a second context for a channel is attempted. Notes: - This limitation is OHCI-1394 specific, therefore its proper place of implementation is down in the low-level driver. - Since the ABI simply maps one userspace iso client context to one hardware iso context, this OHCI-1394 limitation alas requires userspace to implement its own multiplexing of iso reception from the same channel and card to multiple clients when needed. - The limitation is independent of channel allocation at the IRM; the latter is really only important for the initiation of iso transmission but not of iso reception. - We don't need to do the same for IT DMA because OHCI-1394 does not have any ties between IT contexts and channels. Only the voluntary channel allocation protocol via the IRM, globally to the FireWire bus, can ensure proper isochronous transmit behaviour anyway. Signed-off-by: Stefan Richter --- drivers/firewire/fw-iso.c | 3 ++- drivers/firewire/fw-ohci.c | 14 +++++++++++--- drivers/firewire/fw-transaction.h | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) Date: Sun, 21 Dec 2008 16:49:57 +0100 (CET) From: Stefan Richter firewire: cdev: use list_first_entry Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sun, 14 Dec 2008 21:47:36 +0100 (CET) From: Stefan Richter firewire: core: remove unused definitions Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.h | 12 ------------ 1 file changed, 12 deletions(-) Date: Sun, 14 Dec 2008 21:47:04 +0100 (CET) From: Stefan Richter firewire: remove line breaks before function names type function_name(parameters); is nice to look at but was not used consistently. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 68 ++++++------------ drivers/firewire/fw-cdev.c | 88 ++++++++++-------------- drivers/firewire/fw-device.c | 40 ++++------- drivers/firewire/fw-device.h | 3 drivers/firewire/fw-iso.c | 28 +++---- drivers/firewire/fw-ohci.c | 100 ++++++++++++--------------- drivers/firewire/fw-sbp2.c | 57 ++++++--------- drivers/firewire/fw-topology.c | 28 +++---- drivers/firewire/fw-topology.h | 13 +-- drivers/firewire/fw-transaction.c | 92 ++++++++++--------------- drivers/firewire/fw-transaction.h | 109 +++++++++--------------------- 11 files changed, 249 insertions(+), 377 deletions(-) Date: Sun, 14 Dec 2008 21:45:45 +0100 (CET) From: Stefan Richter firewire: standardize a variable name "ret" is the new "retval". Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 44 ++++++++++++------------- drivers/firewire/fw-iso.c | 12 +++---- drivers/firewire/fw-ohci.c | 51 ++++++++++++++---------------- drivers/firewire/fw-transaction.c | 8 ++-- 4 files changed, 57 insertions(+), 58 deletions(-) Date: Sun, 14 Dec 2008 21:45:14 +0100 (CET) From: Stefan Richter firewire: core: remove obsolete assertions This code never changes. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) Date: Sun, 14 Dec 2008 19:21:31 +0100 (CET) From: Stefan Richter firewire: core: remove outdated comment Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) Date: Sun, 14 Dec 2008 19:21:01 +0100 (CET) From: Stefan Richter firewire: cdev: address handler input validation Like before my commit 1415d9189e8c59aa9c77a3bba419dcea062c145f, fw_core_add_address_handler() does not align the address region now. Instead the caller is required to pass valid parameters. Since one of the callers of fw_core_add_address_handler() is the cdev userspace interface, we now check for valid input. If the client is buggy, we give it a hint with -EINVAL. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 5 +++-- drivers/firewire/fw-transaction.c | 27 ++++++++++++++++++--------- 2 files changed, 21 insertions(+), 11 deletions(-) Date: Sun, 21 Dec 2008 16:47:17 +0100 (CET) From: Jay Fenlason firewire: cdev: use an idr rather than a linked list for resources The current code uses a linked list and a counter for storing resources and the corresponding handle numbers. By changing to an idr we can be safe from counter wrap-around giving two resources the same handle. Furthermore, the deallocation ioctls now check whether the resource to be freed is of the intended type. Signed-off-by: Jay Fenlason Some rework by Stefan R: - The idr API documentation says we get an ID within 0...0x7fffffff. Hence we can rest assured that idr handles fit into cdev handles. - Fix some races. Add a client->in_shutdown flag for this purpose. - Add allocation retry to add_client_resource(). - It is possible to use idr_for_each() in fw_device_op_release(). - Fix ioctl_send_response() regression. - Small style changes. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 165 +++++++++++++++++++++++++------------ 1 file changed, 114 insertions(+), 51 deletions(-) Date: Sun, 14 Dec 2008 19:19:23 +0100 (CET) From: Stefan Richter firewire: cdev: fix race of fw_device_op_release with bus reset Unlink the client from the fw_device earlier in order to prevent bus reset events being added to client->event_list during shutdown. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Fri, 5 Dec 2008 22:44:42 +0100 (CET) From: Stefan Richter firewire: cdev: tcodes input validation The behaviour of fw-transaction.c::fw_send_request is ill-defined for any other tcodes than read/ write/ lock request tcodes. Therefore prevent requests with wrong tcodes from entering the transaction layer. Maybe fw_send_request should check them itself, but I am not inclined to change it and fw_fill_request from void-valued functions to ones which return error codes and pass those up. Besides, maybe fw_send_request is going to support one more tcode than ioctl_send_request in the future (TCODE_STREAM_DATA). Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) Date: Fri, 5 Dec 2008 22:43:41 +0100 (CET) From: Stefan Richter firewire: cdev: documentation fixlet Reported-by: Jay Fenlason Signed-off-by: Stefan Richter --- include/linux/firewire-cdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sun, 5 Oct 2008 10:37:11 +0200 (CEST) From: Stefan Richter firewire: convert client_list_lock to mutex So far it is only taken in non-atomic contexts. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 20 ++++++++------------ drivers/firewire/fw-device.c | 3 ++- drivers/firewire/fw-device.h | 7 ++++--- 3 files changed, 14 insertions(+), 16 deletions(-) Date: Fri, 3 Oct 2008 11:19:09 -0400 From: Jay Fenlason firewire: add a client_list_lock This adds a client_list_lock, which only protects the device's client_list, so that future versions of the driver can call code that takes the card->lock while holding the client_list_lock. Adding this lock is much simpler than adding __ versions of all the functions that the future version may need. The one ordering issue is to make sure code never takes the client_list_lock with card->lock held. Since client_list_lock is only used in three places, that isn't hard. Signed-off-by: Jay Fenlason Update fill_bus_reset_event() accordingly. Include linux/spinlock.h. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 28 +++++++++++++--------------- drivers/firewire/fw-device.c | 2 ++ drivers/firewire/fw-device.h | 3 +++ 3 files changed, 18 insertions(+), 15 deletions(-) Date: Tue, 22 Jul 2008 23:23:40 -0700 From: David Moore firewire: Include iso timestamp in headers when header_size > 4 Previously, when an iso context had header_size > 4, the iso header (len/tag/channel/tcode/sy) was passed to userspace followed by quadlets stripped from the payload. This patch changes the behavior: header_size = 8 now passes the header quadlet followed by the timestamp quadlet. When header_size > 8, quadlets are stripped from the payload. The header_size = 4 case remains identical. Since this alters the semantics of the API, the firewire API version needs to be bumped concurrently with this change. This change also refactors the header copying code slightly to be much easier to read. Signed-off-by: David Moore Signed-off-by: Stefan Richter --- drivers/firewire/fw-ohci.c | 73 +++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 38 deletions(-) Date: Thu, 26 Feb 2009 10:32:31 -0800 From: Linus Torvalds Make ieee1394_init a fs-initcall It needs to happen before any firewire driver actually registers itself, and that was previously handled by having the Makefile list the core ieee1394 files before the drivers. But now there are firewire drivers in drivers/media, and the Makefile games aren't enough. So just make ieee1394_init happen earlier in the init sequence, the way all other bus layers already do. Reported-and-tested-by: Ingo Molnar Cc: Stefan Richter Cc: Henrik Kurelid Cc: Mauro Carvalho Chehab Cc: Ben Backx Signed-off-by: Linus Torvalds --- drivers/ieee1394/ieee1394_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Tue, 24 Feb 2009 15:52:49 +0100 (CET) From: Beat Michel Liechti firedtv: dvb_frontend_info for FireDTV S2, fix "frequency limits undefined" error I found that the function fdtv_frontend_init in the file firedtv-fe.c was missing a case for FIREDTV_DVB_S2 which resulted in "frequency limits undefined" errors in syslog. Signed-off-by: Beat Michel Liechti Change by Stefan R: combine it with case case FIREDTV_DVB_S as originally suggested by Beat Michel. This enables FE_CAN_FEC_AUTO also for FireDTV-S2 devices which is possible as long as only DVB-S channels are used. FE_CAN_FEC_AUTO would be wrong for DVB-S2 channels, but those cannot be used yet since the driver is not yet converted to S2API. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-fe.c | 1 + 1 file changed, 1 insertion(+) Date: Mon, 23 Feb 2009 14:21:10 +0100 (CET) From: Stefan Richter firedtv: reinstate debug logging option Henrik Kurelid tells me that FCP debug logging (which I removed during cleanups) is still useful when working on driver issues together with end users. So bring it back in an updated form with only 60% of the original code footprint. Logging can be enabled with # echo -1 > /sys/module/firedtv/parameters/debug 1 instead of -1 enables only FCP header logging, 2 instead of -1 enables only hexdumps of the entire FCP frames. 0 switches logging off again. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-avc.c | 79 +++++++++++++++++++++++ 1 file changed, 79 insertions(+) Date: Fri, 20 Feb 2009 20:54:27 +0100 (CET) From: Stefan Richter firedtv: build fix for INPUT=m and DVB_FIREDTV=y Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Thu, 19 Feb 2009 20:40:39 +0100 From: Stefan Richter firedtv: use msecs_to_jiffies Pointed out by Mauro Carvalho Chehab. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-avc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Date: Mon, 16 Feb 2009 23:42:31 +0100 (CET) From: Stefan Richter ieee1394: remove superfluous assertions hpsb_read, hpsb_write, hpsb_lock are sleeping functions which nobody is in danger to use in atomic context. Besides, in_interrupt does not cover all types of atomic context. Signed-off-by: Stefan Richter --- drivers/ieee1394/ieee1394_transactions.c | 6 ------ 1 file changed, 6 deletions(-) Date: Sun Feb 15 20:50:46 CET 2009 From: Stefan Richter firedtv: some more housekeeping Fix an old checkpatch warning and a new compiler warning. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-ci.c | 2 +- drivers/media/dvb/firewire/firedtv-dvb.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: rename a file once more At the moment, about a third of avc.c is specific to FireDTVs rather than generic AV/C code. Rename it to firedtv-avc.c. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Makefile | 2 drivers/media/dvb/firewire/avc.c | 1235 ----------------------- drivers/media/dvb/firewire/firedtv-avc.c | 1235 +++++++++++++++++++++++ drivers/media/dvb/firewire/firedtv.h | 64 - 4 files changed, 1268 insertions(+), 1268 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: more compact channels backing store Replace struct firedtv_channel { bool active; int pid; } channel[16]; by unsigned long channel_active; u16 channel_pid[16];. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 52 ++++++++++------------- drivers/media/dvb/firewire/firedtv.h | 10 +--- 2 files changed, 27 insertions(+), 35 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: some simplifications c->active was unnecessarily cleared twice. Also, by marking the channel inactive before the for loop, the loop becomes identical with fdtv_channel_collect(). Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: remove a bogus loop This loop is unnecessary because - only active channel[].pid's will be sent to the device, - when a channel is activated, its pid is set to dvbdmxfeed->pid. Perhaps the original code was there because it was initially not fully covered by the fdtv->demux_mutex. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: fix mutex protection fdtv_start_feed() accessed the channel list unsafely. Fully serialize it with itself and fdtv_stop_feed(). Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 80 +++++++++-------------- 1 file changed, 32 insertions(+), 48 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: fix missing braces Original code was: ... case DMX_TS_PES_OTHER: //Dirty fix to keep firesat->channel pid-list up to date for(k=0;k<16;k++){ if(firesat->channel[k].active == 0) firesat->channel[k].pid = dvbdmxfeed->pid; break; } channel = firesat_channel_allocate(firesat); break; default: ... Looks bogus in several respects. For now let's just add braces to the if because that seems to be what the author meant. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: allow build without input subsystem !CONFIG_INPUT is very unlikely on systems on which firedtv is of interest. But we can easily support it. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Kconfig | 5 ++++- drivers/media/dvb/firewire/Makefile | 3 ++- drivers/media/dvb/firewire/firedtv.h | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: replace EXTRA_CFLAGS by ccflags The former are deprecated. The latter can depend on Kconfig variables. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: concentrate ieee1394 dependencies Move the entire interface with drivers/ieee1394 to firedtv-1394.c. Move 1394-independent module initialization code to firedtv-dvb.c. This prepares interfacing with drivers/firewire. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Kconfig | 7 drivers/media/dvb/firewire/Makefile | 10 drivers/media/dvb/firewire/avc.c | 82 +++--- drivers/media/dvb/firewire/firedtv-1394.c | 263 +++++++--------------- drivers/media/dvb/firewire/firedtv-ci.c | 11 drivers/media/dvb/firewire/firedtv-dvb.c | 162 ++++++++++++- drivers/media/dvb/firewire/firedtv-fe.c | 10 drivers/media/dvb/firewire/firedtv.h | 60 +++-- 8 files changed, 332 insertions(+), 273 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: amend Kconfig menu prompt Signed-off-by: Stefan Richter --- drivers/media/dvb/Kconfig | 2 ++ drivers/media/dvb/firewire/Kconfig | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: remove kernel version compatibility macro Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 7 ++++--- drivers/media/dvb/firewire/firedtv.h | 8 -------- 2 files changed, 4 insertions(+), 11 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: combine header files avc.h and firedtv-*.h are small and currently not shared with other drivers, hence concatenate them all into firedtv.h. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 2 drivers/media/dvb/firewire/avc.h | 52 ---------------------- drivers/media/dvb/firewire/firedtv-1394.c | 3 - drivers/media/dvb/firewire/firedtv-ci.c | 2 drivers/media/dvb/firewire/firedtv-ci.h | 9 --- drivers/media/dvb/firewire/firedtv-dvb.c | 2 drivers/media/dvb/firewire/firedtv-fe.c | 1 drivers/media/dvb/firewire/firedtv-rc.c | 1 drivers/media/dvb/firewire/firedtv-rc.h | 11 ---- drivers/media/dvb/firewire/firedtv.h | 33 +++++++++++++ 10 files changed, 33 insertions(+), 83 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: misc style touch-ups Standardize on lower-case hexadecimal constants. Adjust whitespace. Omit unnecessary pointer type casts and an unnecessary list head initialization. Use dev_printk. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 32 +++++----- drivers/media/dvb/firewire/firedtv-1394.c | 35 +++-------- drivers/media/dvb/firewire/firedtv-ci.c | 29 ++++----- drivers/media/dvb/firewire/firedtv-dvb.c | 65 ++++++++++------------ drivers/media/dvb/firewire/firedtv-fe.c | 27 +++++---- 5 files changed, 85 insertions(+), 103 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc, ci: remove unused constants Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 14 ++-- drivers/media/dvb/firewire/firedtv-ci.c | 17 +++-- drivers/media/dvb/firewire/firedtv.h | 81 ------------------------ 3 files changed, 19 insertions(+), 93 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc: remove bitfields from read descriptor response operands Don't use bitfields in struct types of on-the-wire data. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 48 +++++++++- drivers/media/dvb/firewire/avc.h | 106 ------------------------ drivers/media/dvb/firewire/firedtv-ci.c | 46 +++++----- drivers/media/dvb/firewire/firedtv-fe.c | 26 ++--- drivers/media/dvb/firewire/firedtv.h | 29 ++++++ 5 files changed, 107 insertions(+), 148 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc: remove bitfields from DSD command operands Don't use bitfields in struct types of on-the-wire data. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 109 ++++++++++++++----------------- drivers/media/dvb/firewire/avc.h | 74 --------------------- 2 files changed, 52 insertions(+), 131 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc: header file cleanup Remove unused constants and declarations. Move privately used constants into .c files. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 6 +- drivers/media/dvb/firewire/avc.h | 67 ------------------------ drivers/media/dvb/firewire/firedtv-fe.c | 2 3 files changed, 6 insertions(+), 69 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc: remove bitfields from FCP frame types Don't use bitfields in struct types of on-the-wire data. Also move many privately used constants from avc.h to avc.c and remove some unused constants. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 210 +++++++++++++----------- drivers/media/dvb/firewire/avc.h | 134 --------------- drivers/media/dvb/firewire/firedtv-fe.c | 2 3 files changed, 123 insertions(+), 223 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: avc: fix offset in avc_tuner_get_ts The parentheses were wrong. It didn't matter though because this code only writes a 0 into an area which is already initialized to 0. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: avc: reduce stack usage, remove two typedefs It is safe to share a memory buffer for command frame and response frame because the response data come in after the command frame was last used. Even less stack would be required if only the actual required frame size instead of the entire FCP register size was allocated. Also, rename the defined types AVCCmdFrm and AVCRspFrm to struct avc_command_frame and struct avc_response_frame. TODO: Remove the bitfields in these types. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 1064 +++++++++++++++---------------- drivers/media/dvb/firewire/avc.h | 24 2 files changed, 532 insertions(+), 556 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: cmp: move code to avc Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Makefile | 1 drivers/media/dvb/firewire/avc.c | 147 ++++++++++++++++++ drivers/media/dvb/firewire/avc.h | 3 drivers/media/dvb/firewire/cmp.c | 171 ---------------------- drivers/media/dvb/firewire/cmp.h | 9 - drivers/media/dvb/firewire/firedtv-1394.c | 1 drivers/media/dvb/firewire/firedtv-fe.c | 1 7 files changed, 150 insertions(+), 183 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: iso: move code to firedtv-1394 Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Makefile | 1 drivers/media/dvb/firewire/firedtv-1394.c | 96 ++++++++++++++++++- drivers/media/dvb/firewire/firedtv-iso.c | 110 ---------------------- drivers/media/dvb/firewire/firedtv.h | 5 - 4 files changed, 93 insertions(+), 119 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: iso: remove unnecessary struct type definitions Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-iso.c | 17 ++++++----- drivers/media/dvb/firewire/firedtv.h | 34 ----------------------- 2 files changed, 10 insertions(+), 41 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: iso: style changes and fixlets Add cleanup after failure in setup_iso_channel. Replace printk() by dv_err(). Decrease indentation level in rawiso_activity_cb(). Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-iso.c | 136 +++++++++++------------ 1 file changed, 66 insertions(+), 70 deletions(-) Date: Sat, 17 Jan 2009 14:47:34 +0100 From: Rambaldi firedtv: rename variables and functions from firesat to firedtv Signed-off-by: Rambaldi Additional changes by Stefan Richter: Renamed struct firedtv *firedtv to struct firedtv *fdtv and firedtv_foo_bar() to fdtv_foo_bar() for brevity. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 188 ++++++++++----------- drivers/media/dvb/firewire/avc.h | 34 +-- drivers/media/dvb/firewire/cmp.c | 40 ++-- drivers/media/dvb/firewire/cmp.h | 6 drivers/media/dvb/firewire/firedtv-1394.c | 190 +++++++++++----------- drivers/media/dvb/firewire/firedtv-ci.c | 106 ++++++------ drivers/media/dvb/firewire/firedtv-ci.h | 6 drivers/media/dvb/firewire/firedtv-dvb.c | 142 ++++++++-------- drivers/media/dvb/firewire/firedtv-fe.c | 124 +++++++------- drivers/media/dvb/firewire/firedtv-iso.c | 40 ++-- drivers/media/dvb/firewire/firedtv-rc.c | 18 +- drivers/media/dvb/firewire/firedtv-rc.h | 8 drivers/media/dvb/firewire/firedtv.h | 32 +-- 13 files changed, 467 insertions(+), 467 deletions(-) Date: Sat, 17 Jan 2009 13:07:44 +0100 From: Rambaldi firedtv: rename files from firesat to firedtv Signed-off-by: Rambaldi Additional changes by Stefan Richter: Name the directory "firewire" instead of "firedtv". Standardize on "-" instead of "_" in file names, because that's what drivers/firewire/ and drivers/media/dvb/dvb-usb/ use too. Build fix. Signed-off-by: Stefan Richter --- drivers/media/dvb/Kconfig | 2 drivers/media/dvb/Makefile | 2 drivers/media/dvb/firesat/Kconfig | 12 drivers/media/dvb/firesat/Makefile | 13 drivers/media/dvb/firesat/avc_api.c | 1051 ---------------------- drivers/media/dvb/firesat/avc_api.h | 432 --------- drivers/media/dvb/firesat/cmp.c | 171 --- drivers/media/dvb/firesat/cmp.h | 9 drivers/media/dvb/firesat/firesat-ci.c | 261 ----- drivers/media/dvb/firesat/firesat-ci.h | 9 drivers/media/dvb/firesat/firesat-rc.c | 191 --- drivers/media/dvb/firesat/firesat-rc.h | 11 drivers/media/dvb/firesat/firesat.h | 227 ---- drivers/media/dvb/firesat/firesat_1394.c | 291 ------ drivers/media/dvb/firesat/firesat_dvb.c | 276 ----- drivers/media/dvb/firesat/firesat_fe.c | 245 ----- drivers/media/dvb/firesat/firesat_iso.c | 111 -- drivers/media/dvb/firewire/Kconfig | 12 drivers/media/dvb/firewire/Makefile | 13 drivers/media/dvb/firewire/avc.c | 1051 ++++++++++++++++++++++ drivers/media/dvb/firewire/avc.h | 432 +++++++++ drivers/media/dvb/firewire/cmp.c | 171 +++ drivers/media/dvb/firewire/cmp.h | 9 drivers/media/dvb/firewire/firedtv-1394.c | 291 ++++++ drivers/media/dvb/firewire/firedtv-ci.c | 261 +++++ drivers/media/dvb/firewire/firedtv-ci.h | 9 drivers/media/dvb/firewire/firedtv-dvb.c | 276 +++++ drivers/media/dvb/firewire/firedtv-fe.c | 245 +++++ drivers/media/dvb/firewire/firedtv-iso.c | 111 ++ drivers/media/dvb/firewire/firedtv-rc.c | 191 +++ drivers/media/dvb/firewire/firedtv-rc.h | 11 drivers/media/dvb/firewire/firedtv.h | 227 ++++ 32 files changed, 3312 insertions(+), 3312 deletions(-) create mode 100644 drivers/media/dvb/firewire/Kconfig create mode 100644 drivers/media/dvb/firewire/Makefile create mode 100644 drivers/media/dvb/firewire/avc.c create mode 100644 drivers/media/dvb/firewire/avc.h create mode 100644 drivers/media/dvb/firewire/cmp.c create mode 100644 drivers/media/dvb/firewire/cmp.h create mode 100644 drivers/media/dvb/firewire/firedtv-ci.c create mode 100644 drivers/media/dvb/firewire/firedtv-ci.h create mode 100644 drivers/media/dvb/firewire/firedtv-rc.c create mode 100644 drivers/media/dvb/firewire/firedtv-rc.h create mode 100644 drivers/media/dvb/firewire/firedtv.h create mode 100644 drivers/media/dvb/firewire/firedtv-1394.c create mode 100644 drivers/media/dvb/firewire/firedtv-dvb.c create mode 100644 drivers/media/dvb/firewire/firedtv-fe.c create mode 100644 drivers/media/dvb/firewire/firedtv-iso.c delete mode 100644 drivers/media/dvb/firesat/Kconfig delete mode 100644 drivers/media/dvb/firesat/Makefile delete mode 100644 drivers/media/dvb/firesat/avc_api.c delete mode 100644 drivers/media/dvb/firesat/avc_api.h delete mode 100644 drivers/media/dvb/firesat/cmp.c delete mode 100644 drivers/media/dvb/firesat/cmp.h delete mode 100644 drivers/media/dvb/firesat/firesat-ci.c delete mode 100644 drivers/media/dvb/firesat/firesat-ci.h delete mode 100644 drivers/media/dvb/firesat/firesat-rc.c delete mode 100644 drivers/media/dvb/firesat/firesat-rc.h delete mode 100644 drivers/media/dvb/firesat/firesat.h delete mode 100644 drivers/media/dvb/firesat/firesat_1394.c delete mode 100644 drivers/media/dvb/firesat/firesat_dvb.c delete mode 100644 drivers/media/dvb/firesat/firesat_fe.c delete mode 100644 drivers/media/dvb/firesat/firesat_iso.c Date: Wed, 14 Jan 2009 23:01:35 +0100 (CET) From: Stefan Richter firedtv: add missing dependency on CONFIG_INPUT Fix build error \ Reported-by: Randy Dunlap Perhaps we should make the remote control part of firedtv modular so that the driver can be built without input support. But it's not very likely that anybody would have use for such a constellation. Signed-off-by: Stefan Richter --- I need to fold it into "DVB: add firesat driver" before I submit the driver for mainline merge. drivers/media/dvb/firesat/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Thu, 25 Dec 2008 15:34:25 +0100 (CET) From: Julia Lawall firedtv: Use DEFINE_SPINLOCK SPIN_LOCK_UNLOCKED is deprecated. The following makes the change suggested in Documentation/spinlocks.txt Signed-off-by: Julia Lawall Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat_1394.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Mon, 15 Dec 2008 08:17:12 +0100 From: Henrik Kurelid firedtv: fix registration - adapter number could only be zero There was a bug causing the initialization to fail if adapter number was greater than zero. The adapter was however registered which caused the driver to oops the second time initialization was tried. Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat_dvb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Fri, 5 Dec 2008 10:00:16 +0100 From: Henrik Kurelid firedtv: use length_field() of PMT as length Parsed and used the length_field() of the PMT message instead of using the length field of the message struct, which does not seem to be filled correctly by e.g. MythTV. Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat-ci.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) Date: Thu, 4 Dec 2008 22:40:52 +0100 From: Henrik Kurelid firedtv: fix returned struct for ca_info The SystemId of the ca_info message was filled with garbage. It now returns what the card returns. Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: increase FCP frame length for DVB-S2 tune QSPK The last three bytes didn't go out to the wire. Effect of the fix not yet tested. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: replace mdelay by msleep These functions can sleep (and in fact sleep for the duration of a whole FCP transaction). Hence msleep is more appropriate here. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: trivial reorganization in avc_api Reduce nesting level by factoring code out of avc_tuner_dsd() into helper functions. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 519 +++++++++++++--------------- 1 file changed, 257 insertions(+), 262 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: trivial cleanups in avc_api Use dev_err(), no CamelCase function names, adjust comment style, put #if 0 around unused code and add FIXME comments, standardize on lower-case hexadecimal constants, use ALIGN() for some frame length calculations, make a local function static... The code which writes FCP command frames and reads FCP response frames is not yet brought into canonical kernel coding style because this involves changes of typedefs (on-the-wire bitfields). Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 206 +++++++++++------------ drivers/media/dvb/firesat/avc_api.h | 31 +-- drivers/media/dvb/firesat/firesat-ci.c | 8 drivers/media/dvb/firesat/firesat_1394.c | 6 drivers/media/dvb/firesat/firesat_dvb.c | 13 - drivers/media/dvb/firesat/firesat_fe.c | 46 ++--- 6 files changed, 146 insertions(+), 164 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: don't retry oPCR updates endlessly In the theoretical case that the target node wasn't handling the lock transactions as expected or there was continued interference by other initiating nodes, these functions wouldn't return for ages. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/cmp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs Use macros/ inline functions/ standard byte order accessors to read and write oPCR register values (big endian bitfields, on-the-wire data). The new code may not be the ultimate optimum, but it doesn't occur in a hot path. This fixes the CMP code for big endian CPUs. So far I tested it only on a little endian CPU though. For now, include instead of because drivers/ieee1394/*.h also include the former. I will fix this in drivers/ieee1394 and firedtv later. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/cmp.c | 70 +++++++++++++++++--------------- 1 file changed, 38 insertions(+), 32 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: trivial cleanups in cmp Reduce nesting level by means of early exit and goto. Remove obsolete includes, use dev_err(), no CamelCase function names... Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/cmp.c | 199 +++++++++-------------- drivers/media/dvb/firesat/cmp.h | 6 drivers/media/dvb/firesat/firesat_1394.c | 4 drivers/media/dvb/firesat/firesat_fe.c | 6 4 files changed, 93 insertions(+), 122 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: trivial cleanups in firesat-ci Whitespace, variable names, comment style... Also, use dvb_generic_open() and dvb_generic_release() directly as our hooks in struct file_operations because firedtv's wrappers merely called these generic functions. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat-ci.c | 162 ++++++++++--------------- 1 file changed, 66 insertions(+), 96 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: remove CA debug code This looks like it is not necessary to have available for endusers who cannot patch kernels for bug reporting and tests of fixes. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat-ci.c | 67 ------------------------- 1 file changed, 67 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: remove AV/C debug code This looks like it is not necessary to have available for endusers who cannot patch kernels for bug reporting and tests of fixes. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 171 ---------------------------- 1 file changed, 6 insertions(+), 165 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: remove various debug code Most of this was already commented out. And that which wasn't is not relevant in normal use. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/cmp.c | 11 +---------- drivers/media/dvb/firesat/firesat_1394.c | 4 ---- drivers/media/dvb/firesat/firesat_dvb.c | 4 ---- drivers/media/dvb/firesat/firesat_iso.c | 8 +------- 4 files changed, 2 insertions(+), 25 deletions(-) Date: Mon, 29 Sep 2008 19:22:48 +0200 (CEST) From: Stefan Richter firedtv: register input device as child of a FireWire device Instead of one virtual input device which exists for the whole lifetime of the driver and receives events from all connected FireDTVs, register one input device for each firedtv device. These input devices will show up as children of the respective firedtv devices in the sysfs hierarchy. However, the implementation falls short because of a bug in userspace: Udev's path_id script gets stuck with 100% CPU utilization, maybe because of an assumption about the maximum ieee1394 device hierarchy depth. To avoid this bug, we use the fw-host device instead of the proper unit_directory device as parent of the input device. There is hope that the port to the new firewire stack won't be inhibited by this userspace bug because there are no fw-host devices there. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 4 +- drivers/media/dvb/firesat/firesat-rc.c | 42 +++++++++++++++-------- drivers/media/dvb/firesat/firesat-rc.h | 9 +++- drivers/media/dvb/firesat/firesat.h | 5 +- drivers/media/dvb/firesat/firesat_1394.c | 26 ++++++-------- 5 files changed, 52 insertions(+), 34 deletions(-) Date: Mon, 29 Sep 2008 19:21:52 +0200 (CEST) From: Stefan Richter firedtv: fix string comparison and a few sparse warnings Sparse found a bug: while ((kv_buf + kv_len - 1) == '\0') should have been while (kv_buf[kv_len - 1] == '\0') We fix it by a better implementation without a temporary copy. Also fix sparse warnings of 0 instead of NULL and signedness mismatches. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 14 +++++++------- drivers/media/dvb/firesat/avc_api.h | 6 +++--- drivers/media/dvb/firesat/firesat_1394.c | 23 +++++++---------------- drivers/media/dvb/firesat/firesat_dvb.c | 2 +- 4 files changed, 18 insertions(+), 27 deletions(-) Date: Mon, 29 Sep 2008 19:21:20 +0200 (CEST) From: Stefan Richter firedtv: remove unused struct members and redefine an int as a bool. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat.h | 7 +------ drivers/media/dvb/firesat/firesat_dvb.c | 20 ++++++++------------ 2 files changed, 9 insertions(+), 18 deletions(-) Date: Mon, 29 Sep 2008 19:20:36 +0200 (CEST) From: Stefan Richter firedtv: fix initialization of dvb_frontend.ops There was a NULL pointer reference if no dvb_frontend_info was found. Also, don't directly assign struct typed values to struct typed variables. Instead write out assignments to individual strcut members. This reduces module size by about 1 kB. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat.h | 34 ++-- drivers/media/dvb/firesat/firesat_dvb.c | 3 drivers/media/dvb/firesat/firesat_fe.c | 167 ++++++++++-------------- 3 files changed, 91 insertions(+), 113 deletions(-) Date: Mon, 29 Sep 2008 19:19:41 +0200 (CEST) From: Stefan Richter firedtv: remove unused dual subunit code from initialization No FireDTVs with more than one subunit exists, hence simplify the initialization for the special case of one subunit. The driver was able to check for more than one subunit but was broken for more than two subunits. While we are at it, add several missing cleanups after failure, and include a few dynamically allocated structures diretly into struct firesat instead of allocating them separately. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 36 --- drivers/media/dvb/firesat/avc_api.h | 1 drivers/media/dvb/firesat/firesat-ci.c | 15 - drivers/media/dvb/firesat/firesat-ci.h | 2 drivers/media/dvb/firesat/firesat.h | 18 - drivers/media/dvb/firesat/firesat_1394.c | 214 ++++++++--------------- drivers/media/dvb/firesat/firesat_dvb.c | 166 +++++++---------- drivers/media/dvb/firesat/firesat_fe.c | 22 -- 8 files changed, 171 insertions(+), 303 deletions(-) Date: Mon, 29 Sep 2008 19:19:08 +0200 (CEST) From: Stefan Richter firedtv: add vendor_id and version to driver match table Now that nodemgr was enhanced to match against the root directory's vendor ID if there isn't one in the unit directory, use this to prevent firedtv to be bound to wrong devices by accident. Also add the AV/C software version ID to the match flags for completeness; specifier ID and software only make sense as a pair. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat_1394.c | 52 ++++++++++++++--------- 1 file changed, 33 insertions(+), 19 deletions(-) Date: Mon, 29 Sep 2008 19:18:30 +0200 (CEST) From: Stefan Richter firedtv: use hpsb_node_read(), _write(), _lock() because they are simpler and treat the node generation more correctly. While we are at it, clean up and simplify surrounding code. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 133 +++++++---------------- drivers/media/dvb/firesat/cmp.c | 7 - drivers/media/dvb/firesat/firesat.h | 10 - drivers/media/dvb/firesat/firesat_1394.c | 24 +--- drivers/media/dvb/firesat/firesat_iso.c | 3 5 files changed, 58 insertions(+), 119 deletions(-) Date: Wed, 27 Aug 2008 01:24:25 +0200 (CEST) From: Stefan Richter ieee1394: inherit ud vendor_id from node vendor_id While Module_Vendor_ID in the configuration ROM's root directory is mandatory, there often aren't vendor IDs in unit directories. This affects the new firedtv driver which is meant to be auto-loaded and matched only for vendor-specific devices. We now always copy ne->vendor_id into ud->vendor_id before we scan a unit directory (and fill in a possibly present vendor ID from there). This way, the root directory's vendor ID is used as fallback in the "uevent" environment for modprobe'ing per module alias when a node was plugged in, and in the driver match routine when protocol drivers are bound to unit directories. It will however not be used as sysfs attribute of a unit directory device. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 3 +++ 1 file changed, 3 insertions(+) Date: Wed, 27 Aug 2008 13:40:02 +0200 From: Stefan Richter ieee1394: add hpsb_node_read() and hpsb_node_lock() These will be used by the firedtv driver. Like hpsb_node_write() they are much better APIs for high-level drivers than hpsb_write() and its siblings --- easier to use correctly and also terser. Unlike hspb_node_write(), the two new functions will only be used by one call site. Hence make them static inline instead of exported symbols. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) Date: Wed, 27 Aug 2008 01:18:32 +0200 (CEST) From: Stefan Richter ieee1394: use correct barrier types between accesses of nodeid and generation A compiler barrier (explicit on the read side, implicit on the write side) is not quite enough for what has to be accomplished here. Use hardware memory barriers on systems which need them. (Of course a full fix of generation handling would require much more than this. The ieee1394 core's bus generation counter had to be tied to the controller's bus generation counter; cf. Kristian's stack. It's just that I have other current business with the code around these barrier()s, so why not do at least this small fix.) Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Date: Tue, 26 Aug 2008 00:17:30 +0200 (CEST) From: Stefan Richter firedtv: fix remote control input and update the scancode-to-keycode mapping to a current model. Per default, various media key keycodes are emitted which closely match what is printed on the remote. Userland can modify the mapping by means of evdev ioctls. (Not tested.) The old scancode-to-keycode mapping is left in the driver but cannot be modified by ioctls. This preserves status quo for old remotes. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 31 ++--- drivers/media/dvb/firesat/firesat-rc.c | 137 ++++++++++++++++++----- drivers/media/dvb/firesat/firesat-rc.h | 6 - drivers/media/dvb/firesat/firesat_1394.c | 25 ++-- 4 files changed, 139 insertions(+), 60 deletions(-) Date: Tue, 26 Aug 2008 00:11:28 +0200 (CEST) From: Stefan Richter firedtv: replace tasklet by workqueue job Non-atomic context is a lot nicer to work with. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 57 ++++------------------- drivers/media/dvb/firesat/avc_api.h | 1 drivers/media/dvb/firesat/firesat.h | 4 - drivers/media/dvb/firesat/firesat_1394.c | 4 + 4 files changed, 18 insertions(+), 48 deletions(-) Date: Sun, 24 Aug 2008 23:30:00 +0200 (CEST) From: Stefan Richter firedtv: move some code back to ieee1394 core Partially reverts "ieee1394: remove unused code" of Linux 2.6.25. Signed-off-by: Stefan Richter --- drivers/ieee1394/ieee1394_core.c | 1 drivers/ieee1394/ieee1394_transactions.c | 29 ++++++++++ drivers/ieee1394/ieee1394_transactions.h | 2 drivers/media/dvb/firesat/cmp.c | 61 +---------------------- 4 files changed, 35 insertions(+), 58 deletions(-) Date: Sun, 24 Aug 2008 23:29:30 +0200 (CEST) From: Stefan Richter firedtv: replace semaphore by mutex firesat->avc_sem and ->demux_sem have been used exactly like a mutex. The only exception is the schedule_remotecontrol tasklet which did a down_trylock in atomic context. This is not possible with mutex_trylock; however the whole remote control related code is non-functional anyway at the moment. This should be fixed eventually, probably by turning the tasklet into a worqueue job. Convert everything else from semaphore to mutex. Also rewrite a few of the affected functions to unlock the mutex at a single exit point, instead of in several branches. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 11 +++- drivers/media/dvb/firesat/cmp.c | 27 +++++++---- drivers/media/dvb/firesat/firesat.h | 11 +--- drivers/media/dvb/firesat/firesat_1394.c | 5 +- drivers/media/dvb/firesat/firesat_dvb.c | 54 +++++++++-------------- 5 files changed, 55 insertions(+), 53 deletions(-) Date: Sun, 24 Aug 2008 23:28:45 +0200 (CEST) From: Stefan Richter firedtv: some header cleanups Unify #ifndef/#define/#endif guards against multiple inclusion. Drop extern keyword from function declarations. Remove #include's into header files where struct declarations suffice. Remove unused ohci1394 interface and related unused ieee1394 interfaces. Add a few missing #include's and remove a few apparently obsolete ones. Sort them alphabetically. Signed-off-by: Stefan Richter --- drivers/ieee1394/dma.h | 1 drivers/ieee1394/iso.h | 1 drivers/media/dvb/firesat/avc_api.c | 13 ++- drivers/media/dvb/firesat/avc_api.h | 69 +++++++++--------- drivers/media/dvb/firesat/cmp.c | 15 ++-- drivers/media/dvb/firesat/cmp.h | 14 ++- drivers/media/dvb/firesat/firesat-ci.c | 11 +-- drivers/media/dvb/firesat/firesat-ci.h | 8 +- drivers/media/dvb/firesat/firesat-rc.c | 5 - drivers/media/dvb/firesat/firesat-rc.h | 13 +-- drivers/media/dvb/firesat/firesat.h | 48 +++++++------ drivers/media/dvb/firesat/firesat_1394.c | 84 ++++++----------------- drivers/media/dvb/firesat/firesat_dvb.c | 21 +---- drivers/media/dvb/firesat/firesat_fe.c | 21 +---- drivers/media/dvb/firesat/firesat_iso.c | 10 ++ 15 files changed, 160 insertions(+), 174 deletions(-) Date: Sun, 24 Aug 2008 23:27:45 +0200 (CEST) From: Stefan Richter firedtv: nicer registration message and some initialization fixes Print the correct name in dvb_register_adapter(). While we are at it, replace two switch cascades by one for loop, remove a superfluous member of struct firesat and of two unused arguments of AVCIdentifySubunit(), and fix bogus kfree's in firesat_dvbdev_init(). Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 5 - drivers/media/dvb/firesat/avc_api.h | 2 drivers/media/dvb/firesat/firesat.h | 11 ++- drivers/media/dvb/firesat/firesat_1394.c | 30 +++++----- drivers/media/dvb/firesat/firesat_dvb.c | 68 ++++------------------- drivers/media/dvb/firesat/firesat_fe.c | 8 -- 6 files changed, 40 insertions(+), 84 deletions(-) Date: Tue, 26 Aug 2008 14:24:17 +0200 (CEST) From: Stefan Richter firesat: rename to firedtv Suggested by Andreas Monitzer. Besides DVB-S/-S2 receivers, the driver also supports DVB-C and DVB-T receivers, hence the previous project name is too narrow now. Not yet done: Rename source directory, files, types, variables... Signed-off-by: Stefan Richter --- drivers/media/dvb/Makefile | 2 +- drivers/media/dvb/firesat/Kconfig | 13 +++++++------ drivers/media/dvb/firesat/Makefile | 4 ++-- drivers/media/dvb/firesat/avc_api.c | 2 +- drivers/media/dvb/firesat/cmp.c | 2 +- drivers/media/dvb/firesat/firesat-ci.c | 2 +- drivers/media/dvb/firesat/firesat-rc.c | 2 +- drivers/media/dvb/firesat/firesat.h | 2 +- drivers/media/dvb/firesat/firesat_1394.c | 16 ++++++++-------- drivers/media/dvb/firesat/firesat_dvb.c | 2 +- drivers/media/dvb/firesat/firesat_fe.c | 8 ++++---- 11 files changed, 28 insertions(+), 27 deletions(-) Date: Sun, 24 Aug 2008 23:26:23 +0200 (CEST) From: Stefan Richter firesat: add missing copyright notes Reported by Andreas Monitzer and Christian Dolzer. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 6 +-- drivers/media/dvb/firesat/avc_api.h | 39 +++++++++-------------- drivers/media/dvb/firesat/cmp.c | 4 +- drivers/media/dvb/firesat/firesat-ci.c | 3 + drivers/media/dvb/firesat/firesat-rc.c | 11 ++++++ drivers/media/dvb/firesat/firesat.h | 4 +- drivers/media/dvb/firesat/firesat_1394.c | 6 +-- drivers/media/dvb/firesat/firesat_dvb.c | 4 +- drivers/media/dvb/firesat/firesat_fe.c | 4 +- drivers/media/dvb/firesat/firesat_iso.c | 2 - 10 files changed, 44 insertions(+), 39 deletions(-) Date: Sun, 24 Aug 2008 15:20:07 +0200 From: Henrik Kurelid firesat: avc resend - Add resending of AVC message to the card if no answer is received - Replace the homebrewed event_wait function with a standard wait queue - Clean up of log/error messages - Increase debug level of avc communication Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 171 ++++++++++++----------- drivers/media/dvb/firesat/firesat.h | 1 drivers/media/dvb/firesat/firesat_1394.c | 1 3 files changed, 94 insertions(+), 79 deletions(-) Date: Fri, 1 Aug 2008 10:00:45 +0200 (CEST) From: Henrik Kurelid firesat: update isochronous interface, add CI support I have finally managed to get the CI support for the card working. The implementation is a bare minimum to get encrypted channels to work in kaffeine. It works fine with my T/CI card. Now and then I get an AVC timeout and have to retune a channel in order to get it to work. Once the CAM seemed to hang so I needed to remove and insert it again. I.e. there are a number of glitches. The latest version contains the following changes: - Implemented the new hpsb iso interface so that data can be received from the card - Reduced some timers for demux setup which caused scanning to timeout - Added possibility to unload driver - Added support for getting C/N ratio - Added two debug parameters to the driver; ca_debug and avc_comm_debug. - Added CI support that works for me in kaffeine - Started working on CI MMI support. It now supports: o Enter menu o Receiving MMI objects - Added support for 64-bit platforms - Corrected DVB-C modulations problems Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter (rebased, whitespace) --- drivers/media/dvb/firesat/Makefile | 1 drivers/media/dvb/firesat/avc_api.c | 768 ++++++++++++++++++----- drivers/media/dvb/firesat/avc_api.h | 296 +++++--- drivers/media/dvb/firesat/cmp.c | 44 - drivers/media/dvb/firesat/firesat-ci.c | 342 ++++++++-- drivers/media/dvb/firesat/firesat.h | 174 ++++- drivers/media/dvb/firesat/firesat_1394.c | 123 --- drivers/media/dvb/firesat/firesat_dvb.c | 49 - drivers/media/dvb/firesat/firesat_fe.c | 80 +- drivers/media/dvb/firesat/firesat_iso.c | 106 +++ 10 files changed, 1488 insertions(+), 495 deletions(-) Date: Sat, 09 Aug 2008 14:35:55 +0200 From: Ben Backx firesat: add DVB-S support for DVB-S2 devices ...so S2 owners now can at least watch DVB-S channels in linux. Signed-off-by: Ben Backx Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 6 ++++++ 1 file changed, 6 insertions(+) Date: Sun, 22 Jun 2008 16:00:53 +0200 From: Ben Backx firesat: fix DVB-S2 device recognition This only makes sure that a DVB-S2 device is really recognized as a S2, nothing else is added yet. It's using the string containing the model that is stored in the configuration ROM, the older version was using some hardware revision dependent part of the ROM. Signed-off-by: Ben Backx Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 17 ------------- drivers/media/dvb/firesat/firesat.h | 3 +- drivers/media/dvb/firesat/firesat_1394.c | 28 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 17 deletions(-) Date: Thu, 6 Mar 2008 21:30:23 -0800 From: Greg Kroah-Hartman DVB: add firesat driver Original code written by Christian Dolzer Cleaned up by Greg. Major cleanup and reorg by Manu Abraham Additions also by Ben Backx Cc: Christian Dolzer Cc: Andreas Monitzer Cc: Manu Abraham Cc: Fabio De Lorenzo Cc: Robert Berger Signed-off-by: Ben Backx Signed-off-by: Greg Kroah-Hartman Signed-off-by: Stefan Richter (tweaked dvb/Makefile) --- drivers/media/dvb/Kconfig | 2 drivers/media/dvb/Makefile | 2 drivers/media/dvb/firesat/Kconfig | 11 drivers/media/dvb/firesat/Makefile | 12 drivers/media/dvb/firesat/avc_api.c | 848 +++++++++++++++++++++++ drivers/media/dvb/firesat/avc_api.h | 381 ++++++++++ drivers/media/dvb/firesat/cmp.c | 230 ++++++ drivers/media/dvb/firesat/cmp.h | 9 drivers/media/dvb/firesat/firesat-ci.c | 95 ++ drivers/media/dvb/firesat/firesat-ci.h | 9 drivers/media/dvb/firesat/firesat-rc.c | 84 ++ drivers/media/dvb/firesat/firesat-rc.h | 9 drivers/media/dvb/firesat/firesat.h | 85 ++ drivers/media/dvb/firesat/firesat_1394.c | 468 ++++++++++++ drivers/media/dvb/firesat/firesat_dvb.c | 350 +++++++++ drivers/media/dvb/firesat/firesat_fe.c | 263 +++++++ 16 files changed, 2858 insertions(+) Date: Tue, 3 Feb 2009 17:54:31 +0100 (CET) From: Stefan Richter ieee1394: dv1394: move deprecation message from module init to file open 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 --- drivers/ieee1394/dv1394.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Sun, 1 Feb 2009 01:29:35 -0800 (PST) From: Petr Vandrovec firewire: core: Remove card from list of cards when enable fails Signed-off-by: Petr Vandrovec After a controller initialization failure, addition of another card got stuck due to card_list corruption. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter firewire: sbp2: define some magic numbers as macros Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter firewire: sbp2: fix payload limit at S1600 and S3200 1394-2008 clause 16.3.4.1 (1394b-2002 clause 16.3.1.1) defines tighter limits than 1394-2008 clause 6.2.2.3 (1394a-2000 clause 6.2.2.3). Our previously too large limit doesn't matter though if the controller reports its max_receive correctly. Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter ieee1394: sbp2: don't assume zero model_id or firmware_revision if there is none This makes sbp2 behave more like firewire-sbp2 which reports 0xff000000 as immediate value if there are no unit directory entries for model_id or firmware_revision. It does not reduce matches with the currently existing quirks table; the only zero entry there is for a device which actually does have a zero model_id. It only changes how model_id and firmware_revision are logged if they are missing. Other functionally unrelated changes: The model_id member of quirks list entries is renamed to model; the value (but not the effect) of SBP2_ROM_VALUE_WILDCARD is changed. Now this part of the source is identical with firewire-sbp2 for easier maintenance. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter ieee1394: sbp2: fix payload limit at S1600 and S3200 1394-2008 clause 16.3.4.1 (1394b-2002 clause 16.3.1.1) defines tighter limits than 1394-2008 clause 6.2.2.3 (1394a-2000 clause 6.2.2.3). Our previously too large limit doesn't matter though if the controller reports its max_receive correctly. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Mon, 19 Jan 2009 19:20:31 +0100 (CET) From: Stefan Richter ieee1394: sbp2: update a help string Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Mon, 19 Jan 2009 19:19:55 +0100 (CET) From: Stefan Richter ieee1394: support for speeds greater than S800 The hard-wired configuration of the top speed (until now S800) was unnecessary, remove it. If the local link layer controller supports S1600 or S3200, we now assume this speed for all present 1394b PHYs (except if they are behind 1394a repeaters) until nodemgr figured out the actual speed while fetching the config ROM. Signed-off-by: Stefan Richter --- drivers/ieee1394/ieee1394.h | 4 +--- drivers/ieee1394/ieee1394_core.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) Date: Sat, 24 Jan 2009 20:35:38 +0100 (CET) From: Stefan Richter firewire: core: optimize card shutdown This fixes a regression by "firewire: keep highlevel drivers attached during brief connection loss": There were 2 seconds unnecessary waiting added to the shutdown procedure of each controller. We use card->link as status flag to signal the device handler that there is no use to wait for a come-back. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 2 +- drivers/firewire/fw-device.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) Date: Mon, 5 Jan 2009 20:43:23 +0100 (CET) From: Stefan Richter firewire: ohci: change "context_stop: still active" log message The present message is mostly just noise. We only need to be notified if the "active" flag does not go off before the retry loop terminates. Signed-off-by: Stefan Richter --- drivers/firewire/fw-ohci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Sat, 17 Jan 2009 22:45:54 +0100 (CET) From: Stefan Richter firewire: keep highlevel drivers attached during brief connection loss There are situations when nodes vanish from the bus and come back quickly thereafter: - When certain bus-powered hubs are plugged in, - when certain devices are plugged into 6-port hubs, - when certain disk enclosures are switched from self-power to bus power or vice versa and break the daisy chain during the transition, - when the user plugs a cable out and quickly plugs it back in, e.g. to reorder a daisy chain (works on Mac OS X if done quickly enough), - when certain hubs temporarily malfunction during high bus traffic. Until now, firewire-core reported affected nodes as lost to the highlevel drivers (firewire-sbp2 and userspace drivers). We now delay the destruction of device representations until after at least two seconds after the last bus reset. If a "new" device is detected in this period whose bus information block and root directory header match that of a device which is pending for deletion, we resurrect that device and send update calls to highlevel drivers. Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 121 ++++++++++++++++++++++++++++------- drivers/firewire/fw-device.h | 1 2 files changed, 100 insertions(+), 22 deletions(-) Date: Mon, 24 Mar 2008 20:56:40 +0100 (CET) From: Stefan Richter firewire: unnecessary BM delay after generation rollover Noticed by Jarod Wilson: The bus manager work was unnecessarily delayed each time the bus generation counter rolled over. Signed-off-by: Stefan Richter Signed-off-by: Jarod Wilson --- drivers/firewire/fw-card.c | 2 +- drivers/firewire/fw-topology.c | 2 +- drivers/firewire/fw-transaction.h | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) Date: Wed, 19 Mar 2008 22:02:40 +0100 (CET) From: Stefan Richter firewire: insist on successive self ID complete events The whole topology code only works if the old and new topologies which are compared come from immediately successive self ID complete events. If there happened bus resets without self ID complete events in the meantime, or self ID complete events with invalid selfIDs, the topology comparison could identify nodes wrongly, or more likely just corrupt kernel memory or panic right away. We now discard all nodes of the old topology and treat all current nodes as new ones if the current self ID generation is not the previous one plus 1. Signed-off-by: Stefan Richter Signed-off-by: Jarod Wilson --- drivers/firewire/fw-topology.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) Date: Fri, 9 Jan 2009 20:49:37 +0100 (CET) From: Stefan Richter firewire: core: fix sleep in atomic context due to driver core change Due to commit 2831fe6f9cc4e16c103504ee09a47a084297c0f3, "driver core: create a private portion of struct device", device_initialize() can no longer be called from atomic contexts. We now defer it until after config ROM probing. This requires changes to the bus manager code because this may use a device before it was probed. Reported-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 13 +++++++------ drivers/firewire/fw-device.c | 23 +++++++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) Date: Sat, 29 Nov 2008 19:00:56 +0100 (CET) From: Stefan Richter firewire: reorder struct fw_card for better cache efficiency topology_map is by far the largest member in struct fw_card. Move it to the very end of the struct so that card pointer dereferences have better chances to hit the CPU cache. This requires to increase the topology_map backing store to the size specified in IEEE 1394, i.e. 256 rather than 255 quadlets. Otherwise the topology_map response handler may access invalid memory. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) Date: Sat, 29 Nov 2008 18:56:47 +0100 (CET) From: Stefan Richter firewire: fix resetting of bus manager retry counter An earlier change, maybe long ago, removed the copying of self_id_count into card->self_id_count. Since then each bus reset cleared card->bm_retries even when it shouldn't. Signed-off-by: Stefan Richter --- drivers/firewire/fw-topology.c | 14 ++++++-------- drivers/firewire/fw-transaction.h | 1 - 2 files changed, 6 insertions(+), 9 deletions(-) Date: Sat, 29 Nov 2008 17:44:57 +0100 (CET) From: Jay Fenlason firewire: improve refcounting of fw_card Take a reference to the card whenever fw_card_bm_work() is scheduled on that card and release it when the work is done. This allows us to remove the cancel_delayed_work_sync() in fw_core_remove_card(). Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter (patch update) --- drivers/firewire/fw-card.c | 18 +++++++++++++++--- drivers/firewire/fw-device.c | 6 +++--- drivers/firewire/fw-topology.c | 2 +- drivers/firewire/fw-transaction.h | 2 ++ 4 files changed, 21 insertions(+), 7 deletions(-) Date: Wed, 22 Oct 2008 15:59:42 -0400 From: Jay Fenlason firewire: typo in comment Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Mon, 24 Nov 2008 20:40:00 +0100 (CET) From: Stefan Richter firewire: fix small memory leak at module removal Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 2 +- drivers/firewire/fw-device.h | 2 ++ drivers/firewire/fw-transaction.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) Date: Sun, 26 Oct 2008 11:04:20 +0100 (CET) From: Stefan Richter firewire: fw-sbp2: remove unnecessary locking What was I thinking when I added sbp2_set_generation()? Its locking did nothing (except for implicitly providing the necessary barrier between node IDs update and generation update). Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) Date: Sat, 13 Dec 2008 15:21:29 -0800 From: Harvey Harrison ieee1934: dv1394: interrupt enabling/disabling broken on big-endian 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 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 Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Sat, 13 Dec 2008 15:20:39 -0800 From: Harvey Harrison ieee1394: dv1394: annotate frame input/output structs as little endian No Functional changes. Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394-private.h | 44 +++++++++++++++--------------- drivers/ieee1394/dv1394.c | 4 +- 2 files changed, 24 insertions(+), 24 deletions(-) Date: Sat, 13 Dec 2008 15:03:06 -0800 From: Harvey Harrison ieee1394: eth1394: trivial sparse annotations Mostly annotations of ether_type as a be16. Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/eth1394.c | 26 +++++++++++++------------- drivers/ieee1394/eth1394.h | 16 ++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) Date: Sat, 13 Dec 2008 15:02:34 -0800 From: Harvey Harrison ieee1394: mark bus_info_data as a __be32 array Two access functions get_max_rom and set_hw_config_rom are changed to take __be32 as well. Only bus_info_data was ever passed in so this is OK. All other uses of bus_info_data treated it as a be32 value already. Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/csr1212.h | 2 +- drivers/ieee1394/hosts.h | 2 +- drivers/ieee1394/ohci1394.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Date: Sat, 13 Dec 2008 15:02:21 -0800 From: Harvey Harrison ieee1394: replace CSR_SET_BUS_INFO_GENERATION macro Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/csr.h | 10 +++++----- drivers/ieee1394/hosts.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) Date: Sat, 13 Dec 2008 15:01:50 -0800 From: Harvey Harrison ieee1394: pcilynx: trivial endian annotation bus_info_block was treated as a be32 everywhere, annotate as such. Removes plenty of sparse warnings. Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/pcilynx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sat, 13 Dec 2008 23:12:06 +0100 (CET) From: Stefan Richter ieee1394: ignore nonzero Bus_Info_Block.max_rom, fetch config ROM in quadlets It is already known that buggy firmwares exist which report a bogus link_spd in their config ROM bus info block. We now got the first report of a bogus max_rom too (Freecom FireWire Hard Drive 1TB, http://bugzilla.kernel.org/show_bug.cgi?id=12206). I suspect other OSs only use quadlet reads to fetch the config ROM, otherwise the firmware authors would have noticed their mistake. Hence limit ieee1394's config ROM fetching routine to quadlets as the safe minimum regardless of what the bus info block says. This will potentially slow the bus reset handling by nodemgr somewhat down. But most existing devices support only quadlet reads anyway, hence there will often be no actual difference to before this change. Signed-off-by: Stefan Richter --- drivers/ieee1394/csr1212.c | 45 +++++++++++-------------------------- drivers/ieee1394/csr1212.h | 7 ----- drivers/ieee1394/nodemgr.c | 20 +++------------- 3 files changed, 19 insertions(+), 53 deletions(-) Date: Fri, 12 Dec 2008 21:57:50 -0800 From: Harvey Harrison ieee1394: consolidate uses of IEEE1934_BUSID_MAGIC Move the definition out of nodemgr.h and use it in csr.c/pcilynx.c Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/csr.c | 4 ++-- drivers/ieee1394/ieee1394.h | 3 +++ drivers/ieee1394/nodemgr.h | 3 --- drivers/ieee1394/pcilynx.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) Date: Sat, 6 Dec 2008 17:35:59 +0100 (CET) From: Stefan Richter ieee1394: ohci1394: flush MMIO writes before delay in initialization and replace busy-wait by msleep. Signed-off-by: Stefan Richter --- drivers/ieee1394/ohci1394.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) Date: Sat, 6 Dec 2008 17:35:20 +0100 (CET) From: Stefan Richter ieee1394: ohci1394: pass error codes from request_irq through Signed-off-by: Stefan Richter --- drivers/ieee1394/ohci1394.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) Date: Sat, 6 Dec 2008 15:36:47 +0100 From: Frans Pop ieee1394: ohci1394: don't leave interrupts enabled during suspend/resume On my HP 2510p I get the following in dmesg during near the end of most resumes from suspend to RAM: irq 19: nobody cared (try booting with the "irqpoll" option) Pid: 0, comm: swapper Not tainted 2.6.28-rc7 #67 Call Trace: [] ? ohci_irq_handler+0x60/0x7e9 [ohci1394] [] __report_bad_irq+0x38/0x87 [] note_interrupt+0x10e/0x174 [] handle_fasteoi_irq+0xa7/0xd1 [] do_IRQ+0x73/0xe4 [] ret_from_intr+0x0/0xa [] ? acpi_idle_enter_bm+0x26b/0x2b2 [processor] [] ? acpi_idle_enter_bm+0x261/0x2b2 [processor] [] ? notifier_call_chain+0x33/0x5b [] ? cpuidle_idle_call+0x8c/0xc4 [] ? cpu_idle+0x4a/0x9a [] ? rest_init+0x5c/0x5e handlers: [] (ohci_irq_handler+0x0/0x7e9 [ohci1394]) Disabling IRQ #19 There also seems to be an interrupt storm during suspend/resume when this happens: 19: 99968 33 IO-APIC-fasteoi ohci1394 This patch gets rid of both issues and makes the resume as a whole significantly faster. Signed-off-by: Frans Pop As was pointed out in http://lkml.org/lkml/2008/12/6/127, this does not fix the cause of the interrupt storm. However, since the source of the interrupts could not be determined yet, we make the system at least more usable with this change. Signed-off-by: Stefan Richter --- drivers/ieee1394/ohci1394.c | 8 ++++++++ 1 file changed, 8 insertions(+) Date: Wed, 26 Nov 2008 01:35:21 +0100 (CET) From: Stefan Richter ieee1394: mark all hpsb_address_ops instances as const These are never modified. Signed-off-by: Stefan Richter --- drivers/ieee1394/csr.c | 8 ++++---- drivers/ieee1394/eth1394.c | 2 +- drivers/ieee1394/highlevel.c | 7 ++++--- drivers/ieee1394/highlevel.h | 7 ++++--- drivers/ieee1394/raw1394.c | 2 +- drivers/ieee1394/sbp2.c | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) Date: Wed, 26 Nov 2008 01:34:55 +0100 (CET) From: Stefan Richter ieee1394: replace a GFP_ATOMIC by GFP_KERNEL allocation All callers of hpsb_register_addrspace() can sleep. Signed-off-by: Stefan Richter --- drivers/ieee1394/highlevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)