Lines Matching refs:req

49 #define DISCOVER_REQ(_req) CONTAINER_OF(_req, struct bt_avdtp_discover_params, req)
50 #define GET_CAP_REQ(_req) CONTAINER_OF(_req, struct bt_avdtp_get_capabilities_params, req)
51 #define SET_CONF_REQ(_req) CONTAINER_OF(_req, struct bt_avdtp_set_configuration_params, req)
52 #define CTRL_REQ(_req) CONTAINER_OF(_req, struct bt_avdtp_ctrl_params, req)
113 session->req = NULL; in bt_avdtp_clear_req()
135 if (session->req != NULL) { in bt_avdtp_media_l2cap_connected()
136 struct bt_avdtp_req *req = session->req; in bt_avdtp_media_l2cap_connected() local
138 req->status = 0; in bt_avdtp_media_l2cap_connected()
140 if (req->func != NULL) { in bt_avdtp_media_l2cap_connected()
141 req->func(req); in bt_avdtp_media_l2cap_connected()
159 if ((sep->state == AVDTP_CLOSING) && (session->req != NULL) && in bt_avdtp_media_l2cap_disconnected()
160 (session->req->sig == BT_AVDTP_CLOSE)) { in bt_avdtp_media_l2cap_disconnected()
162 struct bt_avdtp_req *req = session->req; in bt_avdtp_media_l2cap_disconnected() local
166 req->status = 0; in bt_avdtp_media_l2cap_disconnected()
168 if (req->func != NULL) { in bt_avdtp_media_l2cap_disconnected()
169 req->func(req); in bt_avdtp_media_l2cap_disconnected()
245 static void avdtp_set_status(struct bt_avdtp_req *req, struct net_buf *buf, uint8_t msg_type) in avdtp_set_status() argument
248 req->status = 0; in avdtp_set_status()
251 req->status = net_buf_pull_u8(buf); in avdtp_set_status()
254 req->status = BT_AVDTP_BAD_LENGTH; in avdtp_set_status()
257 req->status = BT_AVDTP_NOT_SUPPORTED_COMMAND; in avdtp_set_status()
259 req->status = BT_AVDTP_BAD_HEADER_FORMAT; in avdtp_set_status()
311 struct bt_avdtp_req *req = session->req; in avdtp_discover_handler() local
313 if (req == NULL) { in avdtp_discover_handler()
318 DISCOVER_REQ(req)->buf = buf; in avdtp_discover_handler()
320 DISCOVER_REQ(req)->buf = NULL; in avdtp_discover_handler()
322 avdtp_set_status(req, buf, msg_type); in avdtp_discover_handler()
324 if (req->func != NULL) { in avdtp_discover_handler()
325 req->func(req); in avdtp_discover_handler()
403 struct bt_avdtp_req *req = session->req; in avdtp_get_capabilities_handler() local
405 if (req == NULL) { in avdtp_get_capabilities_handler()
409 GET_CAP_REQ(session->req)->buf = NULL; in avdtp_get_capabilities_handler()
412 GET_CAP_REQ(req)->buf = buf; in avdtp_get_capabilities_handler()
414 avdtp_set_status(req, buf, msg_type); in avdtp_get_capabilities_handler()
416 if (req->func != NULL) { in avdtp_get_capabilities_handler()
417 req->func(req); in avdtp_get_capabilities_handler()
503 struct bt_avdtp_req *req = session->req; in avdtp_process_configuration() local
505 if (req == NULL) { in avdtp_process_configuration()
511 bt_avdtp_set_state_lock(SET_CONF_REQ(req)->sep, AVDTP_CONFIGURED); in avdtp_process_configuration()
521 avdtp_set_status(req, buf, msg_type); in avdtp_process_configuration()
523 if (req->func != NULL) { in avdtp_process_configuration()
524 req->func(req); in avdtp_process_configuration()
614 struct bt_avdtp_req *req = session->req; in avdtp_open_handler() local
616 if (req == NULL) { in avdtp_open_handler()
620 avdtp_set_status(req, buf, msg_type); in avdtp_open_handler()
622 bt_avdtp_set_state_lock(CTRL_REQ(req)->sep, AVDTP_OPENING); in avdtp_open_handler()
624 if (!avdtp_media_connect(session, CTRL_REQ(req)->sep)) { in avdtp_open_handler()
628 if (req->status) { in avdtp_open_handler()
630 if (req->func != NULL) { in avdtp_open_handler()
631 req->func(req); in avdtp_open_handler()
685 struct bt_avdtp_req *req = session->req; in avdtp_start_handler() local
687 if (req == NULL) { in avdtp_start_handler()
692 bt_avdtp_set_state_lock(CTRL_REQ(req)->sep, AVDTP_STREAMING); in avdtp_start_handler()
698 if (acp_seid != CTRL_REQ(req)->acp_stream_ep_id) { in avdtp_start_handler()
703 avdtp_set_status(req, buf, msg_type); in avdtp_start_handler()
705 if (req->func != NULL) { in avdtp_start_handler()
706 req->func(req); in avdtp_start_handler()
761 struct bt_avdtp_req *req = session->req; in avdtp_close_handler() local
763 if (req == NULL) { in avdtp_close_handler()
767 avdtp_set_status(req, buf, msg_type); in avdtp_close_handler()
769 bt_avdtp_set_state_lock(CTRL_REQ(req)->sep, AVDTP_CLOSING); in avdtp_close_handler()
770 if (!avdtp_media_disconnect(CTRL_REQ(req)->sep)) { in avdtp_close_handler()
775 if (req->func != NULL) { in avdtp_close_handler()
776 req->func(req); in avdtp_close_handler()
830 struct bt_avdtp_req *req = session->req; in avdtp_suspend_handler() local
832 if (req == NULL) { in avdtp_suspend_handler()
837 bt_avdtp_set_state_lock(CTRL_REQ(req)->sep, AVDTP_OPEN); in avdtp_suspend_handler()
843 if (acp_seid != CTRL_REQ(req)->acp_stream_ep_id) { in avdtp_suspend_handler()
848 avdtp_set_status(req, buf, msg_type); in avdtp_suspend_handler()
850 if (req->func != NULL) { in avdtp_suspend_handler()
851 req->func(req); in avdtp_suspend_handler()
905 struct bt_avdtp_req *req = session->req; in avdtp_abort_handler() local
907 if (req == NULL) { in avdtp_abort_handler()
912 uint8_t pre_state = CTRL_REQ(req)->sep->state; in avdtp_abort_handler()
914 bt_avdtp_set_state_lock(CTRL_REQ(req)->sep, AVDTP_ABORTING); in avdtp_abort_handler()
917 avdtp_media_disconnect(CTRL_REQ(req)->sep); in avdtp_abort_handler()
923 bt_avdtp_set_state_lock(CTRL_REQ(req)->sep, AVDTP_IDLE); in avdtp_abort_handler()
929 if (acp_seid != CTRL_REQ(req)->acp_stream_ep_id) { in avdtp_abort_handler()
934 avdtp_set_status(req, buf, msg_type); in avdtp_abort_handler()
936 if (req->func != NULL) { in avdtp_abort_handler()
937 req->func(req); in avdtp_abort_handler()
945 struct bt_avdtp_req *req = (AVDTP_KWORK(work))->req; in avdtp_timeout() local
949 if (req) { in avdtp_timeout()
950 LOG_DBG("Failed Signal_id = %d", req->sig); in avdtp_timeout()
952 switch (req->sig) { in avdtp_timeout()
961 req->status = BT_AVDTP_TIME_OUT; in avdtp_timeout()
962 req->func(req); in avdtp_timeout()
968 AVDTP_KWORK(work)->req = NULL; in avdtp_timeout()
972 static int avdtp_send(struct bt_avdtp *session, struct net_buf *buf, struct bt_avdtp_req *req) in avdtp_send() argument
978 if (session->req != NULL) { in avdtp_send()
982 session->req = req; in avdtp_send()
995 req->sig = AVDTP_GET_SIG_ID(hdr->signal_id); in avdtp_send()
996 req->tid = AVDTP_GET_TR_ID(hdr->hdr); in avdtp_send()
997 LOG_DBG("sig 0x%02X, tid 0x%02X", req->sig, req->tid); in avdtp_send()
1050 if (session->req) { in bt_avdtp_l2cap_disconnected()
1051 struct bt_avdtp_req *req = session->req; in bt_avdtp_l2cap_disconnected() local
1053 req->status = BT_AVDTP_BAD_STATE; in bt_avdtp_l2cap_disconnected()
1055 if (req->func != NULL) { in bt_avdtp_l2cap_disconnected()
1056 req->func(req); in bt_avdtp_l2cap_disconnected()
1127 if (session->req == NULL) { in bt_avdtp_l2cap_recv()
1132 if (session->req->sig != sigid || session->req->tid != tid) { in bt_avdtp_l2cap_recv()
1135 session->req->sig, session->req->tid); in bt_avdtp_l2cap_recv()
1322 return avdtp_send(session, buf, &param->req); in bt_avdtp_discover()
1365 return avdtp_send(session, buf, &param->req); in bt_avdtp_get_capabilities()
1469 return avdtp_send(session, buf, &param->req); in avdtp_process_configure_command()
1526 return avdtp_send(session, buf, &param->req); in bt_avdtp_ctrl()