From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752200AbcGRWP5 (ORCPT ); Mon, 18 Jul 2016 18:15:57 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33124 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097AbcGRWPy (ORCPT ); Mon, 18 Jul 2016 18:15:54 -0400 MIME-Version: 1.0 In-Reply-To: <1468873673-21776-5-git-send-email-tomas.winkler@intel.com> References: <1468873673-21776-1-git-send-email-tomas.winkler@intel.com> <1468873673-21776-5-git-send-email-tomas.winkler@intel.com> From: Paul Gortmaker Date: Mon, 18 Jul 2016 18:15:22 -0400 X-Google-Sender-Auth: Y9qZnRwl_MiS4lFbFMmSsfQzOh4 Message-ID: Subject: Re: [PATCH v5 4/8] char: rpmb: provide a user space interface To: Tomas Winkler Cc: Greg Kroah-Hartman , Ulf Hansson , Adrian Hunter , James Bottomley , "Martin K. Petersen" , Vinayak Holikatti , Andy Lutomirski , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Michael Ryleev , Joao Pinto , Christoph Hellwig , Yaniv Gardi , LKML , linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 18, 2016 at 4:27 PM, Tomas Winkler wrote: > The user space API is achieved via two synchronous IOCTL. > Simplified one, RPMB_IOC_REQ_CMD, were read result cycles is performed > by the framework on behalf the user and second, RPMB_IOC_SEQ_CMD where > the whole RPMB sequence including RESULT_READ is supplied by the caller. > The latter is intended for easier adjusting of the applications that > use MMC_IOC_MULTI_CMD ioctl. > > Signed-off-by: Tomas Winkler > --- [...] > diff --git a/drivers/char/rpmb/Kconfig b/drivers/char/rpmb/Kconfig > index c5e6e909efce..6794be9fcc5e 100644 > --- a/drivers/char/rpmb/Kconfig > +++ b/drivers/char/rpmb/Kconfig > @@ -6,3 +6,10 @@ config RPMB > access RPMB partition. > > If unsure, select N. > + > +config RPMB_INTF_DEV > + bool "RPMB character device interface /dev/rpmbN" A bool Kconfig should ideally.... > + depends on RPMB > + help > + Say yes here if you want to access RPMB from user space > + via character device interface /dev/rpmb%d > diff --git a/drivers/char/rpmb/Makefile b/drivers/char/rpmb/Makefile > index 812b3ed264c0..b5dc087b1299 100644 > --- a/drivers/char/rpmb/Makefile > +++ b/drivers/char/rpmb/Makefile > @@ -1,4 +1,5 @@ > obj-$(CONFIG_RPMB) += rpmb.o > rpmb-objs += core.o > +rpmb-$(CONFIG_RPMB_INTF_DEV) += cdev.o > > ccflags-y += -D__CHECK_ENDIAN__ > diff --git a/drivers/char/rpmb/cdev.c b/drivers/char/rpmb/cdev.c > new file mode 100644 > index 000000000000..f3ad3444f76d > --- /dev/null > +++ b/drivers/char/rpmb/cdev.c > @@ -0,0 +1,269 @@ > +/* > + * Copyright (C) 2015-2016 Intel Corp. All rights reserved > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; version 2 of the License. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * General Public License for more details. > + */ > + > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > + > +#include ....not use module.h or any MODULE_ macros from within it. Thanks, Paul. -- > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include "rpmb-cdev.h" > + > +static dev_t rpmb_devt;