Newer
Older
/*
* SPDX-License-Identifier: LGPL-3.0-or-later
* Copyright (C) 2020 CERN (www.cern.ch)
* Author: Federico Vaga <federico.vaga@cern.ch>
*/
#ifndef _FMC_CORE_H
#define _FMC_CORE_H
struct fmc_tkn;
#define FMC_ID_INVALID 0xFFFFFFFF
unsigned int *fmc_carrier_id_list_get(void);
void fmc_carrier_id_list_put(unsigned int *id_list);
unsigned int *fmc_slot_id_list_get(struct fmc_tkn *tkn);
void fmc_slot_id_list_put(unsigned int *id_list);
struct fmc_tkn *fmc_carrier_open(unsigned int carrier_id);
void fmc_carrier_close(struct fmc_tkn *tkn);
int fmc_carrier_name(struct fmc_tkn *tkn, char *buf, size_t count);
bool fmc_slot_is_present(struct fmc_tkn *tkn, unsigned int slot_n);
bool fmc_slot_is_fru_valid(struct fmc_tkn *tkn, unsigned int slot_n);
int fmc_slot_geo_address(struct fmc_tkn *tkn, unsigned int slot_n,
unsigned int *ga);
int fmc_slot_eeprom_type_get(struct fmc_tkn *tkn, unsigned int slot_n,
char *str, size_t max_len);
int fmc_slot_eeprom_type_set(struct fmc_tkn *tkn, unsigned int slot_n,
int fmc_slot_eeprom_size(struct fmc_tkn *tkn, unsigned int slot_n,
unsigned int *size);
int fmc_slot_eeprom_read(struct fmc_tkn *tkn, unsigned int slot_n,
char *buf, size_t len, off_t offset);
int fmc_slot_eeprom_write(struct fmc_tkn *tkn, unsigned int slot_n,
const char *buf, size_t len, off_t offset);