@@ -58,11 +58,16 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
5858		      uint8_t  packing , uint8_t  framing , uint8_t  encryption ,
5959		      uint8_t  * bcode )
6060{
61+ 	uint8_t  field_data [1  +  sizeof (uint8_t  * )];
62+ 	struct  ull_adv_ext_hdr_data  hdr_data ;
63+ 	void  * extra_data_prev , * extra_data ;
6164	struct  lll_adv_sync  * lll_adv_sync ;
6265	struct  lll_adv_iso  * lll_adv_iso ;
66+ 	struct  pdu_adv  * pdu_prev , * pdu ;
6367	struct  node_rx_pdu  * node_rx ;
6468	struct  ll_adv_iso  * adv_iso ;
6569	struct  ll_adv_set  * adv ;
70+ 	uint8_t  ter_idx ;
6671	uint8_t  * acad ;
6772	uint8_t  err ;
6873
@@ -133,16 +138,29 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
133138		return  BT_HCI_ERR_MEM_CAPACITY_EXCEEDED ;
134139	}
135140
141+ 	/* Allocate next PDU */ 
142+ 	err  =  ull_adv_sync_pdu_alloc (adv , 0 , 0 , NULL , & pdu_prev , & pdu ,
143+ 				     & extra_data_prev , & extra_data , & ter_idx );
144+ 	if  (err ) {
145+ 		return  err ;
146+ 	}
147+ 
136148	/* Add ACAD to AUX_SYNC_IND */ 
137- 	err  =  ull_adv_sync_acad_enable (lll_adv_sync ,
138- 				       (sizeof (struct  pdu_big_info ) +  2 ),
139- 				       (void  * * )& acad );
149+ 	hdr_data .field_data  =  field_data ;
150+ 	field_data [0 ] =  sizeof (struct  pdu_big_info ) +  2 ;
151+ 	err  =  ull_adv_sync_pdu_set_clear (lll_adv_sync , pdu_prev , pdu ,
152+ 					 ULL_ADV_PDU_HDR_FIELD_ACAD , 0U ,
153+ 					 & hdr_data );
140154	if  (err ) {
141155		return  err ;
142156	}
157+ 
158+ 	memcpy (& acad , & field_data [1 ], sizeof (acad ));
143159	acad [0 ] =  sizeof (struct  pdu_big_info ) +  1 ;
144160	acad [1 ] =  BT_DATA_BIG_INFO ;
145161
162+ 	lll_adv_sync_data_enqueue (lll_adv_sync , ter_idx );
163+ 
146164	/* TODO: For now we can just use the unique BIG handle as the BIS 
147165	 * handle until we support multiple BIS 
148166	 */ 
@@ -209,11 +227,15 @@ uint8_t ll_big_test_create(uint8_t big_handle, uint8_t adv_handle,
209227
210228uint8_t  ll_big_terminate (uint8_t  big_handle , uint8_t  reason )
211229{
230+ 	void  * extra_data_prev , * extra_data ;
212231	struct  lll_adv_sync  * lll_adv_sync ;
213232	struct  lll_adv_iso  * lll_adv_iso ;
233+ 	struct  pdu_adv  * pdu_prev , * pdu ;
214234	struct  node_rx_pdu  * node_rx ;
215235	struct  ll_adv_iso  * adv_iso ;
216236	struct  lll_adv  * lll_adv ;
237+ 	struct  ll_adv_set  * adv ;
238+ 	uint8_t  ter_idx ;
217239	uint32_t  ret ;
218240	uint8_t  err ;
219241
@@ -229,13 +251,24 @@ uint8_t ll_big_terminate(uint8_t big_handle, uint8_t reason)
229251	}
230252
231253	lll_adv_sync  =  lll_adv -> sync ;
254+ 	adv  =  HDR_LLL2ULL (lll_adv );
255+ 
256+ 	/* Allocate next PDU */ 
257+ 	err  =  ull_adv_sync_pdu_alloc (adv , 0 , 0 , NULL , & pdu_prev , & pdu ,
258+ 				     & extra_data_prev , & extra_data , & ter_idx );
259+ 	if  (err ) {
260+ 		return  err ;
261+ 	}
232262
233263	/* Remove ACAD to AUX_SYNC_IND */ 
234- 	err  =  ull_adv_sync_acad_enable (lll_adv_sync , 0 , NULL );
264+ 	err  =  ull_adv_sync_pdu_set_clear (lll_adv_sync , pdu_prev , pdu ,
265+ 					 0U , ULL_ADV_PDU_HDR_FIELD_ACAD , NULL );
235266	if  (err ) {
236267		return  err ;
237268	}
238269
270+ 	lll_adv_sync_data_enqueue (lll_adv_sync , ter_idx );
271+ 
239272	/* TODO: Terminate all BIS data paths */ 
240273
241274	ret  =  ticker_stop (TICKER_INSTANCE_ID_CTLR , TICKER_USER_ID_ULL_HIGH ,
0 commit comments