From patchwork Mon Nov 27 17:31:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 841804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qlQRdFEc"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ncentric.com header.i=@ncentric.com header.b="gX5z+13Z"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ylv561W0Sz9sRW for ; Tue, 28 Nov 2017 04:32:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SDDT5vsIcyCUcppm2/M9roLkbO0ylgR65kSI6lFbzU4=; b=qlQRdFEcfG/yis AmT5maiDLXpq3zTh9DRTPuEVDgsktAyIKIynDrjwEeBwHSuDYONYxmJoAPmgmkuqw2z7FIxokij5K QAyyHAOTDJtsi8Ur1MQpiVgnxDflmHkLmy+CVbtOAAV6Go8pXFC2hltWHZFRuPkL0k7QwjnNr8YU4 N7u5qlCdgLo1pv+fBThM+aIuiY+3auJ9/sUZvEWZdMl86ZA3S9gC3Un/m4Clzu14s3nK2Ja3VjPLN zUkv4lch4o8jAnVgmamTey3YFVzNG5an4BhKRIUB2K1ctxm6vakxo3RO2BUCb0dgbPtBnYAggevQN WdKGyrOYAgJNSrTWKdOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eJNGj-0000es-Mf; Mon, 27 Nov 2017 17:32:33 +0000 Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eJNGG-0000ZP-Kc for lede-dev@lists.infradead.org; Mon, 27 Nov 2017 17:32:10 +0000 Received: by mail-wr0-x22e.google.com with SMTP id k18so22243397wre.1 for ; Mon, 27 Nov 2017 09:31:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ncentric.com; s=google; h=from:to:cc:subject:date:message-id; bh=1weLkOsUTdZbUsyB6z60L1rRmDQSD38BN0Z5R9W/B6E=; b=gX5z+13ZitNtqGb5IXTwgqTYZ5DcShL47MAwZI55TSoitR9MryIGIX9JgPb4Zj2SCT vcXY0qR3axoQjJF+oSVjpVCtpA0zqhcf2lflTvEoRxikDoT0TCSX1mscJR607p2QuX17 zpkA4Vh1Zl83FTHINmbImlWXDe5kZVrVRBzwQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1weLkOsUTdZbUsyB6z60L1rRmDQSD38BN0Z5R9W/B6E=; b=MSyC06coRrNsCATIo9ct+w6uwbXZQ+FujFGrvzgK6vj4WC5P8gtFVtFG3oZ5AgC8HS uWXt1IFtx7X7GeHHWFc2onrmKqlecGgAWlbgYoHVTXy43dc+9031Xt7sfJSv1W2NUM/F eD1ED8KZjLlHtAKvZJrmZMHUcuC2hnT59rKts1rP40oJqEMQa5jwcAnxqCHZ6d8JOQY6 MnbzI8/PZbV+2Nx0OV3l0Jya+ppDJAhtxFF4JdlK/+QkcqO3R6TfHX8LCw+AOka6Ra3J bqfcoofmyzfRAm3OQ78zL3b9E/CdMwavTLEl+zDEVqSlNEaE03FaOpIxrejWgpUGe7pI tk2Q== X-Gm-Message-State: AJaThX7U0lkcZYYk2/ZDr6EcHPti85+48tqDLuGvwSheBedr2UOeG51u MJiPuezmxhLo9/bM87otYOAsrDsYnAQ= X-Google-Smtp-Source: AGs4zMbD8dg6gMj6uQ+FrsyBRO/N1ZaEB5fuOfJzhJWusdBQE7z+Equ1pI4OS74u/jqZxOY8Go2Y1A== X-Received: by 10.223.135.59 with SMTP id a56mr35593221wra.173.1511803902248; Mon, 27 Nov 2017 09:31:42 -0800 (PST) Received: from localhost.localdomain (d515300d8.static.telenet.be. [81.83.0.216]) by smtp.googlemail.com with ESMTPSA id n143sm37100227wmd.31.2017.11.27.09.31.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Nov 2017 09:31:41 -0800 (PST) From: Koen Vandeputte To: lede-dev@lists.infradead.org Date: Mon, 27 Nov 2017 18:31:30 +0100 Message-Id: <1511803890-14127-1-git-send-email-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171127_093204_828914_47206F55 X-CRM114-Status: UNSURE ( 9.08 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c0c:0:0:0:22e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [LEDE-DEV] [PATCH v2] uqmi: fix raw-ip mode for newer lte modems X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Koen Vandeputte , bjorn@mork.no, nbd@nbd.name MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some newer LTE modems, like the MC7455 or EC25-E do not support "802.3" mode, and will stay in "raw-ip" regardless of the mode being set. In this case, the driver must be informed that it should handle all packets in raw mode. [1] This commit fixes connectivity issues for these devices. Before: [ Node 5 ] udhcpc -i wwan0 udhcpc: started, v1.27.2 udhcpc: sending discover udhcpc: sending discover udhcpc: sending discover After: [ Node 5 ] udhcpc -i wwan0 udhcpc: started, v1.27.2 udhcpc: sending discover udhcpc: sending select for 100.66.245.226 udhcpc: lease of 100.66.245.226 obtained, lease time 7200 udhcpc: ifconfig wwan0 100.66.245.226 netmask 255.255.255.252 broadcast + udhcpc: setting default routers: 100.66.245.225 [1] https://lists.freedesktop.org/archives/libqmi- devel/2017-January/002064.html Tested on cns3xxx using a Sierra Wireless MC7455 LTE-A Signed-off-by: Koen Vandeputte --- V2: Add existence test for required driver attribute. Bail out in case it's needed but doesn't exist package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 9c953ea..9a534d4 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -27,7 +27,7 @@ proto_qmi_init_config() { proto_qmi_setup() { local interface="$1" - + local dataformat local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS local cid_4 pdh_4 cid_6 pdh_6 local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 @@ -99,6 +99,19 @@ proto_qmi_setup() { uqmi -s -d "$device" --set-data-format 802.3 uqmi -s -d "$device" --wda-set-data-format 802.3 + dataformat="$(uqmi -s -d "$device" --wda-get-data-format)" + + if [ "$dataformat" = '"raw-ip"' ]; then + + [ -f /sys/class/net/$ifname/qmi/raw_ip ] || { + echo "Device only supports raw-ip mode but is missing this required driver attribute: /sys/class/net/$ifname/qmi/raw_ip" + return 1 + } + + echo "Device does not support 802.3 mode. Informing driver of raw-ip only for $ifname .." + echo "Y" > /sys/class/net/$ifname/qmi/raw_ip + fi + uqmi -s -d "$device" --sync echo "Waiting for network registration"