Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp321515rdd; Tue, 9 Jan 2024 05:25:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1gRNU62B8XMMhMBW5z+8hPDC15SQE0pUXbVb6H86Xo9wNyo4TQlmwFA6hkrCr3TGj8TUE X-Received: by 2002:a17:902:6542:b0:1d4:f12a:99a0 with SMTP id d2-20020a170902654200b001d4f12a99a0mr843791pln.5.1704806739604; Tue, 09 Jan 2024 05:25:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704806739; cv=none; d=google.com; s=arc-20160816; b=eAVvD0JV0hZsaLoIQ61wsYSCNZ+wa53dBLrsFS+gX/ZJ1lvwNdkbDp+J4gvmA1I0QR EEWNxvD8E6yxOms5wqG4dCb9KFVyLmevM6f9yY6injympEJgWKB61EoIkGWupvtcfFdJ 2pb3L4JbdWI4OpXeWwCeS9i7lxWBlU2tg+9XwxJj6dM9oagi7T1YFqL01CvRbs8tlSl0 2szkZqxBW92+Zyi5BMGcO7qML1rpbLTt1KzC2HBAtRwdw2GWkKr2os11YhhfDTYEzDQA +LlEd7BT+QhkAb5oGWrG8/iW6OYV0dj/oVz4+1pa6X0XRY5qQ85GLFmPcN3df/UbsbB0 OaiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=PmYRPNOtowZtUG6mbXstod4k2Hf/1yHJpWonlbn3Aq8=; fh=gNywOoGH9FiEKkqPngRyqJ0mvecwQizKE+QEYR6/Bdw=; b=esvW+Ex0loeoOGN/WOSoyDoZ3ZtRDvnv5tIfKHeqbmhyamcjH4R4pWLLWMD4tYMjuV HQuEPeCiTQYiYWFBNZn6z/0wbbUiP+2EM09BZU2u3n8kZ6BlKap3b/NB8HEFTXN/Z+Ut kCJWbhklYtdPdYYxWhXg06Y+AsxDJOmSZHwgq7QuJPJxnzkfrGdPOFD20iPXiCpFAmom F590/ma41F7WfDrUaaPN7D5wZXlryTxDx2HA9IyOhpi0a3Mqc55/2pthGj2n+jDW5OLw nTkWnT6TxK7+K5sZmw29gsPfWYQ0jKoGFEN2QqJpF6kRbBtOel0WJb5CqhayLqcoEy8a 3DCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L5rpfoXx; spf=pass (google.com: domain of linux-wireless+bounces-1631-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1631-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x2-20020a170902b40200b001d55aa9ffecsi808171plr.253.2024.01.09.05.25.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:25:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1631-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L5rpfoXx; spf=pass (google.com: domain of linux-wireless+bounces-1631-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1631-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E3E7C2870A0 for ; Tue, 9 Jan 2024 13:25:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB59938F8C; Tue, 9 Jan 2024 13:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L5rpfoXx" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D04ED38F8A for ; Tue, 9 Jan 2024 13:25:27 +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) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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