From patchwork Fri May 8 08:51:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Ivanov X-Patchwork-Id: 469919 X-Patchwork-Delegate: jow@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 38E2E140281 for ; Fri, 8 May 2015 18:55:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ubnt.com header.i=@ubnt.com header.b=Jsv9aBIX; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 42BAC281652; Fri, 8 May 2015 10:53:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B342E280F3E for ; Fri, 8 May 2015 10:53:51 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 8 May 2015 10:53:51 +0200 (CEST) Received: by lbbqq2 with SMTP id qq2so48599712lbb.3 for ; Fri, 08 May 2015 01:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ubnt.com; s=google; h=date:from:to:cc:message-id:mime-version:content-type :content-transfer-encoding:resent-date:resent-from:resent-to:subject :resent-message-id; bh=5a0zLMxOZ9vd/jkwSZ7A/0FOPHmIgOSf/nWLPj/0db8=; b=Jsv9aBIX4LLaE/YEO5sb+WfyxLEJebus0ybigR3gLfgEjVs0CcWJ3ORxn9XR+LM5o9 llVnlZkKBztpV6JBZT8qKxPIgQpyyx2znJR0EgfC9f+/YFRmAEt29l9ZKI6zP3R/Y+oj VSoIGq5OYOOIj+kUznADqIgwMgsfNTFFCHCjw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:message-id:mime-version :content-type:content-transfer-encoding:resent-date:resent-from :resent-to:subject:resent-message-id; bh=5a0zLMxOZ9vd/jkwSZ7A/0FOPHmIgOSf/nWLPj/0db8=; b=Hl69bur1YcP8LA1T6IC0T2taRY8p47515B/YcC5jnjvultp+4CnlJXrbwP39+r6m18 SpTCD4aL2tUo1DMmLAUN5Os/1QZ7UtO1lzpUjm0mHVhTTRhxZHC+M0XkgsrH+7sBEBmL dFHoMNDVegNVD93c9sajHT/i43Jdc8Ivpfs5D0ODRjbzR0LwCqBpd8MwvEMznao4+uqG W+kLYzTvCKGkWUBVwLrgNzHSlbdMnpjkz+EiPUNlifq/g4HOOBE1EgvV9jtKj9rPv53L Szm0K4aohqVNOM6mITLCg5nuxQYy485wwfEGAHUBH+xfGMcq9d0+D8XQ3z5kTJFOPPR5 ym3w== X-Gm-Message-State: ALoCoQl76y+/yGDCxKyyQnki3972piNWmYOXvb3NpkhB+8fhcUPRa1QmnDL8DpjABBW5k2P1phcOX5oDXeaW+tOHJvuK7YgReM5+3Kh3kdMMPb2Ve1RrFfzGUQ034SGVdJTckLKNvEoVYjxl17hR8MDUvFP8vSIlcp2rTRAn8Wau3l1+bN0XOSWeJVjc3GX5xoqsa4qrAB7F X-Received: by 10.152.30.100 with SMTP id r4mr2050184lah.107.1431075302689; Fri, 08 May 2015 01:55:02 -0700 (PDT) Received: from di ([80.233.186.214]) by mx.google.com with ESMTPSA id uj9sm1009376lbb.38.2015.05.08.01.55.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2015 01:55:02 -0700 (PDT) Date: Fri, 8 May 2015 11:51:30 +0300 From: Dmitry Ivanov To: jow@openwrt.org, luka@openwrt.org Message-Id: <20150508115130.374f2e2ada7745a8030f2621@ubnt.com> X-Mailer: Sylpheed 3.5.0beta1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) Mime-Version: 1.0 Resent-Date: Fri, 8 May 2015 11:55:01 +0300 Resent-From: Dmitry Ivanov Resent-To: openwrt-devel@lists.openwrt.org Resent-Message-Id: <20150508115501.d7af5e9af5b48a7144c1298e@ubnt.com> Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH] [rpcd] Allow non-negative RSSI reading X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" WLAN RSSI reading can be non-negative, i.e. 0 dBm and more. For example, this occurs with QCA9561 when transmitter is very close. Driver, Linux kernel and iw tool do allow this. This patch allows non-negative RSSI in rpcd too. Signed-off-by: Dmitry Ivanov --- iwinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iwinfo.c b/iwinfo.c index 325c07a..7e39b73 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -356,7 +356,7 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_string(&buf, "mode", IWINFO_OPMODE_NAMES[e->mode]); blobmsg_add_u32(&buf, "channel", e->channel); - blobmsg_add_u32(&buf, "signal", (uint32_t)(e->signal - 0x100)); + blobmsg_add_u32(&buf, "signal", (uint32_t)(e->signal)); blobmsg_add_u32(&buf, "quality", e->quality); blobmsg_add_u32(&buf, "quality_max", e->quality_max);