openwrt/staging/blogic.git
17 years agofirewire: Fix start on cycle 0 for IT, implement start on cycle for IR.
Kristian Høgsberg [Wed, 28 Mar 2007 18:26:10 +0000 (14:26 -0400)]
firewire: Fix start on cycle 0 for IT, implement start on cycle for IR.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Fix the range check for the queue_iso payload pointer.
Kristian Høgsberg [Wed, 28 Mar 2007 18:46:23 +0000 (20:46 +0200)]
firewire: Fix the range check for the queue_iso payload pointer.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (renamed a variable)
17 years agofirewire: Increase the number of config rom retries and the retry delay.
Kristian Høgsberg [Tue, 27 Mar 2007 05:43:43 +0000 (01:43 -0400)]
firewire: Increase the number of config rom retries and the retry delay.

Some devices have a really long power-on cycle, and we fail to
successfully probe these if they're plugged in and then turned on.

There's really no down-side to bumping the number of retries and the
retry delay, and most devices will get picked up within the first couple
of retries anyway.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Don't set card->irm_node before we have a new valid topology.
Kristian Høgsberg [Tue, 27 Mar 2007 14:42:39 +0000 (09:42 -0500)]
firewire: Don't set card->irm_node before we have a new valid topology.

In case the topology build fails, we want to retain the old topology
info until another reset finishes and results in a valid new tree.  If
we clear card->irm_node to NULL and the topology build fails, we end up
dereferencing a NULL pointer in a few places.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Generalize resource tracking for cdev implementation.
Kristian Høgsberg [Tue, 27 Mar 2007 05:43:41 +0000 (01:43 -0400)]
firewire: Generalize resource tracking for cdev implementation.

Generalize the way we keep track of the various resources and
assign a unique handle to each resource.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Add ioctls to add and remove config rom descriptors.
Kristian Høgsberg [Wed, 28 Mar 2007 19:26:42 +0000 (21:26 +0200)]
firewire: Add ioctls to add and remove config rom descriptors.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (fixed whitespace)
17 years agofirewire: Streamline userspace interface structs.
Kristian Høgsberg [Tue, 27 Mar 2007 05:43:39 +0000 (01:43 -0400)]
firewire: Streamline userspace interface structs.

Make event struct layout common part include the closure and add a
union for all event types; provide a mechanism for setting the
bus reset event closure.

Shuffle struct fw_cdev_queue_iso fields around to be 64-bit safe.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Remember to set the driver_data pointer when queueing a packet.
Kristian Høgsberg [Mon, 26 Mar 2007 23:18:19 +0000 (19:18 -0400)]
firewire: Remember to set the driver_data pointer when queueing a packet.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Use device->groups for adding device attributes.
Kristian Høgsberg [Tue, 27 Mar 2007 23:35:13 +0000 (19:35 -0400)]
firewire: Use device->groups for adding device attributes.

We dynamically create an attribute group for the key present on the
device in hand and point device->group to it.  This way the device
core adds the sysfs attributes for us as the device is added.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Add phy register defines.
Marc Butler [Fri, 23 Mar 2007 16:24:02 +0000 (10:24 -0600)]
firewire: Add phy register defines.

Signed-off-by: Marc Butler <marc@adaptivecode.com>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (added whitespace)
17 years agofirewire: Export GUID as sysfs attribute.
Kristian Høgsberg [Wed, 21 Mar 2007 00:58:35 +0000 (20:58 -0400)]
firewire: Export GUID as sysfs attribute.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Add sysfs attributes for config rom directory values.
Kristian Høgsberg [Wed, 21 Mar 2007 14:55:19 +0000 (10:55 -0400)]
firewire: Add sysfs attributes for config rom directory values.

We export the entire config rom, so this is technically redundant,
but should make udev rules and HAL integration easier.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Make use of struct device_type.
Kristian Høgsberg [Wed, 21 Mar 2007 00:58:33 +0000 (20:58 -0400)]
firewire: Make use of struct device_type.

The device_type struct is useful for setting attributes for a device
and overriding .release and .uevent for a group of devices.  This patch
uses it this way to clean up the sysfs code a bit.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: ROM cache is CPU-endian
Stefan Richter [Tue, 20 Mar 2007 18:44:26 +0000 (19:44 +0100)]
firewire: ROM cache is CPU-endian

