Lines Matching refs:sco_conn

250 static int accept_sco_conn(const bt_addr_t *bdaddr, struct bt_conn *sco_conn)  in accept_sco_conn()  argument
256 err = sco_accept(sco_conn->sco.acl, sco_conn); in accept_sco_conn()
268 cp->pkt_type = sco_conn->sco.pkt_type; in accept_sco_conn()
285 struct bt_conn *sco_conn; in bt_esco_conn_req() local
293 sco_conn = bt_conn_add_sco(&evt->bdaddr, evt->link_type); in bt_esco_conn_req()
294 if (!sco_conn) { in bt_esco_conn_req()
298 sec_err = sco_server_check_security(sco_conn->sco.acl); in bt_esco_conn_req()
301 bt_sco_cleanup(sco_conn); in bt_esco_conn_req()
305 memcpy(sco_conn->sco.dev_class, evt->dev_class, sizeof(sco_conn->sco.dev_class)); in bt_esco_conn_req()
306 sco_conn->sco.link_type = evt->link_type; in bt_esco_conn_req()
308 if (accept_sco_conn(&evt->bdaddr, sco_conn)) { in bt_esco_conn_req()
310 bt_sco_cleanup(sco_conn); in bt_esco_conn_req()
314 sco_conn->role = BT_HCI_ROLE_PERIPHERAL; in bt_esco_conn_req()
315 bt_conn_set_state(sco_conn, BT_CONN_INITIATING); in bt_esco_conn_req()
316 bt_conn_unref(sco_conn); in bt_esco_conn_req()
331 static int sco_setup_sync_conn(struct bt_conn *sco_conn) in sco_setup_sync_conn() argument
346 LOG_DBG("handle : %x", sco_conn->sco.acl->handle); in sco_setup_sync_conn()
348 cp->handle = sco_conn->sco.acl->handle; in sco_setup_sync_conn()
349 cp->pkt_type = sco_conn->sco.pkt_type; in sco_setup_sync_conn()
365 struct bt_conn *sco_conn; in bt_conn_create_sco() local
368 sco_conn = bt_conn_lookup_addr_sco(peer); in bt_conn_create_sco()
369 if (sco_conn) { in bt_conn_create_sco()
370 switch (sco_conn->state) { in bt_conn_create_sco()
373 return sco_conn; in bt_conn_create_sco()
375 bt_conn_unref(sco_conn); in bt_conn_create_sco()
386 sco_conn = bt_conn_add_sco(peer, link_type); in bt_conn_create_sco()
387 if (!sco_conn) { in bt_conn_create_sco()
391 sco_conn->sco.link_type = link_type; in bt_conn_create_sco()
393 bt_sco_chan_add(sco_conn, chan); in bt_conn_create_sco()
397 if (sco_setup_sync_conn(sco_conn) < 0) { in bt_conn_create_sco()
400 bt_sco_cleanup(sco_conn); in bt_conn_create_sco()
404 return sco_conn; in bt_conn_create_sco()