drivers: ieee802154: cc13xx_cc26xx_subg: check radio op status

Not only the return code of TI's RF command queueing mechanism but also
the command status need to be checked to assert that a command was
executed successfully. This change introduces additional checking of the
command status.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This commit is contained in:
Florian Grandel 2023-09-07 13:54:42 +02:00 committed by Johan Hedberg
parent f2979edd5c
commit 4b0e730fb1

View file

@ -598,7 +598,7 @@ static int ieee802154_cc13xx_cc26xx_subg_set_channel(
drv_data->cmd_fs.fractFreq = fract; drv_data->cmd_fs.fractFreq = fract;
events = RF_runCmd(drv_data->rf_handle, (RF_Op *)&drv_data->cmd_fs, events = RF_runCmd(drv_data->rf_handle, (RF_Op *)&drv_data->cmd_fs,
RF_PriorityNormal, NULL, 0); RF_PriorityNormal, NULL, 0);
if (events != RF_EventLastCmdDone) { if (events != RF_EventLastCmdDone || drv_data->cmd_fs.status != DONE_OK) {
LOG_DBG("Failed to set frequency: 0x%" PRIx64, events); LOG_DBG("Failed to set frequency: 0x%" PRIx64, events);
ret = -EIO; ret = -EIO;
} }
@ -954,7 +954,7 @@ static int ieee802154_cc13xx_cc26xx_subg_init(const struct device *dev)
drv_data->cmd_fs.fractFreq = fract; drv_data->cmd_fs.fractFreq = fract;
events = RF_runCmd(drv_data->rf_handle, (RF_Op *)&drv_data->cmd_fs, events = RF_runCmd(drv_data->rf_handle, (RF_Op *)&drv_data->cmd_fs,
RF_PriorityNormal, NULL, 0); RF_PriorityNormal, NULL, 0);
if (events != RF_EventLastCmdDone) { if (events != RF_EventLastCmdDone || drv_data->cmd_fs.status != DONE_OK) {
LOG_ERR("Failed to set frequency: 0x%" PRIx64, events); LOG_ERR("Failed to set frequency: 0x%" PRIx64, events);
return -EIO; return -EIO;
} }