提交 d981b5b5 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

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: NAlexander Aring <aar@pengutronix.de>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 c231c5a4
...@@ -902,14 +902,12 @@ at86rf230_xmit_start(void *context) ...@@ -902,14 +902,12 @@ at86rf230_xmit_start(void *context)
struct at86rf230_local *lp = ctx->lp; struct at86rf230_local *lp = ctx->lp;
/* check if we change from off state */ /* check if we change from off state */
if (lp->is_tx_from_off) { if (lp->is_tx_from_off)
lp->is_tx_from_off = false;
at86rf230_async_state_change(lp, ctx, STATE_TX_ARET_ON, at86rf230_async_state_change(lp, ctx, STATE_TX_ARET_ON,
at86rf230_write_frame); at86rf230_write_frame);
} else { else
at86rf230_async_state_change(lp, ctx, STATE_TX_ON, at86rf230_async_state_change(lp, ctx, STATE_TX_ON,
at86rf230_xmit_tx_on); at86rf230_xmit_tx_on);
}
} }
static int static int
...@@ -933,6 +931,7 @@ at86rf230_xmit(struct ieee802154_hw *hw, struct sk_buff *skb) ...@@ -933,6 +931,7 @@ at86rf230_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
at86rf230_async_state_change(lp, ctx, STATE_TRX_OFF, at86rf230_async_state_change(lp, ctx, STATE_TRX_OFF,
at86rf230_xmit_start); at86rf230_xmit_start);
} else { } else {
lp->is_tx_from_off = false;
at86rf230_xmit_start(ctx); at86rf230_xmit_start(ctx);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册