From patchwork Wed Nov 5 13:16:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 406996 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BB656140098 for ; Thu, 6 Nov 2014 01:23:20 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755175AbaKEOXQ (ORCPT ); Wed, 5 Nov 2014 09:23:16 -0500 Received: from mail-bn1bon0133.outbound.protection.outlook.com ([157.56.111.133]:61808 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751500AbaKEOXM (ORCPT ); Wed, 5 Nov 2014 09:23:12 -0500 Received: from DM2PR03MB334.namprd03.prod.outlook.com (10.141.54.19) by DM2PR03MB383.namprd03.prod.outlook.com (10.141.55.17) with Microsoft SMTP Server (TLS) id 15.1.11.14; Wed, 5 Nov 2014 14:23:02 +0000 Received: from BY2PR03CA062.namprd03.prod.outlook.com (10.141.249.35) by DM2PR03MB334.namprd03.prod.outlook.com (10.141.54.19) with Microsoft SMTP Server (TLS) id 15.1.11.9; Wed, 5 Nov 2014 14:22:58 +0000 Received: from BN1AFFO11FD052.protection.gbl (2a01:111:f400:7c10::101) by BY2PR03CA062.outlook.office365.com (2a01:111:e400:2c5d::35) with Microsoft SMTP Server (TLS) id 15.1.11.14 via Frontend Transport; Wed, 5 Nov 2014 14:22:58 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD052.mail.protection.outlook.com (10.58.53.67) with Microsoft SMTP Server (TLS) id 15.1.6.13 via Frontend Transport; Wed, 5 Nov 2014 14:22:57 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id sA5EMqFj017243; Wed, 5 Nov 2014 07:22:54 -0700 From: Dong Aisheng To: CC: , , , , , , Subject: [PATCH V3 1/3] can: add can_is_canfd_skb() API Date: Wed, 5 Nov 2014 21:16:31 +0800 Message-ID: <1415193393-30023-1-git-send-email-b29396@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(979002)(6009001)(189002)(199003)(33646002)(99396003)(64706001)(48376002)(107046002)(120916001)(2351001)(21056001)(229853001)(104016003)(36756003)(62966003)(110136001)(50466002)(95666004)(31966008)(105606002)(106466001)(97736003)(26826002)(104166001)(102836001)(20776003)(92566001)(50986999)(68736004)(93916002)(88136002)(44976005)(4396001)(87936001)(77156002)(6806004)(47776003)(92726001)(87286001)(50226001)(19580405001)(89996001)(19580395003)(46102003)(84676001)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR03MB334; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB334; X-Forefront-PRVS: 0386B406AA Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Aisheng.Dong@freescale.com; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB383; X-OriginatorOrg: freescale.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The CAN device drivers can use it to check if the frame to send is on CAN FD mode or normal CAN mode. Acked-by: Oliver Hartkopp Signed-off-by: Dong Aisheng --- ChangesLog: * v1->v2: change to skb->len == CANFD_MTU; --- include/linux/can/dev.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 6992afc..4c3919c 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h @@ -99,6 +99,11 @@ inval_skb: return 1; } +static inline int can_is_canfd_skb(struct sk_buff *skb) +{ + return skb->len == CANFD_MTU; +} + /* get data length from can_dlc with sanitized can_dlc */ u8 can_dlc2len(u8 can_dlc);