Compile usb ip drivers into kernel

Source: Internet
Author: User
  1. Create a new directory named usbip in "$ (KERNELSOURCE)/drivers/usb/" directory, copy all driver files into that directory. The directory file list below:
    | USB IP
    | ---- Stub. h
    | ---- Stub_tx.c
    | ---- Stub_rx.c
    | ---- Stub_dev.c
    | ---- Stub_main.c
    | ---- Usbip_common.h
    | ---- Usbip_common.c
    | ---- Usbip_event.c
    | ---- Vhci. h
    | ---- Vhci_hcd.c
    | ---- Vhci_rx.c
    | ---- Vhci_tx.c
    | ---- Vhci_sysfs.c
  2. Create a Kconfig file in "usbip" directory with contents below:
    #
    # Usb ip driver configuration
    #
    Comment "usb ip Driver"
    Config USB IP
    Bool "usb ip support"
    Config USBIP_STUB
    Tristate "Usbip stub driver"
    Depends on USB IP
    Config USBIP_VHCI
    Tristate "usb ip vhci driver"
    Depends on USB IP
  3. Modify the Kconfig file of its parent directory "usb", add contents:
    Source "drivers/usb IP/Kconfig"
    Then we can find a item named "usbip" in "Device Driver-> USB devices support" when we use "make menuconfig/xconfig ".
  4. Create a Makefile file in "usbip" directory with contents below:
    Ksource? =/Lib/modules/$ (shell uname-R)/build
    Hcd_header: = $ (ksource)/Drivers/USB/CORE/HCD. h
    Usbip_common_mod-objs: = usbip_common.o usbip_event.o
    Usbip-objs: = stub_dev.o stub_main.o stub_rx.o stub_tx.o
    Vhci-HCD-objs: = vhci_sysfs.o vhci_tx.o vhci_rx.o vhci_hcd.o
    OBJ-$ (config_usbip) + = usbip_common_mod.o
    OBJ-$ (config_usbip_stub) + = usb ip. o
    OBJ-$ (config_usbip_vhci) + = vhci-hcd.o
    Extra_cflags + =-dhcd_header =/"$ (hcd_header )/"
  5. Modify the Makefile file of its parent directory "usb", add contents:
    OBJ-$ (config_usbip) + = usb ip/
    All things done!

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.