On Tuesday, April 10, 2012 14:17:28 Martin Hundebøll wrote:
If you add an ifdef around the definition here would be no need to malloc bat_stats separately, right ?
Do we prefer IFDEFs in the definition over mallocs? (I guess so by your comment). If thats the case, then no problem with me.
The types.h is full of ifdefs already. It helps to keep the structs smaller when functionality is not compiled into the module.
As long as we agree on ifdefs. They weren't there until BLAII and DAT added them, but I don't have a problem with'em. Let's see how long this patch-set will live, as I expect to use the get_ethtool_stats(), if possible.
Some of the counters might exist in bat_priv->stats as Antonio already pointed out (bat_priv->stats.rx_packets). They have the advantage of being printed with ifconfig and friends.
Regards, Marek