/Zephyr-latest/drivers/i2c/ |
D | i2c_bitbang.c | 42 int i2c_bitbang_configure(struct i2c_bitbang *context, uint32_t dev_config) in i2c_bitbang_configure() argument 52 context->delays[T_LOW] = NS_TO_SYS_CLOCK_HW_CYCLES(4700); in i2c_bitbang_configure() 53 context->delays[T_HIGH] = NS_TO_SYS_CLOCK_HW_CYCLES(4000); in i2c_bitbang_configure() 56 context->delays[T_LOW] = NS_TO_SYS_CLOCK_HW_CYCLES(1300); in i2c_bitbang_configure() 57 context->delays[T_HIGH] = NS_TO_SYS_CLOCK_HW_CYCLES(600); in i2c_bitbang_configure() 63 context->dev_config = dev_config; in i2c_bitbang_configure() 68 int i2c_bitbang_get_config(struct i2c_bitbang *context, uint32_t *config) in i2c_bitbang_get_config() argument 70 if (context->dev_config == 0) { in i2c_bitbang_get_config() 74 *config = context->dev_config; in i2c_bitbang_get_config() 79 static void i2c_set_scl(struct i2c_bitbang *context, int state) in i2c_set_scl() argument [all …]
|
D | i2c_gpio.c | 84 struct i2c_gpio_context *context = dev->data; in i2c_gpio_configure() local 87 k_mutex_lock(&context->mutex, K_FOREVER); in i2c_gpio_configure() 89 rc = i2c_bitbang_configure(&context->bitbang, dev_config); in i2c_gpio_configure() 91 k_mutex_unlock(&context->mutex); in i2c_gpio_configure() 98 struct i2c_gpio_context *context = dev->data; in i2c_gpio_get_config() local 101 k_mutex_lock(&context->mutex, K_FOREVER); in i2c_gpio_get_config() 103 rc = i2c_bitbang_get_config(&context->bitbang, config); in i2c_gpio_get_config() 108 k_mutex_unlock(&context->mutex); in i2c_gpio_get_config() 116 struct i2c_gpio_context *context = dev->data; in i2c_gpio_transfer() local 119 k_mutex_lock(&context->mutex, K_FOREVER); in i2c_gpio_transfer() [all …]
|
D | i2c_sedi.c | 37 struct i2c_sedi_context *const context = dev->data; in i2c_sedi_api_configure() local 39 context->addr_10bit = (dev_config & I2C_ADDR_10_BITS) ? SEDI_I2C_ADDRESS_10BIT : 0; in i2c_sedi_api_configure() 53 k_mutex_lock(context->mutex, K_FOREVER); in i2c_sedi_api_configure() 54 ret = sedi_i2c_control(context->sedi_device, SEDI_I2C_BUS_SPEED, sedi_speed); in i2c_sedi_api_configure() 55 k_mutex_unlock(context->mutex); in i2c_sedi_api_configure() 68 struct i2c_sedi_context *context = dev->data; in i2c_sedi_api_full_io() local 75 k_mutex_lock(context->mutex, K_FOREVER); in i2c_sedi_api_full_io() 81 context->sedi_device, addr | context->addr_10bit, msgs[i].buf, in i2c_sedi_api_full_io() 85 context->sedi_device, addr | context->addr_10bit, msgs[i].buf, in i2c_sedi_api_full_io() 93 ret = k_sem_take(context->sem, K_MSEC(I2C_SEDI_TIMEOUT_MS)); in i2c_sedi_api_full_io() [all …]
|
D | i2c_sbcon.c | 88 struct i2c_sbcon_context *context = dev->data; in i2c_sbcon_configure() local 90 return i2c_bitbang_configure(&context->bitbang, dev_config); in i2c_sbcon_configure() 95 struct i2c_sbcon_context *context = dev->data; in i2c_sbcon_get_config() local 97 return i2c_bitbang_get_config(&context->bitbang, config); in i2c_sbcon_get_config() 103 struct i2c_sbcon_context *context = dev->data; in i2c_sbcon_transfer() local 105 return i2c_bitbang_transfer(&context->bitbang, msgs, num_msgs, in i2c_sbcon_transfer() 111 struct i2c_sbcon_context *context = dev->data; in i2c_sbcon_recover_bus() local 113 return i2c_bitbang_recover_bus(&context->bitbang); in i2c_sbcon_recover_bus() 128 struct i2c_sbcon_context *context = dev->data; in i2c_sbcon_init() local 132 i2c_bitbang_init(&context->bitbang, &io_fns, config->sbcon); in i2c_sbcon_init() [all …]
|
/Zephyr-latest/include/zephyr/net/ |
D | net_context.h | 99 typedef void (*net_context_recv_cb_t)(struct net_context *context, 120 typedef void (*net_context_send_cb_t)(struct net_context *context, 167 typedef void (*net_context_connect_cb_t)(struct net_context *context, 436 static inline bool net_context_is_used(struct net_context *context) in net_context_is_used() argument 438 NET_ASSERT(context); in net_context_is_used() 440 return context->flags & NET_CONTEXT_IN_USE; in net_context_is_used() 450 static inline bool net_context_is_bound_to_iface(struct net_context *context) in net_context_is_bound_to_iface() argument 452 NET_ASSERT(context); in net_context_is_bound_to_iface() 454 return context->flags & NET_CONTEXT_BOUND_TO_IFACE; in net_context_is_bound_to_iface() 464 static inline bool net_context_is_accepting(struct net_context *context) in net_context_is_accepting() argument [all …]
|
D | net_offload.h | 59 struct net_context **context); 64 int (*bind)(struct net_context *context, 72 int (*listen)(struct net_context *context, int backlog); 78 int (*connect)(struct net_context *context, 89 int (*accept)(struct net_context *context, 116 int (*recv)(struct net_context *context, 124 int (*put)(struct net_context *context); 148 struct net_context **context) in net_offload_get() argument 154 return net_if_offload(iface)->get(family, type, ip_proto, context); in net_offload_get() 171 struct net_context *context, in net_offload_bind() argument [all …]
|
/Zephyr-latest/subsys/net/ip/ |
D | net_context.c | 88 bool net_context_is_reuseaddr_set(struct net_context *context) in net_context_is_reuseaddr_set() argument 91 return context->options.reuseaddr; in net_context_is_reuseaddr_set() 97 bool net_context_is_reuseport_set(struct net_context *context) in net_context_is_reuseport_set() argument 100 return context->options.reuseport; in net_context_is_reuseport_set() 106 bool net_context_is_v6only_set(struct net_context *context) in net_context_is_v6only_set() argument 109 if (context == NULL) { in net_context_is_v6only_set() 113 return context->options.ipv6_v6only; in net_context_is_v6only_set() 115 ARG_UNUSED(context); in net_context_is_v6only_set() 121 bool net_context_is_recv_pktinfo_set(struct net_context *context) in net_context_is_recv_pktinfo_set() argument 124 return context->options.recv_pktinfo; in net_context_is_recv_pktinfo_set() [all …]
|
D | tcp_internal.h | 103 int net_tcp_get(struct net_context *context); 105 static inline int net_tcp_get(struct net_context *context) in net_tcp_get() argument 107 ARG_UNUSED(context); in net_tcp_get() 128 int net_tcp_connect(struct net_context *context, 137 static inline int net_tcp_connect(struct net_context *context, in net_tcp_connect() argument 144 ARG_UNUSED(context); in net_tcp_connect() 165 int net_tcp_listen(struct net_context *context); 167 static inline int net_tcp_listen(struct net_context *context) in net_tcp_listen() argument 169 ARG_UNUSED(context); in net_tcp_listen() 185 int net_tcp_accept(struct net_context *context, net_tcp_accept_cb_t cb, [all …]
|
D | tcp.h | 45 int net_tcp_get(struct net_context *context); 54 int net_tcp_put(struct net_context *context); 63 int net_tcp_listen(struct net_context *context); 74 int net_tcp_accept(struct net_context *context, net_tcp_accept_cb_t cb, 104 int net_tcp_update_recv_wnd(struct net_context *context, int32_t delta);
|
/Zephyr-latest/drivers/ethernet/nxp_enet/ |
D | eth_mcux.c | 241 static void eth_mcux_phy_enter_reset(struct eth_context *context); 242 void eth_mcux_phy_stop(struct eth_context *context); 340 static void eth_mcux_phy_enter_reset(struct eth_context *context) in eth_mcux_phy_enter_reset() argument 344 ENET_StartSMIWrite(context->base, context->phy_addr, in eth_mcux_phy_enter_reset() 349 context->phy_state = eth_mcux_phy_state_reset; in eth_mcux_phy_enter_reset() 351 k_work_submit(&context->phy_work); in eth_mcux_phy_enter_reset() 355 static void eth_mcux_phy_start(struct eth_context *context) in eth_mcux_phy_start() argument 358 LOG_DBG("%s phy_state=%s", eth_name(context->base), in eth_mcux_phy_start() 359 phy_state_name(context->phy_state)); in eth_mcux_phy_start() 362 context->enabled = true; in eth_mcux_phy_start() [all …]
|
/Zephyr-latest/subsys/net/l2/openthread/ |
D | openthread_utils.c | 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 [all …]
|
D | openthread_utils.h | 22 void add_ipv6_addr_to_zephyr(struct openthread_context *context); 23 void add_ipv6_addr_to_ot(struct openthread_context *context, 25 void add_ipv6_maddr_to_ot(struct openthread_context *context, 27 void add_ipv6_maddr_to_zephyr(struct openthread_context *context); 28 void rm_ipv6_addr_from_zephyr(struct openthread_context *context); 29 void rm_ipv6_maddr_from_zephyr(struct openthread_context *context); 31 int pkt_list_add(struct openthread_context *context, struct net_pkt *pkt); 32 struct net_pkt *pkt_list_peek(struct openthread_context *context); 33 void pkt_list_remove_last(struct openthread_context *context); 34 void pkt_list_remove_first(struct openthread_context *context); [all …]
|
/Zephyr-latest/tests/modules/thrift/ThriftTest/src/ |
D | client.cpp | 26 context.client->testVoid(); in ZTEST() 32 context.client->testString(s, "Test"); in ZTEST() 38 zassert_equal(false, context.client->testBool(false), ""); in ZTEST() 39 zassert_equal(true, context.client->testBool(true), ""); in ZTEST() 44 zassert_equal(0, context.client->testByte(0), ""); in ZTEST() 45 zassert_equal(-1, context.client->testByte(-1), ""); in ZTEST() 46 zassert_equal(42, context.client->testByte(42), ""); in ZTEST() 47 zassert_equal(-42, context.client->testByte(-42), ""); in ZTEST() 48 zassert_equal(127, context.client->testByte(127), ""); in ZTEST() 49 zassert_equal(-128, context.client->testByte(-128), ""); in ZTEST() [all …]
|
D | main.cpp | 28 ctx context; variable 43 context.server->serve(); in server_func() 64 std::shared_ptr<TTransport> trans(new TFDTransport(context.fds[ctx::CLIENT])); in setup_client() 73 trans = std::make_shared<TFDTransport>(context.fds[ctx::CLIENT]); in setup_client() 102 serverTransport = std::make_shared<TFDServer>(context.fds[ctx::SERVER]); in setup_server() 136 rv = socketpair(AF_UNIX, SOCK_STREAM, 0, &context.fds.front()); in thrift_test_before() 140 context.server = setup_server(); in thrift_test_before() 143 rv = pthread_create(&context.server_thread, attrp, server_func, nullptr); in thrift_test_before() 150 context.client = setup_client(); in thrift_test_before() 157 context.server->stop(); in thrift_test_after() [all …]
|
/Zephyr-latest/subsys/net/lib/lwm2m/ |
D | lwm2m_pull_context.c | 45 } context; variable 68 lwm2m_engine_stop(&context.firmware_ctx); in pull_service() 106 msg = lwm2m_get_message(&context.firmware_ctx); in transfer_request() 128 if (strncmp(context.uri, "http", 4) == 0) { in transfer_request() 130 } else if (strncmp(context.uri, "coap", 4) == 0) { in transfer_request() 145 ret = http_parser_parse_url(context.uri, strlen(context.uri), 0, &parser); in transfer_request() 147 LOG_ERR("Invalid firmware url: %s", context.uri); in transfer_request() 155 cursor = context.uri + off; in transfer_request() 190 ret = coap_packet_append_option(&msg->cpkt, COAP_OPTION_PROXY_URI, context.uri, in transfer_request() 191 strlen(context.uri)); in transfer_request() [all …]
|
/Zephyr-latest/tests/subsys/logging/log_backend_init/src/ |
D | main.c | 43 struct backend_context *context = (struct backend_context *)backend->cb->ctx; in backend_process() local 52 zassert_equal(strcmp(str, context->exp_str[context->cnt]), 0, in backend_process() 53 "Unexpected string %s (exp:%s)", str, context->exp_str[context->cnt]); in backend_process() 55 context->cnt++; in backend_process() 66 struct backend_context *context = (struct backend_context *)ctx; in expire_cb() local 68 context->active = true; in expire_cb() 73 struct backend_context *context = (struct backend_context *)backend->cb->ctx; in backend_init() local 75 k_timer_init(&context->timer, expire_cb, NULL); in backend_init() 76 k_timer_user_data_set(&context->timer, (void *)context); in backend_init() 77 k_timer_start(&context->timer, K_MSEC(context->delay), K_NO_WAIT); in backend_init() [all …]
|
/Zephyr-latest/subsys/net/lib/shell/ |
D | net_shell.c | 85 void get_addresses(struct net_context *context, in get_addresses() argument 89 if (IS_ENABLED(CONFIG_NET_IPV6) && context->local.family == AF_INET6) { in get_addresses() 92 net_sin6_ptr(&context->local)->sin6_addr), in get_addresses() 93 ntohs(net_sin6_ptr(&context->local)->sin6_port)); in get_addresses() 96 &net_sin6(&context->remote)->sin6_addr), in get_addresses() 97 ntohs(net_sin6(&context->remote)->sin6_port)); in get_addresses() 99 } else if (IS_ENABLED(CONFIG_NET_IPV4) && context->local.family == AF_INET) { in get_addresses() 102 net_sin_ptr(&context->local)->sin_addr), in get_addresses() 103 ntohs(net_sin_ptr(&context->local)->sin_port)); in get_addresses() 107 net_sin(&context->remote)->sin_family == AF_INET6 && in get_addresses() [all …]
|
/Zephyr-latest/samples/bluetooth/channel_sounding/src/ |
D | distance_estimation.c | 173 struct processing_context *context = (struct processing_context *)user_data; in process_step_data() local 179 if (context->local_steps) { in process_step_data() 180 for (uint8_t i = 0; i < (context->n_ap + 1); i++) { in process_step_data() 186 mode_2_data[context->mode_2_data_index].channel = step->channel; in process_step_data() 187 mode_2_data[context->mode_2_data_index].antenna_permutation = in process_step_data() 189 mode_2_data[context->mode_2_data_index].local_iq_sample = in process_step_data() 196 mode_2_data[context->mode_2_data_index].failed = true; in process_step_data() 199 context->mode_2_data_index++; in process_step_data() 202 for (uint8_t i = 0; i < (context->n_ap + 1); i++) { in process_step_data() 208 mode_2_data[context->mode_2_data_index].peer_iq_sample = in process_step_data() [all …]
|
/Zephyr-latest/drivers/ethernet/ |
D | eth_enc424j600.c | 223 struct enc424j600_runtime *context = in enc424j600_gpio_callback() local 226 k_sem_give(&context->int_sem); in enc424j600_gpio_callback() 310 struct enc424j600_runtime *context = dev->data; in enc424j600_tx() local 317 k_sem_take(&context->tx_rx_sem, K_FOREVER); in enc424j600_tx() 342 k_sem_give(&context->tx_rx_sem); in enc424j600_tx() 349 struct enc424j600_runtime *context = dev->data; in enc424j600_rx() local 358 k_sem_take(&context->tx_rx_sem, K_FOREVER); in enc424j600_rx() 361 context->next_pkt_ptr); in enc424j600_rx() 375 context->next_pkt_ptr = sys_get_le16(&info[0]); in enc424j600_rx() 379 context->next_pkt_ptr, frm_len, status); in enc424j600_rx() [all …]
|
D | eth_litex_liteeth.c | 59 struct eth_litex_dev_data *context = dev->data; in eth_initialize() local 68 gen_random_mac(context->mac_addr, 0x10, 0xe2, 0xd5); in eth_initialize() 78 struct eth_litex_dev_data *context = dev->data; in eth_tx() local 86 net_pkt_read(pkt, config->tx_buf[context->txslot], len); in eth_tx() 88 litex_write8(context->txslot, config->tx_slot_addr); in eth_tx() 103 context->txslot = (context->txslot + 1) % 2; in eth_tx() 117 struct eth_litex_dev_data *context = port->data; in eth_rx() local 125 if (!net_if_flag_is_set(context->iface, NET_IF_UP)) { in eth_rx() 138 pkt = net_pkt_rx_alloc_with_buffer(context->iface, len, AF_UNSPEC, 0, in eth_rx() 153 r = net_recv_data(context->iface, pkt); in eth_rx() [all …]
|
/Zephyr-latest/drivers/interrupt_controller/ |
D | intc_cavs.c | 29 struct cavs_registers *get_base_address(struct cavs_ictl_runtime *context) in get_base_address() argument 32 return UINT_TO_POINTER(context->base_addr + in get_base_address() 35 return UINT_TO_POINTER(context->base_addr); in get_base_address() 56 struct cavs_ictl_runtime *context = port->data; in cavs_ictl_isr() local 60 volatile struct cavs_registers * const regs = get_base_address(context); in cavs_ictl_isr() 69 struct cavs_ictl_runtime *context = dev->data; in cavs_ictl_irq_enable() local 71 volatile struct cavs_registers * const regs = get_base_address(context); in cavs_ictl_irq_enable() 79 struct cavs_ictl_runtime *context = dev->data; in cavs_ictl_irq_disable() local 81 volatile struct cavs_registers * const regs = get_base_address(context); in cavs_ictl_irq_disable() 88 struct cavs_ictl_runtime *context = dev->data; in cavs_ictl_irq_get_state() local [all …]
|
/Zephyr-latest/drivers/wifi/eswifi/ |
D | eswifi_offload.c | 23 static int eswifi_off_bind(struct net_context *context, in eswifi_off_bind() argument 27 struct eswifi_off_socket *socket = context->offload_context; in eswifi_off_bind() 28 struct eswifi_dev *eswifi = eswifi_by_iface_idx(context->iface); in eswifi_off_bind() 39 static int eswifi_off_listen(struct net_context *context, int backlog) in eswifi_off_listen() argument 41 struct eswifi_off_socket *socket = context->offload_context; in eswifi_off_listen() 42 struct eswifi_dev *eswifi = eswifi_by_iface_idx(context->iface); in eswifi_off_listen() 70 struct net_context *context; in eswifi_off_connect_work() local 81 context = socket->context; in eswifi_off_connect_work() 87 net_context_set_state(socket->context, NET_CONTEXT_CONNECTED); in eswifi_off_connect_work() 95 cb(context, err, user_data); in eswifi_off_connect_work() [all …]
|
/Zephyr-latest/drivers/gpio/ |
D | gpio_mmio32.c | 36 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_config() local 37 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_config() 68 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_get_raw() local 69 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_get_raw() 80 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_set_masked_raw() local 81 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_set_masked_raw() 99 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_set_bits_raw() local 100 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_set_bits_raw() 117 struct gpio_mmio32_context *context = dev->data; in gpio_mmio32_port_clear_bits_raw() local 118 const struct gpio_mmio32_config *config = context->config; in gpio_mmio32_port_clear_bits_raw() [all …]
|
/Zephyr-latest/subsys/net/lib/sockets/ |
D | sockets_tls.c | 665 static void tls_session_store(struct tls_context *context, in tls_session_store() argument 673 if (!context->options.cache_enabled) { in tls_session_store() 680 ret = mbedtls_ssl_get_session(&context->ssl, &session); in tls_session_store() 682 NET_ERR("Failed to obtain session for %p", context); in tls_session_store() 688 NET_ERR("Failed to save session for %p", context); in tls_session_store() 695 static void tls_session_restore(struct tls_context *context, in tls_session_restore() argument 703 if (!context->options.cache_enabled) { in tls_session_restore() 712 NET_DBG("Session not found for %p", context); in tls_session_restore() 716 ret = mbedtls_ssl_set_session(&context->ssl, &session); in tls_session_restore() 718 NET_ERR("Failed to set session for %p", context); in tls_session_restore() [all …]
|
/Zephyr-latest/subsys/net/conn_mgr/ |
D | conn_mgr_connectivity.c | 430 struct conn_mgr_conn_all_if_ctx *context = (struct conn_mgr_conn_all_if_ctx *)user_data; in conn_mgr_conn_all_if_cb() local 433 if (context->skip_ignored && conn_mgr_is_iface_ignored(iface)) { in conn_mgr_conn_all_if_cb() 438 switch (context->operation) { in conn_mgr_conn_all_if_cb() 477 if (context->status == 0) { in conn_mgr_conn_all_if_cb() 478 context->status = status; in conn_mgr_conn_all_if_cb() 482 context->operation == ALL_IF_UP ? "net_if_up" : in conn_mgr_conn_all_if_cb() 483 context->operation == ALL_IF_DOWN ? "net_if_down" : in conn_mgr_conn_all_if_cb() 484 context->operation == ALL_IF_CONNECT ? "conn_mgr_if_connect" : in conn_mgr_conn_all_if_cb() 485 context->operation == ALL_IF_DISCONNECT ? "conn_mgr_if_disconnect" : in conn_mgr_conn_all_if_cb() 493 struct conn_mgr_conn_all_if_ctx context = { in conn_mgr_all_if_up() local [all …]
|