Discussion:
Blocking the submission on urbs to usb core
ashish mahamuni
2007-12-19 08:59:47 UTC
Permalink
Hello Everybody,

I've implemented my own usb filter. (same like usbmon)
I am able to capture all urbs that are generated in
host controller.
But problem is those urbs get submitted to usb core
automatically.
I don't want this. In fact I want this submission
under my control.
How should I do it?
I've my own functions as submit, complete and
submit_error.
I want my code in this functions such that I can pass
those urbs to core or hcd from this place.


------------------------------------------------------------------------
Learning is not compulsory. . . neither is survival.
Cheers
Ashish

website:www.alohatechnology.com



Get the freedom to save as many mails as you wish. To know how, go to http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html

-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Alan Stern
2007-12-19 15:52:24 UTC
Permalink
Post by ashish mahamuni
Hello Everybody,
I've implemented my own usb filter. (same like usbmon)
usbmon is not a filter. It is a communications channel from the kernel
to userspace.
Post by ashish mahamuni
I am able to capture all urbs that are generated in
host controller.
That makes no sense. URBs are not generated in the host controller;
they are generated by drivers.
Post by ashish mahamuni
But problem is those urbs get submitted to usb core
automatically.
What do you mean by "automatically"? No URBs are submitted manually
(that is, by a human being) -- they are all submitted by drivers, and
all drivers run automatically.
Post by ashish mahamuni
I don't want this. In fact I want this submission
under my control.
URB submission is not under your control. You cannot prevent URBs from
being submitted. The most you can do is force submissions to fail.
Post by ashish mahamuni
How should I do it?
I've my own functions as submit, complete and
submit_error.
I want my code in this functions such that I can pass
those urbs to core or hcd from this place.
That is impossible. The submit, submit_error, and complete routines
are called by the core, so they can't pass URBs to the core. And since
the core passes URBs to the HCD, your routines cannot also pass the
URBs to the HCD.

You need to rethink your strategy. I don't know what you are trying to
accomplish, but whatever it is, you are using a bad approach.

Alan Stern


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
ashish mahamuni
2007-12-21 07:23:56 UTC
Permalink
Hello everybody,

I tried to make my urb submission to secure failure.
I've made urb->reject=1 in my submit function.
First time it works fine.
But in normal condition(i.e. after removing my module)
the normal functionality of detecting the device goes
down. Following are the logs.

USB Core Registration Done......
Inside my_urb_complete
Inside my_urb_submit
Inside my_urb_submit_Error
Inside my_urb_submit
Inside my_urb_submit_Error
<3>hub 1-0:1.0: hub_port_status failed (err = -1)

The last statement was not printed by me.
After this no device gets detected.
How can I overcome this problem
Post by ashish mahamuni
Post by ashish mahamuni
Hello Everybody,
I've implemented my own usb filter. (same like
usbmon)
usbmon is not a filter. It is a communications
channel from the kernel
to userspace.
Post by ashish mahamuni
I am able to capture all urbs that are generated
in
Post by ashish mahamuni
host controller.
That makes no sense. URBs are not generated in the
host controller;
they are generated by drivers.
Post by ashish mahamuni
But problem is those urbs get submitted to usb
core
Post by ashish mahamuni
automatically.
What do you mean by "automatically"? No URBs are
submitted manually
(that is, by a human being) -- they are all
submitted by drivers, and
all drivers run automatically.
Post by ashish mahamuni
I don't want this. In fact I want this submission
under my control.
URB submission is not under your control. You
cannot prevent URBs from
being submitted. The most you can do is force
submissions to fail.
Post by ashish mahamuni
How should I do it?
I've my own functions as submit, complete and
submit_error.
I want my code in this functions such that I can
pass
Post by ashish mahamuni
those urbs to core or hcd from this place.
That is impossible. The submit, submit_error, and
complete routines
are called by the core, so they can't pass URBs to
the core. And since
the core passes URBs to the HCD, your routines
cannot also pass the
URBs to the HCD.
You need to rethink your strategy. I don't know
what you are trying to
accomplish, but whatever it is, you are using a bad
approach.
Alan Stern
-
To unsubscribe from this list: send the line
"unsubscribe linux-usb" in
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Alan Stern
2007-12-22 03:27:36 UTC
Permalink
Post by ashish mahamuni
Hello everybody,
I tried to make my urb submission to secure failure.
I've made urb->reject=1 in my submit function.
First time it works fine.
But in normal condition(i.e. after removing my module)
the normal functionality of detecting the device goes
down. Following are the logs.
USB Core Registration Done......
Inside my_urb_complete
Inside my_urb_submit
Inside my_urb_submit_Error
Inside my_urb_submit
Inside my_urb_submit_Error
<3>hub 1-0:1.0: hub_port_status failed (err = -1)
The last statement was not printed by me.
After this no device gets detected.
How can I overcome this problem
You have to turn urb->reject off again.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Greg KH
2007-12-19 16:02:23 UTC
Permalink
Post by ashish mahamuni
Hello Everybody,
I've implemented my own usb filter. (same like usbmon)
What's wrong with usbmon?
Post by ashish mahamuni
I am able to capture all urbs that are generated in
host controller.
host controllers don't generate urbs, drivers do.
Post by ashish mahamuni
But problem is those urbs get submitted to usb core
automatically.
That's because drivers do this :)
Post by ashish mahamuni
I don't want this. In fact I want this submission
under my control.
What exactly are you trying to do here?

