Lines Matching refs:eth
70 static int sh_eth_send_common(struct sh_eth_dev *eth, void *packet, int len) in sh_eth_send_common() argument
73 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_send_common()
127 static int sh_eth_recv_start(struct sh_eth_dev *eth) in sh_eth_recv_start() argument
129 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_recv_start()
143 static void sh_eth_recv_finish(struct sh_eth_dev *eth) in sh_eth_recv_finish() argument
145 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_recv_finish()
163 static int sh_eth_reset(struct sh_eth_dev *eth) in sh_eth_reset() argument
165 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_reset()
196 static int sh_eth_tx_desc_init(struct sh_eth_dev *eth) in sh_eth_tx_desc_init() argument
200 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_tx_desc_init()
249 static int sh_eth_rx_desc_init(struct sh_eth_dev *eth) in sh_eth_rx_desc_init() argument
253 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_rx_desc_init()
322 static void sh_eth_tx_desc_free(struct sh_eth_dev *eth) in sh_eth_tx_desc_free() argument
324 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_tx_desc_free()
332 static void sh_eth_rx_desc_free(struct sh_eth_dev *eth) in sh_eth_rx_desc_free() argument
334 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_rx_desc_free()
347 static int sh_eth_desc_init(struct sh_eth_dev *eth) in sh_eth_desc_init() argument
351 ret = sh_eth_tx_desc_init(eth); in sh_eth_desc_init()
355 ret = sh_eth_rx_desc_init(eth); in sh_eth_desc_init()
361 sh_eth_tx_desc_free(eth); in sh_eth_desc_init()
379 static void sh_eth_mac_regs_config(struct sh_eth_dev *eth, unsigned char *mac) in sh_eth_mac_regs_config() argument
381 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_mac_regs_config()
426 static int sh_eth_phy_regs_config(struct sh_eth_dev *eth) in sh_eth_phy_regs_config() argument
428 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_phy_regs_config()
474 static void sh_eth_start(struct sh_eth_dev *eth) in sh_eth_start() argument
476 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_start()
485 static void sh_eth_stop(struct sh_eth_dev *eth) in sh_eth_stop() argument
487 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_stop()
492 static int sh_eth_init_common(struct sh_eth_dev *eth, unsigned char *mac) in sh_eth_init_common() argument
496 ret = sh_eth_reset(eth); in sh_eth_init_common()
500 ret = sh_eth_desc_init(eth); in sh_eth_init_common()
504 sh_eth_mac_regs_config(eth, mac); in sh_eth_init_common()
509 static int sh_eth_start_common(struct sh_eth_dev *eth) in sh_eth_start_common() argument
511 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_start_common()
520 ret = sh_eth_phy_regs_config(eth); in sh_eth_start_common()
524 sh_eth_start(eth); in sh_eth_start_common()
530 static int sh_eth_phy_config_legacy(struct sh_eth_dev *eth) in sh_eth_phy_config_legacy() argument
533 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_phy_config_legacy()
548 struct sh_eth_dev *eth = dev->priv; in sh_eth_send_legacy() local
550 return sh_eth_send_common(eth, packet, len); in sh_eth_send_legacy()
553 static int sh_eth_recv_common(struct sh_eth_dev *eth) in sh_eth_recv_common() argument
556 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_recv_common()
559 len = sh_eth_recv_start(eth); in sh_eth_recv_common()
563 sh_eth_recv_finish(eth); in sh_eth_recv_common()
576 struct sh_eth_dev *eth = dev->priv; in sh_eth_recv_legacy() local
578 return sh_eth_recv_common(eth); in sh_eth_recv_legacy()
583 struct sh_eth_dev *eth = dev->priv; in sh_eth_init_legacy() local
586 ret = sh_eth_init_common(eth, dev->enetaddr); in sh_eth_init_legacy()
590 ret = sh_eth_phy_config_legacy(eth); in sh_eth_init_legacy()
596 ret = sh_eth_start_common(eth); in sh_eth_init_legacy()
603 sh_eth_tx_desc_free(eth); in sh_eth_init_legacy()
604 sh_eth_rx_desc_free(eth); in sh_eth_init_legacy()
610 struct sh_eth_dev *eth = dev->priv; in sh_eth_halt_legacy() local
612 sh_eth_stop(eth); in sh_eth_halt_legacy()
618 struct sh_eth_dev *eth = NULL; in sh_eth_initialize() local
622 eth = (struct sh_eth_dev *)malloc(sizeof(struct sh_eth_dev)); in sh_eth_initialize()
623 if (!eth) { in sh_eth_initialize()
636 memset(eth, 0, sizeof(struct sh_eth_dev)); in sh_eth_initialize()
638 eth->port = CONFIG_SH_ETHER_USE_PORT; in sh_eth_initialize()
639 eth->port_info[eth->port].phy_addr = CONFIG_SH_ETHER_PHY_ADDR; in sh_eth_initialize()
640 eth->port_info[eth->port].iobase = in sh_eth_initialize()
641 (void __iomem *)(BASE_IO_ADDR + 0x800 * eth->port); in sh_eth_initialize()
643 dev->priv = (void *)eth; in sh_eth_initialize()
649 eth->port_info[eth->port].dev = dev; in sh_eth_initialize()
656 bb_miiphy_buses[0].priv = eth; in sh_eth_initialize()
677 if (eth) in sh_eth_initialize()
678 free(eth); in sh_eth_initialize()
698 struct sh_eth_dev *eth = &priv->shdev; in sh_ether_send() local
700 return sh_eth_send_common(eth, packet, len); in sh_ether_send()
706 struct sh_eth_dev *eth = &priv->shdev; in sh_ether_recv() local
707 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_ether_recv()
711 len = sh_eth_recv_start(eth); in sh_ether_recv()
731 struct sh_eth_dev *eth = &priv->shdev; in sh_ether_free_pkt() local
732 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_ether_free_pkt()
734 sh_eth_recv_finish(eth); in sh_ether_free_pkt()
746 struct sh_eth_dev *eth = &priv->shdev; in sh_ether_write_hwaddr() local
747 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_ether_write_hwaddr()
759 struct sh_eth_dev *eth = &priv->shdev; in sh_eth_phy_config() local
761 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_phy_config()
781 struct sh_eth_dev *eth = &priv->shdev; in sh_ether_start() local
784 ret = sh_eth_init_common(eth, pdata->enetaddr); in sh_ether_start()
788 ret = sh_eth_start_common(eth); in sh_ether_start()
795 sh_eth_tx_desc_free(eth); in sh_ether_start()
796 sh_eth_rx_desc_free(eth); in sh_ether_start()
803 struct sh_eth_dev *eth = &priv->shdev; in sh_ether_stop() local
804 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_ether_stop()
814 struct sh_eth_dev *eth = &priv->shdev; in sh_ether_probe() local
846 bb_miiphy_buses[0].priv = eth; in sh_ether_probe()
855 eth->port = CONFIG_SH_ETHER_USE_PORT; in sh_ether_probe()
856 eth->port_info[eth->port].phy_addr = CONFIG_SH_ETHER_PHY_ADDR; in sh_ether_probe()
857 eth->port_info[eth->port].iobase = in sh_ether_probe()
858 (void __iomem *)(uintptr_t)(BASE_IO_ADDR + 0x800 * eth->port); in sh_ether_probe()
866 ret = sh_eth_init_common(eth, pdata->enetaddr); in sh_ether_probe()
890 struct sh_eth_dev *eth = &priv->shdev; in sh_ether_remove() local
891 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_ether_remove()
975 struct sh_eth_dev *eth = bus->priv; in sh_eth_bb_mdio_active() local
976 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_bb_mdio_active()
985 struct sh_eth_dev *eth = bus->priv; in sh_eth_bb_mdio_tristate() local
986 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_bb_mdio_tristate()
995 struct sh_eth_dev *eth = bus->priv; in sh_eth_bb_set_mdio() local
996 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_bb_set_mdio()
1010 struct sh_eth_dev *eth = bus->priv; in sh_eth_bb_get_mdio() local
1011 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_bb_get_mdio()
1020 struct sh_eth_dev *eth = bus->priv; in sh_eth_bb_set_mdc() local
1021 struct sh_eth_info *port_info = ð->port_info[eth->port]; in sh_eth_bb_set_mdc()