Lines Matching refs:chan

43 #define AVDTP_CHAN(_ch) CONTAINER_OF(_ch, struct bt_avdtp, br_chan.chan)
118 void bt_avdtp_media_l2cap_connected(struct bt_l2cap_chan *chan) in bt_avdtp_media_l2cap_connected() argument
121 struct bt_avdtp_sep *sep = CONTAINER_OF(chan, struct bt_avdtp_sep, chan.chan); in bt_avdtp_media_l2cap_connected()
123 if (!chan) { in bt_avdtp_media_l2cap_connected()
133 LOG_DBG("chan %p session %p", chan, session); in bt_avdtp_media_l2cap_connected()
146 void bt_avdtp_media_l2cap_disconnected(struct bt_l2cap_chan *chan) in bt_avdtp_media_l2cap_disconnected() argument
149 struct bt_avdtp_sep *sep = CONTAINER_OF(chan, struct bt_avdtp_sep, chan.chan); in bt_avdtp_media_l2cap_disconnected()
156 LOG_DBG("chan %p", chan); in bt_avdtp_media_l2cap_disconnected()
157 chan->conn = NULL; in bt_avdtp_media_l2cap_disconnected()
181 int bt_avdtp_media_l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf) in bt_avdtp_media_l2cap_recv() argument
184 struct bt_avdtp_sep *sep = CONTAINER_OF(chan, struct bt_avdtp_sep, chan.chan); in bt_avdtp_media_l2cap_recv()
205 sep->chan.rx.mtu = BT_L2CAP_RX_MTU; in avdtp_media_connect()
206 sep->chan.chan.ops = &stream_chan_ops; in avdtp_media_connect()
207 sep->chan.required_sec_level = BT_SECURITY_L2; in avdtp_media_connect()
209 return bt_l2cap_chan_connect(session->br_chan.chan.conn, &sep->chan.chan, in avdtp_media_connect()
215 if (sep == NULL || sep->chan.chan.conn == NULL || sep->chan.chan.ops == NULL) { in avdtp_media_disconnect()
219 return bt_l2cap_chan_disconnect(&sep->chan.chan); in avdtp_media_disconnect()
304 err = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_discover_handler()
396 err = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_get_capabilities_handler()
493 ret = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_process_configuration()
549 err = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_get_configuration_handler()
603 ret = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_open_handler()
675 ret = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_start_handler()
751 ret = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_close_handler()
820 ret = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_suspend_handler()
890 ret = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in avdtp_abort_handler()
897 (sep->chan.state == BT_L2CAP_CONNECTED)) { in avdtp_abort_handler()
986 result = bt_l2cap_chan_send(&session->br_chan.chan, buf); in avdtp_send()
1027 void bt_avdtp_l2cap_connected(struct bt_l2cap_chan *chan) in bt_avdtp_l2cap_connected() argument
1031 if (!chan) { in bt_avdtp_l2cap_connected()
1036 session = AVDTP_CHAN(chan); in bt_avdtp_l2cap_connected()
1037 LOG_DBG("chan %p session %p", chan, session); in bt_avdtp_l2cap_connected()
1043 void bt_avdtp_l2cap_disconnected(struct bt_l2cap_chan *chan) in bt_avdtp_l2cap_disconnected() argument
1045 struct bt_avdtp *session = AVDTP_CHAN(chan); in bt_avdtp_l2cap_disconnected()
1047 LOG_DBG("chan %p session %p", chan, session); in bt_avdtp_l2cap_disconnected()
1048 session->br_chan.chan.conn = NULL; in bt_avdtp_l2cap_disconnected()
1080 int bt_avdtp_l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf) in bt_avdtp_l2cap_recv() argument
1083 struct bt_avdtp *session = AVDTP_CHAN(chan); in bt_avdtp_l2cap_recv()
1116 err = bt_l2cap_chan_send(&session->br_chan.chan, rsp_buf); in bt_avdtp_l2cap_recv()
1169 if (session->br_chan.chan.conn != NULL) { in bt_avdtp_connect()
1173 session->br_chan.chan.conn = conn; in bt_avdtp_connect()
1178 session->br_chan.chan.ops = &signal_chan_ops; in bt_avdtp_connect()
1181 return bt_l2cap_chan_connect(conn, &session->br_chan.chan, BT_L2CAP_PSM_AVDTP); in bt_avdtp_connect()
1192 return bt_l2cap_chan_disconnect(&session->br_chan.chan); in bt_avdtp_disconnect()
1196 struct bt_l2cap_chan **chan) in bt_avdtp_l2cap_accept() argument
1214 if (session->br_chan.chan.conn == NULL) { in bt_avdtp_l2cap_accept()
1215 session->br_chan.chan.conn = conn; in bt_avdtp_l2cap_accept()
1219 session->br_chan.chan.ops = &signal_chan_ops; in bt_avdtp_l2cap_accept()
1221 *chan = &session->br_chan.chan; in bt_avdtp_l2cap_accept()
1227 session->current_sep->chan.chan.ops = &stream_chan_ops; in bt_avdtp_l2cap_accept()
1228 session->current_sep->chan.rx.mtu = BT_L2CAP_RX_MTU; in bt_avdtp_l2cap_accept()
1229 session->current_sep->chan.required_sec_level = BT_SECURITY_L2; in bt_avdtp_l2cap_accept()
1230 *chan = &session->current_sep->chan.chan; in bt_avdtp_l2cap_accept()
1571 err = bt_l2cap_chan_send(&sep->chan.chan, buf); in bt_avdtp_send_media_data()
1582 return sep->chan.tx.mtu; in bt_avdtp_get_media_mtu()