diff options
Diffstat (limited to 'drivers/net/chelsio/cxgb2.c')
-rw-r--r-- | drivers/net/chelsio/cxgb2.c | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index 0f71304e0542..5f82c9c34978 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c | |||
@@ -192,10 +192,8 @@ static void link_start(struct port_info *p) | |||
192 | 192 | ||
193 | static void enable_hw_csum(struct adapter *adapter) | 193 | static void enable_hw_csum(struct adapter *adapter) |
194 | { | 194 | { |
195 | if (adapter->flags & TSO_CAPABLE) | 195 | if (adapter->port[0].dev->hw_features & NETIF_F_TSO) |
196 | t1_tp_set_ip_checksum_offload(adapter->tp, 1); /* for TSO only */ | 196 | t1_tp_set_ip_checksum_offload(adapter->tp, 1); /* for TSO only */ |
197 | if (adapter->flags & UDP_CSUM_CAPABLE) | ||
198 | t1_tp_set_udp_checksum_offload(adapter->tp, 1); | ||
199 | t1_tp_set_tcp_checksum_offload(adapter->tp, 1); | 197 | t1_tp_set_tcp_checksum_offload(adapter->tp, 1); |
200 | } | 198 | } |
201 | 199 | ||
@@ -705,33 +703,6 @@ static int set_pauseparam(struct net_device *dev, | |||
705 | return 0; | 703 | return 0; |
706 | } | 704 | } |
707 | 705 | ||
708 | static u32 get_rx_csum(struct net_device *dev) | ||
709 | { | ||
710 | struct adapter *adapter = dev->ml_priv; | ||
711 | |||
712 | return (adapter->flags & RX_CSUM_ENABLED) != 0; | ||
713 | } | ||
714 | |||
715 | static int set_rx_csum(struct net_device *dev, u32 data) | ||
716 | { | ||
717 | struct adapter *adapter = dev->ml_priv; | ||
718 | |||
719 | if (data) | ||
720 | adapter->flags |= RX_CSUM_ENABLED; | ||
721 | else | ||
722 | adapter->flags &= ~RX_CSUM_ENABLED; | ||
723 | return 0; | ||
724 | } | ||
725 | |||
726 | static int set_tso(struct net_device *dev, u32 value) | ||
727 | { | ||
728 | struct adapter *adapter = dev->ml_priv; | ||
729 | |||
730 | if (!(adapter->flags & TSO_CAPABLE)) | ||
731 | return value ? -EOPNOTSUPP : 0; | ||
732 | return ethtool_op_set_tso(dev, value); | ||
733 | } | ||
734 | |||
735 | static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e) | 706 | static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e) |
736 | { | 707 | { |
737 | struct adapter *adapter = dev->ml_priv; | 708 | struct adapter *adapter = dev->ml_priv; |
@@ -831,17 +802,12 @@ static const struct ethtool_ops t1_ethtool_ops = { | |||
831 | .get_eeprom = get_eeprom, | 802 | .get_eeprom = get_eeprom, |
832 | .get_pauseparam = get_pauseparam, | 803 | .get_pauseparam = get_pauseparam, |
833 | .set_pauseparam = set_pauseparam, | 804 | .set_pauseparam = set_pauseparam, |
834 | .get_rx_csum = get_rx_csum, | ||
835 | .set_rx_csum = set_rx_csum, | ||
836 | .set_tx_csum = ethtool_op_set_tx_csum, | ||
837 | .set_sg = ethtool_op_set_sg, | ||
838 | .get_link = ethtool_op_get_link, | 805 | .get_link = ethtool_op_get_link, |
839 | .get_strings = get_strings, | 806 | .get_strings = get_strings, |
840 | .get_sset_count = get_sset_count, | 807 | .get_sset_count = get_sset_count, |
841 | .get_ethtool_stats = get_stats, | 808 | .get_ethtool_stats = get_stats, |
842 | .get_regs_len = get_regs_len, | 809 | .get_regs_len = get_regs_len, |
843 | .get_regs = get_regs, | 810 | .get_regs = get_regs, |
844 | .set_tso = set_tso, | ||
845 | }; | 811 | }; |
846 | 812 | ||
847 | static int t1_ioctl(struct net_device *dev, struct ifreq *req, int cmd) | 813 | static int t1_ioctl(struct net_device *dev, struct ifreq *req, int cmd) |
@@ -1105,28 +1071,28 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
1105 | netdev->mem_start = mmio_start; | 1071 | netdev->mem_start = mmio_start; |
1106 | netdev->mem_end = mmio_start + mmio_len - 1; | 1072 | netdev->mem_end = mmio_start + mmio_len - 1; |
1107 | netdev->ml_priv = adapter; | 1073 | netdev->ml_priv = adapter; |
1108 | netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; | 1074 | netdev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM | |
1109 | netdev->features |= NETIF_F_LLTX; | 1075 | NETIF_F_RXCSUM; |
1076 | netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | | ||
1077 | NETIF_F_RXCSUM | NETIF_F_LLTX; | ||
1110 | 1078 | ||
1111 | adapter->flags |= RX_CSUM_ENABLED | TCP_CSUM_CAPABLE; | ||
1112 | if (pci_using_dac) | 1079 | if (pci_using_dac) |
1113 | netdev->features |= NETIF_F_HIGHDMA; | 1080 | netdev->features |= NETIF_F_HIGHDMA; |
1114 | if (vlan_tso_capable(adapter)) { | 1081 | if (vlan_tso_capable(adapter)) { |
1115 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 1082 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
1116 | adapter->flags |= VLAN_ACCEL_CAPABLE; | ||
1117 | netdev->features |= | 1083 | netdev->features |= |
1118 | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 1084 | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
1119 | #endif | 1085 | #endif |
1120 | 1086 | ||
1121 | /* T204: disable TSO */ | 1087 | /* T204: disable TSO */ |
1122 | if (!(is_T2(adapter)) || bi->port_number != 4) { | 1088 | if (!(is_T2(adapter)) || bi->port_number != 4) { |
1123 | adapter->flags |= TSO_CAPABLE; | 1089 | netdev->hw_features |= NETIF_F_TSO; |
1124 | netdev->features |= NETIF_F_TSO; | 1090 | netdev->features |= NETIF_F_TSO; |
1125 | } | 1091 | } |
1126 | } | 1092 | } |
1127 | 1093 | ||
1128 | netdev->netdev_ops = &cxgb_netdev_ops; | 1094 | netdev->netdev_ops = &cxgb_netdev_ops; |
1129 | netdev->hard_header_len += (adapter->flags & TSO_CAPABLE) ? | 1095 | netdev->hard_header_len += (netdev->hw_features & NETIF_F_TSO) ? |
1130 | sizeof(struct cpl_tx_pkt_lso) : sizeof(struct cpl_tx_pkt); | 1096 | sizeof(struct cpl_tx_pkt_lso) : sizeof(struct cpl_tx_pkt); |
1131 | 1097 | ||
1132 | netif_napi_add(netdev, &adapter->napi, t1_poll, 64); | 1098 | netif_napi_add(netdev, &adapter->napi, t1_poll, 64); |