Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* r8169_firmware.h: RealTek 8169/8168/8101 ethernet driver.
0003  *
0004  * Copyright (c) 2002 ShuChen <shuchen@realtek.com.tw>
0005  * Copyright (c) 2003 - 2007 Francois Romieu <romieu@fr.zoreil.com>
0006  * Copyright (c) a lot of people too. Please respect their work.
0007  *
0008  * See MAINTAINERS file for support contact information.
0009  */
0010 
0011 #include <linux/device.h>
0012 #include <linux/firmware.h>
0013 
0014 struct rtl8169_private;
0015 typedef void (*rtl_fw_write_t)(struct rtl8169_private *tp, int reg, int val);
0016 typedef int (*rtl_fw_read_t)(struct rtl8169_private *tp, int reg);
0017 
0018 #define RTL_VER_SIZE        32
0019 
0020 struct rtl_fw {
0021     rtl_fw_write_t phy_write;
0022     rtl_fw_read_t phy_read;
0023     rtl_fw_write_t mac_mcu_write;
0024     rtl_fw_read_t mac_mcu_read;
0025     const struct firmware *fw;
0026     const char *fw_name;
0027     struct device *dev;
0028 
0029     char version[RTL_VER_SIZE];
0030 
0031     struct rtl_fw_phy_action {
0032         __le32 *code;
0033         size_t size;
0034     } phy_action;
0035 };
0036 
0037 int rtl_fw_request_firmware(struct rtl_fw *rtl_fw);
0038 void rtl_fw_release_firmware(struct rtl_fw *rtl_fw);
0039 void rtl_fw_write_firmware(struct rtl8169_private *tp, struct rtl_fw *rtl_fw);