据说只要内核版本大于等于3.4即可使用原生高通ndis驱动,这让我兴奋了很久,终于不用自己写驱动,改bug了。于是,从网上下载了ubuntu14.04版本,并将它安装到了自己的pc上。
qiao@qiao-Lenovo-Product:~$ cd /lib/modules/3.13.0-24-generic/kernel/drivers/net/usb/
qiao@qiao-Lenovo-Product:/lib/modules/3.13.0-24-generic/kernel/drivers/net/usb$ ls
asix.ko cdc_ether.ko cdc_subset.ko hso.ko kalmia.ko net1080.ko r8152.ko sierra_net.ko usbnet.ko
ax88179_178a.ko cdc_mbim.ko cx82310_eth.ko huawei_cdc_ncm.ko kaweth.ko pegasus.ko r815x.ko smsc75xx.ko zaurus.ko
catc.ko cdc_ncm.ko dm9601.ko int51x1.ko lg-vl600.ko plusb.ko rndis_host.ko smsc95xx.ko
cdc_eem.ko cdc-phonet.ko gl620a.ko ipheth.ko mcs7830.ko qmi_wwan.ko rtl8150.ko sr9700.ko
qiao@qiao-Lenovo-Product:~$sudo modprobe qmi_wwan
qiao@qiao-Lenovo-Product:~$
sudo echo 1c9e 9b01 > /sys/bus/usb/drivers/qmi_wwan/new_id
qiao@qiao-Lenovo-Product:~$ ls /dev/cdc*
/dev/cdc-wdm0
root@qiao-Lenovo-Product:~# apt-cache search qmi
libqmi-glib-dev - Header files for adding QMI support to applications that use glib
libqmi-glib-doc - API documentation for libqmi-glib
libqmi-glib0 - Support library to use the Qualcomm MSM Interface (QMI) protocol
libqmi-glib0-dbg - Support library to use the Qualcomm MSM Interface (QMI) protocol
libqmi-utils - Utilities to use the QMI protocol from the command line
qmidiarp - MIDI arpeggiator for ALSA
qmidiarp-dbg - Debugging symbols for QMidiArp
qmidinet - MIDI Network Gateway via UDP/IP Multicast
qmidinet-dbg - Debugging symbols for QmidiNet
qmidiroute - a MIDI event router and filter
libqmi-glib1 - Support library to use the Qualcomm MSM Interface (QMI) protocol
libqmi-glib1-dbg - Support library to use the Qualcomm MSM Interface (QMI) protocol
libqmi-proxy - Proxy to communicate with QMI ports
root@qiao-Lenovo-Product:~# apt-get install libqmi-glib-dev
root@qiao-Lenovo-Product:~# apt-get install libqmi-utils
安装完成,先读一个imsi号看看:
qiao@qiao-Lenovo-Product:~$
sudo qmicli -d /dev/cdc-wdm0 --dms-uim-get-imsi
[/dev/cdc-wdm0] UIM IMSI retrieved:
IMSI: '460110580947046'
qiao@qiao-Lenovo-Product:~$
sudo qmicli -d /dev/cdc-wdm0 --dms-get-capabilities
[/dev/cdc-wdm0] Device capabilities retrieved:
Max TX channel rate: '50000000'
Max RX channel rate: '100000000'
Data Service: 'non-simultaneous-cs-ps'
SIM: 'supported'
Networks: 'gsm, umts, lte'
还可以debug qmi 消息:
qiao@qiao-Lenovo-Product:~$
sudo qmicli -d /dev/cdc-wdm0 -v --dms-uim-get-imsi
[26 11月 2014, 20:28:42] [Debug] QMI Device at '/dev/cdc-wdm0' ready
[26 11月 2014, 20:28:42] [Debug] [/dev/cdc-wdm0] Assuming service 'dms' is supported...
[26 11月 2014, 20:28:42] [Debug] [/dev/cdc-wdm0] Allocating new client ID...
[26 11月 2014, 20:28:42] [Debug] [/dev/cdc-wdm0] Sent message...
<<<<<< RAW:
<<<<<< length = 16
<<<<<< data = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:02
关于wds--拨号控制
root@qiao-Lenovo-Product:~#
qmicli -d /dev/cdc-wdm0 --wds-start-network=cnnet
[/dev/cdc-wdm0] Network started
Packet data handle: '1137144008'
在ubuntu下拨号成功后,再看一下openwrt下的qmi_wwan和uqmi表现---基线版本为14.04;
CONFIG_PACKAGE_kmod-qmi-wwan=m --内核
CONFIG_PACKAGE_kmod-usb-wdm=m --内核
CONFIG_PACKAGE_uqmi=m ---system
配置network config:
root@OpenWrt:/# vi /etc/config/network
config interface 'wan'
option device '/dev/cdc-wdm0'
option proto 'qmi'
option apn 'cnnet'
option username 'card'
option password 'card'
option ifname 'wwan0'
重启
然后:ifup wan
拨号成功:
wwan0 Link encap:Ethernet HWaddr BE:EA:5D:CF:6E:3A
inet addr:10.62.117.64 Bcast:10.62.117.67 Mask:255.255.255.252
inet6 addr: fe80::bcea:5dff:fecf:6e3a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:398 errors:0 dropped:0 overruns:0 frame:0
TX packets:501 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17908 (17.4 KiB) TX bytes:31803 (31.0 KiB)
root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-data-status
"connected"
root@OpenWrt:/# ping www.baidu.com
PING www.baidu.com (180.97.33.107): 56 data bytes
64 bytes from 180.97.33.107: seq=0 ttl=53 time=44.515 ms
64 bytes from 180.97.33.107: seq=1 ttl=53 time=43.235 ms