From fddb234e576e1c12946e600a8d010652d5d60dd5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 16 Aug 2014 15:04:09 -0600 Subject: More of the PHY event notification logic change: Fix some compile errors when full feature is enabled; Add some missing ioctol logic --- apps/nshlib/nsh_netinit.c | 1 - nuttx/arch/arm/src/sama5/sam_emaca.c | 5 +-- nuttx/arch/arm/src/sama5/sam_emacb.c | 17 +++++----- nuttx/arch/arm/src/sama5/sam_gmac.c | 5 +-- nuttx/arch/arm/src/stm32/stm32_eth.c | 4 +-- nuttx/configs/sama5d3-xplained/src/sam_ethernet.c | 39 ++++++++++++---------- .../sama5d3-xplained/src/sama5d3-xplained.h | 4 +-- nuttx/configs/sama5d3x-ek/src/sam_ethernet.c | 39 ++++++++++++---------- nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h | 4 +-- nuttx/configs/sama5d4-ek/src/sam_ethernet.c | 39 ++++++++++++---------- nuttx/configs/sama5d4-ek/src/sam_hsmci.c | 2 +- nuttx/configs/sama5d4-ek/src/sam_nandflash.c | 2 +- nuttx/configs/sama5d4-ek/src/sam_spi.c | 2 +- nuttx/configs/sama5d4-ek/src/sam_usb.c | 2 +- nuttx/configs/sama5d4-ek/src/sama5d4-ek.h | 18 +++++----- nuttx/include/net/if.h | 2 +- nuttx/net/netdev/netdev_ioctl.c | 15 ++++++++- 17 files changed, 112 insertions(+), 88 deletions(-) diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c index 187a0bb2f..647d0eebd 100644 --- a/apps/nshlib/nsh_netinit.c +++ b/apps/nshlib/nsh_netinit.c @@ -228,7 +228,6 @@ int nsh_netinit(void) struct sched_param sparam; pthread_attr_t attr; pthread_t tid; - void *value; int ret; /* Start the network initialization thread to perform the network bring-up diff --git a/nuttx/arch/arm/src/sama5/sam_emaca.c b/nuttx/arch/arm/src/sama5/sam_emaca.c index a32ebcb29..de2a6a2b8 100644 --- a/nuttx/arch/arm/src/sama5/sam_emaca.c +++ b/nuttx/arch/arm/src/sama5/sam_emaca.c @@ -385,7 +385,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 -static int sam_ioctl(struct net_driver_s *dev, int cmd, void *arg); +static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg); #endif /* PHY Initialization */ @@ -1848,8 +1848,9 @@ 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, void *arg) +static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg) { + struct sam_emac_s *priv = (struct sam_emac_s *)dev->d_private; int ret; switch (cmd) diff --git a/nuttx/arch/arm/src/sama5/sam_emacb.c b/nuttx/arch/arm/src/sama5/sam_emacb.c index e4f95798a..82dc4cf9b 100644 --- a/nuttx/arch/arm/src/sama5/sam_emacb.c +++ b/nuttx/arch/arm/src/sama5/sam_emacb.c @@ -344,7 +344,7 @@ struct sam_emacattr_s { /* Basic hardware information */ -#ifdef CONFIG_NETDEV_PHY_IOCTL +#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 */ @@ -497,7 +497,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 -static int sam_ioctl(struct net_driver_s *dev, int cmd, void *arg); +static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg); #endif /* PHY Initialization */ @@ -607,8 +607,8 @@ static const struct sam_emacattr_s g_emac0_attr = { /* Basic hardware information */ -#ifdef CONFIG_NETDEV_PHY_IOCTL - .intf = SAMA5_EMAC0_DEVNAME; +#if defined(CONFIG_ARCH_PHY_INTERRUPT) && defined(CONFIG_NETDEV_PHY_IOCTL) + .intf = SAMA5_EMAC0_DEVNAME, #endif .base = SAM_EMAC0_VBASE, .handler = sam_emac0_interrupt, @@ -678,8 +678,8 @@ static const struct sam_emacattr_s g_emac1_attr = { /* Basic hardware information */ -#ifdef CONFIG_NETDEV_PHY_IOCTL - .intf = SAMA5_EMAC1_DEVNAME; +#if defined(CONFIG_ARCH_PHY_INTERRUPT) && defined(CONFIG_NETDEV_PHY_IOCTL) + .intf = SAMA5_EMAC1_DEVNAME, #endif .base = SAM_EMAC1_VBASE, .handler = sam_emac1_interrupt, @@ -2234,8 +2234,9 @@ 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, void *arg) +static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg) { + struct sam_emac_s *priv = (struct sam_emac_s *)dev->d_private; int ret; switch (cmd) @@ -2244,7 +2245,7 @@ static int sam_ioctl(struct net_driver_s *dev, int cmd, void *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(dev0->intf, req->pid, req->signo, req->arg); + ret = phy_notify_subscribe(priv->attr->intf, 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 62ed5c692..4451583ed 100644 --- a/nuttx/arch/arm/src/sama5/sam_gmac.c +++ b/nuttx/arch/arm/src/sama5/sam_gmac.c @@ -310,7 +310,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 -static int sam_ioctl(struct net_driver_s *dev, int cmd, void *arg); +static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg); #endif /* PHY Initialization */ @@ -1803,8 +1803,9 @@ 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, void *arg) +static int sam_ioctl(struct net_driver_s *dev, int cmd, long arg) { + struct sam_emac_s *priv = (struct sam_emac_s *)dev->d_private; int ret; switch (cmd) diff --git a/nuttx/arch/arm/src/stm32/stm32_eth.c b/nuttx/arch/arm/src/stm32/stm32_eth.c index 7a2287afe..4923295b3 100644 --- a/nuttx/arch/arm/src/stm32/stm32_eth.c +++ b/nuttx/arch/arm/src/stm32/stm32_eth.c @@ -659,7 +659,7 @@ static int stm32_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); static int stm32_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); #endif #ifdef CONFIG_NETDEV_PHY_IOCTL -static int stm32_ioctl(struct net_driver_s *dev, int cmd, void *arg); +static int stm32_ioctl(struct net_driver_s *dev, int cmd, long arg); #endif /* Descriptor Initialization */ @@ -2509,7 +2509,7 @@ static void stm32_rxdescinit(FAR struct stm32_ethmac_s *priv) ****************************************************************************/ #ifdef CONFIG_NETDEV_PHY_IOCTL -static int stm32_ioctl(struct net_driver_s *dev, int cmd, void *arg) +static int stm32_ioctl(struct net_driver_s *dev, int cmd, long arg) { int ret; diff --git a/nuttx/configs/sama5d3-xplained/src/sam_ethernet.c b/nuttx/configs/sama5d3-xplained/src/sam_ethernet.c index c180b01bf..77b341ab8 100644 --- a/nuttx/configs/sama5d3-xplained/src/sam_ethernet.c +++ b/nuttx/configs/sama5d3-xplained/src/sam_ethernet.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -48,6 +49,8 @@ #include "sam_pio.h" #include "sam_ethernet.h" +#include "sama5d3-xplained.h" + #ifdef HAVE_NETWORK /************************************************************************************ @@ -59,11 +62,11 @@ #endif #ifdef CONFIG_SAMA5_EMAC_ISETH0 -# SAMA5_EMAC_DEVNAME "eth0" -# SAMA5_GMAC_DEVNAME "eth1" +# define SAMA5_EMAC_DEVNAME "eth0" +# define SAMA5_GMAC_DEVNAME "eth1" #else -# SAMA5_GMAC_DEVNAME "eth0" -# SAMA5_EMAC_DEVNAME "eth1" +# define SAMA5_GMAC_DEVNAME "eth0" +# define SAMA5_EMAC_DEVNAME "eth1" #endif /************************************************************************************ @@ -72,10 +75,10 @@ #ifdef CONFIG_SAMA5_PIOE_IRQ #ifdef CONFIG_SAMA5_EMACA -static xcpt g_emac_handler; +static xcpt_t g_emac_handler; #endif #ifdef CONFIG_SAMA5_GMAC -static xcpt g_gmac_handler; +static xcpt_t g_gmac_handler; #endif #endif @@ -97,7 +100,7 @@ static xcpt g_gmac_handler; void weak_function sam_netinitialize(void) { -#ifdef CONFIG_SAMA4_EMACA +#ifdef CONFIG_SAMA5_EMACA /* Ethernet 10/100 (EMAC A) Port * * The main board contains a MICREL PHY device (KSZ8051) operating at 10/100 Mbps. @@ -120,7 +123,7 @@ void weak_function sam_netinitialize(void) sam_configpio(PIO_INT_ETH1); #endif -#ifdef CONFIG_SAMA4_GMAC +#ifdef CONFIG_SAMA5_GMAC /* Tri-Speed Ethernet PHY * * The SAMA5D3 series-CM board is equipped with a MICREL PHY devices (MICREL @@ -191,10 +194,10 @@ void weak_function sam_netinitialize(void) ****************************************************************************/ #ifdef CONFIG_SAMA5_PIOE_IRQ -xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); +xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler) { irqstate_t flags; - xcpt_t *handler; + xcpt_t *phandler; xcpt_t oldhandler; pio_pinset_t pinset; int irq; @@ -204,18 +207,18 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); #ifdef CONFIG_SAMA5_EMACA if (strcmp(intf, SAMA5_EMAC_DEVNAME) == 0) { - handler = &g_emac_handler; - pinset = PIO_INT_ETH1; - irq = IRQ_INT_ETH1; + phandler = &g_emac_handler; + pinset = PIO_INT_ETH1; + irq = IRQ_INT_ETH1; } else #endif #ifdef CONFIG_SAMA5_GMAC if (strcmp(intf, SAMA5_GMAC_DEVNAME) == 0) { - handler = &g_gmac_handler; - pinset = PIO_INT_ETH0; - irq = IRQ_INT_ETH0; + phandler = &g_gmac_handler; + pinset = PIO_INT_ETH0; + irq = IRQ_INT_ETH0; } else #endif @@ -232,8 +235,8 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); /* Get the old button interrupt handler and save the new one */ - oldhandler = *handler; - *handler = handler; + oldhandler = *phandler; + *phandler = handler; /* Configure the interrupt */ diff --git a/nuttx/configs/sama5d3-xplained/src/sama5d3-xplained.h b/nuttx/configs/sama5d3-xplained/src/sama5d3-xplained.h index 57a17bdb2..c51e0f683 100644 --- a/nuttx/configs/sama5d3-xplained/src/sama5d3-xplained.h +++ b/nuttx/configs/sama5d3-xplained/src/sama5d3-xplained.h @@ -418,7 +418,7 @@ /* Ethernet */ -#ifdef CONFIG_SAMA4_EMACA +#ifdef CONFIG_SAMA5_EMACA /* ETH1: Ethernet 10/100 (EMAC A) Port * * The main board contains a MICREL PHY device (KSZ8051) operating at 10/100 Mbps. @@ -444,7 +444,7 @@ #endif -#ifdef CONFIG_SAMA4_GMAC +#ifdef CONFIG_SAMA5_GMAC /* ETH0: Tri-Speed Ethernet PHY * * The SAMA5D3 series-CM board is equipped with a MICREL PHY devices (MICREL diff --git a/nuttx/configs/sama5d3x-ek/src/sam_ethernet.c b/nuttx/configs/sama5d3x-ek/src/sam_ethernet.c index 7fcc42bfb..f0d1fcdb8 100644 --- a/nuttx/configs/sama5d3x-ek/src/sam_ethernet.c +++ b/nuttx/configs/sama5d3x-ek/src/sam_ethernet.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -48,6 +49,8 @@ #include "sam_pio.h" #include "sam_ethernet.h" +#include "sama5d3x-ek.h" + #ifdef HAVE_NETWORK /************************************************************************************ @@ -59,11 +62,11 @@ #endif #ifdef CONFIG_SAMA5_EMAC_ISETH0 -# SAMA5_EMAC_DEVNAME "eth0" -# SAMA5_GMAC_DEVNAME "eth1" +# define SAMA5_EMAC_DEVNAME "eth0" +# define SAMA5_GMAC_DEVNAME "eth1" #else -# SAMA5_GMAC_DEVNAME "eth0" -# SAMA5_EMAC_DEVNAME "eth1" +# define SAMA5_GMAC_DEVNAME "eth0" +# define SAMA5_EMAC_DEVNAME "eth1" #endif /************************************************************************************ @@ -72,10 +75,10 @@ #ifdef CONFIG_SAMA5_PIOE_IRQ #ifdef CONFIG_SAMA5_EMACA -static xcpt g_emac_handler; +static xcpt_t g_emac_handler; #endif #ifdef CONFIG_SAMA5_GMAC -static xcpt g_gmac_handler; +static xcpt_t g_gmac_handler; #endif #endif @@ -97,7 +100,7 @@ static xcpt g_gmac_handler; void weak_function sam_netinitialize(void) { -#ifdef CONFIG_SAMA4_EMACA +#ifdef CONFIG_SAMA5_EMACA /* Ethernet 10/100 (EMAC A) Port * * The main board contains a MICREL PHY device (KSZ8051) operating at 10/100 Mbps. @@ -120,7 +123,7 @@ void weak_function sam_netinitialize(void) sam_configpio(PIO_INT_ETH1); #endif -#ifdef CONFIG_SAMA4_GMAC +#ifdef CONFIG_SAMA5_GMAC /* Tri-Speed Ethernet PHY * * The SAMA5D3 series-CM board is equipped with a MICREL PHY devices (MICREL @@ -191,10 +194,10 @@ void weak_function sam_netinitialize(void) ****************************************************************************/ #ifdef CONFIG_SAMA5_PIOE_IRQ -xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); +xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler) { irqstate_t flags; - xcpt_t *handler; + xcpt_t *phandler; xcpt_t oldhandler; pio_pinset_t pinset; int irq; @@ -204,18 +207,18 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); #ifdef CONFIG_SAMA5_EMACA if (strcmp(intf, SAMA5_EMAC_DEVNAME) == 0) { - handler = &g_emac_handler; - pinset = PIO_INT_ETH1; - irq = IRQ_INT_ETH1; + phandler = &g_emac_handler; + pinset = PIO_INT_ETH1; + irq = IRQ_INT_ETH1; } else #endif #ifdef CONFIG_SAMA5_GMAC if (strcmp(intf, SAMA5_GMAC_DEVNAME) == 0) { - handler = &g_gmac_handler; - pinset = PIO_INT_ETH0; - irq = IRQ_INT_ETH0; + phandler = &g_gmac_handler; + pinset = PIO_INT_ETH0; + irq = IRQ_INT_ETH0; } else #endif @@ -232,8 +235,8 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); /* Get the old button interrupt handler and save the new one */ - oldhandler = *handler; - *handler = handler; + oldhandler = *phandler; + *phandler = handler; /* Configure the interrupt */ diff --git a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h index df02c6a47..578155cb1 100644 --- a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h +++ b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h @@ -545,7 +545,7 @@ /* Ethernet */ -#ifdef CONFIG_SAMA4_EMACA +#ifdef CONFIG_SAMA5_EMACA /* ETH1: Ethernet 10/100 (EMAC A) Port * * The main board contains a MICREL PHY device (KSZ8051) operating at 10/100 Mbps. @@ -571,7 +571,7 @@ #endif -#ifdef CONFIG_SAMA4_GMAC +#ifdef CONFIG_SAMA5_GMAC /* ETH0: Tri-Speed Ethernet PHY * * The SAMA5D3 series-CM board is equipped with a MICREL PHY devices (MICREL diff --git a/nuttx/configs/sama5d4-ek/src/sam_ethernet.c b/nuttx/configs/sama5d4-ek/src/sam_ethernet.c index de115f923..22c93b4d5 100644 --- a/nuttx/configs/sama5d4-ek/src/sam_ethernet.c +++ b/nuttx/configs/sama5d4-ek/src/sam_ethernet.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -48,6 +49,8 @@ #include "sam_pio.h" #include "sam_ethernet.h" +#include "sama5d4-ek.h" + #ifdef HAVE_NETWORK /************************************************************************************ @@ -59,11 +62,11 @@ #endif #ifdef CONFIG_SAMA5_EMAC0_ISETH0 -# SAMA5_EMAC0_DEVNAME "eth0" -# SAMA5_EMAC1_DEVNAME "eth1" +# define SAMA5_EMAC0_DEVNAME "eth0" +# define SAMA5_EMAC1_DEVNAME "eth1" #else -# SAMA5_EMAC0_DEVNAME "eth1" -# SAMA5_EMAC1_DEVNAME "eth0" +# define SAMA5_EMAC0_DEVNAME "eth1" +# define SAMA5_EMAC1_DEVNAME "eth0" #endif /************************************************************************************ @@ -72,10 +75,10 @@ #ifdef CONFIG_SAMA5_PIOE_IRQ #ifdef CONFIG_SAMA5_EMAC0 -static xcpt g_emac0_handler; +static xcpt_t g_emac0_handler; #endif #ifdef CONFIG_SAMA5_EMAC1 -static xcpt g_emac1_handler; +static xcpt_t g_emac1_handler; #endif #endif @@ -97,11 +100,11 @@ static xcpt g_emac1_handler; void weak_function sam_netinitialize(void) { -#ifdef CONFIG_SAMA4_EMAC0 +#ifdef CONFIG_SAMA5_EMAC0 sam_configpio(PIO_INT_ETH0); #endif -#ifdef CONFIG_SAMA4_EMAC1 +#ifdef CONFIG_SAMA5_EMAC1 sam_configpio(PIO_INT_ETH1); #endif } @@ -160,10 +163,10 @@ void weak_function sam_netinitialize(void) ****************************************************************************/ #ifdef CONFIG_SAMA5_PIOE_IRQ -xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); +xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler) { irqstate_t flags; - xcpt_t *handler; + xcpt_t *phandler; xcpt_t oldhandler; pio_pinset_t pinset; int irq; @@ -173,18 +176,18 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); #ifdef CONFIG_SAMA5_EMAC0 if (strcmp(intf, SAMA5_EMAC0_DEVNAME) == 0) { - handler = &g_emac0_handler; - pinset = PIO_INT_ETH0; - irq = IRQ_INT_ETH0; + phandler = &g_emac0_handler; + pinset = PIO_INT_ETH0; + irq = IRQ_INT_ETH0; } else #endif #ifdef CONFIG_SAMA5_EMAC1 if (strcmp(intf, SAMA5_EMAC1_DEVNAME) == 0) { - handler = &g_emac1_handler; - pinset = PIO_INT_ETH1; - irq = IRQ_INT_ETH1; + phandler = &g_emac1_handler; + pinset = PIO_INT_ETH1; + irq = IRQ_INT_ETH1; } else #endif @@ -201,8 +204,8 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler); /* Get the old button interrupt handler and save the new one */ - oldhandler = *handler; - *handler = handler; + oldhandler = *phandler; + *phandler = handler; /* Configure the interrupt */ diff --git a/nuttx/configs/sama5d4-ek/src/sam_hsmci.c b/nuttx/configs/sama5d4-ek/src/sam_hsmci.c index 99016a8a6..a4b6a91d1 100644 --- a/nuttx/configs/sama5d4-ek/src/sam_hsmci.c +++ b/nuttx/configs/sama5d4-ek/src/sam_hsmci.c @@ -33,7 +33,7 @@ * ****************************************************************************/ -/* The SAMA4D4-EK provides a two SD memory card slots: (1) a full size SD +/* The SAMA5D4-EK provides a two SD memory card slots: (1) a full size SD * card slot (J10), and (2) a microSD memory card slot (J11). * * The full size SD card slot connects via HSMCI0. The card detect discrete diff --git a/nuttx/configs/sama5d4-ek/src/sam_nandflash.c b/nuttx/configs/sama5d4-ek/src/sam_nandflash.c index 651e2eca3..9044526b3 100644 --- a/nuttx/configs/sama5d4-ek/src/sam_nandflash.c +++ b/nuttx/configs/sama5d4-ek/src/sam_nandflash.c @@ -4,7 +4,7 @@ * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * - * Most of this file derives from Atmel sample code for the SAMA4D4-EK + * Most of this file derives from Atmel sample code for the SAMA5D4-EK * board. That sample code has licensing that is compatible with the NuttX * modified BSD license: * diff --git a/nuttx/configs/sama5d4-ek/src/sam_spi.c b/nuttx/configs/sama5d4-ek/src/sam_spi.c index 905e79877..56105cfbc 100644 --- a/nuttx/configs/sama5d4-ek/src/sam_spi.c +++ b/nuttx/configs/sama5d4-ek/src/sam_spi.c @@ -89,7 +89,7 @@ * Name: sam_spiinitialize * * Description: - * Called to configure SPI chip select PIO pins for the SAMA4D4-EK board. + * Called to configure SPI chip select PIO pins for the SAMA5D4-EK board. * ************************************************************************************/ diff --git a/nuttx/configs/sama5d4-ek/src/sam_usb.c b/nuttx/configs/sama5d4-ek/src/sam_usb.c index b3f510b9f..eeb090860 100644 --- a/nuttx/configs/sama5d4-ek/src/sam_usb.c +++ b/nuttx/configs/sama5d4-ek/src/sam_usb.c @@ -197,7 +197,7 @@ static int ehci_waiter(int argc, char *argv[]) * * Description: * Called from sam_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the SAMA4D4-EK board. + * GPIO pins for the SAMA5D4-EK board. * * USB Ports * The SAMA5D4 series-MB features three USB communication ports: diff --git a/nuttx/configs/sama5d4-ek/src/sama5d4-ek.h b/nuttx/configs/sama5d4-ek/src/sama5d4-ek.h index e99a152f1..fc49e0b6c 100644 --- a/nuttx/configs/sama5d4-ek/src/sama5d4-ek.h +++ b/nuttx/configs/sama5d4-ek/src/sama5d4-ek.h @@ -540,7 +540,7 @@ #define MXT_I2C_ADDRESS 0x4c /* HSMCI Card Slots *****************************************************************/ -/* The SAMA4D4-EK provides a two SD memory card slots: (1) a full size SD +/* The SAMA5D4-EK provides a two SD memory card slots: (1) a full size SD * card slot (J10), and (2) a microSD memory card slot (J11). * * The full size SD card slot connects via HSMCI0. The card detect discrete @@ -597,7 +597,7 @@ PIO_PORT_PIOE | PIO_PIN15) /* USB Ports ************************************************************************/ -/* The SAMA4D4-EK features three USB communication ports: +/* The SAMA5D4-EK features three USB communication ports: * * * Port A Host High Speed (EHCI) and Full Speed (OHCI) multiplexed with * USB Device High Speed Micro AB connector, J1 @@ -685,7 +685,7 @@ /* Ethernet */ -#ifdef CONFIG_SAMA4_EMACB +#ifdef CONFIG_SAMA5_EMACB /* ETH0/1: Ethernet 10/100 (EMAC) Ports * * Networking support via the can be added to NSH by selecting the following @@ -747,13 +747,13 @@ * - LCD_ETH1_CONFIG = 1 & LCD_DETECT# =0: LCD 5v enable */ -#ifdef CONFIG_SAMA4_EMAC0 +#ifdef CONFIG_SAMA5_EMAC0 # define PIO_INT_ETH0 (PIO_INPUT | PIO_CFG_PULLUP | PIO_CFG_DEGLITCH | \ PIO_INT_BOTHEDGES | PIO_PORT_PIOE | PIO_PIN1) # define IRQ_INT_ETH0 SAM_IRQ_PE1 #endif -#ifdef CONFIG_SAMA4_EMAC1 +#ifdef CONFIG_SAMA5_EMAC1 # define PIO_INT_ETH1 (PIO_INPUT | PIO_CFG_PULLUP | PIO_CFG_DEGLITCH | \ PIO_INT_BOTHEDGES | PIO_PORT_PIOE | PIO_PIN2) # define IRQ_INT_ETH1 SAM_IRQ_PE2 @@ -844,7 +844,7 @@ * Name: sam_spiinitialize * * Description: - * Called to configure SPI chip select PIO pins for the SAMA4D4-EK board. + * Called to configure SPI chip select PIO pins for the SAMA5D4-EK board. * ************************************************************************************/ @@ -858,7 +858,7 @@ void weak_function sam_spiinitialize(void); * Description: * Configures DDR2 (MT47H128M16RT 128MB or, optionally, MT47H64M16HR) * - * Per the SAMA4D4-EK User guide: "Two SDRAM/DDR2 used as main system memory. + * Per the SAMA5D4-EK User guide: "Two SDRAM/DDR2 used as main system memory. * MT47H128M16 - 2 Gb - 16 Meg x 16 x 8 banks, the board provides up to 2 Gb on- * board, soldered DDR2 SDRAM. The memory bus is 32 bits wide and operates with * up to 166 MHz." @@ -870,7 +870,7 @@ void weak_function sam_spiinitialize(void); * Column address A[9:0] (1K) * Bank address BA[2:0] a(24,25) (8) * - * This logic was taken from Atmel sample code for the SAMA4D4-EK. + * This logic was taken from Atmel sample code for the SAMA5D4-EK. * * Input Parameters: * devtype - Either DDRAM_MT47H128M16RT or DDRAM_MT47H64M16HR @@ -999,7 +999,7 @@ bool sam_writeprotected(int slotno); * * Description: * Called from sam_usbinitialize very early in inialization to setup USB-related - * PIO pins for the SAMA4D4-EK board. + * PIO pins for the SAMA5D4-EK board. * ************************************************************************************/ diff --git a/nuttx/include/net/if.h b/nuttx/include/net/if.h index c9ffc0709..e05cc7869 100644 --- a/nuttx/include/net/if.h +++ b/nuttx/include/net/if.h @@ -138,7 +138,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 llfru_mii_notify; /* PHY event notification */ + struct mii_iotcl_notify_s ifru_mii_notify; /* PHY event notification */ struct mii_ioctl_data_s ifru_mii_data; /* MII request data */ } ifr_ifru; }; diff --git a/nuttx/net/netdev/netdev_ioctl.c b/nuttx/net/netdev/netdev_ioctl.c index ea9f59fa4..1af66029b 100644 --- a/nuttx/net/netdev/netdev_ioctl.c +++ b/nuttx/net/netdev/netdev_ioctl.c @@ -425,6 +425,19 @@ static int netdev_ifrioctl(FAR struct socket *psock, int cmd, #endif #ifdef CONFIG_NETDEV_PHY_IOCTL +#ifdef CONFIG_ARCH_PHY_INTERRUPT + case SIOCMIINOTIFY: /* Set up for PHY event notifications */ + { + dev = netdev_ifrdev(req); + if (dev && dev->d_ioctl) + { + struct mii_iotcl_notify_s *notify = &req->ifr_ifru.ifru_mii_notify; + ret = dev->d_ioctl(dev, cmd, ((long)(uintptr_t)notify)); + } + } + break; +#endif + case SIOCGMIIPHY: /* Get address of MII PHY in use */ case SIOCGMIIREG: /* Get MII register via MDIO */ case SIOCSMIIREG: /* Set MII register via MDIO */ @@ -433,7 +446,7 @@ static int netdev_ifrioctl(FAR struct socket *psock, int cmd, if (dev && dev->d_ioctl) { struct mii_ioctl_data_s *mii_data = &req->ifr_ifru.ifru_mii_data; - ret = dev->d_ioctl(dev, cmd, ((long)(uintptr_t)mii_data); + ret = dev->d_ioctl(dev, cmd, ((long)(uintptr_t)mii_data)); } } break; -- cgit v1.2.3