aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/atl1c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/atl1c')
-rw-r--r--drivers/net/atl1c/atl1c_ethtool.c8
-rw-r--r--drivers/net/atl1c/atl1c_main.c25
2 files changed, 14 insertions, 19 deletions
diff --git a/drivers/net/atl1c/atl1c_ethtool.c b/drivers/net/atl1c/atl1c_ethtool.c
index 7c521508313c..3af5a336a5af 100644
--- a/drivers/net/atl1c/atl1c_ethtool.c
+++ b/drivers/net/atl1c/atl1c_ethtool.c
@@ -113,11 +113,6 @@ static int atl1c_set_settings(struct net_device *netdev,
113 return 0; 113 return 0;
114} 114}
115 115
116static u32 atl1c_get_tx_csum(struct net_device *netdev)
117{
118 return (netdev->features & NETIF_F_HW_CSUM) != 0;
119}
120
121static u32 atl1c_get_msglevel(struct net_device *netdev) 116static u32 atl1c_get_msglevel(struct net_device *netdev)
122{ 117{
123 struct atl1c_adapter *adapter = netdev_priv(netdev); 118 struct atl1c_adapter *adapter = netdev_priv(netdev);
@@ -307,9 +302,6 @@ static const struct ethtool_ops atl1c_ethtool_ops = {
307 .get_link = ethtool_op_get_link, 302 .get_link = ethtool_op_get_link,
308 .get_eeprom_len = atl1c_get_eeprom_len, 303 .get_eeprom_len = atl1c_get_eeprom_len,
309 .get_eeprom = atl1c_get_eeprom, 304 .get_eeprom = atl1c_get_eeprom,
310 .get_tx_csum = atl1c_get_tx_csum,
311 .get_sg = ethtool_op_get_sg,
312 .set_sg = ethtool_op_set_sg,
313}; 305};
314 306
315void atl1c_set_ethtool_ops(struct net_device *netdev) 307void atl1c_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index a6e1c36e48e6..48868de386a0 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -480,6 +480,15 @@ static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter,
480 adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ? 480 adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ?
481 roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; 481 roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE;
482} 482}
483
484static u32 atl1c_fix_features(struct net_device *netdev, u32 features)
485{
486 if (netdev->mtu > MAX_TSO_FRAME_SIZE)
487 features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
488
489 return features;
490}
491
483/* 492/*
484 * atl1c_change_mtu - Change the Maximum Transfer Unit 493 * atl1c_change_mtu - Change the Maximum Transfer Unit
485 * @netdev: network interface device structure 494 * @netdev: network interface device structure
@@ -506,14 +515,8 @@ static int atl1c_change_mtu(struct net_device *netdev, int new_mtu)
506 netdev->mtu = new_mtu; 515 netdev->mtu = new_mtu;
507 adapter->hw.max_frame_size = new_mtu; 516 adapter->hw.max_frame_size = new_mtu;
508 atl1c_set_rxbufsize(adapter, netdev); 517 atl1c_set_rxbufsize(adapter, netdev);
509 if (new_mtu > MAX_TSO_FRAME_SIZE) {
510 adapter->netdev->features &= ~NETIF_F_TSO;
511 adapter->netdev->features &= ~NETIF_F_TSO6;
512 } else {
513 adapter->netdev->features |= NETIF_F_TSO;
514 adapter->netdev->features |= NETIF_F_TSO6;
515 }
516 atl1c_down(adapter); 518 atl1c_down(adapter);
519 netdev_update_features(netdev);
517 atl1c_up(adapter); 520 atl1c_up(adapter);
518 clear_bit(__AT_RESETTING, &adapter->flags); 521 clear_bit(__AT_RESETTING, &adapter->flags);
519 if (adapter->hw.ctrl_flags & ATL1C_FPGA_VERSION) { 522 if (adapter->hw.ctrl_flags & ATL1C_FPGA_VERSION) {
@@ -1088,10 +1091,8 @@ static void atl1c_configure_tx(struct atl1c_adapter *adapter)
1088 u32 max_pay_load; 1091 u32 max_pay_load;
1089 u16 tx_offload_thresh; 1092 u16 tx_offload_thresh;
1090 u32 txq_ctrl_data; 1093 u32 txq_ctrl_data;
1091 u32 extra_size = 0; /* Jumbo frame threshold in QWORD unit */
1092 u32 max_pay_load_data; 1094 u32 max_pay_load_data;
1093 1095
1094 extra_size = ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN;
1095 tx_offload_thresh = MAX_TX_OFFLOAD_THRESH; 1096 tx_offload_thresh = MAX_TX_OFFLOAD_THRESH;
1096 AT_WRITE_REG(hw, REG_TX_TSO_OFFLOAD_THRESH, 1097 AT_WRITE_REG(hw, REG_TX_TSO_OFFLOAD_THRESH,
1097 (tx_offload_thresh >> 3) & TX_TSO_OFFLOAD_THRESH_MASK); 1098 (tx_offload_thresh >> 3) & TX_TSO_OFFLOAD_THRESH_MASK);
@@ -2581,6 +2582,7 @@ static const struct net_device_ops atl1c_netdev_ops = {
2581 .ndo_set_mac_address = atl1c_set_mac_addr, 2582 .ndo_set_mac_address = atl1c_set_mac_addr,
2582 .ndo_set_multicast_list = atl1c_set_multi, 2583 .ndo_set_multicast_list = atl1c_set_multi,
2583 .ndo_change_mtu = atl1c_change_mtu, 2584 .ndo_change_mtu = atl1c_change_mtu,
2585 .ndo_fix_features = atl1c_fix_features,
2584 .ndo_do_ioctl = atl1c_ioctl, 2586 .ndo_do_ioctl = atl1c_ioctl,
2585 .ndo_tx_timeout = atl1c_tx_timeout, 2587 .ndo_tx_timeout = atl1c_tx_timeout,
2586 .ndo_get_stats = atl1c_get_stats, 2588 .ndo_get_stats = atl1c_get_stats,
@@ -2601,12 +2603,13 @@ static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev)
2601 atl1c_set_ethtool_ops(netdev); 2603 atl1c_set_ethtool_ops(netdev);
2602 2604
2603 /* TODO: add when ready */ 2605 /* TODO: add when ready */
2604 netdev->features = NETIF_F_SG | 2606 netdev->hw_features = NETIF_F_SG |
2605 NETIF_F_HW_CSUM | 2607 NETIF_F_HW_CSUM |
2606 NETIF_F_HW_VLAN_TX | 2608 NETIF_F_HW_VLAN_TX |
2607 NETIF_F_HW_VLAN_RX |
2608 NETIF_F_TSO | 2609 NETIF_F_TSO |
2609 NETIF_F_TSO6; 2610 NETIF_F_TSO6;
2611 netdev->features = netdev->hw_features |
2612 NETIF_F_HW_VLAN_RX;
2610 return 0; 2613 return 0;
2611} 2614}
2612 2615