Re: [PATCH v3 1/3] rpmb: add Replay Protected Memory Block (RPMB) subsystem

From: Linus Walleij
Date: Tue Mar 05 2024 - 09:17:07 EST


On Tue, Mar 5, 2024 at 1:54 PM Winkler, Tomas <tomas.winkler@xxxxxxxxx> wrote:

> > On Tue, Feb 27, 2024 at 4:31 PM Jens Wiklander <jens.wiklander@xxxxxxxxxx>
> > wrote:
> >
> > > +struct rpmb_frame {
> > > + u8 stuff[196];
> > > + u8 key_mac[32];
> > > + u8 data[256];
> > > + u8 nonce[16];
> > > + __be32 write_counter;
> > > + __be16 addr;
> > > + __be16 block_count;
> > > + __be16 result;
> > > + __be16 req_resp;
> > > +} __packed;
> >
> > I didn't quite get why these things are encoded big-endian?
>
> By the spec.

So a kerneldoc comment above the struct with a reference to the spec
it is mirroring should be appropriate?

As it stands now it will be misunderstood by people like me as "just some
other Linux struct".

Yours,
Linus Walleij