Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Files

net_bsp.c

Prototype


Code Block
          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’.

...

  • 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

Code Block

          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. */
          }