Lines Matching refs:sco
34 #define SCO_CHAN(_sco) ((_sco)->sco.chan);
78 void bt_sco_connected(struct bt_conn *sco) in bt_sco_connected() argument
82 if (sco == NULL || sco->type != BT_CONN_TYPE_SCO) { in bt_sco_connected()
83 LOG_ERR("Invalid parameters: sco %p sco->type %u", sco, sco ? sco->type : 0); in bt_sco_connected()
87 LOG_DBG("%p", sco); in bt_sco_connected()
89 chan = SCO_CHAN(sco); in bt_sco_connected()
103 void bt_sco_disconnected(struct bt_conn *sco) in bt_sco_disconnected() argument
107 if (sco == NULL || sco->type != BT_CONN_TYPE_SCO) { in bt_sco_disconnected()
108 LOG_ERR("Invalid parameters: sco %p sco->type %u", sco, sco ? sco->type : 0); in bt_sco_disconnected()
111 LOG_DBG("%p", sco); in bt_sco_disconnected()
113 chan = SCO_CHAN(sco); in bt_sco_disconnected()
121 bt_sco_cleanup_acl(sco); in bt_sco_disconnected()
123 chan->sco = NULL; in bt_sco_disconnected()
126 chan->ops->disconnected(chan, sco->err); in bt_sco_disconnected()
166 LOG_DBG("chan %p sco %p %s -> %s", chan, chan->sco, bt_sco_chan_state_str(chan->state), in bt_sco_chan_set_state_debug()
207 static void bt_sco_chan_add(struct bt_conn *sco, struct bt_sco_chan *chan) in bt_sco_chan_add() argument
210 chan->sco = sco; in bt_sco_chan_add()
211 sco->sco.chan = chan; in bt_sco_chan_add()
213 LOG_DBG("sco %p chan %p", sco, chan); in bt_sco_chan_add()
216 static int sco_accept(struct bt_conn *acl, struct bt_conn *sco) in sco_accept() argument
222 CHECKIF(!sco || sco->type != BT_CONN_TYPE_SCO) { in sco_accept()
223 LOG_ERR("Invalid parameters: sco %p sco->type %u", sco, sco ? sco->type : 0); in sco_accept()
227 LOG_DBG("%p", sco); in sco_accept()
230 memcpy(accept_info.dev_class, sco->sco.dev_class, sizeof(accept_info.dev_class)); in sco_accept()
231 accept_info.link_type = sco->sco.link_type; in sco_accept()
244 bt_sco_chan_add(sco, chan); in sco_accept()
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()
298 sec_err = sco_server_check_security(sco_conn->sco.acl); 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()
321 void bt_sco_cleanup_acl(struct bt_conn *sco) in bt_sco_cleanup_acl() argument
323 LOG_DBG("%p", sco); in bt_sco_cleanup_acl()
325 if (sco->sco.acl) { in bt_sco_cleanup_acl()
326 bt_conn_unref(sco->sco.acl); in bt_sco_cleanup_acl()
327 sco->sco.acl = NULL; in bt_sco_cleanup_acl()
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()
391 sco_conn->sco.link_type = link_type; in bt_conn_create_sco()
394 bt_conn_set_state(chan->sco, BT_CONN_INITIATING); in bt_conn_create_sco()
398 bt_conn_set_state(chan->sco, BT_CONN_DISCONNECTED); in bt_conn_create_sco()