diff mbox series

[1/3] mt76: mt7615: fix mt7663e firmware struct endianness

Message ID d14dfd7cd91a4dda8c5dcd03e8a70ff11314182e.1584534454.git.lorenzo@kernel.org (mailing list archive)
State New, archived
Headers show
Series fix endianness issues in mt7663e driver | expand

Commit Message

Lorenzo Bianconi March 18, 2020, 12:41 p.m. UTC
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(-)

Comments

Kalle Valo March 23, 2020, 5:35 p.m. UTC | #1
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> 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>

3 patches applied to wireless-drivers-next.git, thanks.

54178cc134fd mt76: mt7615: fix mt7663e firmware struct endianness
d14f0a5c62d3 mt76: mt7615: fix endianness in unified command
b899150e60ce mt76: mt7615: add missing declaration in mt7615.h
diff mbox series

Patch

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",