Lines Matching refs:txgbe
23 static int txgbe_swnodes_register(struct txgbe *txgbe) in txgbe_swnodes_register() argument
25 struct txgbe_nodes *nodes = &txgbe->nodes; in txgbe_swnodes_register()
26 struct pci_dev *pdev = txgbe->wx->pdev; in txgbe_swnodes_register()
122 static int txgbe_mdio_pcs_init(struct txgbe *txgbe) in txgbe_mdio_pcs_init() argument
130 wx = txgbe->wx; in txgbe_mdio_pcs_init()
154 txgbe->xpcs = xpcs; in txgbe_mdio_pcs_init()
162 struct txgbe *txgbe = netdev_to_txgbe(to_net_dev(config->dev)); in txgbe_phylink_mac_select() local
165 return &txgbe->xpcs->pcs; in txgbe_phylink_mac_select()
248 static int txgbe_phylink_init(struct txgbe *txgbe) in txgbe_phylink_init() argument
252 struct wx *wx = txgbe->wx; in txgbe_phylink_init()
270 fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_PHYLINK]); in txgbe_phylink_init()
290 txgbe->phylink = phylink; in txgbe_phylink_init()
453 struct txgbe *txgbe = wx->priv; in txgbe_irq_handler() local
466 gc = txgbe->gpio; in txgbe_irq_handler()
486 phylink_mac_change(txgbe->phylink, !!(reg & TXGBE_CFG_PORT_ST_LINK_UP)); in txgbe_irq_handler()
493 static int txgbe_gpio_init(struct txgbe *txgbe) in txgbe_gpio_init() argument
501 wx = txgbe->wx; in txgbe_gpio_init()
519 gc->fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_GPIO]); in txgbe_gpio_init()
542 txgbe->gpio = gc; in txgbe_gpio_init()
547 static int txgbe_clock_register(struct txgbe *txgbe) in txgbe_clock_register() argument
549 struct pci_dev *pdev = txgbe->wx->pdev; in txgbe_clock_register()
567 txgbe->clk = clk; in txgbe_clock_register()
568 txgbe->clock = clock; in txgbe_clock_register()
599 static int txgbe_i2c_register(struct txgbe *txgbe) in txgbe_i2c_register() argument
607 wx = txgbe->wx; in txgbe_i2c_register()
616 info.fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_I2C]); in txgbe_i2c_register()
626 txgbe->i2c_dev = i2c_dev; in txgbe_i2c_register()
631 static int txgbe_sfp_register(struct txgbe *txgbe) in txgbe_sfp_register() argument
633 struct pci_dev *pdev = txgbe->wx->pdev; in txgbe_sfp_register()
638 info.fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_SFP]); in txgbe_sfp_register()
645 txgbe->sfp_dev = sfp_dev; in txgbe_sfp_register()
702 static int txgbe_ext_phy_init(struct txgbe *txgbe) in txgbe_ext_phy_init() argument
710 wx = txgbe->wx; in txgbe_ext_phy_init()
745 ret = txgbe_phylink_init(txgbe); in txgbe_ext_phy_init()
754 int txgbe_init_phy(struct txgbe *txgbe) in txgbe_init_phy() argument
758 if (txgbe->wx->media_type == sp_media_copper) in txgbe_init_phy()
759 return txgbe_ext_phy_init(txgbe); in txgbe_init_phy()
761 ret = txgbe_swnodes_register(txgbe); in txgbe_init_phy()
763 wx_err(txgbe->wx, "failed to register software nodes\n"); in txgbe_init_phy()
767 ret = txgbe_mdio_pcs_init(txgbe); in txgbe_init_phy()
769 wx_err(txgbe->wx, "failed to init mdio pcs: %d\n", ret); in txgbe_init_phy()
773 ret = txgbe_phylink_init(txgbe); in txgbe_init_phy()
775 wx_err(txgbe->wx, "failed to init phylink\n"); in txgbe_init_phy()
779 ret = txgbe_gpio_init(txgbe); in txgbe_init_phy()
781 wx_err(txgbe->wx, "failed to init gpio\n"); in txgbe_init_phy()
785 ret = txgbe_clock_register(txgbe); in txgbe_init_phy()
787 wx_err(txgbe->wx, "failed to register clock: %d\n", ret); in txgbe_init_phy()
791 ret = txgbe_i2c_register(txgbe); in txgbe_init_phy()
793 wx_err(txgbe->wx, "failed to init i2c interface: %d\n", ret); in txgbe_init_phy()
797 ret = txgbe_sfp_register(txgbe); in txgbe_init_phy()
799 wx_err(txgbe->wx, "failed to register sfp\n"); in txgbe_init_phy()
806 platform_device_unregister(txgbe->i2c_dev); in txgbe_init_phy()
808 clkdev_drop(txgbe->clock); in txgbe_init_phy()
809 clk_unregister(txgbe->clk); in txgbe_init_phy()
811 phylink_destroy(txgbe->phylink); in txgbe_init_phy()
813 xpcs_destroy(txgbe->xpcs); in txgbe_init_phy()
815 software_node_unregister_node_group(txgbe->nodes.group); in txgbe_init_phy()
820 void txgbe_remove_phy(struct txgbe *txgbe) in txgbe_remove_phy() argument
822 if (txgbe->wx->media_type == sp_media_copper) { in txgbe_remove_phy()
823 phylink_disconnect_phy(txgbe->phylink); in txgbe_remove_phy()
824 phylink_destroy(txgbe->phylink); in txgbe_remove_phy()
828 platform_device_unregister(txgbe->sfp_dev); in txgbe_remove_phy()
829 platform_device_unregister(txgbe->i2c_dev); in txgbe_remove_phy()
830 clkdev_drop(txgbe->clock); in txgbe_remove_phy()
831 clk_unregister(txgbe->clk); in txgbe_remove_phy()
832 phylink_destroy(txgbe->phylink); in txgbe_remove_phy()
833 xpcs_destroy(txgbe->xpcs); in txgbe_remove_phy()
834 software_node_unregister_node_group(txgbe->nodes.group); in txgbe_remove_phy()