* help finding entry point of USB data in the kernel, not drivers/usb/core/devio.c?
@ 2008-09-30 5:04 George Nychis
2008-09-30 5:12 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: George Nychis @ 2008-09-30 5:04 UTC (permalink / raw)
To: linux-kernel
Hi all,
I am trying to find the entry point of USB data in the kernel. I have a
USB device and I would like to find the latency between the time the
data enters the kernel, and I read it in userspace. My first goal is to
find where it actually enters the kernel.
The host device driver obtains a URB and reads the data from urb->buffer.
From digging around the kernel code, I had assumed the entry point for
all USB data was in drivers/usb/core/devio.c::usbdev_read() ... but it
seems as though that is not the case.
Right after the device is locked in this function, I added a simple
printk: printk("Reading %d bytes\n", nbytes); // Line 135
Then around line 154 after it reads the usb device descriptor, I added:
if(temp_desc.idVendor==0xfffe && temp_desc.idProduct==0x0002) {
printk("...Data from USRP\n");
}
That gives me an idea that the data is coming from the device I am
looking for.
But, it seems as though this method is only related to control
information to/from the USB device? Whenever I start my application, I
get about 1614 total bytes read from my first printout, and I see only
one of my second printout messages. Whereas, I am reading a total of
about 8MB from the USB device over the period of time. So I think I am
completely missing my actual data entry point.
Additionally, lsusb generates this same exact amount 1614 total bytes of
data... so it seems to be control related to me.
I'd greatly appreciate any guidance.
Thanks!
George
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: help finding entry point of USB data in the kernel, not drivers/usb/core/devio.c?
2008-09-30 5:04 help finding entry point of USB data in the kernel, not drivers/usb/core/devio.c? George Nychis
@ 2008-09-30 5:12 ` Greg KH
2008-09-30 5:22 ` George Nychis
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2008-09-30 5:12 UTC (permalink / raw)
To: George Nychis; +Cc: linux-kernel
On Tue, Sep 30, 2008 at 01:04:26AM -0400, George Nychis wrote:
> Hi all,
>
> I am trying to find the entry point of USB data in the kernel. I have a
> USB device and I would like to find the latency between the time the data
> enters the kernel, and I read it in userspace. My first goal is to find
> where it actually enters the kernel.
I suggest asking this on the linux-usb mailing list instead, it would
reach the main Linux USB developers.
> The host device driver obtains a URB and reads the data from urb->buffer.
Wait, which way are you sending this data? To or from the device?
> From digging around the kernel code, I had assumed the entry point for all
> USB data was in drivers/usb/core/devio.c::usbdev_read() ... but it seems as
> though that is not the case.
No, that entry point is for usbfs, not the individual drivers, and not
the core.
> Right after the device is locked in this function, I added a simple printk:
> printk("Reading %d bytes\n", nbytes); // Line 135
>
> Then around line 154 after it reads the usb device descriptor, I added:
> if(temp_desc.idVendor==0xfffe && temp_desc.idProduct==0x0002) {
> printk("...Data from USRP\n");
> }
>
> That gives me an idea that the data is coming from the device I am looking
> for.
>
> But, it seems as though this method is only related to control information
> to/from the USB device? Whenever I start my application, I get about 1614
> total bytes read from my first printout, and I see only one of my second
> printout messages. Whereas, I am reading a total of about 8MB from the USB
> device over the period of time. So I think I am completely missing my
> actual data entry point.
Are you watching all of the different USB device endpoints?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: help finding entry point of USB data in the kernel, not drivers/usb/core/devio.c?
2008-09-30 5:12 ` Greg KH
@ 2008-09-30 5:22 ` George Nychis
0 siblings, 0 replies; 3+ messages in thread
From: George Nychis @ 2008-09-30 5:22 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel
Greg KH wrote:
> I suggest asking this on the linux-usb mailing list instead, it would
> reach the main Linux USB developers.
Thanks! I was unaware of the list. Punting there also.
> Wait, which way are you sending this data? To or from the device?
I am looking for data from the device to the host.
> No, that entry point is for usbfs, not the individual drivers, and not
> the core.
I see, that explains things.
> Are you watching all of the different USB device endpoints?
>
Yes, I am not filtering really. But if this code is for usbfs, then
this is definitely not what I am looking for.
I think what I am looking for might be in devices.c::usb_device_read()
... poking around there now. It calls usb_device_dump() which takes a
user space buffer as a parameter for which it dumps data in to.
Thanks for the response!
- George
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-09-30 5:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-30 5:04 help finding entry point of USB data in the kernel, not drivers/usb/core/devio.c? George Nychis
2008-09-30 5:12 ` Greg KH
2008-09-30 5:22 ` George Nychis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.