Puts a stray endian annotation down.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fix compiler warnings on 64bit
Stefan Richter [Tue, 20 Mar 2007 18:42:15 +0000 (19:42 +0100)]
firewire: fix compiler warnings on 64bit

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: add includes for sem and rw_sem
Stefan Richter [Mon, 19 Mar 2007 15:37:16 +0000 (11:37 -0400)]
firewire: add includes for sem and rw_sem

as a precaution.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Grab dev->sem when doing the update callback.
Kristian Høgsberg [Mon, 19 Mar 2007 15:37:16 +0000 (11:37 -0400)]
firewire: Grab dev->sem when doing the update callback.

This serializes the update callback with the probe and remove callback from
the driver core and prevents remove from being called while update is
running for the same device.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: rename CONFIG_FW to CONFIG_FIREWIRE
Stefan Richter [Sun, 18 Mar 2007 00:39:28 +0000 (01:39 +0100)]
firewire: rename CONFIG_FW to CONFIG_FIREWIRE

to avoid confusion with CONFIG_FW_LOADER.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Acked-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: Add ref-counting for sbp2_device and hold a ref while we have work scheduled.
Kristian Høgsberg [Wed, 14 Mar 2007 21:34:58 +0000 (17:34 -0400)]
firewire: Add ref-counting for sbp2_device and hold a ref while we have work scheduled.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Free pending transactions on cdev release.
Kristian Høgsberg [Wed, 14 Mar 2007 21:34:57 +0000 (17:34 -0400)]
firewire: Free pending transactions on cdev release.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Zero out sd->scsi_host if we fail to register with the SCSI stack.
Kristian Høgsberg [Wed, 14 Mar 2007 21:34:56 +0000 (17:34 -0400)]
firewire: Zero out sd->scsi_host if we fail to register with the SCSI stack.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement deallocation of address ranges.
Kristian Høgsberg [Wed, 14 Mar 2007 21:34:55 +0000 (17:34 -0400)]
firewire: Implement deallocation of address ranges.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Move sync and tag parameters to start_iso ioctl.
Kristian Høgsberg [Wed, 14 Mar 2007 21:34:54 +0000 (17:34 -0400)]
firewire: Move sync and tag parameters to start_iso ioctl.

Setting these at create_context time or start_iso time doesn't matter
much, but raw1394 sets them at start_iso time so that will be easier to
emulate this way.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Fix dualbuffer iso receive mode and drop buffer fill mode.
Kristian Høgsberg [Wed, 14 Mar 2007 21:34:53 +0000 (17:34 -0400)]
firewire: Fix dualbuffer iso receive mode and drop buffer fill mode.

The dualbuffer DMA setup did not account for the iso trailer word
and thus didn't  work correctly.  With this fixed we can drop the
dual buffer fallback mode.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement CSR cycle time and bus time registers.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:56 +0000 (12:12 -0500)]
firewire: Implement CSR cycle time and bus time registers.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement topology map and fix a couple of loopback bugs.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:55 +0000 (12:12 -0500)]
firewire: Implement topology map and fix a couple of loopback bugs.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Export juju specific rcodes to user space.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:54 +0000 (12:12 -0500)]
firewire: Export juju specific rcodes to user space.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Add generation field to send_request ioctl struct.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:53 +0000 (12:12 -0500)]
firewire: Add generation field to send_request ioctl struct.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Add card index field to get_info cdev ioctl struct.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:52 +0000 (12:12 -0500)]
firewire: Add card index field to get_info cdev ioctl struct.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Fix order of arguments for iso context creation.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:51 +0000 (12:12 -0500)]
firewire: Fix order of arguments for iso context creation.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Track pending transactions and cancel them on cdev release.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:50 +0000 (12:12 -0500)]
firewire: Track pending transactions and cancel them on cdev release.

Without this, pending transactions will dereference freed memory
if they complete after the device file has been closed.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Move async transmit to use the general context code.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:49 +0000 (12:12 -0500)]
firewire: Move async transmit to use the general context code.

The old async transmit context handling was starting and stopping
DMA for every packet transmission.  This could cause silently failing
packet transmission, if the DMA was reprogrammed too close to being
stopped.

The general context code keeps DMA running at all times and fixes this
problem.  It's also a nice cleanup.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Use only a wait queue and terminate poll and read on device removal.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:48 +0000 (12:12 -0500)]
firewire: Use only a wait queue and terminate poll and read on device removal.

