Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp401492pxb; Mon, 25 Oct 2021 10:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBTtpul8/7g66A7j/l66ZOdcli9GPKxZ/HazNsU5iNxIwOeXS6W8FHOHFWN80ZIS/ByvsX X-Received: by 2002:a05:6402:11ca:: with SMTP id j10mr28608501edw.223.1635182899563; Mon, 25 Oct 2021 10:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635182899; cv=none; d=google.com; s=arc-20160816; b=BkRfh89PdjGoJbjwZHnQxWKhFlmecYUMgLeRsdYvOirgjQM+m2eB/TKl9zY+UzPMZ8 cE0h9PC2p/5fCwuz6qva/BiMG/2rMEpPsTVJ3h0zv9VS6a8qnPVEMoMEVOszO+sff5CB lZxOjkMl8QOdmIS8+bMgcLq7TypOKLnSplk6dnHgZBmzl+yiboNjidFlGX26RS3EtAtB meDEGm+j8kte13Dw2WxTVoArk0XaCJvNDHHWEw8fPbSRjkHVI5EveTWzVCIisHCgwDhl RbG0cPsPXTql3BZbfLvxbjgik/sVwbXz9xTXwhDdlyt0krv5q9bjmfrF15Tfw8OA31mq bKOw== 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=mMVuWCIZVy1D8hkh4bAQ0R+ASdnkAr6+uq0IciqwibE=; b=0cg+E13ZvnX0KISUZnsrbPFoNKGx3Ceq/GWNO2/4sRjJuQF6tOOSO4HmzqqiXvp6pl 1eECChSjOeoZyQ0J52DW0+2HMIc+OfLdrg19WNOGEHjGCmyO64I86XNi6mlLXj8PXtO9 +vp7LpuY5hTv4tTdJoIQzTYVVAH0YkzPYIOy6xMGQzxoouaJJndZoxGBeU9ohMG3eMsY Rm9KRupAmTx1alPJq/d/C3uXNpMffLmaIhlmpbB1W0jdYS32sR2w4FVxBePVBKmPjepk QJzhcgF07HKN4m9fmELLW5t9qDpGSkfDi/Das+Jm65wLP/lffQx2feDXCx6cyATNq7rC dXbQ== 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 d17si7605591edv.245.2021.10.25.10.27.37; Mon, 25 Oct 2021 10:28:19 -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 S231220AbhJYRZh (ORCPT + 99 others); Mon, 25 Oct 2021 13:25:37 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:53833 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbhJYRZh (ORCPT ); Mon, 25 Oct 2021 13:25:37 -0400 Received: from tomoyo.flets-east.jp ([114.149.34.46]) by smtp.orange.fr with ESMTPA id f3gYmY0E4niuxf3glmufEi; Mon, 25 Oct 2021 19:23:13 +0200 X-ME-Helo: tomoyo.flets-east.jp X-ME-Auth: MDU0YmViZGZmMDIzYiBlMiM2NTczNTRjNWZkZTMwOGRiOGQ4ODf3NWI1ZTMyMzdiODlhOQ== X-ME-Date: Mon, 25 Oct 2021 19:23:13 +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: [PATCH v3 0/4] report the controller capabilities through the netlink interface Date: Tue, 26 Oct 2021 02:22:43 +0900 Message-Id: <20211025172247.1774451-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 main purpose of this series is to report the CAN controller capabilities. The proposed method reuses the existing struct can_ctrlmode and thus do not need a new IFLA_CAN_* entry. While doing so, I also realized that can_priv::ctrlmode_static could actually be derived from the other ctrlmode fields. So I added three extra patches to the series: one to replace that field with a function, one to add a safeguard on can_set_static_ctrlmode() and one to repack struct can_priv and fill the hole created after removing can_priv::ctrlmode_priv. Please note that the first three patches are not required by the fourth one. I am just grouping everything in the same series because the patches all revolve around the controller modes. ** Changelog ** v2 -> v3: - Make can_set_static_ctrlmode() return an error and adjust the drivers which use this helper function accordingly. v1 -> v2: - Add a first patch to replace can_priv::ctrlmode_static by the inline function can_get_static_ctrlmode() - Add a second patch to reorder the fields of struct can_priv for better packing (save eight bytes on x86_64 \o/) - Rewrite the comments of the third patch "can: netlink: report the CAN controller mode supported flags" (no changes on the code itself). Vincent Mailhol (4): can: dev: replace can_priv::ctrlmode_static by can_get_static_ctrlmode() can: dev: add sanity check in can_set_static_ctrlmode() can: dev: reorder struct can_priv members for better packing can: netlink: report the CAN controller mode supported flags drivers/net/can/dev/dev.c | 5 +++-- drivers/net/can/dev/netlink.c | 7 +++++-- drivers/net/can/m_can/m_can.c | 10 +++++++--- drivers/net/can/rcar/rcar_canfd.c | 4 +++- include/linux/can/dev.h | 24 +++++++++++++++++------- include/uapi/linux/can/netlink.h | 5 ++++- 6 files changed, 39 insertions(+), 16 deletions(-) -- 2.32.0