Lines Matching full:context
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()
384 eth_stats_update_errors_rx(context->iface); in enc424j600_rx()
389 pkt = net_pkt_rx_alloc_with_buffer(context->iface, frm_len, in enc424j600_rx()
394 eth_stats_update_errors_rx(context->iface); in enc424j600_rx()
426 if (net_recv_data(context->iface, pkt) < 0) { in enc424j600_rx()
431 if (context->next_pkt_ptr == ENC424J600_RXSTART) { in enc424j600_rx()
435 tmp = context->next_pkt_ptr - 2; in enc424j600_rx()
440 k_sem_give(&context->tx_rx_sem); in enc424j600_rx()
450 struct enc424j600_runtime *context = p1; in enc424j600_rx_thread() local
456 k_sem_take(&context->int_sem, K_FOREVER); in enc424j600_rx_thread()
458 enc424j600_write_sbc(context->dev, ENC424J600_1BC_CLREIE); in enc424j600_rx_thread()
459 enc424j600_read_sfru(context->dev, ENC424J600_SFRX_EIRL, &eir); in enc424j600_rx_thread()
460 enc424j600_read_sfru(context->dev, in enc424j600_rx_thread()
467 enc424j600_rx(context->dev); in enc424j600_rx_thread()
468 enc424j600_read_sfru(context->dev, in enc424j600_rx_thread()
475 enc424j600_clear_sfru(context->dev, in enc424j600_rx_thread()
480 enc424j600_setup_mac(context->dev); in enc424j600_rx_thread()
481 net_eth_carrier_on(context->iface); in enc424j600_rx_thread()
485 if (context->iface_initialized) { in enc424j600_rx_thread()
486 net_eth_carrier_off(context->iface); in enc424j600_rx_thread()
500 enc424j600_write_sbc(context->dev, ENC424J600_1BC_SETEIE); in enc424j600_rx_thread()
510 struct enc424j600_runtime *context = dev->data; in enc424j600_get_config() local
518 k_sem_take(&context->tx_rx_sem, K_FOREVER); in enc424j600_get_config()
547 k_sem_give(&context->tx_rx_sem); in enc424j600_get_config()
596 struct enc424j600_runtime *context = dev->data; in enc424j600_iface_init() local
598 net_if_set_link_addr(iface, context->mac_address, in enc424j600_iface_init()
599 sizeof(context->mac_address), in enc424j600_iface_init()
601 context->iface = iface; in enc424j600_iface_init()
605 context->iface_initialized = true; in enc424j600_iface_init()
610 struct enc424j600_runtime *context = dev->data; in enc424j600_start_device() local
613 if (!context->suspended) { in enc424j600_start_device()
618 k_sem_take(&context->tx_rx_sem, K_FOREVER); in enc424j600_start_device()
631 context->suspended = false; in enc424j600_start_device()
632 k_sem_give(&context->tx_rx_sem); in enc424j600_start_device()
640 struct enc424j600_runtime *context = dev->data; in enc424j600_stop_device() local
643 if (context->suspended) { in enc424j600_stop_device()
648 k_sem_take(&context->tx_rx_sem, K_FOREVER); in enc424j600_stop_device()
671 context->suspended = true; in enc424j600_stop_device()
672 k_sem_give(&context->tx_rx_sem); in enc424j600_stop_device()
691 struct enc424j600_runtime *context = dev->data; in enc424j600_init() local
695 context->dev = dev; in enc424j600_init()
715 gpio_init_callback(&(context->gpio_cb), enc424j600_gpio_callback, in enc424j600_init()
718 if (gpio_add_callback(config->interrupt.port, &(context->gpio_cb))) { in enc424j600_init()
775 context->next_pkt_ptr = ENC424J600_RXSTART; in enc424j600_init()
785 context->mac_address[0] = tmp; in enc424j600_init()
786 context->mac_address[1] = tmp >> 8; in enc424j600_init()
789 context->mac_address[2] = tmp; in enc424j600_init()
790 context->mac_address[3] = tmp >> 8; in enc424j600_init()
793 context->mac_address[4] = tmp; in enc424j600_init()
794 context->mac_address[5] = tmp >> 8; in enc424j600_init()
807 k_thread_create(&context->thread, context->thread_stack, in enc424j600_init()
810 context, NULL, NULL, in enc424j600_init()
816 context->suspended = false; in enc424j600_init()