Versions Compared

Key

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

...

Anchor11073231107323 NetDev_WiFi_CfgIntCtrl() Anchor11073891107389This 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. Anchor11073901107390

Files

...

1107391net_bsp.c Anchor11073971107397

Prototype

...

static void NetDev_CfgIntCtrl NET_ERR *perr);
HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan2
Anchor
11073941107394
Code Block
          static void NetDev_CfgIntCtrl (NET_IF  *
pif,
Anchor
11515511151551
Table Row (tr)

...

p_if,
                                         NET_ERR *p_err);

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

Arguments

...

1107400p_if Anchor11323561132356

Pointer to specific interface to configure device’s interrupts.

...

p_erranchor11323581132358

Pointer to variable that will receive the return error code from this function:

...

NET_DEV_ERR_NONE

...

NET_DEV_ERR_FAULT

...


1151926   Anchor11082421108242This is not an exclusive list of return errors and specific network device’s or device BSP functions may return any other specific errors as required. Anchor11081931108193

Returned Value

...

None. Anchor11074051107405

Required Configuration

...

None. Anchor11074491107449

Notes / Warnings

...

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:

...

...

  • 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 call NetIF_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:

...

...

  • <Board><Device>[Number]_IF_Nbr

...

  • <Board>

...

...

  • Development board name

...

  • <Device>

...

  • Network device name (or type)

...

  • [Number]

...

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

...

...

  • For example, the network device interface number variable for the #2 RS9110 wireless device on an Atmel AT91SAM9263-EK should be named AT91SAM9263-EK_RS9110_2_IF_Nbr.

...

...

  • Network device interface number variables should be initialized to NET_IF_NBR_NONE at system initialization prior to being configured by their respective devices.

...

...

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

...

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

...

  • NetDev_WiFi_[Device]CfgIntCtrl[Number]()

...

  • [Device]

...

...

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

...

...

  • [Number]

...

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

...

  • For example, the NetDev_CfgIntCtrl() function for the #2 RS9110 wireless device on an Atmel AT91SAM9263-EK should be named NetDev_WiFi_RS9110_CfgIntCtrl2(), or NetDev_WiFi_RS9110_CfgIntCtrl_2() with additional underscore optional.

...

See also Chapter 6, “Network section Network Board Support Package” on page 121Package.anchor

Examples

...

static void NET_ERR *p_err) { /* Configure AT91SAM9263-EK RS9110 #2's specific IF number. */

                                                       NET_ERR *p_err)
          {
                                         /* Configure AT91SAM9263-EK RS9110 #2's specific IF number.       */
              AT91SAM9263-EK__WiFi_RS9110_2_IF_Nbr = pif->Nbr;
/* Configure AT91SAM9263-EK RS9110 #2's interrupts: */ /* Configure interrupt vector. */

                                         /* Configure AT91SAM9263-EK RS9110 #2's interrupts:               */
                                         /* Configure interrupt vector.                                    */
              BSP_IntVectSet(BSP_INT, &NetDev_WiFi_RS9110_ISR_Handler_2);

              BSP_IntEn(BSP_INT);        /* Enable    interrupts.
*/   *perr =
                                          */
           
             *p_err = NET_DEV_ERR_NONE;
}     static void

          }
           
           
          static  void  NetDev_WiFi_RS9110_CfgIntCtrlRx_2 (NET_IF  *p_if,
NET_ERR *p_err) { /* Configure AT91SAM9263-EK RS9110 #2's specific IF number. */

                                                           NET_ERR *p_err)
          {
                                         /* Configure AT91SAM9263-EK RS9110 #2's specific IF number.       */
              AT91SAM9263-EK_WiFi_RS9110_2_IF_Nbr = pif->Nbr;
/* Configure AT91SAM9263-EK RS9110 #2's receive interrupt: */ /* Configure interrupt vector. */

                                         /* Configure AT91SAM9263-EK RS9110 #2's receive interrupt:        */
                                         /* Configure interrupt vector.                                    */
              BSP_IntVectSet(BSP_INT_RX, &NetDev_WiFi_RS9100_ISR_HandlerRx_2);
                     
              BSP_IntEn(BSP_INT_RX);     /* Enable    interrupt.
*/   *perr =
                                           */
           
             *p_err = NET_DEV_ERR_NONE;
}tr

          }
HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan13
Anchor
11536571153657
Code Block

          static  void  NetDev_WiFi_RS9110_CfgIntCtrl (NET_IF  *p_if,
Anchor
11536581153658
Anchor
11515541151554
Anchor
11515551151555
Anchor
11515561151556
Anchor
11536521153652
Anchor
11536531153653
Anchor
11536711153671
Anchor
11536541153654
Anchor
11536291153629
Anchor
11515611151561
Anchor
11515621151562
Anchor
11515631151563
Anchor
11515641151564
Anchor
11515651151565
Anchor
11515661151566
Anchor
11515671151567
Anchor
11515681151568
Anchor
11515691151569
Anchor
11515701151570
Anchor
11539011153901
Anchor
11515711151571
Anchor
11515721151572
Anchor
11515731151573
Anchor
11515741151574
Anchor
11515751151575
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)