Re: [PATCH] Bluetooth: Define HCI reasons instead of magic number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrei,

* Emeltchenko Andrei <Andrei.Emeltchenko.news@xxxxxxxxx> [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@xxxxxxxxx>
> > > ---
> > >  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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux