sco.c (5e66dd6d66ffe758b39b6dcadf2330753ee1159b) sco.c (25ea6db04a96d7871e7ece27d566f3228d59d932)
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 94 unchanged lines hidden (view full) ---

103 sk->sk_timer.function = sco_sock_timeout;
104 sk->sk_timer.data = (unsigned long)sk;
105}
106
107/* ---- SCO connections ---- */
108static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
109{
110 struct hci_dev *hdev = hcon->hdev;
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 94 unchanged lines hidden (view full) ---

103 sk->sk_timer.function = sco_sock_timeout;
104 sk->sk_timer.data = (unsigned long)sk;
105}
106
107/* ---- SCO connections ---- */
108static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
109{
110 struct hci_dev *hdev = hcon->hdev;
111 struct sco_conn *conn;
111 struct sco_conn *conn = hcon->sco_data;
112
112
113 if ((conn = hcon->sco_data))
113 if (conn || status)
114 return conn;
115
114 return conn;
115
116 if (status)
117 return conn;
118
119 if (!(conn = kmalloc(sizeof(struct sco_conn), GFP_ATOMIC)))
116 conn = kzalloc(sizeof(struct sco_conn), GFP_ATOMIC);
117 if (!conn)
120 return NULL;
118 return NULL;
121 memset(conn, 0, sizeof(struct sco_conn));
122
123 spin_lock_init(&conn->lock);
124
125 hcon->sco_data = conn;
126 conn->hcon = hcon;
127
128 conn->src = &hdev->bdaddr;
129 conn->dst = &hcon->dst;
130
131 if (hdev->sco_mtu > 0)
132 conn->mtu = hdev->sco_mtu;
133 else
134 conn->mtu = 60;
135
136 BT_DBG("hcon %p conn %p", hcon, conn);
119
120 spin_lock_init(&conn->lock);
121
122 hcon->sco_data = conn;
123 conn->hcon = hcon;
124
125 conn->src = &hdev->bdaddr;
126 conn->dst = &hcon->dst;
127
128 if (hdev->sco_mtu > 0)
129 conn->mtu = hdev->sco_mtu;
130 else
131 conn->mtu = 60;
132
133 BT_DBG("hcon %p conn %p", hcon, conn);
134
137 return conn;
138}
139
140static inline struct sock *sco_chan_get(struct sco_conn *conn)
141{
142 struct sock *sk = NULL;
143 sco_conn_lock(conn);
144 sk = conn->sk;

--- 860 unchanged lines hidden ---
135 return conn;
136}
137
138static inline struct sock *sco_chan_get(struct sco_conn *conn)
139{
140 struct sock *sk = NULL;
141 sco_conn_lock(conn);
142 sk = conn->sk;

--- 860 unchanged lines hidden ---