diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-08-16 15:14:39 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-08-16 15:14:39 -0600 |
commit | 18ce73493b4537b3e1e2c2bc13da1100b1e6514a (patch) | |
tree | de26258f4b24e40deac1f94105cb211d249f2ead | |
parent | fddb234e576e1c12946e600a8d010652d5d60dd5 (diff) | |
download | nuttx-18ce73493b4537b3e1e2c2bc13da1100b1e6514a.tar.gz nuttx-18ce73493b4537b3e1e2c2bc13da1100b1e6514a.tar.bz2 nuttx-18ce73493b4537b3e1e2c2bc13da1100b1e6514a.zip |
Use the device name assigned by the registration process, not our best guess
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_emaca.c | 10 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_emacb.c | 21 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_gmac.c | 10 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_eth.c | 2 |
4 files changed, 4 insertions, 39 deletions
diff --git a/nuttx/arch/arm/src/sama5/sam_emaca.c b/nuttx/arch/arm/src/sama5/sam_emaca.c index de2a6a2b8..74c39fc7b 100644 --- a/nuttx/arch/arm/src/sama5/sam_emaca.c +++ b/nuttx/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/nuttx/arch/arm/src/sama5/sam_emacb.c b/nuttx/arch/arm/src/sama5/sam_emacb.c index 82dc4cf9b..2f9441cc5 100644 --- a/nuttx/arch/arm/src/sama5/sam_emacb.c +++ b/nuttx/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/nuttx/arch/arm/src/sama5/sam_gmac.c b/nuttx/arch/arm/src/sama5/sam_gmac.c index 4451583ed..02b39319e 100644 --- a/nuttx/arch/arm/src/sama5/sam_gmac.c +++ b/nuttx/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/nuttx/arch/arm/src/stm32/stm32_eth.c b/nuttx/arch/arm/src/stm32/stm32_eth.c index 4923295b3..4b83ceac3 100644 --- a/nuttx/arch/arm/src/stm32/stm32_eth.c +++ b/nuttx/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 |