From patchwork Sun Jan 5 12:21:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 216745 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 0A02EC33C8C for ; Sun, 5 Jan 2020 12:22:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFFF3215A4 for ; Sun, 5 Jan 2020 12:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578226974; bh=pxkFhecdCehym7cCCgqXYYig3lIDTh079NLpYGJZmRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ynGu2XOrcPzoe11gymq0mEd8lgA5Xo9HIrrFGE/RudehF+5bQGqwYEPG7EcTlHsBM mwd56ZQPquhEgZBRwpFjO2jPdoNJMYaZTtW4rJ4TFW8QdxX2DyJnViD2gecF1f3kJq J/uFoWh5R/SAnGNsEbxhqdU8uzt+Nwjwp1BMtDcE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726454AbgAEMWy (ORCPT ); Sun, 5 Jan 2020 07:22:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:47278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbgAEMWx (ORCPT ); Sun, 5 Jan 2020 07:22:53 -0500 Received: from new-host-5.station (net-2-42-61-77.cust.vodafonedsl.it [2.42.61.77]) (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 EE4AD24650; Sun, 5 Jan 2020 12:22:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578226973; bh=pxkFhecdCehym7cCCgqXYYig3lIDTh079NLpYGJZmRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PFdTnyQNsknZXC+ry6EepAtftsZjRBZC3Ga/AVpuWZlyB3yfZJXcY2N2XX++Xg/yJ mr6KDws8n85t+Fpn0nRsY+h9IPOftiWr4Ejej6y6z8n3fIkcdVTv26jCnEBtAG7+VO rLmTpQH7YNfvgb48LiWzHb+ANPERVCw8CVN0DP8s= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, Sean.Wang@mediatek.com Subject: [PATCH v2 10/18] mt76: mt76u: add mt76u_alloc_rx_queue utility routine Date: Sun, 5 Jan 2020 13:21:48 +0100 Message-Id: <2b4eba1ccbc02bc6e32e473cf06cb4989c981beb.1578226544.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.21.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 Introduce mt76u_alloc_rx_queue routine to allocate rx hw queue. This is a preliminary patch to support new devices (e.g. mt7663u) that rely on a hw queue for mcu messages Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/usb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index dde1ee34d23d..e1112899a207 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -603,9 +603,10 @@ mt76u_submit_rx_buffers(struct mt76_dev *dev, enum mt76_rxq_id qid) return err; } -static int mt76u_alloc_rx(struct mt76_dev *dev) +static int +mt76u_alloc_rx_queue(struct mt76_dev *dev, enum mt76_rxq_id qid) { - struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN]; + struct mt76_queue *q = &dev->q_rx[qid]; int i, err; spin_lock_init(&q->lock); @@ -624,7 +625,7 @@ static int mt76u_alloc_rx(struct mt76_dev *dev) return err; } - return mt76u_submit_rx_buffers(dev, MT_RXQ_MAIN); + return mt76u_submit_rx_buffers(dev, qid); } static void @@ -966,7 +967,7 @@ int mt76u_alloc_queues(struct mt76_dev *dev) { int err; - err = mt76u_alloc_rx(dev); + err = mt76u_alloc_rx_queue(dev, MT_RXQ_MAIN); if (err < 0) return err;