From patchwork Thu Jun 11 19:54:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 6591581 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6A58BC0020 for ; Thu, 11 Jun 2015 19:54:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 906A02063A for ; Thu, 11 Jun 2015 19:54:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BF9820638 for ; Thu, 11 Jun 2015 19:54:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754815AbbFKTyS (ORCPT ); Thu, 11 Jun 2015 15:54:18 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:53219 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752280AbbFKTyO (ORCPT ); Thu, 11 Jun 2015 15:54:14 -0400 Received: from localhost.localdomain (unknown [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id E4AC240A626; Thu, 11 Jun 2015 12:54:13 -0700 (PDT) From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH] iw: print beacon-loss and wiphy delete events. Date: Thu, 11 Jun 2015 15:54:11 -0400 Message-Id: <1434052451-19501-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 1.9.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear This is nicer than messages about unknown events. Signed-off-by: Ben Greear --- event.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/event.c b/event.c index b87a076..2c9694d 100644 --- a/event.c +++ b/event.c @@ -140,15 +140,22 @@ static void parse_cqm_event(struct nlattr **attrs) if (!found_one) printf("Unknown event type: %i\n", rssi_event); - } else if (cqm[NL80211_ATTR_CQM_PKT_LOSS_EVENT] && - attrs[NL80211_ATTR_MAC]) { - uint32_t frames; - char buf[3*6]; - - frames = nla_get_u32(cqm[NL80211_ATTR_CQM_PKT_LOSS_EVENT]); - mac_addr_n2a(buf, nla_data(attrs[NL80211_ATTR_MAC])); - printf("peer %s didn't ACK %d packets\n", buf, frames); - } else + } else if (cqm[NL80211_ATTR_CQM_PKT_LOSS_EVENT]) { + if (attrs[NL80211_ATTR_MAC]) { + uint32_t frames; + char buf[3*6]; + + frames = nla_get_u32(cqm[NL80211_ATTR_CQM_PKT_LOSS_EVENT]); + mac_addr_n2a(buf, nla_data(attrs[NL80211_ATTR_MAC])); + printf("peer %s didn't ACK %d packets\n", buf, frames); + } + else { + printf("PKT-LOSS-EVENT did not have MAC attribute!\n"); + } + } else if (cqm[NL80211_ATTR_CQM_BEACON_LOSS_EVENT]) { + printf("beacon loss\n"); + } + else printf("unknown event\n"); } @@ -615,6 +622,9 @@ static int print_event(struct nl_msg *msg, void *arg) case NL80211_CMD_DEL_INTERFACE: printf("delete interface\n"); break; + case NL80211_CMD_DEL_WIPHY: + printf("delete wiphy\n"); + break; default: printf("unknown event %d (%s)\n", gnlh->cmd, command_name(gnlh->cmd));