Lines Matching refs:adv

92 	struct bt_mesh_adv *adv;  in adv_create_from_pool()  local
100 err = k_mem_slab_alloc(buf_pool, (void **)&adv, timeout); in adv_create_from_pool()
105 adv->__ref = 1; in adv_create_from_pool()
107 net_buf_simple_init_with_data(&adv->b, adv->__bufs, BT_MESH_ADV_DATA_SIZE); in adv_create_from_pool()
108 net_buf_simple_reset(&adv->b); in adv_create_from_pool()
110 ctx = &adv->ctx; in adv_create_from_pool()
118 return adv; in adv_create_from_pool()
121 struct bt_mesh_adv *bt_mesh_adv_ref(struct bt_mesh_adv *adv) in bt_mesh_adv_ref() argument
123 __ASSERT_NO_MSG(adv->__ref < UINT8_MAX); in bt_mesh_adv_ref()
125 adv->__ref++; in bt_mesh_adv_ref()
127 return adv; in bt_mesh_adv_ref()
130 void bt_mesh_adv_unref(struct bt_mesh_adv *adv) in bt_mesh_adv_unref() argument
132 __ASSERT_NO_MSG(adv->__ref > 0); in bt_mesh_adv_unref()
134 if (--adv->__ref > 0) { in bt_mesh_adv_unref()
141 if (adv->ctx.tag == BT_MESH_ADV_TAG_RELAY) { in bt_mesh_adv_unref()
147 if (adv->ctx.tag == BT_MESH_ADV_TAG_FRIEND) { in bt_mesh_adv_unref()
152 k_mem_slab_free(slab, (void *)adv); in bt_mesh_adv_unref()
259 void bt_mesh_adv_send(struct bt_mesh_adv *adv, const struct bt_mesh_send_cb *cb, in bt_mesh_adv_send() argument
262 LOG_DBG("type 0x%02x len %u: %s", adv->ctx.type, adv->b.len, in bt_mesh_adv_send()
263 bt_hex(adv->b.data, adv->b.len)); in bt_mesh_adv_send()
269 adv->ctx.cb = cb; in bt_mesh_adv_send()
270 adv->ctx.cb_data = cb_data; in bt_mesh_adv_send()
271 adv->ctx.busy = 1U; in bt_mesh_adv_send()
274 bt_mesh_stat_planned_count(&adv->ctx); in bt_mesh_adv_send()
278 adv->ctx.tag == BT_MESH_ADV_TAG_FRIEND) { in bt_mesh_adv_send()
279 k_fifo_put(&bt_mesh_friend_queue, bt_mesh_adv_ref(adv)); in bt_mesh_adv_send()
285 adv->ctx.tag == BT_MESH_ADV_TAG_RELAY) || in bt_mesh_adv_send()
287 adv->ctx.tag == BT_MESH_ADV_TAG_PROV)) { in bt_mesh_adv_send()
288 k_fifo_put(&bt_mesh_relay_queue, bt_mesh_adv_ref(adv)); in bt_mesh_adv_send()
293 k_fifo_put(&bt_mesh_adv_queue, bt_mesh_adv_ref(adv)); in bt_mesh_adv_send()