Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5818743ybv; Tue, 18 Feb 2020 04:37:44 -0800 (PST) X-Google-Smtp-Source: APXvYqw4TwQJxFBhyQdFaUcPH/itdYvnhvAliCv1iRHYAj5Mmj3jGLoXmuekUV5ZwVx2L4WASadT X-Received: by 2002:a9d:395:: with SMTP id f21mr15764490otf.67.1582029463903; Tue, 18 Feb 2020 04:37:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582029463; cv=none; d=google.com; s=arc-20160816; b=QMc0H5IAUQTbreGg5Gy2FauKLr/DHpK+IA0KzRMjIXdW+YbLTdD5AbsQjF1wKNPsDu rba7JNEd9PZ13V+CfbsH0a3jdFdtSe8AqzAUVNbCK8yX/EwnlovMlTbgd0nGi9zmqy7h D8dl5ZGnnScae10VtZ3P29dAFaWk+GZLUSjPgY8zVXOwnLu1bAAW6adME2EvY1vBmAWL uMCwAXXw0iejUyFCq3wniJRxSeCzeicdm4n9XG6PkkugpLM5tVpNRFljmXR07DMdqk7H PE7Pz3L+yLLyQxnuBjHtlI4DoXiODAWrygTgPQYAd+e1XAj3mXsfKZe5+50PDY4Vr+kL bOyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=hZ3DX26wZMAKcheoiq0ujRr9oBErAtuhMtcmr305aMo=; b=gQ/l12Ke/wBzZHHGslvhsKQQeKuLERPN+gJbmGHdhzr9PR+BAGJY0+PLVWPg5pZbeN +stMGaLZr0NJ0of5y6xxoihIN+1yW9vSNjx053RU3w8prxoZwaex6WaC9nad1fMIdJJM M0GBr5vBZUFSUCtrQIa/6aI04viB1+k3vBXr/JgwweJVKLTzC/0WFkHbj/v7WUYh8Koa yhfRyj4NW5p/KA5JZVCYlr1zIYTTBQzKQjRuoLNuotgPy89vFz91oaP7BWqX7lOxK8HP QoY92tT3HkFXFDA/UNpzUveZJbxj7jbhd4h+NimQr2qUCoLRmQVdbETbmW4WGA4u4bLm qtUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NIm8cyt1; 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 t20si1648015otr.64.2020.02.18.04.37.19; Tue, 18 Feb 2020 04:37:43 -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=NIm8cyt1; 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 S1726582AbgBRMgh (ORCPT + 99 others); Tue, 18 Feb 2020 07:36:37 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33036 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbgBRMgg (ORCPT ); Tue, 18 Feb 2020 07:36:36 -0500 Received: by mail-pg1-f195.google.com with SMTP id 6so10906224pgk.0 for ; Tue, 18 Feb 2020 04:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hZ3DX26wZMAKcheoiq0ujRr9oBErAtuhMtcmr305aMo=; b=NIm8cyt1o3h3vkiilwTJtwEu3YZKXyy5T7wT2StMknwCgDOvVct+QRApcY5siSYV0b 2JOd1neoPYsRDFa84pn0Ne7MZ5dP3NZRurWO4L/L8Ppt9iaX88i5S5LiFo2BgtAI64HP yYvQ4cbqZaK9HqU+9ectm6YChV7bqA5cPuXyI0ZqCk7WKqh3CUnOyGGyiCfJ3moRNVkc qP4NbvfSl3pj5PWGUM4qz7vcS0E+fuIf+dx4+aPOYJDrJw7ZazEaCgRyFOfZLVFMFoog F0at0gJsE1ychcwuaOGPHJO8+tyayNo43Ezo9w6NlDXSNT/PgiT+n0tO9eIBhAVidpUh +wEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hZ3DX26wZMAKcheoiq0ujRr9oBErAtuhMtcmr305aMo=; b=Vzts8/WefH4AeW70tdbX7mevBgGRjMcslbbdIrqPgZE+dibwuaLngUDG/y/f4Z9k6K eeJDarirc0Uhr/j/yQ8awfQfUCdoFf8VyrgsweHf+eqVhd4pFOUPLs/xzOjxcBwPNzSv GQvEdfOUuLBcarHrnYcP/LE3VnNtxIiL8x399Ht+pps7cKQC5MpU5Vju4jLDuNyeZdxc xVx/h0wR0AVhRWPzZywoz1yJCIMr9/7ij6HUVIZing2LkKRhr2z05iwtaLUJYOTXdTsy qIBCdWd7a+gk/FxR/GjC4uHDGps6hX/ubfPGATBRn1tj610U01h3uomZvta3TMlM1Ix+ mHfQ== X-Gm-Message-State: APjAAAV8OGNaBGyZC2yqarN6kY7iKo2LF05mmHE2pNmpnnadgjOVgiQk Bz+2dRxc05P9aI2kNF/+445fiAnii3Q= X-Received: by 2002:a62:f94d:: with SMTP id g13mr21112309pfm.60.1582029391792; Tue, 18 Feb 2020 04:36:31 -0800 (PST) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.54.42]) by smtp.gmail.com with ESMTPSA id p24sm4613859pgk.19.2020.02.18.04.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 04:36:31 -0800 (PST) From: Sathish Narsimman X-Google-Original-From: Sathish Narsimman To: linux-bluetooth@vger.kernel.org, nsathish41@gmail.com Cc: Sathish Narsimman Subject: [PATCH] Bluetooth: Fix - During le_conn_timeout disable EXT_ADV Date: Tue, 18 Feb 2020 18:07:47 +0530 Message-Id: <20200218123747.3006-1-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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); + } hci_le_conn_failed(conn, HCI_ERROR_ADVERTISING_TIMEOUT); return; } -- 2.17.1