NetDev_WiFi_ISR_Handler

Handle a network device’s interrupts on a specific interface.

Files

net_bsp.c

Prototype


          static void NetDev_ISR_Handler (void);

Note that since NetDev_ISR_Handler() is accessed only by function pointer usually via an interrupt vector table, it doesn’t need to be globally available and should therefore be declared as ‘static’.

Arguments

None.

Returned Value

None.

Required Configuration

None.

Notes / Warnings

Each network device’s interrupt, or set of device interrupts, must be handled by a unique BSP-level interrupt service routine (ISR) handler, NetDev_WiFi_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_WiFi_ISR_Handler() when the device’s interrupt occurs (see function NetDev_WiFi_IntCtrl). Every unique NetDev_WiFi_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’s NetDev_WiFi_CfgIntCtrl() function (see function NetDev_WiFi_IntCtrl). NetIF_ISR_Handler() in turn calls the appropriate device driver’s interrupt handler.

    In most cases, each device requires only a single NetDev_WiFi_ISR_Handler() which calls NetIF_ISR_Handler() with interrupt type code NET_DEV_ISR_TYPE_UNKNOWN. This is possible when the device’s driver can determine the device’s interrupt type to via the interrupt controller. However, some devices cannot generically determine the interrupt type when an interrupt occurs and may therefore require multiple, unique NetDev_WiFi_ISR_Handler()’s each of which calls NetIF_ISR_Handler() with the appropriate interrupt type code. See also function NetIF_ISR_Handler .

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

Since each network device requires a unique NetDev_WiFi_ISR_Handler() for each device interrupt, it is recommended that each device’s NetDev_WiFi_ISR_Handler() function be named using the following convention:

NetDev_WiFi_[Device]ISR_Handler[Type][Number]()
[Device]

Network device name or type, e.g., RS9110 (optional if the development board does not support multiple devices)

[Type]

Network device interrupt type, e.g., receive interrupt (optional if interrupt type is generic or unknown)

[Number]

Network device number for each specific instance of device (optional if the development board does not support multiple instances of a specific device)

For example, the receive ISR handler for the #2 RS9110 wireless device on an Atmel AT91SAM9263-EK should be named NetDev_WiFi_RS9110_ISR_HandlerRx2().

See also section Network Board Support Package.

Examples

          static void NetDev_WiFi_RS9110_ISR_Handler_2 (void)
          {
              NET_ERR  err;
           
              NetIF_ISR_Handler(AT91SAM9263-EK_RS9110_2_IF_Nbr, NET_DEV_ISR_TYPE_UNKNOWN, &err);
              /* Clear external or CPU's integrated interrupt controller. */
          }
           
           
          static void NetDev_WiFi_RS9110_ISR_HandlerRx_2 (void)
          {
              NET_ERR  err;
           
              NetIF_ISR_Handler(AT91SAM9263-EK_RS9110_2_IF_Nbr, NET_DEV_ISR_TYPE_RX, &err);
              /* Clear external or CPU's integrated interrupt controller. */
          }