summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-17 16:51:56 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-17 16:51:56 -0600
commit1e403a4e31a138eb5d47f8ff8738b088ea9d051a (patch)
tree3774dbe8fd5e488dc257976d9709dd22e09b7c59 /apps
parent23900a5b4bbc6b32bbc5095f93c02b3b4ad88456 (diff)
downloadnuttx-1e403a4e31a138eb5d47f8ff8738b088ea9d051a.tar.gz
nuttx-1e403a4e31a138eb5d47f8ff8738b088ea9d051a.tar.bz2
nuttx-1e403a4e31a138eb5d47f8ff8738b088ea9d051a.zip
Change the way PHY interrupts work: disable automatically. Then we have to re-subscribe each time after the interrupt fires
Diffstat (limited to 'apps')
-rw-r--r--apps/nshlib/nsh_netinit.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c
index 2e49bbbc8..704419308 100644
--- a/apps/nshlib/nsh_netinit.c
+++ b/apps/nshlib/nsh_netinit.c
@@ -327,31 +327,30 @@ static int nsh_netinit_monitor(void)
goto errout_with_socket;
}
- /* Configure to receive a signal on changes in link status */
-
- strncpy(ifr.ifr_name, NET_DEVNAME, IFNAMSIZ);
- ifr.ifr_mii_notify_pid = 0; /* PID=0 means this task */
- ifr.ifr_mii_notify_signo = CONFIG_NSH_NETINIT_SIGNO;
- ifr.ifr_mii_notify_arg = NULL;
-
- ret = ioctl(sd, SIOCMIINOTIFY, (unsigned long)&ifr);
- if (ret < 0)
- {
- ret = -errno;
- DEBUGASSERT(ret < 0);
-
- ndbg("ERROR: ioctl(SIOCMIINOTIFY) failed: %d\n", ret);
- goto errout_with_sigaction;
- }
-
/* Now loop, waiting for changes in link status */
for (;;)
{
- /* Does the driver think that the link is up or down? */
+ /* Configure to receive a signal on changes in link status */
strncpy(ifr.ifr_name, NET_DEVNAME, IFNAMSIZ);
+ ifr.ifr_mii_notify_pid = 0; /* PID=0 means this task */
+ ifr.ifr_mii_notify_signo = CONFIG_NSH_NETINIT_SIGNO;
+ ifr.ifr_mii_notify_arg = NULL;
+
+ ret = ioctl(sd, SIOCMIINOTIFY, (unsigned long)&ifr);
+ if (ret < 0)
+ {
+ ret = -errno;
+ DEBUGASSERT(ret < 0);
+
+ ndbg("ERROR: ioctl(SIOCMIINOTIFY) failed: %d\n", ret);
+ goto errout_with_sigaction;
+ }
+
+ /* Does the driver think that the link is up or down? */
+
ret = ioctl(sd, SIOCGIFFLAGS, (unsigned long)&ifr);
if (ret < 0)
{
@@ -483,7 +482,7 @@ static int nsh_netinit_monitor(void)
abstime.tv_nsec -= 1000000000;
}
- DEBUGVERIFY(sem_timedwait(&g_notify_sem, &abstime));
+ (void)sem_timedwait(&g_notify_sem, &abstime);
sched_unlock();
}