wimax-tools 1.4.4
|
The main device management operations are wimaxll_open(), wimaxll_close() and wimax_reset(). More...
Functions | |
struct wimaxll_handle * | wimaxll_open (const char *device) |
Open a handle to the WiMAX control interface in the kernel. | |
void | wimaxll_close (struct wimaxll_handle *wmx) |
Close a device handle opened with wimaxll_open() | |
int | wimaxll_reset (struct wimaxll_handle *wmx) |
Reset a WiMAX device. | |
int | wimaxll_rfkill (struct wimaxll_handle *wmx, enum wimax_rf_state state) |
Control the software RF Kill switch and obtain switch status. | |
int | wimaxll_state_get (struct wimaxll_handle *wmx) |
Get Wimax device status from kernel and return it to user space. | |
const char * | wimaxll_ifname (const struct wimaxll_handle *wmx) |
Return the name of a the system's WiMAX interface associated to an open handle. | |
unsigned | wimaxll_ifidx (const struct wimaxll_handle *wmx) |
Return the interface index of the system's WiMAX interface associated to an open handle. | |
void | wimaxll_priv_set (struct wimaxll_handle *wmx, void *priv) |
Set the private data associated to a WiMAX device handle. | |
void * | wimaxll_priv_get (struct wimaxll_handle *wmx) |
Return the private data associated to a WiMAX device handle. |
The main device management operations are wimaxll_open(), wimaxll_close() and wimax_reset().
It is allowed to have more than one handle opened at the same time.
Use wimaxll_ifname() to obtain the name of the WiMAX interface a handle is open for.
void wimaxll_close | ( | struct wimaxll_handle * | wmx | ) |
Close a device handle opened with wimaxll_open()
wmx | WiMAX device handle |
Referenced by i2400m_destroy(), and main().
unsigned wimaxll_ifidx | ( | const struct wimaxll_handle * | wmx | ) |
Return the interface index of the system's WiMAX interface associated to an open handle.
wmx | WiMAX device handle |
Note that if this is an any interface (open for all devices), this will vary. When not processing a callback, it will be zero. When processing a callback, this call will return the interface for which the callback was executed.
const char* wimaxll_ifname | ( | const struct wimaxll_handle * | wmx | ) |
Return the name of a the system's WiMAX interface associated to an open handle.
wmx | WiMAX device handle |
Note that if this is an any interface (open for all devices), this will be empty.
struct wimaxll_handle* wimaxll_open | ( | const char * | device | ) | [read] |
Open a handle to the WiMAX control interface in the kernel.
device | device name of the WiMAX network interface; to specify an interface by index, use the name "#IFNAME". To open a handle that will receive data for any device (but not allow sending commands to devices), set NULL. |
When opening the handle to the device, a basic check of API versioning will be done. If the kernel interface has a different major version, the wimaxll_open()
call will fail (existing interfaces modified or removed). A higher kernel minor version is allowed (new interfaces added); a lower kernel minor version is allowed with a warning (the library might need interfaces that are not in the kernel).
Referenced by i2400m_create(), and main().
void* wimaxll_priv_get | ( | struct wimaxll_handle * | wmx | ) |
Return the private data associated to a WiMAX device handle.
wmx | WiMAX device handle |
void wimaxll_priv_set | ( | struct wimaxll_handle * | wmx, |
void * | priv | ||
) |
Set the private data associated to a WiMAX device handle.
wmx | WiMAX device handle |
priv | Private data pointer to associate. |
int wimaxll_reset | ( | struct wimaxll_handle * | wmx | ) |
Reset a WiMAX device.
wmx | WiMAX device handle |
When there is a need to reset the device wimaxll_reset() can be used to issue a warm reset. That won't invalidate the existing handles, while still moving the device to power on state.
If the device cannot be properly reset, the WiMAX kernel stack may fall back to a cold reset, which will most likely disconnect the device from the driver (and bus) and reconnect it; that means device handles will be invalid from there on. In those cases, -ENODEV is returned.
int wimaxll_rfkill | ( | struct wimaxll_handle * | wmx, |
enum wimax_rf_state | state | ||
) |
Control the software RF Kill switch and obtain switch status.
wmx | WiMAX device handle |
state | State to which you want to toggle the sofware RF Kill switch (WIMAX_RF_ON, WIMAX_RF_OFF or WIMAX_RF_QUERY for just querying the current state of the hardware and software switches). |
0b11
: Both HW and SW switches are on, radio is on 0b10
: HW switch is off, radio is off 0b01
: SW switch is on, radio is off 0b00
: Both HW and SW switches are off, radio is off Allows the caller to control the state of the software RF Kill switch (if present) and in return, obtain the current status of both the hardware and software RF Kill switches.
If there is no hardware or software switch, that switch is assumed to be always on (radio on).
Changing the radio state might cause the device to change state, and cause the kernel to send reports indicating so.
Referenced by main(), and wimaxll_open().
int wimaxll_state_get | ( | struct wimaxll_handle * | wmx | ) |
Get Wimax device status from kernel and return it to user space.
wmx | WiMAX device handle |
Allows the caller to get the state of the Wimax device.