Lines Matching full:context
29 static bool is_mesh_local(struct openthread_context *context, in is_mesh_local() argument
33 otThreadGetMeshLocalPrefix(context->instance); in is_mesh_local()
38 int pkt_list_add(struct openthread_context *context, struct net_pkt *pkt) in pkt_list_add() argument
40 uint16_t i_idx = context->pkt_list_in_idx; in pkt_list_add()
42 if (context->pkt_list_full) { in pkt_list_add()
51 if (i_idx == context->pkt_list_out_idx) { in pkt_list_add()
52 context->pkt_list_full = 1U; in pkt_list_add()
55 context->pkt_list[context->pkt_list_in_idx].pkt = pkt; in pkt_list_add()
56 context->pkt_list_in_idx = i_idx; in pkt_list_add()
61 void pkt_list_remove_first(struct openthread_context *context) in pkt_list_remove_first() argument
63 uint16_t idx = context->pkt_list_in_idx; in pkt_list_remove_first()
70 context->pkt_list_in_idx = idx; in pkt_list_remove_first()
72 if (context->pkt_list_full) { in pkt_list_remove_first()
73 context->pkt_list_full = 0U; in pkt_list_remove_first()
77 struct net_pkt *pkt_list_peek(struct openthread_context *context) in pkt_list_peek() argument
79 if ((context->pkt_list_in_idx == context->pkt_list_out_idx) && in pkt_list_peek()
80 (!context->pkt_list_full)) { in pkt_list_peek()
84 return context->pkt_list[context->pkt_list_out_idx].pkt; in pkt_list_peek()
87 void pkt_list_remove_last(struct openthread_context *context) in pkt_list_remove_last() argument
89 if ((context->pkt_list_in_idx == context->pkt_list_out_idx) && in pkt_list_remove_last()
90 (!context->pkt_list_full)) { in pkt_list_remove_last()
95 context->pkt_list_out_idx++; in pkt_list_remove_last()
96 if (context->pkt_list_out_idx == CONFIG_OPENTHREAD_PKT_LIST_SIZE) { in pkt_list_remove_last()
97 context->pkt_list_out_idx = 0U; in pkt_list_remove_last()
100 context->pkt_list_full = 0U; in pkt_list_remove_last()
103 void add_ipv6_addr_to_zephyr(struct openthread_context *context) in add_ipv6_addr_to_zephyr() argument
108 for (address = otIp6GetUnicastAddresses(context->instance); in add_ipv6_addr_to_zephyr()
130 context->iface, in add_ipv6_addr_to_zephyr()
136 context->iface, in add_ipv6_addr_to_zephyr()
142 context->iface, in add_ipv6_addr_to_zephyr()
156 context, address->mAddress.mFields.m8); in add_ipv6_addr_to_zephyr()
164 void add_ipv6_addr_to_ot(struct openthread_context *context, in add_ipv6_addr_to_ot() argument
175 ipv6 = context->iface->config.ip.ipv6; in add_ipv6_addr_to_ot()
199 context, ipv6->unicast[i].address.in6_addr.s6_addr); in add_ipv6_addr_to_ot()
216 openthread_api_mutex_lock(context); in add_ipv6_addr_to_ot()
217 otIp6AddUnicastAddress(context->instance, &addr); in add_ipv6_addr_to_ot()
218 openthread_api_mutex_unlock(context); in add_ipv6_addr_to_ot()
228 void add_ipv6_maddr_to_ot(struct openthread_context *context, in add_ipv6_maddr_to_ot() argument
235 openthread_api_mutex_lock(context); in add_ipv6_maddr_to_ot()
236 otIp6SubscribeMulticastAddress(context->instance, &addr); in add_ipv6_maddr_to_ot()
237 openthread_api_mutex_unlock(context); in add_ipv6_maddr_to_ot()
247 void add_ipv6_maddr_to_zephyr(struct openthread_context *context) in add_ipv6_maddr_to_zephyr() argument
252 for (maddress = otIp6GetMulticastAddresses(context->instance); in add_ipv6_maddr_to_zephyr()
256 &context->iface) != NULL) { in add_ipv6_maddr_to_zephyr()
270 zmaddr = net_if_ipv6_maddr_add(context->iface, in add_ipv6_maddr_to_zephyr()
280 net_if_ipv6_maddr_join(context->iface, zmaddr); in add_ipv6_maddr_to_zephyr()
285 void rm_ipv6_addr_from_zephyr(struct openthread_context *context) in rm_ipv6_addr_from_zephyr() argument
292 if (net_if_config_ipv6_get(context->iface, &ipv6) < 0) { in rm_ipv6_addr_from_zephyr()
306 for (address = otIp6GetUnicastAddresses(context->instance); in rm_ipv6_addr_from_zephyr()
327 net_if_ipv6_addr_rm(context->iface, in rm_ipv6_addr_from_zephyr()
333 void rm_ipv6_maddr_from_zephyr(struct openthread_context *context) in rm_ipv6_maddr_from_zephyr() argument
340 if (net_if_config_ipv6_get(context->iface, &ipv6) < 0) { in rm_ipv6_maddr_from_zephyr()
354 for (maddress = otIp6GetMulticastAddresses(context->instance); in rm_ipv6_maddr_from_zephyr()
375 net_if_ipv6_maddr_rm(context->iface, in rm_ipv6_maddr_from_zephyr()