Lines Matching full:conn

47 static struct ll_conn conn;  variable
51 test_setup(&conn); in chmu_setup()
54 static bool is_instant_reached(struct ll_conn *conn, uint16_t instant) in is_instant_reached() argument
56 return ((event_counter(conn) - instant) & 0xFFFF) <= 0x7FFF; in is_instant_reached()
73 memcpy(initial_chm, conn.lll.data_chan_map, sizeof(conn.lll.data_chan_map)); in ZTEST()
76 test_set_role(&conn, BT_HCI_ROLE_CENTRAL); in ZTEST()
79 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
81 err = ull_cp_chan_map_update(&conn, chm); in ZTEST()
85 event_prepare(&conn); in ZTEST()
88 lt_rx(LL_CHAN_MAP_UPDATE_IND, &conn, &tx, &chmu_ind); in ZTEST()
89 lt_rx_q_is_empty(&conn); in ZTEST()
92 event_done(&conn); in ZTEST()
99 ull_cp_release_tx(&conn, tx); in ZTEST()
101 /* spin conn events */ in ZTEST()
102 while (!is_instant_reached(&conn, instant)) { in ZTEST()
104 event_prepare(&conn); in ZTEST()
107 lt_rx_q_is_empty(&conn); in ZTEST()
110 event_done(&conn); in ZTEST()
116 zassert_mem_equal(conn.lll.data_chan_map, initial_chm, in ZTEST()
117 sizeof(conn.lll.data_chan_map), in ZTEST()
122 event_prepare(&conn); in ZTEST()
125 lt_rx_q_is_empty(&conn); in ZTEST()
128 event_done(&conn); in ZTEST()
134 zassert_mem_equal(conn.lll.data_chan_map, chm, sizeof(conn.lll.data_chan_map), in ZTEST()
155 test_set_role(&conn, BT_HCI_ROLE_CENTRAL); in ZTEST()
158 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
160 err = ull_cp_chan_map_update(&conn, chm); in ZTEST()
164 event_prepare(&conn); in ZTEST()
167 lt_rx(LL_CHAN_MAP_UPDATE_IND, &conn, &tx, &chmu_ind); in ZTEST()
168 lt_rx_q_is_empty(&conn); in ZTEST()
171 event_done(&conn); in ZTEST()
174 ull_cp_release_tx(&conn, tx); in ZTEST()
177 event_prepare(&conn); in ZTEST()
180 lt_rx_q_is_empty(&conn); in ZTEST()
183 event_done(&conn); in ZTEST()
190 event_prepare(&conn); in ZTEST()
193 lt_rx_q_is_empty(&conn); in ZTEST()
196 lt_tx(LL_UNKNOWN_RSP, &conn, &unknown_rsp); in ZTEST()
199 event_done(&conn); in ZTEST()
202 lt_rx_q_is_empty(&conn); in ZTEST()
205 zassert_equal(conn.llcp_terminate.reason_final, BT_HCI_ERR_LMP_PDU_NOT_ALLOWED, in ZTEST()
206 "Terminate reason %d", conn.llcp_terminate.reason_final); in ZTEST()
223 memcpy(initial_chm, conn.lll.data_chan_map, sizeof(conn.lll.data_chan_map)); in ZTEST()
226 test_set_role(&conn, BT_HCI_ROLE_PERIPHERAL); in ZTEST()
229 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
232 event_prepare(&conn); in ZTEST()
235 lt_rx_q_is_empty(&conn); in ZTEST()
238 lt_tx(LL_CHAN_MAP_UPDATE_IND, &conn, &chmu_ind); in ZTEST()
241 event_done(&conn); in ZTEST()
243 /* spin conn events */ in ZTEST()
244 while (!is_instant_reached(&conn, instant)) { in ZTEST()
246 event_prepare(&conn); in ZTEST()
249 lt_rx_q_is_empty(&conn); in ZTEST()
252 event_done(&conn); in ZTEST()
258 zassert_mem_equal(conn.lll.data_chan_map, initial_chm, in ZTEST()
259 sizeof(conn.lll.data_chan_map), in ZTEST()
264 event_prepare(&conn); in ZTEST()
267 lt_rx_q_is_empty(&conn); in ZTEST()
270 event_done(&conn); in ZTEST()
276 zassert_mem_equal(conn.lll.data_chan_map, chm, sizeof(conn.lll.data_chan_map), in ZTEST()
294 test_set_role(&conn, BT_HCI_ROLE_PERIPHERAL); in ZTEST()
297 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
300 event_prepare(&conn); in ZTEST()
303 lt_rx_q_is_empty(&conn); in ZTEST()
306 lt_tx(LL_CHAN_MAP_UPDATE_IND, &conn, &chmu_ind); in ZTEST()
309 event_done(&conn); in ZTEST()
315 event_prepare(&conn); in ZTEST()
317 event_done(&conn); in ZTEST()
320 event_prepare(&conn); in ZTEST()
323 lt_rx_q_is_empty(&conn); in ZTEST()
326 lt_tx(LL_UNKNOWN_RSP, &conn, &unknown_rsp); in ZTEST()
329 event_done(&conn); in ZTEST()
332 lt_rx_q_is_empty(&conn); in ZTEST()
335 zassert_equal(conn.llcp_terminate.reason_final, BT_HCI_ERR_LMP_PDU_NOT_ALLOWED, in ZTEST()
336 "Terminate reason %d", conn.llcp_terminate.reason_final); in ZTEST()
348 test_set_role(&conn, BT_HCI_ROLE_PERIPHERAL); in ZTEST()
351 ull_cp_state_set(&conn, ULL_CP_CONNECTED); in ZTEST()
353 err = ull_cp_chan_map_update(&conn, chm); in ZTEST()