diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-29 10:11:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 20:23:54 -0500 |
commit | c383b53729a9bbbceee132a85955d084ba00ca3a (patch) | |
tree | af6a309a5859a9e2e055e674650aa652dffc010c /drivers/net/sfc | |
parent | 76884835684411264cda2f15585261eb02183541 (diff) |
sfc: Allow for additional checksum offload features
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/efx.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/ethtool.c | 16 | ||||
-rw-r--r-- | drivers/net/sfc/falcon.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 3 |
4 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 4fe6d635ef3b..c49d364ebdbd 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -2179,7 +2179,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev, | |||
2179 | net_dev = alloc_etherdev(sizeof(*efx)); | 2179 | net_dev = alloc_etherdev(sizeof(*efx)); |
2180 | if (!net_dev) | 2180 | if (!net_dev) |
2181 | return -ENOMEM; | 2181 | return -ENOMEM; |
2182 | net_dev->features |= (NETIF_F_IP_CSUM | NETIF_F_SG | | 2182 | net_dev->features |= (type->offload_features | NETIF_F_SG | |
2183 | NETIF_F_HIGHDMA | NETIF_F_TSO | | 2183 | NETIF_F_HIGHDMA | NETIF_F_TSO | |
2184 | NETIF_F_GRO); | 2184 | NETIF_F_GRO); |
2185 | /* Mask for features that also apply to VLAN devices */ | 2185 | /* Mask for features that also apply to VLAN devices */ |
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 08a9db993743..0a79ec7d45ee 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -468,6 +468,19 @@ static void efx_ethtool_get_stats(struct net_device *net_dev, | |||
468 | } | 468 | } |
469 | } | 469 | } |
470 | 470 | ||
471 | static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable) | ||
472 | { | ||
473 | struct efx_nic *efx = netdev_priv(net_dev); | ||
474 | unsigned long features = efx->type->offload_features & NETIF_F_ALL_CSUM; | ||
475 | |||
476 | if (enable) | ||
477 | net_dev->features |= features; | ||
478 | else | ||
479 | net_dev->features &= ~features; | ||
480 | |||
481 | return 0; | ||
482 | } | ||
483 | |||
471 | static int efx_ethtool_set_rx_csum(struct net_device *net_dev, u32 enable) | 484 | static int efx_ethtool_set_rx_csum(struct net_device *net_dev, u32 enable) |
472 | { | 485 | { |
473 | struct efx_nic *efx = netdev_priv(net_dev); | 486 | struct efx_nic *efx = netdev_priv(net_dev); |
@@ -813,7 +826,8 @@ const struct ethtool_ops efx_ethtool_ops = { | |||
813 | .get_rx_csum = efx_ethtool_get_rx_csum, | 826 | .get_rx_csum = efx_ethtool_get_rx_csum, |
814 | .set_rx_csum = efx_ethtool_set_rx_csum, | 827 | .set_rx_csum = efx_ethtool_set_rx_csum, |
815 | .get_tx_csum = ethtool_op_get_tx_csum, | 828 | .get_tx_csum = ethtool_op_get_tx_csum, |
816 | .set_tx_csum = ethtool_op_set_tx_csum, | 829 | /* Need to enable/disable IPv6 too */ |
830 | .set_tx_csum = efx_ethtool_set_tx_csum, | ||
817 | .get_sg = ethtool_op_get_sg, | 831 | .get_sg = ethtool_op_get_sg, |
818 | .set_sg = ethtool_op_set_sg, | 832 | .set_sg = ethtool_op_set_sg, |
819 | .get_tso = ethtool_op_get_tso, | 833 | .get_tso = ethtool_op_get_tso, |
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 950de847d22b..f77bbbeacb60 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -3304,6 +3304,7 @@ struct efx_nic_type falcon_a1_nic_type = { | |||
3304 | .phys_addr_channels = 4, | 3304 | .phys_addr_channels = 4, |
3305 | .tx_dc_base = 0x130000, | 3305 | .tx_dc_base = 0x130000, |
3306 | .rx_dc_base = 0x100000, | 3306 | .rx_dc_base = 0x100000, |
3307 | .offload_features = NETIF_F_IP_CSUM, | ||
3307 | .reset_world_flags = ETH_RESET_IRQ, | 3308 | .reset_world_flags = ETH_RESET_IRQ, |
3308 | }; | 3309 | }; |
3309 | 3310 | ||
@@ -3351,6 +3352,7 @@ struct efx_nic_type falcon_b0_nic_type = { | |||
3351 | * channels */ | 3352 | * channels */ |
3352 | .tx_dc_base = 0x130000, | 3353 | .tx_dc_base = 0x130000, |
3353 | .rx_dc_base = 0x100000, | 3354 | .rx_dc_base = 0x100000, |
3355 | .offload_features = NETIF_F_IP_CSUM, | ||
3354 | .reset_world_flags = ETH_RESET_IRQ, | 3356 | .reset_world_flags = ETH_RESET_IRQ, |
3355 | }; | 3357 | }; |
3356 | 3358 | ||
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index e1534ba6ad79..96d3f00df645 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -864,6 +864,8 @@ static inline const char *efx_dev_name(struct efx_nic *efx) | |||
864 | * descriptors | 864 | * descriptors |
865 | * @tx_dc_base: Base address in SRAM of TX queue descriptor caches | 865 | * @tx_dc_base: Base address in SRAM of TX queue descriptor caches |
866 | * @rx_dc_base: Base address in SRAM of RX queue descriptor caches | 866 | * @rx_dc_base: Base address in SRAM of RX queue descriptor caches |
867 | * @offload_features: net_device feature flags for protocol offload | ||
868 | * features implemented in hardware | ||
867 | * @reset_world_flags: Flags for additional components covered by | 869 | * @reset_world_flags: Flags for additional components covered by |
868 | * reset method RESET_TYPE_WORLD | 870 | * reset method RESET_TYPE_WORLD |
869 | */ | 871 | */ |
@@ -904,6 +906,7 @@ struct efx_nic_type { | |||
904 | unsigned int phys_addr_channels; | 906 | unsigned int phys_addr_channels; |
905 | unsigned int tx_dc_base; | 907 | unsigned int tx_dc_base; |
906 | unsigned int rx_dc_base; | 908 | unsigned int rx_dc_base; |
909 | unsigned long offload_features; | ||
907 | u32 reset_world_flags; | 910 | u32 reset_world_flags; |
908 | }; | 911 | }; |
909 | 912 | ||