From patchwork Tue Mar 26 11:09:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zefir Kurtisi X-Patchwork-Id: 2335731 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2376C3FC54 for ; Tue, 26 Mar 2013 11:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755097Ab3CZLKG (ORCPT ); Tue, 26 Mar 2013 07:10:06 -0400 Received: from mail.neratec.com ([80.75.119.105]:42612 "EHLO mail.neratec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753525Ab3CZLKD (ORCPT ); Tue, 26 Mar 2013 07:10:03 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.neratec.com (Postfix) with ESMTP id 2DD268BD99A; Tue, 26 Mar 2013 12:09:57 +0100 (CET) X-Virus-Scanned: amavisd-new at neratec.com Received: from mail.neratec.com ([127.0.0.1]) by localhost (mail.neratec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z7uhacS2RO8w; Tue, 26 Mar 2013 12:09:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.neratec.com (Postfix) with ESMTP id D01458BD99C; Tue, 26 Mar 2013 12:09:56 +0100 (CET) X-Virus-Scanned: amavisd-new at neratec.com Received: from mail.neratec.com ([127.0.0.1]) by localhost (mail.neratec.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id heHdIkZbMZkD; Tue, 26 Mar 2013 12:09:56 +0100 (CET) Received: from CHL500308.neratec.local (CHL500308.neratec.local [192.168.11.104]) by mail.neratec.com (Postfix) with ESMTPSA id 21CBF8BD996; Tue, 26 Mar 2013 12:09:55 +0100 (CET) From: Zefir Kurtisi To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Zefir Kurtisi Subject: [PATCH] iw: don't print DFS states of disabled frequencies Date: Tue, 26 Mar 2013 12:09:49 +0100 Message-Id: <1364296189-10386-1-git-send-email-zefir.kurtisi@neratec.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Also, fix indentation. Signed-off-by: Zefir Kurtisi --- info.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/info.c b/info.c index 3d4eaeb..209e882 100644 --- a/info.c +++ b/info.c @@ -183,17 +183,18 @@ next: printf(")"); printf("\n"); - if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) { - enum nl80211_dfs_state state = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]); - unsigned long time; - - printf("\t\t\t DFS state: %s", dfs_state_name(state)); - if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_TIME]) { - time = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_TIME]); - printf(" (for %lu sec)", time/1000); + if (!tb_freq[NL80211_FREQUENCY_ATTR_DISABLED] && tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) { + enum nl80211_dfs_state state = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]); + unsigned long time; + + printf("\t\t\t DFS state: %s", dfs_state_name(state)); + if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_TIME]) { + time = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_TIME]); + printf(" (for %lu sec)", time/1000); + } + printf("\n"); } - printf("\n"); - } + } }