From patchwork Mon Apr 20 11:58:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 215922 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 173D5C3815B for ; Mon, 20 Apr 2020 11:58:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E029C2072B for ; Mon, 20 Apr 2020 11:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587383937; bh=vr296BXTacwYCW7+S+TQrYUYxiozu97XI9e3sys14XY=; h=From:To:Cc:Subject:Date:List-ID:From; b=lWTxPoio5virNzpdqJNSdkoR/IADdpaKAAfodoZmPOSkcHDDUJhrGKrYwY9bRH1g3 ie6R5HC9EMBoUGRoztM/BJ0QBhzwGEu7RrkMzIAAXnPwDS7H46oEhYWgXKqM+OrZhJ nPJvA1kxhNUCdA5pxyraOdHL29XLKkq9Xj5XHxF0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbgDTL64 (ORCPT ); Mon, 20 Apr 2020 07:58:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbgDTL6z (ORCPT ); Mon, 20 Apr 2020 07:58:55 -0400 Received: from localhost.localdomain.com (unknown [151.48.159.126]) (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 E7AF22072B; Mon, 20 Apr 2020 11:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587383935; bh=vr296BXTacwYCW7+S+TQrYUYxiozu97XI9e3sys14XY=; h=From:To:Cc:Subject:Date:From; b=Za8/hECa0PmiHeZTX4RPJ1kGonEEJ1JJcZmYV0j6L8LdpPk9Qg3BNdlDtFH9bstIT Xcd3t7xy/XVeR7gvt2EyjiFb8qZReZUNKFq/80pIvnYy6l7YL8nGY4Sg0QzWfXgL2L VUV0ye/c2IsgK6maKLpOgkRHIxLYoGLGMKP58grs= From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, linux-mediatek@lists.infradead.org Subject: [PATCH] mt76: mt7615: parse mcu return code for unified commands Date: Mon, 20 Apr 2020 13:58:44 +0200 Message-Id: <73930f50680e6c5fb54a9eacf07003a4e22f2570.1587383612.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add return code parsing for the following unified commands: - MCU_UNI_CMD_DEV_INFO_UPDATE - MCU_UNI_CMD_BSS_INFO_UPDATE - MCU_UNI_CMD_STA_REC_UPDATE Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 10 ++++++++++ drivers/net/wireless/mediatek/mt76/mt7615/mcu.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 703b6996a3d8..d448bbeba1c1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -187,6 +187,16 @@ mt7615_mcu_parse_response(struct mt7615_dev *dev, int cmd, skb_pull(skb, sizeof(*rxd)); ret = le32_to_cpu(*(__le32 *)skb->data); break; + case MCU_UNI_CMD_DEV_INFO_UPDATE: + case MCU_UNI_CMD_BSS_INFO_UPDATE: + case MCU_UNI_CMD_STA_REC_UPDATE: { + struct mt7615_mcu_uni_event *event; + + skb_pull(skb, sizeof(*rxd)); + event = (struct mt7615_mcu_uni_event *)skb->data; + ret = le32_to_cpu(event->status); + break; + } default: break; } diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h index 5440f24a834a..032b5f98608e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.h @@ -282,6 +282,12 @@ enum { MCU_UNI_CMD_STA_REC_UPDATE = MCU_UNI_PREFIX | 0x03, }; +struct mt7615_mcu_uni_event { + u8 cid; + u8 pad[3]; + __le32 status; /* 0: success, others: fail */ +} __packed; + struct mt7615_mcu_scan_ssid { __le32 ssid_len; u8 ssid[IEEE80211_MAX_SSID_LEN];