drivers: ieee802154: cc13xx_cc26xx: Fixup a bus error

Sometime, the radio causes a bus error.
This happens because we cast a struct and access to a member
that doesn't exists in the original struct.
This updates the driver to use the right struct to make the cast safe.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
This commit is contained in:
Alexandre Bailon 2024-04-29 12:31:30 +02:00 committed by Henrik Brix Andersen
parent c75186f5ca
commit f44072c299
2 changed files with 14 additions and 0 deletions

View file

@ -777,7 +777,13 @@ static struct ieee802154_cc13xx_cc26xx_data ieee802154_cc13xx_cc26xx_data = {
},
.cmd_radio_setup = {
#if defined(CONFIG_SOC_CC1352R) || defined(CONFIG_SOC_CC2652R) || \
defined(CONFIG_SOC_CC1352R7) || defined(CONFIG_SOC_CC2652R7)
.commandNo = CMD_RADIO_SETUP,
#elif defined(CONFIG_SOC_CC1352P) || defined(CONFIG_SOC_CC2652P) || \
defined(CONFIG_SOC_CC1352P7) || defined(CONFIG_SOC_CC2652P7)
.commandNo = CMD_RADIO_SETUP_PA,
#endif /* CONFIG_SOC_CCxx52x */
.status = IDLE,
.pNextOp = NULL,
.startTrigger.triggerType = TRIG_NOW,

View file

@ -80,7 +80,15 @@ struct ieee802154_cc13xx_cc26xx_data {
volatile rfc_CMD_IEEE_CSMA_t cmd_ieee_csma;
volatile rfc_CMD_IEEE_TX_t cmd_ieee_tx;
volatile rfc_CMD_IEEE_RX_ACK_t cmd_ieee_rx_ack;
#if defined(CONFIG_SOC_CC1352R) || defined(CONFIG_SOC_CC2652R) || \
defined(CONFIG_SOC_CC1352R7) || defined(CONFIG_SOC_CC2652R7)
volatile rfc_CMD_RADIO_SETUP_t cmd_radio_setup;
#elif defined(CONFIG_SOC_CC1352P) || defined(CONFIG_SOC_CC2652P) || \
defined(CONFIG_SOC_CC1352P7) || defined(CONFIG_SOC_CC2652P7)
volatile rfc_CMD_RADIO_SETUP_PA_t cmd_radio_setup;
#else
BUILD_ASSERT(false, "unknown model");
#endif /* CONFIG_SOC_CCxx52x */
volatile int16_t saved_cmdhandle;
};