linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Andre Guedes <andre.guedes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2] Bluetooth: Create a unique mgmt error code hierarchy
Date: Fri, 11 Nov 2011 19:40:31 +0200	[thread overview]
Message-ID: <20111111174031.GA1176@fusion.localdomain> (raw)
In-Reply-To: <E91B9660-3CDC-4632-8718-4C3103362219@openbossa.org>

Hi Andre,

On Fri, Nov 11, 2011, Andre Guedes wrote:
> > The management protocol uses a single byte for error codes (aka command
> > status). In some places this value is directly copied from HCI and in
> > other a POSIX error number is used. This makes it impossible for
> > user-space to uniquily decipher the meaning of an error.
> > 
> > To solve this issue a new mgmt-specific set of error codes is added
> > along with a conversion table for HCI status values.
> 
> Using _only_ POSIX error codes in management protocol doesn't solve
> this problems? We could use the bt_to_errno() function to translate
> HCI errors into POSIX errors.

I think it's a bit too risky to restrict ourself to POSIX for all
possible Bluetooth errors we may need to communicate to user-space.
Considering that we still haven't added HS and LE based procedures to
the protocol at least I'm not willing to bet that POSIX is enough, or at
least that we'd get an intuitive mapping for it. Using our own codes
gives us flexibility in the long run and it also allows for more clear
and intuitive error names which you don't need to go digging in the
kernel source to figure out exactly what HCI error they map to.

Johan

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 14:18 [PATCH 1/3] Bluetooth: Return success instead of EALREADY for mgmt commands johan.hedberg
2011-11-11 14:18 ` [PATCH 2/3] Bluetooth: Create a unique mgmt error code hierarchy johan.hedberg
2011-11-11 14:37   ` Anderson Lizardo
2011-11-11 15:59     ` Johan Hedberg
2011-11-11 16:10   ` [PATCH v2] " johan.hedberg
2011-11-11 16:49     ` Andre Guedes
2011-11-11 17:40       ` Johan Hedberg [this message]
2011-11-16 18:11     ` Gustavo Padovan
2011-11-16 21:05       ` Johan Hedberg
2011-11-16 22:51         ` Gustavo Padovan
2011-11-11 14:18 ` [PATCH 3/3] Bluetooth: Add missing cmd_complete for mgmt_load_link_keys johan.hedberg
2011-11-16 18:23   ` Gustavo Padovan

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=20111111174031.GA1176@fusion.localdomain \
    --to=johan.hedberg@gmail.com \
    --cc=andre.guedes@openbossa.org \
    --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).