Lines Matching full:conn

55 static struct ll_conn conn;  variable
96 test_setup(&conn); in collision_setup()
98 /* Emulate initial conn state */ in collision_setup()
99 conn.phy_pref_rx = PHY_1M | PHY_2M | PHY_CODED; in collision_setup()
100 conn.phy_pref_tx = PHY_1M | PHY_2M | PHY_CODED; in collision_setup()
101 conn.lll.phy_flags = PREFER_S2_CODING; in collision_setup()
102 conn.lll.phy_tx_time = PHY_1M; in collision_setup()
103 conn.lll.phy_rx = PHY_1M; in collision_setup()
104 conn.lll.phy_tx = PHY_1M; in collision_setup()
109 ull_dle_init(&conn, PHY_1M); in collision_setup()
111 conn.lll.dle.remote.max_tx_octets = PDU_DC_PAYLOAD_SIZE_MIN * 3; in collision_setup()
112 conn.lll.dle.remote.max_rx_octets = PDU_DC_PAYLOAD_SIZE_MIN * 3; in collision_setup()
113 conn.lll.dle.remote.max_tx_time = PDU_DC_MAX_US(conn.lll.dle.remote.max_tx_octets, in collision_setup()
115 conn.lll.dle.remote.max_rx_time = PDU_DC_MAX_US(conn.lll.dle.remote.max_rx_octets, in collision_setup()
117 ull_dle_update_eff(&conn); in collision_setup()
144 static bool is_instant_reached(struct ll_conn *conn, uint16_t instant) in is_instant_reached() argument
146 return ((event_counter(conn) - instant) & 0xFFFF) <= 0x7FFF; in is_instant_reached()
171 test_set_role(&conn, BT_HCI_ROLE_CENTRAL); in ZTEST()
174 conn.llcp.fex.valid = 1; in ZTEST()
177 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
180 err = ull_cp_phy_update(&conn, PHY_2M, PREFER_S8_CODING, PHY_2M, 1); in ZTEST()
186 event_prepare(&conn); in ZTEST()
189 lt_rx(LL_PHY_REQ, &conn, &tx, &req); in ZTEST()
190 lt_rx_q_is_empty(&conn); in ZTEST()
193 lt_tx(LL_PHY_REQ, &conn, &req); in ZTEST()
196 zassert_equal(conn.tx_q.pause_data, 1U, "Data tx is not paused"); in ZTEST()
199 event_tx_ack(&conn, tx); in ZTEST()
202 zassert_equal(conn.tx_q.pause_data, 1U, "Data tx is paused"); in ZTEST()
205 event_done(&conn); in ZTEST()
208 zassert_equal(conn.tx_q.pause_data, 1U, "Data tx is not paused"); in ZTEST()
211 ull_cp_release_tx(&conn, tx); in ZTEST()
216 event_prepare(&conn); in ZTEST()
217 test_print_conn(&conn); in ZTEST()
220 lt_rx(LL_REJECT_EXT_IND, &conn, &tx, &reject_ext_ind); in ZTEST()
221 lt_rx_q_is_empty(&conn); in ZTEST()
224 event_tx_ack(&conn, tx); in ZTEST()
228 event_done(&conn); in ZTEST()
231 ull_cp_release_tx(&conn, tx); in ZTEST()
236 event_prepare(&conn); in ZTEST()
240 lt_rx_q_is_empty(&conn); in ZTEST()
244 lt_tx(LL_PHY_RSP, &conn, &rsp); in ZTEST()
247 event_tx_ack(&conn, tx); in ZTEST()
250 event_done(&conn); in ZTEST()
253 zassert_equal(conn.tx_q.pause_data, 1U, "Data tx is not paused"); in ZTEST()
258 event_prepare(&conn); in ZTEST()
262 lt_rx(LL_PHY_UPDATE_IND, &conn, &tx, &ind); in ZTEST()
263 lt_rx_q_is_empty(&conn); in ZTEST()
266 event_tx_ack(&conn, tx); in ZTEST()
269 event_done(&conn); in ZTEST()
272 zassert_equal(conn.tx_q.pause_data, 0U, "Data tx is paused"); in ZTEST()
279 ull_cp_release_tx(&conn, tx); in ZTEST()
282 while (!is_instant_reached(&conn, instant)) { in ZTEST()
284 event_prepare(&conn); in ZTEST()
287 lt_rx_q_is_empty(&conn); in ZTEST()
290 event_done(&conn); in ZTEST()
299 event_prepare(&conn); in ZTEST()
302 lt_rx_q_is_empty(&conn); in ZTEST()
305 event_done(&conn); in ZTEST()
339 test_set_role(&conn, BT_HCI_ROLE_CENTRAL); in ZTEST()
342 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
347 event_prepare(&conn); in ZTEST()
350 lt_tx(LL_PHY_REQ, &conn, &req_peripheral); in ZTEST()
353 event_done(&conn); in ZTEST()
358 err = ull_cp_phy_update(&conn, PHY_2M, PREFER_S8_CODING, PHY_2M, 1); in ZTEST()
364 event_prepare(&conn); in ZTEST()
367 lt_rx(LL_PHY_UPDATE_IND, &conn, &tx, &ind_1); in ZTEST()
368 lt_rx_q_is_empty(&conn); in ZTEST()
371 event_tx_ack(&conn, tx); in ZTEST()
374 event_done(&conn); in ZTEST()
381 ull_cp_release_tx(&conn, tx); in ZTEST()
384 while (!is_instant_reached(&conn, instant)) { in ZTEST()
386 event_prepare(&conn); in ZTEST()
389 lt_rx_q_is_empty(&conn); in ZTEST()
392 event_done(&conn); in ZTEST()
401 event_prepare(&conn); in ZTEST()
404 lt_rx_q_is_empty(&conn); in ZTEST()
407 event_done(&conn); in ZTEST()
410 event_prepare(&conn); in ZTEST()
413 lt_rx(LL_PHY_REQ, &conn, &tx, &req_central); in ZTEST()
414 lt_rx_q_is_empty(&conn); in ZTEST()
417 lt_tx(LL_PHY_RSP, &conn, &rsp); in ZTEST()
420 event_tx_ack(&conn, tx); in ZTEST()
423 event_done(&conn); in ZTEST()
426 ull_cp_release_tx(&conn, tx); in ZTEST()
436 event_prepare(&conn); in ZTEST()
439 lt_rx(LL_PHY_UPDATE_IND, &conn, &tx, &ind_2); in ZTEST()
440 lt_rx_q_is_empty(&conn); in ZTEST()
443 event_tx_ack(&conn, tx); in ZTEST()
446 event_done(&conn); in ZTEST()
453 ull_cp_release_tx(&conn, tx); in ZTEST()
456 while (!is_instant_reached(&conn, instant)) { in ZTEST()
458 event_prepare(&conn); in ZTEST()
461 lt_rx_q_is_empty(&conn); in ZTEST()
464 event_done(&conn); in ZTEST()
471 event_prepare(&conn); in ZTEST()
474 lt_rx_q_is_empty(&conn); in ZTEST()
477 event_done(&conn); in ZTEST()
511 test_set_role(&conn, BT_HCI_ROLE_PERIPHERAL); in ZTEST()
514 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
519 err = ull_cp_phy_update(&conn, PHY_2M, PREFER_S8_CODING, PHY_2M, 1); in ZTEST()
523 event_prepare(&conn); in ZTEST()
526 lt_rx(LL_PHY_REQ, &conn, &tx, &req_peripheral); in ZTEST()
527 lt_rx_q_is_empty(&conn); in ZTEST()
530 lt_tx(LL_PHY_REQ, &conn, &req_central); in ZTEST()
533 event_tx_ack(&conn, tx); in ZTEST()
536 event_done(&conn); in ZTEST()
539 ull_cp_release_tx(&conn, tx); in ZTEST()
542 event_prepare(&conn); in ZTEST()
545 lt_rx(LL_PHY_RSP, &conn, &tx, &rsp); in ZTEST()
546 lt_rx_q_is_empty(&conn); in ZTEST()
549 lt_tx(LL_REJECT_EXT_IND, &conn, &reject_ext_ind); in ZTEST()
552 event_done(&conn); in ZTEST()
555 event_prepare(&conn); in ZTEST()
558 event_done(&conn); in ZTEST()
569 event_prepare(&conn); in ZTEST()
572 ind.instant = instant = event_counter(&conn) + 6; in ZTEST()
573 lt_tx(LL_PHY_UPDATE_IND, &conn, &ind); in ZTEST()
576 event_tx_ack(&conn, tx); in ZTEST()
579 event_done(&conn); in ZTEST()
582 ull_cp_release_tx(&conn, tx); in ZTEST()
585 while (!is_instant_reached(&conn, instant)) { in ZTEST()
587 event_prepare(&conn); in ZTEST()
590 lt_rx_q_is_empty(&conn); in ZTEST()
593 event_done(&conn); in ZTEST()
600 event_prepare(&conn); in ZTEST()
603 lt_rx_q_is_empty(&conn); in ZTEST()
606 event_done(&conn); in ZTEST()
642 test_set_role(&conn, BT_HCI_ROLE_CENTRAL); in ZTEST()
645 conn.llcp.fex.valid = 1; in ZTEST()
648 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
652 err = ull_cp_phy_update(&conn, PHY_2M, PREFER_S8_CODING, PHY_2M, 1); in ZTEST()
656 event_prepare(&conn); in ZTEST()
659 lt_rx(LL_PHY_REQ, &conn, &tx, &req); in ZTEST()
660 lt_rx_q_is_empty(&conn); in ZTEST()
663 lt_tx(LL_CONNECTION_PARAM_REQ, &conn, req_B); in ZTEST()
665 event_tx_ack(&conn, tx); in ZTEST()
668 event_done(&conn); in ZTEST()
671 ull_cp_release_tx(&conn, tx); in ZTEST()
674 event_prepare(&conn); in ZTEST()
677 lt_rx(LL_REJECT_EXT_IND, &conn, &tx, &reject_ext_ind); in ZTEST()
678 lt_rx_q_is_empty(&conn); in ZTEST()
680 event_tx_ack(&conn, tx); in ZTEST()
683 event_done(&conn); in ZTEST()
686 ull_cp_release_tx(&conn, tx); in ZTEST()
691 event_prepare(&conn); in ZTEST()
694 lt_rx_q_is_empty(&conn); in ZTEST()
697 lt_tx(LL_PHY_RSP, &conn, &rsp); in ZTEST()
700 event_done(&conn); in ZTEST()
702 zassert_equal(conn.tx_q.pause_data, 1U, "Data tx is not paused"); in ZTEST()
706 event_prepare(&conn); in ZTEST()
709 lt_rx(LL_PHY_UPDATE_IND, &conn, &tx, &ind); in ZTEST()
710 lt_rx_q_is_empty(&conn); in ZTEST()
711 event_tx_ack(&conn, tx); in ZTEST()
714 event_done(&conn); in ZTEST()
721 ull_cp_release_tx(&conn, tx); in ZTEST()
724 while (!is_instant_reached(&conn, instant)) { in ZTEST()
726 event_prepare(&conn); in ZTEST()
729 lt_rx_q_is_empty(&conn); in ZTEST()
732 event_done(&conn); in ZTEST()
739 event_prepare(&conn); in ZTEST()
742 lt_rx_q_is_empty(&conn); in ZTEST()
745 event_done(&conn); in ZTEST()