confused,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
ashish mahamuni
2007-12-19 17:21:29 UTC
Permalink
I am trying to send those urbs to remote machine,where
I will try to detect my device
This is client-server apporoach
I'll attach device to server,I don't want that device
to be detected on server.
I want this device to be detected on client. i.e. my
remote machine.
Will this approach work?


Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Sergey Vlasov
2007-12-20 10:59:17 UTC
Permalink
Post by ashish mahamuni
I am trying to send those urbs to remote machine,where
I will try to detect my device
This is client-server apporoach
I'll attach device to server,I don't want that device
to be detected on server.
I want this device to be detected on client. i.e. my
remote machine.
There is some code doing this at http://usbip.sourceforge.net/ - did
you look at it?

| USB/IP Project aims to develop a general USB device sharing system
| over IP network. To share USB devices between computers with their
| full functionality, USB/IP encapsulates "USB I/O messages" into IP
| packets and transmits them between computers.

(They use a stub driver on the server side, which by default binds to
all devices.)
ashish mahamuni
2007-12-20 15:39:52 UTC
Permalink
I've looked at that code.
It works across linux to linux. i.e. client and server
should be linux boxes.
USB device doesn't get shared at urb level.
It has to mounted on server and then they made it
available on remote machine(linux client).
I've my tool working on windows to windows.
where I send the urbs over the network.
Once I am able to establish this facility in linux, I
would be able to share the device between windows to
linux and vice versa. Because as we know both uses
same specification(usb 2.0) for urbs.
I've almost done it. Trying to solve few problms
On Wed, Dec 19, 2007 at 05:21:29PM +0000, ashish
Post by ashish mahamuni
I am trying to send those urbs to remote
machine,where
Post by ashish mahamuni
I will try to detect my device
This is client-server apporoach
I'll attach device to server,I don't want that
device
Post by ashish mahamuni
to be detected on server.
I want this device to be detected on client. i.e.
my
Post by ashish mahamuni
remote machine.
There is some code doing this at
http://usbip.sourceforge.net/ - did
you look at it?
| USB/IP Project aims to develop a general USB
device sharing system
| over IP network. To share USB devices between
computers with their
| full functionality, USB/IP encapsulates "USB I/O
messages" into IP
| packets and transmits them between computers.
(They use a stub driver on the server side, which by
default binds to
all devices.)
Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
ashish mahamuni
2007-12-20 04:39:39 UTC
Permalink
On Wed, Dec 19, 2007 at 05:21:29PM +0000, ashish
Post by ashish mahamuni
I am trying to send those urbs to remote
machine,where
Post by ashish mahamuni
I will try to detect my device
This is client-server apporoach
I'll attach device to server,I don't want that
device
Post by ashish mahamuni
to be detected on server.
I want this device to be detected on client. i.e.
my
Post by ashish mahamuni
remote machine.
So you want to send the USB packets from the device
attached to the server to
the client machine, say through a socket? And you
don't want the USB device
driver on the server side to respond to the packets,
you want the client to
respond to them instead?
It sounds like what you want is to replace the
driver for the USB device on the
server side with a driver that sends the USB device
data to the server over a
socket, and sends data received through the socket
to the device. I'm not sure
how a filter would work for this; unless you're
trying to generalize this code
for all devices?
But why do you want the remote machine handle
communication? What underlying
problem are you trying to solve?
The answer is simple.
COnsider the device having driver installed on server,
but not on client.
With above approach. We will be able to use that
device on client.
Sarah
-
To unsubscribe from this list: send the line
"unsubscribe linux-usb" in
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Bring your gang together - do your thing. Go to http://in.promos.yahoo.com/groups


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Loading...