Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4375646pxb; Tue, 10 Nov 2020 15:07:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJybUc4u3xVTTCDm0wE6kN23f1n76BB29VsUYPziPXc/WVPfawIWosCLCWjlO8cdQeBiRkO0 X-Received: by 2002:aa7:cb58:: with SMTP id w24mr23150267edt.35.1605049629112; Tue, 10 Nov 2020 15:07:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605049629; cv=none; d=google.com; s=arc-20160816; b=dZbsENFBiIoR4zCZibyK1T0roDwdTlUwq+KClQ2+vpMt6AgLMxpBV04YEq8K3ygUdk nrx4bj7CDKejCl1LhFtgnNQ6AT5UXj/IAgxBOgbqOFvOoO3fvFxdxebX60T+3U+S1uws Zjk+CdNnVwIgvv/NyJWuqJTE5DKnfaXfG8Q+oLSdz8DSuaXx7vTUhqvrnQd0IQDbta1Q XckefHmzA5xc1Tn9mln5sFUXR8qJXfTOyJk+qLIkzZ61CUjJW59ME7vNmF2vHYX9GTpl 700dRBd0C2Tl8YB/r6JLSWat5YEbgi/pXV2fdSULqBiTgTrcLxooj1uL2t5Vp4aXMnso TpKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Cljip9sUaVlvc2jEOUwu2jTiAw4pojPhBdDguu8iGf4=; b=dpVAsniP8FR0Nxkla5sDa3ghTiz2HpJVt3ptK/iJlhnA1jz6vc6TufNAkentVqFR4e 07mn2eedW4vj/nk2J0dRnMe/cG6/RMeOR604eWxIDaiN/BlGls5n5OmnO0arm4DF2OMG M/tNmZ672kOtfrde0u5zd29SmDUqFMb5DJ7x+6ywtWeDxG/Uu/j+jrtk9MABy4xDVHDE kZlZ50mzBgV7vx0KdWc64fZfLcK4GsM4jnvl31Uv0K+b6PUGo4EpAQNW3PIS42zRJ7iy qwrzAJ5Q6IZH4BcYc13ubIBoqW6hgCZa3iplYgngwZWLOnDBYwbK2eVKNx0Zru0Ft8KX pcug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BnyVIWeV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si139203edo.178.2020.11.10.15.06.34; Tue, 10 Nov 2020 15:07:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BnyVIWeV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732100AbgKJXDQ (ORCPT + 99 others); Tue, 10 Nov 2020 18:03:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:56402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730254AbgKJXDQ (ORCPT ); Tue, 10 Nov 2020 18:03:16 -0500 Received: from lore-desk.redhat.com (unknown [151.66.8.153]) (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 D353020781; Tue, 10 Nov 2020 23:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605049396; bh=pcgvpl/fYziMjSJsSzAEy+KqImxcD5yVRG1orWVhrXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BnyVIWeVtZVakC/5SU/gIlfaLJPpiQ9CPFDRKiOp9WAJH9HISpRu8Wgr85RrDewtE wGIL7rsIYI3cGZ4ehz+JR5MMgJIE+NEiYG25VJP7Cxg45Ny2WGWiCUBam43rdeYZ/I uwXx6fOL7r60eLzo8/Io+XlCQDr9NZHG3WIcmWvw= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com, sean.wang@mediatek.com Subject: [PATCH 02/10] mt76: sdio: introduce mt76s_alloc_tx_queue Date: Wed, 11 Nov 2020 00:02:52 +0100 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is a preliminary patch to move hw data queues in mt76_phy for mt7915 dbdc support Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/sdio.c | 44 ++++++++++++++++------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c index b4def262e1a0..4c6a65cec318 100644 --- a/drivers/net/wireless/mediatek/mt76/sdio.c +++ b/drivers/net/wireless/mediatek/mt76/sdio.c @@ -36,28 +36,46 @@ mt76s_alloc_rx_queue(struct mt76_dev *dev, enum mt76_rxq_id qid) return 0; } +static struct mt76_queue *mt76s_alloc_tx_queue(struct mt76_dev *dev) +{ + struct mt76_queue *q; + + q = devm_kzalloc(dev->dev, sizeof(*q), GFP_KERNEL); + if (!q) + return ERR_PTR(-ENOMEM); + + spin_lock_init(&q->lock); + q->entry = devm_kcalloc(dev->dev, + MT_NUM_TX_ENTRIES, sizeof(*q->entry), + GFP_KERNEL); + if (!q->entry) + return ERR_PTR(-ENOMEM); + + q->ndesc = MT_NUM_TX_ENTRIES; + + return q; +} + static int mt76s_alloc_tx(struct mt76_dev *dev) { struct mt76_queue *q; int i; - for (i = 0; i < MT_TXQ_MCU_WA; i++) { - q = devm_kzalloc(dev->dev, sizeof(*q), GFP_KERNEL); - if (!q) - return -ENOMEM; + for (i = 0; i <= MT_TXQ_PSD; i++) { + q = mt76s_alloc_tx_queue(dev); + if (IS_ERR(q)) + return PTR_ERR(q); - spin_lock_init(&q->lock); - q->hw_idx = i; + q->qid = i; dev->q_tx[i] = q; + } - q->entry = devm_kcalloc(dev->dev, - MT_NUM_TX_ENTRIES, sizeof(*q->entry), - GFP_KERNEL); - if (!q->entry) - return -ENOMEM; + q = mt76s_alloc_tx_queue(dev); + if (IS_ERR(q)) + return PTR_ERR(q); - q->ndesc = MT_NUM_TX_ENTRIES; - } + q->qid = MT_TXQ_MCU; + dev->q_tx[MT_TXQ_MCU] = q; return 0; } -- 2.26.2