The existence of the network driver ioctl() method should depend on CONFIG_NETDEV_IOCTL rather than CONFIG_NETDEV_PHY_IOCTL. The former enables the method, the later enables a subset of possible driver IOCTLs. This change should be basically a no-operation. The affected ioctl methods only support those subset of driver IOCTLs selected by CONFIG_NETDEV_PHY_IOCTL and the network logic will tolerate a nul ioctl method.
This commit is contained in:
parent
6ae6ecc958
commit
a8b6be4aaf
@ -2447,7 +2447,7 @@ void up_netinitialize(void)
|
||||
#endif
|
||||
g_c5471[0].c_dev.d_private = (void *)g_c5471; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
g_c5471[0].c_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
g_c5471[0].c_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/kinetis/kinetis_enet.c
|
||||
*
|
||||
* Copyright (C) 2011-2012, 2014-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2012, 2014-2018 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* David Sidrane <david_s5@nscdg.com>
|
||||
*
|
||||
@ -310,7 +310,7 @@ static int kinetis_addmac(struct net_driver_s *dev,
|
||||
static int kinetis_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int kinetis_ioctl(struct net_driver_s *dev, int cmd,
|
||||
unsigned long arg);
|
||||
#endif
|
||||
@ -1449,48 +1449,52 @@ static int kinetis_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int kinetis_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
FAR struct kinetis_driver_s *priv =
|
||||
(FAR struct kinetis_driver_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req =
|
||||
(struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req =
|
||||
(struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req =
|
||||
(struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = kinetis_readmii(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
}
|
||||
break;
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req =
|
||||
(struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = kinetis_readmii(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req =
|
||||
(struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = kinetis_writemii(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
}
|
||||
break;
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req =
|
||||
(struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = kinetis_writemii(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
}
|
||||
break;
|
||||
#endif /* ifdef CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: kinetis_initmii
|
||||
@ -2127,12 +2131,12 @@ int kinetis_netinitialize(int intf)
|
||||
priv->dev.d_addmac = kinetis_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = kinetis_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = kinetis_ioctl; /* Support PHY ioctl() calls */
|
||||
#endif
|
||||
priv->dev.d_private = (void *)g_enet; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -3056,7 +3056,7 @@ static inline int lpc17_ethinitialize(int intf)
|
||||
priv->lp_irq = ??; /* Ethernet controller IRQ number */
|
||||
#endif
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->lp_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->lp_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/lpc43/lpc43_eth.c
|
||||
*
|
||||
* Copyright (C) 2011-2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2015, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -621,7 +621,7 @@ static int lpc43_addmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int lpc43_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int lpc43_ioctl(struct net_driver_s *dev, int cmd,
|
||||
unsigned long arg);
|
||||
#endif
|
||||
@ -2744,16 +2744,17 @@ static void lpc43_rxdescinit(FAR struct lpc43_ethmac_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int lpc43_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
#if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT)
|
||||
FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
@ -2791,6 +2792,7 @@ static int lpc43_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
ret = lpc43_phywrite(req->phy_id, req->reg_num, req->val_in);
|
||||
}
|
||||
break;
|
||||
#endif /* ifdef CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
@ -2799,7 +2801,7 @@ static int lpc43_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: lpc43_phyintenable
|
||||
@ -3823,12 +3825,12 @@ static inline int lpc43_ethinitialize(void)
|
||||
priv->dev.d_addmac = lpc43_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = lpc43_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = lpc43_ioctl; /* Support PHY ioctl() calls */
|
||||
#endif
|
||||
priv->dev.d_private = (void *)&g_lpc43ethmac; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmission */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -2392,13 +2392,16 @@ static int lpc54_eth_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
static int lpc54_eth_ioctl(struct net_driver_s *dev, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
struct lpc54_ethdriver_s *priv = (struct lpc54_ethdriver_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
/* Decode and dispatch the driver-specific IOCTL command */
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
@ -2422,6 +2425,7 @@ static int lpc54_eth_ioctl(struct net_driver_s *dev, int cmd,
|
||||
ret = OK
|
||||
}
|
||||
break;
|
||||
#endif /* ifdef CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
nerr("ERROR: Unrecognized IOCTL command: %d\n", command);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/sam34/sam_emac.c
|
||||
*
|
||||
* Copyright (C) 2014-2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014-2015, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* This logic derives from the SAM34D3 Ethernet driver.
|
||||
@ -408,7 +408,7 @@ static int sam_addmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg);
|
||||
#endif
|
||||
|
||||
@ -2309,86 +2309,90 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
struct sam_emac_s *priv = (struct sam_emac_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = sam_phyintenable(priv);
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
|
||||
ret = sam_phyintenable(priv);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR);
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR);
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval);
|
||||
}
|
||||
break;
|
||||
#endif /* ifdef CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR);
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR);
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: sam_phydump
|
||||
@ -3630,7 +3634,7 @@ void up_netinitialize(void)
|
||||
priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */
|
||||
#endif
|
||||
priv->dev.d_private = (void *)&g_emac; /* Used to recover private state from dev */
|
||||
|
@ -4,7 +4,7 @@
|
||||
* 10/100 Base-T Ethernet driver for the SAMA5D3. Denoted as 'A' to
|
||||
* distinguish it from the SAMA5D4 EMAC driver.
|
||||
*
|
||||
* Copyright (C) 2013-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
@ -413,7 +413,7 @@ static int sam_addmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg);
|
||||
#endif
|
||||
|
||||
@ -2345,86 +2345,90 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
struct sam_emac_s *priv = (struct sam_emac_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = sam_phyintenable(priv);
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
|
||||
ret = sam_phyintenable(priv);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR);
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR);
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR);
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR);
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: sam_phydump
|
||||
@ -3672,7 +3676,7 @@ int sam_emac_initialize(void)
|
||||
priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */
|
||||
#endif
|
||||
priv->dev.d_private = (void *)&g_emac; /* Used to recover private state from dev */
|
||||
|
@ -507,7 +507,7 @@ static int sam_addmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg);
|
||||
#endif
|
||||
|
||||
@ -2715,79 +2715,83 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
struct sam_emac_s *priv = (struct sam_emac_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
|
||||
ret = sam_phyintenable(priv);
|
||||
ret = sam_phyintenable(priv);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR_OFFSET);
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR_OFFSET);
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR_OFFSET);
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR_OFFSET);
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -4357,9 +4361,9 @@ int sam_emac_initialize(int intf)
|
||||
priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
#if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT)
|
||||
priv->phytype = phytype; /* Type of PHY on port */
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/sama5/sam_gmac.c
|
||||
*
|
||||
* Copyright (C) 2013-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
@ -338,7 +338,7 @@ static int sam_addmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg);
|
||||
#endif
|
||||
|
||||
@ -2300,82 +2300,86 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
struct sam_gmac_s *priv = (struct sam_gmac_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = sam_phyintenable(priv);
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
|
||||
ret = sam_phyintenable(priv);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
|
||||
/* Enable the management port */
|
||||
|
||||
sam_enablemdio(priv);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable the management port */
|
||||
|
||||
sam_disablemdio(priv);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
|
||||
/* Enable the management port */
|
||||
|
||||
sam_enablemdio(priv);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable the management port */
|
||||
|
||||
sam_disablemdio(priv);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
|
||||
/* Enable the management port */
|
||||
|
||||
sam_enablemdio(priv);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable the management port */
|
||||
|
||||
sam_disablemdio(priv);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
|
||||
/* Enable the management port */
|
||||
|
||||
sam_enablemdio(priv);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable the management port */
|
||||
|
||||
sam_disablemdio(priv);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: sam_phydump
|
||||
@ -3744,12 +3748,12 @@ int sam_gmac_initialize(void)
|
||||
priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */
|
||||
#endif
|
||||
priv->dev.d_private = (void *)&g_gmac; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->txpoll = wd_create();
|
||||
if (!priv->txpoll)
|
||||
|
@ -2,7 +2,7 @@
|
||||
* arch/arm/src/samv7/sam_emac.c
|
||||
* 10/100 Base-T Ethernet driver for the SAMV71.
|
||||
*
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* This logic derives from the SAMA5 Ethernet driver which, in turn, derived
|
||||
@ -622,7 +622,7 @@ static int sam_addmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg);
|
||||
#endif
|
||||
|
||||
@ -3196,86 +3196,90 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
struct sam_emac_s *priv = (struct sam_emac_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
|
||||
ret = sam_phyintenable(priv);
|
||||
ret = sam_phyintenable(priv);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = priv->phyaddr;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR_OFFSET);
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR_OFFSET);
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR_OFFSET);
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Read from the requested register */
|
||||
|
||||
ret = sam_phyread(priv, req->phy_id, req->reg_num, &req->val_out);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
uint32_t regval;
|
||||
|
||||
/* Enable management port */
|
||||
|
||||
regval = sam_getreg(priv, SAM_EMAC_NCR_OFFSET);
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval | EMAC_NCR_MPE);
|
||||
|
||||
/* Write to the requested register */
|
||||
|
||||
ret = sam_phywrite(priv, req->phy_id, req->reg_num, req->val_in);
|
||||
|
||||
/* Disable management port (probably) */
|
||||
|
||||
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: sam_phydump
|
||||
@ -5017,9 +5021,9 @@ int sam_emac_initialize(int intf)
|
||||
priv->dev.d_addmac = sam_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = sam_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = sam_ioctl; /* Support PHY ioctl() calls */
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
#if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT)
|
||||
priv->phytype = phytype; /* Type of PHY on port */
|
||||
#endif
|
||||
#endif
|
||||
|
@ -721,7 +721,7 @@ static int stm32_addmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int stm32_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int stm32_ioctl(struct net_driver_s *dev, int cmd,
|
||||
unsigned long arg);
|
||||
#endif
|
||||
@ -2847,62 +2847,64 @@ static void stm32_rxdescinit(FAR struct stm32_ethmac_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int stm32_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
#if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT)
|
||||
FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = stm32_phyintenable(priv);
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
|
||||
ret = stm32_phyintenable(priv);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = CONFIG_STM32_PHYADDR;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = CONFIG_STM32_PHYADDR;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = stm32_phyread(req->phy_id, req->reg_num, &req->val_out);
|
||||
}
|
||||
break;
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = stm32_phyread(req->phy_id, req->reg_num, &req->val_out);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = stm32_phywrite(req->phy_id, req->reg_num, req->val_in);
|
||||
}
|
||||
break;
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = stm32_phywrite(req->phy_id, req->reg_num, req->val_in);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: stm32_phyintenable
|
||||
@ -4014,12 +4016,12 @@ int stm32_ethinitialize(int intf)
|
||||
priv->dev.d_addmac = stm32_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = stm32_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = stm32_ioctl; /* Support PHY ioctl() calls */
|
||||
#endif
|
||||
priv->dev.d_private = (void *)g_stm32ethmac; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/stm32f7/stm32_ethernet.c
|
||||
*
|
||||
* Copyright (C) 2015-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -732,7 +732,7 @@ static int stm32_addmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int stm32_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int stm32_ioctl(struct net_driver_s *dev, int cmd,
|
||||
unsigned long arg);
|
||||
#endif
|
||||
@ -2958,16 +2958,17 @@ static void stm32_rxdescinit(struct stm32_ethmac_s *priv,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int stm32_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
#if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT)
|
||||
struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)dev->d_private;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_ARCH_PHY_INTERRUPT
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
@ -3005,6 +3006,7 @@ static int stm32_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
ret = stm32_phywrite(req->phy_id, req->reg_num, req->val_in);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
@ -3013,7 +3015,7 @@ static int stm32_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: stm32_phyintenable
|
||||
@ -4095,7 +4097,7 @@ int stm32_ethinitialize(int intf)
|
||||
priv->dev.d_addmac = stm32_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = stm32_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = stm32_ioctl; /* Support PHY ioctl() calls */
|
||||
#endif
|
||||
priv->dev.d_private = (void *)g_stm32ethmac; /* Used to recover private state from dev */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/tiva/tm4c_ethernet.c
|
||||
*
|
||||
* Copyright (C) 2014-2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014-2015, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -733,7 +733,7 @@ static int tiva_addmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
static int tiva_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int tiva_ioctl(struct net_driver_s *dev, int cmd,
|
||||
unsigned long arg);
|
||||
#endif
|
||||
@ -2860,59 +2860,61 @@ static void tiva_rxdescinit(FAR struct tiva_ethmac_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
static int tiva_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_TIVA_PHY_INTERRUPTS
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_TIVA_PHY_INTERRUPTS
|
||||
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
||||
|
||||
tiva_phy_intenable(true);
|
||||
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable PHY link up/down interrupts */
|
||||
|
||||
tiva_phy_intenable(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = CONFIG_TIVA_PHYADDR;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
case SIOCGMIIPHY: /* Get MII PHY address */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
req->phy_id = CONFIG_TIVA_PHYADDR;
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = tiva_phyread(req->phy_id, req->reg_num, &req->val_out);
|
||||
}
|
||||
break;
|
||||
case SIOCGMIIREG: /* Get register from MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = tiva_phyread(req->phy_id, req->reg_num, &req->val_out);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = tiva_phywrite(req->phy_id, req->reg_num, req->val_in);
|
||||
}
|
||||
break;
|
||||
case SIOCSMIIREG: /* Set register in MII PHY */
|
||||
{
|
||||
struct mii_ioctl_data_s *req = (struct mii_ioctl_data_s *)((uintptr_t)arg);
|
||||
ret = tiva_phywrite(req->phy_id, req->reg_num, req->val_in);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_NETDEV_PHY_IOCTL */
|
||||
#endif /* CONFIG_NETDEV_IOCTL */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: tiva_phy_intenable
|
||||
@ -4040,7 +4042,7 @@ int tiva_ethinitialize(int intf)
|
||||
priv->dev.d_addmac = tiva_addmac; /* Add multicast MAC address */
|
||||
priv->dev.d_rmmac = tiva_rmmac; /* Remove multicast MAC address */
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
priv->dev.d_ioctl = tiva_ioctl; /* Support PHY ioctl() calls */
|
||||
#endif
|
||||
priv->dev.d_private = (void *)g_tiva_ethmac; /* Used to recover private state from dev */
|
||||
|
@ -772,7 +772,7 @@ int emac_initialize(int intf)
|
||||
#endif
|
||||
priv->d_dev.d_private = (void*)g_emac; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->d_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->d_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -3348,7 +3348,7 @@ static inline int pic32mx_ethinitialize(int intf)
|
||||
priv->pd_irqsrc = ??; /* Ethernet controller IRQ source number */
|
||||
#endif
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->pd_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->pd_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -3384,7 +3384,7 @@ static inline int pic32mz_ethinitialize(int intf)
|
||||
priv->pd_irqsrc = ??; /* Ethernet controller IRQ source number */
|
||||
#endif
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->pd_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->pd_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -1172,7 +1172,7 @@ int misoc_net_initialize(int intf)
|
||||
#endif
|
||||
priv->misoc_net_dev.d_private = (FAR void *)g_misoc_net; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->misoc_net_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->misoc_net_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -2537,7 +2537,7 @@ int up_netinitialize(void)
|
||||
#endif
|
||||
priv->dev.d_private = (FAR void*)&g_emac; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -1948,7 +1948,7 @@ int dm9x_initialize(void)
|
||||
#endif
|
||||
g_dm9x[0].dm_dev.d_private = (FAR void *)g_dm9x; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
g_dm9x[0].dm_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
g_dm9x[0].dm_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -2632,7 +2632,7 @@ int enc_initialize(FAR struct spi_dev_s *spi,
|
||||
#endif
|
||||
priv->dev.d_private = priv; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -2815,7 +2815,7 @@ int enc_initialize(FAR struct spi_dev_s *spi,
|
||||
#endif
|
||||
priv->dev.d_private = priv; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -1554,7 +1554,7 @@ int ftmac100_initialize(int intf)
|
||||
#endif
|
||||
priv->ft_dev.d_private = (FAR void *)g_ftmac100; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->ft_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->ft_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -891,7 +891,7 @@ static int tun_dev_init(FAR struct tun_device_s *priv, FAR struct file *filep,
|
||||
|
||||
nxsem_setprotocol(&priv->read_wait_sem, SEM_PRIO_NONE);
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
|
||||
|
@ -1392,7 +1392,7 @@ int xbee_netdev_register(XBEEHANDLE xbee)
|
||||
#endif
|
||||
dev->d_private = (FAR void *)priv; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->xd_mac = xbee; /* Save the MAC interface instance */
|
||||
priv->xd_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
|
@ -2812,7 +2812,7 @@ int spirit_netdev_initialize(FAR struct spi_dev_s *spi,
|
||||
|
||||
priv->lower = lower;
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
@ -1400,7 +1400,7 @@ int mac802154netdev_register(MACHANDLE mac)
|
||||
#endif
|
||||
dev->d_private = (FAR void *)priv; /* Used to recover private state from dev */
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
/* Create a watchdog for timing polling for and timing of transmissions */
|
||||
|
||||
priv->md_mac = mac; /* Save the MAC interface instance */
|
||||
priv->md_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
|
Loading…
Reference in New Issue
Block a user