Commit graph

202 commits

Author SHA1 Message Date
Kristian Høgsberg
6f2e53d513 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>
2007-03-28 21:30:13 +02:00
Marc Butler
ecab413359 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)
2007-03-24 23:29:19 +01:00
Kristian Høgsberg
bbd1494580 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>
2007-03-22 00:48:50 +01:00
Kristian Høgsberg
7feb9cce2d 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>
2007-03-22 00:48:50 +01:00
Kristian Høgsberg
21351dbe4e 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>
2007-03-22 00:48:49 +01:00
Stefan Richter
945ac22253 firewire: ROM cache is CPU-endian
Puts a stray endian annotation down.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-20 23:27:19 +01:00
Stefan Richter
d84702a5d7 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>
2007-03-20 23:27:19 +01:00
Stefan Richter
633c52dccd firewire: add includes for sem and rw_sem
as a precaution.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-20 23:27:19 +01:00
Kristian Høgsberg
015b066f4e 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>
2007-03-20 23:27:19 +01:00
Stefan Richter
11f494ee25 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>
2007-03-20 23:27:19 +01:00
Kristian Høgsberg
b3d6e15114 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>
2007-03-15 18:27:40 +01:00
Kristian Høgsberg
7e35f7f318 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>
2007-03-15 18:21:36 +01:00
Kristian Høgsberg
693b902176 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>
2007-03-15 18:21:36 +01:00
Kristian Høgsberg
9472316b6e 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>
2007-03-15 18:21:36 +01:00
Kristian Høgsberg
eb0306eac0 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>
2007-03-15 18:21:36 +01:00
Kristian Høgsberg
c70dc788fd 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>
2007-03-15 18:21:36 +01:00
Kristian Høgsberg
d60d7f1d5c 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>
2007-03-09 22:03:15 +01:00
Kristian Høgsberg
473d28c730 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>
2007-03-09 22:03:14 +01:00
Kristian Høgsberg
7c6e647da0 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>
2007-03-09 22:03:14 +01:00
Kristian Høgsberg
97e3527538 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>
2007-03-09 22:03:13 +01:00
Kristian Høgsberg
e7533505fe 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>
2007-03-09 22:03:13 +01:00
Kristian Høgsberg
8fbdbb3683 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>
2007-03-09 22:03:12 +01:00
Kristian Høgsberg
28cf6a04c8 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>
2007-03-09 22:03:12 +01:00
Kristian Høgsberg
f319b6a02f 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>
2007-03-09 22:03:11 +01:00
Kristian Høgsberg
2603bf219e 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>
2007-03-09 22:03:11 +01:00
Kristian Høgsberg
2aaad97be6 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>
2007-03-09 22:03:10 +01:00
Kristian Høgsberg
048961ef90 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>
2007-03-09 22:03:10 +01:00
Kristian Høgsberg
5c5539d8cd 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>
2007-03-09 22:03:09 +01:00
Kristian Høgsberg
a3aca3dabb 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>
2007-03-09 22:03:09 +01:00
Kristian Høgsberg
344bbc4de1 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>
2007-03-09 22:03:08 +01:00
Kristian Høgsberg
5371842b72 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>
2007-03-09 22:03:08 +01:00
Kristian Høgsberg
97bd9efa5a 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>
2007-03-09 22:03:08 +01:00
Kristian Høgsberg
1da0c93b31 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>
2007-03-09 22:03:07 +01:00
Kristian Høgsberg
5f48047756 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>
2007-03-09 22:03:07 +01:00
Kristian Høgsberg
e254a4b45f 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>
2007-03-09 22:03:06 +01:00
Kristian Høgsberg
49e1179b16 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>
2007-03-09 22:03:06 +01:00
Kristian Høgsberg
937f687969 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>
2007-03-09 22:03:05 +01:00
Thomas Gleixner
65efffa8f0 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>
2007-03-09 22:03:05 +01:00
Stefan Richter
373b2edd86 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>
2007-03-09 22:03:04 +01:00
Kristian Høgsberg
98b6cbe83b 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>
2007-03-09 22:03:04 +01:00
Kristian Høgsberg
21efb3cfc6 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>
2007-03-09 22:03:03 +01:00
Kristian Høgsberg
e364cf4e0a 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>
2007-03-09 22:03:03 +01:00
Kristian Høgsberg
68be3fa15a 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>
2007-03-09 22:03:02 +01:00
Kristian Høgsberg
cb2d2cdbc6 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>
2007-03-09 22:03:02 +01:00
Kristian Høgsberg
d2746dc192 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>
2007-03-09 22:03:01 +01:00
Kristian Høgsberg
1e1d196bf5 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>
2007-03-09 22:03:01 +01:00
Kristian Høgsberg
9b32d5f307 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>
2007-03-09 22:03:00 +01:00
Kristian Høgsberg
500be7251a 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>
2007-03-09 22:03:00 +01:00
Kristian Høgsberg
b82956685a 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>
2007-03-09 22:02:59 +01:00
Kristian Høgsberg
69cdb7268c 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>
2007-03-09 22:02:59 +01:00
Kristian Høgsberg
295e3feb92 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>
2007-03-09 22:02:58 +01:00
Kristian Høgsberg
30200739e6 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>
2007-03-09 22:02:58 +01:00
Kristian Høgsberg
9aad812538 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>
2007-03-09 22:02:57 +01:00
Kristian Høgsberg
6e2e8424d3 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>
2007-03-09 22:02:57 +01:00
Kristian Høgsberg
c889475fb5 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>
2007-03-09 22:02:56 +01:00
Kristian Høgsberg
cbb59da719 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>
2007-03-09 22:02:56 +01:00
Kristian Høgsberg
82eff9db7d 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>
2007-03-09 22:02:55 +01:00
Kristian Høgsberg
27a15e50fb 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>
2007-03-09 22:02:55 +01:00
Kristian Høgsberg
bbf19db37e 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>
2007-03-09 22:02:54 +01:00
Kristian Høgsberg
362c2c8ca4 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>
2007-03-09 22:02:54 +01:00
Kristian Høgsberg
374a003928 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>
2007-03-09 22:02:53 +01:00
Kristian Høgsberg
993baca3dd 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>
2007-03-09 22:02:53 +01:00
Kristian Høgsberg
7f37c426c6 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>
2007-03-09 22:02:52 +01:00
Kristian Høgsberg
1d3d52c536 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>
2007-03-09 22:02:52 +01:00
Kristian Høgsberg
730c32f58b 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>
2007-03-09 22:02:51 +01:00
Kristian Høgsberg
72e318e07e 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>
2007-03-09 22:02:51 +01:00
Kristian Høgsberg
32b46093a0 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>
2007-03-09 22:02:50 +01:00
Stefan Richter
641f8791f0 firewire: use atomic type for fw_device.state
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:49 +01:00
Kristian Høgsberg
0edeefd99f 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>
2007-03-09 22:02:49 +01:00
Kristian Høgsberg
931c4834c8 firewire: Implement compliant bus management.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:48 +01:00
Kristian Høgsberg
9fc82689bf firewire: Fix bit shift typo.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:48 +01:00
Kristian Høgsberg
e5f49c3b83 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>
2007-03-09 22:02:47 +01:00
Kristian Høgsberg
93c4cceb96 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>
2007-03-09 22:02:47 +01:00
Kristian Høgsberg
746083d86c 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>
2007-03-09 22:02:47 +01:00
Kristian Høgsberg
36bfe49d07 firewire: Clean up response handling.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:46 +01:00
Kristian Høgsberg
e636fe2576 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>
2007-03-09 22:02:46 +01:00
Kristian Høgsberg
2639a6fb26 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>
2007-03-09 22:02:45 +01:00
Stefan Richter
748086eb53 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>
2007-03-09 22:02:45 +01:00
Kristian Høgsberg
83db801ce8 firewire: Implement gap count optimization.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:44 +01:00
Stefan Richter
cfb01381f4 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>
2007-03-09 22:02:44 +01:00
Stefan Richter
907293d788 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>
2007-03-09 22:02:43 +01:00
Stefan Richter
366f5f4fa3 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>
2007-03-09 22:02:43 +01:00
Stefan Richter
02af8e70cb 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>
2007-03-09 22:02:42 +01:00
Stefan Richter
5fa1580d2d 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>
2007-03-09 22:02:42 +01:00
Stefan Richter
6cad95fe97 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>
2007-03-09 22:02:41 +01:00
Stefan Richter
5af4e5eab3 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>
2007-03-09 22:02:41 +01:00
Stefan Richter
5e20c28218 firewire: whitespace adjustments
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
2007-03-09 22:02:40 +01:00
Adrian Bunk
95688e97cd 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>
2007-03-09 22:02:40 +01:00
Stefan Richter
21ebcd1224 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>
2007-03-09 22:02:39 +01:00
Stefan Richter
227e7d8194 firewire: additional help in Kconfig
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:39 +01:00
Stefan Richter
22a38e72bc 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>
2007-03-09 22:02:38 +01:00
Stefan Richter
687198bbd2 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>
2007-03-09 22:02:38 +01:00
Stefan Richter
35b7541c8f firewire: typo in Kconfig
Correct a typo.  Also spell FireWire consistently.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:37 +01:00
Stefan Richter
9c87da4eb3 firewire: mark fw-core as experimental
The new stack is not yet stable WRT functionality and APIs.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:37 +01:00
Stefan Richter
fe69ca3ac2 firewire: build fix 3
drivers/firewire/fw-sbp2.c: At top level:
drivers/firewire/fw-sbp2.c:1060: error: storage size of '__mod_ieee1394_device_table' isn't known
(error pointed out by akpm)

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:36 +01:00
Andrew Morton
0b5b290344 firewire: build fix 2
ia64:

