mirror of
https://github.com/apache/nuttx.git
synced 2026-03-27 02:29:15 +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
@@ -230,7 +230,7 @@ static void mrf24j40_irqwork_rx(FAR struct mrf24j40_radio_s *dev)
|
||||
|
||||
/* Allocate an IOB to put the frame into */
|
||||
|
||||
ind->frame = iob_alloc(false, IOBUSER_WIRELESS_RAD802154);
|
||||
ind->frame = iob_alloc(false);
|
||||
ind->frame->io_flink = NULL;
|
||||
ind->frame->io_len = 0;
|
||||
ind->frame->io_pktlen = 0;
|
||||
|
||||
@@ -163,7 +163,7 @@ static void xbee_attnworker(FAR void *arg)
|
||||
|
||||
/* Allocate an IOB for the incoming data. */
|
||||
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_RAD802154);
|
||||
iob = iob_alloc(false);
|
||||
iob->io_flink = NULL;
|
||||
iob->io_len = 0;
|
||||
iob->io_offset = 0;
|
||||
@@ -263,11 +263,9 @@ static void xbee_attnworker(FAR void *arg)
|
||||
* processing.
|
||||
*/
|
||||
|
||||
iob->io_flink =
|
||||
iob_tryalloc(false, IOBUSER_WIRELESS_RAD802154);
|
||||
iob->io_flink = iob_tryalloc(false);
|
||||
|
||||
iob = iob->io_flink;
|
||||
|
||||
if (iob != NULL)
|
||||
{
|
||||
iob->io_flink = NULL;
|
||||
@@ -330,7 +328,7 @@ static void xbee_attnworker(FAR void *arg)
|
||||
wlwarn("Partial API frame clocked in. Dropping!\n");
|
||||
}
|
||||
|
||||
iob_free(iob, IOBUSER_WIRELESS_RAD802154);
|
||||
iob_free(iob);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -804,7 +802,7 @@ static void xbee_process_apiframes(FAR struct xbee_priv_s *priv,
|
||||
|
||||
nextframe = frame->io_flink;
|
||||
frame->io_flink = NULL;
|
||||
iob_free(frame, IOBUSER_WIRELESS_RAD802154);
|
||||
iob_free(frame);
|
||||
frame = nextframe;
|
||||
}
|
||||
}
|
||||
@@ -1032,8 +1030,7 @@ static void xbee_notify_worker(FAR void *arg)
|
||||
|
||||
if (dispose)
|
||||
{
|
||||
iob_free(primitive->u.dataind.frame,
|
||||
IOBUSER_WIRELESS_RAD802154);
|
||||
iob_free(primitive->u.dataind.frame);
|
||||
ieee802154_primitive_free(primitive);
|
||||
}
|
||||
}
|
||||
@@ -1328,7 +1325,7 @@ void xbee_send_apiframe(FAR struct xbee_priv_s *priv,
|
||||
* data.
|
||||
*/
|
||||
|
||||
iob = iob_tryalloc(false, IOBUSER_WIRELESS_RAD802154);
|
||||
iob = iob_tryalloc(false);
|
||||
iob->io_flink = NULL;
|
||||
iob->io_len = 0;
|
||||
iob->io_offset = 0;
|
||||
@@ -1422,8 +1419,7 @@ void xbee_send_apiframe(FAR struct xbee_priv_s *priv,
|
||||
* processing.
|
||||
*/
|
||||
|
||||
iob->io_flink =
|
||||
iob_tryalloc(false, IOBUSER_WIRELESS_RAD802154);
|
||||
iob->io_flink = iob_tryalloc(false);
|
||||
iob = iob->io_flink;
|
||||
|
||||
if (iob != NULL)
|
||||
@@ -1483,7 +1479,7 @@ void xbee_send_apiframe(FAR struct xbee_priv_s *priv,
|
||||
wlwarn("Partial API frame clocked in. Dropping!\n");
|
||||
}
|
||||
|
||||
iob_free(iob, IOBUSER_WIRELESS_RAD802154);
|
||||
iob_free(iob);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ int xbee_req_data(XBEEHANDLE xbee,
|
||||
while (!priv->txdone);
|
||||
|
||||
nxsem_post(&priv->tx_sem);
|
||||
iob_free(frame, IOBUSER_WIRELESS_RAD802154);
|
||||
iob_free(frame);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1116,13 +1116,13 @@ static int xbeenet_req_data(FAR struct radio_driver_s *netdev,
|
||||
{
|
||||
wlerr("ERROR: xbeemac_req_data failed: %d\n", ret);
|
||||
|
||||
iob_free(iob, IOBUSER_WIRELESS_RAD802154);
|
||||
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_RAD802154);
|
||||
iob_free(iob);
|
||||
}
|
||||
|
||||
NETDEV_TXERRORS(&priv->xd_dev.r_dev);
|
||||
|
||||
Reference in New Issue
Block a user