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:
parent
1346f29151
commit
b6e7812c74
@ -962,6 +962,12 @@ retry:
|
|||||||
{
|
{
|
||||||
wlwarn("*** warning: WR_RESP_NOK received.. retrying. (n=%d) \n", n);
|
wlwarn("*** warning: WR_RESP_NOK received.. retrying. (n=%d) \n", n);
|
||||||
nxsig_usleep(100 * 1000);
|
nxsig_usleep(100 * 1000);
|
||||||
|
|
||||||
|
if (100 < n)
|
||||||
|
{
|
||||||
|
return SPI_TIMEOUT;
|
||||||
|
}
|
||||||
|
|
||||||
n++;
|
n++;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
@ -1888,10 +1894,19 @@ static int gs2200m_ioctl_send(FAR struct gs2200m_dev_s *dev,
|
|||||||
gs2200m_set_gpio(dev, LED_GPIO, 1);
|
gs2200m_set_gpio(dev, LED_GPIO, 1);
|
||||||
#endif
|
#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);
|
type = gs2200m_send_bulk(dev, msg->cid, msg->buf, msg->len);
|
||||||
|
|
||||||
msg->type = type;
|
msg->type = type;
|
||||||
|
|
||||||
|
errout:
|
||||||
|
|
||||||
if (type != TYPE_OK)
|
if (type != TYPE_OK)
|
||||||
{
|
{
|
||||||
ret = -EINVAL;
|
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);
|
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
|
/* 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,
|
* NOTE: we need this condition to process the packet in correct order,
|
||||||
|
Loading…
Reference in New Issue
Block a user