drivers: wireless: Fix packet queue overflow in gs2200m.c

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2020-04-30 13:58:11 +09:00 committed by Alin Jerpelea
parent 45c168c5ef
commit a5e4f0435d

View File

@ -404,6 +404,14 @@ static void _notif_q_push(FAR struct gs2200m_dev_s *dev, char cid)
dev->notif_q.wpos++;
dev->notif_q.count++;
if (dev->pfd)
{
/* If poll() waits and cid has been pushed to the queue, notify */
dev->pfd->revents |= POLLIN;
nxsem_post(dev->pfd->sem);
}
wlinfo("+++ pushed %c count=%d \n", cid, dev->notif_q.count);
}
@ -2735,7 +2743,6 @@ static void gs2200m_irq_worker(FAR void *arg)
enum pkt_type_e t = TYPE_ERROR;
struct pkt_dat_s *pkt_dat;
bool ignored = false;
bool pushed = false;
uint8_t c;
char s_cid;
char c_cid;
@ -2821,7 +2828,6 @@ static void gs2200m_irq_worker(FAR void *arg)
if (!_cid_is_set(&dev->aip_cid_bits, pkt_dat->cid))
{
_notif_q_push(dev, pkt_dat->cid);
pushed = true;
}
/* Check if the packet is CONNECT event from client */
@ -2847,14 +2853,6 @@ static void gs2200m_irq_worker(FAR void *arg)
_enable_cid(&dev->aip_cid_bits, c_cid, true);
}
if (dev->pfd && pushed)
{
/* If poll() waits and cid has been pushed to the queue, notify */
dev->pfd->revents |= POLLIN;
nxsem_post(dev->pfd->sem);
}
errout:
/* NOTE: Enable gs2200m irq which was disabled in gs2200m_irq() */