Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5900742ybv; Tue, 18 Feb 2020 06:10:41 -0800 (PST) X-Google-Smtp-Source: APXvYqxWqKmAKTuewIgZ5BHz63cPsG/4uwJ1frqGK3dAuiZolUs3ncNCUwhyAJDGDSaAZSuqfNEH X-Received: by 2002:a9d:5e82:: with SMTP id f2mr15254953otl.240.1582035041455; Tue, 18 Feb 2020 06:10:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582035041; cv=none; d=google.com; s=arc-20160816; b=Nmf08aqQ+JTp+G7VwgtAavSA2YmT9emGKbtDezBrNgqT1OHZ7AgFjZ4ioNj7LoGPJa zfp805OTeyIXddjiUSEcblxgTDwqESOm9uMj5hXohoRH9rjo+Uk2D+DxpN7ifFcIrN3r 0qRi5BtBYSi5pPabKQ20GYqBgy2fnKqnICuXQxXSUWul28vA5ATPAZGiBUoE92YkmH2+ PflnkODk5jiKP+hCd/cesdKOb5BTfuYIUjiSUVRiSGDHWHeVkI+COlR+Dh+mtUOTs6UO Wlagd+Z7+8xhn5ES0uBWH2UvwPzI1h5FeC6eZjfz9t3Dv0q02HIi0pTDKrPAjnofx/E+ quZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=N6tmhD4XbGdPx27z4XXiMNPpbu+jMVv0IOELS12RKKo=; b=Jc/+7XVU7SyQ8Jc7R5O2tRliP9qqkXuV9+A4WMwKcBMbmRU5Ps8i90iD9Ubxt2S1bO jxM8jCk4GtUm2xSTtxVG6clmupbOkIVg1XSFhu3vrymQs3XDdrHM0L0sXlneka0j8bMF +JmJq3y3lVeql8FtFnvfQgqVfLJIkR5nwcTJIMs0EW9n37lxEs/8Tbi8a7IqGgMcLAzV pa33sXlaXMTEj9H02JIHvPaV5Ce6E4ECeL6PFXbulCxbLW33JA9eoVV1HVXxQxL0Y/JJ 85hyvZBGZncrQHSdbAGH6hj2KNP5JpViJ48bh3T/Y33sudnbOWXKlLiPI+EoTSOyG/3T FysA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l83si7874499oih.58.2020.02.18.06.10.28; Tue, 18 Feb 2020 06:10:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726360AbgBROKX (ORCPT + 99 others); Tue, 18 Feb 2020 09:10:23 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:33234 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726338AbgBROKX (ORCPT ); Tue, 18 Feb 2020 09:10:23 -0500 Received: from marcel-macpro.fritz.box (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id F09B0CED28; Tue, 18 Feb 2020 15:19:46 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [PATCH] Bluetooth: Fix - During le_conn_timeout disable EXT_ADV From: Marcel Holtmann In-Reply-To: <20200218123747.3006-1-sathish.narasimman@intel.com> Date: Tue, 18 Feb 2020 15:10:22 +0100 Cc: linux-bluetooth@vger.kernel.org, Sathish Narsimman Content-Transfer-Encoding: 7bit Message-Id: <072E9094-BA5F-47CB-9740-B04A6DC5384D@holtmann.org> References: <20200218123747.3006-1-sathish.narasimman@intel.com> To: Sathish Narsimman X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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