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

C++ phy_mii_ioctl函数代码示例

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

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



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

示例1: r6040_ioctl

static int r6040_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	if (!dev->phydev)
		return -EINVAL;

	return phy_mii_ioctl(dev->phydev, rq, cmd);
}
开发者ID:acton393,项目名称:linux,代码行数:7,代码来源:r6040.c


示例2: bgmac_ioctl

static int bgmac_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
{
	if (!netif_running(net_dev))
		return -EINVAL;

	return phy_mii_ioctl(net_dev->phydev, ifr, cmd);
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:7,代码来源:bgmac.c


示例3: eth_ioctl

static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{
	struct port *port = netdev_priv(dev);

	if (!netif_running(dev))
		return -EINVAL;
	return phy_mii_ioctl(port->phydev, if_mii(req), cmd);
}
开发者ID:mecke,项目名称:linux-2.6,代码行数:8,代码来源:ixp4xx_eth.c


示例4: phylink_mii_ioctl

/**
 * phylink_mii_ioctl() - generic mii ioctl interface
 * @pl: a pointer to a &struct phylink returned from phylink_create()
 * @ifr: a pointer to a &struct ifreq for socket ioctls
 * @cmd: ioctl cmd to execute
 *
 * Perform the specified MII ioctl on the PHY attached to the phylink instance
 * specified by @pl. If no PHY is attached, emulate the presence of the PHY.
 *
 * Returns: zero on success or negative error code.
 *
 * %SIOCGMIIPHY:
 *  read register from the current PHY.
 * %SIOCGMIIREG:
 *  read register from the specified PHY.
 * %SIOCSMIIREG:
 *  set a register on the specified PHY.
 */
int phylink_mii_ioctl(struct phylink *pl, struct ifreq *ifr, int cmd)
{
	struct mii_ioctl_data *mii = if_mii(ifr);
	int  ret;

	ASSERT_RTNL();

	if (pl->phydev) {
		/* PHYs only exist for MLO_AN_PHY and SGMII */
		switch (cmd) {
		case SIOCGMIIPHY:
			mii->phy_id = pl->phydev->mdio.addr;
			/* fall through */

		case SIOCGMIIREG:
			ret = phylink_phy_read(pl, mii->phy_id, mii->reg_num);
			if (ret >= 0) {
				mii->val_out = ret;
				ret = 0;
			}
			break;

		case SIOCSMIIREG:
			ret = phylink_phy_write(pl, mii->phy_id, mii->reg_num,
						mii->val_in);
			break;

		default:
			ret = phy_mii_ioctl(pl->phydev, ifr, cmd);
			break;
		}
	} else {
		switch (cmd) {
		case SIOCGMIIPHY:
			mii->phy_id = 0;
			/* fall through */

		case SIOCGMIIREG:
			ret = phylink_mii_read(pl, mii->phy_id, mii->reg_num);
			if (ret >= 0) {
				mii->val_out = ret;
				ret = 0;
			}
			break;

		case SIOCSMIIREG:
			ret = phylink_mii_write(pl, mii->phy_id, mii->reg_num,
						mii->val_in);
			break;

		default:
			ret = -EOPNOTSUPP;
			break;
		}
	}

	return ret;
}
开发者ID:markus-oberhumer,项目名称:linux,代码行数:76,代码来源:phylink.c


示例5: dsa_slave_ioctl

static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
	struct dsa_slave_priv *p = netdev_priv(dev);

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

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


示例6: bgmac_ioctl

static int bgmac_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
{
	struct bgmac *bgmac = netdev_priv(net_dev);

	if (!netif_running(net_dev))
		return -EINVAL;

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


示例7: pci_eth_ioctl

static int pci_eth_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct pci_eth_private *priv = netdev_priv(dev);

	if (!priv->phydev)
		return -EINVAL;

	return phy_mii_ioctl(priv->phydev, rq, cmd);
}
开发者ID:agamemnon886,项目名称:mod,代码行数:9,代码来源:pci_eth.c


示例8: fs_ioctl

static int fs_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct fs_enet_private *fep = netdev_priv(dev);

	if (!netif_running(dev))
		return -EINVAL;

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


示例9: au1000_ioctl

static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct au1000_private *aup = netdev_priv(dev);

	if (!netif_running(dev)) return -EINVAL;

	if (!aup->phy_dev) return -EINVAL; // PHY not controllable

	return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:10,代码来源:au1000_eth.c


示例10: fs_ioctl

static int fs_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct fs_enet_private *fep = netdev_priv(dev);
	struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&rq->ifr_data;

	if (!netif_running(dev))
		return -EINVAL;

	return phy_mii_ioctl(fep->phydev, mii, cmd);
}
开发者ID:ClarkChen633,项目名称:rtl819x-toolchain,代码行数:10,代码来源:fs_enet-main.c


示例11: ax88172a_ioctl

