221 #ifndef __lib_wimaxll_h__
222 #define __lib_wimaxll_h__
223 #include <sys/errno.h>
224 #include <sys/types.h>
226 #include <byteswap.h>
228 #include <linux/wimax.h>
280 const char *pipe_name,
281 const void *data,
size_t size);
307 enum wimax_st old_state,
enum wimax_st new_state);
324 const void *,
size_t);
331 #define WIMAX_PIPE_ANY (NULL-1)
348 enum wimax_st *old_state,
349 enum wimax_st *new_state);
359 #define wimaxll_array_size(a) (sizeof(a)/sizeof(a[0]))
361 #define wimaxll_container_of(pointer, type, member) \
363 type *object = NULL; \
364 size_t offset = (void *) &object->member - (void *) object; \
365 (type *) ((void *) pointer - offset); \
405 #if __BYTE_ORDER == __LITTLE_ENDIAN
407 #elif __BYTE_ORDER == __BIG_ENDIAN
410 #error ERROR: unknown byte sex - FIXME
426 #if __BYTE_ORDER == __LITTLE_ENDIAN
428 #elif __BYTE_ORDER == __BIG_ENDIAN
431 #error ERROR: unknown byte sex - FIXME
447 #if __BYTE_ORDER == __LITTLE_ENDIAN
449 #elif __BYTE_ORDER == __BIG_ENDIAN
452 #error ERROR: unknown byte sex - FIXME
468 #if __BYTE_ORDER == __LITTLE_ENDIAN
470 #elif __BYTE_ORDER == __BIG_ENDIAN
473 #error ERROR: unknown byte sex - FIXME
489 #if __BYTE_ORDER == __LITTLE_ENDIAN
491 #elif __BYTE_ORDER == __BIG_ENDIAN
494 #error ERROR: unknown byte sex - FIXME
510 #if __BYTE_ORDER == __LITTLE_ENDIAN
512 #elif __BYTE_ORDER == __BIG_ENDIAN
515 #error ERROR: unknown byte sex - FIXME
531 #if __BYTE_ORDER == __LITTLE_ENDIAN
533 #elif __BYTE_ORDER == __BIG_ENDIAN
536 #error ERROR: unknown byte sex - FIXME
552 #if __BYTE_ORDER == __LITTLE_ENDIAN
554 #elif __BYTE_ORDER == __BIG_ENDIAN
557 #error ERROR: unknown byte sex - FIXME
563 #define __WIMAXLL_ALIGN2_MASK(n, m) (((n) + (m)) & ~(m))
567 #define WIMAXLL_ALIGN2(n, o2) __WIMAXLL_ALIGN2_MASK(n, (typeof(n)) (o2) - 1)
const char * wimaxll_ifname(const struct wimaxll_handle *)
Return the name of a the system'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'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