[OpenWrt-Devel] [PATCH] [rpcd] Allow non-negative RSSI reading

Dmitry Ivanov dmitrijs.ivanovs at ubnt.com
Fri May 8 04:51:30 EDT 2015

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 <dima at ubnt.com>
 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);
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list