• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ phy_ethtool_sset函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中phy_ethtool_sset函数的典型用法代码示例。如果您正苦于以下问题:C++ phy_ethtool_sset函数的具体用法?C++ phy_ethtool_sset怎么用?C++ phy_ethtool_sset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了phy_ethtool_sset函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: bgmac_set_settings

static int bgmac_set_settings(struct net_device *net_dev,
			      struct ethtool_cmd *cmd)
{
	struct bgmac *bgmac = netdev_priv(net_dev);

	return phy_ethtool_sset(bgmac->phy_dev, cmd);
}
开发者ID:545191228,项目名称:linux,代码行数:7,代码来源:bgmac.c


示例2: fe_set_settings

static int fe_set_settings(struct net_device *dev,
		struct ethtool_cmd *cmd)
{
	struct fe_priv *priv = netdev_priv(dev);

	if (!priv->phy_dev)
		goto out_sset;

	if (cmd->phy_address != priv->phy_dev->addr) {
		if (priv->phy->phy_node[cmd->phy_address]) {
			priv->phy_dev = priv->phy->phy[cmd->phy_address];
			priv->phy_flags = FE_PHY_FLAG_PORT;
		} else if (priv->mii_bus &&
				priv->mii_bus->phy_map[cmd->phy_address]) {
			priv->phy_dev = priv->mii_bus->phy_map[cmd->phy_address];
			priv->phy_flags = FE_PHY_FLAG_ATTACH;
		} else
			goto out_sset;
	}

	return phy_ethtool_sset(priv->phy_dev, cmd);

out_sset:
	return -ENODEV;
}
开发者ID:2812015651,项目名称:openwrt,代码行数:25,代码来源:ralink_ethtool.c


示例3: stmmac_ethtool_setsettings

static int stmmac_ethtool_setsettings(struct net_device *dev,
				      struct ethtool_cmd *cmd)
{
	struct stmmac_priv *priv = netdev_priv(dev);
	struct phy_device *phy = priv->phydev;
	int rc;

	if ((priv->pcs & STMMAC_PCS_RGMII) || (priv->pcs & STMMAC_PCS_SGMII)) {
		u32 mask = ADVERTISED_Autoneg | ADVERTISED_Pause;

		/* Only support ANE */
		if (cmd->autoneg != AUTONEG_ENABLE)
			return -EINVAL;

		mask &= (ADVERTISED_1000baseT_Half |
			ADVERTISED_1000baseT_Full |
			ADVERTISED_100baseT_Half |
			ADVERTISED_100baseT_Full |
			ADVERTISED_10baseT_Half |
			ADVERTISED_10baseT_Full);

		spin_lock(&priv->lock);
		if (priv->hw->mac->ctrl_ane)
			priv->hw->mac->ctrl_ane(priv->hw, 1);
		spin_unlock(&priv->lock);

		return 0;
	}

	spin_lock(&priv->lock);
	rc = phy_ethtool_sset(phy, cmd);
	spin_unlock(&priv->lock);

	return rc;
}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:35,代码来源:stmmac_ethtool.c


示例4: sh_eth_set_settings

static int sh_eth_set_settings(struct net_device *ndev,
		struct ethtool_cmd *ecmd)
{
	struct sh_eth_private *mdp = netdev_priv(ndev);
	unsigned long flags;
	int ret;

	spin_lock_irqsave(&mdp->lock, flags);

	/* disable tx and rx */
	sh_eth_rcv_snd_disable(ndev);

	ret = phy_ethtool_sset(mdp->phydev, ecmd);
	if (ret)
		goto error_exit;

	if (ecmd->duplex == DUPLEX_FULL)
		mdp->duplex = 1;
	else
		mdp->duplex = 0;

	if (mdp->cd->set_duplex)
		mdp->cd->set_duplex(ndev);

error_exit:
	mdelay(1);

	/* enable tx and rx */
	sh_eth_rcv_snd_enable(ndev);

	spin_unlock_irqrestore(&mdp->lock, flags);

	return ret;
}
开发者ID:andi34,项目名称:Dhollmen_Kernel,代码行数:34,代码来源:sh_eth.c


示例5: sxgbe_setsettings

static int sxgbe_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct sxgbe_priv_data *priv = netdev_priv(dev);

	if (priv->phydev)
		return phy_ethtool_sset(priv->phydev, cmd);

	return -EOPNOTSUPP;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:9,代码来源:sxgbe_ethtool.c


示例6: fs_set_settings

static int fs_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct fs_enet_private *fep = netdev_priv(dev);

	if (!fep->phydev)
		return -ENODEV;

	return phy_ethtool_sset(fep->phydev, cmd);
}
开发者ID:7799,项目名称:linux,代码行数:9,代码来源:fs_enet-main.c


示例7: dsa_slave_set_settings

static int
dsa_slave_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct dsa_slave_priv *p = netdev_priv(dev);

	if (p->phy != NULL)
		return phy_ethtool_sset(p->phy, cmd);

	return -EOPNOTSUPP;
}
开发者ID:andy-shev,项目名称:linux,代码行数:10,代码来源:slave.c


示例8: tse_set_settings

static int tse_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct alt_tse_private *priv = netdev_priv(dev);
	struct phy_device *phydev = priv->phydev;

	if (phydev == NULL)
		return -ENODEV;

	return phy_ethtool_sset(phydev, cmd);
}
开发者ID:sunjiangbo,项目名称:terasic_MTL,代码行数:10,代码来源:altera_tse_ethtool.c


示例9: gfar_ssettings

