From: Stefan Assmann <sassmann@kpanic.de>
To: mcgrof@kernel.org
Cc: backports@vger.kernel.org, hauke@hauke-m.de, sassmann@kpanic.de
Subject: [PATCH v3 05/11] backports: igb fixes for linux-3.6
Date: Wed, 8 Jan 2014 11:44:08 +0100 [thread overview]
Message-ID: <1389177854-24292-6-git-send-email-sassmann@kpanic.de> (raw)
In-Reply-To: <1389177854-24292-1-git-send-email-sassmann@kpanic.de>
- backport ethtool_cmd
- backport ethtool_ops
- backport mmd_eee_adv_to_ethtool_adv_t
- add define to map ptp_clock_register() to old version
- add patches/collateral-evolutions/network/82-ethernet/0004-igb_err_handler.patch
- add patches/collateral-evolutions/network/82-ethernet/0005-igb_mdi.patch
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
---
backport/backport-include/linux/mdio.h | 35 ++++++++++++++++
backport/backport-include/linux/ptp_clock_kernel.h | 9 ++++
.../network/82-ethernet/0004-igb_err_handler.patch | 16 +++++++
.../network/82-ethernet/0005-igb_mdi.patch | 49 ++++++++++++++++++++++
4 files changed, 109 insertions(+)
create mode 100644 backport/backport-include/linux/mdio.h
create mode 100644 backport/backport-include/linux/ptp_clock_kernel.h
create mode 100644 patches/collateral-evolutions/network/82-ethernet/0004-igb_err_handler.patch
create mode 100644 patches/collateral-evolutions/network/82-ethernet/0005-igb_mdi.patch
diff --git a/backport/backport-include/linux/mdio.h b/backport/backport-include/linux/mdio.h
new file mode 100644
index 0000000..2a38121
--- /dev/null
+++ b/backport/backport-include/linux/mdio.h
@@ -0,0 +1,35 @@
+#ifndef __BACKPORT_LINUX_MDIO_H
+#define __BACKPORT_LINUX_MDIO_H
+#include_next <linux/mdio.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+/**
+ * mmd_eee_adv_to_ethtool_adv_t
+ * @eee_adv: value of the MMD EEE Advertisement/Link Partner Ability registers
+ *
+ * A small helper function that translates the MMD EEE Advertisment (7.60)
+ * and MMD EEE Link Partner Ability (7.61) bits to ethtool advertisement
+ * settings.
+ */
+static inline u32 mmd_eee_adv_to_ethtool_adv_t(u16 eee_adv)
+{
+ u32 adv = 0;
+
+ if (eee_adv & MDIO_EEE_100TX)
+ adv |= ADVERTISED_100baseT_Full;
+ if (eee_adv & MDIO_EEE_1000T)
+ adv |= ADVERTISED_1000baseT_Full;
+ if (eee_adv & MDIO_EEE_10GT)
+ adv |= ADVERTISED_10000baseT_Full;
+ if (eee_adv & MDIO_EEE_1000KX)
+ adv |= ADVERTISED_1000baseKX_Full;
+ if (eee_adv & MDIO_EEE_10GKX4)
+ adv |= ADVERTISED_10000baseKX4_Full;
+ if (eee_adv & MDIO_EEE_10GKR)
+ adv |= ADVERTISED_10000baseKR_Full;
+
+ return adv;
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
+
+#endif /* __BACKPORT_LINUX_MDIO_H */
diff --git a/backport/backport-include/linux/ptp_clock_kernel.h b/backport/backport-include/linux/ptp_clock_kernel.h
new file mode 100644
index 0000000..f64e705
--- /dev/null
+++ b/backport/backport-include/linux/ptp_clock_kernel.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_PTP_CLOCK_KERNEL_H
+#define __BACKPORT_PTP_CLOCK_KERNEL_H
+#include_next <linux/ptp_clock_kernel.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) && LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+#define ptp_clock_register(info,parent) ptp_clock_register(info)
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) && LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
+
+#endif /* __BACKPORT_PTP_CLOCK_KERNEL_H */
diff --git a/patches/collateral-evolutions/network/82-ethernet/0004-igb_err_handler.patch b/patches/collateral-evolutions/network/82-ethernet/0004-igb_err_handler.patch
new file mode 100644
index 0000000..393e8b5
--- /dev/null
+++ b/patches/collateral-evolutions/network/82-ethernet/0004-igb_err_handler.patch
@@ -0,0 +1,16 @@
+diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
+index 67441f2..4df7bce 100644
+--- a/drivers/net/ethernet/intel/igb/igb_main.c
++++ b/drivers/net/ethernet/intel/igb/igb_main.c
+@@ -232,7 +232,11 @@ static pci_ers_result_t igb_io_error_detected(struct pci_dev *,
+ static pci_ers_result_t igb_io_slot_reset(struct pci_dev *);
+ static void igb_io_resume(struct pci_dev *);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+ static const struct pci_error_handlers igb_err_handler = {
++#else
++static struct pci_error_handlers igb_err_handler = {
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
+ .error_detected = igb_io_error_detected,
+ .slot_reset = igb_io_slot_reset,
+ .resume = igb_io_resume,
diff --git a/patches/collateral-evolutions/network/82-ethernet/0005-igb_mdi.patch b/patches/collateral-evolutions/network/82-ethernet/0005-igb_mdi.patch
new file mode 100644
index 0000000..7b381c9
--- /dev/null
+++ b/patches/collateral-evolutions/network/82-ethernet/0005-igb_mdi.patch
@@ -0,0 +1,49 @@
+diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
+index c3143da..05fd6f8 100644
+--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
++++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
+@@ -249,10 +249,12 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+ else
+ ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+ if (hw->phy.mdix == AUTO_ALL_MODES)
+ ecmd->eth_tp_mdix_ctrl = ETH_TP_MDI_AUTO;
+ else
+ ecmd->eth_tp_mdix_ctrl = hw->phy.mdix;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
+
+ return 0;
+ }
+@@ -271,6 +273,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+ return -EINVAL;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+ /* MDI setting is only allowed when autoneg enabled because
+ * some hardware doesn't allow MDI setting when speed or
+ * duplex is forced.
+@@ -285,6 +288,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+ return -EINVAL;
+ }
+ }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
+
+ while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
+ msleep(1);
+@@ -328,6 +332,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+ }
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+ /* MDI-X => 2; MDI => 1; Auto => 3 */
+ if (ecmd->eth_tp_mdix_ctrl) {
+ /* fix up the value for auto (3 => 0) as zero is mapped
+@@ -338,6 +343,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+ else
+ hw->phy.mdix = ecmd->eth_tp_mdix_ctrl;
+ }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
+
+ /* reset the link */
+ if (netif_running(adapter->netdev)) {
--
1.8.4.2
next prev parent reply other threads:[~2014-01-08 10:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 10:44 [PATCH v3 00/11] backports: add igb driver Stefan Assmann
2014-01-08 10:44 ` [PATCH v3 01/11] backports: igb fixes for linux-3.12 Stefan Assmann
2014-01-09 20:55 ` Hauke Mehrtens
2014-01-08 10:44 ` [PATCH v3 02/11] backports: igb fixes for linux-3.9 Stefan Assmann
2014-01-09 21:01 ` Hauke Mehrtens
2014-01-08 10:44 ` [PATCH v3 03/11] backports: igb fixes for linux-3.8 Stefan Assmann
2014-01-08 10:44 ` [PATCH v3 04/11] backports: igb fixes for linux-3.7 Stefan Assmann
2014-01-09 21:13 ` Hauke Mehrtens
2014-01-13 7:40 ` Stefan Assmann
2014-01-08 10:44 ` Stefan Assmann [this message]
2014-01-08 10:44 ` [PATCH v3 06/11] backports: igb fixes for linux-3.5 Stefan Assmann
2014-01-08 10:44 ` [PATCH v3 07/11] backports: igb fixes for linux-3.4 Stefan Assmann
2014-01-08 10:44 ` [PATCH v3 08/11] backports: igb fixes for linux-3.3 Stefan Assmann
2014-01-08 10:44 ` [PATCH v3 09/11] backports: igb fixes for linux-3.2 Stefan Assmann
2014-01-08 10:44 ` [PATCH v3 10/11] backports: igb fixes for linux-3.1 Stefan Assmann
2014-01-08 10:44 ` [PATCH v3 11/11] backports: enable igb and add defconfig Stefan Assmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389177854-24292-6-git-send-email-sassmann@kpanic.de \
--to=sassmann@kpanic.de \
--cc=backports@vger.kernel.org \
--cc=hauke@hauke-m.de \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.