RE: newbie usb gadget query

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

 



Ok...I'll break up my question into a few simple ones! :)

1) CDC-ACM: For testing gadget-side implementation, with the gadget
serial
   driver loaded, if the device enumerates correctly, it should be
enough
   right?
[Vivek]: Yes that is all. I have tested this on 2.6.17/26, 1st load
gadget then load file_storage works fine with Linux Host and Windows XP.
For this you need to make backing file on your board of say 4MB then
board will be become 4MB memory stick. See this link
www.linux-usb.org/gadget/file_storage.html



2) CDC-ECM: Since the host-side driver works only with a particular type
   of USB-Ethernet chip, can I tweak the ether gadget driver to "fake"
   this device?
[Vivek] this I have not tried till now but I will try some day.
See I think ether.c is hardware independent and will require gadget
driver NOT HOST. This you can tune to your needs.
http://www.linux-usb.org/gadget/

3) Has anybody here worked with compulab's cmx270L board? The problem
I'm
   facing is that I'm unable to STOP the bootloader (ARMMon) from
booting
   the pre-loaded kernel! I need the bootloaders prompt to be able to
load
   a newer kernel to it.
[vivek] I don't know, generally you can burn your kernel image and
rootfs but this is only possible if you get the bootloader prompt.

   I've followed procedure mentioned here:
http://www.compulab.co.il/mediawiki/index.php5?title=Getting_started_wit
h_Linux_on_CM-X270#Image_installation

   But no luck! :(

Thanks again,
-mandeep

On 1/12/09, Vivek Kumar Gupta <gkvivek@xxxxxxxxx> wrote:
> Hi Mandeep,
> Too many question, separate and ask them.
>
> 1. USB Gadget is the basic driver which is nothing but USB Device(or
> Slave driver). This will make the Board as USB Device. But u need more
> other then just this driver.
> 2. Based on Gadget: you can use File Storage Module if you need to
make
> your board as USB Memory stick. Just change few configuration in
> file_storage.c
> like wise there are many modules( or application drivers) which use
> Gadget driver.
>
> Now, Next question: you can compile them separately means outside the
> Linux kernel as module and load them.
>
> Also enable & use USB Mon to see USB Protocol flow.
>
> Grep usb_gadget_register_driver / usb_gadget_unregister_driver API's
to
> see if any body is using them in your kernel.
>
>
> Regards
> Vivek
>
> -----Original Message-----
> From: kernelnewbies-bounce@xxxxxxxxxxxx
> [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Mandeep Sandhu
> Sent: Monday, January 12, 2009 10:57 AM
> To: Kernel Newbies
> Subject: newbie usb gadget query
>
> Hi All,
>
> I had a few doubts regarding USB gadgets under linux. I posted the
> bellow query to the
> linux-usb mailing list, but since I haven't received any replies, I
> thought I'd try my luck here! :)
>
> Please let me know if this is not the right place for this query...
>
> I'm new to USB device driver development. I've mostly done a few LKMs
> (and an ethernet driver) on 2.6 kernels. And this too was sometime
back
> (around 1.5 yrs!)...so my knowledge on a few things might be rusty! :)
>
> I'm working on an embedded board and would like to validate a few
> assumptions here before proceeding to start work on them.
>
> The board is a Compulab CM-X270L (PXA270). This board has USB master
as
> well as a slave port. It's currently running a patched 2.6.16 kernel
> (the patch is from Compulab). It runs Compulab's Debian distribution
>  - "Debian GNU/Linux 3.1".
>
> We need to use the board as a USB slave to a machine which has a USB
> master (root hub). This machine runs a proprietary OS and we do not
> have access to it's source code and/or any other means to access it's
> internals.
>
> This proprietary OS supports the following USB classes:
>
> * CDC-ACM: Full ACM specs
>
> * CDC-ECM: The USB host side diver on the OS, only works with one
>  particular USB-ethernet dongle (say chip-X). So I'm guessing the OS
>  does not support the full ECM specs.
>
> We need to use the board as a slave and test it's interoperability
with
> the host for the above mentioned USB classes.
>
> I plan to do the following:
>
> 1) CDC-ACM: Compile the USB gadget serial driver as a LKM for the
board.
>   If the module loads successfully, connecting the slave port to the
>   host should make it (the slave), enumerate successfully as an ACM
>   device.
>
> 2) CDC-ECM: This one's a bit tricky! I understand that the ethernet is
>   implemented in drivers/usb/gadget/ether.c. But, since the host side
>   driver is written to work with a particular chipset, will it work
>   "AS IS" with the ethernet gadget driver?
>   Also, in case it doesn't work, can I tweak the gadget driver to make
>   it work/enumerate correctly with the host? Basically I'll be
"faking"
>   the chip in s/w...is this possible to do?
>
> Also, how can I verify that the kernel has recognized the USB slave
> device?
> During kernel configuration, we can choose gadget support as a module.
>
> The following link states that the USB device functionality is not
> supported
> in 2.6.16 kernels:
>
>
http://www.compulab.co.il/mediawiki/index.php5?title=Linux_Kernel_for_CM
> -X270#USB_device
>
> Using the link given on the above page...I downloaded the complete
> gadget
> source:
>
http://handhelds.org/cgi-bin/cvsweb.cgi/linux/kernel26/drivers/usb/gadge
> t/?only_with_tag=K2-6-16-DEV
>
> After this, when compiling the kernel, when I enabled the USB gadget
> support,
> I could see the device controller for PXA27x boards. This produced the
> pxa27x_udc LKM. On inserting the module I got the following  error:
>
> pxa27x_udc: exports duplicate symbol usb_gadget_register_driver (owned
> by kernel)
>
> If i grep /proc/kallsyms I can see this symbol exported. Is this
> symbol exported by a
> module or is this due to gadget support being built into the currently
> running kernel?
> There's no way I can find out what configuration the currently runnig
> kernel (2.6.16-cmx270)
> was built, since the required file is not under /boot!!
>
> Another pain-point is the fact that I can't re-flash the kernel on the
> Compulab board with a newer version (I think 2.6.24 has support for
USB
> device). This is because the board directly boots up the kernel and
does
> not stop at the prompt. I've followed the procedure mentioned here:
>
>
http://www.compulab.co.il/mediawiki/index.php5?title=Getting_started_wit
> h_Linux_on_CM-X270#Image_installation
>
> but this doesn't seem to work, the bootloader (ARMMon) still boots the
> kernel
> directly! :( Any clues as to how to circumvent this problem?
>
> Any suggestions are welcome. Thanks for your time.
>
> Regards,
> -mandeep
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux