From patchwork Wed Dec 22 15:58:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 12691719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FD36C4332F for ; Wed, 22 Dec 2021 15:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344030AbhLVP6x (ORCPT ); Wed, 22 Dec 2021 10:58:53 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50977 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344032AbhLVP6U (ORCPT ); Wed, 22 Dec 2021 10:58:20 -0500 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 6F339E0011; Wed, 22 Dec 2021 15:58:17 +0000 (UTC) From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: David Girault , Romuald Despres , Frederic Blain , Thomas Petazzoni , netdev@vger.kernel.org, Miquel Raynal Subject: [wpan-tools 0/7] IEEE 802.15.4 passive scan support Date: Wed, 22 Dec 2021 16:58:09 +0100 Message-Id: <20211222155816.256405-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello, This series follows the work done in the Linux kernel stack: now that the core knows about the different netlink commands and attributes in order to support passive scan requests from end-to-end, here are the userspace changes to be able to use it. Here is a list of the new available features. * Passively sending (or stopping) beacons. So far only intervals ranging from 0 to 14 are valid. Bigger values would request the PAN coordinator to answer to BEACONS_REQ (active scans), this is not supported yet. # iwpan dev wpan0 beacons send interval 2 # iwpan dev wpan0 beacons stop * Scanning all the channels or only a subset: # iwpan dev wpan1 scan type passive duration 3 * If a beacon is received during this operation the internal PAN list is updated and can be dumped or flushed with: # iwpan dev wpan1 pans dump PAN 0xffff (on wpan1) coordinator 0x2efefdd4cdbf9330 page 0 channel 13 superframe spec. 0xcf22 LQI 0 seen 7156ms ago # iwpan dev wpan1 pans flush * It is also possible to monitor the events with: # iwpan event * As well as triggering a non blocking scan: # iwpan dev wpan1 scan trigger type passive duration 3 # iwpan dev wpan1 scan done # iwpan dev wpan1 scan abort Cheers, Miquèl David Girault (4): iwpan: Export iwpan_debug iwpan: Remove duplicated SECTION iwpan: Add full scan support iwpan: Add events support Miquel Raynal (2): iwpan: Fix a comment iwpan: Synchronize nl802154 header with the Linux kernel Romuald Despres (1): iwpan: Fix the channels printing DEST/usr/local/bin/iwpan | Bin 0 -> 178448 bytes DEST/usr/local/bin/wpan-hwsim | Bin 0 -> 45056 bytes DEST/usr/local/bin/wpan-ping | Bin 0 -> 47840 bytes src/Makefile.am | 2 + src/event.c | 221 ++++++++++++++++ src/info.c | 2 +- src/iwpan.c | 2 +- src/iwpan.h | 13 +- src/nl802154.h | 95 +++++++ src/scan.c | 471 ++++++++++++++++++++++++++++++++++ 10 files changed, 797 insertions(+), 9 deletions(-) create mode 100755 DEST/usr/local/bin/iwpan create mode 100755 DEST/usr/local/bin/wpan-hwsim create mode 100755 DEST/usr/local/bin/wpan-ping create mode 100644 src/event.c create mode 100644 src/scan.c