diff options
author | Lukasz Rymanowski <lukasz.rymanowski@tieto.com> | 2015-02-11 12:31:42 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-02-14 05:19:59 +0100 |
commit | faa810303d4141de335a8b29ec7fba8d653903fc (patch) | |
tree | 9c253d5b51d38e0c5c8de9bfc59e097f41a181ca /net/bluetooth | |
parent | c411110e1f13abd64886c8abdf6f31c10136969f (diff) | |
download | linux-faa810303d4141de335a8b29ec7fba8d653903fc.tar.gz linux-faa810303d4141de335a8b29ec7fba8d653903fc.tar.bz2 linux-faa810303d4141de335a8b29ec7fba8d653903fc.zip |
Bluetooth: Enhance error codes pair device command
If user space is trying to pair on not enabled transport
MGMT_STATUS_REJECT will be returned.
If user space is trying to pair on transport which controller does not
support, MGMT_STATUS_NOT_SUPPORTED will be returned.
Having separate error code for that scenario might be useful for
debugging at least.
Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 9ec5390c85eb..1b528dea9844 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -3249,6 +3249,10 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, if (PTR_ERR(conn) == -EBUSY) status = MGMT_STATUS_BUSY; + else if (PTR_ERR(conn) == -EOPNOTSUPP) + status = MGMT_STATUS_NOT_SUPPORTED; + else if (PTR_ERR(conn) == -ECONNREFUSED) + status = MGMT_STATUS_REJECTED; else status = MGMT_STATUS_CONNECT_FAILED; |