Drop the event list semaphore and only use the wait queue and the list
to synchronize queue access.  Break out of a poll or read whenever
the device is disconnected.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Don't time out command orbs, leave that to the scsi stack.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:47 +0000 (12:12 -0500)]
firewire: Don't time out command orbs, leave that to the scsi stack.

The mod_timer based timing out of orb was a little to agressive and
would time out legit, but long-lived scsi cmds.  Besides, the scsi
stack keeps track of this already.  Since we're only timing out
management orbs, go back to wait_for_completion_timeout.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Add rom_index attribute for unit sysfs directories.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:46 +0000 (12:12 -0500)]
firewire: Add rom_index attribute for unit sysfs directories.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Quiet down fw-sbp2 logging a bit, remove stale FIXME.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:45 +0000 (12:12 -0500)]
firewire: Quiet down fw-sbp2 logging a bit, remove stale FIXME.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Switch cdev code over to use register_chrdev and keep a list of devices.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:44 +0000 (12:12 -0500)]
firewire: Switch cdev code over to use register_chrdev and keep a list of devices.

The old mechanism kept a struct cdev for each fw device, but fops->release
would reference this struct after the device got freed in some cases.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Generalize get_config_rom to get_info.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:43 +0000 (12:12 -0500)]
firewire: Generalize get_config_rom to get_info.

Repurpose the get_config_rom ioctl to a general get_info ioctl.
This ioctl is now used for version negotiation, and optionally
returns the config rom, and the current bus info.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement ioctl to initiate bus reset.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:42 +0000 (12:12 -0500)]
firewire: Implement ioctl to initiate bus reset.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Add a bus reset event type for fw-device-cdev.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:41 +0000 (12:12 -0500)]
firewire: Add a bus reset event type for fw-device-cdev.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Only use INIT_DELAYED_WORK for first initialization.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:40 +0000 (12:12 -0500)]
firewire: Only use INIT_DELAYED_WORK for first initialization.

Use PREPARE_DELAYED_WORK to just change the function pointer.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Iterate through units in a keventd callback for update callbacks.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:39 +0000 (12:12 -0500)]
firewire: Iterate through units in a keventd callback for update callbacks.

We can't take the klist lock for the child device list in interrupt
context.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Clear all interrupt bits before shutting down.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:38 +0000 (12:12 -0500)]
firewire: Clear all interrupt bits before shutting down.

Some flaky controllers doesn't honor the masterIntEnable bits
and can generate bus reset events even if that bit is cleared.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Drop the unused fw_card device.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:37 +0000 (12:12 -0500)]
firewire: Drop the unused fw_card device.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Let an fw_descriptor specify a leading immediate key/value pair.
Kristian Høgsberg [Wed, 7 Mar 2007 17:12:36 +0000 (12:12 -0500)]
firewire: Let an fw_descriptor specify a leading immediate key/value pair.

This lets us break out "Juju" as the model name in the config rom.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Scheduled removal of SA_xxx interrupt flags fixups 3
Thomas Gleixner [Tue, 6 Mar 2007 02:19:51 +0000 (18:19 -0800)]
firewire: Scheduled removal of SA_xxx interrupt flags fixups 3

The obsolete SA_xxx interrupt flags have been used despite the scheduled
removal.  Fixup the remaining users in -mm.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: adjust whitespace
Stefan Richter [Sun, 4 Mar 2007 13:45:18 +0000 (14:45 +0100)]
firewire: adjust whitespace

Remove space before tab and trailing whitespace.
Unify indentation of goto target labels.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement sync and tag matching for isochronous receive.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:51 +0000 (17:34 -0500)]
firewire: Implement sync and tag matching for isochronous receive.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Configure channel and speed at context creation time.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:50 +0000 (17:34 -0500)]
firewire: Configure channel and speed at context creation time.

We need the channel number as we queue up iso packets for transmission
so we can fill out the header correctly.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Store OHCI version and make sure we have at least 1.1 before doing dualbuffer.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:49 +0000 (17:34 -0500)]
firewire: Store OHCI version and make sure we have at least 1.1 before doing dualbuffer.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Get zeroed out pages for mapping to user space.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:48 +0000 (17:34 -0500)]
firewire: Get zeroed out pages for mapping to user space.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Don't touch DMA descriptors after appending.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:47 +0000 (17:34 -0500)]
firewire: Don't touch DMA descriptors after appending.

