net: ieee802154: adf7242: Fix erroneous RX enable
authorMichael Hennerich <michael.hennerich@analog.com>
Mon, 25 Jun 2018 13:49:51 +0000 (16:49 +0300)
committerStefan Schmidt <stefan@datenfreihafen.org>
Mon, 9 Jul 2018 08:53:11 +0000 (10:53 +0200)
Only enable RX mode if the netdev is opened.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
drivers/net/ieee802154/adf7242.c

index 64f1b1e..c3da431 100644 (file)
@@ -719,7 +719,10 @@ static int adf7242_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
        adf7242_write_reg(lp, REG_CH_FREQ1, freq >> 8);
        adf7242_write_reg(lp, REG_CH_FREQ2, freq >> 16);
 
-       return adf7242_cmd(lp, CMD_RC_RX);
+       if (test_bit(FLAG_START, &lp->flags))
+               return adf7242_cmd_rx(lp);
+       else
+               return adf7242_cmd(lp, CMD_RC_PHY_RDY);
 }
 
 static int adf7242_set_hw_addr_filt(struct ieee802154_hw *hw,