Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp778343pxb; Wed, 8 Sep 2021 12:07:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz292hGSjZHLZJ/2W/vKpqaCaSFpaIzQCCP/+dZHA7/RcCY3nuvH7N2z7RQYJ4VpbPLAsqa X-Received: by 2002:a50:f086:: with SMTP id v6mr2687400edl.379.1631128020666; Wed, 08 Sep 2021 12:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631128020; cv=none; d=google.com; s=arc-20160816; b=eoXOubDyMslmyoNZuxH17VnE6lSpPLniTGD8X6+rpWnV1vHYp53fCmXyg07E5iQCIK aWG+W3/+40fMHTOk4c8+efh/hCFVjfSeAGCF4eBwTQbEyYuuNqKrWxsazl3KExaD2Z4L BbMtY7z44y379Ziv0TmiwXXAZGpr61abTcML64yep1xIwkvbQXvysAhBNUtN3+A5+t0o zTnmKO+drNR+R2iF2pvuwkfn9LtNDenTzZpjWr086DMFonXAPYfjzOS27+VY94pAzTv3 VOIQwBv9EDC4wJvrYNtoaQfGIwwgkChSNqyHIZ+PilM6x1SOZahEikGS4gs0JrsVjoXO f1Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=W3LcHHhuZHz9FcX/ub9q4x7THlltzjqPGz3cG8JcJzk=; b=0IxalOwpqlkOSEqLgeVCPTHgNbhx5v268xIoKu1VS5OBa8MW09duP5yP31cOE5q4GF BGvsDfZY1vA2mS5MQvjEwn/p/NjffjE+IsOpR0Hiv/MwTEcpvVjKXZ4ElLfrjM7qB1fo tBMQgxISo+YaUCji6fT1KJkM6HDXdHe/FNJhh8ThULf24G5m2YdcOYvT9Bs40GD+ZJtj 2Q2JJwaTceRyKmNFMgCYlA0NNXKC6CRrtHZcYSBf8fWs3i5PLR/Pf2tg0aSbmeL/FGQD Omft3ar91tEHiYB/jLNKPIFR80DbmK43/Ps13BjPZ+TAirIU6d+n0Utt/AI3SFCnCdaW j8ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j30si3097303ejo.776.2021.09.08.12.06.20; Wed, 08 Sep 2021 12:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348289AbhIHS4i (ORCPT + 99 others); Wed, 8 Sep 2021 14:56:38 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:37970 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S240231AbhIHS4i (ORCPT ); Wed, 8 Sep 2021 14:56:38 -0400 X-UUID: f413067d81e5494494b680887cf22618-20210909 X-UUID: f413067d81e5494494b680887cf22618-20210909 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 578679305; Thu, 09 Sep 2021 02:55:27 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 9 Sep 2021 02:55:26 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 9 Sep 2021 02:55:26 +0800 Message-ID: Subject: Re: [PATCH v3 8/8] mt76: mt7915: set muru platform type From: Ryder Lee To: Shayne Chen , Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Evelyn Tsai , linux-mediatek Date: Thu, 9 Sep 2021 02:55:26 +0800 In-Reply-To: <20210908094144.25641-8-shayne.chen@mediatek.com> References: <20210908094144.25641-1-shayne.chen@mediatek.com> <20210908094144.25641-8-shayne.chen@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 2021-09-08 at 17:41 +0800, Shayne Chen wrote: > Set muru platform type by mcu cmd to notify fw to init corresponding > algorithm. > > Suggested-by: Money Wang > Reviewed-by: Ryder Lee > Signed-off-by: Shayne Chen > --- > v3: - fix endianess > - rework muru ctrl function > --- > drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 17 > +++++++++++++++++ > drivers/net/wireless/mediatek/mt76/mt7915/mcu.h | 5 +++++ > .../net/wireless/mediatek/mt76/mt7915/mt7915.h | 1 + > .../wireless/mediatek/mt76/mt7915/testmode.c | 16 +++++-------- > --- > .../wireless/mediatek/mt76/mt7915/testmode.h | 4 ---- > 5 files changed, 28 insertions(+), 15 deletions(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c > b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c > index 229ba3c469d1..afafc47264cd 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c > @@ -2949,6 +2949,21 @@ static int mt7915_mcu_set_mwds(struct > mt7915_dev *dev, bool enabled) > sizeof(req), false); > } > > +int mt7915_mcu_set_muru_ctrl(struct mt7915_dev *dev, u32 cmd, u8 > *val) > +{ > + struct { > + __le32 cmd; > + u8 val[4]; > + } __packed req = { > + .cmd = cpu_to_le32(cmd), > + }; > + > + memcpy(req.val, val, sizeof(req.val)); Will this lead to undefined behavior if memcpy size larger than source? what about passing u32 and using put_unaligned_le32? Ryder