Ivo van Doorn [Mon, 12 Jun 2006 14:17:04 +0000 (16:17 +0200)]
CRC ITU-T V.41
This will add the CRC calculation according
to the CRC ITU-T V.41 to the kernel lib/ folder.
This code has been derived from the rt2x00 driver,
currently found only in the wireless-dev tree, but
this library is generic and could be used by more
drivers who currently use their own implementation.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Also useful for the new firewire stack.
Signed-off-by: Kristian Hoegsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Randy Dunlap [Thu, 26 Apr 2007 05:43:16 +0000 (22:43 -0700)]
firewire: don't use extern on public symbols
Make firewire entry points not 'extern':
drivers/firewire/fw-device.c:160:25: warning: function 'fw_device_get' with external linkage has definition
drivers/firewire/fw-device.c:167:13: warning: function 'fw_device_put' with external linkage has definition
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
firewire: Only free ORBs that completed the initial transaction.
In some situations we can receive the ORB status write before we
have received the ORB pointer write response. When this happens,
we assume that the fw_transaction is finished and free the ORB
struct containing the fw_transaction.
This fix make the status write logic only accept status writes
for ORBs where the initial ORB pointer write transaction finished.
Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
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>
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>
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>
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>
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)
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>