Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp568060ybg; Tue, 28 Jul 2020 13:02:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybduFh2COGEzI5+zIkrT9S9Ac8iso0wnFdrmIkftiOfxHkPW39rzZD/oEx074OUGd5EbOf X-Received: by 2002:a50:c044:: with SMTP id u4mr28877129edd.366.1595966535079; Tue, 28 Jul 2020 13:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595966535; cv=none; d=google.com; s=arc-20160816; b=peU84vQRT1kFFHn/+rEW4wLh3sLKW5B6qY4Wt2kdpdg/Ra0lZzNyr51dC+siRcT9kB vA0xftTz+MljBAiSXcTqgQyWab+3RttoapB7H4FukSu5DfcSgCxj0YTCtSvHyl6S7fE4 bG45T8roCZQ/iouz+z+eApp0v40iIpYdC+ageoa4mAoNRWWb7Gkl1xkQcwkii7gpDWMe 4Y/Atg3NHNL/5ReJj5Yp12jkS4wQOj5LH0r5EYeO0reQwGtkXbdHLu0j+AeiaDYFv3Sm DGRRRGpe+MOl6tI2B4hJje3taD/Z3AEtxpMUyGcHp3pkZVV3abXLiNxcIsLiUCPZWm28 tVPw== 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=dv3Q/pRdkfZQAIG5khmRSqIaEoGwwBiiMrsb7/J0js4=; b=P/ffMeHxeyuJlaML99rONSUWuQiV0x2HT14cZJLJ6R2lzG9Ke+8MiPzUeEyPZiMU5m m4AqIzGh2TczRT0SzmnP4EqgMwTldMBIjUhGwBnPckvXz1tR5Jh6ksb4ahGLNUYKYE7L E/TmFu34ywU8FuiHl89nNM92th38qGdTrIeUodVDQudDPmZ6B5p9hnctxo/358RuIPsY Lw+ybip9HFp96GgAPB8dSbiteeU3VrcH4bbf6jBRdPGB6hs2WA1DeJ5u4xYOS8GVa4jy 8Mg4P2Hdo6ZccQYLL+4Qv7adPJ9npBQEp6jWIUq6SAyVdd391xLk8EVI50mIdOu4z/IA 7Dcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XeIATN/i"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id m19si6401513edq.355.2020.07.28.13.01.30; Tue, 28 Jul 2020 13:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XeIATN/i"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 S1732123AbgG1SDr (ORCPT + 99 others); Tue, 28 Jul 2020 14:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728598AbgG1SDq (ORCPT ); Tue, 28 Jul 2020 14:03:46 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E628C061794 for ; Tue, 28 Jul 2020 11:03:46 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id v13so1651587oiv.13 for ; Tue, 28 Jul 2020 11:03:46 -0700 (PDT) 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=dv3Q/pRdkfZQAIG5khmRSqIaEoGwwBiiMrsb7/J0js4=; b=XeIATN/iLIc/qj7tkzIxlpfFkjtij9WDXMlB2dtCqqe38hVV8r0kjNVCVgatec6OUG I3STQ94HnuFK8AF5a+Th9pTZ7mi1ndUolhON+3LpzYPC3uUwxDg6M6bgOoMa/ZSI3Ghs bKjTH6aIqqtF/OkhQp/3wwmFV2HLhlMTphOp2CUuntHunUN21yjOFTrHPF5cL4gMImsR pEhl9NkoD8wPxHGoB1Vjd3HlCqMvVe3JcR7BPKALmrMyJvnSMvuJZl9xJqBvvKkzxaHa //1nSxHwCfUvce649mRm1vnd5Cepksp9C4sqrrLf3kAhdvSsNuyFh6qHrZyXMLyKjnwN GHVw== 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=dv3Q/pRdkfZQAIG5khmRSqIaEoGwwBiiMrsb7/J0js4=; b=cOnn5NxCArF09H9JmVpFVX8IPQM4qFqErYqQffnaKbQR5Ns2uwHNBFWI/TBPsvJ0Eu HaqfzV1cFVMHEanzgsYs7nsd5kEBs89wYqLAJyOFOqp081n1Lt5nz43q4OhHzlu7YkTm nzyBCGg2xpANOgwZCK8u0OHM7sezfONEKGGLCB1Ym2wTFzK70T8c1W0nfkI93ZFdFmnX rfQsUxW47epL8FKdreVI1b1kWubiM16TQVog59M3UL/wUQyr7imP+3FLPab1eF1A+Uku RwSDVj15uEq6RH1uRce6B5IIczPEsMZ0pIuopGwGJ47jqPrIUBTSKXjrkzM9kT7DvNWL XKOA== X-Gm-Message-State: AOAM5333IhzbuHkDQ+sG6ApMF4dv/hmsggYuK3n/vxIoqFosWCnQLLyh e3IZcDagCIoSlbC4rVfUKCWqI3SIdr38nIvoNiA= X-Received: by 2002:aca:2819:: with SMTP id 25mr4304488oix.48.1595959425884; Tue, 28 Jul 2020 11:03:45 -0700 (PDT) MIME-Version: 1.0 References: <20200717020332.Bluez.v3.1.I1322f6745fa50365c1c88de3e2c50c9c5962c094@changeid> In-Reply-To: From: Luiz Augusto von Dentz Date: Tue, 28 Jul 2020 11:03:36 -0700 Message-ID: Subject: Re: [Bluez PATCH v3 1/2] device: add device_remove_bonding function To: Alain Michaud Cc: Archie Pusaka , linux-bluetooth , Archie Pusaka , Alain Michaud 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, On Tue, Jul 28, 2020 at 6:19 AM Alain Michaud wrote: > > Friendly ping to maintainers on this one. > > Thanks, > Alain > > On Thu, Jul 16, 2020 at 2:04 PM Archie Pusaka wrote: > > > > From: Archie Pusaka > > > > This patch splits the "bonding removal" function in device.c, > > because we need to remove bonding information when receiving > > "virtual cable unplug" in HID profile. > > > > Reviewed-by: Alain Michaud > > --- > > > > Changes in v3: > > - Call device_set_temporary on device_remove_bonding > > > > Changes in v2: None > > > > src/device.c | 28 ++++++++++++++++++---------- > > src/device.h | 1 + > > 2 files changed, 19 insertions(+), 10 deletions(-) > > > > diff --git a/src/device.c b/src/device.c > > index 226216235..b23ecb7fd 100644 > > --- a/src/device.c > > +++ b/src/device.c > > @@ -4356,6 +4356,20 @@ static void delete_folder_tree(const char *dirname) > > rmdir(dirname); > > } > > > > +void device_remove_bonding(struct btd_device *device, uint8_t bdaddr_type) > > +{ > > + if (bdaddr_type == BDADDR_BREDR) > > + device->bredr_state.bonded = false; > > + else > > + device->le_state.bonded = false; > > + > > + if (!device->bredr_state.bonded && !device->le_state.bonded) > > + btd_device_set_temporary(device, true); > > + > > + btd_adapter_remove_bonding(device->adapter, &device->bdaddr, > > + bdaddr_type); > > +} > > + > > static void device_remove_stored(struct btd_device *device) > > { > > char device_addr[18]; > > @@ -4364,17 +4378,11 @@ static void device_remove_stored(struct btd_device *device) > > char *data; > > gsize length = 0; > > > > - if (device->bredr_state.bonded) { > > - device->bredr_state.bonded = false; > > - btd_adapter_remove_bonding(device->adapter, &device->bdaddr, > > - BDADDR_BREDR); > > - } > > + if (device->bredr_state.bonded) > > + device_remove_bonding(device, BDADDR_BREDR); > > > > - if (device->le_state.bonded) { > > - device->le_state.bonded = false; > > - btd_adapter_remove_bonding(device->adapter, &device->bdaddr, > > - device->bdaddr_type); > > - } > > + if (device->le_state.bonded) > > + device_remove_bonding(device, device->bdaddr_type); > > > > device->bredr_state.paired = false; > > device->le_state.paired = false; > > diff --git a/src/device.h b/src/device.h > > index cb8d884e8..956fec1ae 100644 > > --- a/src/device.h > > +++ b/src/device.h > > @@ -50,6 +50,7 @@ uint16_t btd_device_get_vendor(struct btd_device *device); > > uint16_t btd_device_get_vendor_src(struct btd_device *device); > > uint16_t btd_device_get_product(struct btd_device *device); > > uint16_t btd_device_get_version(struct btd_device *device); > > +void device_remove_bonding(struct btd_device *device, uint8_t bdaddr_type); > > void device_remove(struct btd_device *device, gboolean remove_stored); > > int device_address_cmp(gconstpointer a, gconstpointer b); > > int device_bdaddr_cmp(gconstpointer a, gconstpointer b); > > -- > > 2.27.0.389.gc38d7665816-goog > > Applied, thanks. -- Luiz Augusto von Dentz