From patchwork Sun Oct 3 05:01:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 12532521 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DB5EC433EF for ; Sun, 3 Oct 2021 05:02:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41D5D61A4F for ; Sun, 3 Oct 2021 05:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbhJCFEc (ORCPT ); Sun, 3 Oct 2021 01:04:32 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:52931 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbhJCFEb (ORCPT ); Sun, 3 Oct 2021 01:04:31 -0400 Received: from tomoyo.flets-east.jp ([114.149.34.46]) by smtp.orange.fr with ESMTPA id WtdMmhDZXsoWhWte5m9Qay; Sun, 03 Oct 2021 07:02:43 +0200 X-ME-Helo: tomoyo.flets-east.jp X-ME-Auth: MDU0YmViZGZmMDIzYiBlMiM2NTczNTRjNWZkZTMwOGRiOGQ4ODf3NWI1ZTMyMzdiODlhOQ== X-ME-Date: Sun, 03 Oct 2021 07:02:43 +0200 X-ME-IP: 114.149.34.46 From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Mailhol Subject: [RFC PATCH v1 0/3] iproute2-next: iplink_can: report the controller capabilities Date: Sun, 3 Oct 2021 14:01:44 +0900 Message-Id: <20211003050147.569044-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC The patch series serve one purpose: allow the user to check both the supported and the static capabilities. Currently, the CAN netlink interface provides no easy ways to check the capabilities of a given controller. The only method from the command line is to try each CAN_CTRLMODE_ individually to check whether the netlink interface returns an -EOPNOTSUPP error or not (alternatively, one may find it easier to directly check the source code of the driver instead...) Here, we introduce a way to directly report the supported features as well as the statically enabled features. The first patch of the series only does some clean up. The second patch is the real thing. The last patch contains the needed modification to the uapi headers and is only there for convenience. Vincent Mailhol (3): iplink_can: code refactoring of print_ctrlmode() iplink_can: add ctrlmode_{supported,_static} to the "--details --json" output uapi: can: netlink: add new field to struct can_ctrlmode to report capabilities include/uapi/linux/can/netlink.h | 5 ++- ip/iplink_can.c | 54 +++++++++++++++++++------------- 2 files changed, 36 insertions(+), 23 deletions(-)