aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2010-07-09 09:14:58 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-09 20:41:57 -0400
commitac8d0c4feb5577a830bbf1d9a3bb5b1d30298e2c (patch)
treed564fcfee851d9c96e754afa9dc7093f869dd7a7 /drivers/net
parentd77535162e736c47978d5c01469c56e1781dc91b (diff)
qlcnic: Check FW capability for TSO
Driver checks TSO capability from FW before enabling it. Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/qlcnic/qlcnic.h7
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c3
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c10
3 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 60ea7cb3308f..02a50e60166d 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -821,9 +821,10 @@ struct qlcnic_nic_intr_coalesce {
821#define QLCNIC_LRO_REQUEST_CLEANUP 4 821#define QLCNIC_LRO_REQUEST_CLEANUP 4
822 822
823/* Capabilites received */ 823/* Capabilites received */
824#define QLCNIC_FW_CAPABILITY_BDG (1 << 8) 824#define QLCNIC_FW_CAPABILITY_TSO BIT_1
825#define QLCNIC_FW_CAPABILITY_FVLANTX (1 << 9) 825#define QLCNIC_FW_CAPABILITY_BDG BIT_8
826#define QLCNIC_FW_CAPABILITY_HW_LRO (1 << 10) 826#define QLCNIC_FW_CAPABILITY_FVLANTX BIT_9
827#define QLCNIC_FW_CAPABILITY_HW_LRO BIT_10
827 828
828/* module types */ 829/* module types */
829#define LINKEVENT_MODULE_NOT_PRESENT 1 830#define LINKEVENT_MODULE_NOT_PRESENT 1
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index f8e39e4cfe0f..baf5a52b2a4b 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -820,6 +820,9 @@ static u32 qlcnic_get_tso(struct net_device *dev)
820 820
821static int qlcnic_set_tso(struct net_device *dev, u32 data) 821static int qlcnic_set_tso(struct net_device *dev, u32 data)
822{ 822{
823 struct qlcnic_adapter *adapter = netdev_priv(dev);
824 if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO))
825 return -EOPNOTSUPP;
823 if (data) 826 if (data)
824 dev->features |= (NETIF_F_TSO | NETIF_F_TSO6); 827 dev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
825 else 828 else
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 18e2b2e6626d..c334f1a0a2a4 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1226,10 +1226,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
1226 SET_ETHTOOL_OPS(netdev, &qlcnic_ethtool_ops); 1226 SET_ETHTOOL_OPS(netdev, &qlcnic_ethtool_ops);
1227 1227
1228 netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM | 1228 netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM |
1229 NETIF_F_IPV6_CSUM | NETIF_F_GRO | NETIF_F_TSO | NETIF_F_TSO6); 1229 NETIF_F_IPV6_CSUM | NETIF_F_GRO);
1230
1231 netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM | 1230 netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM |
1232 NETIF_F_IPV6_CSUM | NETIF_F_TSO | NETIF_F_TSO6); 1231 NETIF_F_IPV6_CSUM);
1232
1233 if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO) {
1234 netdev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
1235 netdev->vlan_features |= (NETIF_F_TSO | NETIF_F_TSO6);
1236 }
1233 1237
1234 if (pci_using_dac) { 1238 if (pci_using_dac) {
1235 netdev->features |= NETIF_F_HIGHDMA; 1239 netdev->features |= NETIF_F_HIGHDMA;