ethtool: Add flashing transceiver modules' firmware notifications ability

Add progress notifications ability to user space while flashing modules'
firmware by implementing the interface between the user space and the
kernel.

Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Danielle Ratson
2024-06-27 17:08:51 +03:00
committed by David S. Miller
parent 46fb3ba95b
commit d7d4cfc4c9
4 changed files with 154 additions and 0 deletions

31
net/ethtool/module_fw.h Normal file
View File

@@ -0,0 +1,31 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <uapi/linux/ethtool.h>
/**
* struct ethnl_module_fw_flash_ntf_params - module firmware flashing
* notifications parameters
* @portid: Netlink portid of sender.
* @seq: Sequence number of sender.
* @closed_sock: Indicates whether the socket was closed from user space.
*/
struct ethnl_module_fw_flash_ntf_params {
u32 portid;
u32 seq;
bool closed_sock;
};
void
ethnl_module_fw_flash_ntf_err(struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *params,
char *err_msg, char *sub_err_msg);
void
ethnl_module_fw_flash_ntf_start(struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *params);
void
ethnl_module_fw_flash_ntf_complete(struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *params);
void
ethnl_module_fw_flash_ntf_in_progress(struct net_device *dev,
struct ethnl_module_fw_flash_ntf_params *params,
u64 done, u64 total);