Linux USB Gadget Network Experience

Source: Internet
Author: User

Platform: Mini2440

System: linux-2.6.32.2

Host: Windows

When configuring the USB gadget function in the usbnet, the main task is to load the G_ether.ko module, but tried several times to plug into the computer, are not responding, Windows can not identify the device, consult the data before you know is the USB interface pull-up problem, mini2440 via GPC5 to pull the USB interface, only so that the host can identify the device and prompt to install the device. After the integration of the information, the problem is resolved, the steps:

Open mach-mini2440.c Add code:

[HTML]View Plaincopy
  1. static void S3c2410_udc_pullup (enum s3c2410_udc_cmd_e cmd)
  2. {
  3. Switch (CMD) {
  4. Case S3c2410_udc_p_enable:
  5. S3c2410_gpio_cfgpin (S3C2410_GPC (5), s3c2410_gpio_output);
  6. S3c2410_gpio_setpin (S3C2410_GPC (5), 1);
  7. Break
  8. Case S3c2410_udc_p_disable:
  9. S3c2410_gpio_setpin (S3C2410_GPC (5), 0);
  10. Break
  11. Case S3c2410_udc_p_reset:
  12. Break
  13. Default
  14. Break
  15. }
  16. }
[HTML]View Plaincopy
    1. static struct S3c2410_udc_mach_info s3c2410_udc_cfg __initdata = {
    2. . Udc_command = S3c2410_udc_pullup,
    3. };

Add a sentence in the Mini2440_machine_init function:

[HTML]View Plaincopy
  1. static void __init mini2440_machine_init (void)
  2. {
  3. #if defined (lcd_width)
  4. S3c24xx_fb_set_platdata (&mini2440_fb_info);
  5. #endif
  6. S3c_i2c0_set_platdata (NULL);
  7. S3c2410_gpio_cfgpin (S3C2410_GPC (0), s3c2410_gpc0_lend);
  8. S3c_device_nand.dev.platform_data = &friendly_arm_nand_info;
  9. S3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg;
  10. S3c24xx_udc_set_platdata (&S3C2410_UDC_CFG); Add to
  11. Platform_add_devices (Mini2440_devices, Array_size (mini2440_devices));
  12. S3c_pm_init ();

Save close after adding # include <plat/udc.h> header files at the beginning of the program.

Make Menuconfig configuration kernel: Device drivers-usb support-usb Gadget Support

Configuration

Note the cursor configuration, easy to ignore, select s3c2410 USB Device Controller

Configuration complete save exit, make Zimage, start Linux with the new kernel.

Configuration command: Ifconfig usb0 172.20.21.88 up

Connect the D-type interface and the Windows host with USB to prompt for device installation:

Drive: http://download.csdn.net/detail/wu20093346/7914915


Install from a list or a specified location


After installation, a new local connection, modify IP, should be able to and mini2440 board Ping Pass:

Linux USB Gadget Network Experience

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.