1、修改config:
make menuconfig選擇:
Base system ---> udev
Kernel modules ---> USB Support ---> kmod-usb-acm kmod-usb-net kmod-usb-net-qmi-wwan kmod-usb-ohci kmod-usb-serial kmod-usb-serial-option
LuCI ---> Protocols ---> luci-proto-3g luci-proto-qmi
Network ---> uqmi
Utilities ---> usb-modeswitch usbutils
make kernel_menuconfig
進(jìn)入device drivers->usb support->support for host-side usb選擇USB Modem (CDC ACM) support
進(jìn)入U(xiǎn)SB Serial Converter support選擇:
2婴削、修改option.c: build_dir/target-x86_64_musl/linux-x86_64/linux-4.9.146/drivers/usb/serial/option.c 寿酌,加入8300的pid和vid
static const struct usb_device_id option_ids[] = {
加入
drivers/network/usb/qmiw_wan.c文件添加其USB ID,只有這樣當(dāng)modem插入時(shí)內(nèi)核根據(jù)其id就可以加載qmi_wwan驅(qū)動(dòng)了傲隶。
3漩蟆、編譯后發(fā)現(xiàn)/dev下多了ttyUSB1234四個(gè)節(jié)點(diǎn)和cdc-wan0声滥,ifconfig -a多出一個(gè)wwan0。
修改路由配置文件vi /etc/config/network
添加如下內(nèi)容
config interface 'wan'
option device '/dev/cdc-wdm0'
option proto 'qmi'
option apn 'cnnet'
option username 'card'
option password 'card'
option ifname 'wwan0'
打開(kāi)接口界面帐要,wan點(diǎn)擊連接把敞,發(fā)現(xiàn)撥號(hào)成功,可以上網(wǎng)了榨惠。