uint16_t msgctrl, rwmask, msgdata, mme;
uint32_t addrlo;
/* Convert a 4-byte write at offset 0 into a 2-byte write at 2 */
if (offset == capoff && bytes == 4) {
offset += 2;
bytes -= 2;
val >>= 16;
}
/*
* If guest is writing to the message control register make sure
* we do not overwrite read-only fields.
if (coff == PCIR_COMMAND) {
if (bytes <= 2)
return (-1);
*rv = pci_get_cfgdata16(pi, PCIR_COMMAND) << 16 |
*rv = pci_get_cfgdata16(pi, PCIR_COMMAND) |
read_config(&sc->psc_sel, PCIR_STATUS, 2);
read_config(&sc->psc_sel, PCIR_STATUS, 2) << 16;
return (0);