1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>enum wimax_st</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Networking and Network Devices APIs"><link rel="up" href="ch01s06.html" title="WiMAX"><link rel="prev" href="API-struct-wimax-dev.html" title="struct wimax_dev"><link rel="next" href="netdev.html" title="Chapter&#160;2.&#160;Network device support"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">enum wimax_st</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-wimax-dev.html">Prev</a>&#160;</td><th width="60%" align="center">WiMAX</th><td width="20%" align="right">&#160;<a accesskey="n" href="netdev.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-enum-wimax-st"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>enum wimax_st &#8212; 
2  The different states of a WiMAX device
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4enum wimax_st {
5  __WIMAX_ST_NULL,
6  WIMAX_ST_DOWN,
7  __WIMAX_ST_QUIESCING,
8  WIMAX_ST_UNINITIALIZED,
9  WIMAX_ST_RADIO_OFF,
10  WIMAX_ST_READY,
11  WIMAX_ST_SCANNING,
12  WIMAX_ST_CONNECTING,
13  WIMAX_ST_CONNECTED,
14  __WIMAX_ST_INVALID
15};  </pre></div><div class="refsect1"><a name="idp1097723140"></a><h2>Constants</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">__WIMAX_ST_NULL</span></dt><dd><p>
16The device structure has been allocated and zeroed,
17but still <code class="function">wimax_dev_add</code> hasn't been called. There is no state.
18      </p></dd><dt><span class="term">WIMAX_ST_DOWN</span></dt><dd><p>
19The device has been registered with the WiMAX and
20networking stacks, but it is not initialized (normally that is
21done with 'ifconfig DEV up' [or equivalent], which can upload
22firmware and enable communications with the device).
23In this state, the device is powered down and using as less
24power as possible.
25This state is the default after a call to <code class="function">wimax_dev_add</code>. It
26is ok to have drivers move directly to <code class="constant">WIMAX_ST_UNINITIALIZED</code>
27or <code class="constant">WIMAX_ST_RADIO_OFF</code> in <code class="function">_probe</code> after the call to
28<code class="function">wimax_dev_add</code>.
29It is recommended that the driver leaves this state when
30calling 'ifconfig DEV up' and enters it back on 'ifconfig DEV
31down'.
32      </p></dd><dt><span class="term">__WIMAX_ST_QUIESCING</span></dt><dd><p>
33The device is being torn down, so no API
34operations are allowed to proceed except the ones needed to
35complete the device clean up process.
36      </p></dd><dt><span class="term">WIMAX_ST_UNINITIALIZED</span></dt><dd><p>
37[optional] Communication with the device
38is setup, but the device still requires some configuration
39before being operational.
40Some WiMAX API calls might work.
41      </p></dd><dt><span class="term">WIMAX_ST_RADIO_OFF</span></dt><dd><p>
42The device is fully up; radio is off (wether
43by hardware or software switches).
44It is recommended to always leave the device in this state
45after initialization.
46      </p></dd><dt><span class="term">WIMAX_ST_READY</span></dt><dd><p>
47The device is fully up and radio is on.
48      </p></dd><dt><span class="term">WIMAX_ST_SCANNING</span></dt><dd><p>
49[optional] The device has been instructed to
50scan. In this state, the device cannot be actively connected to
51a network.
52      </p></dd><dt><span class="term">WIMAX_ST_CONNECTING</span></dt><dd><p>
53The device is connecting to a network. This
54state exists because in some devices, the connect process can
55include a number of negotiations between user space, kernel
56space and the device. User space needs to know what the device
57is doing. If the connect sequence in a device is atomic and
58fast, the device can transition directly to CONNECTED
59      </p></dd><dt><span class="term">WIMAX_ST_CONNECTED</span></dt><dd><p>
60The device is connected to a network.
61      </p></dd><dt><span class="term">__WIMAX_ST_INVALID</span></dt><dd><p>
62This is an invalid state used to mark the
63maximum numeric value of states.
64      </p></dd></dl></div></div><div class="refsect1"><a name="idp1097734172"></a><h2>Description</h2><p>
65   </p><p>
66
67   Transitions from one state to another one are atomic and can only
68   be caused in kernel space with <code class="function">wimax_state_change</code>. To read the
69   state, use <code class="function">wimax_state_get</code>.
70   </p><p>
71
72   States starting with __ are internal and shall not be used or
73   referred to by drivers or userspace. They look ugly, but that's the
74   point -- if any use is made non-internal to the stack, it is easier
75   to catch on review.
76   </p><p>
77
78   All API operations [with well defined exceptions] will take the
79   device mutex before starting and then check the state. If the state
80   is <code class="constant">__WIMAX_ST_NULL</code>, <code class="constant">WIMAX_ST_DOWN</code>, <code class="constant">WIMAX_ST_UNINITIALIZED</code> or
81   <code class="constant">__WIMAX_ST_QUIESCING</code>, it will drop the lock and quit with
82   -<code class="constant">EINVAL</code>, -<code class="constant">ENOMEDIUM</code>, -<code class="constant">ENOTCONN</code> or -<code class="constant">ESHUTDOWN</code>.
83   </p><p>
84
85   The order of the definitions is important, so we can do numerical
86   comparisons (eg: &lt; <code class="constant">WIMAX_ST_RADIO_OFF</code> means the device is not ready
87   to operate).
88</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-wimax-dev.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch01s06.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="netdev.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct wimax_dev</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;2.&#160;Network device support</td></tr></table></div></body></html>
89