...
Each network device’s interrupt, or set of device interrupts, must be handled by a unique BSP-level interrupt service routine (ISR) handler, NetDev_ISR_Handler()
, which maps each specific device interrupt to its corresponding network interface ISR handler, NetIF_ISR_Handler()
. For some CPUs this may be a first- or second-level interrupt handler. Generally, the application must configure the interrupt controller to call every network device’s unique NetDev_ISR_Handler()
when the device’s interrupt occurs (see function NetDev_CfgIntCtrl()). Every unique NetDev_ISR_Handler()
must then perform the following actions:
- Call
NetIF_ISR_Handler()
with the device’s unique network interface number and appropriate interrupt type. The device’s network interface number should be available after configuration in the device’sNetDev_CfgIntCtrl()
function (see function NetDev_CfgIntCtrl()).NetIF_ISR_Handler()
in turn calls the appropriate device driver’s interrupt handler.In most cases, each device requires only a single
NetDev_ISR_Handler()
which callsNetIF_ISR_Handler()
with interrupt type codeNET_DEV_ISR_TYPE_UNKNOWN
. This is possible when the device’s driver can determine the device’s interrupt type to via internal device registers or the interrupt controller. However, some devices cannot generically determine the interrupt type when an interrupt occurs and may therefore require multiple, uniqueNetDev_ISR_Handler()
’s each of which callsNetIF_ISR_Handler()
with the appropriate interrupt type code.Ethernet Physical layer (Phy) interrupts should call
NetIF_ISR_Handler()
with interrupt type codeNET_DEV_ISR_TYPE_PHY
.See also function NetIF_ISR_Handler().
- Clear the device’s interrupt source, possibly via an external or CPU-integrated interrupt controller source.
...