On 08/24/2011 06:21 PM, Marcel Holtmann wrote:
Hi Philippe,
> Actually, with this dongle, we have 6 TTY (usb0 -> usb5) and usb-devices
> gives:
>
> T: Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 32 Spd=480 MxCh= 0
> D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
> P: Vendor=19d2 ProdID=0124 Rev=00.00
> S: Manufacturer=ZTE,Incorporated
> S: Product=ZTE WCDMA Technologies MSM
> S: SerialNumber=P671A2TMED010000
> C: #Ifs= 7 Cfg#= 1 Atr=e0 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= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
> I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
> I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
> I: If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
> I: If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
>
> Now, ttyUSB5 is not responsive. So, for this particular dongle, the
> modem interface won't be on the last interface. Anyway, as I'm just
> looking to add the condition related to the interface number 04, it
> doesn't really matter.
so on which interfaces do we actually have the modem and the aux channel
now.
Actually, with current udevng.c, aux channel is on ttyUSB1 and modem is
on ttyUSB3. But in practice, modem should be on ttyUSB4.
And more important now, do we use the right usb_modeswitch magic to
switch it into this mode.
My configuration:
usb modeswitch Version 1.1.8, 2011/06/19
usb modeswitch data package 2011/07/14
Or is Windows using something different?
Windows Device Manager gives the following results:
Vendor Id: 19d2 / Product Id: 0124 (same as after usb_modeswitch)
ZTE Diagnostic port - 00
ZTE AT port - 01
ZTE ATExt2 port - 02
ZTE USB SmartCard Reader - 03
ZTE Proprietary USB Modem - 04
ZTE Mobile broadband Network manager - 05
So, it confirms that the modem port com is on ttyUSB4.
For ZTE, the proposed change (add the condition related to the interface
number 04) seems relevant.
Now, I found an other mismatch with Speedup dongles:
In practice, enabling the dongle speedup SU-7300 fails actually in timeout.
Looking to the oFono traces, we have:
...
ofonod[32238]: plugins/udevng.c:setup_speedup()
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1
ofonod[32238]: plugins/udevng.c:setup_speedup() /dev/ttyUSB0 255/255/255
00 (null)
ofonod[32238]: plugins/udevng.c:setup_speedup() /dev/ttyUSB1 255/255/255
01 (null)
ofonod[32238]: plugins/udevng.c:setup_speedup() /dev/ttyUSB2 255/255/255
02 (null)
ofonod[32238]: plugins/udevng.c:setup_speedup() /dev/ttyUSB3 255/255/255
03 (null)
ofonod[32238]: plugins/udevng.c:setup_speedup() /dev/ttyUSB4 255/255/255
04 (null)
ofonod[32238]: plugins/udevng.c:setup_speedup() aux=/dev/ttyUSB1
modem=/dev/ttyUSB3
...
ofonod[32238]: plugins/speedupcdma.c:open_device() Modem /dev/ttyUSB3
ofonod[32238]: src/modem.c:get_modem_property() modem 0x9a0bc00 property Aux
ofonod[32238]: plugins/speedupcdma.c:open_device() Aux /dev/ttyUSB1
ofonod[32238]: Modem: > ATE0 &C0 +CMEE=1\r
ofonod[32238]: Aux: > ATE0 &C0 +CMEE=1\r
ofonod[32238]: Modem: < ATE0 &C0 +CMEE=1\r\r\nOK\r\n
ofonod[32238]: src/modem.c:set_powered_timeout() modem: 0x9a0bc00
Aux channel is not responsive.
As you can see, aux channel is now set to ttyUSB1 whereas it was set
previously to ttyUSB3 (as stated by the rules below).
# SpeedUp 7300
ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9e00",
ENV{ID_USB_INTERFACE_NUM}=="00", ENV{OFONO_SPEEDUP_TYPE}="modem"
ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9e00",
ENV{ID_USB_INTERFACE_NUM}=="03", ENV{OFONO_SPEEDUP_TYPE}="aux"
Looking to the previous ofono rules related to speedup dongles, aux
channel was always assigned to the last interface. Now, with udevng.c,
aux channel is always assigned to ttyUSB1 and modem is set on the last
interface.
So, currently, aux channel and modem channel are switched.
But in practice, this seems wrong.
I tried indeed with a Speedup 9800 and I could notice that the network
registration unsolicited result codes (+CREG, +CGREG) were received on
the modem channel instead of the aux channel. This issue is raised
already by the bug #20553 (Meego)
Now, if the aux channel is set properly on the last interface, the
remaining issue is that the modem channel can't be always assigned on
ttyUSB1.
At least for speedup 7300 (and generally for speedup cdma dongles ?),
modem channel should be assigned to ttyUSB0.
So, I propose the following change in udevng.c:
@@ -311,12 +311,17 @@ static gboolean setup_speedup(struct modem_info
*modem)
if (aux != NULL)
break;
} else if (g_strcmp0(info->interface, "255/255/255") == 0) {
- if (g_strcmp0(info->number, "01") == 0)
- aux = info->devnode;
- else if (g_strcmp0(info->number, "02") == 0)
+ if (g_strcmp0(info->number, "00") == 0 &&
+ g_strcmp0(modem->driver,
+ "speedupcdma") == 0)
mdm = info->devnode;
- else if (g_strcmp0(info->number, "03") == 0)
+ else if (g_strcmp0(info->number, "01") == 0 &&
+ mdm == NULL)
mdm = info->devnode;
+ else if (g_strcmp0(info->number, "02") == 0)
+ aux = info->devnode;
+ else if (g_strcmp0(info->number, "03") == 0)
+ aux = info->devnode;
}
}
Please, let me know if I can go ahead with a proper patch.
Thanks,
Regards,
Philippe.