Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp289308rdb; Mon, 29 Jan 2024 02:15:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3vTkmu/Aw1Z9GHQbQoJPDmCb9mDdcna1MCxh6NEtcb3wlsBkJETYNT/+pf4Qfl132bvbF X-Received: by 2002:a05:6214:3019:b0:686:ac19:dbdc with SMTP id ke25-20020a056214301900b00686ac19dbdcmr4992628qvb.102.1706523326212; Mon, 29 Jan 2024 02:15:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706523326; cv=pass; d=google.com; s=arc-20160816; b=Pna99Vv0Q5YZ5ajawTU3N2s8C05Upg62LF2GFbVTfPDFnGjyTPRT/qHrIuNGhUnrSw 3hEkeWW7ep955lO00GBhbynx4rCMhem3bPZaE5ZiCWCJLHCY2XA6T9GkhVjAP3agDzpJ k4DB237OepsRSPmQpa58dK3uEs3sqCh4tan7xOS0tA/aRKOkUThghJQuAFDW0lwY8g29 G9dbx4ZefhHAP2bocWyxd23oAZkb0Ehjx0YxguoZhkUFRM6n5zO3WFJRVEuwrOM7ef3i JGFka0uu9Ug/KDQWdNUVhwaPQBt/FPfQLlWzS0XvQxqY40WJQUx8SklnxorwLJDLoPom CO6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9gGxKoTWacXUaD1QUJ6ADPVjHjk8PFQVXH+8EGOZ0xM=; fh=Ytdz/oWTgb4ioZYzcjqGNnhkthhIkqh3lv9CRhXQ9bg=; b=wIK45EOXn0bPXHmFhwpA2hjMzShHXqJdYg1aLrDIIW7zSQBHYcWoxK6k8NotST1IxI lk4mIHtM9m8tI0FVUwo1XALmfKF5NIHi1OUNW+Rt0iLdWBclWHHulxtW513h6R9iz5AE s8wODj7fW5KJMkCT9lgVTP1pWfVkOApugi7jT4NzG1k4gAEOLHKOiiUgzsKSDGEkWo9x 8+CI8s7bvtFAAXQx11IGd9pl8//oQRN6TbblOAhIgERydfQDx+Td1zRWAUIyxUBK65W8 w5TDgwu6C7RsHk/Zp/+efwVN0Nk7brdllHc5mCjTCm47ixgpeXR4+1dpZszHBeAto06s p/RA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DR1mTZlc; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-2651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCVUmupNuTHXb8TB8iGElmhG0E6XYC6KQp3Z4YZFDAD3euwYTFRAeWMRqQcZcrLuJOv/yD73TJulVb0bLxKgbxHJ2AbPLgd5LFBNsWmvpQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q11-20020ad4574b000000b0067a9d364535si1690283qvx.11.2024.01.29.02.15.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 02:15:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DR1mTZlc; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-2651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BAFF11C221A8 for ; Mon, 29 Jan 2024 10:15:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62E6E55E51; Mon, 29 Jan 2024 10:15:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="DR1mTZlc" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 B13F455E7F for ; Mon, 29 Jan 2024 10:15:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706523320; cv=none; b=IRi3KiQWWnBE9y9uREqPxd2JavFrokVVmhgVDKJaPAtdjpIxPtzaYk4bPzW68XwMaBwDO/oIQLh7jxDETxW150sCOiwOzOCPGMZlNnVH1Mw/9Y5jGxWrOskK1gD78O1JNzAGX7jpw83yLbEzx8qZEJFHrEJ+pOia9LcE20ZW/gI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706523320; c=relaxed/simple; bh=NU5xd2Z/nqCE69LmeXu58U3V/XDvzY60jqZKDmsSAPk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=D83XLJVTmQI7YWOqhPhqi6kv7ei2TevPZjLxDJPjrPHszyTUvB5yBFOVowfE4rxwUTFug4HI4dD36NWEgi9SXtJgd9WULHfAeojR1G6nlb9Yo4mJKQJydXZlKIVl+zKXzmXqV/a/9hBDT2ZQN4qG8I9St59mutWObI1W74SSu1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=DR1mTZlc; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40T7GMKM024165; Mon, 29 Jan 2024 10:15:15 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-transfer-encoding:content-type; s= qcppdkim1; bh=9gGxKoTWacXUaD1QUJ6ADPVjHjk8PFQVXH+8EGOZ0xM=; b=DR 1mTZlcAWf7KO22bvWghK0lj6WF0QKLd3lgV2EWniH+P1Vf8tY16OYTvXc0fqqWMW /g8REcbbltWj5F54pHQKwCv4SzMkorqlP/gx+isliqEYet1BTSj1CYsCgF0RrY8t FTod5RPxLLSyFV1IKSeE2JbWNsUbIWtplxTElHuZJy41n2lqYlMbWW1rhkWlTh0s mw+39/PC7mQalwQROfM0T6Lk2mbuT226gy6DNQggn6/IHUEiefjUF7lKmZ2UxKiR Rk9mQEKBQ8PnGzviiVt7+nNOxZX4wfLnPLYyaW+FkTMVVEf0FCcxcNxPl1Rm80WT 8ocion+tYcolgH2V0CKQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vx3rqgqa9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 10:15:15 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40TAFEwh027225 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 10:15:14 GMT Received: from yk-E5440.qca.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 29 Jan 2024 02:15:12 -0800 From: Kang Yang To: CC: , Subject: [PATCH v5 01/11] wifi: ath12k: change interface combination for P2P mode Date: Mon, 29 Jan 2024 18:14:43 +0800 Message-ID: <20240129101453.368494-2-quic_kangyang@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129101453.368494-1-quic_kangyang@quicinc.com> References: <20240129101453.368494-1-quic_kangyang@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: PQ_tIW852POZh0pR0PVTYLAVXjkYVRIn X-Proofpoint-ORIG-GUID: PQ_tIW852POZh0pR0PVTYLAVXjkYVRIn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-29_06,2024-01-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 impostorscore=0 bulkscore=0 mlxlogscore=841 spamscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2401290073 Current interface combination doesn't support P2P mode. Change the combination for P2P mode. Also, there is a bug that when mesh is enabled but ap is not enabled. In this situation, the mesh's max_interface of interface combination won't be set. So assign the max_interfaces for mesh directly. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Kang Yang --- v5: no change. v4: no change. v3: no change. v2: 1. add Tested-on tag of QCN9274. 2. update copyright. --- drivers/net/wireless/ath/ath12k/mac.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index a27480a69b27..d1d2e83dfa37 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -7479,9 +7479,10 @@ static int ath12k_mac_setup_iface_combinations(struct ath12k_hw *ah) struct ieee80211_iface_combination *combinations; struct ieee80211_iface_limit *limits; int n_limits, max_interfaces; - bool ap, mesh; + bool ap, mesh, p2p; ap = ath12k_mac_is_iface_mode_enable(ah, NL80211_IFTYPE_AP); + p2p = ath12k_mac_is_iface_mode_enable(ah, NL80211_IFTYPE_P2P_DEVICE); mesh = IS_ENABLED(CONFIG_MAC80211_MESH) && ath12k_mac_is_iface_mode_enable(ah, NL80211_IFTYPE_MESH_POINT); @@ -7490,9 +7491,15 @@ static int ath12k_mac_setup_iface_combinations(struct ath12k_hw *ah) if (!combinations) return -ENOMEM; - if (ap || mesh) { + if ((ap || mesh) && !p2p) { n_limits = 2; max_interfaces = 16; + } else if (p2p) { + n_limits = 3; + if (ap || mesh) + max_interfaces = 16; + else + max_interfaces = 3; } else { n_limits = 1; max_interfaces = 1; @@ -7507,14 +7514,22 @@ static int ath12k_mac_setup_iface_combinations(struct ath12k_hw *ah) limits[0].max = 1; limits[0].types |= BIT(NL80211_IFTYPE_STATION); - if (ap) { + if (ap || mesh || p2p) limits[1].max = max_interfaces; + + if (ap) limits[1].types |= BIT(NL80211_IFTYPE_AP); - } if (mesh) limits[1].types |= BIT(NL80211_IFTYPE_MESH_POINT); + if (p2p) { + limits[1].types |= BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO); + limits[2].max = 1; + limits[2].types |= BIT(NL80211_IFTYPE_P2P_DEVICE); + } + combinations[0].limits = limits; combinations[0].n_limits = n_limits; combinations[0].max_interfaces = max_interfaces; -- 2.34.1