blob: dbc4d509bd3d876ebbfea4c30b6a82277d40bedd [file] [log] [blame]
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -737,6 +737,7 @@ static int alx_init_sw(struct alx_priv *
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
static netdev_features_t alx_fix_features(struct net_device *netdev,
netdev_features_t features)
{
@@ -745,6 +746,7 @@ static netdev_features_t alx_fix_feature
return features;
}
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */
static void alx_netif_stop(struct alx_priv *alx)
{
@@ -821,7 +823,17 @@ static int alx_change_mtu(struct net_dev
alx->hw.mtu = mtu;
alx->rxbuf_size = mtu > ALX_DEF_RXBUF_SIZE ?
ALIGN(max_frame, 8) : ALX_DEF_RXBUF_SIZE;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
+ if (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(alx);
return 0;
@@ -1180,7 +1192,9 @@ 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,
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = alx_poll_controller,
#endif
@@ -1305,7 +1319,11 @@ static int alx_probe(struct pci_dev *pde
}
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
netdev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM;
+#else
+ netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM;
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */
if (alx_get_perm_macaddr(hw, hw->perm_addr)) {
dev_warn(&pdev->dev,