drivers/net/phy_notify.c and all network drivers that support PHY notifications: Support the signal notification through SIGEV_THREAD

This commit is contained in:
Xiang Xiao
2019-01-27 08:57:23 -06:00
committed by Gregory Nutt
parent 5e8ae23edc
commit d105dc9b5e
13 changed files with 27 additions and 45 deletions
+3 -3
View File
@@ -40,6 +40,7 @@
* Included Files
*******************************************************************************************/
#include <signal.h>
#include <sys/socket.h>
/*******************************************************************************************
@@ -119,9 +120,8 @@
struct mii_iotcl_notify_s
{
pid_t pid; /* PID of the task to receive the signal. Zero means "this task" */
uint8_t signo; /* Signal number to use when signalling */
FAR void *arg; /* An argument that will accompany the signal callback */
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 */
};
/* Structure passed to read from or write to the MII/PHY management interface via the
+4 -4
View File
@@ -45,6 +45,7 @@
#include <nuttx/config.h>
#include <signal.h>
#include <sys/types.h>
/****************************************************************************
@@ -103,8 +104,7 @@ extern "C"
* terminator). Configurable with CONFIG_PHY_NOTIFICATION_MAXINTFLEN.
* pid - Identifies the task to receive the signal. The special value
* of zero means to use the pid of the current task.
* signo - This is the signal number to use when notifying the task.
* arg - An argument that will accompany the notification signal.
* event - Describe the way a task is to be notified
*
* Returned Value:
* OK on success; Negated errno on failure.
@@ -112,8 +112,8 @@ extern "C"
****************************************************************************/
#ifdef CONFIG_ARCH_PHY_INTERRUPT
int phy_notify_subscribe(FAR const char *intf, pid_t pid, int signo,
FAR void *arg);
int phy_notify_subscribe(FAR const char *intf, pid_t pid,
FAR struct sigevent *event);
#endif
/****************************************************************************