module_fw.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #include <uapi/linux/ethtool.h>
  3. #include "netlink.h"
  4. /**
  5. * struct ethnl_module_fw_flash_ntf_params - module firmware flashing
  6. * notifications parameters
  7. * @portid: Netlink portid of sender.
  8. * @seq: Sequence number of sender.
  9. * @closed_sock: Indicates whether the socket was closed from user space.
  10. */
  11. struct ethnl_module_fw_flash_ntf_params {
  12. u32 portid;
  13. u32 seq;
  14. bool closed_sock;
  15. };
  16. /**
  17. * struct ethtool_module_fw_flash_params - module firmware flashing parameters
  18. * @password: Module password. Only valid when @pass_valid is set.
  19. * @password_valid: Whether the module password is valid or not.
  20. */
  21. struct ethtool_module_fw_flash_params {
  22. __be32 password;
  23. u8 password_valid:1;
  24. };
  25. /**
  26. * struct ethtool_cmis_fw_update_params - CMIS firmware update specific
  27. * parameters
  28. * @dev: Pointer to the net_device to be flashed.
  29. * @params: Module firmware flashing parameters.
  30. * @ntf_params: Module firmware flashing notification parameters.
  31. * @fw: Firmware to flash.
  32. */
  33. struct ethtool_cmis_fw_update_params {
  34. struct net_device *dev;
  35. struct ethtool_module_fw_flash_params params;
  36. struct ethnl_module_fw_flash_ntf_params ntf_params;
  37. const struct firmware *fw;
  38. };
  39. /**
  40. * struct ethtool_module_fw_flash - module firmware flashing
  41. * @list: List node for &module_fw_flash_work_list.
  42. * @dev_tracker: Refcount tracker for @dev.
  43. * @work: The flashing firmware work.
  44. * @fw_update: CMIS firmware update specific parameters.
  45. */
  46. struct ethtool_module_fw_flash {
  47. struct list_head list;
  48. netdevice_tracker dev_tracker;
  49. struct work_struct work;
  50. struct ethtool_cmis_fw_update_params fw_update;
  51. };
  52. void ethnl_module_fw_flash_sock_destroy(struct ethnl_sock_priv *sk_priv);
  53. void
  54. ethnl_module_fw_flash_ntf_err(struct net_device *dev,
  55. struct ethnl_module_fw_flash_ntf_params *params,
  56. char *err_msg, char *sub_err_msg);
  57. void
  58. ethnl_module_fw_flash_ntf_start(struct net_device *dev,
  59. struct ethnl_module_fw_flash_ntf_params *params);
  60. void
  61. ethnl_module_fw_flash_ntf_complete(struct net_device *dev,
  62. struct ethnl_module_fw_flash_ntf_params *params);
  63. void
  64. ethnl_module_fw_flash_ntf_in_progress(struct net_device *dev,
  65. struct ethnl_module_fw_flash_ntf_params *params,
  66. u64 done, u64 total);
  67. void ethtool_cmis_fw_update(struct ethtool_cmis_fw_update_params *params);