diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2013-12-07 00:53:55 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-10 02:59:25 +0100 |
commit | 5824d2d16d39a9c57aa3bacf955fbd0c2134061f (patch) | |
tree | 0138f904b7d3f7c93cfbdab929d9d7605a80e3a4 /drivers/net/ethernet/broadcom/bgmac.h | |
parent | etherdevice: Optimize a few is_<foo>_ether_addr functions (diff) | |
download | linux-5824d2d16d39a9c57aa3bacf955fbd0c2134061f.tar.xz linux-5824d2d16d39a9c57aa3bacf955fbd0c2134061f.zip |
bgmac: connect to PHY and make use of PHY device
We were already registering MDIO bus, but we were not connecting bgmac
to the PHY. Add proper call and implement adjust link function to switch
MAC into requested state.
At the same time it's possible to drop our internal PHY management.
This is a "standard" PHY, so the "Generic PHY" driver works perfectly
fine with this. Don't duplicate the code.
Finally make use of phy_ethtool_[gs]set functions instead implementing
them from scratch.
This change was successfully tested on BCM5357. I was able to
autonegotiate 1000Mb/s full duplex, as well as force any of the
10/100/1000 half/full modes.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bgmac.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bgmac.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/ethernet/broadcom/bgmac.h b/drivers/net/ethernet/broadcom/bgmac.h index 66c8afbdc8c7..550f2a8e85a9 100644 --- a/drivers/net/ethernet/broadcom/bgmac.h +++ b/drivers/net/ethernet/broadcom/bgmac.h @@ -342,10 +342,6 @@ #define BGMAC_CHIPCTL_1_SW_TYPE_RGMII 0x000000C0 #define BGMAC_CHIPCTL_1_RXC_DLL_BYPASS 0x00010000 -#define BGMAC_SPEED_10 0x0001 -#define BGMAC_SPEED_100 0x0002 -#define BGMAC_SPEED_1000 0x0004 - #define BGMAC_WEIGHT 64 #define ETHER_MAX_LEN 1518 @@ -402,6 +398,7 @@ struct bgmac { struct net_device *net_dev; struct napi_struct napi; struct mii_bus *mii_bus; + struct phy_device *phy_dev; /* DMA */ struct bgmac_dma_ring tx_ring[BGMAC_MAX_TX_RINGS]; @@ -416,10 +413,9 @@ struct bgmac { u32 int_mask; u32 int_status; - /* Speed-related */ - int speed; - bool autoneg; - bool full_duplex; + /* Current MAC state */ + int mac_speed; + int mac_duplex; u8 phyaddr; bool has_robosw; |