linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"James Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Vinayak Holikatti" <vinholikatti@gmail.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Michael Ryleev" <gmar@google.com>,
	"Joao Pinto" <Joao.Pinto@synopsys.com>,
	"Christoph Hellwig" <hch@lst.de>,
	"Yaniv Gardi" <ygardi@codeaurora.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH v5 4/8] char: rpmb: provide a user space interface
Date: Mon, 18 Jul 2016 18:15:22 -0400	[thread overview]
Message-ID: <CAP=VYLqZCXjWUohLZ35Kvrx7B8z7cbEFzDt4ugaUosrh2ca+8g@mail.gmail.com> (raw)
In-Reply-To: <1468873673-21776-5-git-send-email-tomas.winkler@intel.com>

On Mon, Jul 18, 2016 at 4:27 PM, Tomas Winkler <tomas.winkler@intel.com> 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 <tomas.winkler@intel.com>
> ---

[...]

> 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 <linux/module.h>

....not use module.h or any MODULE_ macros from within it.

Thanks,
Paul.
--

> +#include <linux/fs.h>
> +#include <linux/uaccess.h>
> +#include <linux/compat.h>
> +#include <linux/slab.h>
> +#include <linux/capability.h>
> +
> +#include <linux/rpmb.h>
> +
> +#include "rpmb-cdev.h"
> +
> +static dev_t rpmb_devt;

  reply	other threads:[~2016-07-18 22:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 20:27 [PATCH v5 0/8] Replay Protected Memory Block (RPMB) subsystem Tomas Winkler
2016-07-18 20:27 ` [PATCH v5 1/8] rpmb: add " Tomas Winkler
2016-07-18 20:27 ` [PATCH v5 2/8] char: rpmb: add sysfs-class ABI documentation Tomas Winkler
2016-08-31 10:53   ` Greg Kroah-Hartman
2016-07-18 20:27 ` [PATCH v5 3/8] char: rpmb: add device attributes Tomas Winkler
2016-08-31 10:56   ` Greg Kroah-Hartman
2016-09-01 20:21     ` Winkler, Tomas
2016-07-18 20:27 ` [PATCH v5 4/8] char: rpmb: provide a user space interface Tomas Winkler
2016-07-18 22:15   ` Paul Gortmaker [this message]
2016-07-20  9:02     ` Winkler, Tomas
2016-07-20 14:21       ` Paul Gortmaker
2016-08-05 20:08   ` Pavel Machek
2016-08-07  9:44     ` Winkler, Tomas
2016-08-31 10:49       ` Greg Kroah-Hartman
2016-09-01 20:05         ` Winkler, Tomas
2016-09-01 20:46           ` Greg Kroah-Hartman
2016-09-04 11:35             ` Winkler, Tomas
2016-09-04 20:20               ` Pavel Machek
2016-09-04 20:56                 ` Winkler, Tomas
2016-07-18 20:27 ` [PATCH v5 5/8] char: rpmb: add RPMB simulation device Tomas Winkler
2016-08-31 10:57   ` Greg Kroah-Hartman
2016-08-31 10:58   ` Greg Kroah-Hartman
2016-09-01 20:25     ` Winkler, Tomas
2016-09-01 20:45       ` Greg Kroah-Hartman
2016-07-18 20:27 ` [PATCH v5 6/8] tools rpmb: add RPBM access tool Tomas Winkler
2016-07-18 20:27 ` [PATCH v5 7/8] mmc: block: register RPMB partition with the RPMB subsystem Tomas Winkler
2016-07-18 20:27 ` [PATCH v5 8/8] scsi: ufs: connect to " Tomas Winkler
2016-07-23  7:44 ` [PATCH v5 0/8] Replay Protected Memory Block (RPMB) subsystem Winkler, Tomas
2016-08-05 20:06 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP=VYLqZCXjWUohLZ35Kvrx7B8z7cbEFzDt4ugaUosrh2ca+8g@mail.gmail.com' \
    --to=paul.gortmaker@windriver.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=adrian.hunter@intel.com \
    --cc=arve@android.com \
    --cc=gmar@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tomas.winkler@intel.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vinholikatti@gmail.com \
    --cc=ygardi@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).