Skip to content

Commit

Permalink
Merge pull request #18264 from jia200x/pr/submac_use_ieee802154_retra…
Browse files Browse the repository at this point in the history
…ns_config

ieee802154: add default max frame retransmissions config
  • Loading branch information
benpicco authored Jun 28, 2022
2 parents 1d25475 + 88e14f0 commit 5bb12f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions sys/include/net/ieee802154.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ extern const uint8_t ieee802154_addr_bcast[IEEE802154_ADDR_BCAST_LEN];
#define CONFIG_IEEE802154_CCA_THRESH_DEFAULT (-70)
#endif

/**
* @brief IEEE802.15.4 default value for maximum frame retries.
*/
#ifndef CONFIG_IEEE802154_DEFAULT_MAX_FRAME_RETRANS
#define CONFIG_IEEE802154_DEFAULT_MAX_FRAME_RETRANS (4U)
#endif

/**
* @brief Disable Auto ACK support
*/
Expand Down
2 changes: 0 additions & 2 deletions sys/include/net/ieee802154/submac.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ extern "C" {
#include "net/ieee802154.h"
#include "net/ieee802154/radio.h"

#define IEEE802154_SUBMAC_MAX_RETRANSMISSIONS (4U) /**< maximum number of frame retransmissions */

/**
* @brief IEEE 802.15.4 SubMAC forward declaration
*/
Expand Down
5 changes: 5 additions & 0 deletions sys/net/link_layer/ieee802154/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ if KCONFIG_USEMODULE_IEEE802154
config IEEE802154_DEFAULT_CSMA_CA_MAX
int "IEEE802.15.4 default CSMA-CA maximum backoff exponent"
default 5

config IEEE802154_DEFAULT_MAX_FRAME_RETRANS
int "IEEE802.15.4 default maximum frame retransmissions"
default 4

config IEEE802154_AUTO_ACK_DISABLE
bool "Disable Auto ACK support" if !USEPKG_OPENWSN
default y if USEPKG_OPENWSN
Expand Down
2 changes: 1 addition & 1 deletion sys/net/link_layer/ieee802154/submac.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static inline bool _does_handle_csma(ieee802154_dev_t *dev)

static bool _has_retrans_left(ieee802154_submac_t *submac)
{
return submac->retrans < IEEE802154_SUBMAC_MAX_RETRANSMISSIONS;
return submac->retrans < CONFIG_IEEE802154_DEFAULT_MAX_FRAME_RETRANS;
}

static ieee802154_fsm_state_t _tx_end(ieee802154_submac_t *submac, int status,
Expand Down

0 comments on commit 5bb12f3

Please sign in to comment.