mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
iob: Remove iob_user_e enum and related code
since it is impossible to track producer and consumer correctly if TCP/IP stack pass IOB directly to netdev Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
e247eaf3e8
commit
ba9486de4a
@@ -242,7 +242,7 @@ void mac802154_createdatareq(FAR struct ieee802154_privmac_s *priv,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154);
|
||||
iob = iob_alloc(false);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
@@ -417,8 +417,7 @@ static void mac802154_notify_worker(FAR void *arg)
|
||||
|
||||
if (dispose)
|
||||
{
|
||||
iob_free(primitive->u.dataind.frame,
|
||||
IOBUSER_WIRELESS_MAC802154);
|
||||
iob_free(primitive->u.dataind.frame);
|
||||
ieee802154_primitive_free(primitive);
|
||||
}
|
||||
}
|
||||
@@ -751,7 +750,7 @@ static void mac802154_purge_worker(FAR void *arg)
|
||||
|
||||
/* Free the IOB, the notification, and the tx descriptor */
|
||||
|
||||
iob_free(txdesc->frame, IOBUSER_WIRELESS_MAC802154);
|
||||
iob_free(txdesc->frame);
|
||||
ieee802154_primitive_free((FAR struct ieee802154_primitive_s *)
|
||||
txdesc->conf);
|
||||
mac802154_txdesc_free(priv, txdesc);
|
||||
@@ -992,7 +991,7 @@ static void mac802154_txdone_worker(FAR void *arg)
|
||||
|
||||
/* Free the IOB and the tx descriptor */
|
||||
|
||||
iob_free(txdesc->frame, IOBUSER_WIRELESS_MAC802154);
|
||||
iob_free(txdesc->frame);
|
||||
mac802154_txdesc_free(priv, txdesc);
|
||||
}
|
||||
|
||||
@@ -1533,7 +1532,7 @@ static void mac802154_rxdatareq(FAR struct ieee802154_privmac_s *priv,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154);
|
||||
iob = iob_alloc(false);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
|
||||
@@ -132,7 +132,7 @@ int mac802154_req_associate(MACHANDLE mac,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154);
|
||||
iob = iob_alloc(false);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
@@ -145,7 +145,7 @@ int mac802154_req_associate(MACHANDLE mac,
|
||||
ret = mac802154_txdesc_alloc(priv, &txdesc, true);
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154);
|
||||
iob_free(iob);
|
||||
mac802154_unlock(priv)
|
||||
mac802154_givesem(&priv->opsem);
|
||||
return ret;
|
||||
@@ -325,7 +325,7 @@ int mac802154_resp_associate(MACHANDLE mac,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154);
|
||||
iob = iob_alloc(false);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
@@ -401,7 +401,7 @@ int mac802154_resp_associate(MACHANDLE mac,
|
||||
ret = mac802154_lock(priv, true);
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154);
|
||||
iob_free(iob);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ int mac802154_resp_associate(MACHANDLE mac,
|
||||
ret = mac802154_txdesc_alloc(priv, &txdesc, true);
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154);
|
||||
iob_free(iob);
|
||||
mac802154_unlock(priv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ static ssize_t mac802154dev_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Free the IOB */
|
||||
|
||||
iob_free(ind->frame, IOBUSER_WIRELESS_MAC802154_CHARDEV);
|
||||
iob_free(ind->frame);
|
||||
|
||||
/* Deallocate the data indication */
|
||||
|
||||
@@ -525,7 +525,7 @@ static ssize_t mac802154dev_write(FAR struct file *filep,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154_CHARDEV);
|
||||
iob = iob_alloc(false);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
@@ -554,7 +554,7 @@ static ssize_t mac802154dev_write(FAR struct file *filep,
|
||||
ret = mac802154_req_data(dev->md_mac, &tx->meta, iob, true);
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154_CHARDEV);
|
||||
iob_free(iob);
|
||||
wlerr("ERROR: req_data failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1117,13 +1117,13 @@ static int macnet_req_data(FAR struct radio_driver_s *netdev,
|
||||
{
|
||||
wlerr("ERROR: mac802154_req_data failed: %d\n", ret);
|
||||
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154_NETDEV);
|
||||
iob_free(iob);
|
||||
for (iob = framelist; iob != NULL; iob = framelist)
|
||||
{
|
||||
/* Remove the IOB from the queue and free */
|
||||
|
||||
framelist = iob->io_flink;
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154_NETDEV);
|
||||
iob_free(iob);
|
||||
}
|
||||
|
||||
NETDEV_TXERRORS(&priv->md_dev.r_dev);
|
||||
|
||||
Reference in New Issue
Block a user