lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 19 Oct 2014 22:30:41 +0200
From:	Hartmut Knaack <knaack.h@....de>
To:	Daniel Baluta <daniel.baluta@...el.com>, jic23@...nel.org,
	linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
CC:	irina.tirdea@...el.com
Subject: Re: [RFC PATCH 1/8] iio: dummy: Introduce virtual registers
 for dummy device

Daniel Baluta schrieb am 02.10.2014 15:43:
> We need a way to store events generated by iio_dummy_evgen module,
> in order to correctly process IRQs in iio_simple_dummy_events.
> 
> For the moment, we add two registers:
> 
> * id_reg  - ID register, stores the source of the event
> * id_data - DATA register, stores the type of the event
> 
> e.g echo 4 > /sys/bus/iio/devices/iio_evgen/poke2
> 
> id_reg 0x02, id_data 0x04
> 
> This means, event of type 4 was generated by fake device 2.
> 
> We currently use a hardcoded mapping of virtual events to IIO events.
> 
> Signed-off-by: Daniel Baluta <daniel.baluta@...el.com>
> Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>
> ---
>  drivers/staging/iio/iio_dummy_evgen.c         | 16 ++++++++++++++++
>  drivers/staging/iio/iio_dummy_evgen.h         |  7 +++++++
>  drivers/staging/iio/iio_simple_dummy.h        |  2 ++
>  drivers/staging/iio/iio_simple_dummy_events.c | 23 ++++++++++++++++++-----
>  4 files changed, 43 insertions(+), 5 deletions(-)
> 
<...>
> @@ -153,6 +161,14 @@ static ssize_t iio_evgen_poke(struct device *dev,
>  			      size_t len)
>  {
>  	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
> +	unsigned long event, ret;
int ret
> +
> +	ret = kstrtoul(buf, 10, &event);
> +	if (ret)
> +		return ret;
> +
> +	iio_evgen->regs[this_attr->address].reg_id   = this_attr->address;
> +	iio_evgen->regs[this_attr->address].reg_data = event;
>  
>  	if (iio_evgen->enabled[this_attr->address])
>  		handle_nested_irq(iio_evgen->base + this_attr->address);
<...>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