aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth_mgmt
diff options
context:
space:
mode:
authorDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2012-07-21 23:04:45 +0200
committerDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2012-07-21 23:04:45 +0200
commit0a1182796f6475b8cb2ff1781dad873a744b3197 (patch)
treee15b5256dac226c49a25b5e24594cd638e2fec2c /net/bluetooth_mgmt
parent633018c13fe06461d9c60692fbb114734aa37802 (diff)
downloadkernel_samsung_smdk4412-0a1182796f6475b8cb2ff1781dad873a744b3197.zip
kernel_samsung_smdk4412-0a1182796f6475b8cb2ff1781dad873a744b3197.tar.gz
kernel_samsung_smdk4412-0a1182796f6475b8cb2ff1781dad873a744b3197.tar.bz2
samsung opensource update3
Diffstat (limited to 'net/bluetooth_mgmt')
-rw-r--r--net/bluetooth_mgmt/hci_conn.c2
-rw-r--r--net/bluetooth_mgmt/hci_event.c31
-rw-r--r--net/bluetooth_mgmt/l2cap_core.c4
-rw-r--r--net/bluetooth_mgmt/rfcomm/core.c12
4 files changed, 31 insertions, 18 deletions
diff --git a/net/bluetooth_mgmt/hci_conn.c b/net/bluetooth_mgmt/hci_conn.c
index 44ca233..fcb6c0e 100644
--- a/net/bluetooth_mgmt/hci_conn.c
+++ b/net/bluetooth_mgmt/hci_conn.c
@@ -222,7 +222,7 @@ void hci_setup_sync(struct hci_conn *conn, __u16 handle)
if (conn->hdev->is_wbs) {
/* Transparent Data */
uint16_t voice_setting = hdev->voice_setting | ACF_TRANS;
- cp.max_latency = cpu_to_le16(0x000A);
+ cp.max_latency = cpu_to_le16(0x000D);
cp.pkt_type = cpu_to_le16(ESCO_WBS);
cp.voice_setting = cpu_to_le16(voice_setting);
/* Retransmission Effort */
diff --git a/net/bluetooth_mgmt/hci_event.c b/net/bluetooth_mgmt/hci_event.c
index ba8fc80..7dc2018 100644
--- a/net/bluetooth_mgmt/hci_event.c
+++ b/net/bluetooth_mgmt/hci_event.c
@@ -2664,14 +2664,25 @@ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff
BT_DBG("%s ignoring unauthenticated key", hdev->name);
goto not_found;
}
-
- if (key->type == HCI_LK_COMBINATION && key->pin_len < 16 &&
- conn->pending_sec_level == BT_SECURITY_HIGH) {
- BT_DBG("%s ignoring key unauthenticated for high \
- security", hdev->name);
- goto not_found;
- }
-
+ /* - This is mgmt only. hciops doesn't checking like this. -
+ * If device is pre 2.1 & security level is high, combination key type is required.
+ * (core spec 4.0 GAP 1671p)
+ * And 16 digit PIN is recommended. (but not mandatory)
+ * Now, Google API only support high & low level for outgoing.
+ * So if application use high level security, 16 digit PIN is needed. (mgmt based)
+ * But Google is still using hciops, There is no problem in their platform.
+ * This can make confusion to 3rd party developer.
+ * Disable this part for same action with hciops.
+ * and this should be checked after google's update.
+ */
+ /*
+ *if (key->type == HCI_LK_COMBINATION && key->pin_len < 16 &&
+ * conn->pending_sec_level == BT_SECURITY_HIGH) {
+ * BT_DBG("%s ignoring key unauthenticated for high \
+ * security", hdev->name);
+ * goto not_found;
+ *}
+ */
conn->key_type = key->type;
conn->pin_length = key->pin_len;
}
@@ -2914,9 +2925,7 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu
case 0x1c: /* SCO interval rejected */
case 0x1a: /* Unsupported Remote Feature */
case 0x1f: /* Unspecified error */
- if (conn->out && conn->attempt < 2) {
- /* wbs */
- if (!conn->hdev->is_wbs)
+ if (conn->out && conn->attempt < 2 && !conn->hdev->is_wbs) {
conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) |
(hdev->esco_type & EDR_ESCO_MASK);
hci_setup_sync(conn, conn->link->handle);
diff --git a/net/bluetooth_mgmt/l2cap_core.c b/net/bluetooth_mgmt/l2cap_core.c
index cc836ec..884f61c 100644
--- a/net/bluetooth_mgmt/l2cap_core.c
+++ b/net/bluetooth_mgmt/l2cap_core.c
@@ -1919,9 +1919,9 @@ static void l2cap_ack_timeout(unsigned long arg)
{
struct l2cap_chan *chan = (void *) arg;
- bh_lock_sock(chan->sk);
+ spin_lock_bh(&((chan->sk)->sk_lock.slock));
l2cap_send_ack(chan);
- bh_unlock_sock(chan->sk);
+ spin_unlock_bh(&((chan->sk)->sk_lock.slock));
}
static inline void l2cap_ertm_init(struct l2cap_chan *chan)
diff --git a/net/bluetooth_mgmt/rfcomm/core.c b/net/bluetooth_mgmt/rfcomm/core.c
index c543fda..9e77543 100644
--- a/net/bluetooth_mgmt/rfcomm/core.c
+++ b/net/bluetooth_mgmt/rfcomm/core.c
@@ -1173,9 +1173,11 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
/* When socket is closed and we are not RFCOMM
* initiator rfcomm_process_rx already calls
* rfcomm_session_put() */
- if (s->sock->sk->sk_state != BT_CLOSED && !s->initiator)
- if (list_empty(&s->dlcs))
+ if (s->sock->sk->sk_state != BT_CLOSED && s->acceptor_inc)
+ if (list_empty(&s->dlcs)) {
rfcomm_session_put(s);
+ s->acceptor_inc = 0;
+ }
break;
}
}
@@ -1871,9 +1873,10 @@ static inline void rfcomm_process_rx(struct rfcomm_session *s)
}
if (sk->sk_state == BT_CLOSED) {
- if (!s->initiator)
+ if (s->acceptor_inc) {
rfcomm_session_put(s);
-
+ s->acceptor_inc = 0;
+ }
rfcomm_session_close(s, sk->sk_err);
}
}
@@ -1901,6 +1904,7 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
s = rfcomm_session_add(nsock, BT_OPEN);
if (s) {
rfcomm_session_hold(s);
+ s->acceptor_inc = 1;
/* We should adjust MTU on incoming sessions.
* L2CAP MTU minus UIH header and FCS. */