ieee802154 network driver now retries if ieee802154_req_data() returns EINTR. In clicker2-stm32 6LoWPAN configuration, increased the number of TX descriptors to match then number of IOBs.
This commit is contained in:
parent
d3b9ea9d66
commit
192bacbd7f
|
@ -1138,7 +1138,7 @@ CONFIG_WIRELESS=y
|
|||
CONFIG_WIRELESS_IEEE802154=y
|
||||
CONFIG_IEEE802154_DEFAULT_EADDR=0x00fade00deadbeef
|
||||
CONFIG_MAC802154_HPWORK=y
|
||||
CONFIG_IEEE802154_NTXDESC=3
|
||||
CONFIG_IEEE802154_NTXDESC=32
|
||||
CONFIG_IEEE802154_IND_PREALLOC=20
|
||||
CONFIG_IEEE802154_IND_IRQRESERVE=10
|
||||
CONFIG_IEEE802154_MACDEV=y
|
||||
|
|
|
@ -46,7 +46,14 @@ config IEEE802154_NTXDESC
|
|||
default 3
|
||||
---help---
|
||||
Configured number of Tx descriptors. Default: 3
|
||||
|
||||
|
||||
When used with 6LoWPAN, the descriptor allocator runs on a work
|
||||
and must avoid blocking if possible. Each frame will be provided in
|
||||
an IOB and each TX frame will need a TX descriptor. So the safe
|
||||
thing to do is set CONFIG_IEEE802154_NTXDESC to CONFIG_IOB_NBUFFERS.
|
||||
Then there should be the maximum pre-allocated buffers for each
|
||||
possible TX frame.
|
||||
|
||||
config IEEE802154_IND_PREALLOC
|
||||
int "Number of pre-allocated meta-data structures"
|
||||
default 20
|
||||
|
@ -75,7 +82,7 @@ config IEEE802154_IND_IRQRESERVE
|
|||
Non-interrupt logic will also first attempt to allocate from the
|
||||
general, pre-allocated structure pool. If that fails, it will
|
||||
dynamically allocate the meta data structure with an additional cost in performance.
|
||||
|
||||
|
||||
config IEEE802154_MACDEV
|
||||
bool "Character driver for IEEE 802.15.4 MAC layer"
|
||||
default n
|
||||
|
|
|
@ -405,6 +405,7 @@ static int macnet_rxframe(FAR struct mac802154_maccb_s *maccb,
|
|||
|
||||
if (!priv->md_bifup)
|
||||
{
|
||||
wlwarn("WARNING: Dropped... Network is down\n");
|
||||
return -ENETDOWN;
|
||||
}
|
||||
|
||||
|
@ -421,6 +422,8 @@ static int macnet_rxframe(FAR struct mac802154_maccb_s *maccb,
|
|||
if ((iob->io_data[iob->io_offset] & SIXLOWPAN_DISPATCH_NALP_MASK) ==
|
||||
SIXLOWPAN_DISPATCH_NALP)
|
||||
{
|
||||
wlwarn("WARNING: Dropped... Not a 6LoWPAN frame: %02x\n",
|
||||
iob->io_data[iob->io_offset]);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1114,9 +1117,17 @@ static int macnet_req_data(FAR struct ieee802154_driver_s *netdev,
|
|||
framelist = iob->io_flink;
|
||||
iob->io_flink = NULL;
|
||||
|
||||
/* Transfer the frame to the MAC */
|
||||
/* Transfer the frame to the MAC. mac802154_req_data will return
|
||||
* -EINTR if a signal is received during certain phases of processing.
|
||||
* In this context we just need to ignore -EINTR errors and try again.
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
ret = mac802154_req_data(priv->md_mac, meta, iob);
|
||||
}
|
||||
while (ret == -EINTR);
|
||||
|
||||
ret = mac802154_req_data(priv->md_mac, meta, iob);
|
||||
if (ret < 0)
|
||||
{
|
||||
wlerr("ERROR: mac802154_req_data failed: %d\n", ret);
|
||||
|
|
Loading…
Reference in New Issue