Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Include Page
css.uC-TCP-IP Wireless Device Driver APIs.css
css.uC-TCP-IP Wireless Device Driver APIs.css
Include Page
css.webworks.css
css.webworks.css

Anchor
110807611147421108076
1114742
NetDev_ISR_Handler()

Anchor
110836211147431108362
Handle a network device’s interrupts on a specific interface
1114743
A device’s ISR_Handler() function is used to handle each device’s interrupts. See section 7-5-5 “NetDev_ISR_Handler()” on page 164 for more details on how to handle each device’s interrupts.

Anchor
110836411147441108364
1114744
Files

Anchor
110836511116791108365
1111679
Every device driver’s net_bspdev.c

Anchor
110833211116851108332
1111685
Prototype

Anchor
112355711233561123557
1123356
 

HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan2

Anchor
110832911146611108329
1114661
static void NetDev_ISR_Handler (voidNET_IF *pif,

Anchor
1151496
1151496
NET_DEV_ISR_TYPE type);

Table Row (tr)

Anchor
110833311116861108333
1111686
Note that since NetDev_every device driver’s ISR_Handler() function is accessed only by function pointer usually via an interrupt vector tablevia the device driver’s API structure, it doesn’t need to be globally available and should therefore be declared as ‘static’.

Anchor
110827711116871108277
1111687
Arguments

Anchor
110839511116881108395
1111688
None. pif

Anchor
110830811320441108308
Returned Value Anchor11083091108309 None
1132044
Pointer to the interface to handle network device interrupts.

Anchor
110831011116911108310
1111691
Required Configuration type

Anchor
110831111320461108311
None.
1132046
Device’s interrupt type:

Anchor
110831211147021108312
Notes / Warnings
1114702
NET_DEV_ISR_TYPE_UNKNOWN

Anchor11194871119487 In most cases, each device requires only a single NetDev_ISR_Handler() which calls NetIF_ISR_Handler() with interrupt type code

Anchor
110840711514971108407
Each network device’s interrupt, or set of device interrupts, must be handled by a unique BSP-level interrupt service routine (ISR) handler, NetDev_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_ISR_Handler() when the device’s interrupt occurs (see section A-3-3 on page 340). Every unique NetDev_ISR_Handler() must then perform the following actions:

...

1151497
NET_DEV_ISR_TYPE_RX

Anchor
1151498
1151498
NET_DEV_ISR_TYPE_RX_RUNT

Anchor
1151499
1151499
NET_DEV_ISR_TYPE_UNKNOWN. This is possible when the device’s driver can determine the device’s interrupt type to via internal device registers or the interrupt controller. However, some devices cannot generically determine the interrupt type when an interrupt occurs and may therefore require multiple, unique NetDev_ISR_Handler()’s each of which calls NetIF_ISR_Handler() with the appropriate interrupt type code. Anchor11195011119501 Ethernet Physical layer (Phy) interrupts should call NetIF_ISR_Handler() with interrupt type code RX_OVERRUN

Anchor
1151500
1151500
NET_DEV_ISR_TYPE_PHY.TX_RDY

Anchor
111950811515011119508
See also section C-9-12 “NetIF_ISR_Handler()” on page 519.
1151501
NET_DEV_ISR_TYPE_TX_COMPLETE

Anchor

...

1151502

...

rowspan18

...

1151502
NET_DEV_ISR_TYPE_TX_COLLISION_LATE

Anchor
1151503
1151503
NET_DEV_ISR_TYPE_TX_COLLISION_EXCESS

Anchor
1151504
1151504
NET_DEV_ISR_TYPE_JABBER

Anchor
1151505
1151505
NET_DEV_ISR_TYPE_BABBLE

Anchor
1151506
1151506
NET_DEV_ISR_TYPE_

...

PHY

Anchor

...

1111692

...

1111692
Returned Value

Anchor

...

1111693

...

1111693

...

None.

Anchor

...

1111694

...

1111694

...

Required Configuration

Anchor

...

1111695

...

1111695

...

None.

Anchor

...

1111696

...

1111696
Notes / Warnings

Anchor

...

1111697

...

1111697
Each device’s NetDev_ISR_Handler(

...

) should never return early but check all applicable interrupt sources to see if they are active. This additional checking is necessary because multiple interrupt sources may be set within the interrupt response time and will reduce the number and overhead of handling interrupts.