Openwrt移植LTE模块
1. 增加具体设备驱动
文档位置:/drivers/usb/serial/option.c 注意:是target开头目录下的文件
在文件中添加如下内容:
static conststruct usb_device_id option_ids[] = {
{USB_DEVICE(0x19d2, 0x0536) },
...
}
0x19d2 和 0x0536 是模块设备的VID 和 PID
可以插入到linux系统上lsusb可以查看其VID和PID的值。
3.编译内核
驱动添加需要配置系统
Linux系统内核,配置方法如下:make menuconfig
Kernel modules—->
USB support --->
Kernel modules —> USB Support —> <*>kmod-usb-acm.
Kernel modules —> USB Support —> <*>kmod-usb-core.
Kernel modules —> USB Support —> <*>kmod-usb-net.
Kernel modules —> USB Support —> <*>kmod-usb-net-asix.
Kernel modules —> USB Support —> <*>kmod-usb-net-cdc-eem.
Kernel modules —> USB Support —> <*>kmod-usb-net-cdc-ether.
Kernel modules —> USB Support —> <*>kmod-usb-net-cdc-mbin
Kernel modules —> USB Support —> <*>kmod-usb-net-cdc-ncm
Kernel modules —> USB Support —> <*>kmod-usb-net-cdc-subset
Kernel modules —> USB Support —> <*>kmod-usb-net-dm9601-ether.
Kernel modules —> USB Support —> <*>kmod-usb-net-hso.
Kernel modules —> USB Support —> <*>kmod-usb-net-ipheth.
Kernel modules —> USB Support —> <*>kmod-usb-net-kalmia.
Kernel modules —> USB Support —> <*>kmod-usb-net-kaweth.
Kernel modules —> USB Support —> <*>kmod-usb-net-mcs7830.
Kernel modules —> USB Support —> <*>kmod-usb-net-pegasus.
Kernel modules —> USB Support —> <*>kmod-usb-net-qmi-wwan.
Kernel modules —> USB Support —> <*>kmod-usb-net-sierrawireless.
Kernel modules —> USB Support —> <*>kmod-usb-ohci.
Kernel modules —> USB Support —> <*>kmod-usb-serial.
Kernel modules —> USB Support —> <*> kmod-usb-serial-ark3316.
Kernel modules —> USB Support —> <*>kmod-usb-serial-ch341.
Kernel modules —> USB Support —> <*>kmod-usb-serial-belkin.
Kernel modules —> USB Support —> <*>kmod-usb-serial-cp210x.
Kernel modules —> USB Support —> <*>kmod-usb-serial-cypress-m8.
Kernel modules —> USB Support —> <*>kmod-usb-serial-ftdi.
Kernel modules —> USB Support —> <*>kmod-usb-serial-ipw.
Kernel modules —> USB Support —> <*>kmod-usb-serial-keyspan.
Kernel modules —> USB Support —> <*>kmod-usb-serial-mct.
Kernel modules —> USB Support —> <*>kmod-usb-serial-mos7720.
Kernel modules —> USB Support —> <*>kmod-usb-serial-motorola-phone.
Kernel modules —> USB Support —> <*>kmod-usb-serial-oti6858.
Kernel modules —> USB Support —> <*>kmod-usb-serial-option.
Kernel modules —> USB Support —> <*>kmod-usb-serial-p12303.
Kernel modules —> USB Support —> <*>kmod-usb-serial-qualcomm.
Kernel modules —> USB Support —> <*>kmod-usb-serial-sierrawireless.
Kernel modules —> USB Support —> <*>kmod-usb-serial-ti-usb.
Kernel modules —> USB Support —> <*>kmod-usb-serial-visor.
Kernel modules —> USB Support —> <*>kmod-usb-serial-wwan.
Kernel modules —> USB Support —> <*>kmod-usb-storage.
Kernel modules —> USB Support —> <*>kmod-usb-storage-extras.
Kernel modules —> USB Support —> <*>kmod-usb-serial-uhci.
Kernel modules —> USB Support —> <*> kmod-usb-wdm
Kernel modules —> USB Support —> <*>kmod-usb2.
Kernel modules —> USB Support —> <*>kmod-usb2-pci
Kernel modules —> USB Support —> <*> kmod-usb3.
这些可以多选,例如我就选了很多,可能我有的没有选全,根据需求自己选择需要的。
然后还需要进入内核编译配置:makekernel_menuconfig进入配置界面
然后设置ppp拨号的配置项:
注意上面选不出*号的话选M就行了
执行make V=s
编译成功截图:
如果想在源码中一键编译实现该功能,首先在源码dl目录下解压linux-3.10.14-p112871.tar.xz
然后重复上诉修改option.c,然后重新打包后,同时修改.config文件,这样就可以实现一键编译了。