mac802154_req_data() can return without releasing the exclsem

This commit is contained in:
Gregory Nutt 2017-06-20 11:23:31 -06:00
parent 6dafb4f532
commit a82ab4b729
3 changed files with 20 additions and 15 deletions

View File

@ -447,7 +447,7 @@ Configurations
The ifconfig command will show the IP address of the server. Then on
the client node use this IP address to start the client:
nsh> udpserver <server-ip> &
nsh> udpclient <server-ip> &
Where <server-ip> is the IP address of the server that you got above.
NOTE: There is no way to stop the UDP test once it has been started
@ -455,13 +455,13 @@ Configurations
STATUS:
2017-06-19: The Telnet Daemon does not start. This is simply because
the daemon is started too early in the sequence... befor the network
the daemon is started too early in the sequence... before the network
has been brought up:
telnetd_daemon: ERROR: socket failure: 106
Basic network bring-up sequence works. At least no errors are
reported.
2017-06-20: I am get EINTR errors from the MAC layer when trying the
udpclient tries to send messages. Still under investigation.
nsh:

View File

@ -169,7 +169,6 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv,
*/
ret = sem_trywait(&priv->txdesc_sem);
if (ret == OK)
{
*txdesc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->txdesc_queue);
@ -228,7 +227,6 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv,
}
(*txdesc)->conf = &notif->u.dataconf;
return OK;
}

View File

@ -147,7 +147,10 @@ int mac802154_req_data(MACHANDLE mac,
ret = mac802154_takesem(&priv->exclsem, true);
if (ret < 0)
{
return ret;
/* Should only fail it interrupted by a signal */
wlwarn("WARNING: mac802154_takesem failed: %d", ret);
goto errout_with_sem;
}
/* If both destination and source addressing information is present, the MAC
@ -201,7 +204,8 @@ int mac802154_req_data(MACHANDLE mac,
if (priv->devmode != IEEE802154_DEVMODE_PANCOORD)
{
return -EINVAL;
ret = -EINVAL;
goto errout_with_sem;
}
}
@ -231,7 +235,8 @@ int mac802154_req_data(MACHANDLE mac,
ret = mac802154_txdesc_alloc(priv, &txdesc, true);
if (ret < 0)
{
return ret;
wlwarn("WARNING: mac802154_txdesc_alloc failed: %d", ret);
goto errout_with_sem;
}
txdesc->conf->handle = meta->msdu_handle;
@ -259,11 +264,8 @@ int mac802154_req_data(MACHANDLE mac,
* don't have to try and kick-off any transmission here.
*/
/* We no longer need to have the MAC layer locked. */
mac802154_givesem(&priv->exclsem);
return -ENOTSUP;
ret = -ENOTSUP;
goto errout_with_sem;
}
else
{
@ -300,7 +302,8 @@ int mac802154_req_data(MACHANDLE mac,
else
{
mac802154_givesem(&priv->exclsem);
return -EINVAL;
ret = -EINVAL;
goto errout_with_sem;
}
}
else
@ -320,6 +323,10 @@ int mac802154_req_data(MACHANDLE mac,
}
return OK;
errout_with_sem:
mac802154_givesem(&priv->exclsem);
return ret;
}
/****************************************************************************