brcm47xx: b44: fix error handling for dummy phy creation
[openwrt.git] / target / linux / brcm47xx / patches-3.10 / 206-b44-activate-PHY-when-MAC-is-off.patch
1 From f6a8d917c3efcfb974097ef4b345e8cda5283bab Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 6 Oct 2013 17:58:24 +0200
4 Subject: [PATCH 7/9] b44: activate PHY when MAC is off
5
6 Without this patch we can not access the PHY when the MAC is switched
7 off. This PHY access is needed to configure the switch, which is done
8 through PHY registers.
9
10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 ---
12  drivers/net/ethernet/broadcom/b44.c |    5 ++++-
13  1 file changed, 4 insertions(+), 1 deletion(-)
14
15 --- a/drivers/net/ethernet/broadcom/b44.c
16 +++ b/drivers/net/ethernet/broadcom/b44.c
17 @@ -1358,7 +1358,10 @@ static void b44_halt(struct b44 *bp)
18         bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN);
19         /* now reset the chip, but without enabling the MAC&PHY
20          * part of it. This has to be done _after_ we shut down the PHY */
21 -       b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
22 +       if (bp->flags & B44_FLAG_EXTERNAL_PHY)
23 +               b44_chip_reset(bp, B44_CHIP_RESET_FULL);
24 +       else
25 +               b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
26  }
27  
28  /* bp->lock is held. */