Lines Matching +full:apb3 +full:- +full:bus

9  * Copyright (c) 2014-2016 Advanced Micro Devices, Inc.
59 * Copyright (c) 2014-2016 Advanced Micro Devices, Inc.
125 #include "xgbe-common.h"
129 return pdata->netdev->mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; in xgbe_get_max_frame()
138 DBGPR("-->xgbe_usec_to_riwt\n"); in xgbe_usec_to_riwt()
140 rate = pdata->sysclk_rate; in xgbe_usec_to_riwt()
150 DBGPR("<--xgbe_usec_to_riwt\n"); in xgbe_usec_to_riwt()
161 DBGPR("-->xgbe_riwt_to_usec\n"); in xgbe_riwt_to_usec()
163 rate = pdata->sysclk_rate; in xgbe_riwt_to_usec()
173 DBGPR("<--xgbe_riwt_to_usec\n"); in xgbe_riwt_to_usec()
184 pbl = pdata->pbl; in xgbe_config_pbl_val()
186 if (pdata->pbl > 32) { in xgbe_config_pbl_val()
191 for (i = 0; i < pdata->channel_count; i++) { in xgbe_config_pbl_val()
192 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_CR, PBLX8, in xgbe_config_pbl_val()
195 if (pdata->channel[i]->tx_ring) in xgbe_config_pbl_val()
196 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_TCR, in xgbe_config_pbl_val()
199 if (pdata->channel[i]->rx_ring) in xgbe_config_pbl_val()
200 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_RCR, in xgbe_config_pbl_val()
211 for (i = 0; i < pdata->channel_count; i++) { in xgbe_config_osp_mode()
212 if (!pdata->channel[i]->tx_ring) in xgbe_config_osp_mode()
215 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_TCR, OSP, in xgbe_config_osp_mode()
216 pdata->tx_osp_mode); in xgbe_config_osp_mode()
226 for (i = 0; i < pdata->rx_q_count; i++) in xgbe_config_rsf_mode()
236 for (i = 0; i < pdata->tx_q_count; i++) in xgbe_config_tsf_mode()
247 for (i = 0; i < pdata->rx_q_count; i++) in xgbe_config_rx_threshold()
258 for (i = 0; i < pdata->tx_q_count; i++) in xgbe_config_tx_threshold()
268 for (i = 0; i < pdata->channel_count; i++) { in xgbe_config_rx_coalesce()
269 if (!pdata->channel[i]->rx_ring) in xgbe_config_rx_coalesce()
272 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_RIWT, RWT, in xgbe_config_rx_coalesce()
273 pdata->rx_riwt); in xgbe_config_rx_coalesce()
288 for (i = 0; i < pdata->channel_count; i++) { in xgbe_config_rx_buffer_size()
289 if (!pdata->channel[i]->rx_ring) in xgbe_config_rx_buffer_size()
292 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_RCR, RBSZ, in xgbe_config_rx_buffer_size()
293 pdata->rx_buf_size); in xgbe_config_rx_buffer_size()
301 for (i = 0; i < pdata->channel_count; i++) { in xgbe_config_tso_mode()
302 if (!pdata->channel[i]->tx_ring) in xgbe_config_tso_mode()
305 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_TCR, TSE, 1); in xgbe_config_tso_mode()
313 for (i = 0; i < pdata->channel_count; i++) { in xgbe_config_sph_mode()
314 if (!pdata->channel[i]->rx_ring) in xgbe_config_sph_mode()
317 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_CR, SPH, 1); in xgbe_config_sph_mode()
329 mutex_lock(&pdata->rss_mutex); in xgbe_write_rss_reg()
332 ret = -EBUSY; in xgbe_write_rss_reg()
344 while (wait--) { in xgbe_write_rss_reg()
351 ret = -EBUSY; in xgbe_write_rss_reg()
354 mutex_unlock(&pdata->rss_mutex); in xgbe_write_rss_reg()
361 unsigned int key_regs = sizeof(pdata->rss_key) / sizeof(u32); in xgbe_write_rss_hash_key()
362 unsigned int *key = (unsigned int *)&pdata->rss_key; in xgbe_write_rss_hash_key()
365 while (key_regs--) { in xgbe_write_rss_hash_key()
380 for (i = 0; i < ARRAY_SIZE(pdata->rss_table); i++) { in xgbe_write_rss_lookup_table()
383 pdata->rss_table[i]); in xgbe_write_rss_lookup_table()
393 memcpy(pdata->rss_key, key, sizeof(pdata->rss_key)); in xgbe_set_rss_hash_key()
403 for (i = 0; i < ARRAY_SIZE(pdata->rss_table); i++) in xgbe_set_rss_lookup_table()
404 XGMAC_SET_BITS(pdata->rss_table[i], MAC_RSSDR, DMCH, table[i]); in xgbe_set_rss_lookup_table()
413 if (!pdata->hw_feat.rss) in xgbe_enable_rss()
414 return -EOPNOTSUPP; in xgbe_enable_rss()
427 XGMAC_IOWRITE(pdata, MAC_RSSCR, pdata->rss_options); in xgbe_enable_rss()
437 if (!pdata->hw_feat.rss) in xgbe_disable_rss()
438 return -EOPNOTSUPP; in xgbe_disable_rss()
449 if (!pdata->hw_feat.rss) in xgbe_config_rss()
452 if (pdata->netdev->features & NETIF_F_RXHASH) in xgbe_config_rss()
458 netdev_err(pdata->netdev, in xgbe_config_rss()
469 if (pdata->prio2q_map[prio] != queue) in xgbe_is_pfc_queue()
473 tc = pdata->ets->prio_tc[prio]; in xgbe_is_pfc_queue()
476 if (pdata->pfc->pfc_en & (1 << tc)) in xgbe_is_pfc_queue()
486 XGMAC_IOWRITE_BITS(pdata, MAC_TIR, TNID, pdata->vxlan_port); in xgbe_set_vxlan_id()
488 netif_dbg(pdata, drv, pdata->netdev, "VXLAN tunnel id set to %hx\n", in xgbe_set_vxlan_id()
489 pdata->vxlan_port); in xgbe_set_vxlan_id()
494 if (!pdata->hw_feat.vxn) in xgbe_enable_vxlan()
500 /* Allow for IPv6/UDP zero-checksum VXLAN packets */ in xgbe_enable_vxlan()
507 netif_dbg(pdata, drv, pdata->netdev, "VXLAN acceleration enabled\n"); in xgbe_enable_vxlan()
512 if (!pdata->hw_feat.vxn) in xgbe_disable_vxlan()
518 /* Clear IPv6/UDP zero-checksum VXLAN packets setting */ in xgbe_disable_vxlan()
524 netif_dbg(pdata, drv, pdata->netdev, "VXLAN acceleration disabled\n"); in xgbe_disable_vxlan()
532 if (XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER) >= 0x30) in xgbe_get_fc_queue_count()
535 return min_t(unsigned int, pdata->tx_q_count, max_q_count); in xgbe_get_fc_queue_count()
544 for (i = 0; i < pdata->rx_q_count; i++) in xgbe_disable_tx_flow_control()
563 struct ieee_pfc *pfc = pdata->pfc; in xgbe_enable_tx_flow_control()
564 struct ieee_ets *ets = pdata->ets; in xgbe_enable_tx_flow_control()
569 for (i = 0; i < pdata->rx_q_count; i++) { in xgbe_enable_tx_flow_control()
572 if (pdata->rx_rfd[i]) { in xgbe_enable_tx_flow_control()
584 netif_dbg(pdata, drv, pdata->netdev, in xgbe_enable_tx_flow_control()
624 struct ieee_pfc *pfc = pdata->pfc; in xgbe_config_tx_flow_control()
626 if (pdata->tx_pause || (pfc && pfc->pfc_en)) in xgbe_config_tx_flow_control()
636 struct ieee_pfc *pfc = pdata->pfc; in xgbe_config_rx_flow_control()
638 if (pdata->rx_pause || (pfc && pfc->pfc_en)) in xgbe_config_rx_flow_control()
648 struct ieee_pfc *pfc = pdata->pfc; in xgbe_config_flow_control()
654 (pfc && pfc->pfc_en) ? 1 : 0); in xgbe_config_flow_control()
663 if (pdata->channel_irq_mode) in xgbe_enable_dma_interrupts()
665 pdata->channel_irq_mode); in xgbe_enable_dma_interrupts()
667 ver = XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER); in xgbe_enable_dma_interrupts()
669 for (i = 0; i < pdata->channel_count; i++) { in xgbe_enable_dma_interrupts()
670 channel = pdata->channel[i]; in xgbe_enable_dma_interrupts()
677 channel->curr_ier = 0; in xgbe_enable_dma_interrupts()
680 * NIE - Normal Interrupt Summary Enable in xgbe_enable_dma_interrupts()
681 * AIE - Abnormal Interrupt Summary Enable in xgbe_enable_dma_interrupts()
682 * FBEE - Fatal Bus Error Enable in xgbe_enable_dma_interrupts()
685 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE20, 1); in xgbe_enable_dma_interrupts()
686 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE20, 1); in xgbe_enable_dma_interrupts()
688 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE, 1); in xgbe_enable_dma_interrupts()
689 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE, 1); in xgbe_enable_dma_interrupts()
691 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, FBEE, 1); in xgbe_enable_dma_interrupts()
693 if (channel->tx_ring) { in xgbe_enable_dma_interrupts()
695 * TIE - Transmit Interrupt Enable (unless using in xgbe_enable_dma_interrupts()
699 if (!pdata->per_channel_irq || pdata->channel_irq_mode) in xgbe_enable_dma_interrupts()
700 XGMAC_SET_BITS(channel->curr_ier, in xgbe_enable_dma_interrupts()
703 if (channel->rx_ring) { in xgbe_enable_dma_interrupts()
705 * RBUE - Receive Buffer Unavailable Enable in xgbe_enable_dma_interrupts()
706 * RIE - Receive Interrupt Enable (unless using in xgbe_enable_dma_interrupts()
710 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RBUE, 1); in xgbe_enable_dma_interrupts()
711 if (!pdata->per_channel_irq || pdata->channel_irq_mode) in xgbe_enable_dma_interrupts()
712 XGMAC_SET_BITS(channel->curr_ier, in xgbe_enable_dma_interrupts()
716 XGMAC_DMA_IOWRITE(channel, DMA_CH_IER, channel->curr_ier); in xgbe_enable_dma_interrupts()
725 q_count = max(pdata->hw_feat.tx_q_cnt, pdata->hw_feat.rx_q_cnt); in xgbe_enable_mtl_interrupts()
757 if (!pdata->vdata->ecc_support) in xgbe_enable_ecc_interrupts()
830 return -EINVAL; in xgbe_set_speed()
847 /* Check only C-TAG (0x8100) packets */ in xgbe_enable_rx_vlan_stripping()
850 /* Don't consider an S-TAG (0x88A8) packet as a VLAN packet */ in xgbe_enable_rx_vlan_stripping()
877 /* Only filter on the lower 12-bits of the VLAN tag */ in xgbe_enable_rx_vlan_filtering()
931 for_each_set_bit(vid, pdata->active_vlans, VLAN_N_VID) { in xgbe_update_vlan_hash_table()
953 netif_dbg(pdata, drv, pdata->netdev, "%s promiscuous mode\n", in xgbe_set_promiscuous_mode()
961 if (pdata->netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER) in xgbe_set_promiscuous_mode()
976 netif_dbg(pdata, drv, pdata->netdev, "%s allmulti mode\n", in xgbe_set_all_multicast_mode()
994 mac_addr[0] = ha->addr[0]; in xgbe_set_mac_reg()
995 mac_addr[1] = ha->addr[1]; in xgbe_set_mac_reg()
996 mac_addr[2] = ha->addr[2]; in xgbe_set_mac_reg()
997 mac_addr[3] = ha->addr[3]; in xgbe_set_mac_reg()
999 mac_addr[0] = ha->addr[4]; in xgbe_set_mac_reg()
1000 mac_addr[1] = ha->addr[5]; in xgbe_set_mac_reg()
1002 netif_dbg(pdata, drv, pdata->netdev, in xgbe_set_mac_reg()
1004 ha->addr, *mac_reg); in xgbe_set_mac_reg()
1017 struct net_device *netdev = pdata->netdev; in xgbe_set_mac_addn_addrs()
1023 addn_macs = pdata->hw_feat.addn_mac; in xgbe_set_mac_addn_addrs()
1030 addn_macs--; in xgbe_set_mac_addn_addrs()
1038 addn_macs--; in xgbe_set_mac_addn_addrs()
1044 while (addn_macs--) in xgbe_set_mac_addn_addrs()
1050 struct net_device *netdev = pdata->netdev; in xgbe_set_mac_hash_table()
1058 hash_table_shift = 26 - (pdata->hw_feat.hash_table_size >> 7); in xgbe_set_mac_hash_table()
1059 hash_table_count = pdata->hw_feat.hash_table_size / 32; in xgbe_set_mac_hash_table()
1064 crc = bitrev32(~crc32_le(~0, ha->addr, ETH_ALEN)); in xgbe_set_mac_hash_table()
1070 crc = bitrev32(~crc32_le(~0, ha->addr, ETH_ALEN)); in xgbe_set_mac_hash_table()
1085 if (pdata->hw_feat.hash_table_size) in xgbe_add_mac_addresses()
1109 struct net_device *netdev = pdata->netdev; in xgbe_config_rx_mode()
1112 pr_mode = ((netdev->flags & IFF_PROMISC) != 0); in xgbe_config_rx_mode()
1113 am_mode = ((netdev->flags & IFF_ALLMULTI) != 0); in xgbe_config_rx_mode()
1128 return -EINVAL; in xgbe_clr_gpio()
1143 return -EINVAL; in xgbe_set_gpio()
1163 mmd_address = (pdata->mdio_mmd << 16) | (mmd_reg & 0xffff); in xgbe_read_mmd_regs_v2()
1170 * The mmio interface is based on 16-bit offsets and values. All in xgbe_read_mmd_regs_v2()
1175 index = mmd_address & ~pdata->xpcs_window_mask; in xgbe_read_mmd_regs_v2()
1176 offset = pdata->xpcs_window + (mmd_address & pdata->xpcs_window_mask); in xgbe_read_mmd_regs_v2()
1178 spin_lock_irqsave(&pdata->xpcs_lock, flags); in xgbe_read_mmd_regs_v2()
1179 XPCS32_IOWRITE(pdata, pdata->xpcs_window_sel_reg, index); in xgbe_read_mmd_regs_v2()
1181 spin_unlock_irqrestore(&pdata->xpcs_lock, flags); in xgbe_read_mmd_regs_v2()
1195 mmd_address = (pdata->mdio_mmd << 16) | (mmd_reg & 0xffff); in xgbe_write_mmd_regs_v2()
1202 * The mmio interface is based on 16-bit offsets and values. All in xgbe_write_mmd_regs_v2()
1207 index = mmd_address & ~pdata->xpcs_window_mask; in xgbe_write_mmd_regs_v2()
1208 offset = pdata->xpcs_window + (mmd_address & pdata->xpcs_window_mask); in xgbe_write_mmd_regs_v2()
1210 spin_lock_irqsave(&pdata->xpcs_lock, flags); in xgbe_write_mmd_regs_v2()
1211 XPCS32_IOWRITE(pdata, pdata->xpcs_window_sel_reg, index); in xgbe_write_mmd_regs_v2()
1213 spin_unlock_irqrestore(&pdata->xpcs_lock, flags); in xgbe_write_mmd_regs_v2()
1226 mmd_address = (pdata->mdio_mmd << 16) | (mmd_reg & 0xffff); in xgbe_read_mmd_regs_v1()
1228 /* The PCS registers are accessed using mmio. The underlying APB3 in xgbe_read_mmd_regs_v1()
1233 * The mmio interface is based on 32-bit offsets and values. All in xgbe_read_mmd_regs_v1()
1237 spin_lock_irqsave(&pdata->xpcs_lock, flags); in xgbe_read_mmd_regs_v1()
1240 spin_unlock_irqrestore(&pdata->xpcs_lock, flags); in xgbe_read_mmd_regs_v1()
1254 mmd_address = (pdata->mdio_mmd << 16) | (mmd_reg & 0xffff); in xgbe_write_mmd_regs_v1()
1256 /* The PCS registers are accessed using mmio. The underlying APB3 in xgbe_write_mmd_regs_v1()
1261 * The mmio interface is based on 32-bit offsets and values. All in xgbe_write_mmd_regs_v1()
1265 spin_lock_irqsave(&pdata->xpcs_lock, flags); in xgbe_write_mmd_regs_v1()
1268 spin_unlock_irqrestore(&pdata->xpcs_lock, flags); in xgbe_write_mmd_regs_v1()
1274 switch (pdata->vdata->xpcs_access) { in xgbe_read_mmd_regs()
1287 switch (pdata->vdata->xpcs_access) { in xgbe_write_mmd_regs()
1325 reinit_completion(&pdata->mdio_complete); in xgbe_write_ext_mii_regs()
1335 if (!wait_for_completion_timeout(&pdata->mdio_complete, HZ)) { in xgbe_write_ext_mii_regs()
1336 netdev_err(pdata->netdev, "mdio write operation timed out\n"); in xgbe_write_ext_mii_regs()
1337 return -ETIMEDOUT; in xgbe_write_ext_mii_regs()
1368 reinit_completion(&pdata->mdio_complete); in xgbe_read_ext_mii_regs()
1377 if (!wait_for_completion_timeout(&pdata->mdio_complete, HZ)) { in xgbe_read_ext_mii_regs()
1378 netdev_err(pdata->netdev, "mdio read operation timed out\n"); in xgbe_read_ext_mii_regs()
1379 return -ETIMEDOUT; in xgbe_read_ext_mii_regs()
1413 return -EINVAL; in xgbe_set_ext_mii_mode()
1419 return -EINVAL; in xgbe_set_ext_mii_mode()
1429 return !XGMAC_GET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, OWN); in xgbe_tx_complete()
1448 struct xgbe_ring_desc *rdesc = rdata->rdesc; in xgbe_tx_desc_reset()
1456 rdesc->desc0 = 0; in xgbe_tx_desc_reset()
1457 rdesc->desc1 = 0; in xgbe_tx_desc_reset()
1458 rdesc->desc2 = 0; in xgbe_tx_desc_reset()
1459 rdesc->desc3 = 0; in xgbe_tx_desc_reset()
1467 struct xgbe_ring *ring = channel->tx_ring; in xgbe_tx_desc_init()
1470 int start_index = ring->cur; in xgbe_tx_desc_init()
1472 DBGPR("-->tx_desc_init\n"); in xgbe_tx_desc_init()
1475 for (i = 0; i < ring->rdesc_count; i++) { in xgbe_tx_desc_init()
1483 XGMAC_DMA_IOWRITE(channel, DMA_CH_TDRLR, ring->rdesc_count - 1); in xgbe_tx_desc_init()
1488 upper_32_bits(rdata->rdesc_dma)); in xgbe_tx_desc_init()
1490 lower_32_bits(rdata->rdesc_dma)); in xgbe_tx_desc_init()
1492 DBGPR("<--tx_desc_init\n"); in xgbe_tx_desc_init()
1498 struct xgbe_ring_desc *rdesc = rdata->rdesc; in xgbe_rx_desc_reset()
1499 unsigned int rx_usecs = pdata->rx_usecs; in xgbe_rx_desc_reset()
1500 unsigned int rx_frames = pdata->rx_frames; in xgbe_rx_desc_reset()
1522 hdr_dma = rdata->rx.hdr.dma_base + rdata->rx.hdr.dma_off; in xgbe_rx_desc_reset()
1523 buf_dma = rdata->rx.buf.dma_base + rdata->rx.buf.dma_off; in xgbe_rx_desc_reset()
1524 rdesc->desc0 = cpu_to_le32(lower_32_bits(hdr_dma)); in xgbe_rx_desc_reset()
1525 rdesc->desc1 = cpu_to_le32(upper_32_bits(hdr_dma)); in xgbe_rx_desc_reset()
1526 rdesc->desc2 = cpu_to_le32(lower_32_bits(buf_dma)); in xgbe_rx_desc_reset()
1527 rdesc->desc3 = cpu_to_le32(upper_32_bits(buf_dma)); in xgbe_rx_desc_reset()
1529 XGMAC_SET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, INTE, inte); in xgbe_rx_desc_reset()
1537 XGMAC_SET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, OWN, 1); in xgbe_rx_desc_reset()
1545 struct xgbe_prv_data *pdata = channel->pdata; in xgbe_rx_desc_init()
1546 struct xgbe_ring *ring = channel->rx_ring; in xgbe_rx_desc_init()
1548 unsigned int start_index = ring->cur; in xgbe_rx_desc_init()
1551 DBGPR("-->rx_desc_init\n"); in xgbe_rx_desc_init()
1554 for (i = 0; i < ring->rdesc_count; i++) { in xgbe_rx_desc_init()
1562 XGMAC_DMA_IOWRITE(channel, DMA_CH_RDRLR, ring->rdesc_count - 1); in xgbe_rx_desc_init()
1567 upper_32_bits(rdata->rdesc_dma)); in xgbe_rx_desc_init()
1569 lower_32_bits(rdata->rdesc_dma)); in xgbe_rx_desc_init()
1572 rdata = XGBE_GET_DESC_DATA(ring, start_index + ring->rdesc_count - 1); in xgbe_rx_desc_init()
1574 lower_32_bits(rdata->rdesc_dma)); in xgbe_rx_desc_init()
1576 DBGPR("<--rx_desc_init\n"); in xgbe_rx_desc_init()
1589 while (--count && XGMAC_IOREAD_BITS(pdata, MAC_TSCR, TSADDREG)) in xgbe_update_tstamp_addend()
1593 netdev_err(pdata->netdev, in xgbe_update_tstamp_addend()
1608 while (--count && XGMAC_IOREAD_BITS(pdata, MAC_TSCR, TSINIT)) in xgbe_set_tstamp_time()
1612 netdev_err(pdata->netdev, "timed out initializing timestamp\n"); in xgbe_set_tstamp_time()
1631 if (pdata->vdata->tx_tstamp_workaround) { in xgbe_get_tx_tstamp()
1654 if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_CONTEXT_DESC3, TSA) && in xgbe_get_rx_tstamp()
1655 !XGMAC_GET_BITS_LE(rdesc->desc3, RX_CONTEXT_DESC3, TSD)) { in xgbe_get_rx_tstamp()
1656 nsec = le32_to_cpu(rdesc->desc1); in xgbe_get_rx_tstamp()
1658 nsec |= le32_to_cpu(rdesc->desc0); in xgbe_get_rx_tstamp()
1660 packet->rx_tstamp = nsec; in xgbe_get_rx_tstamp()
1661 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_get_rx_tstamp()
1670 /* Set one nano-second accuracy */ in xgbe_config_tstamp()
1688 xgbe_update_tstamp_addend(pdata, pdata->tstamp_addend); in xgbe_config_tstamp()
1692 timecounter_init(&pdata->tstamp_tc, &pdata->tstamp_cc, in xgbe_config_tstamp()
1701 struct xgbe_prv_data *pdata = channel->pdata; in xgbe_tx_start_xmit()
1709 rdata = XGBE_GET_DESC_DATA(ring, ring->cur); in xgbe_tx_start_xmit()
1711 lower_32_bits(rdata->rdesc_dma)); in xgbe_tx_start_xmit()
1714 if (pdata->tx_usecs && !channel->tx_timer_active) { in xgbe_tx_start_xmit()
1715 channel->tx_timer_active = 1; in xgbe_tx_start_xmit()
1716 mod_timer(&channel->tx_timer, in xgbe_tx_start_xmit()
1717 jiffies + usecs_to_jiffies(pdata->tx_usecs)); in xgbe_tx_start_xmit()
1720 ring->tx.xmit_more = 0; in xgbe_tx_start_xmit()
1725 struct xgbe_prv_data *pdata = channel->pdata; in xgbe_dev_xmit()
1726 struct xgbe_ring *ring = channel->tx_ring; in xgbe_dev_xmit()
1729 struct xgbe_packet_data *packet = &ring->packet_data; in xgbe_dev_xmit()
1734 int start_index = ring->cur; in xgbe_dev_xmit()
1735 int cur_index = ring->cur; in xgbe_dev_xmit()
1738 DBGPR("-->xgbe_dev_xmit\n"); in xgbe_dev_xmit()
1740 tx_packets = packet->tx_packets; in xgbe_dev_xmit()
1741 tx_bytes = packet->tx_bytes; in xgbe_dev_xmit()
1743 csum = XGMAC_GET_BITS(packet->attributes, TX_PACKET_ATTRIBUTES, in xgbe_dev_xmit()
1745 tso = XGMAC_GET_BITS(packet->attributes, TX_PACKET_ATTRIBUTES, in xgbe_dev_xmit()
1747 vlan = XGMAC_GET_BITS(packet->attributes, TX_PACKET_ATTRIBUTES, in xgbe_dev_xmit()
1749 vxlan = XGMAC_GET_BITS(packet->attributes, TX_PACKET_ATTRIBUTES, in xgbe_dev_xmit()
1752 if (tso && (packet->mss != ring->tx.cur_mss)) in xgbe_dev_xmit()
1757 if (vlan && (packet->vlan_ctag != ring->tx.cur_vlan_ctag)) in xgbe_dev_xmit()
1764 * - Tx frame count exceeds the frame count setting in xgbe_dev_xmit()
1765 * - Addition of Tx frame count to the frame count since the in xgbe_dev_xmit()
1768 * - No frame count setting specified (ethtool -C ethX tx-frames 0) in xgbe_dev_xmit()
1769 * - Addition of Tx frame count to the frame count since the in xgbe_dev_xmit()
1772 ring->coalesce_count += tx_packets; in xgbe_dev_xmit()
1773 if (!pdata->tx_frames) in xgbe_dev_xmit()
1775 else if (tx_packets > pdata->tx_frames) in xgbe_dev_xmit()
1777 else if ((ring->coalesce_count % pdata->tx_frames) < tx_packets) in xgbe_dev_xmit()
1783 rdesc = rdata->rdesc; in xgbe_dev_xmit()
1788 netif_dbg(pdata, tx_queued, pdata->netdev, in xgbe_dev_xmit()
1790 packet->mss); in xgbe_dev_xmit()
1793 XGMAC_SET_BITS_LE(rdesc->desc2, TX_CONTEXT_DESC2, in xgbe_dev_xmit()
1794 MSS, packet->mss); in xgbe_dev_xmit()
1797 XGMAC_SET_BITS_LE(rdesc->desc3, TX_CONTEXT_DESC3, in xgbe_dev_xmit()
1801 XGMAC_SET_BITS_LE(rdesc->desc3, TX_CONTEXT_DESC3, in xgbe_dev_xmit()
1804 ring->tx.cur_mss = packet->mss; in xgbe_dev_xmit()
1808 netif_dbg(pdata, tx_queued, pdata->netdev, in xgbe_dev_xmit()
1810 packet->vlan_ctag); in xgbe_dev_xmit()
1813 XGMAC_SET_BITS_LE(rdesc->desc3, TX_CONTEXT_DESC3, in xgbe_dev_xmit()
1817 XGMAC_SET_BITS_LE(rdesc->desc3, TX_CONTEXT_DESC3, in xgbe_dev_xmit()
1818 VT, packet->vlan_ctag); in xgbe_dev_xmit()
1821 XGMAC_SET_BITS_LE(rdesc->desc3, TX_CONTEXT_DESC3, in xgbe_dev_xmit()
1824 ring->tx.cur_vlan_ctag = packet->vlan_ctag; in xgbe_dev_xmit()
1829 rdesc = rdata->rdesc; in xgbe_dev_xmit()
1833 rdesc->desc0 = cpu_to_le32(lower_32_bits(rdata->skb_dma)); in xgbe_dev_xmit()
1834 rdesc->desc1 = cpu_to_le32(upper_32_bits(rdata->skb_dma)); in xgbe_dev_xmit()
1837 XGMAC_SET_BITS_LE(rdesc->desc2, TX_NORMAL_DESC2, HL_B1L, in xgbe_dev_xmit()
1838 rdata->skb_dma_len); in xgbe_dev_xmit()
1842 XGMAC_SET_BITS_LE(rdesc->desc2, TX_NORMAL_DESC2, VTIR, in xgbe_dev_xmit()
1846 if (XGMAC_GET_BITS(packet->attributes, TX_PACKET_ATTRIBUTES, PTP)) in xgbe_dev_xmit()
1847 XGMAC_SET_BITS_LE(rdesc->desc2, TX_NORMAL_DESC2, TTSE, 1); in xgbe_dev_xmit()
1850 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, FD, 1); in xgbe_dev_xmit()
1853 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, CTXT, 0); in xgbe_dev_xmit()
1857 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, OWN, 1); in xgbe_dev_xmit()
1861 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, TSE, 1); in xgbe_dev_xmit()
1862 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, TCPPL, in xgbe_dev_xmit()
1863 packet->tcp_payload_len); in xgbe_dev_xmit()
1864 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, TCPHDRLEN, in xgbe_dev_xmit()
1865 packet->tcp_header_len / 4); in xgbe_dev_xmit()
1867 pdata->ext_stats.tx_tso_packets += tx_packets; in xgbe_dev_xmit()
1870 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, CPC, 0); in xgbe_dev_xmit()
1874 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, in xgbe_dev_xmit()
1878 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, FL, in xgbe_dev_xmit()
1879 packet->length); in xgbe_dev_xmit()
1883 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, VNP, in xgbe_dev_xmit()
1886 pdata->ext_stats.tx_vxlan_packets += packet->tx_packets; in xgbe_dev_xmit()
1889 for (i = cur_index - start_index + 1; i < packet->rdesc_count; i++) { in xgbe_dev_xmit()
1892 rdesc = rdata->rdesc; in xgbe_dev_xmit()
1895 rdesc->desc0 = cpu_to_le32(lower_32_bits(rdata->skb_dma)); in xgbe_dev_xmit()
1896 rdesc->desc1 = cpu_to_le32(upper_32_bits(rdata->skb_dma)); in xgbe_dev_xmit()
1899 XGMAC_SET_BITS_LE(rdesc->desc2, TX_NORMAL_DESC2, HL_B1L, in xgbe_dev_xmit()
1900 rdata->skb_dma_len); in xgbe_dev_xmit()
1903 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, OWN, 1); in xgbe_dev_xmit()
1906 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, CTXT, 0); in xgbe_dev_xmit()
1910 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, in xgbe_dev_xmit()
1915 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, LD, 1); in xgbe_dev_xmit()
1919 XGMAC_SET_BITS_LE(rdesc->desc2, TX_NORMAL_DESC2, IC, 1); in xgbe_dev_xmit()
1922 rdata->tx.packets = tx_packets; in xgbe_dev_xmit()
1923 rdata->tx.bytes = tx_bytes; in xgbe_dev_xmit()
1925 pdata->ext_stats.txq_packets[channel->queue_index] += tx_packets; in xgbe_dev_xmit()
1926 pdata->ext_stats.txq_bytes[channel->queue_index] += tx_bytes; in xgbe_dev_xmit()
1936 rdesc = rdata->rdesc; in xgbe_dev_xmit()
1937 XGMAC_SET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, OWN, 1); in xgbe_dev_xmit()
1941 packet->rdesc_count, 1); in xgbe_dev_xmit()
1946 ring->cur = cur_index + 1; in xgbe_dev_xmit()
1948 netif_xmit_stopped(netdev_get_tx_queue(pdata->netdev, in xgbe_dev_xmit()
1949 channel->queue_index))) in xgbe_dev_xmit()
1952 ring->tx.xmit_more = 1; in xgbe_dev_xmit()
1955 channel->name, start_index & (ring->rdesc_count - 1), in xgbe_dev_xmit()
1956 (ring->cur - 1) & (ring->rdesc_count - 1)); in xgbe_dev_xmit()
1958 DBGPR("<--xgbe_dev_xmit\n"); in xgbe_dev_xmit()
1963 struct xgbe_prv_data *pdata = channel->pdata; in xgbe_dev_read()
1964 struct xgbe_ring *ring = channel->rx_ring; in xgbe_dev_read()
1967 struct xgbe_packet_data *packet = &ring->packet_data; in xgbe_dev_read()
1968 struct net_device *netdev = pdata->netdev; in xgbe_dev_read()
1971 DBGPR("-->xgbe_dev_read: cur = %d\n", ring->cur); in xgbe_dev_read()
1973 rdata = XGBE_GET_DESC_DATA(ring, ring->cur); in xgbe_dev_read()
1974 rdesc = rdata->rdesc; in xgbe_dev_read()
1977 if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, OWN)) in xgbe_dev_read()
1984 xgbe_dump_rx_desc(pdata, ring, ring->cur); in xgbe_dev_read()
1986 if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, CTXT)) { in xgbe_dev_read()
1990 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
1992 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
1998 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, CONTEXT, 0); in xgbe_dev_read()
2001 if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, CDA)) in xgbe_dev_read()
2002 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2006 if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, FD)) { in xgbe_dev_read()
2007 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2009 rdata->rx.hdr_len = XGMAC_GET_BITS_LE(rdesc->desc2, in xgbe_dev_read()
2011 if (rdata->rx.hdr_len) in xgbe_dev_read()
2012 pdata->ext_stats.rx_split_header_packets++; in xgbe_dev_read()
2014 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2019 if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, RSV)) { in xgbe_dev_read()
2020 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2023 packet->rss_hash = le32_to_cpu(rdesc->desc1); in xgbe_dev_read()
2025 l34t = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, L34T); in xgbe_dev_read()
2031 packet->rss_hash_type = PKT_HASH_TYPE_L4; in xgbe_dev_read()
2034 packet->rss_hash_type = PKT_HASH_TYPE_L3; in xgbe_dev_read()
2039 if (!XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, LD)) in xgbe_dev_read()
2043 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2047 rdata->rx.len = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, PL); in xgbe_dev_read()
2050 if (netdev->features & NETIF_F_RXCSUM) { in xgbe_dev_read()
2051 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2053 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2058 if (XGMAC_GET_BITS_LE(rdesc->desc2, RX_NORMAL_DESC2, TNP)) { in xgbe_dev_read()
2059 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2061 pdata->ext_stats.rx_vxlan_packets++; in xgbe_dev_read()
2063 l34t = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, L34T); in xgbe_dev_read()
2067 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2074 err = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, ES); in xgbe_dev_read()
2075 etlt = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, ETLT); in xgbe_dev_read()
2081 (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)) { in xgbe_dev_read()
2082 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2084 packet->vlan_ctag = XGMAC_GET_BITS_LE(rdesc->desc0, in xgbe_dev_read()
2087 netif_dbg(pdata, rx_status, netdev, "vlan-ctag=%#06x\n", in xgbe_dev_read()
2088 packet->vlan_ctag); in xgbe_dev_read()
2091 unsigned int tnp = XGMAC_GET_BITS(packet->attributes, in xgbe_dev_read()
2095 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2097 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2099 pdata->ext_stats.rx_csum_errors++; in xgbe_dev_read()
2101 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2103 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, in xgbe_dev_read()
2105 pdata->ext_stats.rx_vxlan_csum_errors++; in xgbe_dev_read()
2107 XGMAC_SET_BITS(packet->errors, RX_PACKET_ERRORS, in xgbe_dev_read()
2112 pdata->ext_stats.rxq_packets[channel->queue_index]++; in xgbe_dev_read()
2113 pdata->ext_stats.rxq_bytes[channel->queue_index] += rdata->rx.len; in xgbe_dev_read()
2115 DBGPR("<--xgbe_dev_read: %s - descriptor=%u (cur=%d)\n", channel->name, in xgbe_dev_read()
2116 ring->cur & (ring->rdesc_count - 1), ring->cur); in xgbe_dev_read()
2124 return XGMAC_GET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, CTXT); in xgbe_is_context_desc()
2130 return XGMAC_GET_BITS_LE(rdesc->desc3, TX_NORMAL_DESC3, LD); in xgbe_is_last_desc()
2138 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, TIE, 1); in xgbe_enable_int()
2141 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, TXSE, 1); in xgbe_enable_int()
2144 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, TBUE, 1); in xgbe_enable_int()
2147 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RIE, 1); in xgbe_enable_int()
2150 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RBUE, 1); in xgbe_enable_int()
2153 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RSE, 1); in xgbe_enable_int()
2156 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, TIE, 1); in xgbe_enable_int()
2157 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RIE, 1); in xgbe_enable_int()
2160 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, FBEE, 1); in xgbe_enable_int()
2163 channel->curr_ier |= channel->saved_ier; in xgbe_enable_int()
2166 return -1; in xgbe_enable_int()
2169 XGMAC_DMA_IOWRITE(channel, DMA_CH_IER, channel->curr_ier); in xgbe_enable_int()
2179 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, TIE, 0); in xgbe_disable_int()
2182 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, TXSE, 0); in xgbe_disable_int()
2185 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, TBUE, 0); in xgbe_disable_int()
2188 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RIE, 0); in xgbe_disable_int()
2191 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RBUE, 0); in xgbe_disable_int()
2194 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RSE, 0); in xgbe_disable_int()
2197 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, TIE, 0); in xgbe_disable_int()
2198 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, RIE, 0); in xgbe_disable_int()
2201 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, FBEE, 0); in xgbe_disable_int()
2204 channel->saved_ier = channel->curr_ier; in xgbe_disable_int()
2205 channel->curr_ier = 0; in xgbe_disable_int()
2208 return -1; in xgbe_disable_int()
2211 XGMAC_DMA_IOWRITE(channel, DMA_CH_IER, channel->curr_ier); in xgbe_disable_int()
2220 DBGPR("-->xgbe_exit\n"); in __xgbe_exit()
2227 while (--count && XGMAC_IOREAD_BITS(pdata, DMA_MR, SWR)) in __xgbe_exit()
2231 return -EBUSY; in __xgbe_exit()
2233 DBGPR("<--xgbe_exit\n"); in __xgbe_exit()
2256 if (XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER) < 0x21) in xgbe_flush_tx_queues()
2259 for (i = 0; i < pdata->tx_q_count; i++) in xgbe_flush_tx_queues()
2263 for (i = 0; i < pdata->tx_q_count; i++) { in xgbe_flush_tx_queues()
2265 while (--count && XGMAC_MTL_IOREAD_BITS(pdata, i, in xgbe_flush_tx_queues()
2270 return -EBUSY; in xgbe_flush_tx_queues()
2285 /* Set the System Bus mode */ in xgbe_config_dma_bus()
2287 XGMAC_SET_BITS(sbmr, DMA_SBMR, BLEN, pdata->blen >> 2); in xgbe_config_dma_bus()
2288 XGMAC_SET_BITS(sbmr, DMA_SBMR, AAL, pdata->aal); in xgbe_config_dma_bus()
2289 XGMAC_SET_BITS(sbmr, DMA_SBMR, RD_OSR_LMT, pdata->rd_osr_limit - 1); in xgbe_config_dma_bus()
2290 XGMAC_SET_BITS(sbmr, DMA_SBMR, WR_OSR_LMT, pdata->wr_osr_limit - 1); in xgbe_config_dma_bus()
2295 if (pdata->vdata->tx_desc_prefetch) in xgbe_config_dma_bus()
2297 pdata->vdata->tx_desc_prefetch); in xgbe_config_dma_bus()
2299 if (pdata->vdata->rx_desc_prefetch) in xgbe_config_dma_bus()
2301 pdata->vdata->rx_desc_prefetch); in xgbe_config_dma_bus()
2306 XGMAC_IOWRITE(pdata, DMA_AXIARCR, pdata->arcr); in xgbe_config_dma_cache()
2307 XGMAC_IOWRITE(pdata, DMA_AXIAWCR, pdata->awcr); in xgbe_config_dma_cache()
2308 if (pdata->awarcr) in xgbe_config_dma_cache()
2309 XGMAC_IOWRITE(pdata, DMA_AXIAWARCR, pdata->awarcr); in xgbe_config_dma_cache()
2320 for (i = 0; i < pdata->hw_feat.tc_cnt; i++) { in xgbe_config_mtl_mode()
2339 if (pdata->pfcq[queue] && (q_fifo_size > pdata->pfc_rfa)) { in xgbe_queue_flow_control_threshold()
2341 rfa = pdata->pfc_rfa; in xgbe_queue_flow_control_threshold()
2346 rfa = XGMAC_FLOW_CONTROL_MAX - XGMAC_FLOW_CONTROL_UNIT; in xgbe_queue_flow_control_threshold()
2355 pdata->rx_rfa[queue] = 0; in xgbe_queue_flow_control_threshold()
2356 pdata->rx_rfd[queue] = 0; in xgbe_queue_flow_control_threshold()
2362 pdata->rx_rfa[queue] = 0; /* Full - 1024 bytes */ in xgbe_queue_flow_control_threshold()
2363 pdata->rx_rfd[queue] = 1; /* Full - 1536 bytes */ in xgbe_queue_flow_control_threshold()
2368 /* Between 4096 and max-frame */ in xgbe_queue_flow_control_threshold()
2369 pdata->rx_rfa[queue] = 2; /* Full - 2048 bytes */ in xgbe_queue_flow_control_threshold()
2370 pdata->rx_rfd[queue] = 5; /* Full - 3584 bytes */ in xgbe_queue_flow_control_threshold()
2375 /* Between max-frame and 3 max-frames, in xgbe_queue_flow_control_threshold()
2379 rfa = q_fifo_size - frame_fifo_size; in xgbe_queue_flow_control_threshold()
2382 /* Above 3 max-frames - trigger when just over in xgbe_queue_flow_control_threshold()
2391 pdata->rx_rfa[queue] = XGMAC_FLOW_CONTROL_VALUE(rfa); in xgbe_queue_flow_control_threshold()
2392 pdata->rx_rfd[queue] = XGMAC_FLOW_CONTROL_VALUE(rfd); in xgbe_queue_flow_control_threshold()
2401 for (i = 0; i < pdata->rx_q_count; i++) { in xgbe_calculate_flow_control_threshold()
2412 for (i = 0; i < pdata->rx_q_count; i++) { in xgbe_config_flow_control_threshold()
2414 pdata->rx_rfa[i]); in xgbe_config_flow_control_threshold()
2416 pdata->rx_rfd[i]); in xgbe_config_flow_control_threshold()
2423 return min_t(unsigned int, pdata->tx_max_fifo_size, in xgbe_get_tx_fifo_size()
2424 pdata->hw_feat.tx_fifo_size); in xgbe_get_tx_fifo_size()
2430 return min_t(unsigned int, pdata->rx_max_fifo_size, in xgbe_get_rx_fifo_size()
2431 pdata->hw_feat.rx_fifo_size); in xgbe_get_rx_fifo_size()
2450 p_fifo--; in xgbe_calculate_equal_fifo()
2473 fifo[i] = (XGMAC_FIFO_MIN_ALLOC / XGMAC_FIFO_UNIT) - 1; in xgbe_set_nonprio_fifos()
2474 fifo_size -= XGMAC_FIFO_MIN_ALLOC; in xgbe_set_nonprio_fifos()
2485 if (pdata->pfc->delay) in xgbe_get_pfc_delay()
2486 return pdata->pfc->delay / 8; in xgbe_get_pfc_delay()
2509 if (!pdata->pfc->pfc_en) in xgbe_get_pfc_queues()
2513 prio_queues = XGMAC_PRIO_QUEUES(pdata->rx_q_count); in xgbe_get_pfc_queues()
2518 pdata->pfcq[i] = 1; in xgbe_get_pfc_queues()
2535 prio_queues = XGMAC_PRIO_QUEUES(pdata->rx_q_count); in xgbe_calculate_dcb_fifo()
2545 rem_fifo = fifo_size - (q_fifo_size * prio_queues); in xgbe_calculate_dcb_fifo()
2550 pdata->pfc_rfa = xgbe_get_pfc_delay(pdata); in xgbe_calculate_dcb_fifo()
2551 pdata->pfc_rfa = XGMAC_FLOW_CONTROL_ALIGN(pdata->pfc_rfa); in xgbe_calculate_dcb_fifo()
2553 if (pdata->pfc_rfa > q_fifo_size) { in xgbe_calculate_dcb_fifo()
2554 addn_fifo = pdata->pfc_rfa - q_fifo_size; in xgbe_calculate_dcb_fifo()
2561 * - distribute remaining fifo between the VLAN priority in xgbe_calculate_dcb_fifo()
2567 i--; in xgbe_calculate_dcb_fifo()
2569 fifo[i] = (q_fifo_size / XGMAC_FIFO_UNIT) - 1; in xgbe_calculate_dcb_fifo()
2571 if (!pdata->pfcq[i] || !addn_fifo) in xgbe_calculate_dcb_fifo()
2575 netdev_warn(pdata->netdev, in xgbe_calculate_dcb_fifo()
2584 rem_fifo -= addn_fifo; in xgbe_calculate_dcb_fifo()
2604 xgbe_calculate_equal_fifo(fifo_size, pdata->tx_q_count, fifo); in xgbe_config_tx_fifo_size()
2606 for (i = 0; i < pdata->tx_q_count; i++) in xgbe_config_tx_fifo_size()
2609 netif_info(pdata, drv, pdata->netdev, in xgbe_config_tx_fifo_size()
2611 pdata->tx_q_count, ((fifo[0] + 1) * XGMAC_FIFO_UNIT)); in xgbe_config_tx_fifo_size()
2622 memset(pdata->pfcq, 0, sizeof(pdata->pfcq)); in xgbe_config_rx_fifo_size()
2623 pdata->pfc_rfa = 0; in xgbe_config_rx_fifo_size()
2626 prio_queues = XGMAC_PRIO_QUEUES(pdata->rx_q_count); in xgbe_config_rx_fifo_size()
2628 /* Assign a minimum fifo to the non-VLAN priority queues */ in xgbe_config_rx_fifo_size()
2629 fifo_size = xgbe_set_nonprio_fifos(fifo_size, pdata->rx_q_count, fifo); in xgbe_config_rx_fifo_size()
2631 if (pdata->pfc && pdata->ets) in xgbe_config_rx_fifo_size()
2636 for (i = 0; i < pdata->rx_q_count; i++) in xgbe_config_rx_fifo_size()
2642 if (pdata->pfc && pdata->ets && pdata->pfc->pfc_en) { in xgbe_config_rx_fifo_size()
2643 netif_info(pdata, drv, pdata->netdev, in xgbe_config_rx_fifo_size()
2644 "%u Rx hardware queues\n", pdata->rx_q_count); in xgbe_config_rx_fifo_size()
2645 for (i = 0; i < pdata->rx_q_count; i++) in xgbe_config_rx_fifo_size()
2646 netif_info(pdata, drv, pdata->netdev, in xgbe_config_rx_fifo_size()
2650 netif_info(pdata, drv, pdata->netdev, in xgbe_config_rx_fifo_size()
2652 pdata->rx_q_count, in xgbe_config_rx_fifo_size()
2668 qptc = pdata->tx_q_count / pdata->hw_feat.tc_cnt; in xgbe_config_queue_mapping()
2669 qptc_extra = pdata->tx_q_count % pdata->hw_feat.tc_cnt; in xgbe_config_queue_mapping()
2671 for (i = 0, queue = 0; i < pdata->hw_feat.tc_cnt; i++) { in xgbe_config_queue_mapping()
2673 netif_dbg(pdata, drv, pdata->netdev, in xgbe_config_queue_mapping()
2677 pdata->q2tc_map[queue++] = i; in xgbe_config_queue_mapping()
2681 netif_dbg(pdata, drv, pdata->netdev, in xgbe_config_queue_mapping()
2685 pdata->q2tc_map[queue++] = i; in xgbe_config_queue_mapping()
2690 prio_queues = XGMAC_PRIO_QUEUES(pdata->rx_q_count); in xgbe_config_queue_mapping()
2699 netif_dbg(pdata, drv, pdata->netdev, in xgbe_config_queue_mapping()
2702 pdata->prio2q_map[prio++] = i; in xgbe_config_queue_mapping()
2706 netif_dbg(pdata, drv, pdata->netdev, in xgbe_config_queue_mapping()
2709 pdata->prio2q_map[prio++] = i; in xgbe_config_queue_mapping()
2725 for (i = 0; i < pdata->rx_q_count;) { in xgbe_config_queue_mapping()
2728 if ((i % MTL_RQDCM_Q_PER_REG) && (i != pdata->rx_q_count)) in xgbe_config_queue_mapping()
2743 netdev_reset_tc(pdata->netdev); in xgbe_config_tc()
2744 if (!pdata->num_tcs) in xgbe_config_tc()
2747 netdev_set_num_tc(pdata->netdev, pdata->num_tcs); in xgbe_config_tc()
2749 for (i = 0, queue = 0, offset = 0; i < pdata->num_tcs; i++) { in xgbe_config_tc()
2750 while ((queue < pdata->tx_q_count) && in xgbe_config_tc()
2751 (pdata->q2tc_map[queue] == i)) in xgbe_config_tc()
2754 netif_dbg(pdata, drv, pdata->netdev, "TC%u using TXq%u-%u\n", in xgbe_config_tc()
2755 i, offset, queue - 1); in xgbe_config_tc()
2756 netdev_set_tc_queue(pdata->netdev, i, queue - offset, offset); in xgbe_config_tc()
2760 if (!pdata->ets) in xgbe_config_tc()
2764 netdev_set_prio_tc_map(pdata->netdev, prio, in xgbe_config_tc()
2765 pdata->ets->prio_tc[prio]); in xgbe_config_tc()
2770 struct ieee_ets *ets = pdata->ets; in xgbe_config_dcb_tc()
2784 total_weight = pdata->netdev->mtu * pdata->hw_feat.tc_cnt; in xgbe_config_dcb_tc()
2789 for (i = 0; i < pdata->hw_feat.tc_cnt; i++) { in xgbe_config_dcb_tc()
2793 if (ets->prio_tc[prio] == i) in xgbe_config_dcb_tc()
2798 netif_dbg(pdata, drv, pdata->netdev, "TC%u PRIO mask=%#x\n", in xgbe_config_dcb_tc()
2809 switch (ets->tc_tsa[i]) { in xgbe_config_dcb_tc()
2811 netif_dbg(pdata, drv, pdata->netdev, in xgbe_config_dcb_tc()
2817 weight = total_weight * ets->tc_tx_bw[i] / 100; in xgbe_config_dcb_tc()
2820 netif_dbg(pdata, drv, pdata->netdev, in xgbe_config_dcb_tc()
2835 if (!test_bit(XGBE_DOWN, &pdata->dev_state)) { in xgbe_config_dcb_pfc()
2837 netif_tx_stop_all_queues(pdata->netdev); in xgbe_config_dcb_pfc()
2840 pdata->hw_if.disable_rx(pdata); in xgbe_config_dcb_pfc()
2846 if (!test_bit(XGBE_DOWN, &pdata->dev_state)) { in xgbe_config_dcb_pfc()
2848 pdata->hw_if.enable_rx(pdata); in xgbe_config_dcb_pfc()
2851 netif_tx_start_all_queues(pdata->netdev); in xgbe_config_dcb_pfc()
2857 xgbe_set_mac_address(pdata, pdata->netdev->dev_addr); in xgbe_config_mac_address()
2860 if (pdata->hw_feat.hash_table_size) { in xgbe_config_mac_address()
2871 val = (pdata->netdev->mtu > XGMAC_STD_PACKET_MTU) ? 1 : 0; in xgbe_config_jumbo_enable()
2878 xgbe_set_speed(pdata, pdata->phy_speed); in xgbe_config_mac_speed()
2883 if (pdata->netdev->features & NETIF_F_RXCSUM) in xgbe_config_checksum_offload()
2898 if (pdata->netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER) in xgbe_config_vlan_support()
2903 if (pdata->netdev->features & NETIF_F_HW_VLAN_CTAG_RX) in xgbe_config_vlan_support()
2914 if (pdata->vdata->mmc_64bit) { in xgbe_mmc_read()
2953 struct xgbe_mmc_stats *stats = &pdata->mmc_stats; in xgbe_tx_mmc_int()
2957 stats->txoctetcount_gb += in xgbe_tx_mmc_int()
2961 stats->txframecount_gb += in xgbe_tx_mmc_int()
2965 stats->txbroadcastframes_g += in xgbe_tx_mmc_int()
2969 stats->txmulticastframes_g += in xgbe_tx_mmc_int()
2973 stats->tx64octets_gb += in xgbe_tx_mmc_int()
2977 stats->tx65to127octets_gb += in xgbe_tx_mmc_int()
2981 stats->tx128to255octets_gb += in xgbe_tx_mmc_int()
2985 stats->tx256to511octets_gb += in xgbe_tx_mmc_int()
2989 stats->tx512to1023octets_gb += in xgbe_tx_mmc_int()
2993 stats->tx1024tomaxoctets_gb += in xgbe_tx_mmc_int()
2997 stats->txunicastframes_gb += in xgbe_tx_mmc_int()
3001 stats->txmulticastframes_gb += in xgbe_tx_mmc_int()
3005 stats->txbroadcastframes_g += in xgbe_tx_mmc_int()
3009 stats->txunderflowerror += in xgbe_tx_mmc_int()
3013 stats->txoctetcount_g += in xgbe_tx_mmc_int()
3017 stats->txframecount_g += in xgbe_tx_mmc_int()
3021 stats->txpauseframes += in xgbe_tx_mmc_int()
3025 stats->txvlanframes_g += in xgbe_tx_mmc_int()
3031 struct xgbe_mmc_stats *stats = &pdata->mmc_stats; in xgbe_rx_mmc_int()
3035 stats->rxframecount_gb += in xgbe_rx_mmc_int()
3039 stats->rxoctetcount_gb += in xgbe_rx_mmc_int()
3043 stats->rxoctetcount_g += in xgbe_rx_mmc_int()
3047 stats->rxbroadcastframes_g += in xgbe_rx_mmc_int()
3051 stats->rxmulticastframes_g += in xgbe_rx_mmc_int()
3055 stats->rxcrcerror += in xgbe_rx_mmc_int()
3059 stats->rxrunterror += in xgbe_rx_mmc_int()
3063 stats->rxjabbererror += in xgbe_rx_mmc_int()
3067 stats->rxundersize_g += in xgbe_rx_mmc_int()
3071 stats->rxoversize_g += in xgbe_rx_mmc_int()
3075 stats->rx64octets_gb += in xgbe_rx_mmc_int()
3079 stats->rx65to127octets_gb += in xgbe_rx_mmc_int()
3083 stats->rx128to255octets_gb += in xgbe_rx_mmc_int()
3087 stats->rx256to511octets_gb += in xgbe_rx_mmc_int()
3091 stats->rx512to1023octets_gb += in xgbe_rx_mmc_int()
3095 stats->rx1024tomaxoctets_gb += in xgbe_rx_mmc_int()
3099 stats->rxunicastframes_g += in xgbe_rx_mmc_int()
3103 stats->rxlengtherror += in xgbe_rx_mmc_int()
3107 stats->rxoutofrangetype += in xgbe_rx_mmc_int()
3111 stats->rxpauseframes += in xgbe_rx_mmc_int()
3115 stats->rxfifooverflow += in xgbe_rx_mmc_int()
3119 stats->rxvlanframes_gb += in xgbe_rx_mmc_int()
3123 stats->rxwatchdogerror += in xgbe_rx_mmc_int()
3129 struct xgbe_mmc_stats *stats = &pdata->mmc_stats; in xgbe_read_mmc_stats()
3134 stats->txoctetcount_gb += in xgbe_read_mmc_stats()
3137 stats->txframecount_gb += in xgbe_read_mmc_stats()
3140 stats->txbroadcastframes_g += in xgbe_read_mmc_stats()
3143 stats->txmulticastframes_g += in xgbe_read_mmc_stats()
3146 stats->tx64octets_gb += in xgbe_read_mmc_stats()
3149 stats->tx65to127octets_gb += in xgbe_read_mmc_stats()
3152 stats->tx128to255octets_gb += in xgbe_read_mmc_stats()
3155 stats->tx256to511octets_gb += in xgbe_read_mmc_stats()
3158 stats->tx512to1023octets_gb += in xgbe_read_mmc_stats()
3161 stats->tx1024tomaxoctets_gb += in xgbe_read_mmc_stats()
3164 stats->txunicastframes_gb += in xgbe_read_mmc_stats()
3167 stats->txmulticastframes_gb += in xgbe_read_mmc_stats()
3170 stats->txbroadcastframes_g += in xgbe_read_mmc_stats()
3173 stats->txunderflowerror += in xgbe_read_mmc_stats()
3176 stats->txoctetcount_g += in xgbe_read_mmc_stats()
3179 stats->txframecount_g += in xgbe_read_mmc_stats()
3182 stats->txpauseframes += in xgbe_read_mmc_stats()
3185 stats->txvlanframes_g += in xgbe_read_mmc_stats()
3188 stats->rxframecount_gb += in xgbe_read_mmc_stats()
3191 stats->rxoctetcount_gb += in xgbe_read_mmc_stats()
3194 stats->rxoctetcount_g += in xgbe_read_mmc_stats()
3197 stats->rxbroadcastframes_g += in xgbe_read_mmc_stats()
3200 stats->rxmulticastframes_g += in xgbe_read_mmc_stats()
3203 stats->rxcrcerror += in xgbe_read_mmc_stats()
3206 stats->rxrunterror += in xgbe_read_mmc_stats()
3209 stats->rxjabbererror += in xgbe_read_mmc_stats()
3212 stats->rxundersize_g += in xgbe_read_mmc_stats()
3215 stats->rxoversize_g += in xgbe_read_mmc_stats()
3218 stats->rx64octets_gb += in xgbe_read_mmc_stats()
3221 stats->rx65to127octets_gb += in xgbe_read_mmc_stats()
3224 stats->rx128to255octets_gb += in xgbe_read_mmc_stats()
3227 stats->rx256to511octets_gb += in xgbe_read_mmc_stats()
3230 stats->rx512to1023octets_gb += in xgbe_read_mmc_stats()
3233 stats->rx1024tomaxoctets_gb += in xgbe_read_mmc_stats()
3236 stats->rxunicastframes_g += in xgbe_read_mmc_stats()
3239 stats->rxlengtherror += in xgbe_read_mmc_stats()
3242 stats->rxoutofrangetype += in xgbe_read_mmc_stats()
3245 stats->rxpauseframes += in xgbe_read_mmc_stats()
3248 stats->rxfifooverflow += in xgbe_read_mmc_stats()
3251 stats->rxvlanframes_gb += in xgbe_read_mmc_stats()
3254 stats->rxwatchdogerror += in xgbe_read_mmc_stats()
3257 /* Un-freeze counters */ in xgbe_read_mmc_stats()
3291 netdev_info(pdata->netdev, in xgbe_txq_prepare_tx_stop()
3303 if (XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER) > 0x20) in xgbe_prepare_tx_stop()
3311 tx_qidx = queue - DMA_DSRX_FIRST_QUEUE; in xgbe_prepare_tx_stop()
3334 netdev_info(pdata->netdev, in xgbe_prepare_tx_stop()
3344 for (i = 0; i < pdata->channel_count; i++) { in xgbe_enable_tx()
3345 if (!pdata->channel[i]->tx_ring) in xgbe_enable_tx()
3348 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_TCR, ST, 1); in xgbe_enable_tx()
3352 for (i = 0; i < pdata->tx_q_count; i++) in xgbe_enable_tx()
3365 for (i = 0; i < pdata->tx_q_count; i++) in xgbe_disable_tx()
3372 for (i = 0; i < pdata->tx_q_count; i++) in xgbe_disable_tx()
3376 for (i = 0; i < pdata->channel_count; i++) { in xgbe_disable_tx()
3377 if (!pdata->channel[i]->tx_ring) in xgbe_disable_tx()
3380 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_TCR, ST, 0); in xgbe_disable_tx()
3405 netdev_info(pdata->netdev, in xgbe_prepare_rx_stop()
3415 for (i = 0; i < pdata->channel_count; i++) { in xgbe_enable_rx()
3416 if (!pdata->channel[i]->rx_ring) in xgbe_enable_rx()
3419 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_RCR, SR, 1); in xgbe_enable_rx()
3424 for (i = 0; i < pdata->rx_q_count; i++) in xgbe_enable_rx()
3446 for (i = 0; i < pdata->rx_q_count; i++) in xgbe_disable_rx()
3453 for (i = 0; i < pdata->channel_count; i++) { in xgbe_disable_rx()
3454 if (!pdata->channel[i]->rx_ring) in xgbe_disable_rx()
3457 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_RCR, SR, 0); in xgbe_disable_rx()
3466 for (i = 0; i < pdata->channel_count; i++) { in xgbe_powerup_tx()
3467 if (!pdata->channel[i]->tx_ring) in xgbe_powerup_tx()
3470 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_TCR, ST, 1); in xgbe_powerup_tx()
3482 for (i = 0; i < pdata->tx_q_count; i++) in xgbe_powerdown_tx()
3489 for (i = 0; i < pdata->channel_count; i++) { in xgbe_powerdown_tx()
3490 if (!pdata->channel[i]->tx_ring) in xgbe_powerdown_tx()
3493 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_TCR, ST, 0); in xgbe_powerdown_tx()
3502 for (i = 0; i < pdata->channel_count; i++) { in xgbe_powerup_rx()
3503 if (!pdata->channel[i]->rx_ring) in xgbe_powerup_rx()
3506 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_RCR, SR, 1); in xgbe_powerup_rx()
3515 for (i = 0; i < pdata->channel_count; i++) { in xgbe_powerdown_rx()
3516 if (!pdata->channel[i]->rx_ring) in xgbe_powerdown_rx()
3519 XGMAC_DMA_IOWRITE_BITS(pdata->channel[i], DMA_CH_RCR, SR, 0); in xgbe_powerdown_rx()
3525 struct xgbe_desc_if *desc_if = &pdata->desc_if; in xgbe_init()
3528 DBGPR("-->xgbe_init\n"); in xgbe_init()
3533 netdev_err(pdata->netdev, "error flushing TX queues\n"); in xgbe_init()
3550 desc_if->wrapper_tx_desc_init(pdata); in xgbe_init()
3551 desc_if->wrapper_rx_desc_init(pdata); in xgbe_init()
3559 xgbe_config_tsf_mode(pdata, pdata->tx_sf_mode); in xgbe_init()
3560 xgbe_config_rsf_mode(pdata, pdata->rx_sf_mode); in xgbe_init()
3561 xgbe_config_tx_threshold(pdata, pdata->tx_threshold); in xgbe_init()
3562 xgbe_config_rx_threshold(pdata, pdata->rx_threshold); in xgbe_init()
3589 DBGPR("<--xgbe_init\n"); in xgbe_init()
3596 DBGPR("-->xgbe_init_function_ptrs\n"); in xgbe_init_function_ptrs_dev()
3598 hw_if->tx_complete = xgbe_tx_complete; in xgbe_init_function_ptrs_dev()
3600 hw_if->set_mac_address = xgbe_set_mac_address; in xgbe_init_function_ptrs_dev()
3601 hw_if->config_rx_mode = xgbe_config_rx_mode; in xgbe_init_function_ptrs_dev()
3603 hw_if->enable_rx_csum = xgbe_enable_rx_csum; in xgbe_init_function_ptrs_dev()
3604 hw_if->disable_rx_csum = xgbe_disable_rx_csum; in xgbe_init_function_ptrs_dev()
3606 hw_if->enable_rx_vlan_stripping = xgbe_enable_rx_vlan_stripping; in xgbe_init_function_ptrs_dev()
3607 hw_if->disable_rx_vlan_stripping = xgbe_disable_rx_vlan_stripping; in xgbe_init_function_ptrs_dev()
3608 hw_if->enable_rx_vlan_filtering = xgbe_enable_rx_vlan_filtering; in xgbe_init_function_ptrs_dev()
3609 hw_if->disable_rx_vlan_filtering = xgbe_disable_rx_vlan_filtering; in xgbe_init_function_ptrs_dev()
3610 hw_if->update_vlan_hash_table = xgbe_update_vlan_hash_table; in xgbe_init_function_ptrs_dev()
3612 hw_if->read_mmd_regs = xgbe_read_mmd_regs; in xgbe_init_function_ptrs_dev()
3613 hw_if->write_mmd_regs = xgbe_write_mmd_regs; in xgbe_init_function_ptrs_dev()
3615 hw_if->set_speed = xgbe_set_speed; in xgbe_init_function_ptrs_dev()
3617 hw_if->set_ext_mii_mode = xgbe_set_ext_mii_mode; in xgbe_init_function_ptrs_dev()
3618 hw_if->read_ext_mii_regs_c22 = xgbe_read_ext_mii_regs_c22; in xgbe_init_function_ptrs_dev()
3619 hw_if->write_ext_mii_regs_c22 = xgbe_write_ext_mii_regs_c22; in xgbe_init_function_ptrs_dev()
3620 hw_if->read_ext_mii_regs_c45 = xgbe_read_ext_mii_regs_c45; in xgbe_init_function_ptrs_dev()
3621 hw_if->write_ext_mii_regs_c45 = xgbe_write_ext_mii_regs_c45; in xgbe_init_function_ptrs_dev()
3623 hw_if->set_gpio = xgbe_set_gpio; in xgbe_init_function_ptrs_dev()
3624 hw_if->clr_gpio = xgbe_clr_gpio; in xgbe_init_function_ptrs_dev()
3626 hw_if->enable_tx = xgbe_enable_tx; in xgbe_init_function_ptrs_dev()
3627 hw_if->disable_tx = xgbe_disable_tx; in xgbe_init_function_ptrs_dev()
3628 hw_if->enable_rx = xgbe_enable_rx; in xgbe_init_function_ptrs_dev()
3629 hw_if->disable_rx = xgbe_disable_rx; in xgbe_init_function_ptrs_dev()
3631 hw_if->powerup_tx = xgbe_powerup_tx; in xgbe_init_function_ptrs_dev()
3632 hw_if->powerdown_tx = xgbe_powerdown_tx; in xgbe_init_function_ptrs_dev()
3633 hw_if->powerup_rx = xgbe_powerup_rx; in xgbe_init_function_ptrs_dev()
3634 hw_if->powerdown_rx = xgbe_powerdown_rx; in xgbe_init_function_ptrs_dev()
3636 hw_if->dev_xmit = xgbe_dev_xmit; in xgbe_init_function_ptrs_dev()
3637 hw_if->dev_read = xgbe_dev_read; in xgbe_init_function_ptrs_dev()
3638 hw_if->enable_int = xgbe_enable_int; in xgbe_init_function_ptrs_dev()
3639 hw_if->disable_int = xgbe_disable_int; in xgbe_init_function_ptrs_dev()
3640 hw_if->init = xgbe_init; in xgbe_init_function_ptrs_dev()
3641 hw_if->exit = xgbe_exit; in xgbe_init_function_ptrs_dev()
3644 hw_if->tx_desc_init = xgbe_tx_desc_init; in xgbe_init_function_ptrs_dev()
3645 hw_if->rx_desc_init = xgbe_rx_desc_init; in xgbe_init_function_ptrs_dev()
3646 hw_if->tx_desc_reset = xgbe_tx_desc_reset; in xgbe_init_function_ptrs_dev()
3647 hw_if->rx_desc_reset = xgbe_rx_desc_reset; in xgbe_init_function_ptrs_dev()
3648 hw_if->is_last_desc = xgbe_is_last_desc; in xgbe_init_function_ptrs_dev()
3649 hw_if->is_context_desc = xgbe_is_context_desc; in xgbe_init_function_ptrs_dev()
3650 hw_if->tx_start_xmit = xgbe_tx_start_xmit; in xgbe_init_function_ptrs_dev()
3653 hw_if->config_tx_flow_control = xgbe_config_tx_flow_control; in xgbe_init_function_ptrs_dev()
3654 hw_if->config_rx_flow_control = xgbe_config_rx_flow_control; in xgbe_init_function_ptrs_dev()
3657 hw_if->config_rx_coalesce = xgbe_config_rx_coalesce; in xgbe_init_function_ptrs_dev()
3658 hw_if->config_tx_coalesce = xgbe_config_tx_coalesce; in xgbe_init_function_ptrs_dev()
3659 hw_if->usec_to_riwt = xgbe_usec_to_riwt; in xgbe_init_function_ptrs_dev()
3660 hw_if->riwt_to_usec = xgbe_riwt_to_usec; in xgbe_init_function_ptrs_dev()
3663 hw_if->config_rx_threshold = xgbe_config_rx_threshold; in xgbe_init_function_ptrs_dev()
3664 hw_if->config_tx_threshold = xgbe_config_tx_threshold; in xgbe_init_function_ptrs_dev()
3667 hw_if->config_rsf_mode = xgbe_config_rsf_mode; in xgbe_init_function_ptrs_dev()
3668 hw_if->config_tsf_mode = xgbe_config_tsf_mode; in xgbe_init_function_ptrs_dev()
3671 hw_if->config_osp_mode = xgbe_config_osp_mode; in xgbe_init_function_ptrs_dev()
3674 hw_if->tx_mmc_int = xgbe_tx_mmc_int; in xgbe_init_function_ptrs_dev()
3675 hw_if->rx_mmc_int = xgbe_rx_mmc_int; in xgbe_init_function_ptrs_dev()
3676 hw_if->read_mmc_stats = xgbe_read_mmc_stats; in xgbe_init_function_ptrs_dev()
3679 hw_if->config_tstamp = xgbe_config_tstamp; in xgbe_init_function_ptrs_dev()
3680 hw_if->update_tstamp_addend = xgbe_update_tstamp_addend; in xgbe_init_function_ptrs_dev()
3681 hw_if->set_tstamp_time = xgbe_set_tstamp_time; in xgbe_init_function_ptrs_dev()
3682 hw_if->get_tstamp_time = xgbe_get_tstamp_time; in xgbe_init_function_ptrs_dev()
3683 hw_if->get_tx_tstamp = xgbe_get_tx_tstamp; in xgbe_init_function_ptrs_dev()
3686 hw_if->config_tc = xgbe_config_tc; in xgbe_init_function_ptrs_dev()
3687 hw_if->config_dcb_tc = xgbe_config_dcb_tc; in xgbe_init_function_ptrs_dev()
3688 hw_if->config_dcb_pfc = xgbe_config_dcb_pfc; in xgbe_init_function_ptrs_dev()
3691 hw_if->enable_rss = xgbe_enable_rss; in xgbe_init_function_ptrs_dev()
3692 hw_if->disable_rss = xgbe_disable_rss; in xgbe_init_function_ptrs_dev()
3693 hw_if->set_rss_hash_key = xgbe_set_rss_hash_key; in xgbe_init_function_ptrs_dev()
3694 hw_if->set_rss_lookup_table = xgbe_set_rss_lookup_table; in xgbe_init_function_ptrs_dev()
3697 hw_if->disable_ecc_ded = xgbe_disable_ecc_ded; in xgbe_init_function_ptrs_dev()
3698 hw_if->disable_ecc_sec = xgbe_disable_ecc_sec; in xgbe_init_function_ptrs_dev()
3701 hw_if->enable_vxlan = xgbe_enable_vxlan; in xgbe_init_function_ptrs_dev()
3702 hw_if->disable_vxlan = xgbe_disable_vxlan; in xgbe_init_function_ptrs_dev()
3703 hw_if->set_vxlan_id = xgbe_set_vxlan_id; in xgbe_init_function_ptrs_dev()
3705 DBGPR("<--xgbe_init_function_ptrs\n"); in xgbe_init_function_ptrs_dev()