RE: [PATCH] ethtool_ops

From: Feldman, Scott (scott.feldman@intel.com)
Date: Fri Jun 06 2003 - 15:17:46 EST


> Right now, each network driver which supports the ethtool
> ioctl has its own implementation of everything from decoding
> which ethtool ioctl it is, copying data to and from
> userspace, marshalling and unmarshalling data from ethtool
> packets, etc. The current setup makes it impossible to use
> alternative interfaces to get at the same data (eg sysfs) and
> it's not exactly typesafe.

This is really cool! Thanks for doing this Matthew.

Some questions:

* On get_gregs, for example, would it make sense to ->get_drvinfo
  so you'll know regdump_len and therefore can kmalloc an ethtool_regs
  with enough space to pass to ->get_regs? Keep the kmalloc and
  kfree together. Same for self_test, get_strings, and get_stats.
  For get_strings, size = max{n_stats, testinfo_len)*sizeof(u64).

* If the above is done, can we have one function type for the
ethtool_ops
  functions? int f(struct netdev *, struct ethtool_cmd *). The
  drawback is the driver needs to cast to the specific ethtool_* struct.

* Can we get an HAVE_ETHTOOL_OPS defined in netdevice.h to support
  backward compat?

-scott
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 07 2003 - 22:00:31 EST