From 732bef73a7dffbe23ce7da6e94151232dd1a8043 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 27 Jan 2019 16:42:18 -0600 Subject: [PATCH] include/net/if.h: Fix some macro definitions overlooked in commit d105dc9b5e82a3b8710b44a81f05660410e1f22d. Also corrects the name of a structure: mii_ioctl_notify_s vs mii_iotcl_notify_s. --- arch/arm/src/imxrt/imxrt_enet.c | 2 +- arch/arm/src/lpc43xx/lpc43_ethernet.c | 2 +- arch/arm/src/sam34/sam_emac.c | 2 +- arch/arm/src/sama5/sam_emaca.c | 2 +- arch/arm/src/sama5/sam_emacb.c | 2 +- arch/arm/src/sama5/sam_gmac.c | 2 +- arch/arm/src/samv7/sam_emac.c | 2 +- arch/arm/src/stm32/stm32_eth.c | 2 +- arch/arm/src/stm32f7/stm32_ethernet.c | 2 +- arch/arm/src/tiva/tm4c/tm4c_ethernet.c | 2 +- include/net/if.h | 11 +++++------ net/netdev/netdev_ioctl.c | 4 ++-- 12 files changed, 17 insertions(+), 18 deletions(-) diff --git a/arch/arm/src/imxrt/imxrt_enet.c b/arch/arm/src/imxrt/imxrt_enet.c index e40a29ab18..92dd5bc5d5 100644 --- a/arch/arm/src/imxrt/imxrt_enet.c +++ b/arch/arm/src/imxrt/imxrt_enet.c @@ -1750,7 +1750,7 @@ static int imxrt_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index b6ff901d46..befb76174f 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -2761,7 +2761,7 @@ static int lpc43_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index 5eaa9c8d69..486b0fb770 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -2326,7 +2326,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index 7eef64f42e..1555242e53 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -2362,7 +2362,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 174da786d3..e2fbaa8015 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -2729,7 +2729,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index 98872e5d45..6b37ba686d 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -2317,7 +2317,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index b67a9d7b0f..71872e9968 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -3213,7 +3213,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 3e3aa6390a..406fdfc963 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -2873,7 +2873,7 @@ static int stm32_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index 403772ba40..8bc11ffe20 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -2975,7 +2975,7 @@ static int stm32_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/arch/arm/src/tiva/tm4c/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c/tm4c_ethernet.c index 9033f9b110..71c4a97025 100644 --- a/arch/arm/src/tiva/tm4c/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c/tm4c_ethernet.c @@ -2874,7 +2874,7 @@ static int tiva_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) #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); + struct mii_ioctl_notify_s *req = (struct mii_ioctl_notify_s *)((uintptr_t)arg); ret = phy_notify_subscribe(dev->d_ifname, req->pid, &req->event); if (ret == OK) diff --git a/include/net/if.h b/include/net/if.h index 4be72038ca..aa3749e146 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -118,7 +118,7 @@ * of PHY state changes. */ -struct mii_iotcl_notify_s +struct mii_ioctl_notify_s { pid_t pid; /* PID of the task to receive the signal. Zero means "this task" */ struct sigevent event; /* Describe the way a task is to be notified */ @@ -156,7 +156,7 @@ struct lifreq int lifru_count; /* Number of devices */ int lifru_mtu; /* MTU size */ uint8_t lifru_flags; /* Interface flags */ - struct mii_iotcl_notify_s llfru_mii_notify; /* PHY event notification */ + struct mii_ioctl_notify_s llfru_mii_notify; /* PHY event notification */ struct mii_ioctl_data_s lifru_mii_data; /* MII request data */ } lifr_ifru; }; @@ -170,8 +170,7 @@ struct lifreq #define lifr_count lifr_ifru.lifru_count /* Number of devices */ #define lifr_flags lifr_ifru.lifru_flags /* interface flags */ #define lifr_mii_notify_pid lifr_ifru.llfru_mii_notify.pid /* PID to be notified */ -#define lifr_mii_notify_signo lifr_ifru.llfru_mii_notify.signo /* Signal to notify with */ -#define lifr_mii_notify_arg lifr_ifru.llfru_mii_notify.arg /* sigval argument */ +#define lifr_mii_notify_event lifr_ifru.llfru_mii_notify.event /* Describes notification */ #define lifr_mii_phy_id lifr_ifru.lifru_mii_data.phy_id /* PHY device address */ #define lifr_mii_reg_num lifr_ifru.lifru_mii_data.reg_num /* PHY register address */ #define lifr_mii_val_in lifr_ifru.lifru_mii_data.val_in /* PHY input data */ @@ -207,7 +206,7 @@ struct ifreq int ifru_count; /* Number of devices */ int ifru_mtu; /* MTU size */ uint8_t ifru_flags; /* Interface flags */ - struct mii_iotcl_notify_s ifru_mii_notify; /* PHY event notification */ + struct mii_ioctl_notify_s ifru_mii_notify; /* PHY event notification */ struct mii_ioctl_data_s ifru_mii_data; /* MII request data */ } ifr_ifru; }; @@ -221,7 +220,7 @@ struct ifreq #define ifr_count ifr_ifru.ifru_count /* Number of devices */ #define ifr_flags ifr_ifru.ifru_flags /* interface flags */ #define ifr_mii_notify_pid ifr_ifru.ifru_mii_notify.pid /* PID to be notified */ -#define ifr_mii_notify_signo ifr_ifru.ifru_mii_notify.signo /* Signal to notify with */ +#define ifr_mii_notify_event ifr_ifru.ifru_mii_notify.event /* Describes notification */ #define ifr_mii_notify_arg ifr_ifru.ifru_mii_notify.arg /* sigval argument */ #define ifr_mii_phy_id ifr_ifru.ifru_mii_data.phy_id /* PHY device address */ #define ifr_mii_reg_num ifr_ifru.ifru_mii_data.reg_num /* PHY register address */ diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index 4cd26fb79d..639e0e1fb2 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -1077,7 +1077,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd, dev = netdev_ifr_dev(req); if (dev && dev->d_ioctl) { - struct mii_iotcl_notify_s *notify = &req->ifr_ifru.ifru_mii_notify; + struct mii_ioctl_notify_s *notify = &req->ifr_ifru.ifru_mii_notify; ret = dev->d_ioctl(dev, cmd, ((unsigned long)(uintptr_t)notify)); } } @@ -1540,7 +1540,7 @@ ssize_t net_ioctl_arglen(int cmd) return sizeof(struct rtentry); case SIOCMIINOTIFY: - return sizeof(struct mii_iotcl_notify_s); + return sizeof(struct mii_ioctl_notify_s); case SIOCGMIIPHY: case SIOCGMIIREG: