Re: Simple USB raw data drivers or APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- On Thu, 1/14/10, Greg KH <greg@xxxxxxxxx> wrote:

> From: Greg KH <greg@xxxxxxxxx>
> Subject: Re: Simple USB raw data drivers or APIs
> To: "Ron Madrid" <ron_madrid@xxxxxxxxxxxxx>
> Cc: linux-usb@xxxxxxxxxxxxxxx
> Date: Thursday, January 14, 2010, 3:04 PM
> On Thu, Jan 14, 2010 at 02:21:55PM
> -0800, Ron Madrid wrote:
> > Hello all,
> > 
> > I am working with a custom MPC8313 based board
> running
> > linux and want to have USB communication between my
> board
> > and a host machine.  I would like to make a few
> > statements and find out if my assumptions are
> correct.
> > 
> > 1.  I need to write a gadget driver for my
> board.
> 
> Yes, if the existing ones do not work with your hardware.

I take it you are talking about the ethernet and serial ones?
If not I don't know what you mean by existing ones?

> > 2.  I need to write a device driver for my host
> > machine.
> 
> That depends on the type of usb device you wish your device
> to be.
> If you pick a "class" device, then no, you will not, as the
> host driver
> will already be written (usb storage is an example of
> this.)
>
> > 3.  I need to write application programs that
> open
> > each (respective) driver in order to define the
> > communication between each device.
> 
> No, it depends on what type of USB device you create. 
> If it's a storage
> device, you access it through the "normal" file apis on the
> host
> computer.

That makes sense.

> > Basically, what I want to be able to do is access data
> from
> > my board and send it back to my host machine via USB,
> in a
> > similar fashion as send() recv() in socket
> > programming.  Does there already exist any
> drivers that
> > implement a generic raw data transfer capability that
> can be
> > interfaced in this manner?
> 
> Yes, the ethernet gadget device, or the serial one should
> work.
> 
> > I do already know about the ethernet over usb drivers
> and
> > have tried them in the past.  I want something
> more
> > direct and with less overhead.
> 
> Why do you feel the ethernet gadget has too much overhead?

I was under the impression that after calling send() or recv()
ethernet packets get assembled with the data and these would
then be put into the urbs.  Am I wrong?

> Have you tried the serial one?

I have not.  But I think I'll give it a go.  Worst case it'll
be a good exercise.

I'm mostly worried about speed.  I just want to be able to dump
data as quickly as possible.  If the ethernet or serial drivers
are just as fast as writing my own I can go with those, but I
don't know if that is the case.  If there are speed benefits
from writing my own, that's the route I'll take.

Ron
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux