#include <linux/crc32.h>
#include <linux/delay.h>
#include <linux/property.h>
#include <linux/slab.h>
#include "tb.h"
static int tb_eeprom_ctl_write(struct tb_switch *sw, struct tb_eeprom_ctl *ctl)
{ … }
static int tb_eeprom_ctl_read(struct tb_switch *sw, struct tb_eeprom_ctl *ctl)
{ … }
enum tb_eeprom_transfer { … };
static int tb_eeprom_active(struct tb_switch *sw, bool enable)
{ … }
static int tb_eeprom_transfer(struct tb_switch *sw, struct tb_eeprom_ctl *ctl,
enum tb_eeprom_transfer direction)
{ … }
static int tb_eeprom_out(struct tb_switch *sw, u8 val)
{ … }
static int tb_eeprom_in(struct tb_switch *sw, u8 *val)
{ … }
static int tb_eeprom_get_drom_offset(struct tb_switch *sw, u16 *offset)
{ … }
static int tb_eeprom_read_n(struct tb_switch *sw, u16 offset, u8 *val,
size_t count)
{ … }
static u8 tb_crc8(u8 *data, int len)
{ … }
static u32 tb_crc32(void *data, size_t len)
{ … }
#define TB_DROM_DATA_START …
#define TB_DROM_HEADER_SIZE …
#define USB4_DROM_HEADER_SIZE …
struct tb_drom_header { … } __packed;
enum tb_drom_entry_type { … };
struct tb_drom_entry_header { … } __packed;
struct tb_drom_entry_generic { … } __packed;
struct tb_drom_entry_port { … } __packed;
struct tb_drom_entry_desc { … };
int tb_drom_read_uid_only(struct tb_switch *sw, u64 *uid)
{ … }
static int tb_drom_parse_entry_generic(struct tb_switch *sw,
struct tb_drom_entry_header *header)
{ … }
static int tb_drom_parse_entry_port(struct tb_switch *sw,
struct tb_drom_entry_header *header)
{ … }
static int tb_drom_parse_entries(struct tb_switch *sw, size_t header_size)
{ … }
static int tb_drom_copy_efi(struct tb_switch *sw, u16 *size)
{ … }
static int tb_drom_copy_nvm(struct tb_switch *sw, u16 *size)
{ … }
static int usb4_copy_drom(struct tb_switch *sw, u16 *size)
{ … }
static int tb_drom_bit_bang(struct tb_switch *sw, u16 *size)
{ … }
static int tb_drom_parse_v1(struct tb_switch *sw)
{ … }
static int usb4_drom_parse(struct tb_switch *sw)
{ … }
static int tb_drom_parse(struct tb_switch *sw, u16 size)
{ … }
static int tb_drom_host_read(struct tb_switch *sw)
{ … }
static int tb_drom_device_read(struct tb_switch *sw)
{ … }
int tb_drom_read(struct tb_switch *sw)
{ … }