Browse Source

[intelxl] Allow for arbitrary placement of interrupt control register

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 5 years ago
parent
commit
1e0342ebd8
2 changed files with 11 additions and 12 deletions
  1. 6
    9
      src/drivers/net/intelxl.c
  2. 5
    3
      src/drivers/net/intelxl.h

+ 6
- 9
src/drivers/net/intelxl.c View File

1509
 
1509
 
1510
 	/* Acknowledge interrupts, if applicable */
1510
 	/* Acknowledge interrupts, if applicable */
1511
 	if ( netdev_irq_enabled ( netdev ) ) {
1511
 	if ( netdev_irq_enabled ( netdev ) ) {
1512
-		writel ( ( INTELXL_PFINT_DYN_CTL0_CLEARPBA |
1513
-			   INTELXL_PFINT_DYN_CTL0_INTENA_MASK ),
1514
-			 intelxl->regs + INTELXL_PFINT_DYN_CTL0 );
1512
+		writel ( ( INTELXL_INT_DYN_CTL_CLEARPBA |
1513
+			   INTELXL_INT_DYN_CTL_INTENA_MASK ),
1514
+			 ( intelxl->regs + intelxl->intr ) );
1515
 	}
1515
 	}
1516
 
1516
 
1517
 	/* Poll for completed packets */
1517
 	/* Poll for completed packets */
1536
 static void intelxl_irq ( struct net_device *netdev, int enable ) {
1536
 static void intelxl_irq ( struct net_device *netdev, int enable ) {
1537
 	struct intelxl_nic *intelxl = netdev->priv;
1537
 	struct intelxl_nic *intelxl = netdev->priv;
1538
 
1538
 
1539
-	if ( enable ) {
1540
-		writel ( INTELXL_PFINT_DYN_CTL0_INTENA,
1541
-			 intelxl->regs + INTELXL_PFINT_DYN_CTL0 );
1542
-	} else {
1543
-		writel ( 0, intelxl->regs + INTELXL_PFINT_DYN_CTL0 );
1544
-	}
1539
+	writel ( ( enable ? INTELXL_INT_DYN_CTL_INTENA : 0 ),
1540
+		 ( intelxl->regs + intelxl->intr ) );
1545
 }
1541
 }
1546
 
1542
 
1547
 /** Network device operations */
1543
 /** Network device operations */
1585
 	netdev->dev = &pci->dev;
1581
 	netdev->dev = &pci->dev;
1586
 	memset ( intelxl, 0, sizeof ( *intelxl ) );
1582
 	memset ( intelxl, 0, sizeof ( *intelxl ) );
1587
 	intelxl->pf = PCI_FUNC ( pci->busdevfn );
1583
 	intelxl->pf = PCI_FUNC ( pci->busdevfn );
1584
+	intelxl->intr = INTELXL_PFINT_DYN_CTL0;
1588
 	intelxl_init_admin ( &intelxl->command, INTELXL_ADMIN_CMD,
1585
 	intelxl_init_admin ( &intelxl->command, INTELXL_ADMIN_CMD,
1589
 			     &intelxl_admin_offsets );
1586
 			     &intelxl_admin_offsets );
1590
 	intelxl_init_admin ( &intelxl->event, INTELXL_ADMIN_EVT,
1587
 	intelxl_init_admin ( &intelxl->event, INTELXL_ADMIN_EVT,

+ 5
- 3
src/drivers/net/intelxl.h View File

735
 
735
 
736
 /** PF Interrupt Zero Dynamic Control Register */
736
 /** PF Interrupt Zero Dynamic Control Register */
737
 #define INTELXL_PFINT_DYN_CTL0 0x038480
737
 #define INTELXL_PFINT_DYN_CTL0 0x038480
738
-#define INTELXL_PFINT_DYN_CTL0_INTENA	0x00000001UL	/**< Enable */
739
-#define INTELXL_PFINT_DYN_CTL0_CLEARPBA	0x00000002UL	/**< Acknowledge */
740
-#define INTELXL_PFINT_DYN_CTL0_INTENA_MASK 0x80000000UL	/**< Ignore enable */
738
+#define INTELXL_INT_DYN_CTL_INTENA	0x00000001UL	/**< Enable */
739
+#define INTELXL_INT_DYN_CTL_CLEARPBA	0x00000002UL	/**< Acknowledge */
740
+#define INTELXL_INT_DYN_CTL_INTENA_MASK 0x80000000UL	/**< Ignore enable */
741
 
741
 
742
 /** PF Interrupt Zero Linked List Register */
742
 /** PF Interrupt Zero Linked List Register */
743
 #define INTELXL_PFINT_LNKLST0 0x038500
743
 #define INTELXL_PFINT_LNKLST0 0x038500
835
 	unsigned int vsi;
835
 	unsigned int vsi;
836
 	/** Queue set handle */
836
 	/** Queue set handle */
837
 	unsigned int qset;
837
 	unsigned int qset;
838
+	/** Interrupt control register */
839
+	unsigned int intr;
838
 
840
 
839
 	/** Admin command queue */
841
 	/** Admin command queue */
840
 	struct intelxl_admin command;
842
 	struct intelxl_admin command;

Loading…
Cancel
Save