瀏覽代碼

[intel] Report any unexpected interrupt causes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 年之前
父節點
當前提交
63dcab002e
共有 2 個文件被更改,包括 10 次插入0 次删除
  1. 8
    0
      src/drivers/net/intel.c
  2. 2
    0
      src/drivers/net/intel.h

+ 8
- 0
src/drivers/net/intel.c 查看文件

@@ -759,6 +759,14 @@ static void intel_poll ( struct net_device *netdev ) {
759 759
 	if ( icr & INTEL_IRQ_LSC )
760 760
 		intel_check_link ( netdev );
761 761
 
762
+	/* Check for unexpected interrupts */
763
+	if ( icr & ~( INTEL_IRQ_TXDW | INTEL_IRQ_TXQE | INTEL_IRQ_LSC |
764
+		      INTEL_IRQ_RXDMT0 | INTEL_IRQ_RXT0 | INTEL_IRQ_RXO ) ) {
765
+		DBGC ( intel, "INTEL %p unexpected ICR %08x\n", intel, icr );
766
+		/* Report as a TX error */
767
+		netdev_tx_err ( netdev, NULL, -ENOTSUP );
768
+	}
769
+
762 770
 	/* Refill RX ring */
763 771
 	intel_refill_rx ( intel );
764 772
 }

+ 2
- 0
src/drivers/net/intel.h 查看文件

@@ -91,7 +91,9 @@ enum intel_descriptor_status {
91 91
 /** Interrupt Cause Read Register */
92 92
 #define INTEL_ICR 0x000c0UL
93 93
 #define INTEL_IRQ_TXDW		0x00000001UL	/**< Transmit descriptor done */
94
+#define INTEL_IRQ_TXQE		0x00000002UL	/**< Transmit queue empty */
94 95
 #define INTEL_IRQ_LSC		0x00000004UL	/**< Link status change */
96
+#define INTEL_IRQ_RXDMT0	0x00000010UL	/**< Receive queue low */
95 97
 #define INTEL_IRQ_RXT0		0x00000080UL	/**< Receive timer */
96 98
 #define INTEL_IRQ_RXO		0x00000400UL	/**< Receive overrun */
97 99
 

Loading…
取消
儲存