linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <padovan@profusion.mobi>
To: Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: Define HCI reasons instead of magic number
Date: Fri, 4 Nov 2011 15:29:06 -0200	[thread overview]
Message-ID: <20111104172906.GF6171@joana> (raw)
In-Reply-To: <20111104085928.GB1313@aemeltch-MOBL1>

Hi Andrei,

* Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com> [2011-11-04 10:59:30 +0200]:

> Hi Marcel,
> 
> On Wed, Nov 02, 2011 at 03:17:09PM +0100, Marcel Holtmann wrote:
> > Hi Andrei,
> > 
> > > Use HCI error reasons instead of magic numbers.
> > > 
> > > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > > ---
> > >  include/net/bluetooth/hci.h      |    8 ++++++++
> > >  include/net/bluetooth/hci_core.h |    2 +-
> > >  net/bluetooth/hci_conn.c         |    2 +-
> > >  net/bluetooth/hci_event.c        |    4 ++--
> > >  net/bluetooth/l2cap_core.c       |    8 ++++----
> > >  5 files changed, 16 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> > > index c5fcd13..b9b0ca9 100644
> > > --- a/include/net/bluetooth/hci.h
> > > +++ b/include/net/bluetooth/hci.h
> > > @@ -288,6 +288,10 @@ struct hci_cp_create_conn {
> > >  	__u8     role_switch;
> > >  } __packed;
> > >  
> > > +#define HCI_REASON_DISC_AUTH_FAILURE	0x05
> > > +#define HCI_REASON_DISC_REMOTE_USER	0x13
> > > +#define HCI_REASON_DISC_LOCAL_HOST	0x16
> > > +
> > 
> > actually these are HCI error/status codes that are well defined and go
> > beyond just disconnect reason. Using REASON_DISC seems to be wrong here.
> > Can you come up with better naming?
> 
> what about following:
> 
> +/* ---- HCI Error Codes ---- */
> +#define HCI_ERROR_AUTH_FAILURE         0x05
> +#define HCI_ERROR_REJ_BAD_ADDR         0x0f
> +#define HCI_ERROR_REMOTE_USER_TERM     0x13
> +#define HCI_ERROR_LOCAL_HOST_TERM      0x16
> +#define HCI_ERROR_PAIRING_NOT_ALLOWED  0x18
> +

These are fine to me.

	Gustavo

  reply	other threads:[~2011-11-04 17:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02  8:12 [PATCH] Bluetooth: Define HCI reasons instead of magic number Emeltchenko Andrei
2011-11-02 14:17 ` Marcel Holtmann
2011-11-04  8:59   ` Emeltchenko Andrei
2011-11-04 17:29     ` Gustavo Padovan [this message]
2011-11-04 21:07       ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2011-11-07 12:20 Emeltchenko Andrei
2011-11-07 19:30 ` Gustavo Padovan
2011-11-07 23:46 ` Marcel Holtmann

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=20111104172906.GF6171@joana \
    --to=padovan@profusion.mobi \
    --cc=Andrei.Emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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).