Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2555783pxb; Sat, 2 Oct 2021 22:04:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlSlwfKLqmOWtjFdd+8Rz+30N3ofhRtk3bD5e8yO2DGPW+8y3gB/4qbiqex92dg8GoivXw X-Received: by 2002:a50:fd8a:: with SMTP id o10mr8620268edt.256.1633237486230; Sat, 02 Oct 2021 22:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633237486; cv=none; d=google.com; s=arc-20160816; b=bcEjj871StTHO7bsN74QeGQOaMufq7qdEHdv+VranbTEmIokRGbYgl+IocxdGlNvEk 9vMXMFrgrL+Nk0YCZ2gmMF9q7kj6YUHKUh6jFpeU/DgukGhhNC7iDW85XnaZ/uNN5iEo nNcCJkTQZhQ9RNklUriq7sPNpGCkhHKtpjLZx8wSrxvAmji8ZlwnWsuRO0dPW13AyqkR dMYLlezW2yMDDtHmaTbqD3XjYQ4tBr9sclOOjQxlGaz/VVvNGb9JZBMPvfRdrc9RKctc L9wjX7p+CmL8Rv4yF1+dRlz/7aTA/2HGshiQGSj4qdkr8si7dU5K/Uust/AcuCKZpwuR GO5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=i3yfOHplZT26Z5Zb4wT9o8PT8wWiMLJTM6M7G8s859U=; b=QvX3tQZlN1futm93BP6smI3X9ePEmBStpf8tBEspanl2Lgo10UvDRPBmaJAqU6ti3r V6V/3l3Jd8NWDYUdMg3IFYPwGmv1FkVFUXnh8bj/uyNoR75FT9q9mEBE0cLpE1klEJRp YQFLlZpB6JV1sBbBfgeI+3KJrNXTVjJAizKdIjsIB/WFUAC0+sSJyuD7UcoQJ6W9qDhQ OAXKl35yXoRt+8DY1WXu/VItm9cWDKLclo3VK0AHvDCobs/Qxs2UyLDUQXotNGc8kOly OAZbgL0JzYV3x2SNGSXZKPo+JOVTMtlEZld6w1uNDbMgBEM7n/Djz8rgytGD3/m2nsOg pZBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz20si13392863ejc.688.2021.10.02.22.04.22; Sat, 02 Oct 2021 22:04:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229484AbhJCFEc (ORCPT + 99 others); Sun, 3 Oct 2021 01:04:32 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:49800 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbhJCFEb (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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.32.0