@@ -167,27 +167,35 @@ static const char qlcnic_gstrings_test[][ETH_GSTRING_LEN] = {
167
167
168
168
#define QLCNIC_TEST_LEN ARRAY_SIZE(qlcnic_gstrings_test)
169
169
170
- static inline int qlcnic_82xx_statistics (void )
170
+ static inline int qlcnic_82xx_statistics (struct qlcnic_adapter * adapter )
171
171
{
172
- return ARRAY_SIZE (qlcnic_device_gstrings_stats ) +
173
- ARRAY_SIZE (qlcnic_83xx_mac_stats_strings );
172
+ return ARRAY_SIZE (qlcnic_gstrings_stats ) +
173
+ ARRAY_SIZE (qlcnic_83xx_mac_stats_strings ) +
174
+ QLCNIC_TX_STATS_LEN * adapter -> drv_tx_rings ;
174
175
}
175
176
176
- static inline int qlcnic_83xx_statistics (void )
177
+ static inline int qlcnic_83xx_statistics (struct qlcnic_adapter * adapter )
177
178
{
178
- return ARRAY_SIZE (qlcnic_83xx_tx_stats_strings ) +
179
+ return ARRAY_SIZE (qlcnic_gstrings_stats ) +
180
+ ARRAY_SIZE (qlcnic_83xx_tx_stats_strings ) +
179
181
ARRAY_SIZE (qlcnic_83xx_mac_stats_strings ) +
180
- ARRAY_SIZE (qlcnic_83xx_rx_stats_strings );
182
+ ARRAY_SIZE (qlcnic_83xx_rx_stats_strings ) +
183
+ QLCNIC_TX_STATS_LEN * adapter -> drv_tx_rings ;
181
184
}
182
185
183
186
static int qlcnic_dev_statistics_len (struct qlcnic_adapter * adapter )
184
187
{
185
- if (qlcnic_82xx_check (adapter ))
186
- return qlcnic_82xx_statistics ();
187
- else if (qlcnic_83xx_check (adapter ))
188
- return qlcnic_83xx_statistics ();
189
- else
190
- return -1 ;
188
+ int len = -1 ;
189
+
190
+ if (qlcnic_82xx_check (adapter )) {
191
+ len = qlcnic_82xx_statistics (adapter );
192
+ if (adapter -> flags & QLCNIC_ESWITCH_ENABLED )
193
+ len += ARRAY_SIZE (qlcnic_device_gstrings_stats );
194
+ } else if (qlcnic_83xx_check (adapter )) {
195
+ len = qlcnic_83xx_statistics (adapter );
196
+ }
197
+
198
+ return len ;
191
199
}
192
200
193
201
#define QLCNIC_TX_INTR_NOT_CONFIGURED 0X78563412
@@ -920,18 +928,13 @@ static int qlcnic_eeprom_test(struct net_device *dev)
920
928
921
929
static int qlcnic_get_sset_count (struct net_device * dev , int sset )
922
930
{
923
- int len ;
924
931
925
932
struct qlcnic_adapter * adapter = netdev_priv (dev );
926
933
switch (sset ) {
927
934
case ETH_SS_TEST :
928
935
return QLCNIC_TEST_LEN ;
929
936
case ETH_SS_STATS :
930
- len = qlcnic_dev_statistics_len (adapter ) + QLCNIC_STATS_LEN ;
931
- if ((adapter -> flags & QLCNIC_ESWITCH_ENABLED ) ||
932
- qlcnic_83xx_check (adapter ))
933
- return len ;
934
- return qlcnic_82xx_statistics ();
937
+ return qlcnic_dev_statistics_len (adapter );
935
938
default :
936
939
return - EOPNOTSUPP ;
937
940
}
0 commit comments