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] [day] [month] [year] [list]
Message-ID: <20220315181427.GS3293@kadam>
Date:   Tue, 15 Mar 2022 21:14:27 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Nam Cao <cvn249@...il.com>
Cc:     gregkh@...uxfoundation.org, paulo.miguel.almeida.rodenas@...il.com,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        realwakka@...il.com
Subject: Re: [PATCH] staging: pi433: allow max bit rate of 300kps

On Tue, Mar 15, 2022 at 07:08:20PM +0100, Nam Cao wrote:
> diff --git a/drivers/staging/pi433/TODO b/drivers/staging/pi433/TODO
> index 5cf3fd99d521..8530bbe61d70 100644
> --- a/drivers/staging/pi433/TODO
> +++ b/drivers/staging/pi433/TODO
> @@ -1,5 +1,3 @@
>  * currently the code introduces new IOCTLs. I'm afraid this is a bad idea.
>    -> Replace this with another interface, hints are welcome!
>  * Some missing data (marked with ###) needs to be added in the documentation
> -* Change (struct pi433_tx_cfg)->bit_rate to be a u32 so that we can support
> -    bit rates up to 300kbps per the spec.
> diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h
> index 25ee0b77a32c..c958dcfa9f96 100644
> --- a/drivers/staging/pi433/pi433_if.h
> +++ b/drivers/staging/pi433/pi433_if.h
> @@ -51,7 +51,7 @@ enum option_on_off {
>  #define PI433_TX_CFG_IOCTL_NR	0
>  struct pi433_tx_cfg {
>  	__u32			frequency;
> -	__u16			bit_rate;
> +	__u32			bit_rate;
>  	__u32			dev_frequency;
>  	enum modulation		modulation;
>  	enum mod_shaping	mod_shaping;
> @@ -99,7 +99,7 @@ struct pi433_tx_cfg {
>  #define PI433_RX_CFG_IOCTL_NR	1
>  struct pi433_rx_cfg {
>  	__u32			frequency;
> -	__u16			bit_rate;
> +	__u32			bit_rate;
>  	__u32			dev_frequency;
>  
>  	enum modulation		modulation;

You cannot change this because it is part of the UAPI.

Also this API is rubbish.  Instead you should create sysfs files to
set the bit_rate.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