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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 29 Dec 2022 11:37:13 +0100
From:   Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To:     Ping-Ke Shih <pkshih@...ltek.com>
Cc:     "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "tony0620emma@...il.com" <tony0620emma@...il.com>,
        "kvalo@...nel.org" <kvalo@...nel.org>,
        "tehuang@...ltek.com" <tehuang@...ltek.com>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/4] rtw88: Add packed attribute to the eFuse structs

Hi Ping-Ke,

On Thu, Dec 29, 2022 at 10:25 AM Ping-Ke Shih <pkshih@...ltek.com> wrote:
[...]
>
> > @@ -43,13 +43,13 @@ struct rtw8821ce_efuse {
> >       u8 link_cap[4];
> >       u8 link_control[2];
> >       u8 serial_number[8];
> > -     u8 res0:2;                      /* 0xf4 */
> > -     u8 ltr_en:1;
> > -     u8 res1:2;
> > -     u8 obff:2;
> > -     u8 res2:3;
> > -     u8 obff_cap:2;
> > -     u8 res3:4;
> > +     u16 res0:2;                     /* 0xf4 */
> > +     u16 ltr_en:1;
> > +     u16 res1:2;
> > +     u16 obff:2;
> > +     u16 res2:3;
> > +     u16 obff_cap:2;
> > +     u16 res3:4;
>
> These should be __le16. Though bit fields are suitable to efuse layout,
> we don't access these fields for now. It would be well.
My understanding is that it should look like this (replacing all of res0..res3):
    __le16 some_field_name;                     /* 0xf4 */
How to call that single __le16 field then?

I also tried using bit-fields for an __le16 (so basically the same as
my patch but using __le16 instead of u16) but that makes sparse
complain:
  error: invalid bitfield specifier for type restricted __le16


Best regards,
Martin

Powered by blists - more mailing lists