From patchwork Thu Jan 10 14:58:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ingo Feinerer X-Patchwork-Id: 1022983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=logic.at Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZhRzRdzx"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=logic.at header.i=@logic.at header.b="sBmdyX/F"; 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 43b8Jq31cGz9s7h for ; Fri, 11 Jan 2019 01:58:51 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version: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=wkUfio88r+D2I6WmUMoxTJ4iQQJxgDKgAa6GHtD9l6A=; b=ZhRzRdzxP1Gq+9 aHFSKV13rFrMoXvpiHxrQwhJqmgBs04e8KlwLcnZuySAsI66DsCwLyFY6/9wN8kDAZym3I6tAgL2k kGto4n5ZgNwKBYZ3nutLYd/yL+neEJYcCkmvhtXdAuaxjKHQ1dGRT/LPXGACfAMwYKNUgUoSMizEK CLjZxH0RPMqLhgPLr7SnHhaTXG8Qiy9kdBH/F9IGYpn1eF/hQzMLrJ2SGZIKaOC80WYn4JaozjsPZ WQ5nbVhrtQDNDLRAXS7xWEHqTEfp4/pGMhvZZoMN46KOm3Q+mh5MzEPu603KvGIL42+zvtZn+cLel O2gOTikwAd5mcttUFC7Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghbmt-0003IC-NH; Thu, 10 Jan 2019 14:58:27 +0000 Received: from jake.logic.tuwien.ac.at ([128.130.175.117]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghbmp-0003HD-Rd for openwrt-devel@lists.openwrt.org; Thu, 10 Jan 2019 14:58:25 +0000 Received: from t450.aithon.duckdns.org (morty.logic.tuwien.ac.at [128.130.175.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by jake.logic.tuwien.ac.at (Postfix) with ESMTPSA id 5AC16C0348; Thu, 10 Jan 2019 15:58:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=logic.at; s=dkim; t=1547132298; bh=9hVV2oRMJ93NlKhV0shpydDNbHHRD1/0YF7tJhJOL7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sBmdyX/FKZj1cxZvKINBgRd6nJtT7Cp0X+ibbYTwd3lDjN79RpxUIvOwzjr52AEqT F0csglIvf60gkgGL1ZIxkttgXtQIGfqt56R/H1CM19O8aD+iEHARSoWmq1AWj5x1bU MKa7uFWLijH1igSzCguzWK6qgD4EpqFaJER57eYU= Received: from localhost (t450.aithon.duckdns.org [local]) by t450.aithon.duckdns.org (OpenSMTPD) with ESMTPA id e401da7f; Thu, 10 Jan 2019 15:58:17 +0100 (CET) From: Ingo Feinerer To: openwrt-devel@lists.openwrt.org Date: Thu, 10 Jan 2019 15:58:00 +0100 Message-Id: <20190110145800.63138-2-feinerer@logic.at> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190110145800.63138-1-feinerer@logic.at> References: <20190110145800.63138-1-feinerer@logic.at> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190110_065824_200488_94E9E46E X-CRM114-Status: GOOD ( 10.75 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [128.130.175.117 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Subject: [OpenWrt-Devel] [PATCH] umbim: add registration set support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ingo Feinerer Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This implements the MBIM automatic registration mode to let the function select the best provider network. Signed-off-by: Ingo Feinerer Reviewed-by: Bjørn Mork --- cli.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cli.c b/cli.c index 1dd6330..e00b6d4 100644 --- a/cli.c +++ b/cli.c @@ -297,7 +297,16 @@ mbim_pin_state_request(void) static int mbim_registration_request(void) { - mbim_setup_command_msg(basic_connect, MBIM_MESSAGE_COMMAND_TYPE_QUERY, MBIM_CMD_BASIC_CONNECT_REGISTER_STATE, 0); + if (_argc > 0) { + struct mbim_basic_connect_register_state_s *rs = + (struct mbim_basic_connect_register_state_s *) mbim_setup_command_msg(basic_connect, + MBIM_MESSAGE_COMMAND_TYPE_SET, MBIM_CMD_BASIC_CONNECT_REGISTER_STATE, + sizeof(struct mbim_basic_connect_register_state_s)); + + rs->registeraction = htole32(MBIM_REGISTER_ACTION_AUTOMATIC); + } else { + mbim_setup_command_msg(basic_connect, MBIM_MESSAGE_COMMAND_TYPE_QUERY, MBIM_CMD_BASIC_CONNECT_REGISTER_STATE, 0); + } return mbim_send_command_msg(); }