summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2008-12-12 02:17:56 -0800
committerInaky Perez-Gonzalez <inaky@linux.intel.com>2008-12-12 02:39:39 -0800
commit7462577aa13a8dffd3c97c56c17d4ffb1d2fca8b (patch)
tree5c8cb13b036a006cc477cb020a1159983a2e523d
parent62014a51da02bea5f22f89373463366cb20f6341 (diff)
libwimaxll: rename wimaxll_gnl_cb_context to wimaxll_cb_ctx
The type is used for more than just generic netlink callbacks and it was way too long. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
-rw-r--r--lib/internal.h29
-rw-r--r--lib/op-msg.c8
-rw-r--r--lib/op-open.c4
-rw-r--r--lib/re-state-change.c6
-rw-r--r--lib/wimax.c8
5 files changed, 27 insertions, 28 deletions
diff --git a/lib/internal.h b/lib/internal.h
index 8998cf5..5e00d6b 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -66,10 +66,10 @@ enum {
* struct wimaxll_handle *wmx;
* ...
* struct my_context {
- * struct wimaxll_gnl_cb_context ctx;
+ * struct wimaxll_cb_ctx ctx;
* <my data>
* } my_ctx = {
- * .ctx = WIMAXLL_GNL_CB_CONTEXT_INIT(wmx),
+ * .ctx = WIMAXLL_CB_CTX_INIT(wmx),
* <my data initialization>
* };
* ...
@@ -101,7 +101,7 @@ enum {
* errors) for a message have been received and the message
* receiving loop can be considered done.
*/
-struct wimaxll_gnl_cb_context {
+struct wimaxll_cb_ctx {
struct wimaxll_handle *wmx;
ssize_t result;
unsigned msg_done:1; /* internal */
@@ -109,7 +109,7 @@ struct wimaxll_gnl_cb_context {
/**
- * Initialize a definition of struct wimaxll_gnl_cb_context
+ * Initialize a definition of struct wimaxll_cb_ctx
*
* \param _wmx pointer to the WiMAX device handle this will be
* associated to
@@ -119,12 +119,12 @@ struct wimaxll_gnl_cb_context {
* \code
* struct wimaxll_handle *wmx;
* ...
- * struct wimaxll_gnl_cb_context my_context = WIMAXLL_GNL_CB_CONTEXT_INIT(wmx);
+ * struct wimaxll_cb_ctx my_context = WIMAXLL_CB_CTX_INIT(wmx);
* \endcode
*
* \ingroup callbacks
*/
-#define WIMAXLL_GNL_CB_CONTEXT_INIT(_wmx) { \
+#define WIMAXLL_CB_CTX_INIT(_wmx) { \
.wmx = (_wmx), \
.result = -EINPROGRESS, \
}
@@ -132,9 +132,9 @@ struct wimaxll_gnl_cb_context {
static inline // ugly workaround for doxygen
/**
- * Initialize a struct wimaxll_gnl_cb_context
+ * Initialize a struct wimaxll_cb_ctx
*
- * \param ctx Pointer to the struct wimaxll_gnl_cb_context.
+ * \param ctx Pointer to the struct wimaxll_cb_ctx.
* \param wmx pointer to the WiMAX device handle this will be
* associated to
*
@@ -143,16 +143,15 @@ static inline // ugly workaround for doxygen
* \code
* struct wimaxll_handle *wmx;
* ...
- * struct wimaxll_gnl_cb_context my_context;
+ * struct wimaxll_cb_ctx my_context;
* ...
- * wimaxll_gnl_cb_context(&my_context, wmx);
+ * wimaxll_cb_ctx(&my_context, wmx);
* \endcode
*
* \ingroup callbacks
- * \fn static void wimaxll_gnl_cb_context_init(struct wimaxll_gnl_cb_context *ctx, struct wimaxll_handle *wmx)
+ * \fn static void wimaxll_cb_ctx_init(struct wimaxll_cb_ctx *ctx, struct wimaxll_handle *wmx)
*/
-void wimaxll_gnl_cb_context_init(struct wimaxll_gnl_cb_context *ctx,
- struct wimaxll_handle *wmx)
+void wimaxll_cb_ctx_init(struct wimaxll_cb_ctx *ctx, struct wimaxll_handle *wmx)
{
ctx->wmx = wmx;
ctx->result = -EINPROGRESS;
@@ -167,9 +166,9 @@ static inline // ugly workaround for doxygen
* \param val value to set for \a result
*
* \ingroup callbacks
- * \fn static void wimaxll_cb_maybe_set_result(struct wimaxll_gnl_cb_context *ctx, int val)
+ * \fn static void wimaxll_cb_maybe_set_result(struct wimaxll_cb_ctx *ctx, int val)
*/
-void wimaxll_cb_maybe_set_result(struct wimaxll_gnl_cb_context *ctx, int val)
+void wimaxll_cb_maybe_set_result(struct wimaxll_cb_ctx *ctx, int val)
{
if (ctx != NULL && ctx->result == -EINPROGRESS)
ctx->result = val;
diff --git a/lib/op-msg.c b/lib/op-msg.c
index 0b774c4..fdb75dc 100644
--- a/lib/op-msg.c
+++ b/lib/op-msg.c
@@ -223,7 +223,7 @@ error_parse:
struct wimaxll_cb_msg_to_user_context {
- struct wimaxll_gnl_cb_context ctx;
+ struct wimaxll_cb_ctx ctx;
void *data;
};
@@ -242,7 +242,7 @@ int wimaxll_msg_read_cb(struct wimaxll_handle *wmx,
const void *data, size_t data_size)
{
int result;
- struct wimaxll_gnl_cb_context *ctx = _ctx;
+ struct wimaxll_cb_ctx *ctx = _ctx;
struct wimaxll_cb_msg_to_user_context *mtu_ctx =
wimaxll_container_of(
ctx, struct wimaxll_cb_msg_to_user_context, ctx);
@@ -331,7 +331,7 @@ ssize_t wimaxll_msg_read(struct wimaxll_handle *wmx,
{
ssize_t result;
struct wimaxll_cb_msg_to_user_context mtu_ctx = {
- .ctx = WIMAXLL_GNL_CB_CONTEXT_INIT(wmx),
+ .ctx = WIMAXLL_CB_CTX_INIT(wmx),
.data = (void *) pipe_name,
};
wimaxll_msg_to_user_cb_f prev_cb = NULL;
@@ -480,7 +480,7 @@ void wimaxll_get_cb_msg_to_user(
* \param wmx WiMAX handle.
* \param cb Callback function to set
* \param priv Private data pointer to pass to the callback
- * function (wrap a \a struct wimaxll_gnl_cb_context in your context
+ * function (wrap a \a struct wimaxll_cb_ctx in your context
* struct and pass a pointer to it; then use wimaxll_container_of()
* to extract it back).
*
diff --git a/lib/op-open.c b/lib/op-open.c
index 1d24ff6..61ff200 100644
--- a/lib/op-open.c
+++ b/lib/op-open.c
@@ -126,7 +126,7 @@ int wimaxll_gnl_cb(struct nl_msg *msg, void *_ctx)
{
ssize_t result;
enum nl_cb_action result_nl;
- struct wimaxll_gnl_cb_context *ctx = _ctx;
+ struct wimaxll_cb_ctx *ctx = _ctx;
struct wimaxll_handle *wmx = ctx->wmx;
struct nlmsghdr *nl_hdr;
struct genlmsghdr *gnl_hdr;
@@ -223,7 +223,7 @@ int wimaxll_recv_fd(struct wimaxll_handle *wmx)
ssize_t wimaxll_recv(struct wimaxll_handle *wmx)
{
ssize_t result;
- struct wimaxll_gnl_cb_context ctx = WIMAXLL_GNL_CB_CONTEXT_INIT(wmx);
+ struct wimaxll_cb_ctx ctx = WIMAXLL_CB_CTX_INIT(wmx);
struct nl_cb *cb;
d_fnstart(3, wmx, "(wmx %p)\n", wmx);
diff --git a/lib/re-state-change.c b/lib/re-state-change.c
index 369e713..ae2a08d 100644
--- a/lib/re-state-change.c
+++ b/lib/re-state-change.c
@@ -190,7 +190,7 @@ error_parse:
* wimaxll_wait_for_state_change()
*/
struct wimaxll_state_change_context {
- struct wimaxll_gnl_cb_context ctx;
+ struct wimaxll_cb_ctx ctx;
enum wimax_st *old_state, *new_state;
int set:1;
};
@@ -238,7 +238,7 @@ static
int wimaxll_cb_state_change(struct wimaxll_handle *wmx, void *_ctx,
enum wimax_st old_state, enum wimax_st new_state)
{
- struct wimaxll_gnl_cb_context *ctx = _ctx;
+ struct wimaxll_cb_ctx *ctx = _ctx;
struct wimaxll_state_change_context *stch_ctx =
wimaxll_container_of(ctx, struct wimaxll_state_change_context,
ctx);
@@ -285,7 +285,7 @@ ssize_t wimaxll_wait_for_state_change(struct wimaxll_handle *wmx,
wimaxll_state_change_cb_f prev_cb = NULL;
void *prev_priv = NULL;
struct wimaxll_state_change_context ctx = {
- .ctx = WIMAXLL_GNL_CB_CONTEXT_INIT(wmx),
+ .ctx = WIMAXLL_CB_CTX_INIT(wmx),
.old_state = old_state,
.new_state = new_state,
.set = 0,
diff --git a/lib/wimax.c b/lib/wimax.c
index 5014c41..7be7ba0 100644
--- a/lib/wimax.c
+++ b/lib/wimax.c
@@ -60,7 +60,7 @@
*
* \param nla Source netlink address
* \param nlerr Netlink error descritor
- * \param _ctx Pointer to (\a struct wimaxll_gnl_cb_context)
+ * \param _ctx Pointer to (\a struct wimaxll_cb_ctx)
*
* \return 'enum nl_cb_action', NL_OK if there is no error, NL_STOP on
* error and _mch->result possibly updated.
@@ -72,7 +72,7 @@
int wimaxll_gnl_error_cb(struct sockaddr_nl *nla, struct nlmsgerr *nlerr,
void *_ctx)
{
- struct wimaxll_gnl_cb_context *ctx = _ctx;
+ struct wimaxll_cb_ctx *ctx = _ctx;
struct wimaxll_handle *wmx = ctx->wmx;
d_fnstart(3, wmx, "(nla %p nlnerr %p [%d] ctx %p)\n",
@@ -108,7 +108,7 @@ int wimaxll_gnl_ack_cb(struct nl_msg *msg, void *_ctx)
struct nlmsghdr *nl_hdr;
struct nlmsgerr *nl_err;
size_t size = nlmsg_len(nlmsg_hdr(msg));
- struct wimaxll_gnl_cb_context *ctx = _ctx;
+ struct wimaxll_cb_ctx *ctx = _ctx;
d_fnstart(7, NULL, "(msg %p ctx %p)\n", msg, _ctx);
nl_hdr = nlmsg_hdr(msg);
@@ -166,7 +166,7 @@ int wimaxll_wait_for_ack(struct wimaxll_handle *wmx)
{
int result;
struct nl_cb *cb;
- struct wimaxll_gnl_cb_context ctx;
+ struct wimaxll_cb_ctx ctx;
ctx.wmx = wmx;
ctx.result = -EINPROGRESS;