From patchwork Mon Feb 4 16:51:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10796097 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5ADE4922 for ; Mon, 4 Feb 2019 16:51:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 498B62BDAE for ; Mon, 4 Feb 2019 16:51:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47AF02BDCB; Mon, 4 Feb 2019 16:51:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53F982BDB6 for ; Mon, 4 Feb 2019 16:51:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbfBDQvz (ORCPT ); Mon, 4 Feb 2019 11:51:55 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36648 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729892AbfBDQvz (ORCPT ); Mon, 4 Feb 2019 11:51:55 -0500 Received: by mail-wm1-f67.google.com with SMTP id p6so653665wmc.1 for ; Mon, 04 Feb 2019 08:51:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wX6nxWTlBcwblmhHjyDd7eUVh7ijgEJ3FKaiEYVhMsw=; b=HgTG3ez9x1ajlWvnKgYiEhYVoi50E6CBULIHK5xBl+za0XahoAsNBXzzr28/86z0nZ efAEse7Y85IQVJHK5Mfsf1N+T3XcHHlb6CsRIFPwEtI4ke5G2rRh/MnkhOJecHzpAJom zoqNNl/RowCaNk8IQqoURkcqO07v1cep7maJ25poOtill4MeXj045GmaiGS4dP68ez+J Bi6mc5ZvwRFHcL/ivKJ7lpD6aHwh7GGAvuWhBqOolbkGMN+t72wysWErf2Fpzs4xgMHE yAMCRDQfy+UXFnV22E9DxBVf0OwX53ZlTMgJoXZzd0DcRQVkrTXWZazXGttU6nliWe0a v4Qw== X-Gm-Message-State: AHQUAuZe9UYJckEC/sWoe6WcrdkNJVsTRKXLvOzGedNiRpnOE6O2S9WM aKQRmpi/x7WCWbo/ALK5o4jMdfy2Rcw= X-Google-Smtp-Source: AHgI3IZavWHVdTAcBzkuAczo4EFKGZ3NaOtbNLFIVCowi68iWkwrTRtku9Symdszun5X7l76Sx+l2Q== X-Received: by 2002:a1c:6a0f:: with SMTP id f15mr278055wmc.68.1549299113204; Mon, 04 Feb 2019 08:51:53 -0800 (PST) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id r22sm11233707wmh.2.2019.02.04.08.51.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 04 Feb 2019 08:51:52 -0800 (PST) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com Subject: [PATCH 3/3] mt76: move mt76_mcu_rx_event in mt76-core Date: Mon, 4 Feb 2019 17:51:29 +0100 Message-Id: <0036ff4837833af385d0457d23e438198eea8461.1549298196.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.20.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 X-Virus-Scanned: ClamAV using ClamSMTP Move mt76_mcu_rx_event i mt76-core module and remove duplicated code. mt76_mcu_rx_event will be reused adding support for mt7603 driver Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mcu.c | 7 +++++++ drivers/net/wireless/mediatek/mt76/mt76.h | 1 + drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c | 3 +-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mcu.c b/drivers/net/wireless/mediatek/mt76/mcu.c index 0fd71a97a197..dbb57b593a87 100644 --- a/drivers/net/wireless/mediatek/mt76/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mcu.c @@ -51,3 +51,10 @@ struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev, return skb_dequeue(&dev->mmio.mcu.res_q); } EXPORT_SYMBOL_GPL(mt76_mcu_get_response); + +void mt76_mcu_rx_event(struct mt76_dev *dev, struct sk_buff *skb) +{ + skb_queue_tail(&dev->mmio.mcu.res_q, skb); + wake_up(&dev->mmio.mcu.wait); +} +EXPORT_SYMBOL_GPL(mt76_mcu_rx_event); diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index c43c78d45493..9c6b6cb4ff91 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -776,6 +776,7 @@ void mt76u_queues_deinit(struct mt76_dev *dev); struct sk_buff * mt76_mcu_msg_alloc(const void *data, int head_len, int data_len, int tail_len); +void mt76_mcu_rx_event(struct mt76_dev *dev, struct sk_buff *skb); struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev, unsigned long expires); diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c b/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c index a5413a309a0a..7861a832940b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c @@ -58,8 +58,7 @@ void mt76x02_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, if (q == MT_RXQ_MCU) { /* this is used just by mmio code */ - skb_queue_tail(&mdev->mmio.mcu.res_q, skb); - wake_up(&mdev->mmio.mcu.wait); + mt76_mcu_rx_event(&dev->mt76, skb); return; }