Use the device name assigned by the registration process, not our best guess

This commit is contained in:
Gregory Nutt 2014-08-16 15:14:39 -06:00
parent 057af36c1d
commit d87013a665
4 changed files with 4 additions and 39 deletions

View File

@ -170,14 +170,6 @@
# error EMAC PHY unrecognized
#endif
/* Device name */
#ifdef CONFIG_SAMA5_EMAC_ISETH0
# define SAMA5_EMAC_DEVNAME "eth0"
#else
# define SAMA5_EMAC_DEVNAME "eth1"
#endif
#ifdef CONFIG_SAMA5_EMAC_PHYSR_ALTCONFIG
# define PHYSR_MODE(sr) ((sr) & CONFIG_SAMA5_EMAC_PHYSR_ALTMODE)
@ -1859,7 +1851,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg)
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(SAMA5_EMAC_DEVNAME, req->pid, req->signo, req->arg);
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
}
break;
#endif

View File

@ -268,16 +268,6 @@
# endif
#endif /* CONFIG_SAMA5_EMAC0 */
/* Device name */
#ifdef CONFIG_SAMA5_EMAC0_ISETH0
# define SAMA5_EMAC0_DEVNAME "eth0"
# define SAMA5_EMAC1_DEVNAME "eth1"
#else
# define SAMA5_EMAC0_DEVNAME "eth1"
# define SAMA5_EMAC1_DEVNAME "eth0"
#endif
/* Common Configuration *****************************************************/
#undef CONFIG_SAMA5_EMACB_NBC
@ -344,9 +334,6 @@ struct sam_emacattr_s
{
/* Basic hardware information */
#if defined(CONFIG_ARCH_PHY_INTERRUPT) && defined(CONFIG_NETDEV_PHY_IOCTL)
FAR const char *intf; /* Network interface name, e.g., "eth0" */
#endif
uint32_t base; /* EMAC Register base address */
xcpt_t handler; /* EMAC interrupt handler */
uint8_t emac; /* EMACn, n=0 or 1 */
@ -607,9 +594,6 @@ static const struct sam_emacattr_s g_emac0_attr =
{
/* Basic hardware information */
#if defined(CONFIG_ARCH_PHY_INTERRUPT) && defined(CONFIG_NETDEV_PHY_IOCTL)
.intf = SAMA5_EMAC0_DEVNAME,
#endif
.base = SAM_EMAC0_VBASE,
.handler = sam_emac0_interrupt,
.emac = 0,
@ -678,9 +662,6 @@ static const struct sam_emacattr_s g_emac1_attr =
{
/* Basic hardware information */
#if defined(CONFIG_ARCH_PHY_INTERRUPT) && defined(CONFIG_NETDEV_PHY_IOCTL)
.intf = SAMA5_EMAC1_DEVNAME,
#endif
.base = SAM_EMAC1_VBASE,
.handler = sam_emac1_interrupt,
.emac = 0,
@ -2245,7 +2226,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg)
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(priv->attr->intf, req->pid, req->signo, req->arg);
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
}
break;
#endif

View File

@ -114,14 +114,6 @@
# error Unknown PHY
#endif
/* Device name */
#ifdef CONFIG_SAMA5_GMAC_ISETH0
# define SAMA5_GMAC_DEVNAME "eth0"
#else
# define SAMA5_GMAC_DEVNAME "eth1"
#endif
/* GMAC buffer sizes, number of buffers, and number of descriptors.
*
* REVISIT: The CONFIG_NET_MULTIBUFFER might be useful. It might be possible
@ -1814,7 +1806,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg)
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(SAMA5_GMAC_DEVNAME, req->pid, req->signo, req->arg);
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
}
break;
#endif

View File

@ -2519,7 +2519,7 @@ static int stm32_ioctl(struct net_driver_s *dev, int cmd, long arg)
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("eth0", req->pid, req->signo, req->arg);
ret = phy_notify_subscribe(dev->d_ifname, req->pid, req->signo, req->arg);
}
break;
#endif