Has anyone had an opportunity to look at the following problem yet? I'd really
appreciate some help. If I'm doing something wrong, I've been unable to spot
it.
----- Forwarded message from Dave Mielke <[EMAIL PROTECTED]> -----
Date: Wed, 31 Dec 2003 17:12:15 -0500
From: Dave Mielke <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: usbfs urb reap problem.
Hi:
I'm getting no response at all when trying to reap a URB via usbfs. If this
isn't the right place to ask this question then would someone please let me
know what might be a more appropriate place. Here are the details.
I'm using the kernel which comes with Fedora Core 1.0.
rpm -q kernel
kernel-2.4.22-1.2129.nptl
uname...
-i i386
-m i686
-o GNU/Linux
-p athlon
-r 2.4.22-1.2129.nptl
-v #1 Mon Dec 1 08:46:47 EST 2003
My modules.conf file contains:
alias usb-controller usb-ohci
alias usb-controller1 ehci-hcd
I'm trying to read data from an interrupt endpoint. It's entry in
/proc/bus/usb/devices is:
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
The routine, and the call to it, whidch I use to submit the URB are as follows:
struct usbdevfs_urb *
usbSubmitRequest (
UsbDevice *device, // ->file contains open usbfs file descriptor
unsigned char endpoint, // 0X81
unsigned char type, // USBDEVFS_URB_TYPE_INTERRUPT
void *buffer, // NULL
int length, // 0X100
unsigned int flags, // 0
void *data // address of list element pointing to urb
) {
struct usbdevfs_urb *urb;
if ((urb = malloc(sizeof(*urb) + length))) {
memset(urb, 0, sizeof(*urb));
urb->endpoint = endpoint;
urb->type = type;
urb->buffer = urb + 1;
if (buffer) memcpy(urb->buffer, buffer, length);
urb->buffer_length = length;
urb->flags = flags;
urb->signr = 0;
urb->usercontext = data;
if (ioctl(device->file, USBDEVFS_SUBMITURB, urb) != -1) return urb;
free(urb);
}
return NULL;
}
Submitting the URB works fine. This is how I try to reap it:
struct usbdevfs_urb *
usbReapRequest (
UsbDevice *device, // ->file contains open usbfs file descriptor
int wait // 1
) {
struct usbdevfs_urb *urb;
printf("reaping\n");
if (ioctl(device->file,
wait? USBDEVFS_REAPURB: USBDEVFS_REAPURBNDELAY,
&urb) == -1) {
urb = NULL;
} else if (!urb) {
errno = EAGAIN;
}
printf("reaped\n");
return urb;
}
The line "reaping" is printed, but the line "reaped" isn't. It appears,
therefore, that the USBDEVFS_REAPURB is waiting forever even when I know that
the device has pending input data. What might I be doing wrong? Thanks.
--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [EMAIL PROTECTED] | Canada K2A 1H7 | if you're concerned about Hell.
http://familyradio.com/ | http://mielke.cc/bible/
----- End forwarded message -----
--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [EMAIL PROTECTED] | Canada K2A 1H7 | if you're concerned about Hell.
http://familyradio.com/ | http://mielke.cc/bible/
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel