From patchwork Mon Mar 30 11:00:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 216157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61950C43331 for ; Mon, 30 Mar 2020 11:00:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A3B1205ED for ; Mon, 30 Mar 2020 11:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729504AbgC3LAY (ORCPT ); Mon, 30 Mar 2020 07:00:24 -0400 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:40240 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729401AbgC3LAY (ORCPT ); Mon, 30 Mar 2020 07:00:24 -0400 Received: from sauron.tu-ilmenau.de (unknown [141.24.16.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 7D3B6580068; Mon, 30 Mar 2020 13:00:22 +0200 (CEST) From: Markus Theil To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Markus Theil Subject: [PATCH] iw: event: log rssi value for cqm Date: Mon, 30 Mar 2020 13:00:27 +0200 Message-Id: <20200330110027.21541-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Markus Theil --- event.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/event.c b/event.c index b132b17..02e4593 100644 --- a/event.c +++ b/event.c @@ -122,17 +122,20 @@ static void parse_cqm_event(struct nlattr **attrs) if (cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]) { enum nl80211_cqm_rssi_threshold_event rssi_event; + int32_t rssi_level = -1; bool found_one = false; rssi_event = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]); + if(cqm[NL80211_ATTR_CQM_RSSI_LEVEL]) + rssi_level = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_LEVEL]); switch (rssi_event) { case NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: - printf("RSSI went above threshold\n"); + printf("RSSI (%i dBm) went above threshold\n", rssi_level); found_one = true; break; case NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: - printf("RSSI went below threshold\n"); + printf("RSSI (%i dBm) went below threshold\n", rssi_level); found_one = true; break; case NL80211_CQM_RSSI_BEACON_LOSS_EVENT: