Lines Matching refs:sco_socket
119 sco_socket_t *sco_socket = sco_socket_establish_locked(true, NULL, sock_fd); in btsock_sco_listen() local
120 if (sco_socket) { in btsock_sco_listen()
121 BTM_RegForEScoEvts(sco_socket->sco_handle, connection_request_cb); in btsock_sco_listen()
122 listen_sco_socket = sco_socket; in btsock_sco_listen()
127 return sco_socket ? BT_STATUS_SUCCESS : BT_STATUS_FAIL; in btsock_sco_listen()
135 sco_socket_t *sco_socket = sco_socket_establish_locked(false, bd_addr, sock_fd); in btsock_sco_connect() local
138 return (sco_socket != NULL) ? BT_STATUS_SUCCESS : BT_STATUS_FAIL; in btsock_sco_connect()
144 sco_socket_t *sco_socket = NULL; in sco_socket_establish_locked() local
151 sco_socket = sco_socket_new(); in sco_socket_establish_locked()
152 if (!sco_socket) { in sco_socket_establish_locked()
157 …teSco((uint8_t *)bd_addr, !is_listening, sco_parameters.packet_types, &sco_socket->sco_handle, con… in sco_socket_establish_locked()
170 sco_socket->socket = socket; // Hang on to the other end. in sco_socket_establish_locked()
171 list_append(sco_sockets, sco_socket); in sco_socket_establish_locked()
173 socket_register(socket, thread_get_reactor(thread), sco_socket, socket_read_ready_cb, NULL); in sco_socket_establish_locked()
174 return sco_socket; in sco_socket_establish_locked()
182 sco_socket_free_locked(sco_socket); in sco_socket_establish_locked()
187 sco_socket_t *sco_socket = (sco_socket_t *)osi_calloc(sizeof(sco_socket_t)); in sco_socket_new() local
188 sco_socket->sco_handle = BTM_INVALID_SCO_INDEX; in sco_socket_new()
189 return sco_socket; in sco_socket_new()
194 static void sco_socket_free_locked(sco_socket_t *sco_socket) { in sco_socket_free_locked() argument
195 if (!sco_socket) in sco_socket_free_locked()
198 if (sco_socket->sco_handle != BTM_INVALID_SCO_INDEX) in sco_socket_free_locked()
199 BTM_RemoveSco(sco_socket->sco_handle); in sco_socket_free_locked()
200 socket_free(sco_socket->socket); in sco_socket_free_locked()
201 osi_free(sco_socket); in sco_socket_free_locked()
207 sco_socket_t *sco_socket = (sco_socket_t *)list_node(node); in sco_socket_find_locked() local
208 if (sco_socket->sco_handle == sco_handle) in sco_socket_find_locked()
209 return sco_socket; in sco_socket_find_locked()
224 sco_socket_t *sco_socket = sco_socket_find_locked(conn_data->sco_inx); in connection_request_cb() local
227 if (!sco_socket) { in connection_request_cb()
232 if (sco_socket != listen_sco_socket) { in connection_request_cb()
244 uint16_t temp = sco_socket->sco_handle; in connection_request_cb()
245 sco_socket->sco_handle = new_sco_socket->sco_handle; in connection_request_cb()
254 …if (socket_write_and_transfer_fd(sco_socket->socket, &connect_signal, sizeof(connect_signal), clie… in connection_request_cb()
276 sco_socket_t *sco_socket = sco_socket_find_locked(sco_handle); in connect_completed_cb() local
277 if (!sco_socket) { in connect_completed_cb()
284 if (!sco_socket->socket) { in connect_completed_cb()
285 BTM_RemoveSco(sco_socket->sco_handle); in connect_completed_cb()
286 list_remove(sco_sockets, sco_socket); in connect_completed_cb()
290 sco_socket->connect_completed = true; in connect_completed_cb()
299 sco_socket_t *sco_socket = sco_socket_find_locked(sco_handle); in disconnect_completed_cb() local
300 if (!sco_socket) { in disconnect_completed_cb()
305 list_remove(sco_sockets, sco_socket); in disconnect_completed_cb()
314 sco_socket_t *sco_socket = (sco_socket_t *)context; in socket_read_ready_cb() local
315 socket_free(sco_socket->socket); in socket_read_ready_cb()
316 sco_socket->socket = NULL; in socket_read_ready_cb()
324 if (sco_socket->connect_completed || sco_socket == listen_sco_socket) { in socket_read_ready_cb()
325 if (BTM_RemoveSco(sco_socket->sco_handle) == BTM_SUCCESS) in socket_read_ready_cb()
326 list_remove(sco_sockets, sco_socket); in socket_read_ready_cb()
327 if (sco_socket == listen_sco_socket) in socket_read_ready_cb()