diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-05-21 07:37:46 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-05-21 07:37:46 -0600 |
commit | 721f4368aca64955eb92b3c2aebe93e421244787 (patch) | |
tree | cce4f081b93616e25a04c01a560ea432f39e7818 /nuttx/drivers/wireless | |
parent | a258fb9f8de2309b0de77c9674b63ffda4cbe8ea (diff) | |
download | px4-nuttx-721f4368aca64955eb92b3c2aebe93e421244787.tar.gz px4-nuttx-721f4368aca64955eb92b3c2aebe93e421244787.tar.bz2 px4-nuttx-721f4368aca64955eb92b3c2aebe93e421244787.zip |
CC3000: Fix build when POLL is enabled. From Jussi Kivilinna.
Diffstat (limited to 'nuttx/drivers/wireless')
-rw-r--r-- | nuttx/drivers/wireless/cc3000/cc3000.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/nuttx/drivers/wireless/cc3000/cc3000.c b/nuttx/drivers/wireless/cc3000/cc3000.c index 4f2115525..f31419176 100644 --- a/nuttx/drivers/wireless/cc3000/cc3000.c +++ b/nuttx/drivers/wireless/cc3000/cc3000.c @@ -446,15 +446,33 @@ static inline int cc3000_wait_ready(FAR struct cc3000_dev_s *priv) } /**************************************************************************** - * Name: cc3000_notify + * Name: cc3000_pollnotify ****************************************************************************/ -static void cc3000_notify(FAR struct cc3000_dev_s *priv) -{ #ifndef CONFIG_DISABLE_POLL +static void cc3000_pollnotify(FAR struct cc3000_dev_s *priv, uint32_t type) +{ int i; + + for (i = 0; i < CONFIG_CC3000_NPOLLWAITERS; i++) + { + struct pollfd *fds = priv->fds[i]; + if (fds) + { + fds->revents |= type; + nllvdbg("Report events: %02x\n", fds->revents); + sem_post(fds->sem); + } + } +} #endif +/**************************************************************************** + * Name: cc3000_notify + ****************************************************************************/ + +static void cc3000_notify(FAR struct cc3000_dev_s *priv) +{ /* If there are threads waiting for read data, then signal one of them * that the read data is available. */ @@ -475,16 +493,7 @@ static void cc3000_notify(FAR struct cc3000_dev_s *priv) */ #ifndef CONFIG_DISABLE_POLL - for (i = 0; i < CONFIG_CC3000_NPOLLWAITERS; i++) - { - struct pollfd *fds = priv->fds[i]; - if (fds) - { - fds->revents |= POLLIN; - nllvdbg("Report events: %02x\n", fds->revents); - sem_post(fds->sem); - } - } + cc3000_pollnotify(priv, POLLIN); #endif } @@ -1419,7 +1428,7 @@ static int cc3000_poll(FAR struct file *filep, FAR struct pollfd *fds, /* Should we immediately notify on any of the requested events? */ - if (priv->rx_buffer_len) + if (priv->rx_buffer.len) { cc3000_notify(priv); } |