1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2009-2012 Realtek Corporation.*/
7 #define EFUSE_IC_ID_OFFSET 506
9 #define EFUSE_MAX_WORD_UNIT 4
11 #define EFUSE_INIT_MAP 0
12 #define EFUSE_MODIFY_MAP 1
14 #define PG_STATE_HEADER 0x01
15 #define PG_STATE_WORD_0 0x02
16 #define PG_STATE_WORD_1 0x04
17 #define PG_STATE_WORD_2 0x08
18 #define PG_STATE_WORD_3 0x10
19 #define PG_STATE_DATA 0x20
21 #define EFUSE_REPEAT_THRESHOLD_ 3
22 #define EFUSE_ERROE_HANDLE 1
37 enum efuse_data_item
{
74 void read_efuse_byte(struct ieee80211_hw
*hw
, u16 _offset
, u8
*pbuf
);
75 void efuse_initialize(struct ieee80211_hw
*hw
);
76 u8
efuse_read_1byte(struct ieee80211_hw
*hw
, u16 address
);
77 int efuse_one_byte_read(struct ieee80211_hw
*hw
, u16 addr
, u8
*data
);
78 void efuse_write_1byte(struct ieee80211_hw
*hw
, u16 address
, u8 value
);
79 void read_efuse(struct ieee80211_hw
*hw
, u16 _offset
,
80 u16 _size_byte
, u8
*pbuf
);
81 void efuse_shadow_read(struct ieee80211_hw
*hw
, u8 type
,
82 u16 offset
, u32
*value
);
83 void efuse_shadow_write(struct ieee80211_hw
*hw
, u8 type
,
84 u16 offset
, u32 value
);
85 bool efuse_shadow_update(struct ieee80211_hw
*hw
);
86 bool efuse_shadow_update_chk(struct ieee80211_hw
*hw
);
87 void rtl_efuse_shadow_map_update(struct ieee80211_hw
*hw
);
88 void efuse_force_write_vendor_id(struct ieee80211_hw
*hw
);
89 void efuse_re_pg_section(struct ieee80211_hw
*hw
, u8 section_idx
);
90 void efuse_power_switch(struct ieee80211_hw
*hw
, u8 write
, u8 pwrstate
);
91 int rtl_get_hwinfo(struct ieee80211_hw
*hw
, struct rtl_priv
*rtlpriv
,
92 int max_size
, u8
*hwinfo
, int *params
);
93 void rtl_fill_dummy(u8
*pfwbuf
, u32
*pfwlen
);
94 void rtl_fw_page_write(struct ieee80211_hw
*hw
, u32 page
, const u8
*buffer
,
96 void rtl_fw_block_write(struct ieee80211_hw
*hw
, const u8
*buffer
, u32 size
);
97 void rtl_efuse_ops_init(struct ieee80211_hw
*hw
);