drivers/firewire/fw-sbp2.c: In function `sbp2_command_orb_map_scatterlist':
drivers/firewire/fw-sbp2.c:826: warning: implicit declaration of function `sg_dma_len'
drivers/firewire/fw-sbp2.c:828: warning: implicit declaration of function `sg_dma_address'
drivers/firewire/fw-sbp2.c:837: error: invalid use of undefined type `struct scatterlist'
drivers/firewire/fw-sbp2.c:838: error: invalid use of undefined type `struct scatterlist'

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:36 +01:00
Andrew Morton
cf3e72fd85 firewire: build fix
alpha:

drivers/firewire/fw-ohci.c: In function 'ar_context_tasklet':
drivers/firewire/fw-ohci.c:266: warning: implicit declaration of function 'dma_sync_single_for_device'
drivers/firewire/fw-ohci.c:267: error: 'DMA_TO_DEVICE' undeclared (first use in this function)
drivers/firewire/fw-ohci.c:267: error: (Each undeclared identifier is reported only once
drivers/firewire/fw-ohci.c:267: error: for each function it appears in.)
drivers/firewire/fw-ohci.c: In function 'ar_context_init':
drivers/firewire/fw-ohci.c:282: warning: implicit declaration of function 'dma_map_single'
drivers/firewire/fw-ohci.c:283: error: 'DMA_TO_DEVICE' undeclared (first use in this function)
drivers/firewire/fw-ohci.c:293: error: 'DMA_FROM_DEVICE' undeclared (first use in this function)
etc.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:35 +01:00
Andrew Morton
fcf7770a0b firewire: printk warning fix
drivers/firewire/fw-ohci.c: In function 'ar_context_init':
drivers/firewire/fw-ohci.c:288: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'dma_addr_t'

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:35 +01:00
Kristian Høgsberg
9ba136d0fe firewire: Add SBP-2 protocol driver for storage devices.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:34 +01:00
Kristian Høgsberg
ed5689122f firewire: Add driver for OHCI firewire host controllers.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:34 +01:00
Kristian Høgsberg
19a15b937b firewire: Add device probing and sysfs integration.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:33 +01:00
Kristian Høgsberg
3038e353cf firewire: Add core firewire stack.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-09 22:02:33 +01:00