Specifying the Interface Number of the Device ISR

NetDev_ISR_Handler() handles a network device’s interrupts on a specific interface.

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. The application must configure the interrupt controller to call every network device’s unique NetDev_ISR_Handler() when the device’s interrupt occurs (see NetDev_CfgIntCtrl). Every unique NetDev_ISR_Handler() must then perform the following actions:

  1. Call NetIF_ISR_Handler() with the device’s unique network interface number and appropriate interrupt type. The network interface number should be available in the device’s NetDev_CfgIntCtrl() function after configuration (see 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(). This is possible when the device’s driver is able to determine the device’s interrupt type via internal device registers or the interrupt controller. In this case, NetDev_ISR_Handler() calls NetIF_ISR_Handler() with interrupt type code NET_DEV_ISR_TYPE_UNKNOWN.

    However, some devices cannot determine the interrupt type when an interrupt occurs and may therefore require multiple, unique NetDev_ISR_Handler()’s, each of which calls NetIF_ISR_Handler() with the appropriate interrupt type code.

    Ethernet physical layer (PHY) interrupts should call NetIF_ISR_Handler() with interrupt type code NET_DEV_ISR_TYPE_PHY.

  2. Clear the device’s interrupt source, possibly via an external or CPU-integrated interrupt controller source.

See NetDev_WiFi_ISR_Handler for more information.