sxcjsnj 发表于 2009-11-25 14:27:17

在Linux2.6.16上使用EV-DO USB网卡实现3G无线上网(转)

主处理器:SEP4020(东南大学自主设计SOC,基于ARM720T内核)
开发板:UB4020EVB(1.5)
操作系统:Linux2.6.16
文件系统:BusyBox
无线网卡:中兴通讯(ZTE)3G网卡 AC580,EVDO

编译内核时,主要有几点要求
1、对ppp的支持
2、对usb serial的支持
3、对scsi cdrom 的支持
4、对usb host的支持

下面就是具体操作的流程
好吧,下面是流程
/ # ls /dev
buttons    mtd0ro   nbd5       ram3       tty17      tty37      tty57
cmx865   mtd1       nbd6       ram4       tty18      tty38      tty58
console    mtd1ro   nbd7       ram5       tty19      tty39      tty59
full       mtd2       nbd8       ram6       tty2       tty4       tty6
fuse       mtd2ro   nbd9       ram7       tty20      tty40      tty60
graylcd    mtd3       null       ram8       tty21      tty41      tty61
ic         mtd3ro   port       ram9       tty22      tty42      tty62
kmem       mtdblock0ppp      random   tty23      tty43      tty63
kmsg       mtdblock1printer    rtc      tty24      tty44      tty7
led      mtdblock2psam       sda      tty25      tty45      tty8
loop0      mtdblock3psaux      sg0      tty26      tty46      tty9
loop1      nbd0       pts      tp         tty27      tty47      ttyS0
loop2      nbd1       ptyp5      tty      tty28      tty48      ttyS1
loop3      nbd10      ram0       tty0       tty29      tty49      ttyS2
loop4      nbd11      ram1       tty1       tty3       tty5       ttyS3
loop5      nbd12      ram10      tty10      tty30      tty50      ttyp5
loop6      nbd13      ram11      tty11      tty31      tty51      uba
loop7      nbd14      ram12      tty12      tty32      tty52      urandom
mem      nbd15      ram13      tty13      tty33      tty53      usbdev1.1
mg_card    nbd2       ram14      tty14      tty34      tty54      vcs
mice       nbd3       ram15      tty15      tty35      tty55      vcsa
mtd0       nbd4       ram2       tty16      tty36      tty56      zero
/ # eject /dev/uba                   //用eject命令将uba弹出,然后无线网卡的其他设备才能出来
ub: reading capacity: error -5
ub: reading capacity: size 0
ub: reading capacity: error -5
ub: reading capacity: size 0
/ # usb 1-1: USB disconnect, address 2
usb 1-1: new full speed USB device using s1r72v17 and address 3
usb 1-1: Product: ZTE EVDO Technologies MSM
usb 1-1: Manufacturer: ZTE, Incorporated
usb 1-1: configuration #1 chosen from 1 choice
usbserial_generic 1-1:1.0: generic converter detected
usb 1-1: generic converter now attached to ttyUSB0
usbserial_generic 1-1:1.1: generic converter detected
usb 1-1: generic converter now attached to ttyUSB1
usbserial_generic 1-1:1.2: generic converter detected
usb 1-1: generic converter now attached to ttyUSB2
usbserial_generic 1-1:1.3: generic converter detected
usb 1-1: generic converter now attached to ttyUSB3
ub(1.3): GetMaxLUN returned 0, using 1 LUNs
ub: reading capacity: error -5
ub: reading capacity: size 0
ub: reading capacity: error -5
ub: reading capacity: size 0
ub(1.3): GetMaxLUN returned 0, using 1 LUNs