When a DMA descriptor is appended to the context we sync it for
DMA and the device might potentially read it immediately.  So,
we can't set the IRQ bits in the descriptor after appending.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Use a buffer fill descriptor for receive when header size is 0.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:46 +0000 (17:34 -0500)]
firewire: Use a buffer fill descriptor for receive when header size is 0.

When the DMA is setup to not strip any headers, we need to use
the buffer fill descriptor instead of the dual buffer, since the
dual buffer descriptor must strip a non-zero number of header quadlets.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Set correct buffer lengths for dualbuffer DMA descriptor.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:45 +0000 (17:34 -0500)]
firewire: Set correct buffer lengths for dualbuffer DMA descriptor.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Acummulate received iso headers and send them back to user space.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:44 +0000 (17:34 -0500)]
firewire: Acummulate received iso headers and send them back to user space.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Log OHCI chipset version in PCI probe.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:43 +0000 (17:34 -0500)]
firewire: Log OHCI chipset version in PCI probe.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement functionality to stop isochronous DMA contexts.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:42 +0000 (17:34 -0500)]
firewire: Implement functionality to stop isochronous DMA contexts.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Rename 'send_iso' to 'start_iso'.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:41 +0000 (17:34 -0500)]
firewire: Rename 'send_iso' to 'start_iso'.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement basic isochronous receive functionality.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:40 +0000 (17:34 -0500)]
firewire: Implement basic isochronous receive functionality.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Generalize the iso transmit descriptor buffer logic.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:39 +0000 (17:34 -0500)]
firewire: Generalize the iso transmit descriptor buffer logic.

The descriptor circular buffer logic used for iso transmission is
useful for async transmit too, so pull the sharable logic out in
a few standalone functions.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Split the iso buffer out from fw_iso_context and avoid vmalloc.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:38 +0000 (17:34 -0500)]
firewire: Split the iso buffer out from fw_iso_context and avoid vmalloc.

This patch splits out the iso buffer so we can initialize it at mmap
time with the size provided in the mmap call.  Furthermore, allocate
the backing pages using alloc_page to avoid setting up kernel side
virtual memory mappings for the pages.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Use correct payload pointer when demarshalling incoming requests.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:37 +0000 (17:34 -0500)]
firewire: Use correct payload pointer when demarshalling incoming requests.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Read the *Clear versions of the iso interrupt register.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:36 +0000 (17:34 -0500)]
firewire: Read the *Clear versions of the iso interrupt register.

The *Clear registers returns the masked value when read which is
what we want.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Fix another typo from the bitfield conversion.
Kristian Høgsberg [Fri, 16 Feb 2007 22:34:35 +0000 (17:34 -0500)]
firewire: Fix another typo from the bitfield conversion.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Use dma_mapping_error() for checking for DMA mapping errors.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:40 +0000 (14:49 -0500)]
firewire: Use dma_mapping_error() for checking for DMA mapping errors.

Pointed out by Pete Zaitcev.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Credit the old sbp2.c driver for being a good starting point.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:39 +0000 (14:49 -0500)]
firewire: Credit the old sbp2.c driver for being a good starting point.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Use atomic_t's for serial numbers.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:38 +0000 (14:49 -0500)]
firewire: Use atomic_t's for serial numbers.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Use atomic_inc_return.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Spell out fw as firewire in sysfs.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:37 +0000 (14:49 -0500)]
firewire: Spell out fw as firewire in sysfs.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Complete SCSI commands with DID_BUS_BUSY when a bus reset happens.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:36 +0000 (14:49 -0500)]
firewire: Complete SCSI commands with DID_BUS_BUSY when a bus reset happens.

This lets the SCSI stack retry the command when a SCSI command is
interrupted by a FireWire bus reset.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Schedule topology work before calling driver update functions.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:35 +0000 (14:49 -0500)]
firewire: Schedule topology work before calling driver update functions.

This prevents superfluous bus traffic as fw-sbp2 logs in only to
get kicked off the device by another bus reset as the driver core
does bus management.  Scheduling it this way lets the driver core
finish bus management before higher level drivers get the update
callback.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Introduce a retry mechanism for reconnects and logins.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:34 +0000 (14:49 -0500)]
firewire: Introduce a retry mechanism for reconnects and logins.

