From: Johan Hedberg <johan.hedberg@gmail.com>
To: Dmitriy Paliy <dmitriy.paliy@gmail.com>
Cc: Dmitriy Paliy <dmitriy.paliy@nokia.com>, linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Fix unpair device when disconnected for No Bonding
Date: Mon, 20 Jun 2011 13:03:39 +0300 [thread overview]
Message-ID: <20110620100339.GA9457@dell.ger.corp.intel.com> (raw)
In-Reply-To: <BANLkTikE5bLgRWViQd2ynUNHS8HSRbL51A@mail.gmail.com>
Hi Dmitriy,
On Mon, Jun 20, 2011, Dmitriy Paliy wrote:
> On Mon, Jun 20, 2011 at 12:31 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> > Coding-style wise your read_link_key call should be checking for < 0 or
> > specifically for -ENOENT (you're calling the function as if it returned
> > a boolean value). However, I'm thinking we might just store the
> > no-bonding info in the device struct itself so you don't need to consult
> > the storage in this case. I.e. in addition to device_is_paired there'd
> > also be a device_is_bonded function which'd make the logic like:
> >
> > if (device_is_paired(device) && !device_is_bonded(device))
> > device_set_paired(device, FALSE);
> >
> > Thoughts? Have you checked that this works both with hciops and mgmtops?
>
> New ..is_bonded sounds a bit redundant since it is quite
> straightforward to check it from storage, but also ok.
It's still a file-system access for something that we could easily have
available as a flag in runtime memory. Even if you did do the
file-system read it'd make the code more readable if you had this
wrapped into a device_is_bonded function.
> I didnt touch mgmtops at all. Could you provide more inputs about what
> exactly the issue is?
I didn't say that there is an issue. I just asked if you've checked that
this works with mgmtops since the signaling between the kernel,
adapter_ops and the core bluetooth daemon is quite different wrt pairing
in that case.
Johan
prev parent reply other threads:[~2011-06-20 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-20 9:23 [PATCH] Fix unpair device when disconnected for No Bonding Dmitriy Paliy
2011-06-20 9:31 ` Johan Hedberg
2011-06-20 9:55 ` Dmitriy Paliy
2011-06-20 10:03 ` Johan Hedberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110620100339.GA9457@dell.ger.corp.intel.com \
--to=johan.hedberg@gmail.com \
--cc=dmitriy.paliy@gmail.com \
--cc=dmitriy.paliy@nokia.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).