This is an alternative to my previous patch for the non-receiving RF212
problem. Apparently not all state changes to RX_ON must come from
TRX_OFF, but only the *first* such change. This can either be done in
_start with another per-dev variable or in _hw_init by switching to
TRX_OFF unconditionally. The next RX_ON/TX_ON state switch will
correctly execute and leave the transceiver in TX_ON after completion,
from which we can then go on to further TRX states.

Signed-off-by: Phoebe Buckheister <phoebe.buckheis...@itwm.fraunhofer.de>
---
 drivers/net/ieee802154/at86rf230.c |   24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ieee802154/at86rf230.c 
b/drivers/net/ieee802154/at86rf230.c
index d88c586..68d3d9c 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -931,17 +931,9 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
        if (rc)
                return rc;
 
-       dev_info(&lp->spi->dev, "Status: %02x\n", status);
-       if (status == STATE_P_ON) {
-               rc = at86rf230_write_subreg(lp, SR_TRX_CMD, 
STATE_FORCE_TRX_OFF);
-               if (rc)
-                       return rc;
-               msleep(1);
-               rc = at86rf230_read_subreg(lp, SR_TRX_STATUS, &status);
-               if (rc)
-                       return rc;
-               dev_info(&lp->spi->dev, "Status: %02x\n", status);
-       }
+       rc = at86rf230_write_subreg(lp, SR_TRX_CMD, STATE_FORCE_TRX_OFF);
+       if (rc)
+               return rc;
 
        /* configure irq polarity, defaults to high active */
        if (pdata->irq_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW))
@@ -969,16 +961,6 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
        /* Wait the next SLEEP cycle */
        msleep(100);
 
-       rc = at86rf230_write_subreg(lp, SR_TRX_CMD, STATE_TX_ON);
-       if (rc)
-               return rc;
-       msleep(1);
-
-       rc = at86rf230_read_subreg(lp, SR_TRX_STATUS, &status);
-       if (rc)
-               return rc;
-       dev_info(&lp->spi->dev, "Status: %02x\n", status);
-
        rc = at86rf230_read_subreg(lp, SR_DVDD_OK, &status);
        if (rc)
                return rc;
-- 
1.7.9.5


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to