diff options
author | Frédéric Dalleau <frederic.dalleau@linux.intel.com> | 2012-11-21 04:51:12 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-12-03 12:59:58 -0500 |
commit | 20714bfef84d3e690c9c6f8e9cd46543b5ae1eed (patch) | |
tree | aa1ac5c6a0b959382ed2c6a2be52b45414d4cf08 /include/net | |
parent | b96e9c671b05f95126753a22145d4509d45ca197 (diff) |
Bluetooth: Implement deferred sco socket setup
In order to authenticate and configure an incoming SCO connection, the
BT_DEFER_SETUP option was added. This option is intended to defer reply
to Connect Request on SCO sockets.
When a connection is requested, the listening socket is unblocked but
the effective connection setup happens only on first recv. Any send
between accept and recv fails with -ENOTCONN.
Signed-off-by: Frédéric Dalleau <frederic.dalleau@linux.intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index ef5b85dac3f7..76891a914e75 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -376,7 +376,7 @@ extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); | |||
376 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, | 376 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, |
377 | u16 flags); | 377 | u16 flags); |
378 | 378 | ||
379 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 379 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags); |
380 | extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status); | 380 | extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status); |
381 | extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason); | 381 | extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason); |
382 | extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); | 382 | extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); |
@@ -577,6 +577,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); | |||
577 | int hci_conn_del(struct hci_conn *conn); | 577 | int hci_conn_del(struct hci_conn *conn); |
578 | void hci_conn_hash_flush(struct hci_dev *hdev); | 578 | void hci_conn_hash_flush(struct hci_dev *hdev); |
579 | void hci_conn_check_pending(struct hci_dev *hdev); | 579 | void hci_conn_check_pending(struct hci_dev *hdev); |
580 | void hci_conn_accept(struct hci_conn *conn, int mask); | ||
580 | 581 | ||
581 | struct hci_chan *hci_chan_create(struct hci_conn *conn); | 582 | struct hci_chan *hci_chan_create(struct hci_conn *conn); |
582 | void hci_chan_del(struct hci_chan *chan); | 583 | void hci_chan_del(struct hci_chan *chan); |
@@ -779,8 +780,10 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
779 | #define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR) | 780 | #define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR) |
780 | 781 | ||
781 | /* ----- HCI protocols ----- */ | 782 | /* ----- HCI protocols ----- */ |
783 | #define HCI_PROTO_DEFER 0x01 | ||
784 | |||
782 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, | 785 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, |
783 | __u8 type) | 786 | __u8 type, __u8 *flags) |
784 | { | 787 | { |
785 | switch (type) { | 788 | switch (type) { |
786 | case ACL_LINK: | 789 | case ACL_LINK: |
@@ -788,7 +791,7 @@ static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
788 | 791 | ||
789 | case SCO_LINK: | 792 | case SCO_LINK: |
790 | case ESCO_LINK: | 793 | case ESCO_LINK: |
791 | return sco_connect_ind(hdev, bdaddr); | 794 | return sco_connect_ind(hdev, bdaddr, flags); |
792 | 795 | ||
793 | default: | 796 | default: |
794 | BT_ERR("unknown link type %d", type); | 797 | BT_ERR("unknown link type %d", type); |