Versions Compared

Key

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

...

Anchor10919041091904 NetDev_Stop() Anchor11097611109761The next function within the device API structure is the device Stop() function. This function is called once each time an interface is stopped. Anchor11097811109781

Files

...

1109782Every device driver’s net_dev.c Anchor11097891109789

Prototype

...

static void NetDev_Stop NET_ERR *p_err);
HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan2
Anchor
11097851109785
Code Block

          static void NetDev_Stop (NET_IF  *
p_if,
Anchor
11514181151418
Table Row (tr)

...

pif,
                                   NET_ERR *perr);

Note that since every device driver’s Stop() function is accessed only by function pointer via the device driver’s API structure, it doesn’t need to be globally available and should therefore be declared as ‘static’static. Anchor11097911109791 Arguments Anchor11318421131842 p_if Anchor11318431131843

Arguments

pif

Pointer to the interface to start a network device.

Anchor11318441131844 p_err Anchor11318451131845perr

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

...

Returned Value

Anchor11097751109775None. Anchor11102631110263

Required Configuration

...

None. Anchor11102651110265

Notes / Warnings

...

The Stop() function must perform the following operations:

...

  1. 1091079Disable the receiver and transmitter. Anchor10910861091086
  2. Disable all local MAC interrupt sources.anchor
  3. 10910931091093Clear all local MAC interrupt status flags. Anchor10911001091100 Power down the wireless device. Anchor10911211091121 Set p_err
  4. For DMA devices, re-initialize all receive descriptors.
  5. For DMA devices, free all transmit descriptors by calling NetOS_IF_DeallocTaskPost() with the address of the transmit descriptor data areas.
  6. For DMA devices, re-initialize all transmit descriptors.
  7. Set perr to NET_DEV_ERR_NONE if no error occurs. Otherwise, set p_err perr to an appropriate network device error code.