![Broadcom NetXtreme/NetLink BCM5717 Programmer'S Manual Download Page 233](http://html.mh-extra.com/html/broadcom/netxtreme-netlink-bcm5717/netxtreme-netlink-bcm5717_programmers-manual_2815650233.webp)
Basic Driver Interrupt Processing Flow
BCM5718 Programmer’s Guide
Broadcom
®
January 29, 2016 • 5718-PG108-R
Page 233
Interrupt Procedure
1.
Acknowledge interrupt. Write a nonzero value (i.e., value = 1) to the interrupt mailbox 0 (see registers
0x270–0x304) to indicate that the driver is currently processing the interrupt. This step disables device
interrupts except during interrupt feature.
2.
Read and save the value of the Status Tag field of the Status Block (see
).
3.
Claim interrupt. Determine if the Ethernet controller action is required. Read the Updated bit of the status
word. If the Updated bit is asserted, then the host coalescing engine has updated the status block.
4.
Clear the Updated bit of the status word. This indicates that the host driver either has or will touch the status
block. If a during interrupt event is driven, the host driver can examine the Updated bit to determine if a fresh
status block has been moved to host memory space.
5.
Check for RX traffic.
• Loop through enabled RX Return Rings (0 to 3).
• Check for difference between RX Return Ring Producer index (Status block) and RX Return Ring
Consumer index (value written to mailbox on previous call) are the number of frames to process for RX
Return Ring.
• Process the packet.
• Update the RX Return Ring consumer pointer in each mailbox for new RX frames.
6.
Check for TX completes.
• Loop through enabled TX Send Rings.
• Check for difference between previous consumer index (software kept) and current consumer index in
the status block. These are the TX BDs which can be made available to next send operation.
• Update the previous consumer index (i.e., next call) to the value of the status block consumer index.
7.
Compare the current value of the Status Tag to the saved value of the Status Tag. Flush status block (i.e.,
force update of status blocks cached by PCI bridge).
• Read interrupt mailbox (see “Interrupt Mailbox 0 (High Priority Mailbox) Register (offset: 0x200-207) for
host standard and “Interrupt Mailbox 0 Register (offset: 0x5800)” for indirect mode).
• Check the Updated bit in the status word located in the status block. If the Updated bit is asserted, then
new data has been DMAed to the host. Repeat steps 5 and 6.
8.
Check the Error bit in status word (optional). The driver may check the state machine/FTQ status registers
for various attentions.
9.
Enable interrupts. When Status Tagged Status mode bit of the Miscellaneous Host Control register (see
“Miscellaneous Host Control Register (offset: 0x68)” on page 282
) is set to 1, then write the saved Status
Tag to the upper 8 bits of Interrupt Mailbox 0, and 0 to the remaining bits (23 down to 0) to indicate that the
ISR is done processing RX/TX. Otherwise, write 0 to Interrupt Mailbox 0 register. This step also clears
existing interrupts.