--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c @@ -496,6 +496,7 @@ static void atl1c_set_rxbufsize(struct a adapter->rx_frag_size = roundup_pow_of_two(head_size); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) static netdev_features_t atl1c_fix_features(struct net_device *netdev, netdev_features_t features) { @@ -524,6 +525,7 @@ static int atl1c_set_features(struct net return 0; } +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ /** * atl1c_change_mtu - Change the Maximum Transfer Unit @@ -556,8 +558,19 @@ static int atl1c_change_mtu(struct net_d netdev->mtu = new_mtu; adapter->hw.max_frame_size = new_mtu; atl1c_set_rxbufsize(adapter, netdev); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) + if (new_mtu > MAX_TSO_FRAME_SIZE) { + adapter->netdev->features &= ~NETIF_F_TSO; + adapter->netdev->features &= ~NETIF_F_TSO6; + } else { + adapter->netdev->features |= NETIF_F_TSO; + adapter->netdev->features |= NETIF_F_TSO6; + } +#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */ atl1c_down(adapter); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) netdev_update_features(netdev); +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ atl1c_up(adapter); clear_bit(__AT_RESETTING, &adapter->flags); } @@ -2497,8 +2510,10 @@ static const struct net_device_ops atl1c .ndo_set_mac_address = atl1c_set_mac_addr, .ndo_set_rx_mode = atl1c_set_multi, .ndo_change_mtu = atl1c_change_mtu, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) .ndo_fix_features = atl1c_fix_features, .ndo_set_features = atl1c_set_features, +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ .ndo_do_ioctl = atl1c_ioctl, .ndo_tx_timeout = atl1c_tx_timeout, .ndo_get_stats = atl1c_get_stats, @@ -2516,6 +2531,7 @@ static int atl1c_init_netdev(struct net_ netdev->watchdog_timeo = AT_TX_WATCHDOG; atl1c_set_ethtool_ops(netdev); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) /* TODO: add when ready */ netdev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | @@ -2524,6 +2540,14 @@ static int atl1c_init_netdev(struct net_ NETIF_F_TSO6; netdev->features = netdev->hw_features | NETIF_F_HW_VLAN_CTAG_TX; +#else + netdev->features = NETIF_F_SG | + NETIF_F_HW_CSUM | + NETIF_F_HW_VLAN_TX | + NETIF_F_HW_VLAN_RX | + NETIF_F_TSO | + NETIF_F_TSO6; +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */ return 0; }