poll: pollsetup should notify only one fd passd by caller
since it's redundant to iterate the whole fds array in setup Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
11b3adf17f
commit
eddd90de78
@ -3097,7 +3097,7 @@ static int cxd56_gnss_poll(struct file *filep, struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->has_event)
|
if (priv->has_event)
|
||||||
{
|
{
|
||||||
cxd56_gnss_pollnotify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -3108,9 +3108,9 @@ static int cxd56_gnss_poll(struct file *filep, struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
priv->has_event = false;
|
priv->has_event = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -206,9 +206,9 @@ struct sam_tsd_s
|
|||||||
|
|
||||||
static void sam_tsd_notify(struct sam_tsd_s *priv);
|
static void sam_tsd_notify(struct sam_tsd_s *priv);
|
||||||
static int sam_tsd_sample(struct sam_tsd_s *priv,
|
static int sam_tsd_sample(struct sam_tsd_s *priv,
|
||||||
struct sam_sample_s *sample);
|
struct sam_sample_s *sample);
|
||||||
static int sam_tsd_waitsample(struct sam_tsd_s *priv,
|
static int sam_tsd_waitsample(struct sam_tsd_s *priv,
|
||||||
struct sam_sample_s *sample);
|
struct sam_sample_s *sample);
|
||||||
static void sam_tsd_bottomhalf(void *arg);
|
static void sam_tsd_bottomhalf(void *arg);
|
||||||
static int sam_tsd_schedule(struct sam_tsd_s *priv);
|
static int sam_tsd_schedule(struct sam_tsd_s *priv);
|
||||||
static void sam_tsd_expiry(wdparm_t arg);
|
static void sam_tsd_expiry(wdparm_t arg);
|
||||||
@ -1185,8 +1185,8 @@ static int sam_tsd_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
if (i >= CONFIG_SAMA5_TSD_NPOLLWAITERS)
|
if (i >= CONFIG_SAMA5_TSD_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1194,7 +1194,7 @@ static int sam_tsd_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
if (priv->penchange)
|
if (priv->penchange)
|
||||||
{
|
{
|
||||||
sam_tsd_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -1206,8 +1206,8 @@ static int sam_tsd_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -109,15 +109,15 @@ struct stm32_bbsram_s
|
|||||||
static int stm32_bbsram_open(struct file *filep);
|
static int stm32_bbsram_open(struct file *filep);
|
||||||
static int stm32_bbsram_close(struct file *filep);
|
static int stm32_bbsram_close(struct file *filep);
|
||||||
static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
||||||
int whence);
|
int whence);
|
||||||
static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
||||||
size_t len);
|
size_t len);
|
||||||
static ssize_t stm32_bbsram_write(struct file *filep,
|
static ssize_t stm32_bbsram_write(struct file *filep,
|
||||||
const char *buffer, size_t len);
|
const char *buffer, size_t len);
|
||||||
static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
static int stm32_bbsram_poll(struct file *filep,
|
static int stm32_bbsram_poll(struct file *filep,
|
||||||
struct pollfd *fds, bool setup);
|
struct pollfd *fds, bool setup);
|
||||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||||
static int stm32_bbsram_unlink(struct inode *inode);
|
static int stm32_bbsram_unlink(struct inode *inode);
|
||||||
#endif
|
#endif
|
||||||
|
@ -109,15 +109,15 @@ struct stm32_bbsram_s
|
|||||||
static int stm32_bbsram_open(struct file *filep);
|
static int stm32_bbsram_open(struct file *filep);
|
||||||
static int stm32_bbsram_close(struct file *filep);
|
static int stm32_bbsram_close(struct file *filep);
|
||||||
static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
||||||
int whence);
|
int whence);
|
||||||
static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
||||||
size_t len);
|
size_t len);
|
||||||
static ssize_t stm32_bbsram_write(struct file *filep,
|
static ssize_t stm32_bbsram_write(struct file *filep,
|
||||||
const char *buffer, size_t len);
|
const char *buffer, size_t len);
|
||||||
static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
static int stm32_bbsram_poll(struct file *filep,
|
static int stm32_bbsram_poll(struct file *filep,
|
||||||
struct pollfd *fds, bool setup);
|
struct pollfd *fds, bool setup);
|
||||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||||
static int stm32_bbsram_unlink(struct inode *inode);
|
static int stm32_bbsram_unlink(struct inode *inode);
|
||||||
#endif
|
#endif
|
||||||
|
@ -130,15 +130,15 @@ struct stm32_bbsram_s
|
|||||||
static int stm32_bbsram_open(struct file *filep);
|
static int stm32_bbsram_open(struct file *filep);
|
||||||
static int stm32_bbsram_close(struct file *filep);
|
static int stm32_bbsram_close(struct file *filep);
|
||||||
static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
||||||
int whence);
|
int whence);
|
||||||
static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
||||||
size_t len);
|
size_t len);
|
||||||
static ssize_t stm32_bbsram_write(struct file *filep,
|
static ssize_t stm32_bbsram_write(struct file *filep,
|
||||||
const char *buffer, size_t len);
|
const char *buffer, size_t len);
|
||||||
static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
static int stm32_bbsram_poll(struct file *filep,
|
static int stm32_bbsram_poll(struct file *filep,
|
||||||
struct pollfd *fds, bool setup);
|
struct pollfd *fds, bool setup);
|
||||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||||
static int stm32_bbsram_unlink(struct inode *inode);
|
static int stm32_bbsram_unlink(struct inode *inode);
|
||||||
#endif
|
#endif
|
||||||
|
@ -325,7 +325,7 @@ static int cxd5610_gnss_post_interrupt(void);
|
|||||||
|
|
||||||
#if CONFIG_SENSORS_CXD5610_GNSS_NSIGNALRECEIVERS != 0
|
#if CONFIG_SENSORS_CXD5610_GNSS_NSIGNALRECEIVERS != 0
|
||||||
static void cxd5610_gnss_signalhandler(struct cxd5610_gnss_dev_s *priv,
|
static void cxd5610_gnss_signalhandler(struct cxd5610_gnss_dev_s *priv,
|
||||||
uint8_t sigtype);
|
uint8_t sigtype);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_SENSORS_CXD5610_GNSS_NPOLLWAITERS != 0
|
#if CONFIG_SENSORS_CXD5610_GNSS_NPOLLWAITERS != 0
|
||||||
@ -2037,7 +2037,7 @@ static int cxd5610_gnss_poll(struct file *filep, struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->has_event)
|
if (priv->has_event)
|
||||||
{
|
{
|
||||||
cxd5610_gnss_pollnotify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -2048,9 +2048,9 @@ static int cxd5610_gnss_poll(struct file *filep, struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
priv->has_event = false;
|
priv->has_event = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -1397,8 +1397,8 @@ static int tc_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
if (i >= CONFIG_TOUCHSCREEN_NPOLLWAITERS)
|
if (i >= CONFIG_TOUCHSCREEN_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: No available slot found: %d\n", i);
|
ierr("ERROR: No available slot found: %d\n", i);
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1406,7 +1406,7 @@ static int tc_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
if (priv->penchange)
|
if (priv->penchange)
|
||||||
{
|
{
|
||||||
tc_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -1418,8 +1418,8 @@ static int tc_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -1274,8 +1274,8 @@ static int tc_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
if (i >= CONFIG_TOUCHSCREEN_NPOLLWAITERS)
|
if (i >= CONFIG_TOUCHSCREEN_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: No available slot found: %d\n", i);
|
ierr("ERROR: No available slot found: %d\n", i);
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1283,7 +1283,7 @@ static int tc_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
if (priv->penchange)
|
if (priv->penchange)
|
||||||
{
|
{
|
||||||
tc_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -1295,8 +1295,8 @@ static int tc_poll(struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -971,7 +971,7 @@ static int lcd_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int lcd_poll(struct file *filep, struct pollfd *fds,
|
static int lcd_poll(struct file *filep, struct pollfd *fds,
|
||||||
bool setup)
|
bool setup)
|
||||||
{
|
{
|
||||||
if (setup)
|
if (setup)
|
||||||
{
|
{
|
||||||
|
@ -567,8 +567,8 @@ static int adc_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
if (i >= CONFIG_ADC_NPOLLWAITERS)
|
if (i >= CONFIG_ADC_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto return_with_irqdisabled;
|
goto return_with_irqdisabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,7 +576,7 @@ static int adc_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
if (dev->ad_recv.af_head != dev->ad_recv.af_tail)
|
if (dev->ad_recv.af_head != dev->ad_recv.af_tail)
|
||||||
{
|
{
|
||||||
poll_notify(dev->fds, CONFIG_ADC_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -587,8 +587,8 @@ static int adc_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return_with_irqdisabled:
|
return_with_irqdisabled:
|
||||||
|
@ -86,9 +86,9 @@ static const struct comp_callback_s g_comp_callback =
|
|||||||
static int comp_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int comp_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup)
|
bool setup)
|
||||||
{
|
{
|
||||||
FAR struct inode *inode = filep->f_inode;
|
FAR struct inode *inode = filep->f_inode;
|
||||||
FAR struct comp_dev_s *dev = inode->i_private;
|
FAR struct comp_dev_s *dev = inode->i_private;
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
DEBUGASSERT(dev && fds);
|
DEBUGASSERT(dev && fds);
|
||||||
@ -123,8 +123,8 @@ static int comp_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_DEV_COMP_NPOLLWAITERS)
|
if (i >= CONFIG_DEV_COMP_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,15 +137,15 @@ static int comp_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
#ifdef CONFIG_DEBUG_FEATURES
|
#ifdef CONFIG_DEBUG_FEATURES
|
||||||
if (!slot)
|
if (!slot)
|
||||||
{
|
{
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -55,13 +55,13 @@ static int bch_open(FAR struct file *filep);
|
|||||||
static int bch_close(FAR struct file *filep);
|
static int bch_close(FAR struct file *filep);
|
||||||
static off_t bch_seek(FAR struct file *filep, off_t offset, int whence);
|
static off_t bch_seek(FAR struct file *filep, off_t offset, int whence);
|
||||||
static ssize_t bch_read(FAR struct file *filep, FAR char *buffer,
|
static ssize_t bch_read(FAR struct file *filep, FAR char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer,
|
static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static int bch_ioctl(FAR struct file *filep, int cmd,
|
static int bch_ioctl(FAR struct file *filep, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
static int bch_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int bch_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||||
static int bch_unlink(FAR struct inode *inode);
|
static int bch_unlink(FAR struct inode *inode);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1199,7 +1199,7 @@ static int can_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(dev->cd_fds, CONFIG_CAN_NPOLLWAITERS, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
{
|
{
|
||||||
|
@ -994,7 +994,7 @@ static int ads7843e_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
inode = filep->f_inode;
|
inode = filep->f_inode;
|
||||||
|
|
||||||
DEBUGASSERT(inode->i_private);
|
DEBUGASSERT(inode->i_private);
|
||||||
priv = inode->i_private;
|
priv = inode->i_private;
|
||||||
|
|
||||||
/* Are we setting up the poll? Or tearing it down? */
|
/* Are we setting up the poll? Or tearing it down? */
|
||||||
|
|
||||||
@ -1034,8 +1034,8 @@ static int ads7843e_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_ADS7843E_NPOLLWAITERS)
|
if (i >= CONFIG_ADS7843E_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1043,7 +1043,7 @@ static int ads7843e_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->penchange)
|
if (priv->penchange)
|
||||||
{
|
{
|
||||||
ads7843e_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -1055,8 +1055,8 @@ static int ads7843e_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -630,8 +630,8 @@ static int ajoy_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
if (i >= CONFIG_INPUT_AJOYSTICK_NPOLLWAITERS)
|
if (i >= CONFIG_INPUT_AJOYSTICK_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: Too man poll waiters\n");
|
ierr("ERROR: Too man poll waiters\n");
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -710,8 +710,8 @@ static int btn_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
if (i >= CONFIG_INPUT_BUTTONS_NPOLLWAITERS)
|
if (i >= CONFIG_INPUT_BUTTONS_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: Too many poll waiters\n");
|
ierr("ERROR: Too many poll waiters\n");
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1034,9 +1034,7 @@ static int mbr3108_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
pending = priv->int_pending;
|
pending = priv->int_pending;
|
||||||
if (pending)
|
if (pending)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds,
|
poll_notify(&fds, 1, POLLIN);
|
||||||
CONFIG_INPUT_CYPRESS_MBR3108_NPOLLWAITERS,
|
|
||||||
POLLIN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -624,8 +624,8 @@ static int djoy_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
if (i >= CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS)
|
if (i >= CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: Too man poll waiters\n");
|
ierr("ERROR: Too man poll waiters\n");
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1013,8 +1013,8 @@ static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
if (i >= CONFIG_FT5X06_NPOLLWAITERS)
|
if (i >= CONFIG_FT5X06_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: No available slot found: %d\n", i);
|
ierr("ERROR: No available slot found: %d\n", i);
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1022,7 +1022,7 @@ static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->valid)
|
if (priv->valid)
|
||||||
{
|
{
|
||||||
ft5x06_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -1034,8 +1034,8 @@ static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -813,9 +813,7 @@ static int gt9xx_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
pending = priv->int_pending;
|
pending = priv->int_pending;
|
||||||
if (pending)
|
if (pending)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds,
|
poll_notify(&fds, 1, POLLIN);
|
||||||
CONFIG_INPUT_GT9XX_NPOLLWAITERS,
|
|
||||||
POLLIN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ static int keyboard_poll(FAR struct file *filep,
|
|||||||
|
|
||||||
if (!circbuf_is_empty(&opriv->circ))
|
if (!circbuf_is_empty(&opriv->circ))
|
||||||
{
|
{
|
||||||
poll_notify(&opriv->fds, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1027,8 +1027,8 @@ static int max11802_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_MAX11802_NPOLLWAITERS)
|
if (i >= CONFIG_MAX11802_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1036,7 +1036,7 @@ static int max11802_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->penchange)
|
if (priv->penchange)
|
||||||
{
|
{
|
||||||
max11802_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -1048,8 +1048,8 @@ static int max11802_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -218,7 +218,8 @@ out:
|
|||||||
* Name: mouse_poll
|
* Name: mouse_poll
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int mouse_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
|
static int mouse_poll(FAR struct file *filep,
|
||||||
|
FAR struct pollfd *fds, bool setup)
|
||||||
{
|
{
|
||||||
FAR struct mouse_openpriv_s *openpriv = filep->f_priv;
|
FAR struct mouse_openpriv_s *openpriv = filep->f_priv;
|
||||||
pollevent_t eventset = 0;
|
pollevent_t eventset = 0;
|
||||||
@ -248,7 +249,7 @@ static int mouse_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
eventset |= POLLIN;
|
eventset |= POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(&openpriv->fds, 1, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
{
|
{
|
||||||
|
@ -212,18 +212,18 @@ struct mxt_dev_s
|
|||||||
/* MXT register access */
|
/* MXT register access */
|
||||||
|
|
||||||
static int mxt_getreg(FAR struct mxt_dev_s *priv, uint16_t regaddr,
|
static int mxt_getreg(FAR struct mxt_dev_s *priv, uint16_t regaddr,
|
||||||
FAR uint8_t *buffer, size_t buflen);
|
FAR uint8_t *buffer, size_t buflen);
|
||||||
static int mxt_putreg(FAR struct mxt_dev_s *priv, uint16_t regaddr,
|
static int mxt_putreg(FAR struct mxt_dev_s *priv, uint16_t regaddr,
|
||||||
FAR const uint8_t *buffer, size_t buflen);
|
FAR const uint8_t *buffer, size_t buflen);
|
||||||
|
|
||||||
/* MXT object/message access */
|
/* MXT object/message access */
|
||||||
|
|
||||||
static FAR struct mxt_object_s *mxt_object(FAR struct mxt_dev_s *priv,
|
static FAR struct mxt_object_s *mxt_object(FAR struct mxt_dev_s *priv,
|
||||||
uint8_t type);
|
uint8_t type);
|
||||||
static int mxt_getmessage(FAR struct mxt_dev_s *priv,
|
static int mxt_getmessage(FAR struct mxt_dev_s *priv,
|
||||||
FAR struct mxt_msg_s *msg);
|
FAR struct mxt_msg_s *msg);
|
||||||
static int mxt_putobject(FAR struct mxt_dev_s *priv, uint8_t type,
|
static int mxt_putobject(FAR struct mxt_dev_s *priv, uint8_t type,
|
||||||
uint8_t offset, uint8_t value);
|
uint8_t offset, uint8_t value);
|
||||||
#if 0 /* Not used */
|
#if 0 /* Not used */
|
||||||
static int mxt_getobject(FAR struct mxt_dev_s *priv, uint8_t type,
|
static int mxt_getobject(FAR struct mxt_dev_s *priv, uint8_t type,
|
||||||
uint8_t offset, FAR uint8_t *value);
|
uint8_t offset, FAR uint8_t *value);
|
||||||
@ -236,27 +236,27 @@ static void mxt_notify(FAR struct mxt_dev_s *priv);
|
|||||||
|
|
||||||
/* Touch event waiting */
|
/* Touch event waiting */
|
||||||
|
|
||||||
static inline int mxt_checksample(FAR struct mxt_dev_s *priv);
|
static inline int mxt_checksample(FAR struct mxt_dev_s *priv);
|
||||||
static inline int mxt_waitsample(FAR struct mxt_dev_s *priv);
|
static inline int mxt_waitsample(FAR struct mxt_dev_s *priv);
|
||||||
|
|
||||||
/* Interrupt handling/position sampling */
|
/* Interrupt handling/position sampling */
|
||||||
|
|
||||||
#ifdef CONFIG_MXT_BUTTONS
|
#ifdef CONFIG_MXT_BUTTONS
|
||||||
static void mxt_button_event(FAR struct mxt_dev_s *priv,
|
static void mxt_button_event(FAR struct mxt_dev_s *priv,
|
||||||
FAR struct mxt_msg_s *msg);
|
FAR struct mxt_msg_s *msg);
|
||||||
#endif
|
#endif
|
||||||
static void mxt_touch_event(FAR struct mxt_dev_s *priv,
|
static void mxt_touch_event(FAR struct mxt_dev_s *priv,
|
||||||
FAR struct mxt_msg_s *msg, int ndx);
|
FAR struct mxt_msg_s *msg, int ndx);
|
||||||
static void mxt_worker(FAR void *arg);
|
static void mxt_worker(FAR void *arg);
|
||||||
static int mxt_interrupt(FAR const struct mxt_lower_s *lower,
|
static int mxt_interrupt(FAR const struct mxt_lower_s *lower,
|
||||||
FAR void *context);
|
FAR void *context);
|
||||||
|
|
||||||
/* Character driver methods */
|
/* Character driver methods */
|
||||||
|
|
||||||
static int mxt_open(FAR struct file *filep);
|
static int mxt_open(FAR struct file *filep);
|
||||||
static int mxt_close(FAR struct file *filep);
|
static int mxt_close(FAR struct file *filep);
|
||||||
static ssize_t mxt_read(FAR struct file *filep, FAR char *buffer,
|
static ssize_t mxt_read(FAR struct file *filep, FAR char *buffer,
|
||||||
size_t len);
|
size_t len);
|
||||||
static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||||
static int mxt_poll(FAR struct file *filep, struct pollfd *fds, bool setup);
|
static int mxt_poll(FAR struct file *filep, struct pollfd *fds, bool setup);
|
||||||
|
|
||||||
@ -1511,10 +1511,10 @@ static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup)
|
bool setup)
|
||||||
{
|
{
|
||||||
FAR struct inode *inode;
|
FAR struct inode *inode;
|
||||||
FAR struct mxt_dev_s *priv;
|
FAR struct mxt_dev_s *priv;
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
iinfo("setup: %d\n", (int)setup);
|
iinfo("setup: %d\n", (int)setup);
|
||||||
DEBUGASSERT(fds);
|
DEBUGASSERT(fds);
|
||||||
@ -1564,8 +1564,8 @@ static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
if (i >= CONFIG_MXT_NPOLLWAITERS)
|
if (i >= CONFIG_MXT_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: No available slot found: %d\n", i);
|
ierr("ERROR: No available slot found: %d\n", i);
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1573,7 +1573,7 @@ static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->event)
|
if (priv->event)
|
||||||
{
|
{
|
||||||
mxt_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -1585,8 +1585,8 @@ static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -640,8 +640,8 @@ static int spq10kbd_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_SPQ10KBD_NPOLLWAITERS)
|
if (i >= CONFIG_SPQ10KBD_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,7 +651,7 @@ static int spq10kbd_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->headndx != priv->tailndx)
|
if (priv->headndx != priv->tailndx)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_SPQ10KBD_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -663,8 +663,8 @@ static int spq10kbd_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -677,8 +677,8 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
if (i >= CONFIG_STMPE811_NPOLLWAITERS)
|
if (i >= CONFIG_STMPE811_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: No available slot found: %d\n", i);
|
ierr("ERROR: No available slot found: %d\n", i);
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -686,7 +686,7 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->penchange)
|
if (priv->penchange)
|
||||||
{
|
{
|
||||||
stmpe811_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -698,8 +698,8 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -308,12 +308,12 @@ static int touch_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
eventset |= POLLIN;
|
eventset |= POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(&openpriv->fds, 1, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
{
|
{
|
||||||
openpriv->fds = NULL;
|
openpriv->fds = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -1120,8 +1120,8 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
if (i >= CONFIG_TSC2007_NPOLLWAITERS)
|
if (i >= CONFIG_TSC2007_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
ierr("ERROR: No available slot found: %d\n", i);
|
ierr("ERROR: No available slot found: %d\n", i);
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1129,7 +1129,7 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->penchange)
|
if (priv->penchange)
|
||||||
{
|
{
|
||||||
tsc2007_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
@ -1141,8 +1141,8 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int ipcc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
int ipcc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup)
|
bool setup)
|
||||||
{
|
{
|
||||||
FAR struct ipcc_driver_s *priv;
|
FAR struct ipcc_driver_s *priv;
|
||||||
FAR struct pollfd **slot;
|
FAR struct pollfd **slot;
|
||||||
@ -144,7 +144,7 @@ int ipcc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
poll_notify(priv->fds, CONFIG_IPCC_NPOLLWAITERS, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
|
|
||||||
nxmutex_unlock(&priv->lock);
|
nxmutex_unlock(&priv->lock);
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -53,9 +53,9 @@ int ipcc_close(FAR struct file *filep);
|
|||||||
int ipcc_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
int ipcc_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||||
ssize_t ipcc_read(FAR struct file *filep, FAR char *buffer, size_t buflen);
|
ssize_t ipcc_read(FAR struct file *filep, FAR char *buffer, size_t buflen);
|
||||||
ssize_t ipcc_write(FAR struct file *filep, FAR const char *buffer,
|
ssize_t ipcc_write(FAR struct file *filep, FAR const char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
int ipcc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
int ipcc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||||
int ipcc_unlink(FAR struct inode *inode);
|
int ipcc_unlink(FAR struct inode *inode);
|
||||||
#endif
|
#endif
|
||||||
|
@ -126,25 +126,26 @@ static int tda19988_connected(FAR struct tda1988_dev_s *priv);
|
|||||||
/* HDMI Module Helpers */
|
/* HDMI Module Helpers */
|
||||||
|
|
||||||
static int tda19988_fetch_edid_block(FAR struct tda1988_dev_s *priv,
|
static int tda19988_fetch_edid_block(FAR struct tda1988_dev_s *priv,
|
||||||
FAR uint8_t *buf, int block);
|
FAR uint8_t *buf, int block);
|
||||||
static int tda19988_fetch_edid(struct tda1988_dev_s *priv);
|
static int tda19988_fetch_edid(struct tda1988_dev_s *priv);
|
||||||
static ssize_t tda19988_read_internal(FAR struct tda1988_dev_s *priv,
|
static ssize_t tda19988_read_internal(FAR struct tda1988_dev_s *priv,
|
||||||
off_t offset, FAR uint8_t *buffer, size_t buflen);
|
off_t offset, FAR uint8_t *buffer,
|
||||||
|
size_t buflen);
|
||||||
|
|
||||||
/* Character driver methods */
|
/* Character driver methods */
|
||||||
|
|
||||||
static int tda19988_open(FAR struct file *filep);
|
static int tda19988_open(FAR struct file *filep);
|
||||||
static int tda19988_close(FAR struct file *filep);
|
static int tda19988_close(FAR struct file *filep);
|
||||||
static ssize_t tda19988_read(FAR struct file *filep, FAR char *buffer,
|
static ssize_t tda19988_read(FAR struct file *filep, FAR char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static ssize_t tda19988_write(FAR struct file *filep, FAR const char *buffer,
|
static ssize_t tda19988_write(FAR struct file *filep, FAR const char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static off_t tda19988_seek(FAR struct file *filep, off_t offset,
|
static off_t tda19988_seek(FAR struct file *filep, off_t offset,
|
||||||
int whence);
|
int whence);
|
||||||
static int tda19988_ioctl(FAR struct file *filep, int cmd,
|
static int tda19988_ioctl(FAR struct file *filep, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
static int tda19988_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int tda19988_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||||
static int tda19988_unlink(FAR struct inode *inode);
|
static int tda19988_unlink(FAR struct inode *inode);
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,11 +39,11 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer,
|
static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer,
|
static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static int devnull_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int devnull_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
|
@ -39,11 +39,11 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static ssize_t devzero_read(FAR struct file *filep, FAR char *buffer,
|
static ssize_t devzero_read(FAR struct file *filep, FAR char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static ssize_t devzero_write(FAR struct file *filep, FAR const char *buffer,
|
static ssize_t devzero_write(FAR struct file *filep, FAR const char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static int devzero_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int devzero_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
|
@ -159,13 +159,13 @@ static void telnet_sendopt(FAR struct telnet_dev_s *priv, uint8_t option,
|
|||||||
static int telnet_open(FAR struct file *filep);
|
static int telnet_open(FAR struct file *filep);
|
||||||
static int telnet_close(FAR struct file *filep);
|
static int telnet_close(FAR struct file *filep);
|
||||||
static ssize_t telnet_read(FAR struct file *filep, FAR char *buffer,
|
static ssize_t telnet_read(FAR struct file *filep, FAR char *buffer,
|
||||||
size_t len);
|
size_t len);
|
||||||
static ssize_t telnet_write(FAR struct file *filep, FAR const char *buffer,
|
static ssize_t telnet_write(FAR struct file *filep, FAR const char *buffer,
|
||||||
size_t len);
|
size_t len);
|
||||||
static int telnet_ioctl(FAR struct file *filep, int cmd,
|
static int telnet_ioctl(FAR struct file *filep, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
static int telnet_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int telnet_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
|
|
||||||
/* Telnet session creation */
|
/* Telnet session creation */
|
||||||
|
|
||||||
|
@ -246,11 +246,6 @@ static void tun_pollnotify(FAR struct tun_device_s *priv,
|
|||||||
nxsem_post(&priv->write_wait_sem);
|
nxsem_post(&priv->write_wait_sem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fds == NULL)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
poll_notify(&fds, 1, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1186,7 +1181,7 @@ static int tun_poll(FAR struct file *filep,
|
|||||||
eventset |= POLLIN;
|
eventset |= POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
tun_pollnotify(priv, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -741,7 +741,7 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
eventset |= POLLERR;
|
eventset |= POLLERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(dev->d_fds, CONFIG_DEV_PIPE_NPOLLWAITERS, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -103,15 +103,10 @@ static const struct file_operations g_batteryops =
|
|||||||
static int battery_charger_notify(FAR struct battery_charger_priv_s *priv,
|
static int battery_charger_notify(FAR struct battery_charger_priv_s *priv,
|
||||||
uint32_t mask)
|
uint32_t mask)
|
||||||
{
|
{
|
||||||
FAR struct pollfd *fd = priv->fds;
|
FAR struct pollfd *fds = priv->fds;
|
||||||
int semcnt;
|
int semcnt;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!fd)
|
|
||||||
{
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = nxmutex_lock(&priv->lock);
|
ret = nxmutex_lock(&priv->lock);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@ -121,7 +116,7 @@ static int battery_charger_notify(FAR struct battery_charger_priv_s *priv,
|
|||||||
priv->mask |= mask;
|
priv->mask |= mask;
|
||||||
if (priv->mask)
|
if (priv->mask)
|
||||||
{
|
{
|
||||||
poll_notify(&fd, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
|
|
||||||
nxsem_get_value(&priv->wait, &semcnt);
|
nxsem_get_value(&priv->wait, &semcnt);
|
||||||
if (semcnt < 1)
|
if (semcnt < 1)
|
||||||
@ -433,6 +428,10 @@ static int bat_charger_poll(FAR struct file *filep,
|
|||||||
{
|
{
|
||||||
priv->fds = fds;
|
priv->fds = fds;
|
||||||
fds->priv = &priv->fds;
|
fds->priv = &priv->fds;
|
||||||
|
if (priv->mask)
|
||||||
|
{
|
||||||
|
poll_notify(&fds, 1, POLLIN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -446,12 +445,6 @@ static int bat_charger_poll(FAR struct file *filep,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&priv->lock);
|
nxmutex_unlock(&priv->lock);
|
||||||
|
|
||||||
if (setup)
|
|
||||||
{
|
|
||||||
battery_charger_notify(priv, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ static ssize_t bat_gauge_write(FAR struct file *filep,
|
|||||||
static int bat_gauge_ioctl(FAR struct file *filep, int cmd,
|
static int bat_gauge_ioctl(FAR struct file *filep, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
static int bat_gauge_poll(FAR struct file *filep,
|
static int bat_gauge_poll(FAR struct file *filep,
|
||||||
FAR struct pollfd *fds, bool setup);
|
FAR struct pollfd *fds, bool setup);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
@ -105,15 +105,10 @@ static const struct file_operations g_batteryops =
|
|||||||
static int battery_gauge_notify(FAR struct battery_gauge_priv_s *priv,
|
static int battery_gauge_notify(FAR struct battery_gauge_priv_s *priv,
|
||||||
uint32_t mask)
|
uint32_t mask)
|
||||||
{
|
{
|
||||||
FAR struct pollfd *fd = priv->fds;
|
FAR struct pollfd *fds = priv->fds;
|
||||||
int semcnt;
|
int semcnt;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!fd)
|
|
||||||
{
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = nxmutex_lock(&priv->lock);
|
ret = nxmutex_lock(&priv->lock);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@ -123,7 +118,7 @@ static int battery_gauge_notify(FAR struct battery_gauge_priv_s *priv,
|
|||||||
priv->mask |= mask;
|
priv->mask |= mask;
|
||||||
if (priv->mask)
|
if (priv->mask)
|
||||||
{
|
{
|
||||||
poll_notify(&fd, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
|
|
||||||
nxsem_get_value(&priv->wait, &semcnt);
|
nxsem_get_value(&priv->wait, &semcnt);
|
||||||
if (semcnt < 1)
|
if (semcnt < 1)
|
||||||
@ -391,6 +386,10 @@ static int bat_gauge_poll(FAR struct file *filep,
|
|||||||
{
|
{
|
||||||
priv->fds = fds;
|
priv->fds = fds;
|
||||||
fds->priv = &priv->fds;
|
fds->priv = &priv->fds;
|
||||||
|
if (priv->mask)
|
||||||
|
{
|
||||||
|
poll_notify(&fds, 1, POLLIN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -404,12 +403,6 @@ static int bat_gauge_poll(FAR struct file *filep,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&priv->lock);
|
nxmutex_unlock(&priv->lock);
|
||||||
|
|
||||||
if (setup)
|
|
||||||
{
|
|
||||||
battery_gauge_notify(priv, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,15 +104,10 @@ static const struct file_operations g_batteryops =
|
|||||||
static int battery_monitor_notify(FAR struct battery_monitor_priv_s *priv,
|
static int battery_monitor_notify(FAR struct battery_monitor_priv_s *priv,
|
||||||
uint32_t mask)
|
uint32_t mask)
|
||||||
{
|
{
|
||||||
FAR struct pollfd *fd = priv->fds;
|
FAR struct pollfd *fds = priv->fds;
|
||||||
int semcnt;
|
int semcnt;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!fd)
|
|
||||||
{
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = nxmutex_lock(&priv->lock);
|
ret = nxmutex_lock(&priv->lock);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@ -122,7 +117,7 @@ static int battery_monitor_notify(FAR struct battery_monitor_priv_s *priv,
|
|||||||
priv->mask |= mask;
|
priv->mask |= mask;
|
||||||
if (priv->mask)
|
if (priv->mask)
|
||||||
{
|
{
|
||||||
poll_notify(&fd, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
|
|
||||||
nxsem_get_value(&priv->wait, &semcnt);
|
nxsem_get_value(&priv->wait, &semcnt);
|
||||||
if (semcnt < 1)
|
if (semcnt < 1)
|
||||||
@ -470,6 +465,10 @@ static int bat_monitor_poll(FAR struct file *filep,
|
|||||||
{
|
{
|
||||||
priv->fds = fds;
|
priv->fds = fds;
|
||||||
fds->priv = &priv->fds;
|
fds->priv = &priv->fds;
|
||||||
|
if (priv->mask)
|
||||||
|
{
|
||||||
|
poll_notify(&fds, 1, POLLIN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -483,12 +482,6 @@ static int bat_monitor_poll(FAR struct file *filep,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&priv->lock);
|
nxmutex_unlock(&priv->lock);
|
||||||
|
|
||||||
if (setup)
|
|
||||||
{
|
|
||||||
battery_monitor_notify(priv, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ struct lirc_fh_s
|
|||||||
struct list_node node; /* list of open file handles */
|
struct list_node node; /* list of open file handles */
|
||||||
FAR struct lirc_lowerhalf_s *lower; /* the pointer to lirc_lowerhalf_s */
|
FAR struct lirc_lowerhalf_s *lower; /* the pointer to lirc_lowerhalf_s */
|
||||||
struct circbuf_s buffer; /* buffer for incoming IR */
|
struct circbuf_s buffer; /* buffer for incoming IR */
|
||||||
FAR struct pollfd *fd; /* poll structures of threads waiting for driver events */
|
FAR struct pollfd *fds; /* poll structures of threads waiting for driver events */
|
||||||
sem_t waitsem; /* sem of wait buffer for ready */
|
sem_t waitsem; /* sem of wait buffer for ready */
|
||||||
int carrier_low; /* when setting the carrier range, first the low end must be
|
int carrier_low; /* when setting the carrier range, first the low end must be
|
||||||
* set with an ioctl and then the high end with another ioctl
|
* set with an ioctl and then the high end with another ioctl
|
||||||
@ -85,7 +85,7 @@ static int lirc_open(FAR struct file *filep);
|
|||||||
static int lirc_close(FAR struct file *filep);
|
static int lirc_close(FAR struct file *filep);
|
||||||
static int lirc_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
static int lirc_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||||
static int lirc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int lirc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
static ssize_t lirc_write(FAR struct file *filep, FAR const char *buffer,
|
static ssize_t lirc_write(FAR struct file *filep, FAR const char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static ssize_t lirc_read(FAR struct file *filep, FAR char *buffer,
|
static ssize_t lirc_read(FAR struct file *filep, FAR char *buffer,
|
||||||
@ -216,21 +216,21 @@ static int lirc_poll(FAR struct file *filep,
|
|||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
if (setup)
|
if (setup)
|
||||||
{
|
{
|
||||||
if (fh->fd)
|
if (fh->fds)
|
||||||
{
|
{
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
fh->fd = fds;
|
fh->fds = fds;
|
||||||
fds->priv = &fh->fd;
|
fds->priv = &fh->fds;
|
||||||
|
|
||||||
if (!circbuf_is_empty(&fh->buffer))
|
if (!circbuf_is_empty(&fh->buffer))
|
||||||
{
|
{
|
||||||
eventset |= POLLIN | POLLRDNORM;
|
eventset |= POLLIN | POLLRDNORM;
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(&fh->fd, 1, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
{
|
{
|
||||||
@ -914,7 +914,7 @@ void lirc_raw_event(FAR struct lirc_lowerhalf_s *lower,
|
|||||||
fh = (FAR struct lirc_fh_s *)node;
|
fh = (FAR struct lirc_fh_s *)node;
|
||||||
if (circbuf_write(&fh->buffer, &gap, sizeof(int)) > 0)
|
if (circbuf_write(&fh->buffer, &gap, sizeof(int)) > 0)
|
||||||
{
|
{
|
||||||
poll_notify(&fh->fd, 1, POLLIN | POLLRDNORM);
|
poll_notify(&fh->fds, 1, POLLIN | POLLRDNORM);
|
||||||
nxsem_get_value(&fh->waitsem, &semcount);
|
nxsem_get_value(&fh->waitsem, &semcount);
|
||||||
if (semcount < 1)
|
if (semcount < 1)
|
||||||
{
|
{
|
||||||
@ -944,7 +944,7 @@ void lirc_raw_event(FAR struct lirc_lowerhalf_s *lower,
|
|||||||
|
|
||||||
if (circbuf_write(&fh->buffer, &sample, sizeof(unsigned int)) > 0)
|
if (circbuf_write(&fh->buffer, &sample, sizeof(unsigned int)) > 0)
|
||||||
{
|
{
|
||||||
poll_notify(&fh->fd, 1, POLLIN | POLLRDNORM);
|
poll_notify(&fh->fds, 1, POLLIN | POLLRDNORM);
|
||||||
nxsem_get_value(&fh->waitsem, &semcount);
|
nxsem_get_value(&fh->waitsem, &semcount);
|
||||||
if (semcount < 1)
|
if (semcount < 1)
|
||||||
{
|
{
|
||||||
@ -988,7 +988,7 @@ void lirc_scancode_event(FAR struct lirc_lowerhalf_s *lower,
|
|||||||
fh = (FAR struct lirc_fh_s *)node;
|
fh = (FAR struct lirc_fh_s *)node;
|
||||||
if (circbuf_write(&fh->buffer, lsc, sizeof(*lsc)) > 0)
|
if (circbuf_write(&fh->buffer, lsc, sizeof(*lsc)) > 0)
|
||||||
{
|
{
|
||||||
poll_notify(&fh->fd, 1, POLLIN | POLLRDNORM);
|
poll_notify(&fh->fds, 1, POLLIN | POLLRDNORM);
|
||||||
nxsem_get_value(&fh->waitsem, &semcount);
|
nxsem_get_value(&fh->waitsem, &semcount);
|
||||||
if (semcount < 1)
|
if (semcount < 1)
|
||||||
{
|
{
|
||||||
@ -1034,7 +1034,7 @@ void lirc_sample_event(FAR struct lirc_lowerhalf_s *lower,
|
|||||||
fh = (FAR struct lirc_fh_s *)node;
|
fh = (FAR struct lirc_fh_s *)node;
|
||||||
if (circbuf_write(&fh->buffer, &sample, sizeof(unsigned int)) > 0)
|
if (circbuf_write(&fh->buffer, &sample, sizeof(unsigned int)) > 0)
|
||||||
{
|
{
|
||||||
poll_notify(&fh->fd, 1, POLLIN | POLLRDNORM);
|
poll_notify(&fh->fds, 1, POLLIN | POLLRDNORM);
|
||||||
nxsem_get_value(&fh->waitsem, &semcount);
|
nxsem_get_value(&fh->waitsem, &semcount);
|
||||||
if (semcount < 1)
|
if (semcount < 1)
|
||||||
{
|
{
|
||||||
|
@ -386,7 +386,7 @@ static int gps_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
fds->priv = filep;
|
fds->priv = filep;
|
||||||
if (upper->buffer.head > user->pos)
|
if (upper->buffer.head > user->pos)
|
||||||
{
|
{
|
||||||
poll_notify(&user->fds, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (user->fds)
|
else if (user->fds)
|
||||||
|
@ -332,7 +332,7 @@ static int hcsr04_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
if (hcsr04_sample(priv))
|
if (hcsr04_sample(priv))
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_HCSR04_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
@ -1115,7 +1115,7 @@ static int hts221_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
if (priv->int_pending || hts221_sample(priv))
|
if (priv->int_pending || hts221_sample(priv))
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_HTS221_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
@ -108,38 +108,40 @@ static int lis2dh_open(FAR struct file *filep);
|
|||||||
static int lis2dh_close(FAR struct file *filep);
|
static int lis2dh_close(FAR struct file *filep);
|
||||||
static ssize_t lis2dh_read(FAR struct file *, FAR char *, size_t);
|
static ssize_t lis2dh_read(FAR struct file *, FAR char *, size_t);
|
||||||
static ssize_t lis2dh_write(FAR struct file *filep,
|
static ssize_t lis2dh_write(FAR struct file *filep,
|
||||||
FAR const char *buffer, size_t buflen);
|
FAR const char *buffer, size_t buflen);
|
||||||
static int lis2dh_ioctl(FAR struct file *filep, int cmd,
|
static int lis2dh_ioctl(FAR struct file *filep, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
static int lis2dh_access(FAR struct lis2dh_dev_s *dev,
|
static int lis2dh_access(FAR struct lis2dh_dev_s *dev,
|
||||||
uint8_t subaddr, FAR uint8_t *buf, int length);
|
uint8_t subaddr, FAR uint8_t *buf,
|
||||||
|
int length);
|
||||||
static int lis2dh_get_reading(FAR struct lis2dh_dev_s *dev,
|
static int lis2dh_get_reading(FAR struct lis2dh_dev_s *dev,
|
||||||
FAR struct lis2dh_vector_s *res, bool force_read);
|
FAR struct lis2dh_vector_s *res,
|
||||||
|
bool force_read);
|
||||||
static int lis2dh_powerdown(FAR struct lis2dh_dev_s *dev);
|
static int lis2dh_powerdown(FAR struct lis2dh_dev_s *dev);
|
||||||
static int lis2dh_reboot(FAR struct lis2dh_dev_s *dev);
|
static int lis2dh_reboot(FAR struct lis2dh_dev_s *dev);
|
||||||
static int lis2dh_poll(FAR struct file *filep,
|
static int lis2dh_poll(FAR struct file *filep,
|
||||||
FAR struct pollfd *fds, bool setup);
|
FAR struct pollfd *fds, bool setup);
|
||||||
static int lis2dh_int_handler(int irq, FAR void *context,
|
static int lis2dh_int_handler(int irq, FAR void *context,
|
||||||
FAR void *arg);
|
FAR void *arg);
|
||||||
static int lis2dh_setup(FAR struct lis2dh_dev_s *dev,
|
static int lis2dh_setup(FAR struct lis2dh_dev_s *dev,
|
||||||
FAR struct lis2dh_setup *new_setup);
|
FAR struct lis2dh_setup *new_setup);
|
||||||
static inline int16_t lis2dh_raw_to_mg(uint8_t raw_hibyte,
|
static inline int16_t lis2dh_raw_to_mg(uint8_t raw_hibyte,
|
||||||
uint8_t raw_lobyte, int scale);
|
uint8_t raw_lobyte, int scale);
|
||||||
static int lis2dh_read_temp(FAR struct lis2dh_dev_s *dev,
|
static int lis2dh_read_temp(FAR struct lis2dh_dev_s *dev,
|
||||||
FAR int16_t *temper);
|
FAR int16_t *temper);
|
||||||
static int lis2dh_clear_interrupts(FAR struct lis2dh_dev_s *priv,
|
static int lis2dh_clear_interrupts(FAR struct lis2dh_dev_s *priv,
|
||||||
uint8_t interrupts);
|
uint8_t interrupts);
|
||||||
static unsigned int lis2dh_get_fifo_readings(FAR struct lis2dh_dev_s *priv,
|
static unsigned int lis2dh_get_fifo_readings(FAR struct lis2dh_dev_s *priv,
|
||||||
FAR struct lis2dh_result *res,
|
FAR struct lis2dh_result *res,
|
||||||
unsigned int readcount,
|
unsigned int readcount,
|
||||||
FAR int *perr);
|
FAR int *perr);
|
||||||
#ifdef CONFIG_LIS2DH_DRIVER_SELFTEST
|
#ifdef CONFIG_LIS2DH_DRIVER_SELFTEST
|
||||||
static int lis2dh_handle_selftest(FAR struct lis2dh_dev_s *priv);
|
static int lis2dh_handle_selftest(FAR struct lis2dh_dev_s *priv);
|
||||||
static int16_t lis2dh_raw_convert_to_12bit(uint8_t raw_hibyte,
|
static int16_t lis2dh_raw_convert_to_12bit(uint8_t raw_hibyte,
|
||||||
uint8_t raw_lobyte);
|
uint8_t raw_lobyte);
|
||||||
static FAR const struct lis2dh_vector_s *
|
static FAR const struct lis2dh_vector_s *
|
||||||
lis2dh_get_raw_readings(FAR struct lis2dh_dev_s *dev,
|
lis2dh_get_raw_readings(FAR struct lis2dh_dev_s *dev,
|
||||||
FAR int *err);
|
FAR int *err);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -713,7 +715,7 @@ static int lis2dh_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->int_pending)
|
if (priv->int_pending)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_LIS2DH_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
|
@ -828,7 +828,8 @@ static int max44009_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->int_pending)
|
if (priv->int_pending)
|
||||||
{
|
{
|
||||||
max44009_notify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
|
priv->int_pending = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
|
@ -936,7 +936,7 @@ static int sensor_poll(FAR struct file *filep,
|
|||||||
eventset |= POLLPRI;
|
eventset |= POLLPRI;
|
||||||
}
|
}
|
||||||
|
|
||||||
sensor_pollnotify_one(user, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1617,8 +1617,8 @@ static int uart_poll(FAR struct file *filep,
|
|||||||
{
|
{
|
||||||
/* Bind the poll structure and this slot */
|
/* Bind the poll structure and this slot */
|
||||||
|
|
||||||
dev->fds[i] = fds;
|
dev->fds[i] = fds;
|
||||||
fds->priv = &dev->fds[i];
|
fds->priv = &dev->fds[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1678,7 +1678,7 @@ static int uart_poll(FAR struct file *filep,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
poll_notify(dev->fds, CONFIG_SERIAL_NPOLLWAITERS, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
{
|
{
|
||||||
|
@ -369,8 +369,8 @@ static int uart_bth4_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
{
|
{
|
||||||
/* Bind the poll structure and this slot */
|
/* Bind the poll structure and this slot */
|
||||||
|
|
||||||
dev->fds[i] = fds;
|
dev->fds[i] = fds;
|
||||||
fds->priv = &dev->fds[i];
|
fds->priv = &dev->fds[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -388,7 +388,7 @@ static int uart_bth4_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
eventset |= POLLOUT;
|
eventset |= POLLOUT;
|
||||||
|
|
||||||
uart_bth4_pollnotify(dev, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1209,7 +1209,7 @@ uart_bth5_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
|
|||||||
nxmutex_unlock(&dev->recvlock);
|
nxmutex_unlock(&dev->recvlock);
|
||||||
eventset |= POLLOUT;
|
eventset |= POLLOUT;
|
||||||
|
|
||||||
uart_bth5_pollnotify(dev, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
{
|
{
|
||||||
|
@ -490,7 +490,7 @@ static int spi_slave_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
eventset |= POLLOUT;
|
eventset |= POLLOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(&priv->fds, 1, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
{
|
{
|
||||||
|
@ -204,16 +204,12 @@ static void ramlog_pollnotify(FAR struct ramlog_dev_s *priv,
|
|||||||
pollevent_t eventset)
|
pollevent_t eventset)
|
||||||
{
|
{
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
int i;
|
|
||||||
|
|
||||||
/* This function may be called from an interrupt handler */
|
/* This function may be called from an interrupt handler */
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_RAMLOG_NPOLLWAITERS; i++)
|
flags = enter_critical_section();
|
||||||
{
|
poll_notify(priv->rl_fds, CONFIG_RAMLOG_NPOLLWAITERS, eventset);
|
||||||
flags = enter_critical_section();
|
leave_critical_section(flags);
|
||||||
poll_notify(&priv->rl_fds[i], 1, eventset);
|
|
||||||
leave_critical_section(flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -709,8 +705,8 @@ static int ramlog_file_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_RAMLOG_NPOLLWAITERS)
|
if (i >= CONFIG_RAMLOG_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -741,7 +737,7 @@ static int ramlog_file_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
|
||||||
ramlog_pollnotify(priv, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
{
|
{
|
||||||
|
@ -856,7 +856,7 @@ static int usbdev_fs_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(fs_ep->fds, CONFIG_USBDEV_FS_NPOLLWAITERS, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
|
|
||||||
exit_leave_critical:
|
exit_leave_critical:
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
@ -572,8 +572,8 @@ static int cdcwdm_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_USBHOST_CDCMBIM_NPOLLWAITERS)
|
if (i >= CONFIG_USBHOST_CDCMBIM_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,8 +583,7 @@ static int cdcwdm_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->comm_rxlen > 0)
|
if (priv->comm_rxlen > 0)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_USBHOST_CDCMBIM_NPOLLWAITERS,
|
poll_notify(&fds, 1, POLLIN);
|
||||||
POLLIN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -263,21 +263,22 @@ static inline void usbhost_freeclass(FAR struct usbhost_state_s *usbclass);
|
|||||||
static int usbhost_allocdevno(FAR struct usbhost_state_s *priv);
|
static int usbhost_allocdevno(FAR struct usbhost_state_s *priv);
|
||||||
static void usbhost_freedevno(FAR struct usbhost_state_s *priv);
|
static void usbhost_freedevno(FAR struct usbhost_state_s *priv);
|
||||||
static inline void usbhost_mkdevname(FAR struct usbhost_state_s *priv,
|
static inline void usbhost_mkdevname(FAR struct usbhost_state_s *priv,
|
||||||
FAR char *devname);
|
FAR char *devname);
|
||||||
|
|
||||||
/* Keyboard polling thread */
|
/* Keyboard polling thread */
|
||||||
|
|
||||||
static void usbhost_destroy(FAR void *arg);
|
static void usbhost_destroy(FAR void *arg);
|
||||||
static void usbhost_putbuffer(FAR struct usbhost_state_s *priv,
|
static void usbhost_putbuffer(FAR struct usbhost_state_s *priv,
|
||||||
uint8_t keycode);
|
uint8_t keycode);
|
||||||
#ifdef CONFIG_HIDKBD_ENCODED
|
#ifdef CONFIG_HIDKBD_ENCODED
|
||||||
static void usbhost_putstream(FAR struct lib_outstream_s *self, int ch);
|
static void usbhost_putstream(FAR struct lib_outstream_s *self, int ch);
|
||||||
#endif
|
#endif
|
||||||
static inline uint8_t usbhost_mapscancode(uint8_t scancode,
|
static inline uint8_t usbhost_mapscancode(uint8_t scancode,
|
||||||
uint8_t modifier);
|
uint8_t modifier);
|
||||||
#ifdef CONFIG_HIDKBD_ENCODED
|
#ifdef CONFIG_HIDKBD_ENCODED
|
||||||
static inline void usbhost_encodescancode(FAR struct usbhost_state_s *priv,
|
static inline void usbhost_encodescancode(FAR struct usbhost_state_s *priv,
|
||||||
uint8_t scancode, uint8_t modifier);
|
uint8_t scancode,
|
||||||
|
uint8_t modifier);
|
||||||
#endif
|
#endif
|
||||||
static int usbhost_kbdpoll(int argc, char *argv[]);
|
static int usbhost_kbdpoll(int argc, char *argv[]);
|
||||||
|
|
||||||
@ -298,7 +299,8 @@ static inline void usbhost_toggle_capslock(void);
|
|||||||
/* Helpers for usbhost_connect() */
|
/* Helpers for usbhost_connect() */
|
||||||
|
|
||||||
static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
||||||
FAR const uint8_t *configdesc, int desclen);
|
FAR const uint8_t *configdesc,
|
||||||
|
int desclen);
|
||||||
static inline int usbhost_devinit(FAR struct usbhost_state_s *priv);
|
static inline int usbhost_devinit(FAR struct usbhost_state_s *priv);
|
||||||
|
|
||||||
/* (Little Endian) Data helpers */
|
/* (Little Endian) Data helpers */
|
||||||
@ -318,9 +320,9 @@ static int usbhost_crfree(FAR struct usbhost_state_s *priv);
|
|||||||
|
|
||||||
/* struct usbhost_registry_s methods */
|
/* struct usbhost_registry_s methods */
|
||||||
|
|
||||||
static FAR struct usbhost_class_s *usbhost_create(
|
static FAR struct usbhost_class_s *
|
||||||
FAR struct usbhost_hubport_s *hport,
|
usbhost_create(FAR struct usbhost_hubport_s *hport,
|
||||||
FAR const struct usbhost_id_s *id);
|
FAR const struct usbhost_id_s *id);
|
||||||
|
|
||||||
/* struct usbhost_class_s methods */
|
/* struct usbhost_class_s methods */
|
||||||
|
|
||||||
@ -333,11 +335,11 @@ static int usbhost_disconnected(FAR struct usbhost_class_s *usbclass);
|
|||||||
static int usbhost_open(FAR struct file *filep);
|
static int usbhost_open(FAR struct file *filep);
|
||||||
static int usbhost_close(FAR struct file *filep);
|
static int usbhost_close(FAR struct file *filep);
|
||||||
static ssize_t usbhost_read(FAR struct file *filep,
|
static ssize_t usbhost_read(FAR struct file *filep,
|
||||||
FAR char *buffer, size_t len);
|
FAR char *buffer, size_t len);
|
||||||
static ssize_t usbhost_write(FAR struct file *filep,
|
static ssize_t usbhost_write(FAR struct file *filep,
|
||||||
FAR const char *buffer, size_t len);
|
FAR const char *buffer, size_t len);
|
||||||
static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
@ -2832,8 +2834,8 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_HIDKBD_NPOLLWAITERS)
|
if (i >= CONFIG_HIDKBD_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2843,7 +2845,7 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->headndx != priv->tailndx)
|
if (priv->headndx != priv->tailndx)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_HIDKBD_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2855,8 +2857,8 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Remove all memory of the poll setup */
|
/* Remove all memory of the poll setup */
|
||||||
|
|
||||||
*slot = NULL;
|
*slot = NULL;
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -2378,8 +2378,8 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_HIDMOUSE_NPOLLWAITERS)
|
if (i >= CONFIG_HIDMOUSE_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2389,7 +2389,7 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->valid)
|
if (priv->valid)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_HIDMOUSE_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2139,8 +2139,8 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (i >= CONFIG_XBOXCONTROLLER_NPOLLWAITERS)
|
if (i >= CONFIG_XBOXCONTROLLER_NPOLLWAITERS)
|
||||||
{
|
{
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2150,7 +2150,7 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (priv->valid)
|
if (priv->valid)
|
||||||
{
|
{
|
||||||
usbhost_pollnotify(priv);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -705,7 +705,7 @@ static int fusb301_poll(FAR struct file *filep,
|
|||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
if (priv->int_pending)
|
if (priv->int_pending)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_FUSB301_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
@ -456,6 +456,7 @@ void enableccmeas(FAR struct fusb302_dev_s *priv,
|
|||||||
void set_switches(FAR struct fusb302_dev_s *priv,
|
void set_switches(FAR struct fusb302_dev_s *priv,
|
||||||
uint8_t toggsval);
|
uint8_t toggsval);
|
||||||
static int set_int_mask(struct fusb302_dev_s *priv);
|
static int set_int_mask(struct fusb302_dev_s *priv);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -893,7 +893,7 @@ static int fusb303_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
if (priv->int_pending)
|
if (priv->int_pending)
|
||||||
{
|
{
|
||||||
poll_notify(priv->fds, CONFIG_FUSB303_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
@ -77,17 +77,12 @@ struct usrsockdev_s
|
|||||||
|
|
||||||
static ssize_t usrsockdev_read(FAR struct file *filep, FAR char *buffer,
|
static ssize_t usrsockdev_read(FAR struct file *filep, FAR char *buffer,
|
||||||
size_t len);
|
size_t len);
|
||||||
|
|
||||||
static ssize_t usrsockdev_write(FAR struct file *filep,
|
static ssize_t usrsockdev_write(FAR struct file *filep,
|
||||||
FAR const char *buffer, size_t len);
|
FAR const char *buffer, size_t len);
|
||||||
|
|
||||||
static off_t usrsockdev_seek(FAR struct file *filep, off_t offset,
|
static off_t usrsockdev_seek(FAR struct file *filep, off_t offset,
|
||||||
int whence);
|
int whence);
|
||||||
|
|
||||||
static int usrsockdev_open(FAR struct file *filep);
|
static int usrsockdev_open(FAR struct file *filep);
|
||||||
|
|
||||||
static int usrsockdev_close(FAR struct file *filep);
|
static int usrsockdev_close(FAR struct file *filep);
|
||||||
|
|
||||||
static int usrsockdev_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int usrsockdev_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
|
|
||||||
@ -395,7 +390,6 @@ static int usrsockdev_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
{
|
{
|
||||||
FAR struct inode *inode = filep->f_inode;
|
FAR struct inode *inode = filep->f_inode;
|
||||||
FAR struct usrsockdev_s *dev;
|
FAR struct usrsockdev_s *dev;
|
||||||
pollevent_t eventset;
|
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -447,18 +441,14 @@ static int usrsockdev_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
/* Should immediately notify on any of the requested events? */
|
/* Should immediately notify on any of the requested events? */
|
||||||
|
|
||||||
eventset = 0;
|
|
||||||
|
|
||||||
/* Notify the POLLIN event if pending request. */
|
/* Notify the POLLIN event if pending request. */
|
||||||
|
|
||||||
if (dev->req.iov != NULL &&
|
if (dev->req.iov != NULL &&
|
||||||
!(usrsock_iovec_get(NULL, 0, dev->req.iov,
|
!(usrsock_iovec_get(NULL, 0, dev->req.iov,
|
||||||
dev->req.iovcnt, dev->req.pos, NULL) < 0))
|
dev->req.iovcnt, dev->req.pos, NULL) < 0))
|
||||||
{
|
{
|
||||||
eventset |= POLLIN;
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(dev->pollfds, nitems(dev->pollfds), eventset);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1068,7 +1068,7 @@ static int fb_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
panbuf = fb_get_panbuf(fb, priv->overlay);
|
panbuf = fb_get_panbuf(fb, priv->overlay);
|
||||||
if (!circbuf_is_full(panbuf))
|
if (!circbuf_is_full(panbuf))
|
||||||
{
|
{
|
||||||
poll_notify(pollfds, 1, POLLOUT);
|
poll_notify(&fds, 1, POLLOUT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
@ -1177,19 +1177,12 @@ static void fb_do_pollnotify(wdparm_t arg)
|
|||||||
{
|
{
|
||||||
FAR struct fb_paninfo_s *paninfo = (FAR struct fb_paninfo_s *)arg;
|
FAR struct fb_paninfo_s *paninfo = (FAR struct fb_paninfo_s *)arg;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
int i;
|
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_VIDEO_FB_NPOLLWAITERS; i++)
|
/* Notify framebuffer is writable. */
|
||||||
{
|
|
||||||
if (paninfo->fds[i] != NULL)
|
|
||||||
{
|
|
||||||
/* Notify framebuffer is writable. */
|
|
||||||
|
|
||||||
poll_notify(&paninfo->fds[i], 1, POLLOUT);
|
poll_notify(paninfo->fds, CONFIG_VIDEO_FB_NPOLLWAITERS, POLLOUT);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
}
|
}
|
||||||
|
@ -3280,7 +3280,7 @@ static int video_poll(FAR struct file *filep, struct pollfd *fds, bool setup)
|
|||||||
fds->priv = &type_inf->fds;
|
fds->priv = &type_inf->fds;
|
||||||
if (!video_framebuff_is_empty(&type_inf->bufinf))
|
if (!video_framebuff_is_empty(&type_inf->bufinf))
|
||||||
{
|
{
|
||||||
poll_notify(&type_inf->fds, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -623,7 +623,7 @@ static int cc1101_file_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
nxmutex_lock(&dev->lock_rx_buffer);
|
nxmutex_lock(&dev->lock_rx_buffer);
|
||||||
if (dev->fifo_len > 0)
|
if (dev->fifo_len > 0)
|
||||||
{
|
{
|
||||||
poll_notify(&dev->pfd, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&dev->lock_rx_buffer);
|
nxmutex_unlock(&dev->lock_rx_buffer);
|
||||||
|
@ -3143,7 +3143,7 @@ static int gs2200m_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
|
|
||||||
if (0 < n)
|
if (0 < n)
|
||||||
{
|
{
|
||||||
poll_notify(&dev->pfd, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1220,7 +1220,7 @@ static int sx127x_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
{
|
{
|
||||||
/* Data available for input */
|
/* Data available for input */
|
||||||
|
|
||||||
poll_notify(&dev->pfd, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&dev->rx_buffer_lock);
|
nxmutex_unlock(&dev->rx_buffer_lock);
|
||||||
|
@ -1403,7 +1403,7 @@ static int nrf24l01_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
nxmutex_lock(&dev->lock_fifo);
|
nxmutex_lock(&dev->lock_fifo);
|
||||||
if (dev->fifo_len > 0)
|
if (dev->fifo_len > 0)
|
||||||
{
|
{
|
||||||
poll_notify(&dev->pfd, 1, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&dev->lock_fifo);
|
nxmutex_unlock(&dev->lock_fifo);
|
||||||
|
@ -134,7 +134,7 @@ static int nxmq_file_poll(FAR struct file *filep,
|
|||||||
eventset |= POLLIN;
|
eventset |= POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
nxmq_pollnotify(msgq, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ static ssize_t eventfd_do_write(FAR struct file *filep,
|
|||||||
FAR const char *buffer, size_t len);
|
FAR const char *buffer, size_t len);
|
||||||
#ifdef CONFIG_EVENT_FD_POLL
|
#ifdef CONFIG_EVENT_FD_POLL
|
||||||
static int eventfd_do_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
static int eventfd_do_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int eventfd_blocking_io(FAR struct eventfd_priv_s *dev,
|
static int eventfd_blocking_io(FAR struct eventfd_priv_s *dev,
|
||||||
@ -489,7 +489,7 @@ static int eventfd_do_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
eventset |= POLLIN;
|
eventset |= POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
poll_notify(dev->fds, CONFIG_EVENT_FD_NPOLLWAITERS, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
nxmutex_unlock(&dev->lock);
|
nxmutex_unlock(&dev->lock);
|
||||||
|
@ -271,7 +271,7 @@ static int signalfd_file_poll(FAR struct file *filep,
|
|||||||
sigandset(&mask, &mask, &dev->sigmask);
|
sigandset(&mask, &mask, &dev->sigmask);
|
||||||
if (!sigisemptyset(&mask))
|
if (!sigisemptyset(&mask))
|
||||||
{
|
{
|
||||||
poll_notify(dev->fds, CONFIG_SIGNAL_FD_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@ -370,7 +370,7 @@ static int timerfd_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||||||
if (dev->counter > 0)
|
if (dev->counter > 0)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TIMER_FD_POLL
|
#ifdef CONFIG_TIMER_FD_POLL
|
||||||
poll_notify(dev->fds, CONFIG_TIMER_FD_NPOLLWAITERS, POLLIN);
|
poll_notify(&fds, 1, POLLIN);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,10 +175,11 @@ extern const struct file_operations g_nxterm_drvrops;
|
|||||||
|
|
||||||
/* Common device registration/un-registration */
|
/* Common device registration/un-registration */
|
||||||
|
|
||||||
FAR struct nxterm_state_s *nxterm_register(NXTERM handle,
|
FAR struct nxterm_state_s *
|
||||||
FAR struct nxterm_window_s *wndo,
|
nxterm_register(NXTERM handle,
|
||||||
FAR const struct nxterm_operations_s *ops,
|
FAR struct nxterm_window_s *wndo,
|
||||||
int minor);
|
FAR const struct nxterm_operations_s *ops,
|
||||||
|
int minor);
|
||||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||||
void nxterm_unregister(FAR struct nxterm_state_s *priv);
|
void nxterm_unregister(FAR struct nxterm_state_s *priv);
|
||||||
#endif
|
#endif
|
||||||
@ -213,7 +214,7 @@ FAR const
|
|||||||
struct nxterm_bitmap_s *nxterm_addchar(FAR struct nxterm_state_s *priv,
|
struct nxterm_bitmap_s *nxterm_addchar(FAR struct nxterm_state_s *priv,
|
||||||
uint8_t ch);
|
uint8_t ch);
|
||||||
int nxterm_hidechar(FAR struct nxterm_state_s *priv,
|
int nxterm_hidechar(FAR struct nxterm_state_s *priv,
|
||||||
FAR const struct nxterm_bitmap_s *bm);
|
FAR const struct nxterm_bitmap_s *bm);
|
||||||
int nxterm_backspace(FAR struct nxterm_state_s *priv);
|
int nxterm_backspace(FAR struct nxterm_state_s *priv);
|
||||||
void nxterm_fillchar(FAR struct nxterm_state_s *priv,
|
void nxterm_fillchar(FAR struct nxterm_state_s *priv,
|
||||||
FAR const struct nxgl_rect_s *rect,
|
FAR const struct nxgl_rect_s *rect,
|
||||||
|
@ -50,16 +50,12 @@ static void nxterm_pollnotify(FAR struct nxterm_state_s *priv,
|
|||||||
pollevent_t eventset)
|
pollevent_t eventset)
|
||||||
{
|
{
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
int i;
|
|
||||||
|
|
||||||
/* This function may be called from an interrupt handler */
|
/* This function may be called from an interrupt handler */
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NXTERM_NPOLLWAITERS; i++)
|
flags = enter_critical_section();
|
||||||
{
|
poll_notify(priv->fds, CONFIG_NXTERM_NPOLLWAITERS, eventset);
|
||||||
flags = enter_critical_section();
|
leave_critical_section(flags);
|
||||||
poll_notify(&priv->fds[i], 1, eventset);
|
|
||||||
leave_critical_section(flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -260,7 +256,7 @@ int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
|
|||||||
/* Bind the poll structure and this slot */
|
/* Bind the poll structure and this slot */
|
||||||
|
|
||||||
priv->fds[i] = fds;
|
priv->fds[i] = fds;
|
||||||
fds->priv = &priv->fds[i];
|
fds->priv = &priv->fds[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,8 +265,8 @@ int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
|
|||||||
{
|
{
|
||||||
gerr("ERROR: Too many poll waiters\n");
|
gerr("ERROR: Too many poll waiters\n");
|
||||||
|
|
||||||
fds->priv = NULL;
|
fds->priv = NULL;
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +283,7 @@ int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
|
|||||||
eventset |= POLLIN;
|
eventset |= POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
nxterm_pollnotify(priv, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else if (fds->priv)
|
else if (fds->priv)
|
||||||
{
|
{
|
||||||
|
@ -52,9 +52,9 @@ static int can_setup(FAR struct socket *psock);
|
|||||||
static sockcaps_t can_sockcaps(FAR struct socket *psock);
|
static sockcaps_t can_sockcaps(FAR struct socket *psock);
|
||||||
static void can_addref(FAR struct socket *psock);
|
static void can_addref(FAR struct socket *psock);
|
||||||
static int can_bind(FAR struct socket *psock,
|
static int can_bind(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr, socklen_t addrlen);
|
||||||
static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
|
static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
static int can_close(FAR struct socket *psock);
|
static int can_close(FAR struct socket *psock);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -394,9 +394,9 @@ static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
|
|||||||
* during callback processing.
|
* during callback processing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
cb->flags = NETDEV_DOWN;
|
cb->flags = NETDEV_DOWN;
|
||||||
cb->priv = (FAR void *)info;
|
cb->priv = info;
|
||||||
cb->event = can_poll_eventhandler;
|
cb->event = can_poll_eventhandler;
|
||||||
|
|
||||||
if ((fds->events & POLLOUT) != 0)
|
if ((fds->events & POLLOUT) != 0)
|
||||||
{
|
{
|
||||||
@ -412,7 +412,7 @@ static int can_poll_local(FAR struct socket *psock, FAR struct pollfd *fds,
|
|||||||
* for use during poll teardown as well.
|
* for use during poll teardown as well.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fds->priv = (FAR void *)info;
|
fds->priv = info;
|
||||||
|
|
||||||
/* Check for read data availability now */
|
/* Check for read data availability now */
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ int icmp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
cb->flags = NETDEV_DOWN;
|
cb->flags = NETDEV_DOWN;
|
||||||
cb->priv = (FAR void *)info;
|
cb->priv = info;
|
||||||
cb->event = icmp_poll_eventhandler;
|
cb->event = icmp_poll_eventhandler;
|
||||||
|
|
||||||
if ((fds->events & POLLIN) != 0)
|
if ((fds->events & POLLIN) != 0)
|
||||||
@ -202,7 +202,7 @@ int icmp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
* for use during poll teardown as well.
|
* for use during poll teardown as well.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fds->priv = (FAR void *)info;
|
fds->priv = info;
|
||||||
|
|
||||||
/* Check for read data availability now */
|
/* Check for read data availability now */
|
||||||
|
|
||||||
|
@ -50,13 +50,15 @@ static int icmp_setup(FAR struct socket *psock);
|
|||||||
static sockcaps_t icmp_sockcaps(FAR struct socket *psock);
|
static sockcaps_t icmp_sockcaps(FAR struct socket *psock);
|
||||||
static void icmp_addref(FAR struct socket *psock);
|
static void icmp_addref(FAR struct socket *psock);
|
||||||
static int icmp_netpoll(FAR struct socket *psock,
|
static int icmp_netpoll(FAR struct socket *psock,
|
||||||
FAR struct pollfd *fds, bool setup);
|
FAR struct pollfd *fds, bool setup);
|
||||||
static int icmp_close(FAR struct socket *psock);
|
static int icmp_close(FAR struct socket *psock);
|
||||||
#ifdef CONFIG_NET_SOCKOPTS
|
#ifdef CONFIG_NET_SOCKOPTS
|
||||||
static int icmp_getsockopt(FAR struct socket *psock, int level,
|
static int icmp_getsockopt(FAR struct socket *psock, int level,
|
||||||
int option, FAR void *value, FAR socklen_t *value_len);
|
int option, FAR void *value,
|
||||||
|
FAR socklen_t *value_len);
|
||||||
static int icmp_setsockopt(FAR struct socket *psock, int level,
|
static int icmp_setsockopt(FAR struct socket *psock, int level,
|
||||||
int option, FAR const void *value, socklen_t value_len);
|
int option, FAR const void *value,
|
||||||
|
socklen_t value_len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -189,7 +189,7 @@ int icmpv6_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
cb->flags = NETDEV_DOWN;
|
cb->flags = NETDEV_DOWN;
|
||||||
cb->priv = (FAR void *)info;
|
cb->priv = info;
|
||||||
cb->event = icmpv6_poll_eventhandler;
|
cb->event = icmpv6_poll_eventhandler;
|
||||||
|
|
||||||
if ((fds->events & POLLIN) != 0)
|
if ((fds->events & POLLIN) != 0)
|
||||||
@ -201,7 +201,7 @@ int icmpv6_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
* for use during poll teardown as well.
|
* for use during poll teardown as well.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fds->priv = (FAR void *)info;
|
fds->priv = info;
|
||||||
|
|
||||||
/* Check for read data availability now */
|
/* Check for read data availability now */
|
||||||
|
|
||||||
|
@ -66,42 +66,50 @@ static int inet_setup(FAR struct socket *psock);
|
|||||||
static sockcaps_t inet_sockcaps(FAR struct socket *psock);
|
static sockcaps_t inet_sockcaps(FAR struct socket *psock);
|
||||||
static void inet_addref(FAR struct socket *psock);
|
static void inet_addref(FAR struct socket *psock);
|
||||||
static int inet_bind(FAR struct socket *psock,
|
static int inet_bind(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr,
|
||||||
|
socklen_t addrlen);
|
||||||
static int inet_getsockname(FAR struct socket *psock,
|
static int inet_getsockname(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen);
|
FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen);
|
||||||
static int inet_getpeername(FAR struct socket *psock,
|
static int inet_getpeername(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen);
|
FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen);
|
||||||
static int inet_listen(FAR struct socket *psock, int backlog);
|
static int inet_listen(FAR struct socket *psock, int backlog);
|
||||||
static int inet_connect(FAR struct socket *psock,
|
static int inet_connect(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr,
|
||||||
|
socklen_t addrlen);
|
||||||
static int inet_accept(FAR struct socket *psock,
|
static int inet_accept(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen,
|
FAR struct sockaddr *addr,
|
||||||
FAR struct socket *newsock, int flags);
|
FAR socklen_t *addrlen,
|
||||||
|
FAR struct socket *newsock, int flags);
|
||||||
static int inet_poll(FAR struct socket *psock,
|
static int inet_poll(FAR struct socket *psock,
|
||||||
FAR struct pollfd *fds, bool setup);
|
FAR struct pollfd *fds, bool setup);
|
||||||
static ssize_t inet_send(FAR struct socket *psock, FAR const void *buf,
|
static ssize_t inet_send(FAR struct socket *psock, FAR const void *buf,
|
||||||
size_t len, int flags);
|
size_t len, int flags);
|
||||||
static ssize_t inet_sendto(FAR struct socket *psock, FAR const void *buf,
|
static ssize_t inet_sendto(FAR struct socket *psock, FAR const void *buf,
|
||||||
size_t len, int flags, FAR const struct sockaddr *to,
|
size_t len, int flags,
|
||||||
socklen_t tolen);
|
FAR const struct sockaddr *to,
|
||||||
|
socklen_t tolen);
|
||||||
static ssize_t inet_sendmsg(FAR struct socket *psock,
|
static ssize_t inet_sendmsg(FAR struct socket *psock,
|
||||||
FAR struct msghdr *msg, int flags);
|
FAR struct msghdr *msg, int flags);
|
||||||
static ssize_t inet_recvmsg(FAR struct socket *psock,
|
static ssize_t inet_recvmsg(FAR struct socket *psock,
|
||||||
FAR struct msghdr *msg, int flags);
|
FAR struct msghdr *msg, int flags);
|
||||||
static int inet_ioctl(FAR struct socket *psock,
|
static int inet_ioctl(FAR struct socket *psock,
|
||||||
int cmd, unsigned long arg);
|
int cmd, unsigned long arg);
|
||||||
static int inet_socketpair(FAR struct socket *psocks[2]);
|
static int inet_socketpair(FAR struct socket *psocks[2]);
|
||||||
static int inet_shutdown(FAR struct socket *psock, int how);
|
static int inet_shutdown(FAR struct socket *psock, int how);
|
||||||
#ifdef CONFIG_NET_SOCKOPTS
|
#ifdef CONFIG_NET_SOCKOPTS
|
||||||
static int inet_getsockopt(FAR struct socket *psock, int level,
|
static int inet_getsockopt(FAR struct socket *psock, int level,
|
||||||
int option, FAR void *value, FAR socklen_t *value_len);
|
int option, FAR void *value,
|
||||||
|
FAR socklen_t *value_len);
|
||||||
static int inet_setsockopt(FAR struct socket *psock, int level,
|
static int inet_setsockopt(FAR struct socket *psock, int level,
|
||||||
int option, FAR const void *value, socklen_t value_len);
|
int option, FAR const void *value,
|
||||||
|
socklen_t value_len);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_NET_SENDFILE
|
#ifdef CONFIG_NET_SENDFILE
|
||||||
static ssize_t inet_sendfile(FAR struct socket *psock,
|
static ssize_t inet_sendfile(FAR struct socket *psock,
|
||||||
FAR struct file *infile, FAR off_t *offset,
|
FAR struct file *infile, FAR off_t *offset,
|
||||||
size_t count);
|
size_t count);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -87,7 +87,7 @@ static int local_event_pollsetup(FAR struct local_conn_s *conn,
|
|||||||
eventset |= POLLIN;
|
eventset |= POLLIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
local_event_pollnotify(conn, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -51,25 +51,31 @@ static int local_setup(FAR struct socket *psock);
|
|||||||
static sockcaps_t local_sockcaps(FAR struct socket *psock);
|
static sockcaps_t local_sockcaps(FAR struct socket *psock);
|
||||||
static void local_sockaddref(FAR struct socket *psock);
|
static void local_sockaddref(FAR struct socket *psock);
|
||||||
static int local_bind(FAR struct socket *psock,
|
static int local_bind(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr,
|
||||||
|
socklen_t addrlen);
|
||||||
static int local_getsockname(FAR struct socket *psock,
|
static int local_getsockname(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen);
|
FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen);
|
||||||
static int local_getpeername(FAR struct socket *psock,
|
static int local_getpeername(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen);
|
FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen);
|
||||||
static int local_connect(FAR struct socket *psock,
|
static int local_connect(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr,
|
||||||
|
socklen_t addrlen);
|
||||||
static int local_poll(FAR struct socket *psock,
|
static int local_poll(FAR struct socket *psock,
|
||||||
FAR struct pollfd *fds, bool setup);
|
FAR struct pollfd *fds, bool setup);
|
||||||
static int local_close(FAR struct socket *psock);
|
static int local_close(FAR struct socket *psock);
|
||||||
static int local_ioctl(FAR struct socket *psock,
|
static int local_ioctl(FAR struct socket *psock,
|
||||||
int cmd, unsigned long arg);
|
int cmd, unsigned long arg);
|
||||||
static int local_socketpair(FAR struct socket *psocks[2]);
|
static int local_socketpair(FAR struct socket *psocks[2]);
|
||||||
static int local_shutdown(FAR struct socket *psock, int how);
|
static int local_shutdown(FAR struct socket *psock, int how);
|
||||||
#ifdef CONFIG_NET_SOCKOPTS
|
#ifdef CONFIG_NET_SOCKOPTS
|
||||||
static int local_getsockopt(FAR struct socket *psock, int level,
|
static int local_getsockopt(FAR struct socket *psock, int level,
|
||||||
int option, FAR void *value, FAR socklen_t *value_len);
|
int option, FAR void *value,
|
||||||
|
FAR socklen_t *value_len);
|
||||||
static int local_setsockopt(FAR struct socket *psock, int level,
|
static int local_setsockopt(FAR struct socket *psock, int level,
|
||||||
int option, FAR const void *value, socklen_t value_len);
|
int option, FAR const void *value,
|
||||||
|
socklen_t value_len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -51,15 +51,18 @@ static int netlink_setup(FAR struct socket *psock);
|
|||||||
static sockcaps_t netlink_sockcaps(FAR struct socket *psock);
|
static sockcaps_t netlink_sockcaps(FAR struct socket *psock);
|
||||||
static void netlink_addref(FAR struct socket *psock);
|
static void netlink_addref(FAR struct socket *psock);
|
||||||
static int netlink_bind(FAR struct socket *psock,
|
static int netlink_bind(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr, socklen_t addrlen);
|
||||||
static int netlink_getsockname(FAR struct socket *psock,
|
static int netlink_getsockname(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen);
|
FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen);
|
||||||
static int netlink_getpeername(FAR struct socket *psock,
|
static int netlink_getpeername(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen);
|
FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen);
|
||||||
static int netlink_connect(FAR struct socket *psock,
|
static int netlink_connect(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr,
|
||||||
|
socklen_t addrlen);
|
||||||
static int netlink_poll(FAR struct socket *psock, FAR struct pollfd *fds,
|
static int netlink_poll(FAR struct socket *psock, FAR struct pollfd *fds,
|
||||||
bool setup);
|
bool setup);
|
||||||
static ssize_t netlink_sendmsg(FAR struct socket *psock,
|
static ssize_t netlink_sendmsg(FAR struct socket *psock,
|
||||||
FAR struct msghdr *msg, int flags);
|
FAR struct msghdr *msg, int flags);
|
||||||
static ssize_t netlink_recvmsg(FAR struct socket *psock,
|
static ssize_t netlink_recvmsg(FAR struct socket *psock,
|
||||||
|
@ -141,30 +141,36 @@ static int rpmsg_socket_setup(FAR struct socket *psock);
|
|||||||
static sockcaps_t rpmsg_socket_sockcaps(FAR struct socket *psock);
|
static sockcaps_t rpmsg_socket_sockcaps(FAR struct socket *psock);
|
||||||
static void rpmsg_socket_addref(FAR struct socket *psock);
|
static void rpmsg_socket_addref(FAR struct socket *psock);
|
||||||
static int rpmsg_socket_bind(FAR struct socket *psock,
|
static int rpmsg_socket_bind(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr,
|
||||||
|
socklen_t addrlen);
|
||||||
static int rpmsg_socket_getsockname(FAR struct socket *psock,
|
static int rpmsg_socket_getsockname(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen);
|
FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen);
|
||||||
static int rpmsg_socket_getconnname(FAR struct socket *psock,
|
static int rpmsg_socket_getconnname(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen);
|
FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen);
|
||||||
static int rpmsg_socket_listen(FAR struct socket *psock, int backlog);
|
static int rpmsg_socket_listen(FAR struct socket *psock, int backlog);
|
||||||
static int rpmsg_socket_connect(FAR struct socket *psock,
|
static int rpmsg_socket_connect(FAR struct socket *psock,
|
||||||
FAR const struct sockaddr *addr, socklen_t addrlen);
|
FAR const struct sockaddr *addr,
|
||||||
|
socklen_t addrlen);
|
||||||
static int rpmsg_socket_accept(FAR struct socket *psock,
|
static int rpmsg_socket_accept(FAR struct socket *psock,
|
||||||
FAR struct sockaddr *addr, FAR socklen_t *addrlen,
|
FAR struct sockaddr *addr,
|
||||||
FAR struct socket *newsock, int flags);
|
FAR socklen_t *addrlen,
|
||||||
|
FAR struct socket *newsock, int flags);
|
||||||
static int rpmsg_socket_poll(FAR struct socket *psock,
|
static int rpmsg_socket_poll(FAR struct socket *psock,
|
||||||
FAR struct pollfd *fds, bool setup);
|
FAR struct pollfd *fds, bool setup);
|
||||||
static ssize_t rpmsg_socket_sendmsg(FAR struct socket *psock,
|
static ssize_t rpmsg_socket_sendmsg(FAR struct socket *psock,
|
||||||
FAR struct msghdr *msg, int flags);
|
FAR struct msghdr *msg, int flags);
|
||||||
static ssize_t rpmsg_socket_recvmsg(FAR struct socket *psock,
|
static ssize_t rpmsg_socket_recvmsg(FAR struct socket *psock,
|
||||||
FAR struct msghdr *msg, int flags);
|
FAR struct msghdr *msg, int flags);
|
||||||
static int rpmsg_socket_close(FAR struct socket *psock);
|
static int rpmsg_socket_close(FAR struct socket *psock);
|
||||||
static int rpmsg_socket_ioctl(FAR struct socket *psock,
|
static int rpmsg_socket_ioctl(FAR struct socket *psock,
|
||||||
int cmd, unsigned long arg);
|
int cmd, unsigned long arg);
|
||||||
#ifdef CONFIG_NET_SOCKOPTS
|
#ifdef CONFIG_NET_SOCKOPTS
|
||||||
static int rpmsg_socket_getsockopt(FAR struct socket *psock,
|
static int rpmsg_socket_getsockopt(FAR struct socket *psock,
|
||||||
int level, int option, FAR void *value,
|
int level, int option,
|
||||||
FAR socklen_t *value_len);
|
FAR void *value,
|
||||||
|
FAR socklen_t *value_len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -943,7 +949,7 @@ static int rpmsg_socket_poll(FAR struct socket *psock,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rpmsg_socket_poll_notify(conn, eventset);
|
poll_notify(&fds, 1, eventset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -165,9 +165,9 @@ static uint16_t tcp_poll_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
{
|
{
|
||||||
/* Stop further callbacks */
|
/* Stop further callbacks */
|
||||||
|
|
||||||
info->cb->flags = 0;
|
info->cb->flags = 0;
|
||||||
info->cb->priv = NULL;
|
info->cb->priv = NULL;
|
||||||
info->cb->event = NULL;
|
info->cb->event = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,17 +256,16 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
* callback processing.
|
* callback processing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
cb->flags = TCP_DISCONN_EVENTS;
|
cb->flags = TCP_DISCONN_EVENTS;
|
||||||
cb->priv = (FAR void *)info;
|
cb->priv = info;
|
||||||
cb->event = tcp_poll_eventhandler;
|
cb->event = tcp_poll_eventhandler;
|
||||||
|
|
||||||
if ((fds->events & POLLOUT) != 0)
|
if ((fds->events & POLLOUT) != 0)
|
||||||
{
|
{
|
||||||
cb->flags |= TCP_POLL
|
cb->flags |= TCP_POLL;
|
||||||
#if defined(CONFIG_NET_TCP_WRITE_BUFFERS)
|
#if defined(CONFIG_NET_TCP_WRITE_BUFFERS)
|
||||||
| TCP_ACKDATA
|
cb->flags |= TCP_ACKDATA;
|
||||||
#endif
|
#endif
|
||||||
;
|
|
||||||
|
|
||||||
/* Monitor the connected event */
|
/* Monitor the connected event */
|
||||||
|
|
||||||
@ -285,7 +284,7 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
* for use during poll teardown as well.
|
* for use during poll teardown as well.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fds->priv = (FAR void *)info;
|
fds->priv = info;
|
||||||
|
|
||||||
/* Check for read data or backlogged connection availability now */
|
/* Check for read data or backlogged connection availability now */
|
||||||
|
|
||||||
|
@ -186,9 +186,9 @@ int udp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
* callback processing.
|
* callback processing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
cb->flags = NETDEV_DOWN;
|
cb->flags = NETDEV_DOWN;
|
||||||
cb->priv = (FAR void *)info;
|
cb->priv = info;
|
||||||
cb->event = udp_poll_eventhandler;
|
cb->event = udp_poll_eventhandler;
|
||||||
|
|
||||||
if ((fds->events & POLLOUT) != 0)
|
if ((fds->events & POLLOUT) != 0)
|
||||||
{
|
{
|
||||||
@ -204,7 +204,7 @@ int udp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
|
|||||||
* for use during poll teardown as well.
|
* for use during poll teardown as well.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fds->priv = (FAR void *)info;
|
fds->priv = info;
|
||||||
|
|
||||||
/* Check for read data availability now */
|
/* Check for read data availability now */
|
||||||
|
|
||||||
|
@ -174,17 +174,17 @@ static int usrsock_pollsetup(FAR struct socket *psock,
|
|||||||
* callback processing.
|
* callback processing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
cb->flags = USRSOCK_EVENT_ABORT | USRSOCK_EVENT_CONNECT_READY |
|
cb->flags = USRSOCK_EVENT_ABORT | USRSOCK_EVENT_CONNECT_READY |
|
||||||
USRSOCK_EVENT_SENDTO_READY | USRSOCK_EVENT_RECVFROM_AVAIL |
|
USRSOCK_EVENT_SENDTO_READY | USRSOCK_EVENT_RECVFROM_AVAIL |
|
||||||
USRSOCK_EVENT_REMOTE_CLOSED;
|
USRSOCK_EVENT_REMOTE_CLOSED;
|
||||||
cb->priv = (FAR void *)info;
|
cb->priv = info;
|
||||||
cb->event = poll_event;
|
cb->event = poll_event;
|
||||||
|
|
||||||
/* Save the reference in the poll info structure as fds private as well
|
/* Save the reference in the poll info structure as fds private as well
|
||||||
* for use during poll teardown as well.
|
* for use during poll teardown as well.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fds->priv = (FAR void *)info;
|
fds->priv = info;
|
||||||
|
|
||||||
/* Check if socket is in error state */
|
/* Check if socket is in error state */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user