[intelxl] Use default dummy MSI-X target address

Use the default dummy MSI-X target address that is now allocated and
configured automatically by pci_msix_enable().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-10-09 16:27:49 +01:00
parent 4224f574da
commit 5438299649
2 changed files with 6 additions and 34 deletions

View File

@@ -63,35 +63,20 @@ int intelxl_msix_enable ( struct intelxl_nic *intelxl,
struct pci_device *pci, unsigned int vector ) {
int rc;
/* Map dummy target location */
if ( ( rc = dma_map ( intelxl->dma, &intelxl->msix.map,
&intelxl->msix.msg, sizeof ( intelxl->msix.msg ),
DMA_RX ) ) != 0 ) {
DBGC ( intelxl, "INTELXL %p could not map MSI-X target: %s\n",
intelxl, strerror ( rc ) );
goto err_map;
}
/* Enable MSI-X capability */
if ( ( rc = pci_msix_enable ( pci, &intelxl->msix.cap ) ) != 0 ) {
if ( ( rc = pci_msix_enable ( pci, &intelxl->msix ) ) != 0 ) {
DBGC ( intelxl, "INTELXL %p could not enable MSI-X: %s\n",
intelxl, strerror ( rc ) );
goto err_enable;
}
/* Configure interrupt to write to dummy location */
pci_msix_map ( &intelxl->msix.cap, vector,
dma ( &intelxl->msix.map, &intelxl->msix.msg ), 0 );
/* Enable dummy interrupt */
pci_msix_unmask ( &intelxl->msix.cap, vector );
pci_msix_unmask ( &intelxl->msix, vector );
return 0;
pci_msix_disable ( pci, &intelxl->msix.cap );
pci_msix_disable ( pci, &intelxl->msix );
err_enable:
dma_unmap ( &intelxl->msix.map, sizeof ( intelxl->msix.msg ) );
err_map:
return rc;
}
@@ -106,13 +91,10 @@ void intelxl_msix_disable ( struct intelxl_nic *intelxl,
struct pci_device *pci, unsigned int vector ) {
/* Disable dummy interrupts */
pci_msix_mask ( &intelxl->msix.cap, vector );
pci_msix_mask ( &intelxl->msix, vector );
/* Disable MSI-X capability */
pci_msix_disable ( pci, &intelxl->msix.cap );
/* Unmap dummy target location */
dma_unmap ( &intelxl->msix.map, sizeof ( intelxl->msix.msg ) );
pci_msix_disable ( pci, &intelxl->msix );
}
/******************************************************************************

View File

@@ -891,16 +891,6 @@ intelxl_init_ring ( struct intelxl_ring *ring, unsigned int count, size_t len,
#define INTELXL_PFGEN_PORTNUM_PORT_NUM(x) \
( ( (x) >> 0 ) & 0x3 ) /**< Port number */
/** MSI-X interrupt */
struct intelxl_msix {
/** PCI capability */
struct pci_msix cap;
/** MSI-X dummy interrupt target */
uint32_t msg;
/** DMA mapping for dummy interrupt target */
struct dma_mapping map;
};
/** MSI-X interrupt vector */
#define INTELXL_MSIX_VECTOR 0
@@ -934,7 +924,7 @@ struct intelxl_nic {
/** PCI Express capability offset */
unsigned int exp;
/** MSI-X interrupt */
struct intelxl_msix msix;
struct pci_msix msix;
/** Admin command queue */
struct intelxl_admin command;