diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index de2a6a2b89..74c39fc7ba 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -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 diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 82dc4cf9b9..2f9441cc5f 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -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 diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index 4451583ed9..02b39319e9 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -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 diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 4923295b3e..4b83ceac3e 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -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