Revision: 6824
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6824&view=rev
Author:   owes
Date:     2012-11-02 17:52:29 +0000 (Fri, 02 Nov 2012)
Log Message:
-----------
Add GUI support for Traverse Solos PCI ADSL2+.
We already had all tools but lacked the option in the GUI and a rc.d helper 
script.
This does not add support for the mlppp bonding capability. Will need to think 
about how to best implement that.

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/pppsetup.cgi
    ipcop/trunk/src/rc.d/rc.red
    ipcop/trunk/updates/2.1.0/ROOTFILES.i486-2.1.0

Added Paths:
-----------
    ipcop/trunk/src/rc.d/rc.solosdsl

Modified: ipcop/trunk/html/cgi-bin/pppsetup.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/pppsetup.cgi       2012-11-02 17:45:19 UTC (rev 
6823)
+++ ipcop/trunk/html/cgi-bin/pppsetup.cgi       2012-11-02 17:52:29 UTC (rev 
6824)
@@ -97,7 +97,7 @@
 }
 elsif ($pppsettings{'ACTION'} eq $Lang::tr{'refresh'}) {
     unless ($pppsettings{'TYPE'} =~
-/^(modem|serial|isdn|pppoe|pptp|alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl|wanpipe-serial)$/
+/^(modem|serial|isdn|pppoe|pptp|alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|solosdsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl|wanpipe-serial)$/
         )
     {
         $errormessage = $Lang::tr{'invalid input'};
@@ -269,7 +269,7 @@
     }
 
     if ($pppsettings{'TYPE'} =~
-/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
+/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|solosdsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
         )
     {
         if (($pppsettings{'VPI'} eq '') || ($pppsettings{'VCI'} eq '')) {
@@ -440,6 +440,7 @@
 $selected{'TYPE'}{'pptp'}               = '';
 $selected{'TYPE'}{'alcatelusb'}         = '';
 $selected{'TYPE'}{'pulsardsl'}          = '';
+$selected{'TYPE'}{'solosdsl'}           = '';
 $selected{'TYPE'}{'eciadsl'}            = '';
 $selected{'TYPE'}{'fritzdsl'}           = '';
 $selected{'TYPE'}{'bewanadsl'}          = '';
@@ -661,6 +662,7 @@
 print <<END
     <option value='fritzdsl' $selected{'TYPE'}{'fritzdsl'}>Fritz!DSL</option>
     <option value='pulsardsl' $selected{'TYPE'}{'pulsardsl'}>Pulsar 
ADSL</option>
+    <option value='solosdsl' $selected{'TYPE'}{'solosdsl'}>Solos PCI 
ADSL2+</option>
     <option value='bewanadsl' $selected{'TYPE'}{'bewanadsl'}>Bewan ADSL PCI 
st/USB st</option>
     <option value='conexantpciadsl' 
$selected{'TYPE'}{'conexantpciadsl'}>Conexant PCI ADSL</option>
     <option value='wanpipe-adsl' $selected{'TYPE'}{'wanpipe-adsl'}>Sangoma 
S518 adsl</option>
@@ -892,7 +894,7 @@
     }
 
     if ($pppsettings{'TYPE'} =~
-/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
+/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|solosdsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
         )
     {
         print <<END
@@ -997,7 +999,7 @@
     }
 
     if ($pppsettings{'TYPE'} =~
-/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
+/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|solosdsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
         )
     {
         print <<END
@@ -1015,7 +1017,7 @@
     }
 
     if ($pppsettings{'TYPE'} =~
-/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|eciadsl|bewanadsl|eagleusbadsl|fritzdsl|wanpipe-adsl)$/
+/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|solosdsl|eciadsl|bewanadsl|eagleusbadsl|fritzdsl|wanpipe-adsl)$/
         )
     {
         print <<END
@@ -1032,7 +1034,7 @@
     }
 
     if ($pppsettings{'TYPE'} =~
-/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
+/^(alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|solosdsl|eciadsl|fritzdsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
         )
     {
         print <<END
@@ -1082,7 +1084,7 @@
     }
 
     if ($pppsettings{'TYPE'} =~
-/^(pppoe|alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|eciadsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
+/^(pppoe|alcatelusb|amedynusbadsl|conexantusbadsl|conexantpciadsl|3cp4218usbadsl|pulsardsl|solosdsl|eciadsl|bewanadsl|eagleusbadsl|wanpipe-adsl)$/
         )
     {
         print <<END

Modified: ipcop/trunk/src/rc.d/rc.red
===================================================================
--- ipcop/trunk/src/rc.d/rc.red 2012-11-02 17:45:19 UTC (rev 6823)
+++ ipcop/trunk/src/rc.d/rc.red 2012-11-02 17:52:29 UTC (rev 6824)
@@ -91,8 +91,9 @@
     #if ($pppsettings{'TYPE'} ne 'fritzdsl')    {
     #   system('/sbin/modprobe', '-r', 'fcdsl', 'fcdsl2', 'fcdslsl');}
     if ($pppsettings{'TYPE'} ne 'pulsardsl') { system('/sbin/modprobe', '-r', 
'pulsar'); }
+    if ($pppsettings{'TYPE'} ne 'solosdsl')  { system('/sbin/modprobe', '-r', 
'solos_pci'); }
     sleep 1;
-    if ($pppsettings{'TYPE'} !~ /^(alcatelusb|conexantpciadsl|pulsardsl)$/) {
+    if ($pppsettings{'TYPE'} !~ 
/^(alcatelusb|conexantpciadsl|pulsardsl|solos_pci)$/) {
         system('/sbin/modprobe', '-r', 'atm');
     }
 
@@ -238,12 +239,13 @@
     elsif ($pppsettings{'TYPE'} eq 'pppoe')           { &dopppoedial(); }
     elsif ($pppsettings{'TYPE'} eq 'pptp')            { &dopptpdial(); }
     elsif ($pppsettings{'TYPE'} eq 'alcatelusb')      { &doatmdial(); }
-    elsif ($pppsettings{'TYPE'} eq 'pulsardsl')       { &dopulsardsldial(); }
+    elsif ($pppsettings{'TYPE'} eq 'pulsardsl')       { 
&doatmprepare($pppsettings{'TYPE'}); }
+    elsif ($pppsettings{'TYPE'} eq 'solosdsl')        { 
&doatmprepare($pppsettings{'TYPE'}); }
     elsif ($pppsettings{'TYPE'} eq 'eciadsl')         { &doeciadsldial(); }
     elsif ($pppsettings{'TYPE'} eq 'fritzdsl')        { &dofritzdsldial(); }
     elsif ($pppsettings{'TYPE'} eq 'eagleusbadsl')    { &doeagleusbadsldial(); 
}
     elsif ($pppsettings{'TYPE'} eq 'conexantpciadsl') { 
&doconexantpciadsldial(); }
-    elsif ($pppsettings{'TYPE'} eq 'wanpipe-adsl')    { &dowanpipeadsldial(); }
+    elsif ($pppsettings{'TYPE'} eq 'wanpipe-adsl')    { 
&doatmprepare($pppsettings{'TYPE'}); }
     elsif ($pppsettings{'TYPE'} eq 'wanpipe-serial')  { 
&dowanpipeserialdial(); }
 
     if (-e "/var/ipcop/ppp/updatesettings") {
@@ -339,6 +341,7 @@
         if ($pppsettings{'TYPE'} eq 'eagleusbadsl')    { 
system('/etc/rc.d/rc.eagleusbadsl',    'stop'); }
         if ($pppsettings{'TYPE'} eq 'fritzdsl')        { 
system('/etc/rc.d/rc.fritzdsl',        'stop'); }
         if ($pppsettings{'TYPE'} eq 'pulsardsl')       { 
system('/etc/rc.d/rc.pulsardsl',       'stop'); }
+        if ($pppsettings{'TYPE'} eq 'solosdsl')        { 
system('/etc/rc.d/rc.solosdsl',        'stop'); }
         if ($pppsettings{'TYPE'} =~ /wanpipe/) { 
system('/etc/rc.d/rc.wanpipe', 'stop'); }
     }
 
@@ -381,6 +384,7 @@
     if ($pppsettings{'TYPE'} eq 'fritzdsl')        { 
system('/etc/rc.d/rc.fritzdsl',        'cleanup'); }
     if ($pppsettings{'TYPE'} eq 'eagleusbadsl')    { 
system('/etc/rc.d/rc.eagleusbadsl',    'cleanup'); }
     if ($pppsettings{'TYPE'} eq 'conexantpciadsl') { 
system('/etc/rc.d/rc.conexantpciadsl', 'cleanup'); }
+    if ($pppsettings{'TYPE'} eq 'solosdsl')        { 
system('/etc/rc.d/rc.solosdsl',        'cleanup'); }
 }
 
 sub domodemdial {
@@ -1079,31 +1083,42 @@
     }
 }
 
-sub dopulsardsldial {
-    if (system('/etc/rc.d/rc.pulsardsl', 'start')) {
-        &General::log('red', 'ERROR: PULSAR ADSL modem failed to start');
-        myexit(1);
-    }
-    doatmdial();
-}
 
+sub doatmprepare {
+    my $type = shift;
+    my $script = "/etc/rc.d/rc.${type}";
+    my $error;
 
-sub doconexantpciadsldial {
-    if (system('/etc/rc.d/rc.conexantpciadsl', 'start')) {
-        &General::log('red', 'ERROR: Conexant PCI ADSL modem failed to start');
+    if ($type eq 'conexantpciadsl') {
+        $error = 'ERROR: Conexant PCI ADSL modem failed to start';
+    }
+    elsif ($type eq 'pulsardsl') {
+        $error = 'ERROR: PULSAR ADSL modem failed to start';
+    }
+    elsif ($type eq 'solosdsl') {
+        $error = 'ERROR: Solos PCI modem failed to start';
+    }
+    elsif ($type eq 'wanpipe-adsl') {
+        $script = '/etc/rc.d/rc.wanpipe';
+        $error = 'ERROR: wanpipe adsl failed to start';
+    }
+    else {
+        &General::log('red', 'ERROR: Called ATM prepare with unsupported 
type');
         myexit(1);
     }
-    doatmdial();
-}
 
-sub dowanpipeadsldial {
-    if (system('/etc/rc.d/rc.wanpipe', 'start')) {
-        &General::log('red', 'ERROR: wanpipe adsl failed to start');
+    if (! -e $script) {
+        &General::log('red', "ERROR: missing script $script");
         myexit(1);
     }
+    if (system($script, 'start')) {
+        &General::log('red', $error);
+        myexit(1);
+    }
     doatmdial();
 }
 
+
 sub doatmdial {
     my $ENCAP;
     if ($pppsettings{'PROTOCOL'} eq 'RFC2364') {
@@ -1218,6 +1233,10 @@
             }
         }
     }
+    else {
+        &General::log('red', 'atm, no RFC2364 and no RFC1483');
+        myexit(1);
+    }
 }
 
 sub dowanpipeserialdial {

Added: ipcop/trunk/src/rc.d/rc.solosdsl
===================================================================
--- ipcop/trunk/src/rc.d/rc.solosdsl                            (rev 0)
+++ ipcop/trunk/src/rc.d/rc.solosdsl    2012-11-02 17:52:29 UTC (rev 6824)
@@ -0,0 +1,75 @@
+#!/bin/bash
+#
+# This file is part of the IPCop Firewall.
+#
+# IPCop is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# IPCop is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with IPCop.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Copyright (c) 2012 The IPCop Team
+#
+# $Id$
+#
+
+DEBUG="off"
+eval $(/usr/local/bin/readhash /var/ipcop/ppp/settings)
+
+# Debugging. Comment it out to use DEBUG from ppp settings
+DEBUG="on"
+
+msg() {
+    if [ "$DEBUG" = "on" ] ; then
+        /usr/bin/logger -t red "Solos PCI: $*"
+    fi
+}
+
+# See how we were called.
+case "$1" in
+start)
+    if ( ! /bin/lsmod | /bin/grep -q solos_pci ); then
+        /sbin/modprobe solos_pci
+        if [ $? -ne 0 ]; then
+            msg "loading failed"
+            exit 2
+        fi
+    fi
+    if [ ! -e "/sys/class/atm/solos-pci0" ]; then
+        msg "No device 0 found"
+        exit 1
+    fi
+    C=`cat /sys/class/atm/solos-pci0/parameters/Connected`
+    if [ "${C}" == "true" ]; then
+        MODE=`cat /sys/class/atm/solos-pci0/parameters/OperationalMode`
+        RX=`cat /sys/class/atm/solos-pci0/parameters/RxBitRate`
+        TX=`cat /sys/class/atm/solos-pci0/parameters/TxBitRate`
+        msg "Sync ${MODE} RxBitRate ${RX} TxBitRate ${TX}"
+    else
+        STATE=`cat /sys/class/atm/solos-pci0/parameters/State`
+        msg "No sync, modem state $STATE"
+        exit 1
+    fi
+    exit 0
+    ;;
+stop)
+    msg "stop"
+    ;;
+cleanup)
+    msg "driver cleanup"
+    /sbin/modprobe -r solos_pci
+    ;;
+*)
+    echo "Usage: $0 {start|stop|cleanup}"
+    exit 1
+    ;;
+esac
+
+exit 0


Property changes on: ipcop/trunk/src/rc.d/rc.solosdsl
___________________________________________________________________
Added: svn:keywords
   + Id

Modified: ipcop/trunk/updates/2.1.0/ROOTFILES.i486-2.1.0
===================================================================
--- ipcop/trunk/updates/2.1.0/ROOTFILES.i486-2.1.0      2012-11-02 17:45:19 UTC 
(rev 6823)
+++ ipcop/trunk/updates/2.1.0/ROOTFILES.i486-2.1.0      2012-11-02 17:52:29 UTC 
(rev 6824)
@@ -1,6 +1,8 @@
 ## please place IPCop files first, then packages sorted by alphabetical order
 /etc/httpd/conf/httpd.conf
 /etc/logrotate.conf.FLASH
+/etc/rc.d/rc.red
+/etc/rc.d/rc.solosdsl
 /etc/rc.d/rc.sysinit
 /etc/rc.d/rc.updatered
 /etc/sysctl.conf
@@ -14,6 +16,7 @@
 /home/httpd/cgi-bin/logproxy.cgi
 /home/httpd/cgi-bin/logsystem.cgi
 /home/httpd/cgi-bin/logurlfilter.cgi
+/home/httpd/cgi-bin/pppsetup.cgi
 /home/httpd/cgi-bin/proxy.cgi
 /home/httpd/cgi-bin/shaping.cgi
 /home/httpd/cgi-bin/status.cgi

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to