Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277739
b: refs/heads/master
c: 9f5a0d7
h: refs/heads/master
i:
  277737: bcd4a9d
  277735: 3a81316
v: v3
  • Loading branch information
Andrei Emeltchenko authored and Gustavo F. Padovan committed Nov 8, 2011
1 parent ad28ab0 commit e83ebef
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 36f7fc7e9ac72507ab7bf6caf77ad252c12ab37e
refs/heads/master: 9f5a0d7bf079e9e26771ad13ff1c2cb3adf80963
7 changes: 7 additions & 0 deletions trunk/include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ enum {
#define HCI_LK_SMP_IRK 0x82
#define HCI_LK_SMP_CSRK 0x83

/* ---- 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

/* ----- HCI Commands ---- */
#define HCI_OP_NOP 0x0000

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ static inline void hci_proto_connect_cfm(struct hci_conn *conn, __u8 status)
static inline int hci_proto_disconn_ind(struct hci_conn *conn)
{
register struct hci_proto *hp;
int reason = 0x13;
int reason = HCI_ERROR_REMOTE_USER_TERM;

hp = hci_proto[HCI_PROTO_L2CAP];
if (hp && hp->disconn_ind)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ void hci_conn_hash_flush(struct hci_dev *hdev)

c->state = BT_CLOSED;

hci_proto_disconn_cfm(c, 0x16);
hci_proto_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM);
hci_conn_del(c);
}
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
struct hci_cp_reject_conn_req cp;

bacpy(&cp.bdaddr, &ev->bdaddr);
cp.reason = 0x0f;
cp.reason = HCI_ERROR_REJ_BAD_ADDR;
hci_send_cmd(hdev, HCI_OP_REJECT_CONN_REQ, sizeof(cp), &cp);
}
}
Expand Down Expand Up @@ -2646,7 +2646,7 @@ static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff
struct hci_cp_io_capability_neg_reply cp;

bacpy(&cp.bdaddr, &ev->bdaddr);
cp.reason = 0x18; /* Pairing not allowed */
cp.reason = HCI_ERROR_PAIRING_NOT_ALLOWED;

hci_send_cmd(hdev, HCI_OP_IO_CAPABILITY_NEG_REPLY,
sizeof(cp), &cp);
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
BT_DBG("conn %p, psm 0x%2.2x, dcid 0x%4.4x", conn,
chan->psm, chan->dcid);

conn->disc_reason = 0x13;
conn->disc_reason = HCI_ERROR_REMOTE_USER_TERM;

chan->conn = conn;

Expand Down Expand Up @@ -1082,7 +1082,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
setup_timer(&conn->info_timer, l2cap_info_timeout,
(unsigned long) conn);

conn->disc_reason = 0x13;
conn->disc_reason = HCI_ERROR_REMOTE_USER_TERM;

return conn;
}
Expand Down Expand Up @@ -2535,7 +2535,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
/* Check if the ACL is secure enough (if not SDP) */
if (psm != cpu_to_le16(0x0001) &&
!hci_conn_check_link_mode(conn->hcon)) {
conn->disc_reason = 0x05;
conn->disc_reason = HCI_ERROR_AUTH_FAILURE;
result = L2CAP_CR_SEC_BLOCK;
goto response;
}
Expand Down Expand Up @@ -4411,7 +4411,7 @@ static int l2cap_disconn_ind(struct hci_conn *hcon)
BT_DBG("hcon %p", hcon);

if ((hcon->type != ACL_LINK && hcon->type != LE_LINK) || !conn)
return 0x13;
return HCI_ERROR_REMOTE_USER_TERM;

return conn->disc_reason;
}
Expand Down

0 comments on commit e83ebef

Please sign in to comment.