Skip to content

Commit 93647ed

Browse files
Florian Grandelcarlescufi
authored andcommitted
drivers: ieee802154: nrf: wrapped pkt attribute access
Nordic's IEEE 802.15.4 radio driver adapter layer had a few raw accesses to net packet attributes. Packet attributes should never be accessed directly, though, but only through the dedicated accessor methods provided by the net core. This change replaces raw accesses to packet attributes by their respective wrapper functions. This also is a necessary precondition to the isolation and encapsulation of IEEE 802.15.4 specific packet attributes which will be introduced in a later commit of this change set. Fixes: #51264 Signed-off-by: Florian Grandel <[email protected]>
1 parent f1e9dd2 commit 93647ed

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/ieee802154/ieee802154_nrf5.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,14 @@ static bool nrf5_tx_immediate(struct net_pkt *pkt, uint8_t *payload, bool cca)
442442
{
443443
nrf_802154_transmit_metadata_t metadata = {
444444
.frame_props = {
445-
.is_secured = pkt->ieee802154_frame_secured,
446-
.dynamic_data_is_set = pkt->ieee802154_mac_hdr_rdy,
445+
.is_secured = net_pkt_ieee802154_frame_secured(pkt),
446+
.dynamic_data_is_set = net_pkt_ieee802154_mac_hdr_rdy(pkt),
447447
},
448448
.cca = cca,
449449
.tx_power = {
450450
.use_metadata_value = IS_ENABLED(CONFIG_IEEE802154_SELECTIVE_TXPOWER),
451451
#if defined(CONFIG_IEEE802154_SELECTIVE_TXPOWER)
452-
.power = pkt->ieee802154_txpwr,
452+
.power = net_pkt_ieee802154_txpwr(pkt),
453453
#endif
454454
},
455455
};
@@ -462,13 +462,13 @@ static bool nrf5_tx_csma_ca(struct net_pkt *pkt, uint8_t *payload)
462462
{
463463
nrf_802154_transmit_csma_ca_metadata_t metadata = {
464464
.frame_props = {
465-
.is_secured = pkt->ieee802154_frame_secured,
466-
.dynamic_data_is_set = pkt->ieee802154_mac_hdr_rdy,
465+
.is_secured = net_pkt_ieee802154_frame_secured(pkt),
466+
.dynamic_data_is_set = net_pkt_ieee802154_mac_hdr_rdy(pkt),
467467
},
468468
.tx_power = {
469469
.use_metadata_value = IS_ENABLED(CONFIG_IEEE802154_SELECTIVE_TXPOWER),
470470
#if defined(CONFIG_IEEE802154_SELECTIVE_TXPOWER)
471-
.power = pkt->ieee802154_txpwr,
471+
.power = net_pkt_ieee802154_txpwr(pkt),
472472
#endif
473473
},
474474
};
@@ -549,15 +549,15 @@ static bool nrf5_tx_at(struct net_pkt *pkt, uint8_t *payload, bool cca)
549549
{
550550
nrf_802154_transmit_at_metadata_t metadata = {
551551
.frame_props = {
552-
.is_secured = pkt->ieee802154_frame_secured,
553-
.dynamic_data_is_set = pkt->ieee802154_mac_hdr_rdy,
552+
.is_secured = net_pkt_ieee802154_frame_secured(pkt),
553+
.dynamic_data_is_set = net_pkt_ieee802154_mac_hdr_rdy(pkt),
554554
},
555555
.cca = cca,
556556
.channel = nrf_802154_channel_get(),
557557
.tx_power = {
558558
.use_metadata_value = IS_ENABLED(CONFIG_IEEE802154_SELECTIVE_TXPOWER),
559559
#if defined(CONFIG_IEEE802154_SELECTIVE_TXPOWER)
560-
.power = pkt->ieee802154_txpwr,
560+
.power = net_pkt_ieee802154_txpwr(pkt),
561561
#endif
562562
},
563563
};

0 commit comments

Comments
 (0)