Lines Matching full:macb
3 * Cadence MACB/GEM Ethernet Controller driver
42 #include "macb.h"
44 /* This structure is only used for MACB on SiFive FU540 devices */
128 static unsigned int macb_dma_desc_get_size(struct macb *bp) in macb_dma_desc_get_size()
155 static unsigned int macb_adj_dma_desc_idx(struct macb *bp, unsigned int desc_idx) in macb_adj_dma_desc_idx()
174 static struct macb_dma_desc_64 *macb_64b_desc(struct macb *bp, struct macb_dma_desc *desc) in macb_64b_desc()
182 static unsigned int macb_tx_ring_wrap(struct macb *bp, unsigned int index) in macb_tx_ring_wrap()
211 static unsigned int macb_rx_ring_wrap(struct macb *bp, unsigned int index) in macb_rx_ring_wrap()
230 static u32 hw_readl_native(struct macb *bp, int offset) in hw_readl_native()
235 static void hw_writel_native(struct macb *bp, int offset, u32 value) in hw_writel_native()
240 static u32 hw_readl(struct macb *bp, int offset) in hw_readl()
245 static void hw_writel(struct macb *bp, int offset, u32 value) in hw_writel()
279 static void macb_set_hwaddr(struct macb *bp) in macb_set_hwaddr()
303 static void macb_get_hwaddr(struct macb *bp) in macb_get_hwaddr()
332 static int macb_mdio_wait_for_idle(struct macb *bp) in macb_mdio_wait_for_idle()
342 struct macb *bp = bus->priv; in macb_mdio_read_c22()
375 struct macb *bp = bus->priv; in macb_mdio_read_c45()
421 struct macb *bp = bus->priv; in macb_mdio_write_c22()
454 struct macb *bp = bus->priv; in macb_mdio_write_c45()
496 static void macb_init_buffers(struct macb *bp) in macb_init_buffers()
519 * @bp: pointer to struct macb
522 static void macb_set_tx_clk(struct macb *bp, int speed) in macb_set_tx_clk()
569 struct macb *bp = container_of(pcs, struct macb, phylink_usx_pcs); in macb_usx_pcs_link_up()
583 struct macb *bp = container_of(pcs, struct macb, phylink_usx_pcs); in macb_usx_pcs_get_state()
603 struct macb *bp = container_of(pcs, struct macb, phylink_usx_pcs); in macb_usx_pcs_config()
647 struct macb *bp = netdev_priv(ndev); in macb_mac_config()
705 struct macb *bp = netdev_priv(ndev); in macb_mac_link_down()
729 struct macb *bp = netdev_priv(ndev); in macb_mac_link_up()
795 struct macb *bp = netdev_priv(ndev); in macb_mac_select_pcs()
819 static int macb_phylink_connect(struct macb *bp) in macb_phylink_connect()
854 struct macb *bp = netdev_priv(ndev); in macb_get_pcs_fixed_state()
862 struct macb *bp = netdev_priv(dev); in macb_mii_probe()
918 static int macb_mdiobus_register(struct macb *bp) in macb_mdiobus_register()
951 static int macb_mii_init(struct macb *bp) in macb_mii_init()
958 * In that case, some devices may be attached to the MACB's MDIO bus. in macb_mii_init()
1005 static void macb_update_stats(struct macb *bp) in macb_update_stats()
1007 u32 *p = &bp->hw_stats.macb.rx_pause_frames; in macb_update_stats()
1008 u32 *end = &bp->hw_stats.macb.tx_pause_frames + 1; in macb_update_stats()
1017 static int macb_halt_tx(struct macb *bp) in macb_halt_tx()
1037 static void macb_tx_unmap(struct macb *bp, struct macb_tx_skb *tx_skb, int budget) in macb_tx_unmap()
1055 static void macb_set_addr(struct macb *bp, struct macb_dma_desc *desc, dma_addr_t addr) in macb_set_addr()
1073 static dma_addr_t macb_get_addr(struct macb *bp, struct macb_dma_desc *desc) in macb_get_addr()
1097 struct macb *bp = queue->bp; in macb_tx_error_task()
1112 * network engine about the macb/gem being halted. in macb_tx_error_task()
1122 * macb/gem must be halted to write TBQP register in macb_tx_error_task()
1242 struct macb *bp = queue->bp; in macb_tx_complete()
1317 struct macb *bp = queue->bp; in gem_rx_refill()
1399 struct macb *bp = queue->bp; in gem_rx()
1495 struct macb *bp = queue->bp; in macb_rx_frame()
1571 struct macb *bp = queue->bp; in macb_init_rx_ring()
1590 struct macb *bp = queue->bp; in macb_rx()
1668 struct macb *bp = queue->bp; in macb_rx_pending()
1684 struct macb *bp = queue->bp; in macb_rx_poll()
1721 struct macb *bp = queue->bp; in macb_tx_restart()
1763 struct macb *bp = queue->bp; in macb_tx_poll()
1805 struct macb *bp = from_work(bp, work, hresp_err_bh_work); in macb_hresp_error_task()
1845 struct macb *bp = queue->bp; in macb_wol_interrupt()
1858 netdev_vdbg(bp->dev, "MACB WoL: queue = %u, isr = 0x%08lx\n", in macb_wol_interrupt()
1874 struct macb *bp = queue->bp; in gem_wol_interrupt()
1903 struct macb *bp = queue->bp; in macb_interrupt()
1998 bp->hw_stats.macb.rx_overruns++; in macb_interrupt()
2025 struct macb *bp = netdev_priv(dev); in macb_poll_controller()
2037 static unsigned int macb_tx_map(struct macb *bp, in macb_tx_map()
2318 struct macb *bp = netdev_priv(dev); in macb_start_xmit()
2417 static void macb_init_rx_buffer_size(struct macb *bp, size_t size) in macb_init_rx_buffer_size()
2437 static void gem_free_rx_buffers(struct macb *bp) in gem_free_rx_buffers()
2470 static void macb_free_rx_buffers(struct macb *bp) in macb_free_rx_buffers()
2482 static void macb_free_consistent(struct macb *bp) in macb_free_consistent()
2514 static int gem_alloc_rx_buffers(struct macb *bp) in gem_alloc_rx_buffers()
2533 static int macb_alloc_rx_buffers(struct macb *bp) in macb_alloc_rx_buffers()
2550 static int macb_alloc_consistent(struct macb *bp) in macb_alloc_consistent()
2602 static void macb_init_tieoff(struct macb *bp) in macb_init_tieoff()
2615 static void gem_init_rings(struct macb *bp) in gem_init_rings()
2641 static void macb_init_rings(struct macb *bp) in macb_init_rings()
2660 static void macb_reset_hw(struct macb *bp) in macb_reset_hw()
2692 static u32 gem_mdc_clk_div(struct macb *bp) in gem_mdc_clk_div()
2717 static u32 macb_mdc_clk_div(struct macb *bp) in macb_mdc_clk_div()
2742 static u32 macb_dbw(struct macb *bp) in macb_dbw()
2765 static void macb_configure_dma(struct macb *bp) in macb_configure_dma()
2811 static void macb_init_hw(struct macb *bp) in macb_init_hw()
2908 struct macb *bp = netdev_priv(dev); in macb_sethashtable()
2926 struct macb *bp = netdev_priv(dev); in macb_set_rx_mode()
2968 struct macb *bp = netdev_priv(dev); in macb_open()
3028 struct macb *bp = netdev_priv(dev); in macb_close()
3082 static void gem_update_stats(struct macb *bp) in gem_update_stats()
3111 static struct net_device_stats *gem_get_stats(struct macb *bp) in gem_get_stats()
3155 struct macb *bp; in gem_get_ethtool_stats()
3165 struct macb *bp = netdev_priv(dev); in gem_get_sset_count()
3178 struct macb *bp = netdev_priv(dev); in gem_get_ethtool_strings()
3202 struct macb *bp = netdev_priv(dev); in macb_get_stats()
3204 struct macb_stats *hwstat = &bp->hw_stats.macb; in macb_get_stats()
3255 struct macb *bp = netdev_priv(dev); in macb_get_regs()
3287 struct macb *bp = netdev_priv(netdev); in macb_get_wol()
3292 /* Add macb wolopts to phy wolopts */ in macb_get_wol()
3298 struct macb *bp = netdev_priv(netdev); in macb_set_wol()
3319 struct macb *bp = netdev_priv(netdev); in macb_get_link_ksettings()
3327 struct macb *bp = netdev_priv(netdev); in macb_set_link_ksettings()
3337 struct macb *bp = netdev_priv(netdev); in macb_get_ringparam()
3351 struct macb *bp = netdev_priv(netdev); in macb_set_ringparam()
3387 static unsigned int gem_get_tsu_rate(struct macb *bp) in gem_get_tsu_rate()
3412 struct macb *bp = netdev_priv(dev); in gem_get_ts_info()
3452 struct macb *bp = netdev_priv(netdev); in macb_get_ts_info()
3460 static void gem_enable_flow_filters(struct macb *bp, bool enable) in gem_enable_flow_filters()
3506 static void gem_prog_cmp_regs(struct macb *bp, struct ethtool_rx_flow_spec *fs) in gem_prog_cmp_regs()
3592 struct macb *bp = netdev_priv(netdev); in gem_add_flow_filter()
3647 struct macb *bp = netdev_priv(netdev); in gem_del_flow_filter()
3683 struct macb *bp = netdev_priv(netdev); in gem_get_flow_entry()
3698 struct macb *bp = netdev_priv(netdev); in gem_get_all_flow_entries()
3717 struct macb *bp = netdev_priv(netdev); in gem_get_rxnfc()
3744 struct macb *bp = netdev_priv(netdev); in gem_set_rxnfc()
3801 struct macb *bp = netdev_priv(dev); in macb_ioctl()
3812 struct macb *bp = netdev_priv(dev); in macb_hwtstamp_get()
3827 struct macb *bp = netdev_priv(dev); in macb_hwtstamp_set()
3838 static inline void macb_set_txcsum_feature(struct macb *bp, in macb_set_txcsum_feature()
3855 static inline void macb_set_rxcsum_feature(struct macb *bp, in macb_set_rxcsum_feature()
3873 static inline void macb_set_rxflow_feature(struct macb *bp, in macb_set_rxflow_feature()
3885 struct macb *bp = netdev_priv(netdev); in macb_set_features()
3903 static void macb_restore_features(struct macb *bp) in macb_restore_features()
3944 static void macb_configure_caps(struct macb *bp, in macb_configure_caps()
3990 /* is it macb or gem ? in macb_probe_queues()
4107 struct macb *bp = netdev_priv(dev); in macb_init()
4277 static int at91ether_alloc_coherent(struct macb *lp) in at91ether_alloc_coherent()
4304 static void at91ether_free_coherent(struct macb *lp) in at91ether_free_coherent()
4326 static int at91ether_start(struct macb *lp) in at91ether_start()
4371 static void at91ether_stop(struct macb *lp) in at91ether_stop()
4395 struct macb *lp = netdev_priv(dev); in at91ether_open()
4431 struct macb *lp = netdev_priv(dev); in at91ether_close()
4447 struct macb *lp = netdev_priv(dev); in at91ether_start_xmit()
4484 struct macb *lp = netdev_priv(dev); in at91ether_rx()
4528 struct macb *lp = netdev_priv(dev); in at91ether_interrupt()
4627 struct macb *bp = netdev_priv(dev); in at91ether_init()
4757 struct macb *bp = netdev_priv(dev); in init_reset_optional()
4962 { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
4963 { .compatible = "cdns,macb" },
4964 { .compatible = "cdns,np4-macb", .data = &np4_config },
4967 { .compatible = "cdns,sam9x60-macb", .data = &at91sam9260_config },
4971 { .compatible = "atmel,sama5d3-macb", .data = &sama5d3macb_config },
4978 { .compatible = "microchip,mpfs-macb", .data = &mpfs_config },
5017 struct macb *bp; in macb_probe()
5187 macb_is_gem(bp) ? "GEM" : "MACB", macb_readl(bp, MID), in macb_probe()
5217 struct macb *bp; in macb_remove()
5244 struct macb *bp = netdev_priv(netdev); in macb_suspend()
5375 struct macb *bp = netdev_priv(netdev); in macb_resume()
5458 struct macb *bp = netdev_priv(netdev); in macb_runtime_suspend()
5471 struct macb *bp = netdev_priv(netdev); in macb_runtime_resume()
5495 .name = "macb",
5504 MODULE_DESCRIPTION("Cadence MACB/GEM Ethernet driver");
5506 MODULE_ALIAS("platform:macb");