NetDev_Stop() (Wireless)

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

Files

Every device driver’s net_dev.c

Prototype

          static void NetDev_Stop (NET_IF  *p_if,
                                   NET_ERR *p_err);

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

Arguments

p_if

Pointer to the interface to start a network device.

p_err

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

Returned Value

None.

Required Configuration

None.

Notes / Warnings

The Stop() function must perform the following operations:

  1. Disable the receiver and transmitter.
  2. Disable all local MAC interrupt sources.
  3. Clear all local MAC interrupt status flags.
  4. Power down the wireless device.
  5. Set p_err to NET_DEV_ERR_NONE if no error occurs. Otherwise, set p_err to an appropriate network device error code.