From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJR1I-0001MB-In for qemu-devel@nongnu.org; Mon, 18 Aug 2014 13:47:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJR19-0007yu-Ha for qemu-devel@nongnu.org; Mon, 18 Aug 2014 13:47:00 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:60632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJR19-0007yd-32 for qemu-devel@nongnu.org; Mon, 18 Aug 2014 13:46:51 -0400 Received: by mail-wi0-f178.google.com with SMTP id hi2so4059107wib.17 for ; Mon, 18 Aug 2014 10:46:50 -0700 (PDT) Date: Mon, 18 Aug 2014 19:46:44 +0200 From: Marc =?UTF-8?B?TWFyw60=?= Message-ID: <20140818194644.308c3f25@crunchbang> In-Reply-To: <1408365973-15498-7-git-send-email-marc.mari.barcelo@gmail.com> References: <1408365973-15498-1-git-send-email-marc.mari.barcelo@gmail.com> <1408365973-15498-7-git-send-email-marc.mari.barcelo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v5 6/7] libqos: Added MSI-X support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marc =?UTF-8?B?TWFyw60=?= Cc: Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi >El Mon, 18 Aug 2014 14:46:11 +0200 >Marc Mar=C3=AD escribi=C3=B3: > +void qpci_msix_enable(QPCIDevice *dev) > +{ > + uint8_t addr; > + uint16_t val; > + uint32_t table; > + uint8_t bir_table; > + uint8_t bir_pba; > + void *offset; > + > + addr =3D qpci_find_capability(dev, PCI_CAP_ID_MSIX); > + g_assert_cmphex(addr, !=3D, 0); > + > + val =3D qpci_config_readw(dev, addr + PCI_MSIX_FLAGS); > + qpci_config_writew(dev, addr + PCI_MSIX_FLAGS, val | > PCI_MSIX_FLAGS_ENABLE); + > + table =3D qpci_config_readl(dev, addr + PCI_MSIX_TABLE); > + bir_table =3D table & PCI_MSIX_FLAGS_BIRMASK; > + offset =3D qpci_iomap(dev, bir_table); > + dev->msix_table =3D offset + (table & ~PCI_MSIX_FLAGS_BIRMASK); > + > + table =3D qpci_config_readl(dev, addr+PCI_MSIX_PBA); > + bir_pba =3D table & PCI_MSIX_FLAGS_BIRMASK; > + if (bir_pba !=3D bir_table) { > + offset =3D qpci_iomap(dev, bir_pba); qpci_iomap changed its prototype in one of the lastest pull requests. Both qpci_iomap should have a NULL as third parameter. Will change in next version. Marc