static int ax88172a_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
{
	if (!netif_running(net))
		return -EINVAL;

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

	return phy_mii_ioctl(net->phydev, rq, cmd);
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:10,代码来源:ax88172a.c


示例12: octeon_mgmt_ioctl

static int octeon_mgmt_ioctl(struct net_device *netdev,
			     struct ifreq *rq, int cmd)
{
	switch (cmd) {
	case SIOCSHWTSTAMP:
		return octeon_mgmt_ioctl_hwtstamp(netdev, rq, cmd);
	default:
		if (netdev->phydev)
			return phy_mii_ioctl(netdev->phydev, rq, cmd);
		return -EINVAL;
	}
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:12,代码来源:octeon_mgmt.c


示例13: cvm_oct_ioctl

/**
 * cvm_oct_ioctl - IOCTL support for PHY control
 * @dev:    Device to change
 * @rq:     the request
 * @cmd:    the command
 *
 * Returns Zero on success
 */
int cvm_oct_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct octeon_ethernet *priv = netdev_priv(dev);

	if (!netif_running(dev))
		return -EINVAL;

	if (!priv->phydev)
		return -EINVAL;

	return phy_mii_ioctl(priv->phydev, rq, cmd);
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:20,代码来源:ethernet-mdio.c


示例14: emac_ioctl

static int emac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct phy_device *phydev = dev->phydev;

	if (!netif_running(dev))
		return -EINVAL;

	if (!phydev)
		return -ENODEV;

	return phy_mii_ioctl(phydev, rq, cmd);
}
开发者ID:Lyude,项目名称:linux,代码行数:12,代码来源:sun4i-emac.c


示例15: hieth_net_ioctl

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

	if (!netif_running(net_dev))
		return -EINVAL;

	if (!ld->phy)
		return -EINVAL;

	return phy_mii_ioctl(ld->phy, ifreq, cmd);
}
开发者ID:jorneytu,项目名称:code,代码行数:13,代码来源:net.c


示例16: emac_ioctl

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

	if (!netif_running(dev))
		return -EINVAL;

	if (!phydev)
		return -ENODEV;

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


示例17: octeon_mgmt_ioctl

static int octeon_mgmt_ioctl(struct net_device *netdev,
			     struct ifreq *rq, int cmd)
{
	struct octeon_mgmt *p = netdev_priv(netdev);

	if (!netif_running(netdev))
		return -EINVAL;

	if (!p->phydev)
		return -EINVAL;

	return phy_mii_ioctl(p->phydev, rq, cmd);
}
开发者ID:andi34,项目名称:Dhollmen_Kernel,代码行数:13,代码来源:octeon_mgmt.c


示例18: sh_eth_do_ioctl

/* ioctl to device funciotn*/
static int sh_eth_do_ioctl(struct net_device *ndev, struct ifreq *rq,
                           int cmd)
{
    struct sh_eth_private *mdp = netdev_priv(ndev);
    struct phy_device *phydev = mdp->phydev;

    if (!netif_running(ndev))
        return -EINVAL;

    if (!phydev)
        return -ENODEV;

    return phy_mii_ioctl(phydev, if_mii(rq), cmd);
}
开发者ID:artm1248,项目名称:linux,代码行数:15,代码来源:sh_eth.c


示例19: fs_ioctl

static int fs_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct fs_enet_private *fep = netdev_priv(dev);
	struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&rq->ifr_data;
	unsigned long flags;
	int rc;

	if (!netif_running(dev))
		return -EINVAL;

	spin_lock_irqsave(&fep->lock, flags);
	rc = phy_mii_ioctl(fep->phydev, mii, cmd);
	spin_unlock_irqrestore(&fep->lock, flags);
	return rc;
}
开发者ID:prime5711,项目名称:blackbox,代码行数:15,代码来源:fs_enet-main.c


示例20: stmmac_ioctl

/**
 *  stmmac_ioctl - Entry point for the Ioctl
 *  @dev: Device pointer.
 *  @rq: An IOCTL specefic structure, that can contain a pointer to
 *  a proprietary structure used to pass information to the driver.
 *  @cmd: IOCTL command
 *  Description:
 *  Currently there are no special functionality supported in IOCTL, just the
 *  phy_mii_ioctl(...) can be invoked.
 */
static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct stmmac_priv *priv = netdev_priv(dev);
	int ret;

	if (!netif_running(dev))
		return -EINVAL;

	if (!priv->phydev)
		return -EINVAL;

	spin_lock(&priv->lock);
	ret = phy_mii_ioctl(priv->phydev, rq, cmd);
	spin_unlock(&priv->lock);

	return ret;
}
开发者ID:303750856,项目名称:linux-3.1,代码行数:27,代码来源:stmmac_main.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ phy_power_off函数代码示例发布时间:2022-05-30
下一篇:
C++ phy_init函数代码示例发布时间: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