| --- a/drivers/net/ethernet/atheros/alx/main.c |
| +++ b/drivers/net/ethernet/atheros/alx/main.c |
| @@ -733,6 +733,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) |
| { |
| @@ -741,6 +742,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) |
| { |
| @@ -817,7 +819,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; |
| @@ -1226,7 +1238,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 |
| @@ -1345,7 +1359,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, |