summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-06 18:13:35 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-06 18:13:35 +0300
commitd230ec72c4efed7d0f414a80a756c54d4c422a6e (patch)
treed437aaad8dfb78dc6926a704b96f09fed6a874e8 /drivers
parentf84d9fa86820b3074a8c143444a6932c0c0fd019 (diff)
parentaf70c1f92d3567035d2f73f39079459d58c706dc (diff)
downloadlinux-d230ec72c4efed7d0f414a80a756c54d4c422a6e.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixups from David Miller: "Here are the build and merge fixups for the networking stuff" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: phy: micrel.c: Enable ksz9031 energy-detect power-down mode netfilter: merge fixup for "nf_tables_netdev: remove redundant ip_hdr assignment" netfilter: nft_limit: fix divided by zero panic netfilter: fix namespace handling in nf_log_proc_dostring netfilter: xt_hashlimit: Fix link error in 32bit arch because of 64bit division netfilter: accommodate different kconfig in nf_set_hooks_head netfilter: Fix potential null pointer dereference
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/micrel.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 885ac9cbab5a..081df68d2ce1 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -439,6 +439,10 @@ static int ksz9021_config_init(struct phy_device *phydev)
#define MII_KSZ9031RN_TX_DATA_PAD_SKEW 6
#define MII_KSZ9031RN_CLK_PAD_SKEW 8
+/* MMD Address 0x1C */
+#define MII_KSZ9031RN_EDPD 0x23
+#define MII_KSZ9031RN_EDPD_ENABLE BIT(0)
+
static int ksz9031_extended_write(struct phy_device *phydev,
u8 mode, u32 dev_addr, u32 regnum, u16 val)
{
@@ -510,6 +514,18 @@ static int ksz9031_center_flp_timing(struct phy_device *phydev)
return genphy_restart_aneg(phydev);
}
+/* Enable energy-detect power-down mode */
+static int ksz9031_enable_edpd(struct phy_device *phydev)
+{
+ int reg;
+
+ reg = ksz9031_extended_read(phydev, OP_DATA, 0x1C, MII_KSZ9031RN_EDPD);
+ if (reg < 0)
+ return reg;
+ return ksz9031_extended_write(phydev, OP_DATA, 0x1C, MII_KSZ9031RN_EDPD,
+ reg | MII_KSZ9031RN_EDPD_ENABLE);
+}
+
static int ksz9031_config_init(struct phy_device *phydev)
{
const struct device *dev = &phydev->mdio.dev;
@@ -525,6 +541,11 @@ static int ksz9031_config_init(struct phy_device *phydev)
};
static const char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"};
const struct device *dev_walker;
+ int result;
+
+ result = ksz9031_enable_edpd(phydev);
+ if (result < 0)
+ return result;
/* The Micrel driver has a deprecated option to place phy OF
* properties in the MAC node. Walk up the tree of devices to