History

My problems started April 2003 - fix 3 to Smoothwall 2 beta 4 - Mallard. I had problems with my connection failing unpredictably after a few hours under heavy upload (kazaa on the network usually, but ftp'ing a large file to a server on red will sometimes force it) with a message from pppoa3 saying Error reading usb urb.
I reverted to 1.1 modem_run and pppoa3 and ran without problems for months, but I knew I would have to move to 1.2 eventually. The problem looks like this...

Dec 11 17:04:14 smoothwall pppoa3[184]: Error reading usb urb
Dec 11 17:04:14 smoothwall pppoa3[179]: Woken by a sem_post event -> Exiting
Dec 11 17:04:14 smoothwall pppoa3[179]: Read from usb Canceled
Dec 11 17:04:14 smoothwall pppoa3[179]: pusb_release_interface failed
Dec 11 17:04:14 smoothwall pppoa3[179]: Exiting
Dec 11 17:04:14 smoothwall kernel: hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
Dec 11 17:04:14 smoothwall kernel: usb-uhci.c: interrupt, status 2, frame# 835
Dec 11 17:04:14 smoothwall kernel: usb.c: USB disconnect on device 00:14.2-2 address 2
Dec 11 17:04:14 smoothwall kernel: usbdevfs: USBDEVFS_BULK failed dev 2 ep 0x7 len 1643 ret -110
Dec 11 17:04:14 smoothwall pppd[176]: Modem hangup
Dec 11 17:04:14 smoothwall pppd[176]: Connection terminated.
Dec 11 17:04:14 smoothwall pppd[176]: Connect time 217.0 minutes.
Dec 11 17:04:14 smoothwall pppd[176]: Sent 106235053 bytes, received 23664392 bytes

after which only a reboot can get the connection working again. It looked like a hardware problem, but version 1.1 worked OK.

I posted about the problem and waited for a while, but nothing happened and Smoothwall went to 2.0 final with the new versions, so it was time to debug it myself.

First I tried all the software levels, but 1.2 always failed eventually and 1.1 always worked. I tried using a hub in case it was a problem with the 500mA power drain and my chipset, but it failed with the hub.I tried another version of the firmware, still it failed.

So I acquired an old machine and a copy of Redhat 9 2.4.20. First I recompiled version 1.1 and 1.2-beta3 and tested my versions on Smoothwall. The good thing was that they worked, which surprised me, the bad thing was that they showed exactly the same behaviour as the tailored Smoothwall versions.

I then took the CVS of modem_run (4/1/2004 version) and patched it to stop it releasing interface 0, this did nothing as it didn't release interface 0 anyway.

The second attempt changed the code in modem_run to add a new option -e <n> to allow me to chose the alternate endpoint in (pusb_set_interface(fdusb,1,1)) so I could try the endpoint of 2 that had been used in version 1 code. This seems to be "it". By reverting to endpoint 2 I have a version (john2) of 1.2-beta3 that runs for days without crashing.

I have tested firmware versions with the new version of modem_run to see if the fix/problem is firmware dependent, which it initially does not seem to be.

I then tried forcing the endpoint on pppoa3 by adding -e 1 or -e 2 rather than letting it default. I also run with the --clean option set. Forcing it to 2 with -e 2 is a bad idea, pppoa3 just loops with errors. Forcing it to 1 with -e 1 is what I then tried and this failed even with the john2 version of modem_run. So was time to create a version that auto detects the modem revision. This was john4_modem_run , created from the latest CVS, with patches. Then followed by john5 as Rev 0400 need a timed_out = 0; to pretend the load worked cleanly (thanks to Martin Galpin). Why are all these versions 33943 bytes long, its confusing!

I haven't attempted to automate pppoa3 yet, not sure how -e and -r would co-exist.

I have now tested john5_modem_run and john5_pppoa3 on both a Rev 0000 and a Rev 0400 modem (Thanks Brian) and they both work. Gilles has tested on Rev 0200 and Rev 0000 and both work - Thanks again. Does any of this work with Rev 0300 modems or are they very different ?

The Silver modem manages 473kb down 246kb up on my line, using the speed test at adslguide.org, neither better nor worse than the Green frog.

What remained was a fix to co-exist with the kernel mode driver, as pusb_ioctl(fdusb, 1, 1, NULL); is never executed by the subprocess for Rev 0400 modems.This has been done and is in the john6_modem_run version. The fix causes the wait for interrupts for Rev 0400 modems to timeout every 12 seconds and check the line status. The loop finishes when the modem synchronises, rather than continuing to run. I'm not sure this is the correct behaviour, but on my machine it stops these messages...
06:33:32 kernel: usb_control/bulk_msg timeout
06:33:32 kernel: usbdevfs USBDEVFS_BULK failed dev 2 ep 0x81 len 6 ret -110
06:33:32 modem_run[47] ADSL line is up (576 kbit/s down | 288 kbit/s up)
06:33:44 kernel: usb_control/bulk_msg timeout
06:33:44 kernel: usbdevfs USBDEVFS_BULK failed dev 2 ep 0x81 len 6 ret -110
from appearing from the subprocess after the main code has been woken up again.

John5 and john6 were released back to the speedtouch mailing list and Edouard Gomez incorporated the ideas, but coded them better. The CVS was updated and gom38 and gom39 have been compiled and tested. I have stopped work as my job is done and the code I need should now be in the mainstream version.

Release 1.2-final of the speedtouch software contains all the fixes and is now available.

Then, just to cap it all, Version 1.3 of pppoa3 caused me problems with Rev 0.00 modems. Modem_run seems to be OK but pppoa3 crashes regularly under heavy load which is due to it defaulting to alternate_ep =1 rather than unset, which make my green frog unstable. Adding -e -1 works and reverts to the Version 1.2 behaviour.

Test cases and results are on another page or as a spreadsheet

Below are the various modem_run and pppoa3 versions used during my testing, firmware is on this page.

  version kernel source size
110_modem_run 1.1   Smoothwall 2 beta 4 mallard iso 15604
110_pppoa3 1.1   Smoothwall 2 beta 4 mallard iso 31048
110_2420_modem_run 1.1 RH9 2.4.20 1.1 Release compiled on Redhat9 2.4.20 27413
110_2420_pppoa3 1.1 RH9 2.4.20 1.1 Release compiled on Redhat9 2.4.20 45247
121_modem_run 1.2-beta1   Smoothwall 2 beta 4 mallard fix 3 28175
121_pppoa3 1.2-beta1   Smoothwall 2 beta 4 mallard fix 3 45840
121_200-modem_run

1.2-beta1

RH7 2.4.20 Smoothwall Express 2.0 final 16308
121_200_pppoa3 1.2-beta1 RH7 2.4.20 Smoothwall Express 2.0 final 32820
122_modem_run 1.2-beta2   http://www.zen22507.zen.co.uk/ 30884
122_pppoa3 1.2-beta2   http://www.zen22507.zen.co.uk/ 47321
123_modem_run 1.2-beta3 RH9 2.4.20 1.2 beta 3 Release compiled on Redhat9 2.4.20 32744
123_pppoa3 1.2-beta3 RH9 2.4.20 1.2 beta 3 Release compiled on Redhat9 2.4.20 50488
john2_modem_run 1.2-cvs-patched RH9 2.4.20 CVS 04/01/04 + revert to alternate2 (use -e 1 for speedtouch 330) 32833
john2_pppoa3 1.2-cvs-patched RH9 2.4.20 CVS 04/01/04 50580
john3_modem_run 1.2-cvs-patched RH9 2.4.20 First rev detecting version of CVS 04/01/04 33943
john4_modem_run 1.2-cvs-patched RH9 2.4.20 Second Rev detecting version ( use -r [0,2,4] to override ) 33943
john5_modem_run 1.2-cvs-patched RH9 2.4.20 Third Rev detecting version ( use -r [0,2,4] to override ) 33943
john5_pppoa3 1.2-cvs-patched RH9 2.4.20 From CVS on 06/02/04 50647
john5_patch.patch 1.2-cvs-patched RH9 2.4.20 Patch relative to CVS on 06/02/04 16947
john5_src.tar.gz 1.2-cvs-patched RH9 2.4.20 All Sources 52630
john6_modem_run 1.2-cvs-patched RH9 2.4.20 Fourth Rev detecting version ( use -r [0,2,4] to override ) 33943
john6_pppoa3 1.2-cvs-patched RH9 2.4.20 From CVS on 06/02/04 50647
john6_patch.patch 1.2-cvs-patched RH9 2.4.20 Patch relative to CVS on 06/02/04  
john6_src.tar.gz 1.2-cvs-patched RH9 2.4.20 All Sources  
gom38_modem_run 1.2-cvs-patched RH9 2.4.20    
gom38_pppoa3 1.2-cvs-patched RH9 2.4.20    

gom38_src.tar.gz

1.2-cvs-patched RH9 2.4.20    
gom39_modem_run 1.2-cvs-patched RH9 2.4.20    
gom39_pppoa3 1.2-cvs-patched RH9 2.4.20    
gom39_src.tar.gz 1.2-cvs-patched RH9 2.4.20    
12_modem_run 1.2-final RH9 2.4.20 compiled on 21/03/2004 from speedtouch-1.2.tar.gz  
12_pppoa3 1.2-final RH9 2.4.20 compiled on 21/03/2004 from speedtouch-1.2.tar.gz  
speedtouch-1.2.tar.gz 1.2-final RH9 2.4.20 Please download from http://sourceforge.net/projects/speedtouch  
         
alcateladslfw_v1     patched version of alcatedadslfw with -v 1 added for more info 3704

Other Version 4 fixes

The version 4 stuff is here because, after advocating SmoothWall to the folks at work for their new ADSL lines, the ISP delivered silver SpeedTouches which wouldn't work with it and made me look stupid. They are using ICS on WinXP for now - Opportunity missed there.
Here are some other people's fixes for the Rev 0400 problem which I incorporated in my version...

link

source

speedtouch_v4.zip Complete tested package with instructions from amiSMB on the SmoothWall forums - thanks
http://www.nemohackers.org/speedtouch.php Martin Galpin's page

.Things have moved on and Version 1.3 has been available on the sourceforge site since 10th June 2004. These files are pulled out of the rpm file and went in for testing on 10th July. Modem_run seems to be OK but pppoa3 crashes regularly under heavy load which is due to it defaulting to alternate_ep =1 rather than unset, which make my green frog unstable. Adding -e -1 works and reverts to the Version 1.2 behaviour.

link

source

13_modem_run extracted using 'RPM Browser for windows" from speedtouch-1.3-2.i586.rpm
13_pppoa3 extracted using 'RPM Browser for windows" from speedtouch-1.3-2.i586.rpm
speedtouch-1.3.tar.gz Please download from http://sourceforge.net/projects/speedtouch

Version 1.3.1 is now available (30-Sep-2004), this is just a Debian vulnerability fix, so no need for SmoothWall users to upgrade.

Home