diff --git a/net/ieee802154/ieee802154.h b/net/ieee802154/ieee802154.h index 9555fc5fc5..3981068aba 100644 --- a/net/ieee802154/ieee802154.h +++ b/net/ieee802154/ieee802154.h @@ -31,6 +31,8 @@ #include #include +#include + #ifdef CONFIG_NET_IEEE802154 /**************************************************************************** @@ -40,9 +42,9 @@ /* Allocate a new IEEE 802.15.4 socket data callback */ #define ieee802154_callback_alloc(dev,conn) \ - devif_callback_alloc(dev, &conn->list, &conn->list_tail) + devif_callback_alloc(dev, &conn->sconn.list, &conn->sconn.list_tail) #define ieee802154_callback_free(dev,conn,cb) \ - devif_conn_callback_free(dev, cb, &conn->list, &conn->list_tail) + devif_conn_callback_free(dev, cb, &conn->sconn.list, &conn->sconn.list_tail) /* Memory Pools */ @@ -97,14 +99,7 @@ struct ieee802154_conn_s { /* Common prologue of all connection structures. */ - dq_entry_t node; /* Supports a double linked list */ - - /* This is a list of IEEE 802.15.4 callbacks. Each callback represents - * a thread that is stalled, waiting for a device-specific event. - */ - - FAR struct devif_callback_s *list; - FAR struct devif_callback_s *list_tail; + struct socket_conn_s sconn; /* IEEE 802.15.4-specific content follows */ diff --git a/net/ieee802154/ieee802154_callback.c b/net/ieee802154/ieee802154_callback.c index 66df820820..dbb71274ac 100644 --- a/net/ieee802154/ieee802154_callback.c +++ b/net/ieee802154/ieee802154_callback.c @@ -66,7 +66,8 @@ uint16_t ieee802154_callback(FAR struct radio_driver_s *radio, { /* Perform the callback */ - flags = devif_conn_event(&radio->r_dev, conn, flags, conn->list); + flags = devif_conn_event(&radio->r_dev, conn, flags, + conn->sconn.list); } return flags; diff --git a/net/ieee802154/ieee802154_conn.c b/net/ieee802154/ieee802154_conn.c index 9f1c40ef4d..2d47f3bf05 100644 --- a/net/ieee802154/ieee802154_conn.c +++ b/net/ieee802154/ieee802154_conn.c @@ -96,7 +96,7 @@ void ieee802154_conn_initialize(void) { /* Link each pre-allocated connection structure into the free list. */ - dq_addlast(&g_ieee802154_connections[i].node, + dq_addlast(&g_ieee802154_connections[i].sconn.node, &g_free_ieee802154_connections); } #endif @@ -129,7 +129,8 @@ FAR struct ieee802154_conn_s *ieee802154_conn_alloc(void) { for (i = 0; i < CONFIG_NET_IEEE802154_NCONNS; i++) { - dq_addlast(&conn[i].node, &g_free_ieee802154_connections); + dq_addlast(&conn[i].sconn.node, + &g_free_ieee802154_connections); } } } @@ -139,7 +140,7 @@ FAR struct ieee802154_conn_s *ieee802154_conn_alloc(void) dq_remfirst(&g_free_ieee802154_connections); if (conn) { - dq_addlast(&conn->node, &g_active_ieee802154_connections); + dq_addlast(&conn->sconn.node, &g_active_ieee802154_connections); } net_unlock(); @@ -167,7 +168,7 @@ void ieee802154_conn_free(FAR struct ieee802154_conn_s *conn) /* Remove the connection from the active list */ net_lock(); - dq_rem(&conn->node, &g_active_ieee802154_connections); + dq_rem(&conn->sconn.node, &g_active_ieee802154_connections); /* Check if there any any frames attached to the container */ @@ -196,7 +197,7 @@ void ieee802154_conn_free(FAR struct ieee802154_conn_s *conn) /* Free the connection */ - dq_addlast(&conn->node, &g_free_ieee802154_connections); + dq_addlast(&conn->sconn.node, &g_free_ieee802154_connections); net_unlock(); } @@ -222,7 +223,7 @@ FAR struct ieee802154_conn_s * for (conn = (FAR struct ieee802154_conn_s *) g_active_ieee802154_connections.head; conn != NULL; - conn = (FAR struct ieee802154_conn_s *)conn->node.flink) + conn = (FAR struct ieee802154_conn_s *)conn->sconn.node.flink) { /* Does the destination address match the bound address of the socket. * @@ -300,7 +301,7 @@ FAR struct ieee802154_conn_s * } else { - return (FAR struct ieee802154_conn_s *)conn->node.flink; + return (FAR struct ieee802154_conn_s *)conn->sconn.node.flink; } }