OSDN Git Service

ethtool: ethtool_get_drvinfo: populate drvinfo fields even if callback exits
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Tue, 8 Nov 2022 03:57:54 +0000 (12:57 +0900)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Nov 2022 17:01:58 +0000 (09:01 -0800)
commitedaf5df22cb8e7e849773ce69fcc9bc20ca92160
tree1b155902e1ced5728fe26fa9e04d1e4c0ac1a361
parent0c9ef08a4d0fd6c5e6000597b506235d71a85a61
ethtool: ethtool_get_drvinfo: populate drvinfo fields even if callback exits

If ethtool_ops::get_drvinfo() callback isn't set,
ethtool_get_drvinfo() will fill the ethtool_drvinfo::name and
ethtool_drvinfo::bus_info fields.

However, if the driver provides the callback function, those two
fields are not touched. This means that the driver has to fill these
itself.

Allow the driver to leave those two fields empty and populate them in
such case. This way, the driver can rely on the default values for the
name and the bus_info. If the driver provides values, do nothing.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/r/20221108035754.2143-1-mailhol.vincent@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/ioctl.c