mirror of
https://github.com/ipxe/ipxe
synced 2025-12-15 00:12:19 +03:00
[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:
@@ -63,35 +63,20 @@ int intelxl_msix_enable ( struct intelxl_nic *intelxl,
|
|||||||
struct pci_device *pci, unsigned int vector ) {
|
struct pci_device *pci, unsigned int vector ) {
|
||||||
int rc;
|
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 */
|
/* 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",
|
DBGC ( intelxl, "INTELXL %p could not enable MSI-X: %s\n",
|
||||||
intelxl, strerror ( rc ) );
|
intelxl, strerror ( rc ) );
|
||||||
goto err_enable;
|
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 */
|
/* Enable dummy interrupt */
|
||||||
pci_msix_unmask ( &intelxl->msix.cap, vector );
|
pci_msix_unmask ( &intelxl->msix, vector );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pci_msix_disable ( pci, &intelxl->msix.cap );
|
pci_msix_disable ( pci, &intelxl->msix );
|
||||||
err_enable:
|
err_enable:
|
||||||
dma_unmap ( &intelxl->msix.map, sizeof ( intelxl->msix.msg ) );
|
|
||||||
err_map:
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,13 +91,10 @@ void intelxl_msix_disable ( struct intelxl_nic *intelxl,
|
|||||||
struct pci_device *pci, unsigned int vector ) {
|
struct pci_device *pci, unsigned int vector ) {
|
||||||
|
|
||||||
/* Disable dummy interrupts */
|
/* Disable dummy interrupts */
|
||||||
pci_msix_mask ( &intelxl->msix.cap, vector );
|
pci_msix_mask ( &intelxl->msix, vector );
|
||||||
|
|
||||||
/* Disable MSI-X capability */
|
/* Disable MSI-X capability */
|
||||||
pci_msix_disable ( pci, &intelxl->msix.cap );
|
pci_msix_disable ( pci, &intelxl->msix );
|
||||||
|
|
||||||
/* Unmap dummy target location */
|
|
||||||
dma_unmap ( &intelxl->msix.map, sizeof ( intelxl->msix.msg ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|||||||
@@ -891,16 +891,6 @@ intelxl_init_ring ( struct intelxl_ring *ring, unsigned int count, size_t len,
|
|||||||
#define INTELXL_PFGEN_PORTNUM_PORT_NUM(x) \
|
#define INTELXL_PFGEN_PORTNUM_PORT_NUM(x) \
|
||||||
( ( (x) >> 0 ) & 0x3 ) /**< Port number */
|
( ( (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 */
|
/** MSI-X interrupt vector */
|
||||||
#define INTELXL_MSIX_VECTOR 0
|
#define INTELXL_MSIX_VECTOR 0
|
||||||
|
|
||||||
@@ -934,7 +924,7 @@ struct intelxl_nic {
|
|||||||
/** PCI Express capability offset */
|
/** PCI Express capability offset */
|
||||||
unsigned int exp;
|
unsigned int exp;
|
||||||
/** MSI-X interrupt */
|
/** MSI-X interrupt */
|
||||||
struct intelxl_msix msix;
|
struct pci_msix msix;
|
||||||
|
|
||||||
/** Admin command queue */
|
/** Admin command queue */
|
||||||
struct intelxl_admin command;
|
struct intelxl_admin command;
|
||||||
|
|||||||
Reference in New Issue
Block a user