Lines Matching +full:discard +full:- +full:rx +full:- +full:fcs

5  * SPDX-License-Identifier: Apache-2.0
43 struct eth_stellaris_runtime *dev_data = dev->data; in eth_stellaris_flush()
45 if (dev_data->tx_pos != 0) { in eth_stellaris_flush()
46 sys_write32(dev_data->tx_word, REG_MACDATA); in eth_stellaris_flush()
47 dev_data->tx_pos = 0; in eth_stellaris_flush()
48 dev_data->tx_word = 0U; in eth_stellaris_flush()
54 struct eth_stellaris_runtime *dev_data = dev->data; in eth_stellaris_send_byte()
56 dev_data->tx_word |= byte << (dev_data->tx_pos * 8); in eth_stellaris_send_byte()
57 dev_data->tx_pos++; in eth_stellaris_send_byte()
58 if (dev_data->tx_pos == 4) { in eth_stellaris_send_byte()
59 sys_write32(dev_data->tx_word, REG_MACDATA); in eth_stellaris_send_byte()
60 dev_data->tx_pos = 0; in eth_stellaris_send_byte()
61 dev_data->tx_word = 0U; in eth_stellaris_send_byte()
67 struct eth_stellaris_runtime *dev_data = dev->data; in eth_stellaris_send()
76 data_len = net_pkt_get_len(pkt) - sizeof(struct net_eth_hdr); in eth_stellaris_send()
81 for (frag = pkt->frags; frag; frag = frag->frags) { in eth_stellaris_send()
82 for (i = 0U; i < frag->len; ++i) { in eth_stellaris_send()
83 eth_stellaris_send_byte(dev, frag->data[i]); in eth_stellaris_send()
94 k_sem_take(&dev_data->tx_sem, K_FOREVER); in eth_stellaris_send()
96 if (dev_data->tx_err) { in eth_stellaris_send()
97 dev_data->tx_err = false; in eth_stellaris_send()
98 return -EIO; in eth_stellaris_send()
136 * +---------+---- ... -------+ in eth_stellaris_rx_pkt()
138 * +---------+---- ... -------+ in eth_stellaris_rx_pkt()
165 bytes_left = frame_len - 4; in eth_stellaris_rx_pkt()
167 /* Read the rest of words, minus the partial word and FCS byte. */ in eth_stellaris_rx_pkt()
168 for (; bytes_left > 7; bytes_left -= 4) { in eth_stellaris_rx_pkt()
177 /* Handle the last partial word and discard the 4 Byte FCS. */ in eth_stellaris_rx_pkt()
182 /* Discard the last FCS word. */ in eth_stellaris_rx_pkt()
188 count = bytes_left - 4; in eth_stellaris_rx_pkt()
194 bytes_left -= 4; in eth_stellaris_rx_pkt()
207 struct eth_stellaris_runtime *dev_data = dev->data; in eth_stellaris_rx()
208 struct net_if *iface = dev_data->iface; in eth_stellaris_rx()
218 LOG_ERR("Failed to place frame in RX Queue"); in eth_stellaris_rx()
229 return -EIO; in eth_stellaris_rx()
234 struct eth_stellaris_runtime *dev_data = dev->data; in eth_stellaris_isr()
260 dev_data->tx_err = false; in eth_stellaris_isr()
261 k_sem_give(&dev_data->tx_sem); in eth_stellaris_isr()
266 eth_stats_update_errors_tx(dev_data->iface); in eth_stellaris_isr()
267 dev_data->tx_err = true; in eth_stellaris_isr()
268 k_sem_give(&dev_data->tx_sem); in eth_stellaris_isr()
273 eth_stellaris_rx_error(dev_data->iface); in eth_stellaris_isr()
277 LOG_ERR("Error Rx Overrun"); in eth_stellaris_isr()
278 eth_stellaris_rx_error(dev_data->iface); in eth_stellaris_isr()
287 const struct eth_stellaris_config *dev_conf = dev->config; in eth_stellaris_init()
288 struct eth_stellaris_runtime *dev_data = dev->data; in eth_stellaris_init()
290 dev_data->iface = iface; in eth_stellaris_init()
294 dev_data->mac_addr, 6, NET_LINK_ETHERNET); in eth_stellaris_init()
299 k_sem_init(&dev_data->tx_sem, 0, 1); in eth_stellaris_init()
302 dev_conf->config_func(dev); in eth_stellaris_init()
308 struct eth_stellaris_runtime *dev_data = dev->data; in eth_stellaris_stats()
310 return &dev_data->stats; in eth_stellaris_stats()