More of the PHY event notification logic change: Fix some compile errors when full feature is enabled; Add some missing ioctol logic

This commit is contained in:
Gregory Nutt
2014-08-16 15:04:09 -06:00
parent 329ae8024d
commit 8f6f564971
4 changed files with 17 additions and 14 deletions
+3 -2
View File
@@ -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)
+9 -8
View File
@@ -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
+3 -2
View File
@@ -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)
+2 -2
View File
@@ -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;