Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2497384rdb; Mon, 5 Feb 2024 08:17:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKsAuB/1eA1qvdv81M24eE5TwYftX0LEHvLqTIJKx4rEnpsjuLxjNNJHn5iALabWcuv4bE X-Received: by 2002:a17:906:5782:b0:a30:d336:d7b6 with SMTP id k2-20020a170906578200b00a30d336d7b6mr6641932ejq.57.1707149841624; Mon, 05 Feb 2024 08:17:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707149841; cv=pass; d=google.com; s=arc-20160816; b=NKJ4ZQ88971/+8ZGRU9xzq6ESqiTdhZOH6Zq4dkYGwCTza+xWH8wT9eGLu9+f1cMd/ dXGtVDkqEHMhtiU1Fx44aUJ4AdqjofFyUgv44rDEWFbPZqI/p6etzdwFXP1cqJVzHWQ+ GAet8Z/abfbOoZ5prx92a8Lkye/PRc3aUvb1EdCD+E7g882qRaMDBEojbuCii6STeECd 14jECrFNf5Ss6EDw3j9yzEeBHJ/LKkgCGERrkATOz2yDZuqX+Nsm+dPnZzTQ3Na+vxBq npmTknRc2x4fE99pFjgNxQkQR2ASQ6GRzsDug2k7q9IvyniuQEa6fuRYhLgnv81PctWM 8/6w== ARC-Message-Signature: i=2; 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=5Q8EFFedaXj7WDNwu52pImfXlitC5Z/0rxc1XStBMmw=; fh=iEkww2eax7Uor3vNhpum0zqth9jjmZdQrSrD2Funer4=; b=lU+5l3dz4FD6SGdFTrJnFj9Pz/Odd63nbJhIVD8BsQFdOBEP7+RDdLANC6MYbZ6T4L y7QNNnd80ki/Cmla4NrY1LUnU1gBzIqnIadx+thitAPzZOf9k+kTv3WyFylcS+7bDdaG lR31lKh4S/4FbslHkRgJb7SgUNikrgX3ffdRqMuhX248r17sn1X5DZWOx/H4HuQNgxAO HRg33r65/Wgg3cuxkB2JTqQQInoWiuxn2Yid4kW23ZyEPvUbEnF6qwZmlvb9Tp+Sd60j T+mHNDiEkU0zzrhxHg3fUW23ESWvfQX5AfbFx4ds/dbTax2xy3uekU6VIw99AgWp2XIT uxyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dHvPP3sb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCU/jaDjiRgay+sQiAGlAoUwgIpu6Wnor+GdBnASrP+9ou1bUkiXd0qmITRZpanCb8J+NLgj0Br7aLy/WkiJJRNLzhnOF/aezg6KiGKnzA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x12-20020a1709064bcc00b00a36715df0f8si4326663ejv.112.2024.02.05.08.17.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 08:17:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dHvPP3sb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3132-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3132-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5FD9C1F222B5 for ; Mon, 5 Feb 2024 16:17:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0A4B3CF7B; Mon, 5 Feb 2024 16:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dHvPP3sb" 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 8B34E3CF4B for ; Mon, 5 Feb 2024 16:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707149837; cv=none; b=jl2QUqIe+myPvoVu06kRxMJsPEFBo6E2PWp3lCiQ1t8JuGdlqYQyVDxiAs18ecUrBMrtQQOgQdWhBs2bj793tf0qFxADHWVwYSojLCPdpMXfTla2Waf9bZXbDYKn9EMEAsch630NHU5QuyOprPqEEelJvCNn8NIj7Jt7eQFPSjw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707149837; c=relaxed/simple; bh=zlF1znOg4DaD2qj2azQ5lGme9OlhIk2O3oHaH5uFPpI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=tTFEtb2Pe99G+tBQpdFupugOyOMzPahKaiZb5Uep/uo5rJOualxeAZxxYy3uTmI9eD8m9fDIq+X3ysNFUduHsHPE6ymFfTFznxb6HR6ZT4uCdxBJoaprNr8KGmjeWJSo2z305OlPvG9lsl5LA1I0JFhBvOuAf9VGra5FkveRCHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dHvPP3sb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D6FFC433F1; Mon, 5 Feb 2024 16:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707149837; bh=zlF1znOg4DaD2qj2azQ5lGme9OlhIk2O3oHaH5uFPpI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dHvPP3sbpckVuCgj6s1HL+X/rO6HxRqZyaoeMm31VvqdHMKEoyPQUedKgs0p5jVAS TmUGg8VYACmXEnDShszkXATDMxuoM+zaGwyvDehH/kmC0gAxKIHeUFNn8agy2A4PrV a3OVOR4KlhUvpN6gL/NOQkonwC1Cyvefky6xM1Ry39Tc1eRYMznweSMWv2U3KvbdrL PZCLMNM14ovw8sGLMZ6ZQJr12l6TfG2rgqvnLCFRIejekguGd+rFejtiiBZvm1cRkm bfA5SIwjtp9xb2JTie5j7aYC/QFu5D9UFNGZ6LyiJqF6zh/w23KmH+HACO+S3McFT3 1ZIXdcnT2SkWw== From: Kalle Valo To: Kang Yang Cc: , Subject: Re: [PATCH v6 04/11] wifi: ath12k: add P2P IE in beacon template References: <20240130040303.370590-1-quic_kangyang@quicinc.com> <20240130040303.370590-5-quic_kangyang@quicinc.com> Date: Mon, 05 Feb 2024 18:17:14 +0200 In-Reply-To: <20240130040303.370590-5-quic_kangyang@quicinc.com> (Kang Yang's message of "Tue, 30 Jan 2024 12:02:56 +0800") Message-ID: <87bk8usx6d.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 Kang Yang writes: > P2P Element is a necessary component of P2P protocol communication. > It contains the Vendor Specific Information Element which includes > the WFA OUI and an OUI Type indicating P2P. > > Add P2P IE in beacon template, and implement WMI interface for it. > > 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 [...] > +static int ath12k_mac_remove_vendor_ie(struct sk_buff *skb, unsigned int oui, > + u8 oui_type, size_t ie_offset) > +{ > + size_t len; > + const u8 *next; > + const u8 *end; > + u8 *ie; Reverse xmas tree and you can merge next and end: const u8 *next, *end; size_t len; u8 *ie; I changed that in the pending branch. > + if (WARN_ON(skb->len < ie_offset)) > + return -EINVAL; > + > + ie = (u8 *)cfg80211_find_vendor_ie(oui, oui_type, > + skb->data + ie_offset, > + skb->len - ie_offset); So cfg80211_find_vendor_ie() returns: static inline const u8 * cfg80211_find_vendor_ie(unsigned int oui, int oui_type, const u8 *ies, unsigned int len) You are casting away the const here. I see that other drivers do the same as the assumption is that the pointer points to the same buffer, but I still don't really like casting away const. Thoughts? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches