* [PATCH 1/3] mt76: mt7615: fix mt7663e firmware struct endianness
2020-03-18 12:41 [PATCH 0/3] fix endianness issues in mt7663e driver Lorenzo Bianconi
@ 2020-03-18 12:41 ` Lorenzo Bianconi
2020-03-23 17:35 ` 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
2 siblings, 1 reply; 5+ messages in thread
From: Lorenzo Bianconi @ 2020-03-18 12:41 UTC (permalink / raw)
To: kvalo
Cc: linux-wireless, nbd, lorenzo.bianconi, sean.wang, ryder.lee,
linux-mediatek
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
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/3] mt76: mt7615: fix endianness in unified command
2020-03-18 12:41 [PATCH 0/3] fix endianness issues in mt7663e driver Lorenzo Bianconi
2020-03-18 12:41 ` [PATCH 1/3] mt76: mt7615: fix mt7663e firmware struct endianness Lorenzo Bianconi
@ 2020-03-18 12:41 ` Lorenzo Bianconi
2020-03-18 12:41 ` [PATCH 3/3] mt76: mt7615: add missing declaration in mt7615.h Lorenzo Bianconi
2 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2020-03-18 12:41 UTC (permalink / raw)
To: kvalo
Cc: linux-wireless, nbd, lorenzo.bianconi, sean.wang, ryder.lee,
linux-mediatek
Fix cid field endianness in unified mt7615_uni_txd header
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 323d7daad363 ("mt76: mt7615: introduce uni cmd command types")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 9978f6bb22ab..610cfa918c7b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -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;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/3] mt76: mt7615: add missing declaration in mt7615.h
2020-03-18 12:41 [PATCH 0/3] fix endianness issues in mt7663e driver Lorenzo Bianconi
2020-03-18 12:41 ` [PATCH 1/3] mt76: mt7615: fix mt7663e firmware struct endianness Lorenzo Bianconi
2020-03-18 12:41 ` [PATCH 2/3] mt76: mt7615: fix endianness in unified command Lorenzo Bianconi
@ 2020-03-18 12:41 ` Lorenzo Bianconi
2 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2020-03-18 12:41 UTC (permalink / raw)
To: kvalo
Cc: linux-wireless, nbd, lorenzo.bianconi, sean.wang, ryder.lee,
linux-mediatek
Add mt7615_mcu_wait_response declaration in mt7615.h since it will be
reused adding usb support to mt7615 driver
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 044a43256a35 ("mt76: mt7615: introduce mt7615_mcu_wait_response")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
index 8b3d95a2d7b2..676ca622c35a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread