Of all the gin joints in all the towns in all the world, Chris Frey had to walk into mine and say:
> Hi Bill, > > Thanks for your bug report! > > On Fri, Jan 16, 2009 at 10:28:58AM -0800, Bill Paul wrote: > > I don't know for sure what's causing the problem yet, but I have a > > suspicion. Looking at the log file generated by pppob, there seems to be > > a pattern to the data transfer. In particular, whenever pppob does a USB > > bulk write, it's typically followed by a USB bulk read of an "IPModem > > special packet." The DataReadThread() method in m_ipmodem.cc does not do > > any special processing of these messages and just discards them, but I > > think this might be the wrong behavior. It looks an awful lot like these > > messages are write completion acknowledgements; if so, I think the right > > thing to do is wait for the acknowledgement after each write before > > proceeding to the next write. > > This is a good idea. I think it should be possible to add a pthread > condition on the write, without too much difficulty. Are you able to > compile and test the latest CVS/git sources? I'll see if I can whip up > a patch tonight. I'll see if I can give it a try when I get home from work later. [...] > When I started writing the modem support for Barry, I wanted to do it the > same way, using select(). Unfortunately, I was not able to do this easily. > I wanted to keep using libusb, since this gives me easier cross-platform > compatibility. Indeed, you probably wouldn't be using Barry on FreeBSD > at all without libusb. > > The current stable version of libusb does not make it easy to use select() > on its read operations, nor does it provide asynchronous calls. Even > earlier in Barry's development I started using the devel branch of libusb > in order to use those asynchronous calls, but that was years ago, and > the old stable libusb is still the main one, so I dropped that in favour > of a stable libusb that is available everywhere. > > So that left threads, and that's the API we have today. Yeah, after I sent my e-mail earlier, I grabbed the source to libusb, and I noticed that. It shouldn't be too hard to add an API to libusb to extract the underlying file descriptors, but as you say, that would be a non-standard patch to it. > > Oh, a few notes on getting pppob to work with FreeBSD: > > > > - Building barry fails unless you have GCC 4. This is because the > > router.cc module seems to depend on something called C++ Technical Report > > 1 library extensions, which are not present in GCC 3. (Current versions > > of FreeBSD include GCC 4 in the base install, but FreeBSD 6.0 comes with > > GCC 3.4.4. This means I had to build a newer GCC on my laptop before I > > could compile barry.) Is it really necessary to make the code dependent > > on this extension? > > The tr1 headers are only used for the shared_ptr<> template. So > technically, there are 3 ways to proceed: [...] *looks up what shared_ptr<> is supposed to do* Oh, I see. Well, ok then. > I realize there's some inconvenience, but in the greater scheme of things, > I think keeping up with C++ standards is important enough to bear a little > upgrade pain. I'm going to bite my tongue, lest this descend into a C vs. C++ war. :) > > - The version of pppd included with FreeBSD is 2.3 patch level 5. Linux > > seems to use pppd 2.4. The main problem with this is that the "pty" > > directive doesn't exist in pppd 2.3pl5, which makes it hard to use > > pppob with it. I found a workaround for this, but I still had problems > > (pppd would not negotiate a link). I finally gave up on pppd and used > > the user-space ppp(8) utility in FreeBSD, and had better luck with it. > > (The one trick to it seems to be that you have to disable VJ header > > compression.) > > I'm glad there was a workaround. Is there any reason why FreeBSD is still > using 2.3? If my web search was correct, it appears that pppd 2.4 was > released in 2000. That's a good question. I think interest in pppd dropped off a lot once the user mode ppp(8) application was introduced. Getting it updated would require some interest from a developer, and nobody seems to want to get tagged with it. Unfortunately, upgrading it from 2.3 to 2.4 is non-trivial: the stock pppd distribution only supports Linux and SunOS by default, and there seem to be enough differences between the two versions that updating FreeBSD's OS-specific sys-bsd.c module would take a bit of work and testing. The workaround I used, by the way, was to bind pppob to a pseudo-terminal by starting it with a ptyexec perl script that I discovered here: http://www.mail-archive.com/gnh...@zk3.dec.com/msg05685.html It's a bit clumsy, but it works. -Bill > - Chris -- ============================================================================= -Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu wp...@windriver.com | Wind River Systems ============================================================================= "I put a dollar in a change machine. Nothing changed." - George Carlin ============================================================================= ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Barry-devel mailing list Barry-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/barry-devel