本文整理汇总了C++中phy_disconnect函数的典型用法代码示例。如果您正苦于以下问题:C++ phy_disconnect函数的具体用法?C++ phy_disconnect怎么用?C++ phy_disconnect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phy_disconnect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bcmgenet_mii_probe
int bcmgenet_mii_probe(struct net_device *dev)
{
struct bcmgenet_priv *priv = netdev_priv(dev);
struct device_node *dn = priv->pdev->dev.of_node;
struct phy_device *phydev;
u32 phy_flags;
int ret;
/* Communicate the integrated PHY revision */
phy_flags = priv->gphy_rev;
/* Initialize link state variables that bcmgenet_mii_setup() uses */
priv->old_link = -1;
priv->old_speed = -1;
priv->old_duplex = -1;
priv->old_pause = -1;
if (dn) {
phydev = of_phy_connect(dev, priv->phy_dn, bcmgenet_mii_setup,
phy_flags, priv->phy_interface);
if (!phydev) {
pr_err("could not attach to PHY\n");
return -ENODEV;
}
} else {
phydev = dev->phydev;
phydev->dev_flags = phy_flags;
ret = phy_connect_direct(dev, phydev, bcmgenet_mii_setup,
priv->phy_interface);
if (ret) {
pr_err("could not attach to PHY\n");
return -ENODEV;
}
}
/* Configure port multiplexer based on what the probed PHY device since
* reading the 'max-speed' property determines the maximum supported
* PHY speed which is needed for bcmgenet_mii_config() to configure
* things appropriately.
*/
ret = bcmgenet_mii_config(dev, true);
if (ret) {
phy_disconnect(dev->phydev);
return ret;
}
linkmode_copy(phydev->advertising, phydev->supported);
/* The internal PHY has its link interrupts routed to the
* Ethernet MAC ISRs. On GENETv5 there is a hardware issue
* that prevents the signaling of link UP interrupts when
* the link operates at 10Mbps, so fallback to polling for
* those versions of GENET.
*/
if (priv->internal_phy && !GENET_IS_V5(priv))
dev->phydev->irq = PHY_IGNORE_INTERRUPT;
return 0;
}
示例2: emac_mdio_remove
static void emac_mdio_remove(struct net_device *dev)
{
struct emac_board_info *db = netdev_priv(dev);
phy_disconnect(db->phy_dev);
db->phy_dev = NULL;
}
示例3: hieth_platdev_remove_port
static int hieth_platdev_remove_port(struct platform_device *pdev, int port)
{
struct net_device *ndev;
struct hieth_netdev_local *ld;
ndev = hieth_devs_save[port];
if (!ndev)
goto _ndev_exit;
ld = netdev_priv(ndev);
unregister_netdev(ndev);
hieth_destroy_skb_buffers(ld);
phy_disconnect(ld->phy);
ld->phy = NULL;
iounmap((void *)ld->iobase);
local_lock_exit();
hieth_devs_save[port] = NULL;
free_netdev(ndev);
_ndev_exit:
return 0;
}
示例4: yatse_stop
static int yatse_stop(struct net_device *ndev){
struct yatse_private *priv = netdev_priv(ndev);
unsigned long flags;
napi_disable(&priv->napi);
printk(KERN_INFO "yatse: shutdown\n");
spin_lock_irqsave(&priv->mac_lock, flags);
priv->link = 0;
if(priv->phy_irq != PHY_POLL) phy_stop_interrupts(priv->phydev);
phy_disconnect(priv->phydev);
spin_unlock_irqrestore(&priv->mac_lock, flags);
disable_irq(priv->dma.rx_irq);
disable_irq(priv->dma.tx_irq);
netif_stop_queue(ndev);
spin_lock_irqsave(&priv->dma.rx_lock, flags);
spin_lock(&priv->dma.tx_lock);
yatse_dma_stop(&priv->dma);
spin_unlock(&priv->dma.tx_lock);
spin_unlock_irqrestore(&priv->dma.rx_lock, flags);
tasklet_kill(&priv->tx_tasklet);
napi_disable(&priv->napi);
printk(KERN_INFO "yatse: shutdown complete\n");
return 0;
}
示例5: cvm_oct_common_uninit
void cvm_oct_common_uninit(struct net_device *dev)
{
struct octeon_ethernet *priv = netdev_priv(dev);
if (priv->phydev)
phy_disconnect(priv->phydev);
}
示例6: octeon_mgmt_stop
static int octeon_mgmt_stop(struct net_device *netdev)
{
struct octeon_mgmt *p = netdev_priv(netdev);
napi_disable(&p->napi);
netif_stop_queue(netdev);
if (p->phydev)
phy_disconnect(p->phydev);
p->phydev = NULL;
netif_carrier_off(netdev);
octeon_mgmt_reset_hw(p);
free_irq(p->irq, netdev);
/* dma_unmap is a nop on Octeon, so just free everything. */
skb_queue_purge(&p->tx_list);
skb_queue_purge(&p->rx_list);
dma_unmap_single(p->dev, p->rx_ring_handle,
ring_size_to_bytes(OCTEON_MGMT_RX_RING_SIZE),
DMA_BIDIRECTIONAL);
kfree(p->rx_ring);
dma_unmap_single(p->dev, p->tx_ring_handle,
ring_size_to_bytes(OCTEON_MGMT_TX_RING_SIZE),
DMA_BIDIRECTIONAL);
kfree(p->tx_ring);
return 0;
}
示例7: cpsw_slave_stop
static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
{
if (!slave->phy)
return;
phy_stop(slave->phy);
phy_disconnect(slave->phy);
slave->phy = NULL;
}
示例8: dsa_slave_destroy
void dsa_slave_destroy(struct net_device *slave_dev)
{
struct dsa_slave_priv *p = netdev_priv(slave_dev);
netif_carrier_off(slave_dev);
if (p->phy)
phy_disconnect(p->phy);
unregister_netdev(slave_dev);
free_netdev(slave_dev);
}
示例9: arc_emac_remove
static int arc_emac_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct arc_emac_priv *priv = netdev_priv(ndev);
phy_disconnect(priv->phy_dev);
priv->phy_dev = NULL;
arc_mdio_remove(priv);
unregister_netdev(ndev);
netif_napi_del(&priv->napi);
free_netdev(ndev);
return 0;
}
示例10: eth_remove_one
static int __devexit eth_remove_one(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
struct port *port = netdev_priv(dev);
unregister_netdev(dev);
phy_disconnect(port->phydev);
npe_port_tab[NPE_ID(port->id)] = NULL;
platform_set_drvdata(pdev, NULL);
npe_release(port->npe);
release_resource(port->mem_res);
free_netdev(dev);
return 0;
}
示例11: ax88172a_stop
static int ax88172a_stop(struct usbnet *dev)
{
struct ax88172a_private *priv = dev->driver_priv;
netdev_dbg(dev->net, "Stopping interface\n");
if (priv->phydev) {
netdev_info(dev->net, "Disconnecting from phy %s\n",
priv->phy_name);
phy_stop(priv->phydev);
phy_disconnect(priv->phydev);
}
return 0;
}
示例12: at91ether_remove
static int at91ether_remove(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
struct macb *lp = netdev_priv(dev);
if (lp->phy_dev)
phy_disconnect(lp->phy_dev);
mdiobus_unregister(lp->mii_bus);
kfree(lp->mii_bus->irq);
mdiobus_free(lp->mii_bus);
unregister_netdev(dev);
clk_disable(lp->pclk);
free_netdev(dev);
return 0;
}
示例13: phylink_disconnect_phy
/**
* phylink_disconnect_phy() - disconnect any PHY attached to the phylink
* instance.
* @pl: a pointer to a &struct phylink returned from phylink_create()
*
* Disconnect any current PHY from the phylink instance described by @pl.
*/
void phylink_disconnect_phy(struct phylink *pl)
{
struct phy_device *phy;
ASSERT_RTNL();
phy = pl->phydev;
if (phy) {
mutex_lock(&phy->lock);
mutex_lock(&pl->state_mutex);
pl->phydev = NULL;
mutex_unlock(&pl->state_mutex);
mutex_unlock(&phy->lock);
flush_work(&pl->resolve);
phy_disconnect(phy);
}
}
示例14: hip04_remove
static int hip04_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct hip04_priv *priv = netdev_priv(ndev);
struct device *d = &pdev->dev;
if (priv->phy)
phy_disconnect(priv->phy);
hip04_free_ring(ndev, d);
unregister_netdev(ndev);
free_irq(ndev->irq, ndev);
of_node_put(priv->phy_node);
cancel_work_sync(&priv->tx_timeout_task);
free_netdev(ndev);
return 0;
}
示例15: phylink_disconnect_phy
void phylink_disconnect_phy(struct phylink *pl)
{
struct phy_device *phy;
WARN_ON(!lockdep_rtnl_is_held());
phy = pl->phydev;
if (phy) {
mutex_lock(&phy->lock);
mutex_lock(&pl->state_mutex);
pl->netdev->phydev = NULL;
pl->phydev = NULL;
mutex_unlock(&pl->state_mutex);
mutex_unlock(&phy->lock);
flush_work(&pl->resolve);
phy_disconnect(phy);
}
}