Lines Matching full:conn
51 static struct proc_ctx *lr_dequeue(struct ll_conn *conn);
76 void llcp_lr_check_done(struct ll_conn *conn, struct proc_ctx *ctx) in llcp_lr_check_done() argument
81 ctx_header = llcp_lr_peek(conn); in llcp_lr_check_done()
90 lr_dequeue(conn); in llcp_lr_check_done()
128 static void lr_set_state(struct ll_conn *conn, enum lr_state state) in lr_set_state() argument
130 conn->llcp.local.state = state; in lr_set_state()
133 void llcp_lr_enqueue(struct ll_conn *conn, struct proc_ctx *ctx) in llcp_lr_enqueue() argument
141 sys_slist_append(&conn->llcp.local.pend_proc_list, &ctx->node); in llcp_lr_enqueue()
146 static struct proc_ctx *lr_dequeue(struct ll_conn *conn) in lr_dequeue() argument
156 ctx = (struct proc_ctx *)sys_slist_get(&conn->llcp.local.pend_proc_list); in lr_dequeue()
163 struct proc_ctx *llcp_lr_peek(struct ll_conn *conn) in llcp_lr_peek() argument
172 ctx = (struct proc_ctx *)sys_slist_peek_head(&conn->llcp.local.pend_proc_list); in llcp_lr_peek()
179 struct proc_ctx *llcp_lr_peek_proc(struct ll_conn *conn, uint8_t proc) in llcp_lr_peek_proc() argument
189 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&conn->llcp.local.pend_proc_list, ctx, tmp, node) { in llcp_lr_peek_proc()
200 bool llcp_lr_ispaused(struct ll_conn *conn) in llcp_lr_ispaused() argument
202 return conn->llcp.local.pause == 1U; in llcp_lr_ispaused()
205 void llcp_lr_pause(struct ll_conn *conn) in llcp_lr_pause() argument
207 conn->llcp.local.pause = 1U; in llcp_lr_pause()
210 void llcp_lr_resume(struct ll_conn *conn) in llcp_lr_resume() argument
212 conn->llcp.local.pause = 0U; in llcp_lr_resume()
215 void llcp_lr_prt_restart(struct ll_conn *conn) in llcp_lr_prt_restart() argument
217 conn->llcp.local.prt_expire = conn->llcp.prt_reload; in llcp_lr_prt_restart()
220 void llcp_lr_prt_restart_with_value(struct ll_conn *conn, uint16_t value) in llcp_lr_prt_restart_with_value() argument
222 conn->llcp.local.prt_expire = value; in llcp_lr_prt_restart_with_value()
225 void llcp_lr_prt_stop(struct ll_conn *conn) in llcp_lr_prt_stop() argument
227 conn->llcp.local.prt_expire = 0U; in llcp_lr_prt_stop()
230 void llcp_lr_flush_procedures(struct ll_conn *conn) in llcp_lr_flush_procedures() argument
235 ctx = lr_dequeue(conn); in llcp_lr_flush_procedures()
237 llcp_nodes_release(conn, ctx); in llcp_lr_flush_procedures()
239 ctx = lr_dequeue(conn); in llcp_lr_flush_procedures()
243 void llcp_lr_rx(struct ll_conn *conn, struct proc_ctx *ctx, memq_link_t *link, in llcp_lr_rx() argument
265 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
269 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
273 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
277 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
282 llcp_lp_enc_rx(conn, ctx, rx); in llcp_lr_rx()
287 llcp_lp_pu_rx(conn, ctx, rx); in llcp_lr_rx()
292 llcp_lp_cu_rx(conn, ctx, rx); in llcp_lr_rx()
295 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
299 llcp_lp_chmu_rx(conn, ctx, rx); in llcp_lr_rx()
304 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
309 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
314 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
319 llcp_lp_cc_rx(conn, ctx, rx); in llcp_lr_rx()
324 llcp_lp_comm_rx(conn, ctx, rx); in llcp_lr_rx()
338 llcp_lr_check_done(conn, ctx); in llcp_lr_rx()
341 void llcp_lr_tx_ack(struct ll_conn *conn, struct proc_ctx *ctx, struct node_tx *tx) in llcp_lr_tx_ack() argument
346 llcp_lp_comm_tx_ack(conn, ctx, tx); in llcp_lr_tx_ack()
350 llcp_lp_comm_tx_ack(conn, ctx, tx); in llcp_lr_tx_ack()
354 llcp_lp_comm_tx_ack(conn, ctx, tx); in llcp_lr_tx_ack()
359 llcp_lp_pu_tx_ack(conn, ctx, tx); in llcp_lr_tx_ack()
364 llcp_lp_comm_tx_ack(conn, ctx, tx); in llcp_lr_tx_ack()
369 llcp_lp_past_tx_ack(conn, ctx, tx); in llcp_lr_tx_ack()
380 llcp_lr_check_done(conn, ctx); in llcp_lr_tx_ack()
383 void llcp_lr_tx_ntf(struct ll_conn *conn, struct proc_ctx *ctx) in llcp_lr_tx_ntf() argument
388 llcp_lp_pu_tx_ntf(conn, ctx); in llcp_lr_tx_ntf()
396 llcp_lr_check_done(conn, ctx); in llcp_lr_tx_ntf()
399 static void lr_act_run(struct ll_conn *conn) in lr_act_run() argument
403 ctx = llcp_lr_peek(conn); in lr_act_run()
408 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
412 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
416 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
420 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
425 llcp_lp_enc_run(conn, ctx, NULL); in lr_act_run()
430 llcp_lp_pu_run(conn, ctx, NULL); in lr_act_run()
435 llcp_lp_cu_run(conn, ctx, NULL); in lr_act_run()
438 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
442 llcp_lp_chmu_run(conn, ctx, NULL); in lr_act_run()
447 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
453 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
458 llcp_lp_cc_run(conn, ctx, NULL); in lr_act_run()
463 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
468 llcp_lp_comm_run(conn, ctx, NULL); in lr_act_run()
473 llcp_lp_past_run(conn, ctx, NULL); in lr_act_run()
482 llcp_lr_check_done(conn, ctx); in lr_act_run()
485 static void lr_act_complete(struct ll_conn *conn) in lr_act_complete() argument
489 ctx = llcp_lr_peek(conn); in lr_act_complete()
493 llcp_lr_prt_stop(conn); in lr_act_complete()
499 static void lr_act_connect(struct ll_conn *conn) in lr_act_connect() argument
504 static void lr_act_disconnect(struct ll_conn *conn) in lr_act_disconnect() argument
506 llcp_lr_flush_procedures(conn); in lr_act_disconnect()
509 static void lr_st_disconnect(struct ll_conn *conn, uint8_t evt, void *param) in lr_st_disconnect() argument
513 lr_act_connect(conn); in lr_st_disconnect()
514 lr_set_state(conn, LR_STATE_IDLE); in lr_st_disconnect()
522 static void lr_st_idle(struct ll_conn *conn, uint8_t evt, void *param) in lr_st_idle() argument
528 ctx = llcp_lr_peek(conn); in lr_st_idle()
535 lr_act_run(conn); in lr_st_idle()
537 lr_set_state(conn, LR_STATE_ACTIVE); in lr_st_idle()
539 lr_set_state(conn, LR_STATE_TERMINATE); in lr_st_idle()
544 lr_act_disconnect(conn); in lr_st_idle()
545 lr_set_state(conn, LR_STATE_DISCONNECT); in lr_st_idle()
551 lr_act_complete(conn); in lr_st_idle()
559 static void lr_st_active(struct ll_conn *conn, uint8_t evt, void *param) in lr_st_active() argument
563 if (llcp_lr_peek(conn)) { in lr_st_active()
564 lr_act_run(conn); in lr_st_active()
568 lr_act_complete(conn); in lr_st_active()
569 lr_set_state(conn, LR_STATE_IDLE); in lr_st_active()
572 lr_act_disconnect(conn); in lr_st_active()
573 lr_set_state(conn, LR_STATE_DISCONNECT); in lr_st_active()
581 static void lr_st_terminate(struct ll_conn *conn, uint8_t evt, void *param) in lr_st_terminate() argument
585 if (llcp_lr_peek(conn)) { in lr_st_terminate()
586 lr_act_run(conn); in lr_st_terminate()
590 lr_act_complete(conn); in lr_st_terminate()
591 lr_set_state(conn, LR_STATE_IDLE); in lr_st_terminate()
594 lr_act_disconnect(conn); in lr_st_terminate()
595 lr_set_state(conn, LR_STATE_DISCONNECT); in lr_st_terminate()
603 static void lr_execute_fsm(struct ll_conn *conn, uint8_t evt, void *param) in lr_execute_fsm() argument
605 switch (conn->llcp.local.state) { in lr_execute_fsm()
607 lr_st_disconnect(conn, evt, param); in lr_execute_fsm()
610 lr_st_idle(conn, evt, param); in lr_execute_fsm()
613 lr_st_active(conn, evt, param); in lr_execute_fsm()
616 lr_st_terminate(conn, evt, param); in lr_execute_fsm()
624 void llcp_lr_init(struct ll_conn *conn) in llcp_lr_init() argument
626 lr_set_state(conn, LR_STATE_DISCONNECT); in llcp_lr_init()
627 conn->llcp.local.prt_expire = 0U; in llcp_lr_init()
630 void llcp_lr_run(struct ll_conn *conn) in llcp_lr_run() argument
632 lr_execute_fsm(conn, LR_EVT_RUN, NULL); in llcp_lr_run()
635 void llcp_lr_complete(struct ll_conn *conn) in llcp_lr_complete() argument
637 lr_execute_fsm(conn, LR_EVT_COMPLETE, NULL); in llcp_lr_complete()
640 void llcp_lr_connect(struct ll_conn *conn) in llcp_lr_connect() argument
642 lr_execute_fsm(conn, LR_EVT_CONNECT, NULL); in llcp_lr_connect()
645 void llcp_lr_disconnect(struct ll_conn *conn) in llcp_lr_disconnect() argument
647 lr_execute_fsm(conn, LR_EVT_DISCONNECT, NULL); in llcp_lr_disconnect()
650 void llcp_lr_terminate(struct ll_conn *conn) in llcp_lr_terminate() argument
653 llcp_lr_flush_procedures(conn); in llcp_lr_terminate()
654 llcp_lr_prt_stop(conn); in llcp_lr_terminate()
655 llcp_rr_set_incompat(conn, 0U); in llcp_lr_terminate()
656 lr_set_state(conn, LR_STATE_IDLE); in llcp_lr_terminate()
661 bool llcp_lr_is_disconnected(struct ll_conn *conn) in llcp_lr_is_disconnected() argument
663 return conn->llcp.local.state == LR_STATE_DISCONNECT; in llcp_lr_is_disconnected()
666 bool llcp_lr_is_idle(struct ll_conn *conn) in llcp_lr_is_idle() argument
668 return conn->llcp.local.state == LR_STATE_IDLE; in llcp_lr_is_idle()
671 struct proc_ctx *llcp_lr_dequeue(struct ll_conn *conn) in llcp_lr_dequeue() argument
673 return lr_dequeue(conn); in llcp_lr_dequeue()