mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
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:
@@ -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);
|
static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#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
|
#endif
|
||||||
|
|
||||||
/* PHY Initialization */
|
/* PHY Initialization */
|
||||||
@@ -1848,8 +1848,9 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#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;
|
int ret;
|
||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ struct sam_emacattr_s
|
|||||||
{
|
{
|
||||||
/* Basic hardware information */
|
/* 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" */
|
FAR const char *intf; /* Network interface name, e.g., "eth0" */
|
||||||
#endif
|
#endif
|
||||||
uint32_t base; /* EMAC Register base address */
|
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);
|
static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#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
|
#endif
|
||||||
|
|
||||||
/* PHY Initialization */
|
/* PHY Initialization */
|
||||||
@@ -607,8 +607,8 @@ static const struct sam_emacattr_s g_emac0_attr =
|
|||||||
{
|
{
|
||||||
/* Basic hardware information */
|
/* Basic hardware information */
|
||||||
|
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#if defined(CONFIG_ARCH_PHY_INTERRUPT) && defined(CONFIG_NETDEV_PHY_IOCTL)
|
||||||
.intf = SAMA5_EMAC0_DEVNAME;
|
.intf = SAMA5_EMAC0_DEVNAME,
|
||||||
#endif
|
#endif
|
||||||
.base = SAM_EMAC0_VBASE,
|
.base = SAM_EMAC0_VBASE,
|
||||||
.handler = sam_emac0_interrupt,
|
.handler = sam_emac0_interrupt,
|
||||||
@@ -678,8 +678,8 @@ static const struct sam_emacattr_s g_emac1_attr =
|
|||||||
{
|
{
|
||||||
/* Basic hardware information */
|
/* Basic hardware information */
|
||||||
|
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#if defined(CONFIG_ARCH_PHY_INTERRUPT) && defined(CONFIG_NETDEV_PHY_IOCTL)
|
||||||
.intf = SAMA5_EMAC1_DEVNAME;
|
.intf = SAMA5_EMAC1_DEVNAME,
|
||||||
#endif
|
#endif
|
||||||
.base = SAM_EMAC1_VBASE,
|
.base = SAM_EMAC1_VBASE,
|
||||||
.handler = sam_emac1_interrupt,
|
.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
|
#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;
|
int ret;
|
||||||
|
|
||||||
switch (cmd)
|
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 */
|
case SIOCMIINOTIFY: /* Set up for PHY event notifications */
|
||||||
{
|
{
|
||||||
struct mii_iotcl_notify_s *req = (struct mii_iotcl_notify_s *)((uintptr_t)arg);
|
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;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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);
|
static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#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
|
#endif
|
||||||
|
|
||||||
/* PHY Initialization */
|
/* PHY Initialization */
|
||||||
@@ -1803,8 +1803,9 @@ static int sam_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#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;
|
int ret;
|
||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
|
|||||||
@@ -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);
|
static int stm32_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#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
|
#endif
|
||||||
|
|
||||||
/* Descriptor Initialization */
|
/* Descriptor Initialization */
|
||||||
@@ -2509,7 +2509,7 @@ static void stm32_rxdescinit(FAR struct stm32_ethmac_s *priv)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NETDEV_PHY_IOCTL
|
#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;
|
int ret;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user