mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
mac802154_req_data() can return without releasing the exclsem
This commit is contained in:
@@ -447,7 +447,7 @@ Configurations
|
|||||||
The ifconfig command will show the IP address of the server. Then on
|
The ifconfig command will show the IP address of the server. Then on
|
||||||
the client node use this IP address to start the client:
|
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.
|
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
|
NOTE: There is no way to stop the UDP test once it has been started
|
||||||
@@ -455,13 +455,13 @@ Configurations
|
|||||||
|
|
||||||
STATUS:
|
STATUS:
|
||||||
2017-06-19: The Telnet Daemon does not start. This is simply because
|
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:
|
has been brought up:
|
||||||
|
|
||||||
telnetd_daemon: ERROR: socket failure: 106
|
telnetd_daemon: ERROR: socket failure: 106
|
||||||
|
|
||||||
Basic network bring-up sequence works. At least no errors are
|
2017-06-20: I am get EINTR errors from the MAC layer when trying the
|
||||||
reported.
|
udpclient tries to send messages. Still under investigation.
|
||||||
|
|
||||||
nsh:
|
nsh:
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
ret = sem_trywait(&priv->txdesc_sem);
|
ret = sem_trywait(&priv->txdesc_sem);
|
||||||
|
|
||||||
if (ret == OK)
|
if (ret == OK)
|
||||||
{
|
{
|
||||||
*txdesc = (FAR struct ieee802154_txdesc_s *)sq_remfirst(&priv->txdesc_queue);
|
*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 = ¬if->u.dataconf;
|
(*txdesc)->conf = ¬if->u.dataconf;
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,10 @@ int mac802154_req_data(MACHANDLE mac,
|
|||||||
ret = mac802154_takesem(&priv->exclsem, true);
|
ret = mac802154_takesem(&priv->exclsem, true);
|
||||||
if (ret < 0)
|
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
|
/* 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)
|
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);
|
ret = mac802154_txdesc_alloc(priv, &txdesc, true);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
return ret;
|
wlwarn("WARNING: mac802154_txdesc_alloc failed: %d", ret);
|
||||||
|
goto errout_with_sem;
|
||||||
}
|
}
|
||||||
|
|
||||||
txdesc->conf->handle = meta->msdu_handle;
|
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.
|
* don't have to try and kick-off any transmission here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* We no longer need to have the MAC layer locked. */
|
ret = -ENOTSUP;
|
||||||
|
goto errout_with_sem;
|
||||||
mac802154_givesem(&priv->exclsem);
|
|
||||||
|
|
||||||
return -ENOTSUP;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -300,7 +302,8 @@ int mac802154_req_data(MACHANDLE mac,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
mac802154_givesem(&priv->exclsem);
|
mac802154_givesem(&priv->exclsem);
|
||||||
return -EINVAL;
|
ret = -EINVAL;
|
||||||
|
goto errout_with_sem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -320,6 +323,10 @@ int mac802154_req_data(MACHANDLE mac,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
|
errout_with_sem:
|
||||||
|
mac802154_givesem(&priv->exclsem);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user