From patchwork Thu Feb 15 14:15:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 873891 X-Patchwork-Delegate: blogic@openwrt.org 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=2607:7c80:54:e::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="hTnjk7pD"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ncentric.com header.i=@ncentric.com header.b="maNNfNOL"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::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 3zhz1t0nqfz9t2l for ; Fri, 16 Feb 2018 01:20:02 +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:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2IFlrZ41ut/B2ha0UT8x2bB+ri9ymEoA973+IVu49SQ=; b=hTnjk7pDejIaAj 80enWoJRqGEbEUvXC38idDnydufrwNtKNHeO/TQNfHU8nbFPt+StBH0JsdJ2XSqqBv//inSZDZYq+ 8Lmk0OBZhifvGIjjDG5kzKxAUPS8CuT/PAFLKq9+kKf0bvh8aL2MYAdO4dFtO6DuxcgRm1qcPe+GK 4kVgSB0s/GFOHspP4EO1D5sRDPTDbmoJ7WVVFD7iey5qDQinct9nJ+Ysk8j4NOtDwl8EKsnYnOMsm 52LxliiIza+etcbTep2+iIZuPOtZiQ0u4gDHfV/YZzPdAvmF6I5Pp4fxyNPvsy56AVSNLSFIU0PKZ NpSh8MrVwbqxK6gfPhTg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1emKOF-0000sv-6K; Thu, 15 Feb 2018 14:19:59 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1emKLI-00073H-9s for lede-dev@lists.infradead.org; Thu, 15 Feb 2018 14:17:01 +0000 Received: by mail-wm0-x232.google.com with SMTP id f3so1136154wmc.1 for ; Thu, 15 Feb 2018 06:16:45 -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:in-reply-to:references; bh=Okee++F9A/fUt/u4W9baTI4apSNWEL9/befgkphU1uA=; b=maNNfNOLRC/WY30fXslVmV+MirfRPVnDokB45uJLqx+/XvrAeypdSVHEhasuIAGZgX Y5rddOGj9X+sQ69XeLi8X9PodMyXddL0hbQI/eVJzfdYS9+Q5vmh9WiYQN1hnQ/RC68r NrORUu9oUfeqYcg14d5iwPdJ0/LccN0BMNQFw= 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:in-reply-to :references; bh=Okee++F9A/fUt/u4W9baTI4apSNWEL9/befgkphU1uA=; b=c26orES+CQ4B4n8zEb78jAvcA+A5opiiwDZpbXSPR7qFqg7yIax6OMmDjOyeWxFGAu wBfFTs/Eg9E/pRCIDbfaL2lM2NFaudwW3jYBqq52AnL6T0a8vZZrsavSno9kCfcBwZUX TVjUIDZ0e5j/Kpoiswl3KC2uBO3hDflqLnizGyjPHjzh47WTVwVzShjz+7IKhKUwBNXb rqNm9OjbUnbIRGfx7dv8puSKxnlMdq4oNalGCMjVzvS6WVuVQAL3dAESfAgQZLdFp4M9 jpE/hS+Q2H6hBKrE+iBg8XD5njAvRFqfK89f+jJmaBj39wPLkqCBjsSzJ8EwpchFQhls Ncgg== X-Gm-Message-State: APf1xPAoHsRUSRilfiFJwMFHvCp7ba/3TABb7VWn4NWZcT1SfayAotyx td3Y5hLZZGjuqTMlJgMRR3t3pQ13PK4= X-Google-Smtp-Source: AH8x224bq0wtxZQ+ykowOguoaEeiG9LWCMfIReCtPmU7qfIdNE2jYEpLzb/bZruOs2O8Qp64zVnKPA== X-Received: by 10.80.154.6 with SMTP id o6mr1066652edb.146.1518704203945; Thu, 15 Feb 2018 06:16:43 -0800 (PST) Received: from localhost.localdomain (d515300d8.static.telenet.be. [81.83.0.216]) by smtp.googlemail.com with ESMTPSA id d6sm3462692edm.52.2018.02.15.06.16.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Feb 2018 06:16:43 -0800 (PST) From: Koen Vandeputte To: lede-dev@lists.infradead.org Date: Thu, 15 Feb 2018 15:15:59 +0100 Message-Id: <1518704164-22198-5-git-send-email-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518704164-22198-1-git-send-email-koen.vandeputte@ncentric.com> References: <1518704164-22198-1-git-send-email-koen.vandeputte@ncentric.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180215_061656_381835_FA88CD63 X-CRM114-Status: GOOD ( 12.51 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:232 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 Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH 4/9] 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: Jo-Philipp Wich , leventelist@gmail.com, lynxis@fe80.eu, Koen Vandeputte , john@phrozen.org, 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 [bumped PKG_RELEASE] Signed-off-by: Jo-Philipp Wich --- package/network/utils/uqmi/Makefile | 2 +- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 2102490f68d4..6e891435b941 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uqmi -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/uqmi.git 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 9c953ea69757..9a534d4b96d7 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"