| Age | Commit message (Collapse) | Author |
|
Half the compat_ioctl handling is in devio.c, the other
half is in fs/compat_ioctl.c. This moves everything into
one place for consistency.
As a positive side-effect, push down the BKL into the
ioctl methods.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Cc: Alon Bar-Lev <alon.barlev@gmail.com>
Cc: David Vrabel <david.vrabel@csr.com>
Cc: linux-usb@vger.kernel.org
|
|
This patch (as1283) adds a new flag, USBDEVFS_URB_BULK_CONTINUATION,
to usbfs. It is intended for userspace libraries such as libusb and
openusb. When they have to break up a single usbfs bulk transfer into
multiple URBs, they will set the flag on all but the first URB of the
series.
If an error other than an unlink occurs, the kernel will automatically
cancel all the following URBs for the same endpoint and refuse to
accept new submissions, until an URB is encountered that is not marked
as a BULK_CONTINUATION. Such an URB would indicate the start of a new
transfer or the presence of an older library, so the kernel returns to
normal operation.
This enables libraries to delimit bulk transfers correctly, even in
the presence of early termination as indicated by short packets.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
This patch (as1258) implements a feature that users have been asking
for: It gives programs the ability to "claim" a port on a hub, via a
new usbfs ioctl. A device plugged into a "claimed" port will not be
touched by the kernel beyond the immediate necessities of
initialization and enumeration.
In particular, when a device is plugged into a "claimed" port, the
kernel will not select and install a configuration. And when a config
is installed by usbfs or sysfs, the kernel will not probe any drivers
for any of the interfaces. (However the kernel will fetch various
string descriptors during enumeration. One could argue that this
isn't really necessary, but the strings are exported in sysfs.)
The patch does not guarantee exclusive access to these devices; it is
still possible for more than one program to open the device file
concurrently. Programs are responsible for coordinating access among
themselves.
A demonstration program showing how to use the new interface can be
found in an attachment to
http://marc.info/?l=linux-usb&m=124345857431452&w=2
The patch also makes a small simplification to the hub driver,
replacing a bunch of more-or-less useless variants of "out of memory"
with a single message.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
This patch removes CVS keywords that weren't updated for a long time
from comments.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
This patch (as1079) cleans up the way URB_* flags are exported in
usbfs.
The URB_NO_INTERRUPT flag is now exported (this is the
only behavioral change).
USBDEVFS_URB_* macros are added for URB_NO_FSBR,
URB_ZERO_PACKET, and URB_NO_INTERRUPT, making explicit the
fact that the kernel accepts them.
The flag matching takes into account that the URB_* values
may change as the kernel evolves, whereas the USBDEVFS_URB_*
values must remain fixed since they are a user API.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
fix warning:
drivers/usb/core/devio.c:1226:20: warning: incorrect type in assignment (different address spaces)
drivers/usb/core/devio.c:1226:20: expected void *usercontext
drivers/usb/core/devio.c:1226:20: got void [noderef] <asn:1>*
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
This trivial documentation patch corrects a comment in usbdevice_fs.h; it
previously suggested that the signal would only be sent on error, but I am
told that it is sent on both successful and unsuccessful completion, and
that zero indicates that no signal should be sent.
Signed-off-by: Phil Endecott <spam_from_usb_devel@chezphil.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Use __u32 rather than u32 in userspace ioctl defines.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Signed-off-by: Jeff Garzik <jeff@garzik.org>
|
|
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
|
|
Dell supplied me with the following test:
#include<stdio.h>
#include<errno.h>
#include<sys/ioctl.h>
#include<fcntl.h>
#include<linux/usbdevice_fs.h>
main(int argc,char*argv[])
{
struct usbdevfs_hub_portinfo hubPortInfo = {0};
struct usbdevfs_ioctl command = {0};
command.ifno = 0;
command.ioctl_code = USBDEVFS_HUB_PORTINFO;
command.data = (void*)&hubPortInfo;
int fd, ret;
if(argc != 2) {
fprintf(stderr,"Usage: %s /proc/bus/usb/<BusNo>/<HubID>\n",argv[0]);
fprintf(stderr,"Example: %s /proc/bus/usb/001/001\n",argv[0]);
exit(1);
}
errno = 0;
fd = open(argv[1],O_RDWR);
if(fd < 0) {
perror("open failed:");
exit(errno);
}
errno = 0;
ret = ioctl(fd,USBDEVFS_IOCTL,&command);
printf("IOCTL return status:%d\n",ret);
if(ret<0) {
perror("IOCTL failed:");
close(fd);
exit(3);
} else {
printf("IOCTL passed:Num of ports %d\n",hubPortInfo.nports);
close(fd);
exit(0);
}
return 0;
}
I have verified that it breaks if built in 32 bit mode on x86_64 and that
the patch below fixes it.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
[USBDEVFS] fix inclusion of <linux/compat.h> to avoud header mess
Without moving the include of compat.h down, userspace programs that use
usbdevice_fs.h end up including half the kernel includes (and eventually
fail to compile).
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
From: Christopher Li <chrisl@vmware.com>
- Let usbdevfs directly handle 32 bit URB ioctl. More specifically:
USBDEVFS_SUBMITURB32, USBDEVFS_REAPURB32 and USBDEVFS_REAPURBNDELAY32.
Those asynchronous ioctls are too complicate to handle by the
compatible layer.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
This has been publicised for years now, and the usvfs name will work just
fine with a 2.4 kernel, so we are not breaking backwards compatibility.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
|
|
usb ioctls in compat_ioctl.c switched to compat_alloc_user_space()
and cleaned up; ioctl structures annotated.
|
|
devio.c | 43 +++++++++++++++++++++++--------------------
usbdevice_fs.h | 1 -
2 files changed, 23 insertions(+), 21 deletions(-)
|
|
|
|
This has minor usbcore cleanups:
DOC:
- the changes passing a usb_interface to driver probe() and disconnect()
weren't reflected in their adjacent docs. likewise they still said
it was possible to get a null usb_device_id (no more).
- the (root) hub API restrictions from rmk's ARM patch weren't
flagged
- mention the non-dma-coherent cache issue for usb_buffer_alloc()
- mention disconnect() cleanup issue with usb_{control,bulk}_msg()
[ you can't cancel those urbs from disconnect() ]
CODE
- make driver ioctl() use 'usb_interface' too ... this update
also resolves an old 'one instance per device' bad assumption
- module locking on driver->ioctl() was goofy, kept BKL way too
long and didn't try_inc_mod_count() like the rest of usbcore
- hcd unlink code treated iso inappropriately like interrupt;
only interrupt still wants that automagic mode
- move iso init out of ohci into shared submit_urb logic
- remove interrupt transfer length restriction; hcds that don't
handle packetization (just like bulk :) should be updated,
but device drivers won't care for now.
|
|
This patch fixes two problems that have already been discussed
on this list:
- USB_QUEUE_BULK is rather pointless (and UHCI-specific).
If drivers really want only one bulk urb queued at a time,
they just shouldn't issue such urbs till others complete.
FIX: remove it entirely.
- USB_DISABLE_SPD is horribly named (based on a UHCI flag).
What it really does is turn non-ISO short reads into errors.
FIX: rename it. Now it's URB_SHORT_NOT_OK.
I changed all the drivers using these two flags, including
corresponding changes in the "usbfs" API.
Most of the patch by volume is doc updates:
- Documentation/usb/URB.txt hadn't been updated in two years (!)
and was pretty out of date. It also had many details that were
inappropriately specific to usb-uhci.
- Most of the URB flags weren't even commented as to intent.
- DISABLE_SPD was often documented as if it were SHORT_IS_OK.
- There was still some doc saying how iso should use urb->next.
There are also some related updates:
- Some of the submit sanity checks for transfer flags were
overly broad ... SHORT_NOT_OK is only for reads, NO_FSBR
is for non-periodic requests, ZERO_PACKET only for writes.
- The ohci-hcd code thought SHORT_NOT_OK worked for ISO.
- The uhci-hcd code thought QUEUE_BULK applied to non-bulk
Note that this patch doesn't update any of the "old" HCDs,
including usb-ohci-hcd.
In the case of usb-uhci{,-hcd} it'd have been painful to fix
the QUEUE_BULK logic. That logic was, I think, the original
reason to have that flag! So I count switching to "uhci-hcd"
as a win already ... :)
|
|
This was originally created by David many months ago and posted to the
list, but not put into the kernel.
I modified the original patch to:
-patch against the 2.5.7 kernel
-use the 'real' interface number, not position (to do this I added 2
methods in usb.c)
|
|
- Kai Germaschewski: ISDN updates
- Al Viro: start moving buffer cache indexing to "struct block_device *"
- Greg KH: USB update
- Russell King: fix up some ARM merge issues
- Ingo Molnar: scalable scheduler
|
|
- Davide Libenzi: nicer timeslices for scheduler
- Arnaldo: wd7000 scsi driver cleanups and bio update
- Greg KH: USB update (including initial 2.0 support)
- me: strict typechecking on "kdev_t"
|
|
- merge with Alan (USB, zoran, sony motion-eye, rio, dmi-scan)
|
|
|