comgt: delay 3g bringup for sierra wireless cards until the card has locked on to...
authorFelix Fietkau <nbd@openwrt.org>
Thu, 27 Oct 2011 20:29:10 +0000 (20:29 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 27 Oct 2011 20:29:10 +0000 (20:29 +0000)
SVN-Revision: 28636

package/comgt/Makefile
package/comgt/files-netifd/3g.sh

index c071c8ca19c8f24458f4f4db1de139feb4dea071..d853276a453faa352e6cd229e8ee834a6c356764 100644 (file)
@@ -73,6 +73,7 @@ define Package/comgt/install
        $(INSTALL_DATA) ./files/setmode.gcom $(1)/etc/gcom/setmode.gcom
        $(INSTALL_DATA) ./files/getcardinfo.gcom $(1)/etc/gcom/getcardinfo.gcom
        $(INSTALL_DATA) ./files/getstrength.gcom $(1)/etc/gcom/getstrength.gcom
+       $(INSTALL_DATA) ./files/getcarrier.gcom $(1)/etc/gcom/getcarrier.gcom
        $(INSTALL_DIR) $(1)/etc/hotplug.d/tty
        $(INSTALL_DATA) $(FILES_DIR)/3g.usb $(1)/etc/hotplug.d/tty/30-3g
        $(Package/comgt/install/$(COMGT_VARIANT))
index cbf8bd1e6628134932925fb4193c29e2eb32ea56..cf96435a8588129da8633f48f6ca64654ff87cf2 100644 (file)
@@ -50,6 +50,8 @@ proto_3g_setup() {
                                        *) CODE=3;;
                                esac
                                export MODE="AT_OPSYS=${CODE}"
+                       elif echo "$cardinfo" | grep -q "Sierra Wireless"; then
+                               SIERRA=1
                        fi
 
                        if [ -n "$pincode" ]; then
@@ -60,6 +62,11 @@ proto_3g_setup() {
                                }
                        fi
                        [ -n "$MODE" ] && gcom -d "$device" -s /etc/gcom/setmode.gcom
+
+                       # wait for carrier to avoid firmware stability bugs
+                       [ -n "$SIERRA" ] && {
+                               gcom -d "$device" -s /etc/gcom/getcarrier.gcom || return 1
+                       }
                ;;
        esac