Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp609503ybv; Wed, 19 Feb 2020 05:53:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwTnDU4nobZiNaFjdyW08SExiLmpM8xQ2PbuWTJJ/B+xxp1ulyitecJi3zt+FuNbQ2ZVzuk X-Received: by 2002:a9d:7ad9:: with SMTP id m25mr18753218otn.13.1582120426246; Wed, 19 Feb 2020 05:53:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582120426; cv=none; d=google.com; s=arc-20160816; b=DnRStfXMQ7yawO8BFMSExgofpiuTbKXnF8xtZGypXJcJJW7nQx5JgPHbLiL4GZ56mv GHOUvDOOQlUaQyC6mh5yzDTYt2FdR2HNvohqhP+By1mXdMDsbKHiGr+tXvIInu3ywhSF 180ptkXnye19y04xUWaTx28cJWqwJRpBZ6sDXnwE0O1sGdaXImN5Ok4mbBfrD+aTtRjF euaLNbRMjvdxalUJK2Ya8W0Gc+ykwu8aVuI6N61GgfX+5EMPYDUXE8tZ9gIS67J5b3O7 QkYWtQT2PkaPYnkXBwmcoSOkYJf0wlishH8RxFJdAyTeorzHHjLe3InpgY/OqDsq3SPh o/cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dWBM6hMtN3OxyWIje0A1AXoVlXn1ORCStBKjXv2qJr0=; b=ksD87fwhPqDzFVP5dbubdtljrRyQYtctlvdQXWkhDJGgsaqEIdh7yUOZdhd0BbhpJo g78+TSyJVmaa+S20Qi/Y/ewLeJ6sYfyip7HmfIclOczqHWUi436rZY2lin+5BUSqOxXZ LfJfNmvmgmdIzC0FG4rbMMEAB/zvfOE0f+utZNp84L0Dlei5LfhrfDXpJDE3Qhe22K0T EYXC6plChrhC7+ubkwPtQIv0KFaj6ItuF1hU1W9PdT7gqSLJ86Qwbf0CDAkVOnJSiaXo KrNo2V3Bi3ypsl7d4iwaVmjkURE6EKnNDkhlqrX/Z5XxwDR+amN3LAPrMvfz3SM2RpQN mu4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vKNN3YDe; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si1164240oti.311.2020.02.19.05.53.27; Wed, 19 Feb 2020 05:53:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vKNN3YDe; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbgBSNxW (ORCPT + 99 others); Wed, 19 Feb 2020 08:53:22 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:46792 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbgBSNxW (ORCPT ); Wed, 19 Feb 2020 08:53:22 -0500 Received: by mail-io1-f65.google.com with SMTP id t26so577030ioi.13 for ; Wed, 19 Feb 2020 05:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dWBM6hMtN3OxyWIje0A1AXoVlXn1ORCStBKjXv2qJr0=; b=vKNN3YDeyrO1HBGWAczgtuOd6f1qZ/+fQ0rL/ROUm+4iyQ9M/1qjOlnnuTmaT0QdKv kV8bc+Z0gxJOOhtbg5BXnm+bAAZUrICeCANbfyUdFnc0l7yQiAgJUasPnsbdN4jtRFIX 6Jki8PAjd3vMg+H6zutAJ4TQ+GBk7GNjCIVMfMUzRg2xRnOLBW9Vq8HDWSWD5x20ANxN O/4nesCScpkni/ZCpHmGBzz+X2l9oeav162+0luAdgnE0B0ytfXDA131hFMKp8gRAOpU ejXyy92Snrcu5YyP58c2nIz7ADqZK4+PG7oFFyo+nPRmIgcLYxHZHqQZd0Kdznz+khwo U6rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dWBM6hMtN3OxyWIje0A1AXoVlXn1ORCStBKjXv2qJr0=; b=hZi3tbVSeOicoh5Rtc06t+ZEs86m+CdADnpOMozZCCEUqaGuGehOLwyUW3LafKGBLn Sfe6f0Atnx1puqlSRqfUpkRihEbtJpCd7B8lSY2r0Pg92iI2C+9RpkF6tXiLnmqHJoVR PKBvP4fg+G2rTNGc13C6dPPTYCRQwrLzeicU5ypLTEZWVWgM9RX9J5r0577T8vyurXGZ 1520YM/ShGrOvZxv5vDfUylqKpEJJM4GA7vREqb+Ys/HJzd53ZYWJPeOiNuqgrwiNURY SB3QsDSo7oaJBM7Cl5HYESmPPnf1dS+Y8lBy2DPfzwyWzlPtc5F/AYhKdbmjjDfixmmm cihg== X-Gm-Message-State: APjAAAURSRa4jlCPVZo90y+/xJAI5IMZc6zLLAzv3cMdTa1qkUTV6ykv uKCJ0q7VefmoyZX7g4Db37M4k0n1QqofNeIv2Sk= X-Received: by 2002:a6b:ec08:: with SMTP id c8mr19928418ioh.257.1582120401701; Wed, 19 Feb 2020 05:53:21 -0800 (PST) MIME-Version: 1.0 References: <20200218123747.3006-1-sathish.narasimman@intel.com> <072E9094-BA5F-47CB-9740-B04A6DC5384D@holtmann.org> In-Reply-To: From: Sathish Narasimman Date: Wed, 19 Feb 2020 19:23:10 +0530 Message-ID: Subject: Re: [PATCH] Bluetooth: Fix - During le_conn_timeout disable EXT_ADV To: Marcel Holtmann Cc: Bluez mailing list , Sathish Narsimman Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marcel On Tue, Feb 18, 2020 at 8:17 PM Sathish Narasimman wrote: > > Hi Marcel > > On Tue, Feb 18, 2020 at 7:40 PM Marcel Holtmann wrote: > > > > Hi Sathish, > > > > > Disabling LE_LEGACY_ADV when LE_EXT_ADV is enabled causes 'command > > > disallowed . This patch fixes that issue and disables EXT_ADV if > > > enabled. > > > > > > Signed-off-by: Sathish Narsimman > > > --- > > > net/bluetooth/hci_conn.c | 16 +++++++++++++--- > > > 1 file changed, 13 insertions(+), 3 deletions(-) > > > > > > diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c > > > index a582c676e584..a8d8a876363c 100644 > > > --- a/net/bluetooth/hci_conn.c > > > +++ b/net/bluetooth/hci_conn.c > > > @@ -481,9 +481,19 @@ static void le_conn_timeout(struct work_struct *work) > > > * (which doesn't have a timeout of its own). > > > */ > > > if (conn->role == HCI_ROLE_SLAVE) { > > > - u8 enable = 0x00; > > > - hci_send_cmd(hdev, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), > > > - &enable); > > > + if (ext_adv_capable(hdev)) { > > > + struct hci_cp_le_set_ext_adv_enable cp; > > > + > > > + cp.enable = 0x00; > > > + cp.num_of_sets = 0x00; > > > + > > > + hci_send_cmd(hdev, HCI_OP_LE_SET_EXT_ADV_ENABLE, > > > + sizeof(cp), &cp); > > > + } else { > > > + u8 enable = 0x00; > > > + hci_send_cmd(hdev, HCI_OP_LE_SET_ADV_ENABLE, > > > + sizeof(enable), &enable); > > > + } > > > > hmmm, I wonder if it is better to create a helper function for this. > > > > Regards > > > > Marcel > > > > let me verify and submit patch with __hci_req_disable_advertising > > Regards > Sathish N calling __hci_req_disable_advertising is not working. the command is not getting executed I hope the below method is fine? where it works +static void le_disable_advertising(struct hci_dev *hdev) +{ + if (ext_adv_capable(hdev)) { + struct hci_cp_le_set_ext_adv_enable cp; + cp.enable = 0x00; + cp.num_of_sets = 0x00; + + hci_send_cmd(hdev, HCI_OP_LE_SET_EXT_ADV_ENABLE, sizeof(cp), + &cp); + } else { + u8 enable = 0x00; + hci_send_cmd(hdev, HCI_OP_LE_SET_ADV_ENABLE, + sizeof(enable), &enable); + } + +} Regards Sathish N