From patchwork Wed Mar 18 12:41:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 216260 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EA70C5ACD6 for ; Wed, 18 Mar 2020 12:41:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 37FE920768 for ; Wed, 18 Mar 2020 12:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584535297; bh=lqF7zlnVf6/0NevdwimAGCK2mAe+Unj/eKbq5AcaaTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SdLETgLc8PWYMRw1sXviElEptmiUG1PoV+TWBQqV6cgv9bby1KB0yD2ftqpfK/I6D WwI+DhLCA3H8Or6yjXP6Jmiy8kYWGEcgv+YcnLjaZ4EZXH6wKcqi5VIL/3OQMIYtmK OuFuxJarLoaGwvV83lERHDC0t0Q/aJEh8lnj8jjg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726767AbgCRMlg (ORCPT ); Wed, 18 Mar 2020 08:41:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:51824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbgCRMlg (ORCPT ); Wed, 18 Mar 2020 08:41:36 -0400 Received: from lore-desk-wlan.redhat.com (unknown [151.48.128.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1798B2076D; Wed, 18 Mar 2020 12:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584535295; bh=lqF7zlnVf6/0NevdwimAGCK2mAe+Unj/eKbq5AcaaTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0zoBC4DjueVAsTH1srqDMn38jdGTE4SiRcKHsMtsXubaswhnNf7XuRfJm3+Ev9+yP 26GoqgwOgzN7A3K8NI/iV+ZyamvzjPVGJ5hlxoSx/68xyM72pjsedpDiZNMQ1cdWXz tEvPl9SidP1UsqG/jyTs4MkcJvXjmsD8zFCSz4p0= From: Lorenzo Bianconi To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, nbd@nbd.name, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, ryder.lee@mediatek.com, linux-mediatek@lists.infradead.org Subject: [PATCH 1/3] mt76: mt7615: fix mt7663e firmware struct endianness Date: Wed, 18 Mar 2020 13:41:03 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Convert fields in mt7663_fw_trailer and mt7663_fw_buf to little-endian Reported-by: kbuild test robot Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi --- 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", From patchwork Wed Mar 18 12:41:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 216259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D64B9C5ACD6 for ; Wed, 18 Mar 2020 12:41:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A058E2076D for ; Wed, 18 Mar 2020 12:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584535302; bh=tP+u4ybkKs8jDbO/sPn25phauZi0VKfegPje63qy7Mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AKIX/nIRJeVwQTV6HMk06eClXer2cEjqiDdgZSwWWoZDvsINdBGuZTrCU+MDLTIPE FLpO6enPi8fsUBKDf3NBawsbT1bH6+Jd5iOTobPbs7MPmAcwJiO4hxzQiJXbMcx493 FhWwyCEU1HteTRSmZHIKgSbZoYHsF1dPFjDvgOqA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbgCRMlm (ORCPT ); Wed, 18 Mar 2020 08:41:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:51904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbgCRMll (ORCPT ); Wed, 18 Mar 2020 08:41:41 -0400 Received: from lore-desk-wlan.redhat.com (unknown [151.48.128.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0BEC32076E; Wed, 18 Mar 2020 12:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584535301; bh=tP+u4ybkKs8jDbO/sPn25phauZi0VKfegPje63qy7Mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s8Z66ysB7BEys739CfNE5DU4j+aLPJJEBH6BxdXcKNT/YxaeQ/7jyiMKQbZwOPpZe KGaTgZbvgBmwSplWw/1w121u0jxXdwKBJtakNwz52F9snP47Yd6GBwfs5/wVeVdAdm jsRqhyAi0uLXt3bySAzmOs8eB+ohP3tfuW4Kn/LY= From: Lorenzo Bianconi To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, nbd@nbd.name, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, ryder.lee@mediatek.com, linux-mediatek@lists.infradead.org Subject: [PATCH 3/3] mt76: mt7615: add missing declaration in mt7615.h Date: Wed, 18 Mar 2020 13:41:05 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 Fixes: 044a43256a35 ("mt76: mt7615: introduce mt7615_mcu_wait_response") Signed-off-by: Lorenzo Bianconi --- 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);