Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2419117rdb; Tue, 12 Sep 2023 00:48:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZr0KcVnd7y2nvzZBekMvVobf082C5mOOfp7/Uxfwb7+aoemGm04FH+qs3oiisapjpgRyp X-Received: by 2002:a17:902:ecc4:b0:1bd:bba1:be78 with SMTP id a4-20020a170902ecc400b001bdbba1be78mr12499484plh.23.1694504881555; Tue, 12 Sep 2023 00:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694504881; cv=none; d=google.com; s=arc-20160816; b=fgig9ZQZFqTcOdW/0bxh38Kk5/Uvooi6o6++FyBDRQi+7AFX8znLrGZfcsDnwfypbq FGj+jQZmyvZcTG8jxl9Fi3xgr9IIYyu2JwfNlloTFukZB1rdcy5ZylGLUzSbuRh/3+B8 awCsRiD13/s/Db0zUBRSnhr7kQv7SR8DpJQLGMCuPtlNpfci8FnsCLYj9ch8lkdF1Flx VGhJa076qUhA2SGvETcGaYc75CTFwB++wSbNeYd4hKQ6+AUazToGS6CjCXChzZktc0Dh R6OHpwrsWoTyT3NlD8t41B67zcyC+MSiTTv25B7OTT9lPvFCE0RrQ2eYJZjJme9pHuXP Oqkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=QIaN1utO1VHlj/8tIeHcu7VKVtsuUkJRfV6lWLXw4M0=; fh=W+5SKaFxthTmphJqNfvr20eGpDs/whkH1ogVujk566U=; b=ScLBi+nUj+ndrmJGGoQ60IL5+VhDCiqkrJXz38uVB/C+5C+KY0NqJUTAErP4abAqI8 sragqJgCtO7oz/J/+rv6bCrvIcXzR3IbV+NfoBN38bKK61ncVpTZdojwO+E+wWtlCR38 5mq1zUOYPwvPkq5zYjRmsSka4AvqLsoTmpb6ttcvXWH7kDfIq9A/xpe8aHPK6z9zR6Sc hOZ4/cNRH42O9m1o95GjY1h6oIhC67KA05ivWrRskLlOHv8w+lQqDFGrmdzJRXPyTZqd rTFix9ocxiyfcZij/KfpDxtsk1BA4R/hZHoVr/tIxri2+4IMt3+ZFG9/AjIyv+DL3wCQ 6Hww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XK6uPDgz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id kn12-20020a170903078c00b001bdb4827256si7320675plb.246.2023.09.12.00.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:48:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XK6uPDgz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 87C99803E8CE; Mon, 11 Sep 2023 22:20:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230470AbjILFUF (ORCPT + 55 others); Tue, 12 Sep 2023 01:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbjILFUE (ORCPT ); Tue, 12 Sep 2023 01:20:04 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37455AA for ; Mon, 11 Sep 2023 22:20:01 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38C3UD3S021595; Tue, 12 Sep 2023 05:19:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=QIaN1utO1VHlj/8tIeHcu7VKVtsuUkJRfV6lWLXw4M0=; b=XK6uPDgzOfnlIEooyUZooBUK5UK3VXUvYWZfjhHKyq7iM1R1z1pZFjLR1K35hMCeVviP 45g8jvqBP9KsYAX7PSLDR3eLmAvy7OVqE8CL18msASopuPdqdxXwtLJs/xWNASy18z6l YDvAMj9E7vPXR1mGY6xFG3BuEiKvacxHhGB5IUCay42qDdnAXTdgajNmLfyv07u5nkHp eTqxjAxiN2R1quRy4FQc97hUbf9ny2pfXtVi56D6Nwbg4RK4UyMvmx8TdQQSuk2Mmjw2 cRBX3huGuEPoaW5hLDKmpdTDi5Swf/e6dFVNf9ZViISLHMMCfimtz5+qW4jCEY1rJDqW tQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t2f3yr8sb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 05:19:56 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38C5JWma011984 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 05:19:32 GMT Received: from adisi-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Mon, 11 Sep 2023 22:19:29 -0700 From: Aditya Kumar Singh To: CC: , , "Aditya Kumar Singh" Subject: [PATCH v2 2/3] wifi: ath11k: fix CAC running state during virtual interface start Date: Tue, 12 Sep 2023 10:48:56 +0530 Message-ID: <20230912051857.2284-3-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230912051857.2284-1-quic_adisi@quicinc.com> References: <20230912051857.2284-1-quic_adisi@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: SPGDkbscH3K4YTRR5vfusdVbhqu_BUX1 X-Proofpoint-ORIG-GUID: SPGDkbscH3K4YTRR5vfusdVbhqu_BUX1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-12_02,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309120044 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 11 Sep 2023 22:20:13 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Currently channel definition's primary channel's DFS CAC time as well as primary channel's state i.e usable are used to set the CAC_RUNNING flag for the ath11k radio structure. However, this is wrong since certain channel definition are possbile where primary channel may not be a DFS channel but, secondary channel is a DFS channel. For example - channel 36 with 160 MHz bandwidth. In such cases, the flag will not be set which is wrong. Fix this issue by using cfg80211_chandef_dfs_usable() function from cfg80211 which return trues if at least one channel is in usable state. While at it, modify the CAC running debug log message to print the CAC time as well in milli-seconds. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh --- drivers/net/wireless/ath/ath11k/mac.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index c071bf5841af..6b5f032197ff 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -7193,6 +7194,7 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, struct wmi_vdev_start_req_arg arg = {}; const struct cfg80211_chan_def *chandef = &ctx->def; int ret = 0; + unsigned int dfs_cac_time; lockdep_assert_held(&ar->conf_mutex); @@ -7272,20 +7274,21 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM started, vdev_id %d\n", arvif->vif->addr, arvif->vdev_id); - /* Enable CAC Flag in the driver by checking the channel DFS cac time, - * i.e dfs_cac_ms value which will be valid only for radar channels - * and state as NL80211_DFS_USABLE which indicates CAC needs to be + /* Enable CAC Flag in the driver by checking the all sub-channel's DFS + * state as NL80211_DFS_USABLE which indicates CAC needs to be * done before channel usage. This flags is used to drop rx packets. * during CAC. */ /* TODO Set the flag for other interface types as required */ - if (arvif->vdev_type == WMI_VDEV_TYPE_AP && - chandef->chan->dfs_cac_ms && - chandef->chan->dfs_state == NL80211_DFS_USABLE) { + if (arvif->vdev_type == WMI_VDEV_TYPE_AP && ctx->radar_enabled && + cfg80211_chandef_dfs_usable(ar->hw->wiphy, chandef)) { set_bit(ATH11K_CAC_RUNNING, &ar->dev_flags); + dfs_cac_time = cfg80211_chandef_dfs_cac_time(ar->hw->wiphy, + chandef); ath11k_dbg(ab, ATH11K_DBG_MAC, - "CAC Started in chan_freq %d for vdev %d\n", - arg.channel.freq, arg.vdev_id); + "CAC (for %u ms) Started in center_freq %d center_freq1 %d for vdev %d\n", + dfs_cac_time, arg.channel.freq, chandef->center_freq1, + arg.vdev_id); } ret = ath11k_mac_set_txbf_conf(arvif); -- 2.17.1