From: Michael Straube <straube.linux@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>,
Larry Finger <Larry.Finger@lwfinger.net>
Cc: Phillip Potter <phil@philpotter.co.uk>,
Greg KH <gregkh@linuxfoundation.org>,
"open list:STAGING SUBSYSTEM" <linux-staging@lists.linux.dev>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: staging: r8188eu: struct rt_firmware_header issues
Date: Thu, 14 Apr 2022 12:08:01 +0200 [thread overview]
Message-ID: <a40a2a1b-a8f1-e720-be92-48858d4f6678@gmail.com> (raw)
In-Reply-To: <51e706400b914552bfda6353020da17e@AcuMS.aculab.com>
On 4/14/22 10:41, David Laight wrote:
> From: Michael Straube
>> Sent: 13 April 2022 20:42
>>
>> On 4/13/22 18:27, Michael Straube wrote:
>>> Hi all,
>>>
>>> I think the rt_firmware_hdr structure in rtw_fw.c has some issues.
>>>
>>>
>>> struct rt_firmware_hdr {
>>> /* 8-byte alinment required */
>
> Probably need an __aligned(8) at the bottom then?
I don't see any reason why this is needed. Do I miss something?
>>> /* LONG WORD 0 ---- */
>>> __le16 Signature; /* 92C0: test chip; 92C,
>>> * 88C0: test chip; 88C1: MP A-cut;
>>> * 92C1: MP A-cut */
>>> u8 Category; /* AP/NIC and USB/PCI */
>>> u8 Function; /* Reserved for different FW function
>>> * indcation, for further use when
>>> * driver needs to download different
>>> * FW for different conditions */
>>> __le16 Version; /* FW Version */
>>> u8 Subversion; /* FW Subversion, default 0x00 */
>>> u16 Rsvd1;
>>>
>>> /* LONG WORD 1 ---- */
>>> u8 Month; /* Release time Month field */
>>> u8 Date; /* Release time Date field */
>>> u8 Hour; /* Release time Hour field */
>>> u8 Minute; /* Release time Minute field */
>>> __le16 RamCodeSize; /* The size of RAM code */
>>> u8 Foundry;
>>> u8 Rsvd2;
>>>
>>> /* LONG WORD 2 ---- */
>>> __le32 SvnIdx; /* The SVN entry index */
>>> u32 Rsvd3;
>>>
>>> /* LONG WORD 3 ---- */
>>> u32 Rsvd4;
>>> u32 Rsvd5;
>>> };
> ...
>>
>> Ok, I figured it out by looking at the hexdumps of firmware files. The
>> field Rsvd1 should be u8 instead of u16. I'll prepare a patch for this.
>
> I'd also add a compile-time assert on the size.
I'll add a patch to the series I recently sent.
thanks,
Michael
next prev parent reply other threads:[~2022-04-14 10:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 16:27 staging: r8188eu: struct rt_firmware_header issues Michael Straube
2022-04-13 19:42 ` Michael Straube
2022-04-13 21:12 ` Larry Finger
2022-04-14 8:41 ` David Laight
2022-04-14 10:08 ` Michael Straube [this message]
2022-04-14 10:14 ` David Laight
2022-04-14 15:46 ` Larry Finger
2022-04-13 20:58 ` Pavel Skripkin
2022-04-13 21:26 ` Michael Straube
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=a40a2a1b-a8f1-e720-be92-48858d4f6678@gmail.com \
--to=straube.linux@gmail.com \
--cc=David.Laight@ACULAB.COM \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
/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).