From patchwork Sun Jan 5 12:21:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 216748 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 883A3C33C9A for ; Sun, 5 Jan 2020 12:22:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48491217F4 for ; Sun, 5 Jan 2020 12:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578226965; bh=D1vmSmOvBpph5gWc+Ol2X4qyXZ/bV3ON/REHNMqow58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=O7ugJhpn3X60AMjZUT1O91IE//X/frr73k9JRySA6dcimRbfxVZop627Vkj6Gxhat BvAfTv0561AueezRjHJHVDGXkq+8dY3ggJhFnlyRxHkYsjOonXj5izNMNiQTLR2wDz J1mB597c848wni1fE6Rr9X2cyOnuOotnzFEyc/FI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726351AbgAEMWo (ORCPT ); Sun, 5 Jan 2020 07:22:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:46944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbgAEMWn (ORCPT ); Sun, 5 Jan 2020 07:22:43 -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 C4AA8215A4; Sun, 5 Jan 2020 12:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578226963; bh=D1vmSmOvBpph5gWc+Ol2X4qyXZ/bV3ON/REHNMqow58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ujaVqXmM3E+5XJ82HD+o0GDBhSAu1lSMaylWliSH9pRUrx+i9xMx3Ss0aWHVarcF9 pxIV6l1kSq/TsgjqZT2tuvEunw8Jh/uYEMtxO4h8CUKPo0A1MzMM7i+XubyCbdHhZA r2uQ4z/oFPgRPfGUO5LfO81WF0KYirE5Xil4YH48= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, Sean.Wang@mediatek.com Subject: [PATCH v2 04/18] mt76: mt76u: add mt76_queue to mt76u_refill_rx signature Date: Sun, 5 Jan 2020 13:21:42 +0100 Message-Id: <98472266869681f6d9cef56a1814a4350d1d25d9.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 mt76_queue parameter to mt76u_refill_rx signature in order to reuse it for mcu hw rx queue Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/usb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index 23973ec6c92c..65b819f0d18a 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -318,11 +318,12 @@ mt76u_fill_rx_sg(struct mt76_dev *dev, struct mt76_queue *q, struct urb *urb, } static int -mt76u_refill_rx(struct mt76_dev *dev, struct urb *urb, int nsgs, gfp_t gfp) +mt76u_refill_rx(struct mt76_dev *dev, struct mt76_queue *q, + struct urb *urb, int nsgs, gfp_t gfp) { - struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN]; + enum mt76_rxq_id qid = q - &dev->q_rx[MT_RXQ_MAIN]; - if (dev->usb.sg_en) + if (qid == MT_RXQ_MAIN && dev->usb.sg_en) return mt76u_fill_rx_sg(dev, q, urb, nsgs, gfp); urb->transfer_buffer_length = q->buf_size; @@ -355,13 +356,14 @@ mt76u_urb_alloc(struct mt76_dev *dev, struct mt76_queue_entry *e, static int mt76u_rx_urb_alloc(struct mt76_dev *dev, struct mt76_queue_entry *e) { + struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN]; int err; err = mt76u_urb_alloc(dev, e, MT_RX_SG_MAX_SIZE); if (err) return err; - return mt76u_refill_rx(dev, e->urb, MT_RX_SG_MAX_SIZE, + return mt76u_refill_rx(dev, q, e->urb, MT_RX_SG_MAX_SIZE, GFP_KERNEL); } @@ -558,7 +560,7 @@ mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q) count = mt76u_process_rx_entry(dev, urb, q->buf_size); if (count > 0) { - err = mt76u_refill_rx(dev, urb, count, GFP_ATOMIC); + err = mt76u_refill_rx(dev, q, urb, count, GFP_ATOMIC); if (err < 0) break; }