summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2013-04-02 22:13:40 +0200
committerJohannes Berg <johannes@sipsolutions.net>2013-04-02 22:13:40 +0200
commit2b709151ada49c7bd74285f0bdbaef671276a2d5 (patch)
treed149dc5eac715a58b9f7382a46ed26c4b8d982dd /patches
parent8b67dc814dc740f45891c92c49473a05d914ea71 (diff)
add the ability to include ALX
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'patches')
-rw-r--r--patches/unified-drivers/network/0001-backport-alx/alx.patch123
-rw-r--r--patches/unified-drivers/network/0002-alx-make-kconfig/alx.patch32
-rw-r--r--patches/unified-drivers/network/0003-alx-deactivate-loopback-test/alx.patch25
-rw-r--r--patches/unified-drivers/network/0004-alx-intx-msi-workaround/alx.patch12
4 files changed, 192 insertions, 0 deletions
diff --git a/patches/unified-drivers/network/0001-backport-alx/alx.patch b/patches/unified-drivers/network/0001-backport-alx/alx.patch
new file mode 100644
index 00000000..e550439d
--- /dev/null
+++ b/patches/unified-drivers/network/0001-backport-alx/alx.patch
@@ -0,0 +1,123 @@
+--- a/drivers/net/ethernet/atheros/alx/alx_main.c
++++ b/drivers/net/ethernet/atheros/alx/alx_main.c
+@@ -98,7 +98,11 @@ static void __alx_set_rx_mode(struct net
+
+ /* comoute mc addresses' hash value ,and put it into hash table */
+ netdev_for_each_mc_addr(ha, netdev)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ alx_add_mc_addr(hw, ha->addr);
++#else
++ alx_add_mc_addr(hw, ha->dmi_addr);
++#endif
+
+ ALX_MEM_W32(hw, ALX_HASH_TBL0, hw->mc_hash[0]);
+ ALX_MEM_W32(hw, ALX_HASH_TBL1, hw->mc_hash[1]);
+@@ -130,8 +134,10 @@ static int alx_set_mac_address(struct ne
+ if (!is_valid_ether_addr(addr->sa_data))
+ return -EADDRNOTAVAIL;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
+ if (netdev->addr_assign_type & NET_ADDR_RANDOM)
+ netdev->addr_assign_type ^= NET_ADDR_RANDOM;
++#endif
+
+ memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+ memcpy(hw->mac_addr, addr->sa_data, netdev->addr_len);
+@@ -1138,6 +1144,7 @@ static void alx_set_vlan_mode(struct alx
+ }
+
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
+ static netdev_features_t alx_fix_features(struct net_device *netdev,
+ netdev_features_t features)
+ {
+@@ -1170,6 +1177,7 @@ static int alx_set_features(struct net_d
+
+ return 0;
+ }
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */
+
+ /* alx_change_mtu - Change the Maximum Transfer Unit */
+ static int alx_change_mtu(struct net_device *netdev, int new_mtu)
+@@ -1194,7 +1202,17 @@ static int alx_change_mtu(struct net_dev
+ adpt->hw.mtu = new_mtu;
+ adpt->rxbuf_size = new_mtu > ALX_DEF_RXBUF_SIZE ?
+ ALIGN(max_frame, 8) : ALX_DEF_RXBUF_SIZE;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
++ if (new_mtu > (7*1024)) {
++ netdev->features &= ~NETIF_F_TSO;
++ netdev->features &= ~NETIF_F_TSO6;
++ } else {
++ netdev->features |= NETIF_F_TSO;
++ netdev->features |= NETIF_F_TSO6;
++ }
++#else
+ netdev_update_features(netdev);
++#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */
+ if (netif_running(netdev))
+ alx_reinit(adpt, false);
+ }
+@@ -2460,8 +2478,10 @@ static const struct net_device_ops alx_n
+ .ndo_change_mtu = alx_change_mtu,
+ .ndo_do_ioctl = alx_ioctl,
+ .ndo_tx_timeout = alx_tx_timeout,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
+ .ndo_fix_features = alx_fix_features,
+ .ndo_set_features = alx_set_features,
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */
+ #ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = alx_poll_controller,
+ #endif
+@@ -2563,7 +2583,7 @@ alx_probe(struct pci_dev *pdev, const st
+ goto err_iomap;
+ }
+
+- netdev->netdev_ops = &alx_netdev_ops;
++ netdev_attach_ops(netdev, &alx_netdev_ops);
+ alx_set_ethtool_ops(netdev);
+ netdev->irq = pdev->irq;
+ netdev->watchdog_timeo = ALX_WATCHDOG_TIME;
+@@ -2608,12 +2628,21 @@ alx_probe(struct pci_dev *pdev, const st
+ }
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
+ netdev->hw_features = NETIF_F_SG |
+ NETIF_F_HW_CSUM |
+ NETIF_F_HW_VLAN_RX |
+ NETIF_F_TSO |
+ NETIF_F_TSO6;
+ netdev->features = netdev->hw_features | NETIF_F_HW_VLAN_TX;
++#else
++ netdev->features = NETIF_F_SG |
++ NETIF_F_HW_CSUM |
++ NETIF_F_HW_VLAN_RX |
++ NETIF_F_TSO |
++ NETIF_F_TSO6 |
++ NETIF_F_HW_VLAN_TX;
++#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */
+
+ /* read permanent mac addr from register or eFuse */
+ if (alx_get_perm_macaddr(hw, hw->perm_addr)) {
+@@ -2789,6 +2818,8 @@ static struct pci_error_handlers alx_err
+ };
+
+ #ifdef CONFIG_PM_SLEEP
++compat_pci_suspend(alx_suspend);
++compat_pci_resume(alx_resume);
+ static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);
+ #define ALX_PM_OPS (&alx_pm_ops)
+ #else
+@@ -2802,7 +2833,12 @@ static struct pci_driver alx_driver = {
+ .remove = alx_remove,
+ .shutdown = alx_shutdown,
+ .err_handler = &alx_err_handler,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+ .driver.pm = ALX_PM_OPS,
++#elif defined(CONFIG_PM_SLEEP)
++ .suspend = alx_suspend_compat,
++ .resume = alx_resume_compat,
++#endif
+ };
+
+
diff --git a/patches/unified-drivers/network/0002-alx-make-kconfig/alx.patch b/patches/unified-drivers/network/0002-alx-make-kconfig/alx.patch
new file mode 100644
index 00000000..465e4998
--- /dev/null
+++ b/patches/unified-drivers/network/0002-alx-make-kconfig/alx.patch
@@ -0,0 +1,32 @@
+--- a/drivers/net/ethernet/atheros/Kconfig
++++ b/drivers/net/ethernet/atheros/Kconfig
+@@ -67,4 +67,22 @@ config ATL1C
+ To compile this driver as a module, choose M here. The module
+ will be called atl1c.
+
++config ALX
++ tristate "Qualcomm Atheros L1F Gigabit Ethernet support"
++ depends on PCI
++ select CRC32
++ select NET_CORE
++ select MII
++ ---help---
++ This driver supports the Qualcomm Atheros L1F ethernet adapter.
++ This driver supports following chipsets:
++
++ 1969:1091 - AR8161 Gigabit Ethernet
++ 1969:1090 - AR8162 Fast Ethernet
++ 1969:10A1 - AR8171 Gigabit Ethernet
++ 1969:10A0 - AR8172 Fast Ethernet
++
++ To compile this driver as a module, choose M here. The module
++ will be called alx.
++
+ endif # NET_VENDOR_ATHEROS
+--- a/drivers/net/ethernet/atheros/Makefile
++++ b/drivers/net/ethernet/atheros/Makefile
+@@ -6,3 +6,4 @@ obj-$(CONFIG_ATL1) += atlx/
+ obj-$(CONFIG_ATL2) += atlx/
+ obj-$(CONFIG_ATL1E) += atl1e/
+ obj-$(CONFIG_ATL1C) += atl1c/
++obj-$(CONFIG_ALX) += alx/
diff --git a/patches/unified-drivers/network/0003-alx-deactivate-loopback-test/alx.patch b/patches/unified-drivers/network/0003-alx-deactivate-loopback-test/alx.patch
new file mode 100644
index 00000000..3ed96a43
--- /dev/null
+++ b/patches/unified-drivers/network/0003-alx-deactivate-loopback-test/alx.patch
@@ -0,0 +1,25 @@
+--- a/drivers/net/ethernet/atheros/alx/alx_ethtool.c
++++ b/drivers/net/ethernet/atheros/alx/alx_ethtool.c
+@@ -1687,7 +1687,9 @@ static void alx_self_test(struct net_dev
+ {
+ struct alx_adapter *adpt = netdev_priv(netdev);
+ bool if_running = netif_running(netdev);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+ bool phy_lpback = etest->flags & ETH_TEST_FL_EXTERNAL_LB;
++#endif
+
+ ALX_FLAG_SET(adpt, TESTING);
+ memset(data, 0, sizeof(u64) * ALX_TEST_LEN);
+@@ -1707,10 +1709,12 @@ static void alx_self_test(struct net_dev
+ if (alx_diag_interrupt(adpt, &data[2]))
+ etest->flags |= ETH_TEST_FL_FAILED;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+ if (phy_lpback)
+ etest->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE;
+ if (alx_diag_loopback(adpt, &data[3], phy_lpback))
+ etest->flags |= ETH_TEST_FL_FAILED;
++#endif
+
+ } else {
+ netif_info(adpt, hw, adpt->netdev, "online test start...\n");
diff --git a/patches/unified-drivers/network/0004-alx-intx-msi-workaround/alx.patch b/patches/unified-drivers/network/0004-alx-intx-msi-workaround/alx.patch
new file mode 100644
index 00000000..83ed16e3
--- /dev/null
+++ b/patches/unified-drivers/network/0004-alx-intx-msi-workaround/alx.patch
@@ -0,0 +1,12 @@
+--- a/drivers/net/ethernet/atheros/alx/alx_main.c
++++ b/drivers/net/ethernet/atheros/alx/alx_main.c
+@@ -1032,6 +1032,9 @@ static int alx_identify_hw(struct alx_ad
+ if (rev < ALX_REV_C0) {
+ hw->ptrn_ofs = 0x600;
+ hw->max_ptrns = 8;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
++ pdev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
++#endif
+ } else {
+ hw->ptrn_ofs = 0x14000;
+ hw->max_ptrns = 16;