Sometimes we reconnect too soon, sometimes too late.  Adding a retry
mechanism make the reconnect step much more robust.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-sbp2: Do ORB timeout right.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:33 +0000 (14:49 -0500)]
firewire: fw-sbp2: Do ORB timeout right.

When a management ORB times out, either because the fw_transaction
times out or when we don't get the status write, we need to properly
cancel the entire operation.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement proper transaction cancelation.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:32 +0000 (14:49 -0500)]
firewire: Implement proper transaction cancelation.

Drivers such as fw-sbp2 had no way to properly cancel in-progress
transactions, which could leave a pending transaction or an unset
packet in the low-level queues after kfree'ing the containing
structure. fw_cancel_transaction() lets drivers cancel a submitted
transaction.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Reduce some redundant register definitions.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:31 +0000 (14:49 -0500)]
firewire: Reduce some redundant register definitions.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Rework async receive DMA.
Kristian Høgsberg [Tue, 6 Feb 2007 19:49:30 +0000 (14:49 -0500)]
firewire: Rework async receive DMA.

The old DMA program for receiving async packets stops DMA while
processing received packets and only expects one packet per
interrupt.  Stopping DMA can silently drop packets and we need to
handle multiple received packets per interrupt.

This new version keeps DMA running at all times and just append new
pages as buffers fill up, and supports multiple packets per interrupt.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: use atomic type for fw_device.state
Stefan Richter [Sat, 27 Jan 2007 09:34:55 +0000 (10:34 +0100)]
firewire: use atomic type for fw_device.state

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Make sure we wait for DMA to stop before we reprogram it.
Kristian Høgsberg [Fri, 26 Jan 2007 05:38:49 +0000 (00:38 -0500)]
firewire: Make sure we wait for DMA to stop before we reprogram it.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement compliant bus management.
Kristian Høgsberg [Fri, 26 Jan 2007 05:38:45 +0000 (00:38 -0500)]
firewire: Implement compliant bus management.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Fix bit shift typo.
Kristian Høgsberg [Fri, 26 Jan 2007 05:38:38 +0000 (00:38 -0500)]
firewire: Fix bit shift typo.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Sanitize send error codes.
Kristian Høgsberg [Fri, 26 Jan 2007 05:38:34 +0000 (00:38 -0500)]
firewire: Sanitize send error codes.

Drop the negative errnos and use RCODEs for all error codes
in the complete transaction callback.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Handle access to CSR resources on local node.
Kristian Høgsberg [Fri, 26 Jan 2007 05:38:26 +0000 (00:38 -0500)]
firewire: Handle access to CSR resources on local node.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Add lock transaction opcodes to fw-device-cdev.h.
Kristian Høgsberg [Fri, 26 Jan 2007 05:38:18 +0000 (00:38 -0500)]
firewire: Add lock transaction opcodes to fw-device-cdev.h.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Clean up response handling.
Kristian Høgsberg [Fri, 26 Jan 2007 05:38:13 +0000 (00:38 -0500)]
firewire: Clean up response handling.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Loop requests to the host controller back into the stack.
Kristian Høgsberg [Fri, 26 Jan 2007 05:38:04 +0000 (00:38 -0500)]
firewire: Loop requests to the host controller back into the stack.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Use struct fw_packet for incoming packets too in controller interface.
Kristian Høgsberg [Fri, 26 Jan 2007 05:37:57 +0000 (00:37 -0500)]
firewire: Use struct fw_packet for incoming packets too in controller interface.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fix compilation with gcc 3.4
Stefan Richter [Sat, 27 Jan 2007 15:59:15 +0000 (16:59 +0100)]
firewire: fix compilation with gcc 3.4

