Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

enum_wimax_st(9) [suse man page]

ENUM 
WIMAX_ST(9) Linux Networking ENUM WIMAX_ST(9) NAME
enum_wimax_st - The different states of a WiMAX device SYNOPSIS
enum wimax_st { __WIMAX_ST_NULL, WIMAX_ST_DOWN, __WIMAX_ST_QUIESCING, WIMAX_ST_UNINITIALIZED, WIMAX_ST_RADIO_OFF, WIMAX_ST_READY, WIMAX_ST_SCANNING, WIMAX_ST_CONNECTING, WIMAX_ST_CONNECTED, __WIMAX_ST_INVALID }; CONSTANTS
__WIMAX_ST_NULL The device structure has been allocated and zeroed, but still wimax_dev_add hasn't been called. There is no state. WIMAX_ST_DOWN The device has been registered with the WiMAX and networking stacks, but it is not initialized (normally that is done with 'ifconfig DEV up' [or equivalent], which can upload firmware and enable communications with the device). In this state, the device is powered down and using as less power as possible. This state is the default after a call to wimax_dev_add. It is ok to have drivers move directly to WIMAX_ST_UNINITIALIZED or WIMAX_ST_RADIO_OFF in _probe after the call to wimax_dev_add. It is recommended that the driver leaves this state when calling 'ifconfig DEV up' and enters it back on 'ifconfig DEV down'. __WIMAX_ST_QUIESCING The device is being torn down, so no API operations are allowed to proceed except the ones needed to complete the device clean up process. WIMAX_ST_UNINITIALIZED [optional] Communication with the device is setup, but the device still requires some configuration before being operational. Some WiMAX API calls might work. WIMAX_ST_RADIO_OFF The device is fully up; radio is off (wether by hardware or software switches). It is recommended to always leave the device in this state after initialization. WIMAX_ST_READY The device is fully up and radio is on. WIMAX_ST_SCANNING [optional] The device has been instructed to scan. In this state, the device cannot be actively connected to a network. WIMAX_ST_CONNECTING The device is connecting to a network. This state exists because in some devices, the connect process can include a number of negotiations between user space, kernel space and the device. User space needs to know what the device is doing. If the connect sequence in a device is atomic and fast, the device can transition directly to CONNECTED WIMAX_ST_CONNECTED The device is connected to a network. __WIMAX_ST_INVALID This is an invalid state used to mark the maximum numeric value of states. DESCRIPTION
Transitions from one state to another one are atomic and can only be caused in kernel space with wimax_state_change. To read the state, use wimax_state_get. States starting with __ are internal and shall not be used or referred to by drivers or userspace. They look ugly, but that's the point -- if any use is made non-internal to the stack, it is easier to catch on review. All API operations [with well defined exceptions] will take the device mutex before starting and then check the state. If the state is __WIMAX_ST_NULL, WIMAX_ST_DOWN, WIMAX_ST_UNINITIALIZED or __WIMAX_ST_QUIESCING, it will drop the lock and quit with -EINVAL, -ENOMEDIUM, -ENOTCONN or -ESHUTDOWN. The order of the definitions is important, so we can do numerical comparisons (eg: < WIMAX_ST_RADIO_OFF means the device is not ready to operate). COPYRIGHT
Kernel Hackers Manual 2.6. July 2010 ENUM WIMAX_ST(9)

Check Out this Related Man Page

ddi_get_devstate(9F)					   Kernel Functions for Drivers 				      ddi_get_devstate(9F)

NAME
ddi_get_devstate - Check device state SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> ddi_devstate_t ddi_get_devstate(dev_info_t *dip); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) PARAMETERS
dip Pointer to the device's dev_info structure DESCRIPTION
The ddi_get_devstate() function returns a value indicating the state of the device specified by dip, as derived from the configuration operations that have been performed on it (or on the bus on which it resides) and any fault reports relating to it. RETURN VALUES
DDI_DEVSTATE_OFFLINE The device is offline. In this state, the device driver is not attached, nor will it be attached automatically. The device cannot be used until it is brought online. DDI_DEVSTATE_DOWN The device is online but unusable due to a fault. DDI_DEVSTATE_QUIESCED The bus on which the device resides has been quiesced. This is not a fault, but no operations on the device should be performed while the bus remains quiesced. DDI_DEVSTATE_DEGRADED The device is online but only able to provide a partial or degraded service, due to a fault. DDI_DEVSTATE_UP The device is online and fully operational. CONTEXT
The ddi_get_devstate() function may be called from user, kernel, or interrupt context. NOTES
A device driver should call this function to check its own state at each major entry point, and before committing resources to a requested operation. If a driver discovers that its device is already down, it should perform required cleanup actions and return as soon as possi- ble. If appropriate, it should return an error to its caller, indicating that the device has failed (for example, a driver's read(9E) rou- tine would return EIO). Depending on the driver, some non-I/O operations (for example, calls to the driver's ioctl(9E) routine) may still succeed; only functions which would require fully accessible and operational hardware will necessarily fail. If the bus on which the device resides is quiesced, the driver may return a value indicating the operation should be retried later (for example, EAGAIN). Alternatively, for some classes of device, it may be appropriate for the driver to enqueue the operation and service it once the bus has been unquiesced. Note that not all busses support the quiesce/unquiesce operations, so this value may never be seen by some drivers. SEE ALSO
attach(9E), ioctl(9E), open(9E), read(9E), strategy(9E), write(9E), ddi_dev_report_fault(9F) SunOS 5.10 13 August 1999 ddi_get_devstate(9F)
Man Page