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

 

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

...

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:

  • 1 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.

...

See also function NetIF_ISR_Handler .

  • 2 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

...

Examples