Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1160514pxb; Thu, 4 Mar 2021 05:04:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYfyxpWR76bTiLsYdEMAdy8Hi2NoCjHa4eoc2EIjrYwUWfGZ8Ryf4Ycj+qYDIQTU6LTIlv X-Received: by 2002:a17:906:a099:: with SMTP id q25mr4041602ejy.549.1614863082760; Thu, 04 Mar 2021 05:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614863082; cv=none; d=google.com; s=arc-20160816; b=m44KwO01JGBQk/3vTHLOiJ3w80ufdiRS2IO1LDWoGejuw3QNffqYg9jdU9W45yhPM4 DGXbntP8xp/z+GQVox8PdFb1xyiQrOWNoSqjU2To6U+h7P/2r2fDdWT044DgVGnhvlsb zo5T/zsuTX+pO8Brv4yX6BY9pDQs4kylYZ9mTaJdEvsiE/X4zED+gMQ+uHTivYafmnXi cofMTLnYY1mgedT90OgTwkkaKPI/qk0Mrpae/lhxDCr5xA0QC82utYH0GZK7QzjuNBEd vIeg4ZctC6jaFVVEix+2RuFod975e16Ez7dPLLJNqC76c6+3I7tGrnul44Rxvnymb3zf tpwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=WmBHqMPHJObFRHlBdLd4gvd+I6hOcuIDZK3TBL5lq08=; b=knylXGQ4PLo4W195wRIVu9pp96I8BQC1nO9I5XwoWRcRv6Yc6zA2qB0hWeqBq66uAz xVgFkD20VkfXHrG6vLOMC+sVXI5fTkUDi/WfX1Tt//5wVcFVKm/oJMlPWQo6NCevvAZV vcyMyBUaxr9rkKZGbcIzvi3L0uqlgPrjAENMLW8IbAdfL5HJyM72AHykg4FkOLHCNUL4 3N0QZ7Z9o09n1marZ5akYxEUvzQPWxxBLRAkze8gGuZh5iGNWcuLzwwL3zVpgSrrNpbO Y+JNFu0tZ+9Id3nKljCYAMe7KMxCkXpuTqeYdjxOMhPwi6C5Vvx76UXWFN2U/09Krurg A99A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fn3si3770662ejc.182.2021.03.04.05.04.15; Thu, 04 Mar 2021 05:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353992AbhCDAG1 (ORCPT + 99 others); Wed, 3 Mar 2021 19:06:27 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:40213 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388526AbhCCVKt (ORCPT ); Wed, 3 Mar 2021 16:10:49 -0500 Received: from marcel-macbook.holtmann.net (p4ff9fb90.dip0.t-ipconnect.de [79.249.251.144]) by mail.holtmann.org (Postfix) with ESMTPSA id 58E05CED0A; Wed, 3 Mar 2021 22:17:37 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: [PATCH] Bluetooth: Allow scannable adv with extended MGMT APIs From: Marcel Holtmann In-Reply-To: <20210303111505.1.I3108b046a478cb4f1b85aeb84edb0f127cff81a8@changeid> Date: Wed, 3 Mar 2021 22:10:02 +0100 Cc: Bluetooth Kernel Mailing List , CrosBT Upstreaming , Alain Michaud , Sonny Sasaka , Miao-chen Chou , "David S. Miller" , Jakub Kicinski , Johan Hedberg , Luiz Augusto von Dentz , LKML , netdev@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: References: <20210303111505.1.I3108b046a478cb4f1b85aeb84edb0f127cff81a8@changeid> To: Daniel Winkler X-Mailer: Apple Mail (2.3654.60.0.2.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, > An issue was found, where if a bluetooth client requests a broadcast > advertisement with scan response data, it will not be properly > registered with the controller. This is because at the time that the > hci_cp_le_set_scan_param structure is created, the scan response will > not yet have been received since it comes in a second MGMT call. With > empty scan response, the request defaults to a non-scannable PDU type. > On some controllers, the subsequent scan response request will fail due > to incorrect PDU type, and others will succeed and not use the scan > response. > > This fix allows the advertising parameters MGMT call to include a flag > to let the kernel know whether a scan response will be coming, so that > the correct PDU type is used in the first place. A bluetoothd change is > also incoming to take advantage of it. > > To test this, I created a broadcast advertisement with scan response > data and registered it on the hatch chromebook. Without this change, the > request fails, and with it will succeed. > > Reviewed-by: Alain Michaud > Reviewed-by: Sonny Sasaka > Reviewed-by: Miao-chen Chou > Signed-off-by: Daniel Winkler > --- > > include/net/bluetooth/mgmt.h | 1 + > net/bluetooth/hci_request.c | 3 ++- > net/bluetooth/mgmt.c | 1 + > 3 files changed, 4 insertions(+), 1 deletion(-) patch has been applied to bluetooth-next tree. Regards Marcel