Gentoo Archives: gentoo-user

From: Digby Tarvin <digbyt@×××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] USB mobile phone connection..
Date: Thu, 03 Nov 2005 19:58:54
Message-Id: 20051103195037.GH25208@skaro.cthulhu.dircon.co.uk
In Reply to: Re: [gentoo-user] USB mobile phone connection.. by James Hiscock
1 I've had another look at the problem, and at last can report
2 a bit of success - at least I think I have bracketed the problem...
3
4 I started by enabling the USB debug messages in the kernel
5 (CONFIG_USB_DEBUG) to see if that shed any light on what was
6 happening, but it just produced a lot of stuff like:
7 usb 1-1: new full speed USB device using uhci_hcd and address 2
8 uhci_hcd 0000:00:07.2: uhci_result_control: failed with status 440000
9 [cb907240] link (0b9071b2) element (0b03e040)
10 0: [cb03e040] link (0b03e080) e0 Stalled CRC/Timeo Length=7 MaxLen=7 DT0 EndPt
11 =0 Dev=0, PID=2d(SETUP) (buf=0c3d0860)
12 1: [cb03e080] link (0b03e0c0) e3 SPD Active Length=0 MaxLen=3f DT1 EndPt=0 Dev
13 =0, PID=69(IN) (buf=0b31c9a0)
14 2: [cb03e0c0] link (00000001) e3 IOC Active Length=0 MaxLen=7ff DT1 EndPt=0 De
15 v=0, PID=e1(OUT) (buf=00000000)
16
17 which didn't enlighten me very much.
18
19 So I then decided to try something fairly radical and booted a ubuntu live
20 CD which I picked up at a recent show in a different PC, and used
21 'apt-get install' to add all the pre-requisite packages and cvs to
22 download the latest version of moto4lin.
23
24 The first interesting thing that I learned was that the error messages I was
25 getting on connection of the phone are not specific to gentoo - I get exactly
26 the same messages from ubuntu:
27 usb 1-2: new full speed USB device using uhci_hcd and address 2
28 usb 1-2: device descriptor read/64, error -71
29 usb 1-2: device descriptor read/64, error -71
30 usb 1-2: new full speed USB device using uhci_hcd and address 3
31 usb 1-2: device descriptor read/64, error -71
32 cdc_acm 1-2:1.0: ttyACM0: USB ACM device
33 usbcore: registered new driver cdc_acm
34 drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters
35
36 This did produce the '/dev/ttyACM0' device file which you are seeing (rather
37 than the /dev/usb/acm/0 I am seeing on gentoo). It took me several attempts
38 before I found a configuration and sequence that worked, but eventually managed
39 to get the phone recognised in P2K mode and I successfully transfered all
40 accessible files from the phone onto my disk.
41
42 So now I know that my phone and cable are good, and just need track down
43 which difference between these systems is causing my problem with gentoo.
44
45 Havn't worked out yet where the phonebook or SMS inbox/outbox (two items
46 I really wanted to be able to archive from the phone) are stored.
47 Let me know if you have any suggestions.
48
49 Regards,
50 DigbyT
51
52 On Wed, Nov 02, 2005 at 06:46:48PM -0500, James Hiscock wrote:
53 > > Thanks for going to all the trouble of testing out the phone
54 > > operation on your SuSE machine. I havn't had any breakthrough
55 > > yet, but your help has given me the confidence to persevere..
56 >
57 > No problem -- I'm a software tester in Real Life (tm), so stuff like
58 > this bugs the crap out of me. I have a tendency to get a hold of a
59 > problem, and beat it into the ground sometimes, and this is one of
60 > those things that drives me absolutely crazy: inconsistent behaviour
61 > of software is _extremely_ annoying and frustrating - especially when
62 > _I'm_ the one with the "works for me" response, but I can't figure out
63 > what I did (if anything) to solve the problem. <sigh>
64 >
65 > Anyway... I'm not convinced that the problem's in the kernel. If it
66 > was, then anybody with the same kernel would run into the same
67 > problem(s)...
68 >
69 > ...and, following that logic, I started digging through the code for
70 > moto4lin, trying to see if there was anything spectacularly obvious
71 > that _might_ be causing the behaviour we're seeing. In so doing, I
72 > _think_ I _might_ have found a typo in moto_ui/p2kproc.cpp, on line
73 > 729... here's the function where that line appears:
74 >
75 > <snip>
76 >
77 > // Connect to phone.
78 > int P2kProc::drv_connect()
79 > {
80 > FUNC("drv_connect");
81 > int ph=drv_findPhone();
82 > if (ph==PHONE_NONE) RAISE("no phone")
83 > if (ph==PHONE_AT) drv_switchP2K();
84 >
85 > int t;
86 > t=time(NULL);
87 >
88 > while ((time(NULL)-t<5) && (ph!=PHONE_P2K))
89 > {
90 > usb_find_devices();
91 > ph=drv_findPhone();
92 > usleep(10000);
93 > }
94 > if (ph!=PHONE_P2K) return(-1);
95 > return(drv_openPhone());
96 > }
97 > </snip>
98 >
99 > What's got me thinking there's a typo are the following two lines:
100 >
101 > if (ph==PHONE_NONE) RAISE("no phone")
102 > if (ph==PHONE_AT) drv_switchP2K();
103 >
104 > This looks to me like if there's no phone, an error is spit out (to
105 > the terminal, if you started moto4lin from there), then it checks to
106 > see if the phone's in AT mode, and then it tries to switch it to P2K
107 > mode. The problem here is that the switch to P2K will never be
108 > reached, because there's a missing semi-colon at the end of the first
109 > line, which means that if there's no phone _and_ it's in AT mode, then
110 > it'll do the switch... which makes little to no sense to me, if I'm
111 > reading this correctly...
112 >
113 > ...it might be worth trying out, though, to see if adding a semi-colon
114 > here would help, so that it looks like this instead:
115 >
116 > if (ph==PHONE_NONE) RAISE("no phone");
117 > if (ph==PHONE_AT) drv_switchP2K();
118 >
119 > I checked out the current CVS version, using the instructions on the
120 > moto4lin website, and it looks as though this entire function's been
121 > rewritten (and moved to line 857-ish), and would work the way I'm
122 > thinking it should: if it doesn't find a phone, it prints an error;
123 > then it checks to see if it's an AT phone, and switches to P2K mode if
124 > it is...
125 >
126 > ...but - as I said before - I'm a software tester, not a developer...
127 > so it's entirely possible that I'm just jumping at shadows... <shrug>
128 --
129 Digby R. S. Tarvin digbyt@××××××.com
130 http://www.digbyt.com
131 --
132 gentoo-user@g.o mailing list