From: Lorenzo Bianconi <lorenzo@kernel.org>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org, nbd@nbd.name,
lorenzo.bianconi@redhat.com, sean.wang@mediatek.com,
ryder.lee@mediatek.com, linux-mediatek@lists.infradead.org
Subject: [PATCH 1/3] mt76: mt7615: fix mt7663e firmware struct endianness
Date: Wed, 18 Mar 2020 13:41:03 +0100 [thread overview]
Message-ID: <d14dfd7cd91a4dda8c5dcd03e8a70ff11314182e.1584534454.git.lorenzo@kernel.org> (raw)
In-Reply-To: <cover.1584534454.git.lorenzo@kernel.org>
Convert fields in mt7663_fw_trailer and mt7663_fw_buf to little-endian
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 50c98913d81d..9978f6bb22ab 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -44,16 +44,16 @@ struct mt7663_fw_trailer {
u8 reserv[2];
char fw_ver[10];
char build_date[15];
- u32 crc;
+ __le32 crc;
} __packed;
struct mt7663_fw_buf {
- u32 crc;
- u32 d_img_size;
- u32 block_size;
+ __le32 crc;
+ __le32 d_img_size;
+ __le32 block_size;
u8 rsv[4];
- u32 img_dest_addr;
- u32 img_size;
+ __le32 img_dest_addr;
+ __le32 img_size;
u8 feature_set;
};
@@ -1896,7 +1896,7 @@ static int mt7663_load_n9(struct mt7615_dev *dev, const char *name)
goto out;
}
- offset += buf->img_size;
+ offset += le32_to_cpu(buf->img_size);
if (buf->feature_set & DL_MODE_VALID_RAM_ENTRY) {
override_addr = le32_to_cpu(buf->img_dest_addr);
dev_info(dev->mt76.dev, "Region %d, override_addr = 0x%08x\n",
--
2.25.1
next prev parent reply other threads:[~2020-03-18 12:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 12:41 [PATCH 0/3] fix endianness issues in mt7663e driver Lorenzo Bianconi
2020-03-18 12:41 ` Lorenzo Bianconi [this message]
2020-03-23 17:35 ` [PATCH 1/3] mt76: mt7615: fix mt7663e firmware struct endianness Kalle Valo
2020-03-18 12:41 ` [PATCH 2/3] mt76: mt7615: fix endianness in unified command Lorenzo Bianconi
2020-03-18 12:41 ` [PATCH 3/3] mt76: mt7615: add missing declaration in mt7615.h Lorenzo Bianconi
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=d14dfd7cd91a4dda8c5dcd03e8a70ff11314182e.1584534454.git.lorenzo@kernel.org \
--to=lorenzo@kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
/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).