Merged in masayuki2009/nuttx.nuttx/fix_gs2200m (pull request #926)

drivers/wireless: Fix a passive close when sending a packet in gs2200m.c

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Masayuki Ishikawa 2019-07-03 00:11:24 +00:00 committed by Gregory Nutt
parent 1346f29151
commit b6e7812c74

View File

@ -962,6 +962,12 @@ retry:
{
wlwarn("*** warning: WR_RESP_NOK received.. retrying. (n=%d) \n", n);
nxsig_usleep(100 * 1000);
if (100 < n)
{
return SPI_TIMEOUT;
}
n++;
goto retry;
}
@ -1888,10 +1894,19 @@ static int gs2200m_ioctl_send(FAR struct gs2200m_dev_s *dev,
gs2200m_set_gpio(dev, LED_GPIO, 1);
#endif
if (!_cid_is_set(&dev->valid_cid_bits, msg->cid))
{
wlinfo("+++ already closed \n");
type = TYPE_DISCONNECT;
goto errout;
}
type = gs2200m_send_bulk(dev, msg->cid, msg->buf, msg->len);
msg->type = type;
errout:
if (type != TYPE_OK)
{
ret = -EINVAL;
@ -2449,6 +2464,14 @@ static void gs2200m_irq_worker(FAR void *arg)
wlinfo("=== added to qkt_q[%d] t=%d \n", c, t);
/* When a DISCONNECT packet received, disable the cid */
if (TYPE_DISCONNECT == t)
{
wlinfo("=== received DISCONNECT for cid=%c \n", pkt_dat->cid);
_enable_cid(&dev->valid_cid_bits, pkt_dat->cid, false);
}
/* If accept() is not in progress for the cid, add the packet to notif_q
*
* NOTE: we need this condition to process the packet in correct order,