diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-02-06 11:46:48 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-02-16 17:17:15 +0100 |
commit | 2bf9ea6a31736db059aa97addce3a34b933dacc1 (patch) | |
tree | ecfe628aabaf38e6bd40ca841443d19079105a83 /target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch | |
parent | 237454991618e0e8b7ceb8a8a2a43fca12c1a454 (diff) | |
download | upstream-2bf9ea6a31736db059aa97addce3a34b933dacc1.tar.gz upstream-2bf9ea6a31736db059aa97addce3a34b933dacc1.tar.bz2 upstream-2bf9ea6a31736db059aa97addce3a34b933dacc1.zip |
mvebu: add linux 4.9 support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch')
-rw-r--r-- | target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch b/target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch new file mode 100644 index 0000000000..9f049aaa44 --- /dev/null +++ b/target/linux/mvebu/patches-4.9/431-sfp-phylink-hook-up-eeprom-functions.patch @@ -0,0 +1,65 @@ +From: Russell King <rmk+kernel@arm.linux.org.uk> +Date: Thu, 8 Oct 2015 23:49:47 +0100 +Subject: [PATCH] sfp/phylink: hook up eeprom functions + +Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> +--- + +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -985,11 +985,9 @@ static void sfp_sm_event(struct sfp *sfp + mutex_unlock(&sfp->sm_mutex); + } + +-#if 0 +-static int sfp_phy_module_info(struct phy_device *phy, +- struct ethtool_modinfo *modinfo) ++static int sfp_module_info(void *priv, struct ethtool_modinfo *modinfo) + { +- struct sfp *sfp = phy->priv; ++ struct sfp *sfp = priv; + + /* locking... and check module is present */ + +@@ -1003,10 +1001,9 @@ static int sfp_phy_module_info(struct ph + return 0; + } + +-static int sfp_phy_module_eeprom(struct phy_device *phy, +- struct ethtool_eeprom *ee, u8 *data) ++static int sfp_module_eeprom(void *priv, struct ethtool_eeprom *ee, u8 *data) + { +- struct sfp *sfp = phy->priv; ++ struct sfp *sfp = priv; + unsigned int first, last, len; + int ret; + +@@ -1037,7 +1034,11 @@ static int sfp_phy_module_eeprom(struct + } + return 0; + } +-#endif ++ ++static const struct phylink_module_ops sfp_module_ops = { ++ .get_module_info = sfp_module_info, ++ .get_module_eeprom = sfp_module_eeprom, ++}; + + static void sfp_timeout(struct work_struct *work) + { +@@ -1113,6 +1114,7 @@ static int sfp_netdev_notify(struct noti + case NETDEV_UNREGISTER: + if (sfp->mod_phy && sfp->phylink) + phylink_disconnect_phy(sfp->phylink); ++ phylink_unregister_module(sfp->phylink, sfp); + sfp->phylink = NULL; + dev_put(sfp->ndev); + sfp->ndev = NULL; +@@ -1230,6 +1232,7 @@ static int sfp_probe(struct platform_dev + } + + phylink_disable(sfp->phylink); ++ phylink_register_module(sfp->phylink, sfp, &sfp_module_ops); + } + + sfp->state = sfp_get_state(sfp); |