// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2009-2012 Realtek Corporation.*/
#include "wifi.h"
#include "efuse.h"
#include "pci.h"
#include <linux/export.h>
static const u8 PGPKT_DATA_SIZE = 8;
static const int EFUSE_MAX_SIZE = 512;
#define START_ADDRESS 0x1000
#define REG_MCUFWDL 0x0080
static const struct rtl_efuse_ops efuse_ops = {
.efuse_onebyte_read = efuse_one_byte_read,
.efuse_logical_map_read = efuse_shadow_read,
};
static void efuse_shadow_read_1byte(struct ieee80211_hw *hw, u16 offset,
u8 *value);
static void efuse_shadow_read_2byte(struct ieee80211_hw *hw, u16 offset,
u16 *value);
static void efuse_shadow_read_4byte(struct ieee80211_hw *hw, u16 offset,
u32 *value);
static void efuse_shadow_write_1byte(struct ieee80211_hw *hw, u16 offset,
u8 value);
static void efuse_shadow_write_2byte(struct ieee80211_hw *hw, u16 offset,
u16 value);
static void efuse_shadow_write_4byte(struct ieee80211_hw *hw, u16 offset,
u32 value);
static int efuse_one_byte_write(struct ieee80211_hw *hw, u16 addr,
u8 data);
static void efuse_read_all_map(struct ieee80211_hw *hw, u8 *efuse);
static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset,
u8 *data);
static int efuse_pg_packet_write(struct ieee80211_hw *hw, u8 offset,<