summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Aring <aar@pengutronix.de>2016-02-19 09:59:13 +0100
committerMarcel Holtmann <marcel@holtmann.org>2016-02-23 20:29:39 +0100
commitd981b5b5fe8ed0c237b2925ab37a17d28405494f (patch)
treecdafe6ee43066f4ac5f336c54b65d12a189d60f7
parentc231c5a47a0c697e7bc821af0b5cb28d129fe8e0 (diff)
downloadlinux-d981b5b5fe8ed0c237b2925ab37a17d28405494f.tar.bz2
at86rf230: fix state change handling on error
This patch force always to set "is_tx_from_off", when calibration timeout was not occurred. In case of error handling the is_tx_from_off can be inside in an invalid state. Signed-off-by: Alexander Aring <aar@pengutronix.de> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--drivers/net/ieee802154/at86rf230.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index bf3cfe44b84f..cb9e9fe6d77a 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -902,14 +902,12 @@ at86rf230_xmit_start(void *context)
struct at86rf230_local *lp = ctx->lp;
/* check if we change from off state */
- if (lp->is_tx_from_off) {
- lp->is_tx_from_off = false;
+ if (lp->is_tx_from_off)
at86rf230_async_state_change(lp, ctx, STATE_TX_ARET_ON,
at86rf230_write_frame);
- } else {
+ else
at86rf230_async_state_change(lp, ctx, STATE_TX_ON,
at86rf230_xmit_tx_on);
- }
}
static int
@@ -933,6 +931,7 @@ at86rf230_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
at86rf230_async_state_change(lp, ctx, STATE_TRX_OFF,
at86rf230_xmit_start);
} else {
+ lp->is_tx_from_off = false;
at86rf230_xmit_start(ctx);
}