Skip to content

Commit

Permalink
xhci: add xhci_get_flag
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
kraxel committed May 26, 2014
1 parent 058fdcf commit f995523
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hw/usb/hcd-xhci.c
Expand Up @@ -621,6 +621,11 @@ static const char *ep_state_name(uint32_t state)
ARRAY_SIZE(ep_state_names));
}

static bool xhci_get_flag(XHCIState *xhci, enum xhci_flags bit)
{
return xhci->flags & (1 << bit);
}

static uint64_t xhci_mfindex_get(XHCIState *xhci)
{
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
Expand Down Expand Up @@ -3599,10 +3604,10 @@ static int usb_xhci_initfn(struct PCIDevice *dev)
assert(ret >= 0);
}

if (xhci->flags & (1 << XHCI_FLAG_USE_MSI)) {
if (xhci_get_flag(xhci, XHCI_FLAG_USE_MSI)) {
msi_init(dev, 0x70, xhci->numintrs, true, false);
}
if (xhci->flags & (1 << XHCI_FLAG_USE_MSI_X)) {
if (xhci_get_flag(xhci, XHCI_FLAG_USE_MSI_X)) {
msix_init(dev, xhci->numintrs,
&xhci->mem, 0, OFF_MSIX_TABLE,
&xhci->mem, 0, OFF_MSIX_PBA,
Expand Down

0 comments on commit f995523

Please sign in to comment.