Lines Matching refs:pdu
72 struct pdu_adv *pdu);
75 struct pdu_adv *pdu);
91 struct pdu_adv *pdu);
94 struct pdu_adv *pdu);
101 const struct pdu_adv *pdu);
118 static struct pdu_adv_sync_info *sync_info_get(struct pdu_adv *pdu);
135 struct pdu_adv *pdu_prev, *pdu; in ll_adv_sync_param_set() local
213 err = ull_adv_sync_pdu_alloc(adv, ULL_ADV_PDU_EXTRA_DATA_ALLOC_IF_EXIST, &pdu_prev, &pdu, in ll_adv_sync_param_set()
227 err = ull_adv_sync_duplicate(pdu_prev, pdu); in ll_adv_sync_param_set()
257 struct pdu_adv *pdu_prev, *pdu; in ll_adv_sync_ad_data_set() local
312 &pdu_prev, &pdu, &extra_data_prev, in ll_adv_sync_ad_data_set()
328 err = ull_adv_sync_update_adi(lll_sync, pdu_prev, pdu); in ll_adv_sync_ad_data_set()
332 err = ull_adv_sync_ad_replace(lll_sync, pdu_prev, pdu, data, len); in ll_adv_sync_ad_data_set()
334 err = ull_adv_sync_ad_add(lll_sync, pdu_prev, pdu, data, len); in ll_adv_sync_ad_data_set()
348 (pdu->len == pdu->adv_ext_ind.ext_hdr_len + 1U) || in ll_adv_sync_ad_data_set()
356 if (pdu_prev == pdu) { in ll_adv_sync_ad_data_set()
365 err = ull_adv_sync_time_update(sync, pdu); in ll_adv_sync_ad_data_set()
457 struct pdu_adv *pdu_prev, *pdu; in ll_adv_sync_enable() local
460 &pdu_prev, &pdu, &extra_data_prev, in ll_adv_sync_enable()
467 ter_pdu = pdu; in ll_adv_sync_enable()
478 ull_adv_sync_add_adi(lll_sync, pdu_prev, pdu); in ll_adv_sync_enable()
480 ull_adv_sync_remove_adi(lll_sync, pdu_prev, pdu); in ll_adv_sync_enable()
793 struct pdu_adv *pdu) in ull_adv_sync_evt_init() argument
801 if (!pdu) { in ull_adv_sync_evt_init()
802 pdu = lll_adv_sync_data_peek(&sync->lll, NULL); in ull_adv_sync_evt_init()
805 time_us = sync_time_get(sync, pdu); in ull_adv_sync_evt_init()
878 struct pdu_adv *pdu) in ull_adv_sync_time_update() argument
883 time_us = sync_time_get(sync, pdu); in ull_adv_sync_time_update()
939 struct pdu_adv *pdu; in ull_adv_sync_chm_complete() local
945 pdu = NULL; in ull_adv_sync_chm_complete()
949 &pdu_prev, &pdu, NULL, NULL, &ter_idx); in ull_adv_sync_chm_complete()
952 err = ull_adv_sync_remove_from_acad(lll_sync, pdu_prev, pdu, in ull_adv_sync_chm_complete()
995 void ull_adv_sync_pdu_init(struct pdu_adv *pdu, uint8_t ext_hdr_flags, in ull_adv_sync_pdu_init() argument
1008 pdu->type = PDU_ADV_TYPE_AUX_SYNC_IND; in ull_adv_sync_pdu_init()
1009 pdu->rfu = 0U; in ull_adv_sync_pdu_init()
1010 pdu->chan_sel = 0U; in ull_adv_sync_pdu_init()
1012 pdu->tx_addr = 0U; in ull_adv_sync_pdu_init()
1013 pdu->rx_addr = 0U; in ull_adv_sync_pdu_init()
1015 com_hdr = &pdu->adv_ext_ind; in ull_adv_sync_pdu_init()
1058 pdu->len = len; in ull_adv_sync_pdu_init()
1065 offs_us = PDU_AC_US(pdu->len, phy_s, phy_flags) + in ull_adv_sync_pdu_init()
1145 static void ull_adv_sync_add_to_header(struct pdu_adv *pdu, argument
1149 struct pdu_adv_com_ext_adv *hdr = &pdu->adv_ext_ind;
1182 if (pdu->len > hdr->ext_hdr_len + 1U) {
1183 if (pdu->len > PDU_AC_EXT_PAYLOAD_SIZE_MAX - delta) {
1187 *overflow_len = delta - (PDU_AC_EXT_PAYLOAD_SIZE_MAX - pdu->len);
1189 pdu->payload + PDU_AC_EXT_PAYLOAD_SIZE_MAX - *overflow_len,
1191 pdu->len -= *overflow_len;
1194 dptr = pdu->payload + hdr->ext_hdr_len + 1U;
1196 dptr, pdu->len - hdr->ext_hdr_len - 1U);
1199 pdu->len += delta;
1279 static void ull_adv_sync_remove_from_header(struct pdu_adv *pdu, argument
1283 struct pdu_adv_com_ext_adv *hdr = &pdu->adv_ext_ind;
1360 if (pdu->len > orig_hdr_len + 1U) {
1363 pdu->len - orig_hdr_len - 1U);
1367 pdu->len -= orig_hdr_len - hdr->ext_hdr_len;
1479 static void ull_adv_sync_update_pdu_adi(struct lll_adv_sync *lll_sync, struct pdu_adv *pdu, argument
1482 struct pdu_adv_com_ext_adv *hdr = &pdu->adv_ext_ind;
1510 static void ull_adv_sync_add_aux_ptr(struct pdu_adv *pdu, uint8_t *ad_overflow, argument
1516 ull_adv_sync_add_to_header(pdu, &fields, ad_overflow, overflow_len);
1519 static void ull_adv_sync_update_aux_ptr(struct lll_adv_sync *lll_sync, struct pdu_adv *pdu) argument
1521 struct pdu_adv_com_ext_adv *hdr = &pdu->adv_ext_ind;
1556 offs_us = PDU_AC_US(pdu->len, adv->lll.phy_s, adv->lll.phy_flags) + EVENT_SYNC_B2B_MAFS_US;
1569 static uint8_t ull_adv_sync_append_ad_data(struct lll_adv_sync *lll_sync, struct pdu_adv *pdu, argument
1583 ext_hdr_len = pdu->adv_ext_ind.ext_hdr_len + 1U;
1584 pdu_ad_len = pdu->len - ext_hdr_len;
1594 PDU_AC_EXT_PAYLOAD_SIZE_MAX - pdu->len < ad_len) {
1601 ull_adv_sync_add_aux_ptr(pdu, ad_overflow, &overflow_len);
1604 PDU_AC_EXT_PAYLOAD_SIZE_MAX - pdu->len));
1608 dptr = pdu->payload + pdu->len;
1614 pdu->len += overflow_len;
1622 pdu->len += pdu_add_len;
1632 ull_adv_sync_update_aux_ptr(lll_sync, pdu);
1643 ull_adv_sync_copy_pdu_header(pdu_chain, pdu, &skip_fields, true);
1646 lll_adv_pdu_linked_append(pdu_chain, pdu);
1648 pdu = pdu_chain;
1657 struct pdu_adv *pdu)
1659 if (pdu == pdu_prev) {
1664 pdu->type = pdu_prev->type;
1665 pdu->rfu = 0U;
1666 pdu->chan_sel = 0U;
1667 pdu->tx_addr = 0U;
1668 pdu->rx_addr = 0U;
1669 pdu->len = pdu_prev->len;
1672 memcpy(pdu->payload, pdu_prev->payload, pdu_prev->len);
1677 struct pdu_adv *pdu)
1680 if (pdu == pdu_prev) {
1688 ull_adv_sync_copy_pdu(pdu_prev, pdu);
1691 pdu_chain = lll_adv_pdu_linked_next_get(pdu);
1700 lll_adv_pdu_linked_append(pdu_chain, pdu);
1701 pdu = pdu_chain;
1842 struct pdu_adv *pdu) argument
1861 err = ull_adv_sync_duplicate_chain(pdu_prev, pdu);
1868 while (pdu) {
1869 last_pdu = pdu;
1874 ull_adv_sync_add_to_header(pdu, &add_fields,
1877 ull_adv_sync_update_pdu_adi(lll_sync, pdu, did);
1878 pdu = lll_adv_pdu_linked_next_get(pdu);
1879 if (pdu) {
1882 uint8_t pdu_avail = PDU_AC_EXT_PAYLOAD_SIZE_MAX - pdu->len;
1886 if (!pdu->adv_ext_ind.ext_hdr.adi) {
1889 if (pdu->adv_ext_ind.ext_hdr_len == 0U) {
1899 pdu->payload + (pdu->len - overflow_tmp_len),
1901 pdu->len -= overflow_tmp_len;
1905 dptr = pdu->payload + pdu->adv_ext_ind.ext_hdr_len + 1U;
1907 pdu->len - pdu->adv_ext_ind.ext_hdr_len - 1U +
1909 pdu->len += total_overflow_len;
1922 ull_adv_sync_append_ad_data(lll_sync, pdu, ad_overflow, total_overflow_len,
1927 if (pdu->len > PDU_AC_EXT_PAYLOAD_SIZE_MAX - sizeof(struct pdu_adv_adi)) {
1933 pdu->type = pdu_prev->type;
1934 pdu->rfu = 0U;
1935 pdu->chan_sel = 0U;
1936 pdu->tx_addr = 0U;
1937 pdu->rx_addr = 0U;
1938 pdu->len = pdu_prev->len;
1941 memcpy(pdu->payload, pdu_prev->payload, pdu_prev->len);
1944 ull_adv_sync_add_to_header(pdu, &add_fields, NULL, NULL);
1945 ull_adv_sync_update_pdu_adi(lll_sync, pdu, did);
1952 struct pdu_adv *pdu) argument
1962 err = ull_adv_sync_duplicate_chain(pdu_prev, pdu);
1968 while (pdu) {
1969 ull_adv_sync_remove_from_header(pdu, &remove_fields, false);
1970 if (pdu->adv_ext_ind.ext_hdr_len && pdu->adv_ext_ind.ext_hdr.aux_ptr) {
1971 ull_adv_sync_update_aux_ptr(lll_sync, pdu);
1973 pdu = lll_adv_pdu_linked_next_get(pdu);
1976 ull_adv_sync_remove_from_header(pdu, &remove_fields, false);
1983 uint8_t *ull_adv_sync_get_acad(struct pdu_adv *pdu, uint8_t *acad_len) argument
1985 struct pdu_adv_com_ext_adv *hdr = &pdu->adv_ext_ind;
2029 struct pdu_adv *pdu, argument
2040 err = ull_adv_sync_duplicate_chain(pdu_prev, pdu);
2045 ull_adv_sync_copy_pdu(pdu_prev, pdu);
2048 acad = ull_adv_sync_get_acad(pdu, &acad_len);
2078 (void)memmove(ad, ad + ad_len, pdu->len - ((ad + ad_len) - pdu->payload));
2081 pdu->len -= ad_len;
2082 pdu->adv_ext_ind.ext_hdr_len -= ad_len;
2089 struct pdu_adv *pdu, argument
2099 err = ull_adv_sync_duplicate_chain(pdu_prev, pdu);
2104 ull_adv_sync_copy_pdu(pdu_prev, pdu);
2108 if (pdu->adv_ext_ind.ext_hdr_len == 0U) {
2113 if (pdu->len > PDU_AC_EXT_PAYLOAD_SIZE_MAX - delta) {
2117 dptr = pdu->payload + pdu->adv_ext_ind.ext_hdr_len + 1U;
2120 ad_len = pdu->len - pdu->adv_ext_ind.ext_hdr_len - 1U;
2125 if (pdu->adv_ext_ind.ext_hdr_len == 0U) {
2135 pdu->len += delta;
2136 pdu->adv_ext_ind.ext_hdr_len += delta;
2142 static void ull_adv_sync_update_pdu_cteinfo(struct lll_adv_sync *lll_sync, struct pdu_adv *pdu, argument
2145 struct pdu_adv_com_ext_adv *hdr = &pdu->adv_ext_ind;
2164 struct pdu_adv *pdu, argument
2172 struct pdu_adv *last_pdu = pdu;
2180 err = ull_adv_sync_duplicate_chain(pdu_prev, pdu);
2187 while (pdu && cte_count) {
2188 last_pdu = pdu;
2193 ull_adv_sync_add_to_header(pdu, &add_fields,
2196 ull_adv_sync_update_pdu_cteinfo(lll_sync, pdu, cte_info);
2200 ull_adv_sync_update_aux_ptr(lll_sync, pdu);
2202 pdu = lll_adv_pdu_linked_next_get(pdu);
2203 if (pdu) {
2206 uint8_t pdu_avail = PDU_AC_EXT_PAYLOAD_SIZE_MAX - pdu->len;
2210 if (!pdu->adv_ext_ind.ext_hdr.cte_info) {
2213 if (pdu->adv_ext_ind.ext_hdr_len == 0U) {
2223 pdu->payload + (pdu->len - overflow_tmp_len),
2225 pdu->len -= overflow_tmp_len;
2229 dptr = pdu->payload + pdu->adv_ext_ind.ext_hdr_len + 1U;
2231 pdu->len - pdu->adv_ext_ind.ext_hdr_len - 1U +
2233 pdu->len += total_overflow_len;
2246 pdu = last_pdu;
2249 ull_adv_sync_append_ad_data(lll_sync, pdu, ad_overflow, total_overflow_len,
2269 lll_adv_pdu_linked_append(pdu_chain, pdu);
2272 ull_adv_sync_copy_pdu_header(pdu_chain, pdu, &skip_fields, true);
2275 ull_adv_sync_add_aux_ptr(pdu, ad_overflow, &overflow_len);
2276 ull_adv_sync_update_aux_ptr(lll_sync, pdu);
2283 pdu = pdu_chain;
2290 if (pdu->len > PDU_AC_EXT_PAYLOAD_SIZE_MAX - sizeof(struct pdu_cte_info)) {
2296 pdu->type = pdu_prev->type;
2297 pdu->rfu = 0U;
2298 pdu->chan_sel = 0U;
2299 pdu->tx_addr = 0U;
2300 pdu->rx_addr = 0U;
2301 pdu->len = pdu_prev->len;
2304 memcpy(pdu->payload, pdu_prev->payload, pdu_prev->len);
2307 ull_adv_sync_add_to_header(pdu, &add_fields, NULL, NULL);
2308 ull_adv_sync_update_pdu_cteinfo(lll_sync, pdu, cte_info);
2315 struct pdu_adv *pdu) argument
2325 err = ull_adv_sync_duplicate_chain(pdu_prev, pdu);
2331 while (pdu) {
2334 ull_adv_sync_remove_from_header(pdu, &remove_fields, false);
2336 if (pdu->adv_ext_ind.ext_hdr_len && pdu->adv_ext_ind.ext_hdr.aux_ptr) {
2337 ull_adv_sync_update_aux_ptr(lll_sync, pdu);
2340 pdu_chain = lll_adv_pdu_linked_next_get(pdu);
2348 ull_adv_sync_remove_from_header(pdu, &remove_fields, false);
2350 lll_adv_pdu_linked_append(NULL, pdu);
2354 pdu = pdu_chain;
2357 ull_adv_sync_remove_from_header(pdu, &remove_fields, false);
2466 const struct pdu_adv *pdu) argument
2476 len = pdu->len - pdu->adv_ext_ind.ext_hdr_len -
2550 struct pdu_adv *pdu; local
2575 &pdu_prev, &pdu, NULL, NULL, &ter_idx);
2591 err = ull_adv_sync_add_to_acad(lll_sync, pdu_prev, pdu, ad, sizeof(*chm_upd_ind) + 2U);
2626 void ull_adv_sync_lll_syncinfo_fill(struct pdu_adv *pdu, struct lll_adv_aux *lll_aux) argument
2634 si = sync_info_get(pdu);
2692 struct pdu_adv *pdu; local
2751 pdu = lll_adv_aux_data_latest_peek(adv->lll.aux);
2752 si = sync_info_get(pdu);
2812 static struct pdu_adv_sync_info *sync_info_get(struct pdu_adv *pdu) argument
2818 p = (void *)&pdu->adv_ext_ind;