- 25 3月, 2009 14 次提交
-
-
由 Stefan Richter 提交于
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: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
Based on Date: Tue, 18 Nov 2008 11:41:27 -0500 From: Jay Fenlason <fenlason@redhat.com> 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: NStefan Richter <stefanr@s5r6.in-berlin.de> Tested-by: NDavid Moore <dcm@acm.org>
-
由 Stefan Richter 提交于
Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
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: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
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: NStefan Richter <stefanr@s5r6.in-berlin.de> Reviewed-by: NDavid Moore <dcm@acm.org>
-
由 Stefan Richter 提交于
Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
type function_name(parameters); is nice to look at but was not used consistently. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
"ret" is the new "retval". Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
Like before my commit 1415d918, 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: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Jay Fenlason 提交于
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: NJay Fenlason <fenlason@redhat.com> 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: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
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: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
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: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
So far it is only taken in non-atomic contexts. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Jay Fenlason 提交于
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: NJay Fenlason <fenlason@redhat.com> Update fill_bus_reset_event() accordingly. Include linux/spinlock.h. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 16 10月, 2008 2 次提交
-
-
由 Stefan Richter 提交于
Reported by Jay Fenlason: ioctl() did not return as intended - the size of data read into ioctl_send_request, - the number of datagrams enqueued by ioctl_queue_iso. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
Reported by Jay Fenlason: The iso packet control accessors in fw-cdev.c had bogus masks. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 03 8月, 2008 1 次提交
-
-
由 David Moore 提交于
Recently, a bug having to do with the alignment of transaction response data was fixed. However, some apps such as libdc1394 relied on the presence of that bug in order to function correctly. In order to stay compatible with old versions of those apps, this patch preserves the bug in cases where it is harmless to normal operation (such as the single quadlet read) due to a simple duplication of data. This guarantees maximum compatability for those users who are using the old app with the fixed kernel. Signed-off-by: NDavid Moore <dcm@acm.org> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 20 7月, 2008 1 次提交
-
-
由 JiSheng Zhang 提交于
There will be 4 padding bytes in struct fw_cdev_event_response on some platforms The member:__u32 data will point to these padding bytes. While queue the response and data in complete_transaction in fw-cdev.c, it will queue like this: |response(excluding padding bytes)|4 padding bytes|4 padding bytes|data. It queue 4 extra bytes. That is to say it use "&response + sizeof(response)" while other place of kernel and userspace library use "&response + offsetof (typeof(response), data)". So it will lost the last 4 bytes of data. This patch can fix it while not changing the struct definition. Signed-off-by: NJiSheng Zhang <jszhang3@mail.ustc.edu.cn> This fixes responses to outbound block read requests on 64bit architectures. Tested on i686, x86-64, and x86-64 with i686 userland, using firecontrol and gscanbus. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 19 6月, 2008 1 次提交
-
-
由 Stefan Richter 提交于
Callers of fill_bus_reset_event() have to take card->lock. Otherwise access to node data may oops if node removal is in progress. A lockless alternative would be - event->local_node_id = card->local_node->node_id; + tmp = fw_node_get(card->local_node); + event->local_node_id = tmp->node_id; + fw_node_put(tmp); and ditto with the other node pointers which fill_bus_reset_event() accesses. But I went the locked route because one of the two callers already holds the lock. As a bonus, we don't need the memory barrier anymore because device->generation and device->node_id are written in a card->lock protected section. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: NKristian Høgsberg <krh@redhat.com>
-
- 21 5月, 2008 1 次提交
-
-
由 Jay Fenlason 提交于
If userspace ignores the POLLERR bit from poll(), and only attempts to read() the device when POLLIN is set, it can still make ioctl() calls on a device that has been removed from the system. The node_id and generation returned by GET_INFO will be outdated, but INITIATE_BUS_RESET would still cause a bus reset, and GET_CYCLE_TIMER will return data. And if you guess the correct generation to use, you can send requests to a different device on the bus, and get responses back. This patch prevents open, ioctl, compat_ioctl, and mmap against shutdown devices. Signed-off-by: NJay Fenlason <fenlason@redhat.com> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 18 4月, 2008 1 次提交
-
-
由 Stefan Richter 提交于
When a device changes its configuration ROM, it announces this with a bus reset. firewire-core has to check which node initiated a bus reset and whether any unit directories went away or were added on this node. Tested with an IOI FWB-IDE01AB which has its link-on bit set if bus power is available but does not respond to ROM read requests if self power is off. This implements - recognition of the units if self power is switched on after fw-core gave up the initial attempt to read the config ROM, - shutdown of the units when self power is switched off. Also tested with a second PC running Linux/ieee1394. When the eth1394 driver is inserted and removed on that node, fw-core now notices the addition and removal of the IPv4 unit on the ieee1394 node. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 22 2月, 2008 1 次提交
-
-
由 Stefan Richter 提交于
By supplying ioctl()s in the wrong order, a userspace client was able to trigger NULL pointer dereferences. Furthermore, by calling ioctl_create_iso_context more than once, new contexts could be created without ever freeing the previously created contexts. Thanks to Anders Blomdell for the report. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 16 2月, 2008 1 次提交
-
-
由 Stefan Richter 提交于
There is a race between shutdown and creation of devices: fw-core may attempt to add a device with the same name of an already existing device. http://bugzilla.kernel.org/show_bug.cgi?id=9828 Impact of the bug: Happens rarely (when shutdown of a device coincides with creation of another), forces the user to unplug and replug the new device to get it working. The fix is obvious: Free the minor number *after* instead of *before* device_unregister(). This requires to take an additional reference of the fw_device as long as the IDR tree points to it. And while we are at it, we fix an additional race condition: fw_device_op_open() took its reference of the fw_device a little bit too late, hence was in danger to access an already invalid fw_device. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 31 1月, 2008 2 次提交
-
-
由 Stefan Richter 提交于
fw_device.node_id and fw_device.generation are accessed without mutexes. We have to ensure that all readers will get to see node_id updates before generation updates. Fixes an inability to recognize devices after "giving up on config rom", https://bugzilla.redhat.com/show_bug.cgi?id=429950Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de> Reviewed by Nick Piggin <nickpiggin@yahoo.com.au>. Verified to fix 'giving up on config rom' issues on multiple system and drive combinations that were previously affected. Signed-off-by: NJarod Wilson <jwilson@redhat.com> Signed-off-by: NKristian Høgsberg <krh@redhat.com>
-
由 Stefan Richter 提交于
We have to use the fw_device.generation here, not the fw_card.generation, because the generation must never be newer than the node ID when we emit a transaction. This cannot be guaranteed with fw_card.generation. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de> Verified in concert with subsequent memory barriers patch to fix 'giving up on config rom' issues on multiple system and drive combinations that were previously affected. Signed-off-by: NJarod Wilson <jwilson@redhat.com>
-
- 17 10月, 2007 3 次提交
-
-
由 Jay Fenlason 提交于
Signed-off-by: NJay Fenlason <fenlason@redhat.com> Prompted by https://bugzilla.redhat.com/show_bug.cgi?id=323411Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Stefan Richter 提交于
This duplicates the read cycle timer feature of raw1394 (added in Linux 2.6.21) in firewire-core's userspace ABI. The argument to the ioctl is reordered though to ensure 32/64 bit compatibility. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: NKristian Høgsberg <krh@redhat.com>
-
由 Stefan Richter 提交于
Sparse warned about it although it was apparently harmless: drivers/firewire/fw-cdev.c:624:23: warning: symbol 'interrupt' shadows an earlier one include/asm/hw_irq.h:29:13: originally declared here Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 15 10月, 2007 1 次提交
-
-
由 Al Viro 提交于
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 10 7月, 2007 1 次提交
-
-
由 Stefan Richter 提交于
Use a speed probe to determine the speed over 1394b buses and of nodes which report a link speed less than their PHY speed. Log the effective maximum speed of newly created nodes in dmesg. Also, read the config ROM (except bus info block) at the maximum speed rather than S100. This isn't a real optimization though because we still only use quadlet read requests for the entire ROM. The patch also adds support for S1600 and S3200, although such hardware does not exist yet. Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: NKristian Høgsberg <krh@redhat.com>
-
- 21 6月, 2007 1 次提交
-
-
由 Kristian Høgsberg 提交于
This patch fixes an OOPS on cdev release for an fd where iso context creation failed. Signed-off-by: NKristian Høgsberg <krh@redhat.com> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 01 6月, 2007 1 次提交
-
-
由 Kristian Høgsberg 提交于
The struct is part of the userspace interface and can not use bitfields. This patch replaces the bitfields with a __u32 'control' word and provides access macros to set the bits. Signed-off-by: NKristian Høgsberg <krh@redhat.com> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 28 5月, 2007 1 次提交
-
-
由 Jeff Garzik 提交于
Fix this warning on x86-64 drivers/firewire/fw-cdev.c:798: warning: initialization from incompatible pointer type by making the return code of ioctl_send_request() the same as all the other ioctl_xxx() return codes. Signed-off-by: NJeff Garzik <jeff@garzik.org> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 11 5月, 2007 2 次提交
-
-
由 Kristian Høgsberg 提交于
Signed-off-by: NKristian Hoegsberg <krh@redhat.com> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Kristian Høgsberg 提交于
Drop filenames from file preamble, drop editor annotations and use standard indent style for block comments. Signed-off-by: NKristian Hoegsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (fixed typo)
-
- 01 5月, 2007 3 次提交
-
-
由 Kristian Høgsberg 提交于
Signed-off-by: NKristian Høgsberg <krh@redhat.com> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Kristian Høgsberg 提交于
Currently create context always returns 0 and the other iso ioctls will expect user space to pass that in for subsequent ioctls. Signed-off-by: NKristian Høgsberg <krh@redhat.com> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
由 Kristian Høgsberg 提交于
Also, with this change, refactor ioctl dispatch code to do the copying from and to user space as indicated by the IOC annotations. Signed-off-by: NKristian Høgsberg <krh@redhat.com> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-
- 29 3月, 2007 2 次提交
-
-
由 Kristian Høgsberg 提交于
Signed-off-by: NKristian Høgsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (renamed a variable)
-
由 Kristian Høgsberg 提交于
Generalize the way we keep track of the various resources and assign a unique handle to each resource. Signed-off-by: NKristian Høgsberg <krh@redhat.com> Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
-