diff options
author | Shahed Shaikh <shahed.shaikh@qlogic.com> | 2013-05-21 05:27:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-22 17:52:40 -0400 |
commit | 147a90887baa98d73db1fa7ed9e755bf48960c21 (patch) | |
tree | a86f12f683de6ca93113ded2498b89748dd0f8b5 /drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |
parent | 0ce54ce4aaef1389fb8d640271748ace257cb763 (diff) |
qlcnic: Fix updating netdev->features
o After change in EPORT features of 82xx adapter, netdev->features needs to
be updated to reflect EPORT feature updates but driver was manipulating
netdev->features at wrong place.
o This patch uses netdev_update_features() and .ndo_fix_features() to
update netdev->features properly.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 49 |
1 files changed, 7 insertions, 42 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 0da38df51793..aeb26a850679 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -84,14 +84,9 @@ static int qlcnic_start_firmware(struct qlcnic_adapter *); | |||
84 | static void qlcnic_free_lb_filters_mem(struct qlcnic_adapter *adapter); | 84 | static void qlcnic_free_lb_filters_mem(struct qlcnic_adapter *adapter); |
85 | static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *); | 85 | static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *); |
86 | static int qlcnicvf_start_firmware(struct qlcnic_adapter *); | 86 | static int qlcnicvf_start_firmware(struct qlcnic_adapter *); |
87 | static void qlcnic_set_netdev_features(struct qlcnic_adapter *, | ||
88 | struct qlcnic_esw_func_cfg *); | ||
89 | static int qlcnic_vlan_rx_add(struct net_device *, __be16, u16); | 87 | static int qlcnic_vlan_rx_add(struct net_device *, __be16, u16); |
90 | static int qlcnic_vlan_rx_del(struct net_device *, __be16, u16); | 88 | static int qlcnic_vlan_rx_del(struct net_device *, __be16, u16); |
91 | 89 | ||
92 | #define QLCNIC_IS_TSO_CAPABLE(adapter) \ | ||
93 | ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO) | ||
94 | |||
95 | static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter *adapter) | 90 | static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter *adapter) |
96 | { | 91 | { |
97 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 92 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
@@ -1074,8 +1069,6 @@ void qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter, | |||
1074 | 1069 | ||
1075 | if (!esw_cfg->promisc_mode) | 1070 | if (!esw_cfg->promisc_mode) |
1076 | adapter->flags |= QLCNIC_PROMISC_DISABLED; | 1071 | adapter->flags |= QLCNIC_PROMISC_DISABLED; |
1077 | |||
1078 | qlcnic_set_netdev_features(adapter, esw_cfg); | ||
1079 | } | 1072 | } |
1080 | 1073 | ||
1081 | int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *adapter) | 1074 | int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *adapter) |
@@ -1090,51 +1083,23 @@ int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *adapter) | |||
1090 | return -EIO; | 1083 | return -EIO; |
1091 | qlcnic_set_vlan_config(adapter, &esw_cfg); | 1084 | qlcnic_set_vlan_config(adapter, &esw_cfg); |
1092 | qlcnic_set_eswitch_port_features(adapter, &esw_cfg); | 1085 | qlcnic_set_eswitch_port_features(adapter, &esw_cfg); |
1086 | qlcnic_set_netdev_features(adapter, &esw_cfg); | ||
1093 | 1087 | ||
1094 | return 0; | 1088 | return 0; |
1095 | } | 1089 | } |
1096 | 1090 | ||
1097 | static void | 1091 | void qlcnic_set_netdev_features(struct qlcnic_adapter *adapter, |
1098 | qlcnic_set_netdev_features(struct qlcnic_adapter *adapter, | 1092 | struct qlcnic_esw_func_cfg *esw_cfg) |
1099 | struct qlcnic_esw_func_cfg *esw_cfg) | ||
1100 | { | 1093 | { |
1101 | struct net_device *netdev = adapter->netdev; | 1094 | struct net_device *netdev = adapter->netdev; |
1102 | unsigned long features, vlan_features; | ||
1103 | 1095 | ||
1104 | if (qlcnic_83xx_check(adapter)) | 1096 | if (qlcnic_83xx_check(adapter)) |
1105 | return; | 1097 | return; |
1106 | 1098 | ||
1107 | features = (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | | 1099 | adapter->offload_flags = esw_cfg->offload_flags; |
1108 | NETIF_F_IPV6_CSUM | NETIF_F_GRO); | 1100 | adapter->flags |= QLCNIC_APP_CHANGED_FLAGS; |
1109 | vlan_features = (NETIF_F_SG | NETIF_F_IP_CSUM | | 1101 | netdev_update_features(netdev); |
1110 | NETIF_F_IPV6_CSUM); | 1102 | adapter->flags &= ~QLCNIC_APP_CHANGED_FLAGS; |
1111 | |||
1112 | if (QLCNIC_IS_TSO_CAPABLE(adapter)) { | ||
1113 | features |= (NETIF_F_TSO | NETIF_F_TSO6); | ||
1114 | vlan_features |= (NETIF_F_TSO | NETIF_F_TSO6); | ||
1115 | } | ||
1116 | |||
1117 | if (netdev->features & NETIF_F_LRO) | ||
1118 | features |= NETIF_F_LRO; | ||
1119 | |||
1120 | if (esw_cfg->offload_flags & BIT_0) { | ||
1121 | netdev->features |= features; | ||
1122 | adapter->rx_csum = 1; | ||
1123 | if (!(esw_cfg->offload_flags & BIT_1)) { | ||
1124 | netdev->features &= ~NETIF_F_TSO; | ||
1125 | features &= ~NETIF_F_TSO; | ||
1126 | } | ||
1127 | if (!(esw_cfg->offload_flags & BIT_2)) { | ||
1128 | netdev->features &= ~NETIF_F_TSO6; | ||
1129 | features &= ~NETIF_F_TSO6; | ||
1130 | } | ||
1131 | } else { | ||
1132 | netdev->features &= ~features; | ||
1133 | features &= ~features; | ||
1134 | adapter->rx_csum = 0; | ||
1135 | } | ||
1136 | |||
1137 | netdev->vlan_features = (features & vlan_features); | ||
1138 | } | 1103 | } |
1139 | 1104 | ||
1140 | static int | 1105 | static int |