当前位置: 首页>>代码示例>>C++>>正文


C++ phy_mii_ioctl函数代码示例

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


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


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