r8169_firmware.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* r8169_firmware.h: RealTek 8169/8168/8101 ethernet driver.
  3. *
  4. * Copyright (c) 2002 ShuChen <[email protected]>
  5. * Copyright (c) 2003 - 2007 Francois Romieu <[email protected]>
  6. * Copyright (c) a lot of people too. Please respect their work.
  7. *
  8. * See MAINTAINERS file for support contact information.
  9. */
  10. #include <linux/device.h>
  11. #include <linux/firmware.h>
  12. struct rtl8169_private;
  13. typedef void (*rtl_fw_write_t)(struct rtl8169_private *tp, int reg, int val);
  14. typedef int (*rtl_fw_read_t)(struct rtl8169_private *tp, int reg);
  15. #define RTL_VER_SIZE 32
  16. struct rtl_fw {
  17. rtl_fw_write_t phy_write;
  18. rtl_fw_read_t phy_read;
  19. rtl_fw_write_t mac_mcu_write;
  20. rtl_fw_read_t mac_mcu_read;
  21. const struct firmware *fw;
  22. const char *fw_name;
  23. struct device *dev;
  24. char version[RTL_VER_SIZE];
  25. struct rtl_fw_phy_action {
  26. __le32 *code;
  27. size_t size;
  28. } phy_action;
  29. };
  30. int rtl_fw_request_firmware(struct rtl_fw *rtl_fw);
  31. void rtl_fw_release_firmware(struct rtl_fw *rtl_fw);
  32. void rtl_fw_write_firmware(struct rtl8169_private *tp, struct rtl_fw *rtl_fw);