Lines Matching refs:sco_socket
110 sco_socket_t* sco_socket = sco_socket_establish_locked(true, NULL, sock_fd); in btsock_sco_listen() local
111 if (!sco_socket) return BT_STATUS_FAIL; in btsock_sco_listen()
113 BTM_RegForEScoEvts(sco_socket->sco_handle, connection_request_cb); in btsock_sco_listen()
114 listen_sco_socket = sco_socket; in btsock_sco_listen()
125 sco_socket_t* sco_socket = in btsock_sco_connect() local
128 return (sco_socket != NULL) ? BT_STATUS_SUCCESS : BT_STATUS_FAIL; in btsock_sco_connect()
136 sco_socket_t* sco_socket = NULL; in sco_socket_establish_locked() local
146 sco_socket = sco_socket_new(); in sco_socket_establish_locked()
147 if (!sco_socket) { in sco_socket_establish_locked()
154 &sco_socket->sco_handle, connect_completed_cb, in sco_socket_establish_locked()
169 sco_socket->socket = socket; // Hang on to the other end. in sco_socket_establish_locked()
170 list_append(sco_sockets, sco_socket); in sco_socket_establish_locked()
172 socket_register(socket, thread_get_reactor(thread), sco_socket, in sco_socket_establish_locked()
174 return sco_socket; in sco_socket_establish_locked()
180 sco_socket_free_locked(sco_socket); in sco_socket_establish_locked()
185 sco_socket_t* sco_socket = (sco_socket_t*)osi_calloc(sizeof(sco_socket_t)); in sco_socket_new() local
186 sco_socket->sco_handle = BTM_INVALID_SCO_INDEX; in sco_socket_new()
187 return sco_socket; in sco_socket_new()
193 static void sco_socket_free_locked(sco_socket_t* sco_socket) { in sco_socket_free_locked() argument
194 if (!sco_socket) return; in sco_socket_free_locked()
196 if (sco_socket->sco_handle != BTM_INVALID_SCO_INDEX) in sco_socket_free_locked()
197 BTM_RemoveSco(sco_socket->sco_handle); in sco_socket_free_locked()
198 socket_free(sco_socket->socket); in sco_socket_free_locked()
199 osi_free(sco_socket); in sco_socket_free_locked()
206 sco_socket_t* sco_socket = (sco_socket_t*)list_node(node); in sco_socket_find_locked() local
207 if (sco_socket->sco_handle == sco_handle) return sco_socket; in sco_socket_find_locked()
222 sco_socket_t* sco_socket = sco_socket_find_locked(conn_data->sco_inx); in connection_request_cb() local
228 if (!sco_socket) { in connection_request_cb()
234 if (sco_socket != listen_sco_socket) { in connection_request_cb()
249 temp = sco_socket->sco_handle; in connection_request_cb()
250 sco_socket->sco_handle = new_sco_socket->sco_handle; in connection_request_cb()
259 if (socket_write_and_transfer_fd(sco_socket->socket, &connect_signal, in connection_request_cb()
281 sco_socket_t* sco_socket = sco_socket_find_locked(sco_handle); in connect_completed_cb() local
282 if (!sco_socket) { in connect_completed_cb()
291 if (!sco_socket->socket) { in connect_completed_cb()
292 BTM_RemoveSco(sco_socket->sco_handle); in connect_completed_cb()
293 list_remove(sco_sockets, sco_socket); in connect_completed_cb()
297 sco_socket->connect_completed = true; in connect_completed_cb()
303 sco_socket_t* sco_socket = sco_socket_find_locked(sco_handle); in disconnect_completed_cb() local
304 if (!sco_socket) { in disconnect_completed_cb()
310 list_remove(sco_sockets, sco_socket); in disconnect_completed_cb()
316 sco_socket_t* sco_socket = (sco_socket_t*)context; in socket_read_ready_cb() local
317 socket_free(sco_socket->socket); in socket_read_ready_cb()
318 sco_socket->socket = NULL; in socket_read_ready_cb()
326 if (sco_socket->connect_completed || sco_socket == listen_sco_socket) { in socket_read_ready_cb()
327 if (BTM_RemoveSco(sco_socket->sco_handle) == BTM_SUCCESS) in socket_read_ready_cb()
328 list_remove(sco_sockets, sco_socket); in socket_read_ready_cb()
329 if (sco_socket == listen_sco_socket) listen_sco_socket = NULL; in socket_read_ready_cb()