|
wimax-tools 1.4.4
|
When notification callbacks are being executed, the processing of notifications from the kernel is effectively blocked by it. More...
Data Structures | |
| struct | wimaxll_cb_ctx |
| General structure for storing callback context. More... | |
Defines | |
| #define | WIMAXLL_CB_CTX_INIT(_wmx) |
| Initialize a definition of struct wimaxll_cb_ctx. | |
Functions | |
| void | wimaxll_cb_ctx_init (struct wimaxll_cb_ctx *ctx, struct wimaxll_handle *wmx) |
| Initialize a struct wimaxll_cb_ctx. | |
| void | wimaxll_cb_maybe_set_result (struct wimaxll_cb_ctx *ctx, int val) |
| Set the result value in a callback context. | |
When notification callbacks are being executed, the processing of notifications from the kernel is effectively blocked by it.
Care must be taken not to call blocking functions, especially wimaxll_recv().
Callbacks are always passed a pointer to a private context as set by the application.
Callbacks can return -EBUSY to have wimaxll_recv() stop processing messages and pass control to the caller (which will see it returning -EBUSY). Callbacks *SHOULD NOT* return -EINPROGRESS, as it is used internally by wimaxll_recv().
| #define WIMAXLL_CB_CTX_INIT | ( | _wmx | ) |
{ \
.wmx = (_wmx), \
.result = -EINPROGRESS, \
}
Initialize a definition of struct wimaxll_cb_ctx.
| _wmx | pointer to the WiMAX device handle this will be associated to |
Use as:
struct wimaxll_handle *wmx; ... struct wimaxll_cb_ctx my_context = WIMAXLL_CB_CTX_INIT(wmx);
Referenced by wimaxll_msg_read(), wimaxll_recv(), and wimaxll_wait_for_state_change().
| static static void wimaxll_cb_ctx_init | ( | struct wimaxll_cb_ctx * | ctx, |
| struct wimaxll_handle * | wmx | ||
| ) | [inline] |
Initialize a struct wimaxll_cb_ctx.
| ctx | Pointer to the struct wimaxll_cb_ctx. |
| wmx | pointer to the WiMAX device handle this will be associated to |
Use as:
struct wimaxll_handle *wmx; ... struct wimaxll_cb_ctx my_context; ... wimaxll_cb_ctx(&my_context, wmx);
| static static void wimaxll_cb_maybe_set_result | ( | struct wimaxll_cb_ctx * | ctx, |
| int | val | ||
| ) | [inline] |
Set the result value in a callback context.
| ctx | Context where to set -- if NULL, no action will be taken |
| val | value to set for result |
Referenced by wimaxll_gnl_ack_cb(), and wimaxll_gnl_error_cb().
1.7.3