wimax-tools  1.4.4
wimaxll.h
Go to the documentation of this file.
1 /*
2  * Linux WiMax
3  * User Space API
4  *
5  *
6  * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
7  * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  * * Neither the name of Intel Corporation nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  *
36  *
37  */
38 /**
39  * @mainpage
40  *
41  * This is a simple library to control WiMAX devices through the
42  * control API exported by the Linux kernel WiMAX Stack. It provides
43  * means to execute functions exported by the stack and to receive its
44  * notifications.
45  *
46  * Because of this, this is a callback oriented library. It is
47  * designed to be operated asynchronously and/or in an event loop. For
48  * the very simple cases, helpers that implement synchronous
49  * functionality are available.
50  *
51  * This library is provided as a convenience and using it is not
52  * required to talk to the WiMAX kernel stack. It is possible to do so
53  * by interacting with it over generic netlink directly.
54  *
55  * \note this is a very low level library. It does not provide the
56  * caller with means to scan, connect, disconnect, etc from a WiMAX
57  * network. Said capability is provided by higher level services which
58  * might be users of this library.
59  *
60  * @section conventions Conventions
61  *
62  * Most function calls return an integer with a negative \a errno
63  * error code when there is an error.
64  *
65  * @section general_usage General usage
66  *
67  * The first operation to start controlling a WiMAX device is to open
68  * a handle for it:
69  *
70  * @code
71  * struct wimaxll_handle *wmx = wimaxll_open("wmx0");
72  * @endcode
73  *
74  * With an open handle you can execute all the WiMax API
75  * operations. When done with the handle, it has to be closed:
76  *
77  * @code
78  * wimaxll_close(wmx);
79  * @endcode
80  *
81  * If the device is unloaded/disconnected, the handle will be marked
82  * as invalid and any operation will fail with -ENODEV.
83  *
84  * To reset a WiMAX device, use:
85  *
86  * @code
87  * wimaxll_reset(wmx);
88  * @endcode
89  *
90  * To turn a device \e on or \e off, or to query it's status, use:
91  *
92  * @code
93  * wimaxll_rfkill(wmx, WIMAX_RF_ON);
94  * @endcode
95  *
96  * WIMAX_RF_ON and WIMAX_RF_OFF turn the radio on and off
97  * respectively, using the software switch and return the current
98  * status of both switches. WIMAX_RF_QUERY just returns the status of
99  * both the \e HW and \e SW switches.
100  *
101  * See \ref device_management "device management" for more information.
102  *
103  * \section receiving Receiving notifications from the WiMAX kernel stack
104  *
105  * The WiMAX kernel stack will broadcast notifications and
106  * driver-specific messages to all the user space clients connected to
107  * it over a generic netlink multicast group.
108  *
109  * To listen to said notifications, a library client needs to block
110  * waiting for them or set \ref callbacks "callbacks" and integrate
111  * into some kind of main loop using \e select() call to detect
112  * incoming notifications.
113  *
114  * Simple example of mainloop integration:
115  *
116  * @code
117  * int fd = wimaxll_recv_fd(wmx);
118  * fd_set pipe_fds, read_fds;
119  * ...
120  * // Main loop
121  * FD_ZERO(&pipe_fds);
122  * FD_SET(fd, &pipe_fds);
123  * while(1) {
124  * read_fds = pipe_fds;
125  * select(FD_SETSIZE, &read_fds, NULL, NULL, NULL);
126  * if (FD_ISSET(fd, &read_fds))
127  * wimaxll_recv(wmx);
128  * }
129  * @endcode
130  *
131  * This code will call wimaxll_recv() when notifications are available
132  * for delivery. Calling said function will execute, for each
133  * notification, the callback associated to it.
134  *
135  * To wait for a \e state \e change notification, for example:
136  *
137  * @code
138  * result = wimaxll_wait_for_state_change(wmx, &old_state, &new_state);
139  * @endcode
140  *
141  * The same thing can be accomplished setting a callback for a state
142  * change notification with wimaxll_set_cb_state_change() and then
143  * waiting on a main loop. See \ref state_change_group "state changes"
144  * for more information.
145  *
146  * To wait for a (device-specific) message from the driver, an
147  * application would use:
148  *
149  * @code
150  * void *msg;
151  * ...
152  *
153  * size = wimaxll_msg_read(wmx, &msg);
154  *
155  * ... <act on the message>
156  *
157  * wimaxll_msg_free(msg); // done with the message
158  * @endcode
159  *
160  * \e msg points to a buffer which contains the message payload as
161  * sent by the driver. When done with \a msg it has to be freed with
162  * wimaxll_msg_free().
163  *
164  * As with \e state \e change notifications, a callback can be set
165  * that will be executed from a mainloop every time a message is
166  * received from a message pipe. See
167  * wimaxll_pipe_set_cb_msg_to_user().
168  *
169  * A message can be sent to the driver with wimaxll_msg_write().
170  * not the default \e message pipe.
171  *
172  * For more details, see \ref the_messaging_interface.
173  *
174  * @section miscellaneous Miscellaneous
175  *
176  * @subsection diagnostics Controlling the ouput of diagnostics
177  *
178  * \e libwimaxll will output messages by default to \a stderr. See
179  * \ref helper_log for changing the default destination.
180  *
181  * @subsection bytesex Endianess conversion
182  *
183  * The following convenience helpers are provided for endianess
184  * conversion:
185  *
186  * - wimaxll_le32_to_cpu() and wimaxll_cpu_to_le32()
187  * - wimaxll_le16_to_cpu() and wimaxll_cpu_to_le16()
188  * - wimaxll_swap_16() and wimaxll_swap_32()
189  *
190  * @section multithreading Multithreading
191  *
192  * This library is not threaded or locked. Internally it uses two
193  * different netlink handles, one for receiving and one for sending;
194  * thus the maximum level of paralellism you can do with one handle
195  * is:
196  *
197  * - Functions that can't be executed in parallel when using the same
198  * wimaxll handle (need to be serialized):
199  * <ul>
200  * <li> wimaxll_msg_write(), wimaxll_rfkill(), wimax_reset()
201  * <li> wimaxll_recv(), wimaxll_msg_read(),
202  * wimaxll_wait_for_state_change()
203  * <li> wimax_get_cb_*() and wimax_set_cb_*().
204  * <li> wimaxll_recv_fd(), as long as the handle is valid.
205  * </ul>
206  *
207  * - Function calls that have to be always serialized with respect to
208  * any other:
209  * <ul>
210  * <li> wimaxll_open() and wimaxll_close()
211  * <li> wimax_get_cb_*() and wimax_set_cb_*().
212  * </ul>
213  *
214  * - callbacks are all executed serially; don't call wimax_recv() from
215  * inside a callback.
216  *
217  * Any function not covered by the in this list can be parallelizable.
218  */
219 
220 
221 #ifndef __lib_wimaxll_h__
222 #define __lib_wimaxll_h__
223 #include <sys/errno.h>
224 #include <sys/types.h>
225 #include <endian.h>
226 #include <byteswap.h>
227 #include <stdarg.h>
228 #include <linux/wimax.h>
229 
230 struct wimaxll_handle;
231 
232 struct nlattr;
233 
234 
235 /**
236  * \defgroup callbacks Callbacks
237  *
238  * When notification callbacks are being executed, the processing of
239  * notifications from the kernel is effectively blocked by it. Care
240  * must be taken not to call blocking functions, especially
241  * wimaxll_recv().
242  *
243  * Callbacks are always passed a pointer to a private context as set
244  * by the application.
245  *
246  * Callbacks can return -%EBUSY to have wimaxll_recv() stop processing
247  * messages and pass control to the caller (which will see it
248  * returning -%EBUSY). Callbacks *SHOULD NOT* return -%EINPROGRESS, as
249  * it is used internally by wimaxll_recv().
250  */
251 
252 
253 /**
254  * Callback for a \e message \e to \e user generic netlink message
255  *
256  * A \e driver \e specific message has been received from the kernel;
257  * the pointer to the data and the size are passed in \a data and \a
258  * size. The callback can access that data, but it's lifetime is valid
259  * only while the callback is executing. If it will be accessed later,
260  * it has to be copied to a safe location.
261  *
262  * \note See \ref callbacks callbacks for a set of warnings and
263  * guidelines for using callbacks.
264  *
265  * \param wmx WiMAX device handle
266  * \param priv Context passed by the user with
267  * wimaxll_pipe_set_cb_msg_to_user().
268  * \param pipe_name Name of the pipe the message is sent for
269  * \param data Pointer to a buffer with the message data.
270  * \param size Size of the buffer
271  * \return >= 0 if it is ok to keep processing messages, -EBUSY if
272  * message processing should stop and control be returned to the
273  * caller. Any other negative error code to continue processing
274  * messages skipping the current one.
275  *
276  * \ingroup the_messaging_interface
277  */
278 typedef int (*wimaxll_msg_to_user_cb_f)(struct wimaxll_handle *wmx,
279  void *priv,
280  const char *pipe_name,
281  const void *data, size_t size);
282 
283 /**
284  * Callback for a \e state \e change notification from the WiMAX
285  * kernel stack.
286  *
287  * The WiMAX device has changed state from \a old_state to \a
288  * new_state.
289  *
290  * \note See \ref callbacks callbacks for a set of warnings and
291  * guidelines for using callbacks.
292  *
293  * \param wmx WiMAX device handle
294  * \param priv ctx Context passed by the user with
295  * wimaxll_set_cb_state_change().
296  * \param old_state State the WiMAX device left
297  * \param new_state State the WiMAX device entered
298  * \return >= 0 if it is ok to keep processing messages, -EBUSY if
299  * message processing should stop and control be returned to the
300  * caller. Any other negative error code to continue processing
301  * messages skipping the current one.
302  *
303  * \ingroup state_change_group
304  */
306  struct wimaxll_handle *, void *priv,
307  enum wimax_st old_state, enum wimax_st new_state);
308 
309 
310 /* Basic handle management */
311 struct wimaxll_handle *wimaxll_open(const char *device_name);
312 void *wimaxll_priv_get(struct wimaxll_handle *);
313 void wimaxll_priv_set(struct wimaxll_handle *, void *);
314 void wimaxll_close(struct wimaxll_handle *);
315 const char *wimaxll_ifname(const struct wimaxll_handle *);
316 unsigned wimaxll_ifidx(const struct wimaxll_handle *);
317 
318 /* Wait for data from the kernel, execute callbacks */
319 int wimaxll_recv_fd(struct wimaxll_handle *);
320 ssize_t wimaxll_recv(struct wimaxll_handle *);
321 
322 /* Default (bidirectional) message pipe from the kernel */
323 ssize_t wimaxll_msg_write(struct wimaxll_handle *, const char *,
324  const void *, size_t);
325 
327  wimaxll_msg_to_user_cb_f *, void **);
329  wimaxll_msg_to_user_cb_f, void *);
330 
331 #define WIMAX_PIPE_ANY (NULL-1)
332 ssize_t wimaxll_msg_read(struct wimaxll_handle *, const char *pine_name,
333  void **);
334 void wimaxll_msg_free(void *);
335 
336 /* generic API */
337 int wimaxll_rfkill(struct wimaxll_handle *, enum wimax_rf_state);
338 int wimaxll_reset(struct wimaxll_handle *);
339 int wimaxll_state_get(struct wimaxll_handle *);
340 
343  void **);
346  void *);
348  enum wimax_st *old_state,
349  enum wimax_st *new_state);
350 
351 
352 /**
353  * \defgroup miscellaneous_group Miscellaneous utilities
354  */
355 enum wimax_st wimaxll_state_by_name(const char *);
356 size_t wimaxll_states_snprintf(char *, size_t);
357 const char * wimaxll_state_to_name(enum wimax_st);
358 
359 #define wimaxll_array_size(a) (sizeof(a)/sizeof(a[0]))
360 
361 #define wimaxll_container_of(pointer, type, member) \
362 ({ \
363  type *object = NULL; \
364  size_t offset = (void *) &object->member - (void *) object; \
365  (type *) ((void *) pointer - offset); \
366 })
367 
368 static inline // ugly hack for doxygen
369 /**
370  *
371  * Swap the nibbles in a 16 bit number.
372  *
373  * \ingroup miscellaneous_group
374  * \fn unsigned short wimaxll_swap_16(unsigned short x)
375  */
376 unsigned short wimaxll_swap_16(unsigned short x)
377 {
378  return bswap_16(x);
379 }
380 
381 
382 static inline // ugly hack for doxygen
383 /**
384  * Swap the nibbles in a 32 bit number.
385  *
386  * \ingroup miscellaneous_group
387  * \fn unsigned long wimaxll_swap_32(unsigned long x)
388  */
389 unsigned long wimaxll_swap_32(unsigned long x)
390 {
391  return bswap_32(x);
392 }
393 
394 
395 static inline // ugly hack for doxygen
396 /**
397  * Convert a cpu-order 16 bits to little endian.
398  *
399  * \ingroup miscellaneous_group
400  * \fn unsigned short wimaxll_cpu_to_le16(unsigned short x)
401  */
402 unsigned short wimaxll_cpu_to_le16(unsigned short x)
403 {
404  unsigned short le16;
405 #if __BYTE_ORDER == __LITTLE_ENDIAN
406  le16 = x;
407 #elif __BYTE_ORDER == __BIG_ENDIAN
408  le16 = wimaxll_swap_16(x);
409 #else
410 #error ERROR: unknown byte sex - FIXME
411 #endif
412  return le16;
413 }
414 
415 
416 static inline // ugly hack for doxygen
417 /**
418  * Convert a little-endian 16 bits to cpu order.
419  *
420  * \ingroup miscellaneous_group
421  * \fn unsigned short wimaxll_le16_to_cpu(unsigned short le16)
422  */
423 unsigned short wimaxll_le16_to_cpu(unsigned short le16)
424 {
425  unsigned short cpu;
426 #if __BYTE_ORDER == __LITTLE_ENDIAN
427  cpu = le16;
428 #elif __BYTE_ORDER == __BIG_ENDIAN
429  cpu = wimaxll_swap_16(le16);
430 #else
431 #error ERROR: unknown byte sex - FIXME
432 #endif
433  return cpu;
434 }
435 
436 
437 static inline // ugly hack for doxygen
438 /**
439  * Convert a cpu-order 32 bits to little endian.
440  *
441  * \ingroup miscellaneous_group
442  * \fn unsigned long wimaxll_cpu_to_le32(unsigned long x)
443  */
444 unsigned long wimaxll_cpu_to_le32(unsigned long x)
445 {
446  unsigned long le32;
447 #if __BYTE_ORDER == __LITTLE_ENDIAN
448  le32 = x;
449 #elif __BYTE_ORDER == __BIG_ENDIAN
450  le32 = wimaxll_swap_32(x);
451 #else
452 #error ERROR: unknown byte sex - FIXME
453 #endif
454  return le32;
455 }
456 
457 
458 static inline // ugly hack for doxygen
459 /**
460  * Convert a little-endian 32 bits to cpu order.
461  *
462  * \ingroup miscellaneous_group
463  * \fn unsigned long wimaxll_le32_to_cpu(unsigned long le32)
464  */
465 unsigned long wimaxll_le32_to_cpu(unsigned long le32)
466 {
467  unsigned long cpu;
468 #if __BYTE_ORDER == __LITTLE_ENDIAN
469  cpu = le32;
470 #elif __BYTE_ORDER == __BIG_ENDIAN
471  cpu = wimaxll_swap_32(le32);
472 #else
473 #error ERROR: unknown byte sex - FIXME
474 #endif
475  return cpu;
476 }
477 
478 
479 static inline // ugly hack for doxygen
480 /**
481  * Convert a cpu-order 16 bits to big endian.
482  *
483  * \ingroup miscellaneous_group
484  * \fn unsigned short wimaxll_cpu_to_be16(unsigned short x)
485  */
486 unsigned short wimaxll_cpu_to_be16(unsigned short x)
487 {
488  unsigned short be16;
489 #if __BYTE_ORDER == __LITTLE_ENDIAN
490  be16 = wimaxll_swap_16(x);
491 #elif __BYTE_ORDER == __BIG_ENDIAN
492  be16 = x;
493 #else
494 #error ERROR: unknown byte sex - FIXME
495 #endif
496  return be16;
497 }
498 
499 
500 static inline // ugly hack for doxygen
501 /**
502  * Convert a big-endian 16 bits to cpu order.
503  *
504  * \ingroup miscellaneous_group
505  * \fn unsigned short wimaxll_be16_to_cpu(unsigned short be16)
506  */
507 unsigned short wimaxll_be16_to_cpu(unsigned short be16)
508 {
509  unsigned short cpu;
510 #if __BYTE_ORDER == __LITTLE_ENDIAN
511  cpu = wimaxll_swap_16(be16);
512 #elif __BYTE_ORDER == __BIG_ENDIAN
513  cpu = be16;
514 #else
515 #error ERROR: unknown byte sex - FIXME
516 #endif
517  return cpu;
518 }
519 
520 
521 static inline // ugly hack for doxygen
522 /**
523  * Convert a cpu-order 32 bits to big endian.
524  *
525  * \ingroup miscellaneous_group
526  * \fn unsigned long wimaxll_cpu_to_be32(unsigned long x)
527  */
528 unsigned long wimaxll_cpu_to_be32(unsigned long x)
529 {
530  unsigned long be32;
531 #if __BYTE_ORDER == __LITTLE_ENDIAN
532  be32 = wimaxll_swap_32(x);
533 #elif __BYTE_ORDER == __BIG_ENDIAN
534  be32 = x;
535 #else
536 #error ERROR: unknown byte sex - FIXME
537 #endif
538  return be32;
539 }
540 
541 
542 static inline // ugly hack for doxygen
543 /**
544  * Convert a big-endian 32 bits to cpu order.
545  *
546  * \ingroup miscellaneous_group
547  * \fn unsigned long wimaxll_be32_to_cpu(unsigned long be32)
548  */
549 unsigned long wimaxll_be32_to_cpu(unsigned long be32)
550 {
551  unsigned long cpu;
552 #if __BYTE_ORDER == __LITTLE_ENDIAN
553  cpu = be32;
554 #elif __BYTE_ORDER == __BIG_ENDIAN
555  cpu = wimaxll_swap_32(be32);
556 #else
557 #error ERROR: unknown byte sex - FIXME
558 #endif
559  return cpu;
560 }
561 
562 
563 #define __WIMAXLL_ALIGN2_MASK(n, m) (((n) + (m)) & ~(m))
564 /**
565  * Return the value \e n aligned to an order-of-two value \a o2.
566  */
567 #define WIMAXLL_ALIGN2(n, o2) __WIMAXLL_ALIGN2_MASK(n, (typeof(n)) (o2) - 1)
568 
569 #endif /* #ifndef __lib_wimaxll_h__ */
const char * wimaxll_ifname(const struct wimaxll_handle *)
Return the name of a the system&#39;s WiMAX interface associated to an open handle.
Definition: wimax.c:226
A WiMax control pipe handle.
Definition: internal.h:219
size_t wimaxll_states_snprintf(char *, size_t)
Definition: misc.c:79
enum wimax_st wimaxll_state_by_name(const char *)
Definition: misc.c:57
void wimaxll_set_cb_state_change(struct wimaxll_handle *, wimaxll_state_change_cb_f, void *)
Set the callback and priv pointer for a WIMAX_GNL_RE_STATE_CHANGE message.
Definition: re-state-change.c:232
unsigned wimaxll_ifidx(const struct wimaxll_handle *)
Return the interface index of the system&#39;s WiMAX interface associated to an open handle.
Definition: wimax.c:246
unsigned short wimaxll_cpu_to_le16(unsigned short x)
Convert a cpu-order 16 bits to little endian.
Definition: wimaxll.h:402
void wimaxll_close(struct wimaxll_handle *)
Close a device handle opened with wimaxll_open()
Definition: op-open.c:492
unsigned long wimaxll_cpu_to_be32(unsigned long x)
Convert a cpu-order 32 bits to big endian.
Definition: wimaxll.h:528
void wimaxll_set_cb_msg_to_user(struct wimaxll_handle *, wimaxll_msg_to_user_cb_f, void *)
Set the callback and priv pointer for a MSG_TO_USER message.
Definition: op-msg.c:503
unsigned long wimaxll_le32_to_cpu(unsigned long le32)
Convert a little-endian 32 bits to cpu order.
Definition: wimaxll.h:465
unsigned long wimaxll_cpu_to_le32(unsigned long x)
Convert a cpu-order 32 bits to little endian.
Definition: wimaxll.h:444
int wimaxll_recv_fd(struct wimaxll_handle *)
Return the file descriptor associated to a WiMAX handle.
Definition: op-open.c:186
void wimaxll_get_cb_msg_to_user(struct wimaxll_handle *, wimaxll_msg_to_user_cb_f *, void **)
Get the callback and priv pointer for a MSG_TO_USER message.
Definition: op-msg.c:479
unsigned short wimaxll_cpu_to_be16(unsigned short x)
Convert a cpu-order 16 bits to big endian.
Definition: wimaxll.h:486
unsigned short wimaxll_swap_16(unsigned short x)
Swap the nibbles in a 16 bit number.
Definition: wimaxll.h:376
unsigned long wimaxll_swap_32(unsigned long x)
Swap the nibbles in a 32 bit number.
Definition: wimaxll.h:389
int wimaxll_rfkill(struct wimaxll_handle *, enum wimax_rf_state)
Control the software RF Kill switch and obtain switch status.
Definition: op-rfkill.c:92
int wimaxll_reset(struct wimaxll_handle *)
Reset a WiMAX device.
Definition: op-reset.c:86
ssize_t wimaxll_msg_read(struct wimaxll_handle *, const char *pine_name, void **)
Read a message from any WiMAX kernel-user pipe.
Definition: op-msg.c:339
void wimaxll_priv_set(struct wimaxll_handle *, void *)
Set the private data associated to a WiMAX device handle.
Definition: wimax.c:261
int(* wimaxll_state_change_cb_f)(struct wimaxll_handle *, void *priv, enum wimax_st old_state, enum wimax_st new_state)
Callback for a state change notification from the WiMAX kernel stack.
Definition: wimaxll.h:305
const char * wimaxll_state_to_name(enum wimax_st)
Definition: misc.c:68
void wimaxll_get_cb_state_change(struct wimaxll_handle *, wimaxll_state_change_cb_f *, void **)
Get the callback and priv pointer for a WIMAX_GNL_RE_STATE_CHANGE message.
Definition: re-state-change.c:215
unsigned short wimaxll_be16_to_cpu(unsigned short be16)
Convert a big-endian 16 bits to cpu order.
Definition: wimaxll.h:507
struct wimaxll_handle * wimaxll_open(const char *device_name)
Open a handle to the WiMAX control interface in the kernel.
Definition: op-open.c:369
ssize_t wimaxll_wait_for_state_change(struct wimaxll_handle *wmx, enum wimax_st *old_state, enum wimax_st *new_state)
Wait for an state change notification from the kernel.
Definition: re-state-change.c:286
ssize_t wimaxll_msg_write(struct wimaxll_handle *, const char *, const void *, size_t)
Send a driver-specific message to a WiMAX device.
Definition: op-msg.c:405
int(* wimaxll_msg_to_user_cb_f)(struct wimaxll_handle *wmx, void *priv, const char *pipe_name, const void *data, size_t size)
Callback for a message to user generic netlink message.
Definition: wimaxll.h:278
void * wimaxll_priv_get(struct wimaxll_handle *)
Return the private data associated to a WiMAX device handle.
Definition: wimax.c:277
void wimaxll_msg_free(void *)
Free a message received with wimaxll_msg_read()
Definition: op-msg.c:379
ssize_t wimaxll_recv(struct wimaxll_handle *)
Read notifications from the WiMAX multicast group.
Definition: op-open.c:221
unsigned short wimaxll_le16_to_cpu(unsigned short le16)
Convert a little-endian 16 bits to cpu order.
Definition: wimaxll.h:423
int wimaxll_state_get(struct wimaxll_handle *)
Get Wimax device status from kernel and return it to user space.
Definition: op-state-get.c:71
unsigned long wimaxll_be32_to_cpu(unsigned long be32)
Convert a big-endian 32 bits to cpu order.
Definition: wimaxll.h:549
void * priv
Definition: internal.h:223