mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
PF_IEEE802154: Finishes up sendto() logic
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include <nuttx/wqueue.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/net/ip.h>
|
||||
#include <nuttx/net/ieee802154.h>
|
||||
#include <nuttx/net/sixlowpan.h>
|
||||
#include <nuttx/wireless/ieee802154/ieee802154_loopback.h>
|
||||
|
||||
@@ -341,7 +342,26 @@ static int lo_loopback(FAR struct net_driver_s *dev)
|
||||
ninfo("Send frame %p to the network: Offset=%u Length=%u\n",
|
||||
iob, iob->io_offset, iob->io_len);
|
||||
|
||||
ret = sixlowpan_input(&priv->lo_radio, iob, (FAR void *)&ind);
|
||||
#ifdef CONFIG_NET_IEEE802154
|
||||
/* Invoke the PF_IEEE802154 tap first. If the frame matches
|
||||
* with a connected PF_IEEE802145 socket, it will take the
|
||||
* frame and return success.
|
||||
*/
|
||||
|
||||
ret = ieee802154_input(&priv->lo_radio, iob, (FAR void *)&ind);
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
/* If PF_IEEE802154 was not interested in the frame, then
|
||||
* give it to 6LoWPAN.
|
||||
*/
|
||||
|
||||
if (ret < 0)
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
{
|
||||
ret = sixlowpan_input(&priv->lo_radio, iob, (FAR void *)&ind);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Increment statistics */
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include <nuttx/mm/iob.h>
|
||||
#include <nuttx/net/arp.h>
|
||||
#include <nuttx/net/netdev.h>
|
||||
#include <nuttx/net/ieee802154.h>
|
||||
#include <nuttx/net/sixlowpan.h>
|
||||
#include <nuttx/wireless/ieee802154/ieee802154_mac.h>
|
||||
|
||||
@@ -434,7 +435,23 @@ static int macnet_rxframe(FAR struct mac802154_maccb_s *maccb,
|
||||
|
||||
/* Transfer the frame to the network logic */
|
||||
|
||||
sixlowpan_input(&priv->md_dev, iob, (FAR void *)ind);
|
||||
#ifdef CONFIG_NET_IEEE802154
|
||||
/* Invoke the PF_IEEE802154 tap first. If the frame matches
|
||||
* with a connected PF_IEEE802145 socket, it will take the
|
||||
* frame and return success.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_NET_6LOWPAN
|
||||
(void)ieee802154_input(&priv->md_dev, iob, (FAR void *)ind);
|
||||
#else
|
||||
if (ieee802154_input(&priv->md_dev, iob, (FAR void *)ind) < 0)
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
{
|
||||
(void)sixlowpan_input(&priv->md_dev, iob, (FAR void *)ind);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* sixlowpan_input() will free the IOB, but we must free the struct
|
||||
* ieee802154_data_ind_s container here.
|
||||
|
||||
Reference in New Issue
Block a user