<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/firewire/fw-cdev.c, branch v2.6.30</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.30</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.30'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2009-03-24T19:56:50Z</updated>
<entry>
<title>firewire: cdev: add closure to async stream ioctl</title>
<updated>2009-03-24T19:56:50Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-03-10T20:02:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18e9b10fcdc090d3a38606958167d5923c7099b7'/>
<id>urn:sha1:18e9b10fcdc090d3a38606958167d5923c7099b7</id>
<content type='text'>
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 &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: cdev: simplify FW_CDEV_IOC_SEND_REQUEST return value</title>
<updated>2009-03-24T19:56:50Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-03-10T20:01:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=664d8010b170ae8b3ce9268b4f4da934d27b0491'/>
<id>urn:sha1:664d8010b170ae8b3ce9268b4f4da934d27b0491</id>
<content type='text'>
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 &lt; 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 "&amp; 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 &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: cdev: fix race of ioctl_send_request with bus reset</title>
<updated>2009-03-24T19:56:50Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-03-10T20:01:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=207fbefb18de9bc6f871e4008da29879c90cb67e'/>
<id>urn:sha1:207fbefb18de9bc6f871e4008da29879c90cb67e</id>
<content type='text'>
The bus reset handler concurrently frees client-&gt;device-&gt;node.  Use
device-&gt;node_id instead.  This is equivalent to device-&gt;node-&gt;node_id
while device-&gt;generation is current.

Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: cdev: secure add_descriptor ioctl</title>
<updated>2009-03-24T19:56:50Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-03-10T20:00:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=de487da8ca5839d057e1f4b57ee3f387e180b800'/>
<id>urn:sha1:de487da8ca5839d057e1f4b57ee3f387e180b800</id>
<content type='text'>
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 &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: cdev: amendment to "add ioctl to query maximum transmission speed"</title>
<updated>2009-03-24T19:56:49Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-03-10T19:59:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c8a25900f35e575938c791507894c036c0f2ca7d'/>
<id>urn:sha1:c8a25900f35e575938c791507894c036c0f2ca7d</id>
<content type='text'>
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 &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: implement asynchronous stream transmission</title>
<updated>2009-03-24T19:56:49Z</updated>
<author>
<name>Jay Fenlason</name>
<email>fenlason@redhat.com</email>
</author>
<published>2009-03-05T18:08:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f8c2287c65f8f72000102fc058232669e4540bc4'/>
<id>urn:sha1:f8c2287c65f8f72000102fc058232669e4540bc4</id>
<content type='text'>
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 &lt;fenlason@redhat.com&gt;
Signed-off-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt; (tweaks)
</content>
</entry>
<entry>
<title>firewire: cdev: simplify a schedule_delayed_work wrapper</title>
<updated>2009-03-24T19:56:46Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-01-11T12:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81610b8fbfc027a67707ff567d490819a3d55844'/>
<id>urn:sha1:81610b8fbfc027a67707ff567d490819a3d55844</id>
<content type='text'>
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 &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: cdev: add ioctls for iso resource management, amendment</title>
<updated>2009-03-24T19:56:46Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-01-08T22:07:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d9cb7d276a9c465fef5a771792eac2cf1929f2b'/>
<id>urn:sha1:5d9cb7d276a9c465fef5a771792eac2cf1929f2b</id>
<content type='text'>
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 &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: cdev: shut down iso context before freeing the buffer</title>
<updated>2009-03-24T19:56:46Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-01-05T19:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=36a755cfc398fc50abc74055d4478c1b067dac55'/>
<id>urn:sha1:36a755cfc398fc50abc74055d4478c1b067dac55</id>
<content type='text'>
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 &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
<entry>
<title>firewire: cdev: replace some spin_lock_irqsave by spin_lock_irq</title>
<updated>2009-03-24T19:56:45Z</updated>
<author>
<name>Stefan Richter</name>
<email>stefanr@s5r6.in-berlin.de</email>
</author>
<published>2009-01-04T15:23:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3ba949868a6dc082b24cba5c3bf3f50de7391433'/>
<id>urn:sha1:3ba949868a6dc082b24cba5c3bf3f50de7391433</id>
<content type='text'>
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 &lt;stefanr@s5r6.in-berlin.de&gt;
</content>
</entry>
</feed>
