Changeset 38199


Ignore:
Timestamp:
2013-09-25T23:47:25+02:00 (4 years ago)
Author:
hauke
Message:

bcm53xx: update bgmac driver

Update the bgmac driver with the patches already used for bcm47xx target.

Signed-off-by: Hauke Mehrtens <hauke@…>

Location:
trunk/target/linux/bcm53xx/patches-3.10
Files:
4 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/bcm53xx/patches-3.10/203-bgmac-register-phy.patch

    r37586 r38199  
    1 bgmac: register phy 
    2  
    3 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> 
    4 --- 
    5  drivers/net/ethernet/broadcom/bgmac.c |  137 ++++++++++++++++----------------- 
    6  drivers/net/ethernet/broadcom/bgmac.h |    3 + 
    7  2 files changed, 71 insertions(+), 69 deletions(-) 
    8  
     1--- a/drivers/net/ethernet/broadcom/Kconfig 
     2+++ b/drivers/net/ethernet/broadcom/Kconfig 
     3@@ -133,6 +133,7 @@ config BNX2X_SRIOV 
     4 config BGMAC 
     5        tristate "BCMA bus GBit core support" 
     6        depends on BCMA_HOST_SOC && HAS_DMA 
     7+       select PHYLIB 
     8        ---help--- 
     9          This driver supports GBit MAC and BCM4706 GBit MAC cores on BCMA bus. 
     10          They can be found on BCM47xx SoCs and provide gigabit ethernet. 
    911--- a/drivers/net/ethernet/broadcom/bgmac.c 
    1012+++ b/drivers/net/ethernet/broadcom/bgmac.c 
     
    3436-               return -EOPNOTSUPP; 
    3537-       } 
    36 +       if (!netif_running(net_dev)) 
    37 +               return -EINVAL; 
     38+       if (!netif_running(net_dev)) 
     39+               return -EINVAL; 
    3840+ 
    3941+       if (!bgmac->phydev) 
     
    4446  
    4547 static const struct net_device_ops bgmac_netdev_ops = { 
    46 @@ -1247,61 +1234,18 @@ static int bgmac_get_settings(struct net 
     48@@ -1247,61 +1234,16 @@ static int bgmac_get_settings(struct net 
    4749 { 
    4850        struct bgmac *bgmac = netdev_priv(net_dev); 
     
    9698  
    9799-#if 0 
    98 + 
    99100 static int bgmac_set_settings(struct net_device *net_dev, 
    100101                              struct ethtool_cmd *cmd) 
     
    106107 } 
    107108-#endif 
    108 + 
    109109  
    110110 static void bgmac_get_drvinfo(struct net_device *net_dev, 
    111111                              struct ethtool_drvinfo *info) 
    112 @@ -1312,6 +1256,7 @@ static void bgmac_get_drvinfo(struct net 
     112@@ -1312,6 +1254,7 @@ static void bgmac_get_drvinfo(struct net 
    113113  
    114114 static const struct ethtool_ops bgmac_ethtool_ops = { 
     
    118118 }; 
    119119  
    120 @@ -1330,10 +1275,42 @@ static int bgmac_mii_write(struct mii_bu 
     120@@ -1330,10 +1273,36 @@ static int bgmac_mii_write(struct mii_bu 
    121121        return bgmac_phy_write(bus->priv, mii_id, regnum, value); 
    122122 } 
     
    126126+       struct bgmac *bgmac = netdev_priv(dev); 
    127127+       struct phy_device *phydev = bgmac->phydev; 
    128 +       int status_changed = 0; 
     128+       bool status_changed = 0; 
    129129+ 
    130130+       BUG_ON(!phydev); 
     
    141141+       } 
    142142+ 
    143 +       if (status_changed) { 
    144 +               pr_info("%s: link %s", dev->name, phydev->link ? 
    145 +                       "UP" : "DOWN"); 
    146 +               if (phydev->link) 
    147 +                       pr_cont(" - %d/%s", phydev->speed, 
    148 +                       phydev->duplex == DUPLEX_FULL ? "full" : "half"); 
    149 +               pr_cont("\n"); 
    150 +       } 
     143+       if (status_changed) 
     144+               phy_print_status(phydev); 
    151145+} 
    152146+ 
     
    161155        mii_bus = mdiobus_alloc(); 
    162156        if (!mii_bus) 
    163 @@ -1364,7 +1341,29 @@ static int bgmac_mii_register(struct bgm 
     157@@ -1364,7 +1333,28 @@ static int bgmac_mii_register(struct bgm 
    164158  
    165159        bgmac->mii_bus = mii_bus; 
     
    174168+ 
    175169+       if (IS_ERR(phydev)) { 
    176 +               netdev_err(net_dev, "could not attach PHY: %s", phy_id); 
     170+               netdev_err(net_dev, "could not attach PHY: %s\n", phy_id); 
    177171+               bgmac->phyaddr = BGMAC_PHY_NOREGS; 
    178172+               return PTR_ERR(phydev); 
     
    184178+       bgmac->phyaddr = phydev->addr; 
    185179+ 
    186 +       netdev_info(net_dev, "attached PHY driver [%s] " 
    187 +               "(mii_bus:phy_addr=%s)\n", 
    188 +               phydev->drv->name, dev_name(&phydev->dev)); 
     180+       netdev_info(net_dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s)\n", 
     181+                   phydev->drv->name, dev_name(&phydev->dev)); 
    189182+ 
    190183+       return 0; 
Note: See TracChangeset for help on using the changeset viewer.