From patchwork Tue Dec 23 11:59:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Recursive Madman X-Patchwork-Id: 5532931 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23638BEEA8 for ; Tue, 23 Dec 2014 12:03:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FA4520165 for ; Tue, 23 Dec 2014 12:03:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C79082012D for ; Tue, 23 Dec 2014 12:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932143AbaLWMD0 (ORCPT ); Tue, 23 Dec 2014 07:03:26 -0500 Received: from mout.gmx.net ([212.227.17.20]:49767 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932140AbaLWMD0 (ORCPT ); Tue, 23 Dec 2014 07:03:26 -0500 Received: from [192.168.0.107] ([37.120.108.67]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MKYpv-1Y4ld01Jqh-00204J; Tue, 23 Dec 2014 13:03:21 +0100 Message-ID: <1419335948.29925.33.camel@gmx.de> Subject: [PATCH] iw dev link: print channel number as well From: Recursive Madman To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Date: Tue, 23 Dec 2014 12:59:08 +0100 X-Mailer: Evolution 3.12.9-1 Mime-Version: 1.0 X-Provags-ID: V03:K0:y9PYCUeYGHgVBmQ7jElMJq+wkwYltXKDWqQvNcGznPYe6MJdKRR 6wqgBj8wNpugtj9mGUkuTcv6ONrEMXErbG97R4k35mszIjPnSY7qBLuLoVHs1nmT3gM/CdZ UHO7RS6CakEzFMqzNuTUDg8rW36ENZXbK3tzm3zxDPoaeCa1X0LnTCQiaGxv/NyL5kr8G1h FHVpTo98/xDIl+UmH6MQw== X-UI-Out-Filterresults: notjunk:1; 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,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,T_TVD_MIME_EPI,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 Hi, dev link prints the SSID and frequency, when connected. To figure out the channel however (if you don't know it by heart), you need to use dev info which will print the channel along with the frequency (though not the current SSID). With attached patch, dev link prints the channel along with the frequency, e.g. as: freq: 2442 channel: 7 . I find it more convenient this way. -- madman. From 0e167018fbc95580ba2cb94128452a18463cbde2 Mon Sep 17 00:00:00 2001 From: Recursive Madman Date: Mon, 22 Dec 2014 15:21:07 +0100 Subject: [PATCH] dev link: print channel number as well Signed-off-by: Recursive Madman --- link.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/link.c b/link.c index f7818f5..629b2ba 100644 --- a/link.c +++ b/link.c @@ -84,9 +84,12 @@ static int link_bss_handler(struct nl_msg *msg, void *arg) nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]), false, PRINT_LINK); - if (bss[NL80211_BSS_FREQUENCY]) + if (bss[NL80211_BSS_FREQUENCY]) { printf("\tfreq: %d\n", nla_get_u32(bss[NL80211_BSS_FREQUENCY])); + printf("\tchannel: %d\n", + ieee80211_frequency_to_channel(nla_get_u32(bss[NL80211_BSS_FREQUENCY]))); + } if (nla_get_u32(bss[NL80211_BSS_STATUS]) != NL80211_BSS_STATUS_ASSOCIATED) return NL_SKIP; -- 2.1.3