diff mbox

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

Message ID 20150508115130.374f2e2ada7745a8030f2621@ubnt.com
State Changes Requested
Delegated to: Jo-Philipp Wich
Headers show

Commit Message

Dmitry Ivanov May 8, 2015, 8:51 a.m. UTC
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@ubnt.com>
---
 iwinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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);