提交 faa81030 编写于 作者: L Lukasz Rymanowski 提交者: Marcel Holtmann

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: NLukasz Rymanowski <lukasz.rymanowski@tieto.com>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 c411110e
...@@ -3249,6 +3249,10 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, ...@@ -3249,6 +3249,10 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
if (PTR_ERR(conn) == -EBUSY) if (PTR_ERR(conn) == -EBUSY)
status = MGMT_STATUS_BUSY; 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 else
status = MGMT_STATUS_CONNECT_FAILED; status = MGMT_STATUS_CONNECT_FAILED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册