Commit aa97ff57 authored by Michael Lo's avatar Michael Lo Committed by Felix Fietkau
Browse files

wifi: mt76: mt7925: ensure all MCU commands wait for response



Modify MCU command sending functions to wait for a response,
ensuring consistent behavior across all commands and improves
reliability by confirming that each command is processed
successfully.

Fixes: c948b5da ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: default avatarMichael Lo <michael.lo@mediatek.com>
Signed-off-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250414013954.1151774-3-mingyen.hsieh@mediatek.com


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent bd02eebf
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -783,7 +783,7 @@ int mt7925_mcu_fw_log_2_host(struct mt792x_dev *dev, u8 ctrl)
	int ret;

	ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_UNI_CMD(WSYS_CONFIG),
					&req, sizeof(req), false, NULL);
					&req, sizeof(req), true, NULL);
	return ret;
}

@@ -1441,7 +1441,7 @@ int mt7925_mcu_set_eeprom(struct mt792x_dev *dev)
	};

	return mt76_mcu_send_and_get_msg(&dev->mt76, MCU_UNI_CMD(EFUSE_CTRL),
					 &req, sizeof(req), false, NULL);
					 &req, sizeof(req), true, NULL);
}
EXPORT_SYMBOL_GPL(mt7925_mcu_set_eeprom);

@@ -2813,7 +2813,7 @@ int mt7925_mcu_set_dbdc(struct mt76_phy *phy, bool enable)
	conf->band = 0; /* unused */

	err = mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SET_DBDC_PARMS),
				    false);
				    true);

	return err;
}
@@ -2943,7 +2943,7 @@ int mt7925_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
	}

	err = mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SCAN_REQ),
				    false);
				    true);
	if (err < 0)
		clear_bit(MT76_HW_SCANNING, &phy->state);

@@ -3049,7 +3049,7 @@ int mt7925_mcu_sched_scan_req(struct mt76_phy *phy,
	}

	return mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SCAN_REQ),
				     false);
				     true);
}
EXPORT_SYMBOL_GPL(mt7925_mcu_sched_scan_req);

@@ -3085,7 +3085,7 @@ mt7925_mcu_sched_scan_enable(struct mt76_phy *phy,
		clear_bit(MT76_HW_SCHED_SCANNING, &phy->state);

	return mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SCAN_REQ),
				     false);
				     true);
}

int mt7925_mcu_cancel_hw_scan(struct mt76_phy *phy,
@@ -3124,7 +3124,7 @@ int mt7925_mcu_cancel_hw_scan(struct mt76_phy *phy,
	}

	return mt76_mcu_send_msg(phy->dev, MCU_UNI_CMD(SCAN_REQ),
				 &req, sizeof(req), false);
				 &req, sizeof(req), true);
}
EXPORT_SYMBOL_GPL(mt7925_mcu_cancel_hw_scan);

@@ -3229,7 +3229,7 @@ int mt7925_mcu_set_channel_domain(struct mt76_phy *phy)
	memcpy(__skb_push(skb, sizeof(req)), &req, sizeof(req));

	return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(SET_DOMAIN_INFO),
				     false);
				     true);
}
EXPORT_SYMBOL_GPL(mt7925_mcu_set_channel_domain);