Currently modem_run
(1) ignores the -m flag (it sets "monitoring" but never uses it)
(2) watches if the ADSL line goes up (in a child process) and
signals the parent if it goes up.  After the first signal is sent, the
parent exits so it is pointless to continue to monitor - the signal
is just lost.

I should mention that when the parent exits it releases interface 0
(the one used for line monitoring), however the urb waiting on endpoint
0x81 is allowed to continue rather than being forced to complete with
an error.  This is a bug in the kernel that is about to be fixed (it causes
the oops on system shutdown that some people have been seeing).

This patch causes the child process to exit once the line has gone up.
There is then no point in closing the endpoint on BSD systems, thus I
removed this code.  Also, I consider it wrong to continue submitting an
urb when it completes with an error.  For example, my system used
to grind to a halt because a buggy uhci card caused urbs to fail - but
modem_run would submit this urb endlessly, causing heavy system
load.  Thus if something goes wrong, just say so and exit.

I have to confess that I don't think line monitoring should be in
modem_run at all: I think there should be a seperate program
for that.  I may write one if I find the time...

Duncan.

--- src/modem_run.c.orig        2002-11-16 16:57:19.000000000 +0100
+++ src/modem_run.c     2002-11-16 17:10:11.000000000 +0100
@@ -883,14 +883,6 @@
                        _exit (-1);
                }
 
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 
-               /*
-                * BUG: unless we close the control endpoint, pppoa will
-                *      not be able to open the device.
-                */
-               pusb_close(fdusb);
-#endif
-
                up = 0;
 
                while(1) {
@@ -898,14 +890,11 @@
                        ret = pusb_endpoint_read(ep_int,lbuf,sizeof(lbuf),0);
                        
                        if (ret < 0) {
-                               if(errno == ENODEV) {
+                               if(errno == ENODEV)
                                        report(0, REPORT_INFO, "Device disconnected, 
shutting down");
-                                       break;
-                               }
-                               else {
+                               else
                                        report(0, REPORT_ERROR, "Error reading 
interrupts\n");
-                                       continue;
-                               }
+                               break;
                        }
                        
                        report(1, REPORT_INFO|REPORT_DUMP, "Received interrupt, len = 
%d\n", lbuf, ret, ret);
@@ -920,6 +909,7 @@
                                        report(1, REPORT_INFO, "Sending a signal to 
notify the adsl up state\n");
                                        kill(parent, SIGUSR2);
                                        up = 1;
+                                       break;
                                }
        
                        }


Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe

        

Reply via email to