OSDN Git Service

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[uclinux-h8/linux.git] / drivers / net / ieee802154 / at86rf230.c
index 0fbbba7..cb9e9fe 100644 (file)
@@ -343,16 +343,26 @@ static const struct regmap_config at86rf230_regmap_spi_config = {
 };
 
 static void
-at86rf230_async_error_recover(void *context)
+at86rf230_async_error_recover_complete(void *context)
 {
        struct at86rf230_state_change *ctx = context;
        struct at86rf230_local *lp = ctx->lp;
 
-       lp->is_tx = 0;
-       at86rf230_async_state_change(lp, ctx, STATE_RX_AACK_ON, NULL);
-       ieee802154_wake_queue(lp->hw);
        if (ctx->free)
                kfree(ctx);
+
+       ieee802154_wake_queue(lp->hw);
+}
+
+static void
+at86rf230_async_error_recover(void *context)
+{
+       struct at86rf230_state_change *ctx = context;
+       struct at86rf230_local *lp = ctx->lp;
+
+       lp->is_tx = 0;
+       at86rf230_async_state_change(lp, ctx, STATE_RX_AACK_ON,
+                                    at86rf230_async_error_recover_complete);
 }
 
 static inline void
@@ -892,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
@@ -923,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);
        }