This function is called by a device driver’s NetDev_Init()
to configure a specific network device’s interrupts and/or interrupt controller on a specific interface.
Files
net_bsp.c
Prototype
Note that since NetDev_WiFi_CfgIntCtrl()
is accessed only by function pointer via a BSP interface structure, it doesn’t need to be globally available and should therefore be declared as ‘static
’.
...
Each network device’s NetDev_WiFi_CfgIntCtrl()
should configure and enable all required interrupt sources for the network device. This usually means configuring the interrupt vector address of each corresponding network device BSP interrupt service routine (ISR) handler and enabling its corresponding interrupt source. Thus, for most NetDev_WiFi_CfgIntCtrl()
, the following actions should be performed:
- 1 Configure/store each device’s network interface number to be available for all necessary
NetDev_WiFi_ISR_Handler()
functions (see section B-3-13). Even though devices are added dynamically, the device’s interface number must be saved in order for each device’s ISR handlers to callNetIF_ISR_Handler()
with the device’s network interface number.
Since each network device maps to a unique network interface number, it is recommended that each instance of network devices’ interface numbers be named using the following convention:
[Number]_IF_Nbr
Development board name
Network device name (or type)
...
Network device interface number variables should be initialized to NET_IF_NBR_NONE
at system initialization prior to being configured by their respective devices.
- 2 Configure each of the device’s interrupts on either an external or CPU’s integrated interrupt controller. However, vectored interrupt controllers may not require the explicit configuration and enabling of higher-level interrupt controller sources. In this case, the application developer may need to configure the system’s interrupt vector table with the name of the ISR handler functions declared in
net_bsp.c
.
NetDev_WiFi_CfgIntCtrl()
should only enable each devices’ interrupt sources but not the local device-level interrupts themselves, which are enabled by the device driver only after the device has been fully configured and started.
...
See also Chapter 6, “Network Board Support Package”.
ExampleS