Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2344794
  • 博文数量: 141
  • 博客积分: 3552
  • 博客等级: 中校
  • 技术积分: 4148
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-15 14:39
个人简介

熟悉Linux下程序设计及各种应用程序 熟悉C Language 熟悉Glusterfs、FFmpeg、CDN 系统设计,计算机图形系统设计、分布式程序设计 目前主要研究方向:流媒体

文章分类

全部博文(141)

分类: LINUX

2010-01-09 09:08:50

首先,这是一个比较简单的问题
我是在Linux下和windows下作了一个对比
 
1,windows下第一次插入该猫的时候,会以一个usb外接存储设备显示出来,并且看上去是一个CD-ROM的Media设备,当在windows下安装完电信的拨号程序以后,这个CDROM的设备就不见了,然后打开windows的超级终端,会看到三个新的串口设备
 
2,在Linux下,无论什么时候插入该猫的时候,都会是一个usb外接存储设备显示出来,并且看上去是一个CD-ROM的Media设备
 
然后通过cat /proc/kmsg获得相关调试信息,我使用的kernel是加了kernel hacking选项的,也就是说,打印信息会多点,方便调试,看到如下信息:
 

[root@localhost liuqi]# cat /proc/kmsg
<7>[ 173.96809]ubub:ubrsm
7[ 7.610 hihd00:01.:rsm othb10 u_eue<> 13980]ec_c 000:d7 eSau ot2sau 083PWRsgjCCCNET<> 13983]hb2010 ot2 tts00 hne00
6cg04et00
7[ 7.837 u -:.:pr ,sau 51 hne00,40M/
<7>[ 174.158650] Monitor-Mwait will be used to enter C-3 state
<7>[ 174.177594] hub 6-0:1.0: hub_resume
<7>[ 174.177645] uhci_hcd 0000:00:1d.0: port 2 portsc 0093,00
<7>[ 174.177654] hub 6-0:1.0: port2:sau 11cag 01<>[ 7.914 hihd00:01.:Gtttspr tts030 OE WE i=e S
7[ 7.929 u -:.: state 7 ports 6 chg 0000 evt 0004
0 v 00<> 14284]hb6010 ot2 tts00,cag 00 2M/
<6>[ 174.380245 s -:nwfl pe S eieuiguc_c n drs
<7>[ 174.516276] usb 6-2: default language 0x0409
<7>[ 174.531319] usb 6-2: udev 2, busnum 6, minor = 641
<6>[ 174.531327] usb 6-2: New USB device found, idVendor=05c6, idProduct=2001
<6>[ 174.531334] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 174.531341] usb 6-2: Product: USB MMC Storage
<6>[ 174.531347] usb 6-2: Manufacturer: Qualcomm, Incorporated
<6>[ 174.531352] usb 6-2: SerialNumber: Mass Storage
<7>[ 174.536313] usb 6-2: adding 6-2:1.0 (config #1, interface 0)
<7>[ 174.536933] usb 6-2:1.0: uevent
<7>[ 174.537241] usb-storage 6-2:1.0: usb_probe_interface
<7>[ 174.537254] usb-storage 6-2:1.0: usb_probe_interface - got id
<7>[ 174.537262] usb-storage: USB Mass Storage device detected
bsoae rtcl rnprn CI<7>[ 174.546717] usb-storage: *** thread sleeping.
<7>[ 174.547697] usb-storage 6-2:1.0: device found
<7>[ 174.547700] usb-storage 6-2:1.0: waiting for device to settle before scanning
<7>[ 174.548539] drivers/usb/core/inode.c: creating file '002'
:qf rtp=1vle00 ne=0ln1<7>[ 179.549322] usb-storage: GetMaxLUN comadrsl s1 aai
7[ 7.460 s-trg:qeeomn ald<> 19593]ubsoae * hedaaee.<> 19594]ubsoae omn NUR 6bts
7[ 7.463 s-trg: 20 00 40
7[ 7.469 s-trg:Bl omn x3235T01L3 2 r U L6<> 1959<7>[ 179.550289] usb-stora:Sttscd ;taserd3/1<> 19509]ubsoae -tase opee<> 19509]ubsoae ukcmadtase eut0<> 19509]ubsoae s_trbl_rnfrsls:xe 6bts nre
<7>[ 179.551311] usb-storae ttscd ;taserd3/6<> 19511]ubsoae -tase opee<> 19511]ubsoae ukdt rnfrrsl x
7[ 7.536 s-trg:Atmtn ogtCW.
7[ 7.538 s-trg:ubso_uktase_u:xe 3bts<7>[ 179.552303] usb-storage: Status code 0; transferred 13/13
<7>[ 179.552305] usb-storage: -- transfer complete
<7>[ 179.552307] usb-storage: Bulk status result = 0
<7>[ 179.552309] usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0
<7>[ 179.552312] usb-storage: scsi cmd done, result=0x0
<7>[ 179.552316] usb-storage: *** thread sleeping.
<5>[ 179.552403] scsi 2:0:0:0: CD-ROM D-Link CDROM 2.31 PQ: 0 ANSI: 2
<7>[ 179.553240] usb-storage: queuecommand called
<7>[ 179.554294] usb-storage: Status code 0; transferred 31/31
<7>[ 179.554296] usb-storage: -- transfer complete
<7>[ 179.554298] usb-storage: Bulk command transfer result=0
<7>[ 179.554300] usb-storage: Attempting to get CSW...
<7>[ 179.554302] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
<7>[ 179.556287] usb-storage: Status code 0; transferred 31/31
<7>[ 179.556289] usb-storage: -- transfer complete
<7>[ 179.556291] usb-storage: Bulk command transfer result=0
<7>[ 179.556293] usb-storage: usb_stor_bulk_transfer_sglist: xfer 18 bytes, 1 entries
<7>[ 179.558286] usb-storage: Status code 0; transferred 13/13
<7>[ 179.558288] usb-storage: -- transfer complete
<7>[ 179.558290] usb-storage: Bulk status result = 0
<7>[ 179.558298] usb-storage: Bulk Status S 0x53425355 T 0x3 R 0 Stat 0x0
<7>[ 179.558300] usb-storage: -- Result from auto-sense is 0
<7>[ 179.558302] usb-storage: -- code: 0x70, key: 0x6, ASC: 0x28, ASCQ: 0x0
<7>[ 179.558305] usb-storage: Unit Attention: Not ready to ready change, medium may have changed
<7>[ 179.558309] usb-storage: scsi cmd done, result=0x2
<7>[ 179.558313] usb-storage: *** thread sleeping.
<7>[ 179.558392] usb-storage: queuecommand called
<7>[ 179.558398] usb-storage: *** thread awakened.
<7>[ 179.558401] usb-storage: Command TEST_UNIT_READY (6 bytes)
<7>[ 179.558402] usb-storage: 00 00 00 00 00 00
<7>[ 179.558408] usb-storage: Bulk Command S 0x43425355 T 0x4 L 0 F 0 Trg 0 LUN 0 CL 6
<7>[ 179.558410] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
<7>[ 179.560357] usb-storage: Status code 0; transferred 13/13
<7>[ 179.560359] usb-storage: -- transfer complete
<7>[ 179.560361] usb-storage: Bulk status result = 0
<7>[ 179.560363] usb-storage: Bulk Status S 0x53425355 T 0x4 R 0 Stat 0x0
<7>[ 179.560366] usb-storage: scsi cmd done, result=0x0
<7>[ 179.560370] usb-storage: *** thread sleeping.
<7>[ 179.560510] usb-storage: queuecommand called
<7>[ 179.560530] usb-storage: *** thread awakened.
<7>[ 179.560533] usb-storage: Command MODE_SENSE_10 (10 bytes)
<7>[ 179.560534] usb-storage: 5a 00 2a 00 00 00 00 00 80 00
<7>[ 179.560543] usb-storage: Bulk Command S 0x43425355 T 0x5 L 128 F 128 Trg 0 LUN 0 CL 10
<7>[ 179.560545] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
<7>[ 179.562299] usb-storage: Status code -121; transferred 32/128
<7>[ 179.562301] usb-storage: -- short read trase
7[ 7.633 s-trg:Bl aatase eut01<> 19520]ubsoae tepigto get CSW...
<7>[ 179.562307] usb-storage:ubso_uktase_u:xe 3bts=0 ne=3ln0<7>[ 179.565286] usb-storage: Status code 0; transferred 13/13
<7>[ 179.565288] usb-storage: -- transfer complete
<7>[ 179.565290] usb-storage: Bulk status result = 0
<7>[ 179.565292] usb-storage: Bulk Status S 0x53425355 T 0x5 R 96 Stat 0x0
<7>[ 179.565295] usb-storage: scsi cmd done, result=0x0
<7>[ 179.565300] usb-storage: *** thread sleeping.
<4>[ 179.565360] sr0: scsi3-mmc drive: 8x/40x writer xa/form2 cdda tray
<6>[ 179.565369] Uniform CD-ROM driver Revision: 3.20
<7>[ 179.566915] sr 2:0:0:0: Attached scsi CD-ROM sr0
<5>[ 179.567541] sr 2:0:0:0: Attached scsi generic sg1 type 5
<7>[ 179.569524] usb-storage: queuecommand called
<7>[ 179.569531] usb-storage: *** thread awakened.
<7>[ 179.569533] usb-storage: Bad target number (3:0)
<7>[ 179.569535] usb-storage: scsi cmd done, result=0x40000
<7>[ 179.569538] usb-storage: *** thread sleeping.

.........................
^C

然后ls /dev就可以看到一些关键设备,比如sr0

[root@localhost liuqi]# ls /dev/
0:0:0:0 dsp loop4 pcmC0D0c random stdout tty28 tty50 usb3 vcs1
adsp event0 loop5 pcmC0D0p rfkill systty tty29 tty51 usb4 vcs2
agpgart event1 loop6 pcmC0D1p root timer tty3 tty52 usb5 vcs3
audio event2 loop7 port rtc tty tty30 tty53 usb6 vcs4
bsg event3 lp0 ppp rtc0 tty0 tty31 tty54 usb7 vcs5
btrfs-control event4 lp1 ptmx scd0 tty1 tty32 tty55 usb8 vcs6
bus event5 lp2 pts sda tty10 tty33 tty56 usbdev1.1 vcsa
cachefiles event6 lp3 ram sda1 tty11 tty34 tty57 usbdev2.1 vcsa1
card0 fb MAKEDEV ram0 sda2 tty12 tty35 tty58 usbdev3.1 vcsa2
cdrom fb0 mapper ram1 sda5 tty13 tty36 tty59 usbdev4.1 vcsa3
cdrw fb1 mcelog ram10 sda6 tty14 tty37 tty6 usbdev5.1 vcsa4
console fd mem ram11 sda7 tty15 tty38 tty60 usbdev6.1 vcsa5
controlC0 full mice ram12 sda8 tty16 tty39 tty61 usbdev6.2 vcsa6
core fuse microcode ram13 sda9 tty17 tty4 tty62 usbdev7.1 vga_arbiter
cpu gpmctl mixer ram14 seq tty18 tty40 tty63 usbdev8.1 XOR
cpu0 hpet mouse0 ram15 sequencer tty19 tty41 tty7 usbmon0 zero
cpu1 hwC0D0 mouse1 ram2 sequencer2 tty2 tty42 tty8 usbmon1
cpu_dma_latency input msr0 ram3 sg0 tty20 tty43 tty9 usbmon2
cuse kmem msr1 ram4 sg1 tty21 tty44 ttyS0 usbmon3
device-mapper kmsg net ram5 shm tty22 tty45 ttyS1 usbmon4
disk log network_latency ram6 snapshot tty23 tty46 ttyS2 usbmon5
dlm-control loop0 network_throughput ram7 snd tty24 tty47 ttyS3 usbmon6
dlm-monitor loop1 null ram8 sr0 tty25 tty48 urandom usbmon7
dlm_plock loop2 ocfs2_control ram9 stderr tty26 tty49 usb1 usbmon8
dri loop3 oldmem ramdisk stdin tty27 tty5 usb2 vcs

然后lsusb可以看到我们的新usb的相关信息

[root@localhost liuqi]# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 004: ID 05c6:2001 Qualcomm, Inc.
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

可以看出来,关键的是:Bus 006 Device 004: ID 05c6:2001 Qualcomm, Inc.

可以看到,其Vendor: 05c6 ProductID:2001

其实这个就是我们刚才看到的/dev/sr0相对应的usb的信息

 

 

可以说,之前说过的都等于白说,仅仅是一些信息的获得,经过观察可以看出来,在windows下安装完拨号程序以后,就看不到cdrom了,这个时候就可以看到串口设备了,那么可以总结,应该是有一个将cdrom给弹出来了,这个时候使用了一下如下命令

eject /dev/sr0

这样就把Media弹出了,然后再lsusb看一下

 

[root@localhost liuqi]# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 005: ID 1e0e:ce16
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub


这回好了,看到结果了,Bus 006 Device 005: ID 1e0e:ce16

结果就是,这个usb的VendorID: 1e0e ProductID:ce16

然后看一下/dev/下的设备

 

[root@localhost liuqi]# ls /dev/
0:0:0:0 dri loop0 msr1 ram15 sda9 tty14 tty34 tty54 usb1 usbmon5
adsp dsp loop1 net ram2 sdb tty15 tty35 tty55 usb2 usbmon6
agpgart event0 loop2 network_latency ram3 seq tty16 tty36 tty56 usb3 usbmon7
audio event1 loop3 network_throughput ram4 sequencer tty17 tty37 tty57 usb4 usbmon8
bsg event2 loop4 null ram5 sequencer2 tty18 tty38 tty58 usb5 vcs
btrfs-control event3 loop5 ocfs2_control ram6 sg0 tty19 tty39 tty59 usb6 vcs1
bus event4 loop6 oldmem ram7 sg1 tty2 tty4 tty6 usb7 vcs2
cachefiles event5 loop7 pcmC0D0c ram8 shm tty20 tty40 tty60 usb8 vcs3
card0 event6 lp0 pcmC0D0p ram9 snapshot tty21 tty41 tty61 usbdev1.1 vcs4
console fb lp1 pcmC0D1p ramdisk snd tty22 tty42 tty62 usbdev2.1 vcs5
controlC0 fb0 lp2 port random stderr tty23 tty43 tty63 usbdev3.1 vcs6
core fb1 lp3 ppp rfkill stdin tty24 tty44 tty7 usbdev4.1 vcsa
cpu fd MAKEDEV ptmx root stdout tty25 tty45 tty8 usbdev5.1 vcsa1
cpu0 full mapper pts rtc systty tty26 tty46 tty9 usbdev6.1 vcsa2
cpu1 fuse mcelog ram rtc0 timer tty27 tty47 ttyS0 usbdev6.3 vcsa3
cpu_dma_latency gpmctl mem ram0 sda tty tty28 tty48 ttyS1 usbdev7.1 vcsa4
cuse hpet mice ram1 sda1 tty0 tty29 tty49 ttyS2 usbdev8.1 vcsa5
device-mapper hwC0D0 microcode ram10 sda2 tty1 tty3 tty5 ttyS3 usbmon0 vcsa6
disk input mixer ram11 sda5 tty10 tty30 tty50 ttyUSB0 usbmon1 vga_arbiter
dlm-control kmem mouse0 ram12 sda6 tty11 tty31 tty51 ttyUSB1 usbmon2 XOR
dlm-monitor kmsg mouse1 ram13 sda7 tty12 tty32 tty52 ttyUSB2 usbmon3 zero
dlm_plock log msr0 ram14 sda8 tty13 tty33 tty53 urandom usbmon4
[root@localhost liuqi]#



多了三个串口设备,这样就对了,接下来就可以使用串口设备了

使用minicom先试试哪个串口好用

 


+CSQ:31, 99

OK

+CGMR: P1.0 DLink_DWM-162-U5_V1.0

OK

^HRSSILVL:99

^HRSSILVL:80


通过AT指令可以看出来,可以玩了,接下来设置一下conf就可以了,这个在网上应该可以找到各种方法来连接,其实都是at指令来配一下而已
阅读(4662) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~