svec-fmc: provide fake null EEPROM for empty slots

This kludge is made to cheat the fmc-bus into the belief
that a valid EEPROM with no FRU information was read,
given that FMC_DEVICE_NO_MEZZANINE is not used in it.
parent a86fe4f3
......@@ -235,6 +235,8 @@ int svec_fmc_prepare(struct svec_dev *svec, unsigned int fmc_slot)
return ret;
}
static uint8_t svec_void_eeprom[10];
int svec_fmc_create(struct svec_dev *svec)
{
int i;
......@@ -245,6 +247,14 @@ int svec_fmc_create(struct svec_dev *svec)
error = svec_fmc_prepare(svec, i);
if (error)
goto failed;
/* FIXME: this kludge must be replaced by a
* proper copy from a template; all this code
* is badly broken */
if (svec->fmcs[i]->flags & FMC_DEVICE_NO_MEZZANINE) {
svec->fmcs[i]->eeprom = svec_void_eeprom;
svec->fmcs[i]->eeprom_len = sizeof(svec_void_eeprom);
svec->fmcs[i]->eeprom_addr = 0xff;
}
}
/* fmc device creation */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment