Skip to contentSkip to conversation

fix endianness issues in mt7663e driver

PATCH In review Lorenzo Bianconi 2 participants 6 messages Mar 18, 2020 – Mar 23, 2020

Subsystems (2)
lore
Share & tools
lore

Lorenzo Bianconi

author maintainer
#0 lore raw

cover fix endianness issues in mt7663e driver

Fix endianness issues reported by kbuild test robot

Lorenzo Bianconi (3):
mt76: mt7615: fix mt7663e firmware struct endianness
mt76: mt7615: fix endianness in unified command
mt76: mt7615: add missing declaration in mt7615.h

 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c  | 16 ++++++++--------
 .../net/wireless/mediatek/mt76/mt7615/mt7615.h   |  1 +
 2 files changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/3 mt76: mt7615: fix mt7663e firmware struct endianness

Convert fields in mt7663_fw_trailer and mt7663_fw_buf to little-endian

Fixes f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")
---
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +7 -7
index 50c98913d81d..9978f6bb22ab 100644
@@ -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",
Signature · 1 line
2.25.1
author maintainer
#4 lore raw

PATCH 2/3 mt76: mt7615: fix endianness in unified command

In reply to Lorenzo Bianconi

Fix cid field endianness in unified mt7615_uni_txd header

Fixes 323d7daad363 ("mt76: mt7615: introduce uni cmd command types")
---
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +1 -1
index 9978f6bb22ab..610cfa918c7b 100644
@@ -120,9 +120,9 @@ void mt7615_mcu_fill_msg(struct mt7615_dev *dev, struct sk_buff *skb,
 		uni_txd = (struct mt7615_uni_txd *)txd;
 		uni_txd->len = cpu_to_le16(skb->len - sizeof(uni_txd->txd));
 		uni_txd->option = MCU_CMD_UNI_EXT_ACK;
+		uni_txd->cid = cpu_to_le16(mcu_cmd);
 		uni_txd->s2d_index = MCU_S2D_H2N;
 		uni_txd->pkt_type = MCU_PKT_ID;
-		uni_txd->cid = mcu_cmd;
 		uni_txd->seq = seq;
 
 		return;
Signature · 1 line
2.25.1
author maintainer
#5 lore raw

PATCH 3/3 mt76: mt7615: add missing declaration in mt7615.h

In reply to Lorenzo Bianconi

Add mt7615_mcu_wait_response declaration in mt7615.h since it will be reused adding usb support to mt7615 driver

Fixes 044a43256a35 ("mt76: mt7615: introduce mt7615_mcu_wait_response")
---
 drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +1 -0
index 8b3d95a2d7b2..676ca622c35a 100644
@@ -383,6 +383,7 @@ int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, struct mt76_wcid *wcid,
 			    enum set_key_cmd cmd);
 void mt7615_mac_reset_work(struct work_struct *work);
 
+int mt7615_mcu_wait_response(struct mt7615_dev *dev, int cmd, int seq);
 int mt7615_mcu_set_dbdc(struct mt7615_dev *dev);
 int mt7615_mcu_set_eeprom(struct mt7615_dev *dev);
 int mt7615_mcu_set_mac_enable(struct mt7615_dev *dev, int band, bool enable);
Signature · 1 line
2.25.1
#2 lore raw

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

In reply to Lorenzo Bianconi
Quoted 5 lines · Lorenzo Bianconi

Convert fields in mt7663_fw_trailer and mt7663_fw_buf to little-endian

Fixes f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")

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

Signature · 3 lines
https://patchwork.kernel.org/patch/11445177/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw

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

In reply to Lorenzo Bianconi
Quoted 5 lines · Lorenzo Bianconi

Convert fields in mt7663_fw_trailer and mt7663_fw_buf to little-endian

Fixes f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")

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

Signature · 8 lines
https://patchwork.kernel.org/patch/11445177/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek