Commit 028a47cf authored by Gergo Koteles's avatar Gergo Koteles Committed by Felix Fietkau
Browse files

wifi: mt76: mt76_usb.mt76u_mcu.burst is always false remove related code



Simplify mt76x02u_multiple_mcu_reads routine since burst is always
false.

Signed-off-by: default avatarGergo Koteles <soyer@irl.hu>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent deb0f90d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -527,7 +527,6 @@ struct mt76_usb {
		struct mt76_reg_pair *rp;
		int rp_len;
		u32 base;
		bool burst;
	} mcu;
};

+8 −22
Original line number Diff line number Diff line
@@ -21,31 +21,18 @@ static void
mt76x02u_multiple_mcu_reads(struct mt76_dev *dev, u8 *data, int len)
{
	struct mt76_usb *usb = &dev->usb;
	u32 reg, val;
	int i;

	if (usb->mcu.burst) {
		WARN_ON_ONCE(len / 4 != usb->mcu.rp_len);

		reg = usb->mcu.rp[0].reg - usb->mcu.base;
		for (i = 0; i < usb->mcu.rp_len; i++) {
			val = get_unaligned_le32(data + 4 * i);
			usb->mcu.rp[i].reg = reg++;
			usb->mcu.rp[i].value = val;
		}
	} else {
	WARN_ON_ONCE(len / 8 != usb->mcu.rp_len);

	for (i = 0; i < usb->mcu.rp_len; i++) {
			reg = get_unaligned_le32(data + 8 * i) -
			      usb->mcu.base;
			val = get_unaligned_le32(data + 8 * i + 4);
		u32 reg = get_unaligned_le32(data + 8 * i) - usb->mcu.base;
		u32 val = get_unaligned_le32(data + 8 * i + 4);

		WARN_ON_ONCE(usb->mcu.rp[i].reg != reg);
		usb->mcu.rp[i].value = val;
	}
}
}

static int mt76x02u_mcu_wait_resp(struct mt76_dev *dev, u8 seq)
{
@@ -207,7 +194,6 @@ mt76x02u_mcu_rd_rp(struct mt76_dev *dev, u32 base,
	usb->mcu.rp = data;
	usb->mcu.rp_len = n;
	usb->mcu.base = base;
	usb->mcu.burst = false;

	ret = __mt76x02u_mcu_send_msg(dev, skb, CMD_RANDOM_READ, true);