drivers/firewire/fw-topology.c: In function `report_found_node':
drivers/firewire/fw-topology.c:345: error: `typeof' applied to a bit-field
drivers/firewire/fw-topology.c:345: error: `typeof' applied to a bit-field

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: Implement gap count optimization.
Kristian Høgsberg [Fri, 26 Jan 2007 05:37:50 +0000 (00:37 -0500)]
firewire: Implement gap count optimization.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-sbp2: set command set related device flags
Stefan Richter [Tue, 23 Jan 2007 20:20:08 +0000 (21:20 +0100)]
firewire: fw-sbp2: set command set related device flags

Copied from sbp2:
  - enable spin-up by START STOP UNIT for all devices
  - enable INQUIRY (36) workaround on demand
  - prefer READ/ WRITE (10) over (6) for all devices
  - prefer MODE SENSE (10) for MMC devices

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: consistent usage of node_id
Stefan Richter [Tue, 23 Jan 2007 20:11:43 +0000 (21:11 +0100)]
firewire: consistent usage of node_id

Definitions as per IEEE 1212 and IEEE 1394:

     Node ID: Concatenation of bus ID and local ID. 16 bits long.
      Bus ID: Identifies a particular bus within a group of buses
              interconnected by bus bridges.
    Local ID: Identifies a particular node on a bus.
      PHY ID: Local ID of IEEE 1394 nodes. 6 bits long.

Never ever use a variable called node_id for anything else than a node ID.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-ohci: remove unnecessary macro
Stefan Richter [Tue, 23 Jan 2007 20:09:23 +0000 (21:09 +0100)]
firewire: fw-ohci: remove unnecessary macro

Cleans up after patch "Add PCI class ID for firewire OHCI controllers".

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: fw-sbp2: remove unused macro
Stefan Richter [Sun, 21 Jan 2007 19:50:11 +0000 (20:50 +0100)]
firewire: fw-sbp2: remove unused macro

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: fw-sbp2: remove bogus "emulated" host flag
Stefan Richter [Sun, 21 Jan 2007 19:49:38 +0000 (20:49 +0100)]
firewire: fw-sbp2: remove bogus "emulated" host flag

There is no emulation going on here too.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: fix failure path in ohci_enable_phys_dma
Stefan Richter [Sun, 21 Jan 2007 19:46:45 +0000 (20:46 +0100)]
firewire: fix failure path in ohci_enable_phys_dma

"goto out" happens with the lock taken.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: comma after last enum item or initializer
Stefan Richter [Sun, 21 Jan 2007 19:45:32 +0000 (20:45 +0100)]
firewire: comma after last enum item or initializer

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: whitespace adjustments
Stefan Richter [Sun, 21 Jan 2007 19:44:09 +0000 (20:44 +0100)]
firewire: whitespace adjustments

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: cleanups
Adrian Bunk [Mon, 22 Jan 2007 18:17:37 +0000 (19:17 +0100)]
firewire: cleanups

This patch contains the following cleanups:
- "extern inline" -> "static inline"
- fw-topology.c: make struct fw_node_create static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: mark some structs const
Stefan Richter [Sun, 14 Jan 2007 14:29:07 +0000 (15:29 +0100)]
firewire: mark some structs const

Instances of struct file_operations and struct fw_card_driver can be
qualified as "const".  Ditto with struct fw_descriptor.data, struct
fw_device_id, and predefined instances of struct fw_address_region,
at least in the current implementation.

Data qualified as const is placed into the .rodata section which won't
be mixed with dirty data.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: additional help in Kconfig
Stefan Richter [Sun, 7 Jan 2007 21:33:59 +0000 (22:33 +0100)]
firewire: additional help in Kconfig

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: put old and new stack into same Kconfig submenu
Stefan Richter [Sun, 31 Dec 2006 16:20:20 +0000 (17:20 +0100)]
firewire: put old and new stack into same Kconfig submenu

Screenshot from "make menuconfig":
...
  ?????????????????????? IEEE 1394 (FireWire) support ???????????????????????
  ?  Arrow keys navigate the menu.  <Enter> selects submenus --->.          ?
...
  ? ??????????????????????????????????????????????????????????????????????? ?
  ? ?    <M> IEEE 1394 (FireWire) support (JUJU alternative stack, experim? ?
  ? ?    <M>   Support for OHCI firewire host controllers                 ? ?
  ? ?    <M>   Support for storage devices (SBP-2 protocol driver)        ? ?
  ? ?    <M> IEEE 1394 (FireWire) support                                 ? ?
  ? ?    ---   Subsystem Options                                          ? ?
  ? ?    [ ]   Excessive debugging output                                 ? ?
...
  ?                    <Select>    < Exit >    < Help >                     ?
  ???????????????????????????????????????????????????????????????????????????

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: consistent ifndef blocks in header files
Stefan Richter [Thu, 28 Dec 2006 15:20:00 +0000 (16:20 +0100)]
firewire: consistent ifndef blocks in header files

Replace __fw_core_h by __fw_transaction_h to match the file name.
Add comments to the final #endif in header files.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>