static int gfar_ssettings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct gfar_private *priv = netdev_priv(dev);
	struct phy_device *phydev = priv->phydev;

	if (NULL == phydev)
		return -ENODEV;

	return phy_ethtool_sset(phydev, cmd);
}
开发者ID:c444b774,项目名称:linux,代码行数:10,代码来源:gianfar_ethtool.c


示例10: emac_set_settings

static int emac_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct emac_board_info *dm = netdev_priv(dev);
	struct phy_device *phydev = dm->phy_dev;

	if (!phydev)
		return -ENODEV;

	return phy_ethtool_sset(phydev, cmd);
}
开发者ID:DenisLug,项目名称:mptcp,代码行数:10,代码来源:sun4i-emac.c


示例11: arc_emac_set_settings

/**
 * arc_emac_set_settings - Set PHY settings as passed in the argument.
 * @ndev:	Pointer to net_device structure.
 * @cmd:	Pointer to ethtool_cmd structure.
 *
 * This implements ethtool command for setting various PHY settings. If PHY
 * could not be found, the function returns -ENODEV. This function calls the
 * relevant PHY ethtool API to set the PHY.
 * Issue e.g. "ethtool -s ethX speed 1000" under linux prompt to execute this
 * function.
 */
static int arc_emac_set_settings(struct net_device *ndev,
				 struct ethtool_cmd *cmd)
{
	struct arc_emac_priv *priv = netdev_priv(ndev);

	if (!capable(CAP_NET_ADMIN))
		return -EPERM;

	return phy_ethtool_sset(priv->phy_dev, cmd);
}
开发者ID:Felixneu,项目名称:Power-Management,代码行数:21,代码来源:emac_main.c


示例12: uec_set_settings

static int
uec_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{
	struct ucc_geth_private *ugeth = netdev_priv(netdev);
	struct phy_device *phydev = ugeth->phydev;

	if (!phydev)
		return -ENODEV;

	return phy_ethtool_sset(phydev, ecmd);
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:11,代码来源:ucc_geth_ethtool.c


示例13: ag71xx_ethtool_set_settings

static int ag71xx_ethtool_set_settings(struct net_device *dev,
				       struct ethtool_cmd *cmd)
{
	struct ag71xx *ag = netdev_priv(dev);
	struct phy_device *phydev = ag->phy_dev;

	if (!phydev)
		return -ENODEV;

	return phy_ethtool_sset(phydev, cmd);
}
开发者ID:Cribstone,项目名称:linino,代码行数:11,代码来源:ag71xx_ethtool.c


示例14: stmmac_ethtool_setsettings

int stmmac_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct stmmac_priv *priv = netdev_priv(dev);
	struct phy_device *phy = priv->phydev;
	int rc;

	spin_lock(&priv->lock);
	rc = phy_ethtool_sset(phy, cmd);
	spin_unlock(&priv->lock);

	return rc;
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:12,代码来源:stmmac_ethtool.c


示例15: cvm_oct_set_settings

static int cvm_oct_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct octeon_ethernet *priv = netdev_priv(dev);

	if (!capable(CAP_NET_ADMIN))
		return -EPERM;

	if (priv->phydev)
		return phy_ethtool_sset(priv->phydev, cmd);

	return -EINVAL;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:12,代码来源:ethernet-mdio.c


示例16: au1000_set_settings

static int au1000_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct au1000_private *aup = netdev_priv(dev);

	if (!capable(CAP_NET_ADMIN))
		return -EPERM;

	if (aup->phy_dev)
		return phy_ethtool_sset(aup->phy_dev, cmd);

	return -EINVAL;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:12,代码来源:au1000_eth.c


示例17: bfin_mac_ethtool_setsettings

static int
bfin_mac_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
{
	struct bfin_mac_local *lp = netdev_priv(dev);

	if (!capable(CAP_NET_ADMIN))
		return -EPERM;

	if (lp->phydev)
		return phy_ethtool_sset(lp->phydev, cmd);

	return -EINVAL;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:13,代码来源:bfin_mac.c


示例18: octeon_mgmt_set_settings

static int octeon_mgmt_set_settings(struct net_device *netdev,
				    struct ethtool_cmd *cmd)
{
	struct octeon_mgmt *p = netdev_priv(netdev);

	if (!capable(CAP_NET_ADMIN))
		return -EPERM;

	if (p->phydev)
		return phy_ethtool_sset(p->phydev, cmd);

	return -EOPNOTSUPP;
}
开发者ID:7799,项目名称:linux,代码行数:13,代码来源:octeon_mgmt.c


示例19: hieth_ethtools_set_settings

static int hieth_ethtools_set_settings(struct net_device *net_dev, \
		struct ethtool_cmd *cmd)
{
	struct hieth_netdev_local *ld = netdev_priv(net_dev);

	if (!capable(CAP_NET_ADMIN))
		return -EPERM;

	if (ld->phy)
		return phy_ethtool_sset(ld->phy, cmd);

	return -EINVAL;
}
开发者ID:jorneytu,项目名称:code,代码行数:13,代码来源:net.c


示例20: stmmac_ethtool_setsettings

static int stmmac_ethtool_setsettings(struct net_device *dev,
				      struct ethtool_cmd *cmd)
{
	struct stmmac_priv *priv = netdev_priv(dev);
	struct phy_device *phy = priv->phydev;
	int rc;

	spin_lock(&priv->lock);
#ifndef CONFIG_EMU_MODE
	rc = phy_ethtool_sset(phy, cmd);
#endif
	spin_unlock(&priv->lock);

	return rc;
}
开发者ID:magnusjjj,项目名称:android_kernel_huawei_rle,代码行数:15,代码来源:stmmac_ethtool.c



注:本文中的phy_ethtool_sset函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ phy_exit函数代码示例发布时间:2022-05-30
下一篇:
C++ phy_ethtool_gset函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap