Lines Matching refs:context
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()
186 struct eth_litex_dev_data *context = dev->data; in eth_set_config() local
191 memcpy(context->mac_addr, config->mac_address.addr, sizeof(context->mac_addr)); in eth_set_config()
192 ret = net_if_set_link_addr(context->iface, context->mac_addr, in eth_set_config()
193 sizeof(context->mac_addr), NET_LINK_ETHERNET); in eth_set_config()
235 struct eth_litex_dev_data *context = dev->data; in phy_link_state_changed() local
240 net_eth_carrier_on(context->iface); in phy_link_state_changed()
242 net_eth_carrier_off(context->iface); in phy_link_state_changed()
250 struct eth_litex_dev_data *context = port->data; in eth_iface_init() local
253 if (context->iface == NULL) { in eth_iface_init()
254 context->iface = iface; in eth_iface_init()
261 if (net_if_set_link_addr(iface, context->mac_addr, sizeof(context->mac_addr), in eth_iface_init()