The ZTE MF60 uses VID 19d2 PID 2000 in CDROM mode.
I can eject it manually and get the two serial ports, the MMC, CDROM and WWAN ports, but the WWAN port doesn't give me an IP address.
I'm running raspbian Wheezy with kernel 3.12.35 on my Raspberry.
I installed the modeswitch utility version 2.2.1 from January 14th 2015.
Initially the usb_modeswitch rule didn't trigger at all.
Code: Select all
udevadm info -a -p $(udevadm info -q path -n /dev/sr0)
Code: Select all
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3/host15/target15:0:0/15:0:0:0/block/sr0':
KERNEL=="sr0"
SUBSYSTEM=="block"
DRIVER==""
ATTR{ro}=="0"
ATTR{size}=="13452"
ATTR{stat}==" 24 24 192 180 0 0 0 0 0 180 180"
ATTR{range}=="1"
ATTR{discard_alignment}=="0"
ATTR{events}=="media_change eject_request"
ATTR{ext_range}=="1"
ATTR{events_poll_msecs}=="-1"
ATTR{alignment_offset}=="0"
ATTR{inflight}==" 0 0"
ATTR{removable}=="1"
ATTR{capability}=="119"
ATTR{events_async}==""
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3/host15/target15:0:0/15:0:0:0':
KERNELS=="15:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sr"
ATTRS{rev}=="2.31"
ATTRS{type}=="5"
ATTRS{scsi_level}=="3"
ATTRS{model}=="USB SCSI CD-ROM "
ATTRS{state}=="running"
ATTRS{queue_type}=="none"
ATTRS{iodone_cnt}=="0x6d"
ATTRS{iorequest_cnt}=="0x6d"
ATTRS{evt_capacity_change_reported}=="0"
ATTRS{timeout}=="30"
ATTRS{evt_media_change}=="0"
ATTRS{max_sectors}=="240"
ATTRS{ioerr_cnt}=="0x1b"
ATTRS{queue_depth}=="1"
ATTRS{vendor}=="ZTE "
ATTRS{evt_soft_threshold_reached}=="0"
ATTRS{device_blocked}=="0"
ATTRS{evt_mode_parameter_change_reported}=="0"
ATTRS{evt_lun_change_reported}=="0"
ATTRS{evt_inquiry_change_reported}=="0"
ATTRS{iocounterbits}=="32"
ATTRS{eh_timeout}=="10"
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3/host15/target15:0:0':
KERNELS=="target15:0:0"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3/host15':
KERNELS=="host15"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3':
KERNELS=="1-1.3.4:1.3"
SUBSYSTEMS=="usb"
DRIVERS=="usb-storage"
ATTRS{bInterfaceClass}=="08"
ATTRS{bInterfaceSubClass}=="06"
ATTRS{bInterfaceProtocol}=="50"
ATTRS{bNumEndpoints}=="02"
ATTRS{supports_autosuspend}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="03"
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4':
KERNELS=="1-1.3.4"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="1.3.4"
ATTRS{idVendor}=="19d2"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="1"
ATTRS{devnum}=="21"
ATTRS{configuration}=="ZTE Configuration"
ATTRS{bMaxPower}=="500mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="c0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="0000"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="MF60__ZTED010000"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="399"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="ZTE,Incorporated"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="2000"
ATTRS{bDeviceClass}=="00"
ATTRS{product}=="ZTE WCDMA Technologies MSM"
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3':
KERNELS=="1-1.3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{devpath}=="1.3"
ATTRS{idVendor}=="1a40"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="1"
ATTRS{devnum}=="5"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="100mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="4"
ATTRS{bcdDevice}=="0111"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="396"
ATTRS{ltm_capable}=="no"
ATTRS{removable}=="removable"
ATTRS{idProduct}=="0101"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="USB 2.0 Hub"
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1':
KERNELS=="1-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="02"
ATTRS{devpath}=="1"
ATTRS{idVendor}=="0424"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="1"
ATTRS{devnum}=="2"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="2mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="5"
ATTRS{bcdDevice}=="0200"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="57"
ATTRS{ltm_capable}=="no"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="9514"
ATTRS{bDeviceClass}=="09"
looking at parent device '/devices/platform/bcm2708_usb/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{devpath}=="0"
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized_default}=="1"
ATTRS{busnum}=="1"
ATTRS{devnum}=="1"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="1"
ATTRS{bcdDevice}=="0312"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="bcm2708_usb"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="26"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 3.12.35+ dwc_otg_hcd"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0002"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="DWC OTG Controller"
looking at parent device '/devices/platform/bcm2708_usb':
KERNELS=="bcm2708_usb"
SUBSYSTEMS=="platform"
DRIVERS=="dwc_otg"
ATTRS{hnp}=="HstNegScs = 0x0"
ATTRS{srp}=="SesReqScs = 0x1"
ATTRS{regvalue}=="invalid offset"
ATTRS{hsic_connect}=="HSIC Connect = 0x1"
ATTRS{guid}=="GUID = 0x2708a000"
ATTRS{mode}=="Mode = 0x1"
ATTRS{srpcapable}=="SRPCapable = 0x1"
ATTRS{regdump}=="Register Dump"
ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
ATTRS{ggpio}=="GGPIO = 0x00000000"
ATTRS{hprt0}=="HPRT0 = 0x00001005"
ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 370 msecs (37 jiffies)"
ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
ATTRS{busconnected}=="Bus Connected = 0x1"
ATTRS{hcddump}=="HCD Dump"
ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
ATTRS{spramdump}=="SPRAM Dump"
ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
ATTRS{gusbcfg}=="GUSBCFG = 0x00001700"
ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
ATTRS{devspeed}=="Device Speed = 0x0"
ATTRS{fr_interval}=="Frame Interval = 0x1d4c"
ATTRS{rem_wakeup_pwrdn}==""
ATTRS{bussuspend}=="Bus Suspend = 0x0"
ATTRS{buspower}=="Bus Power = 0x1"
ATTRS{hnpcapable}=="HNPCapable = 0x1"
ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 1150 msecs (115 jiffies)"
ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
ATTRS{regoffset}=="0xffffffff"
looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""
Now the rule fires bit it didn't call the script in /lib/udev.
I checked this by adding an debug line into the script.
When udev calls a script PWD is / and PATH is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
so I forced execution of /lib/udev/usb_modeswitch in the rule.
now '%b/%k gives me 1-1.3.4/1-1.3.4:1.3
looking into /lib/udev/usb_modeswitch it seems it expects something entirely different.
Can somebody tell me how to solve this problem?
Regards
Aydan
PS: some more device info:
before eject
Code: Select all
T: Bus=01 Lev=03 Prnt=05 Port=03 Cnt=01 Dev#= 21 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=19d2 ProdID=2000 Rev=00.00
S: Manufacturer=ZTE,Incorporated
S: Product=ZTE WCDMA Technologies MSM
S: SerialNumber=MF60__ZTED010000
C: #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA
I: If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
usb-devices
Code: Select all
T: Bus=01 Lev=03 Prnt=05 Port=03 Cnt=01 Dev#= 22 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=19d2 ProdID=1402 Rev=00.00
S: Manufacturer=ZTE,Incorporated
S: Product=ZTE WCDMA Technologies MSM
S: SerialNumber=MF60__ZTED010000
C: #Ifs= 4 Cfg#= 1 Atr=c0 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
I: If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
Code: Select all
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/5p, 480M
|__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
|__ Port 2: Dev 4, If 0, Class=vend., Driver=rt2800usb, 480M
|__ Port 3: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
|__ Port 4: Dev 22, If 0, Class=vend., Driver=option, 480M
|__ Port 4: Dev 22, If 1, Class=vend., Driver=option, 480M
|__ Port 4: Dev 22, If 2, Class=vend., Driver=qmi_wwan, 480M
|__ Port 4: Dev 22, If 3, Class=stor., Driver=usb-storage, 480M
Code: Select all
[ 4077.639193] usb 1-1.3.4: new high-speed USB device number 22 using dwc_otg
[ 4077.742235] usb 1-1.3.4: New USB device found, idVendor=19d2, idProduct=1402
[ 4077.742270] usb 1-1.3.4: New USB device strings: Mfr=3, Product=2, SerialNumber=4
[ 4077.742286] usb 1-1.3.4: Product: ZTE WCDMA Technologies MSM
[ 4077.742303] usb 1-1.3.4: Manufacturer: ZTE,Incorporated
[ 4077.742316] usb 1-1.3.4: SerialNumber: MF60__ZTED010000
[ 4077.754116] usb-storage 1-1.3.4:1.3: USB Mass Storage device detected
[ 4077.760186] scsi16 : usb-storage 1-1.3.4:1.3
[ 4077.858823] usbcore: registered new interface driver usbserial
[ 4077.858949] usbcore: registered new interface driver usbserial_generic
[ 4077.861130] usbserial: USB Serial support registered for generic
[ 4077.866199] usbcore: registered new interface driver cdc_wdm
[ 4077.908116] usbcore: registered new interface driver option
[ 4077.908252] usbserial: USB Serial support registered for GSM modem (1-port)
[ 4077.910529] qmi_wwan 1-1.3.4:1.2: cdc-wdm0: USB WDM device
[ 4077.920244] qmi_wwan 1-1.3.4:1.2 wwan0: register 'qmi_wwan' at usb-bcm2708_usb-1.3.4, WWAN/QMI device, 22:51:4d:e6:56:78
[ 4077.920537] usbcore: registered new interface driver qmi_wwan
[ 4077.933107] option 1-1.3.4:1.0: GSM modem (1-port) converter detected
[ 4077.936872] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB0
[ 4077.937449] option 1-1.3.4:1.1: GSM modem (1-port) converter detected
[ 4077.938638] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB1
[ 4078.760875] scsi 16:0:0:0: CD-ROM ZTE USB SCSI CD-ROM 2.31 PQ: 0 ANSI: 2
[ 4078.763380] sr0: scsi-1 drive
[ 4078.764195] sr 16:0:0:0: Attached scsi CD-ROM sr0
[ 4078.765331] sr 16:0:0:0: Attached scsi generic sg0 type 5
[ 4078.767329] scsi 16:0:0:1: Direct-Access ZTE MMC Storage 2.31 PQ: 0 ANSI: 2
[ 4078.772280] sd 16:0:0:1: [sda] Attached SCSI removable disk
[ 4078.772414] sd 16:0:0:1: Attached scsi generic sg1 type 0
[ 4079.160352] sr 16:0:0:0: ioctl_internal_command return code = 8070000
[ 4079.160387] : Sense Key : 0x4 [current]
[ 4079.160406] : ASC=0x0 ASCQ=0x0
[ 4079.904491] sr 16:0:0:0: ioctl_internal_command return code = 8070000
[ 4079.904522] : Sense Key : 0x4 [current]
[ 4079.904541] : ASC=0x0 ASCQ=0x0