/ # mdev -s       //主要是多了ttyUSBx 这几个设备节点,当然,必须要有usbserial驱动的支持
/ # ls /dev
buttons    mtd1       nbd7       ram6       tty20      tty41      tty62
cmx865   mtd1ro   nbd8       ram7       tty21      tty42      tty63
console    mtd2       nbd9       ram8       tty22      tty43      tty7
full       mtd2ro   null       ram9       tty23      tty44      tty8
fuse       mtd3       port       random   tty24      tty45      tty9
graylcd    mtd3ro   ppp      rtc      tty25      tty46      ttyS0
ic         mtdblock0printer    sda      tty26      tty47      ttyS1
kmem       mtdblock1psam       sg0      tty27      tty48      ttyS2
kmsg       mtdblock2psaux      tp         tty28      tty49      ttyS3
led      mtdblock3pts      tty      tty29      tty5       ttyUSB0
loop0      nbd0       ptyp5      tty0       tty3       tty50      ttyUSB1
loop1      nbd1       ram0       tty1       tty30      tty51      ttyUSB2
loop2      nbd10      ram1       tty10      tty31      tty52      ttyUSB3
loop3      nbd11      ram10      tty11      tty32      tty53      ttyp5
loop4      nbd12      ram11      tty12      tty33      tty54      uba
loop5      nbd13      ram12      tty13      tty34      tty55      ubb
loop6      nbd14      ram13      tty14      tty35      tty56      urandom
loop7      nbd15      ram14      tty15      tty36      tty57      usbdev1.1
mem      nbd2       ram15      tty16      tty37      tty58      usbdev1.3
mg_card    nbd3       ram2       tty17      tty38      tty59      vcs
mice       nbd4       ram3       tty18      tty39      tty6       vcsa
mtd0       nbd5       ram4       tty19      tty4       tty60      zero
mtd0ro   nbd6       ram5       tty2       tty40      tty61
/ # pppd call cdma&         //这一步是拨号
/ # Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent
rcvd
rcvd
sent
rcvd
sent
rcvd
CHAP authentication succeeded:
CHAP authentication succeeded
sent
sent
rcvd
sent
rcvd
sent
rcvd
sent
rcvd
sent
rcvd
sent
rcvd
not replacing existing default route via 192.168.0.1
localIP address 117.61.124.196
remote IP address 115.168.74.46
primary   DNS address 61.177.7.1
secondary DNS address 218.2.135.1
rcvd
/ # route -n               
Kernel IP routing table
Destination   Gateway         Genmask         Flags Metric Ref    Use Iface
115.168.74.46   0.0.0.0         255.255.255.255 UH    0      0      0 ppp0
192.168.0.0   0.0.0.0         255.255.255.0   U   0      0      0 eth0
0.0.0.0         192.168.0.1   0.0.0.0         UG    0      0      0 eth0
/ # route add default dev ppp0      //将ppp0设置为默认路由
/ # route -n
Kernel IP routing table
Destination   Gateway         Genmask         Flags Metric Ref    Use Iface
115.168.74.46   0.0.0.0         255.255.255.255 UH    0      0      0 ppp0
192.168.0.0   0.0.0.0         255.255.255.0   U   0      0      0 eth0
0.0.0.0         0.0.0.0         0.0.0.0         U   0      0      0 ppp0
0.0.0.0         192.168.0.1   0.0.0.0         UG    0      0      0 eth0
/ # ping www.baidu.com               //现在就能ping通baidu了,当然,必须再/etc/resolv.conf中添加dns
PING www.baidu.com (119.75.213.61): 56 data bytes
the tp time is 0xa851bd57,the triptime is 0x00013a62,the triptime2 is 0xa852f7b9,the triptime3 is 0xa851bd57
64 bytes from 119.75.213.61: seq=0 ttl=58 time=80.482 ms
the tp time is 0xa8612142,the triptime is 0x0001465c,the triptime2 is 0xa862679e,the triptime3 is 0xa8612142
64 bytes from 119.75.213.61: seq=1 ttl=58 time=83.548 ms
the tp time is 0xa8708a2c,the triptime is 0x000146f1,the triptime2 is 0xa871d11d,the triptime3 is 0xa8708a2c
64 bytes from 119.75.213.61: seq=2 ttl=58 time=83.697 ms
--- www.baidu.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 80.482/82.575/83.697 ms

网络连上之后,就能实现一系列应用,下面是在控制台上通过telnet登陆东南大学虎踞龙盘bbs
http://cache.amobbs.com/bbs_upload782111/files_22/ourdev_507109.jpg
(原文件名:3G.jpg)

http://cache.amobbs.com/bbs_upload782111/files_22/ourdev_507110.jpg
(原文件名:seu.jpg)

computerxx 发表于 2009-11-25 14:54:37

不错,参考一下.我也正在搞3G网卡

VERY 发表于 2010-2-22 03:55:26

Å£

clever0725 发表于 2010-9-28 08:58:51

不错不错
页: [1]
查看完整版本: 在Linux2.6.16上使用EV-DO USB网卡实现3G无线上网(转)