本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}