From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DA6CC46CD2 for ; Tue, 9 Jan 2024 13:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PmYRPNOtowZtUG6mbXstod4k2Hf/1yHJpWonlbn3Aq8=; b=stSPAa0tifb+1ylnTbL8E4C02b 76hEyT+WxCfkqw01fAJa6bxdcbcSCjdekJbQ9LoNQveAQbc5l06vekq+UBbmdSc37ueIGY0FG8UB1 LqTpVBACfgYZFZyqiFRaIfwfMw20m6EOUGmyxnOFMgU74Z0GQGQ3zyjtFz7OlA9RohzU/iCKrKjK0 ndZrGcN3tXVWF9cWjnouoOKdrVTAbOhPQjASunW7XFTcmi7U+x9HHjdeaseWXDKda/aO2US50+m7B utStyFbk7eljn5pBaEq+MolZO5erL5x64X8rn4qOBnpVWC2jh+7TMfluq+rbjn2nyWQ1BO50H0gOS HIjHr49g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNC6n-008MWQ-0G for ath12k@archiver.kernel.org; Tue, 09 Jan 2024 13:25:33 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNC6j-008MVr-1D for ath12k@lists.infradead.org; Tue, 09 Jan 2024 13:25:30 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 0DF9DB802C5; Tue, 9 Jan 2024 13:25:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98E22C433C7; Tue, 9 Jan 2024 13:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704806727; bh=hWfC3nwISNlU43qKaia8bNnTVYDPxraQ0ILBp0ZN2G8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=L5rpfoXxeKVSgRUX6cjdFvnqnvKJ+/DcNjUzTM/KiJfiakgtGLh2clmsc9LzSIdVY 1a0iry9fYA7Y090SR8z+1XVu7MjUfXtFq+a1Eifg49qtNyDsGYsWzsHc8TaAytnmlC ASFiCqAQI3/LwpPYoph1LrqmFPGXOY6W5l1viCTMguJ8OAIYVjXnywJjpnho5YAExF FbUXxWZB6SXQm6Zqfd63LUbBqnok0tM/C+L04f2gSsobHaWYQMM1qxrDS+vJdOYLL6 eiofV7zDX2xO6jWTPU6qmrqmR3PWNff9RoHpRHdNXOyrpM86vxlFBc9iBKoKzO/Gg/ 4d8E91iVLLPHg== From: Kalle Valo To: Karthikeyan Periyasamy Cc: , Subject: Re: [PATCH 4/4] wifi: ath12k: Refactor MAC un/register helper function References: <20231206034920.1037449-1-quic_periyasa@quicinc.com> <20231206034920.1037449-5-quic_periyasa@quicinc.com> Date: Tue, 09 Jan 2024 15:25:24 +0200 In-Reply-To: <20231206034920.1037449-5-quic_periyasa@quicinc.com> (Karthikeyan Periyasamy's message of "Wed, 6 Dec 2023 09:19:20 +0530") Message-ID: <87bk9uej0b.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240109_052529_591200_50A19D68 X-CRM114-Status: GOOD ( 19.31 ) X-BeenThere: ath12k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath12k" Errors-To: ath12k-bounces+ath12k=archiver.kernel.org@lists.infradead.org Karthikeyan Periyasamy writes: > Currently, the mac80211 hw registration procedure is tightly coupled with > the handling of link/radio (ar). Define a new helper function to separate > the link/radio handling from the mac80211 hw registration procedure for > improved code readability. Also, it can be easy to scale these > functionality to support single/multi link operation in the future. > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > > Signed-off-by: Karthikeyan Periyasamy > --- > drivers/net/wireless/ath/ath12k/core.c | 61 +++++++++++- > drivers/net/wireless/ath/ath12k/mac.c | 132 ++++++++++--------------- > drivers/net/wireless/ath/ath12k/mac.h | 4 +- > 3 files changed, 109 insertions(+), 88 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c > index e10c5f2cd8eb..d1ac00c59b8c 100644 > --- a/drivers/net/wireless/ath/ath12k/core.c > +++ b/drivers/net/wireless/ath/ath12k/core.c > @@ -498,11 +498,62 @@ static void ath12k_core_soc_destroy(struct ath12k_base *ab) > ath12k_qmi_deinit_service(ab); > } > > +static int ath12k_core_mac_register(struct ath12k_base *ab) > +{ > + struct ath12k *ar; > + struct ath12k_pdev *pdev; > + int i; > + int ret; > + > + if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags)) > + return 0; > + > + /* Initialize channel counters frequency value in hertz */ > + ab->cc_freq_hz = 320000; > + ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1; > + > + for (i = 0; i < ab->num_radios; i++) { > + pdev = &ab->pdevs[i]; > + ar = pdev->ar; > + > + ret = ath12k_mac_hw_register(ar); > + if (ret) > + goto err_cleanup; > + } > + > + return 0; > + > +err_cleanup: > + for (i = i - 1; i >= 0; i--) { > + pdev = &ab->pdevs[i]; > + ar = pdev->ar; > + ath12k_mac_hw_unregister(ar); > + } > + > + return ret; > +} Is there a reason why you moved these two functions from mac.c to core.c? This is mac level code anyway, right? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches