Changeset 10347


Ignore:
Timestamp:
2008-02-02T02:21:31+01:00 (10 years ago)
Author:
nbd
Message:

Add CDMA/EVDO support to comgt package

This patch adds a chat script and makes some modifications to
/lib/network/3g.sh to enable seamless use of CDMA/EVDO modems in
addition to the existing GPRS/UMTS support. Modifications to 3g.sh
are:

  • Added 'chat' variable to point at the appropriate script
  • Added 'evdo' and 'cdma' as acceptable 'service' values, and skip

the whole gcom initialization bit

  • Changed pppd connection speed from 460800 to more widely supported

115200; in my experience, this is not your actual connection speed,
but at what speed pppd sends setup commands to the interface.

This kinda eliminates the need for /etc/ppp/3g.connect - I think I've
replaced that functionality, but in a slightly more standardized
method, using the 'connect' variable understood by PPP.

Signed-off-by: RB<aoz.syn@…>

Location:
trunk/package/comgt
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/comgt/Makefile

    r8659 r10347  
    4949        $(INSTALL_DIR) $(1)/etc/chatscripts 
    5050        $(INSTALL_DATA) ./files/3g.chat $(1)/etc/chatscripts/3g.chat 
     51        $(INSTALL_DATA) ./files/evdo.chat $(1)/etc/chatscripts/evdo.chat 
    5152        $(INSTALL_DIR) $(1)/lib/network 
    5253        $(INSTALL_DATA) ./files/3g.sh $(1)/lib/network/3g.sh 
  • trunk/package/comgt/files/3g.sh

    r8717 r10347  
    3737        local iface="$1" 
    3838        local config="$2" 
     39        local chat="/etc/chatscripts/3g.chat" 
    3940         
    4041        config_get device "$config" device 
     
    5253 
    5354        # figure out hardware specific commands for the card 
    54         if gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | grep Novatel 2>/dev/null >/dev/null; then 
    55                 case "$service" in 
    56                         umts_only) CODE=2;; 
    57                         gprs_only) CODE=1;; 
    58                         *) CODE=0;; 
    59                 esac 
    60                 mode="AT\$NWRAT=${CODE},2" 
    61         else 
    62                 case "$service" in 
    63                         umts_only) CODE=1;; 
    64                         gprs_only) CODE=0;; 
    65                         *) CODE=3;; 
    66                 esac 
    67                 mode="AT_OPSYS=${CODE}" 
    68         fi 
    69          
    70         PINCODE="$pincode" gcom -d "$device" -s /etc/gcom/setpin.gcom || { 
    71                 echo "$cfg(3g): Failed to set the PIN code." 
    72                 set_3g_led 0 0 0 
    73                 return 1 
    74         } 
    75         MODE="$mode" gcom -d "$device" -s /etc/gcom/setmode.gcom 
     55        case "$service" in 
     56                cdma|evdo) chat="/etc/chatscripts/evdo.chat";; 
     57        *) 
     58                if gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | grep Novatel 2>/dev/null >/dev/null; then 
     59                        case "$service" in 
     60                                umts_only) CODE=2;; 
     61                                gprs_only) CODE=1;; 
     62                                *) CODE=0;; 
     63                        esac 
     64                        mode="AT\$NWRAT=${CODE},2" 
     65                else 
     66                        case "$service" in 
     67                                umts_only) CODE=1;; 
     68                                gprs_only) CODE=0;; 
     69                                *) CODE=3;; 
     70                        esac 
     71                        mode="AT_OPSYS=${CODE}" 
     72                fi 
     73                 
     74                PINCODE="$pincode" gcom -d "$device" -s /etc/gcom/setpin.gcom || { 
     75                        echo "$cfg(3g): Failed to set the PIN code." 
     76                        set_3g_led 0 0 0 
     77                        return 1 
     78                } 
     79                MODE="$mode" gcom -d "$device" -s /etc/gcom/setmode.gcom 
     80        esac 
    7681        set_3g_led 1 0 0 
    7782 
     83        config_set "$config" "connect" "${apn:+USE_APN=$apn }/usr/sbin/chat -t5 -f $chat" 
    7884        start_pppd "$config" \ 
    7985                noaccomp \ 
     
    8490                lock \ 
    8591                crtscts \ 
    86                 connect "USE_APN=\"$apn\" /etc/ppp/3g.connect" \ 
    8792                ${mtu:+mtu $mtu mru $mtu} \ 
    88                 460800 "$device" 
     93                115200 "$device" 
    8994} 
Note: See TracChangeset for help on using the changeset viewer.