summaryrefslogtreecommitdiff
path: root/lib/op-msg.c
AgeCommit message (Collapse)AuthorFilesLines
2009-04-21libwimaxll: introduce 'any' handles to receive callbacks from any deviceInaky Perez-Gonzalez1-1/+16
An 'any' handle is a handle opened with NULL as device name. No commands can be executed with it, but it will emit callbacks for any WiMAX device that would otherwise generate them for a handle opened for it exclusively. When the callback is executed, the handle is temporarily modified to contain the interface index for whom the callback is emitted, which can be recovered with wimaxll_ifidx(). The code modifications are quite minimal, mainly dealing with not allowing command execution and updating the handle's interface index before executing a callback. This code also adds a path in wimaxll_open() to allow opening an interface by interface index, by specifying "#NUMBER" (where NUMBER is the interface index). Errors to in some calls to libnl are better reported now. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2008-12-12libwimaxll: remove unused goto target in wimaxll_gnl_handle_msg_to_user()Inaky Perez-Gonzalez1-1/+0
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2008-12-12libwimaxll: rename wimaxll_gnl_cb_context to wimaxll_cb_ctxInaky Perez-Gonzalez1-4/+4
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>
2008-12-12libwimaxll: callbacks take "void *" priv pointersInaky Perez-Gonzalez1-23/+15
Change the callback model not to require a typed context and make it completely up to the application. The reason we had it before using an specific type that could be wrapped was that we had the callback pre-handler, when de-marshalled the arguments for the callback, to store in there the result of the demarshalling. However, that's kind of silly -- there is nothing the callback can do in case of error, as it doesn't even get called. So changed to just print an error message and return to wimaxll_gnl_cb(), which will just skip the bad netlink message. As part of this, we can move all the definitions of 'wimaxll_gnl_cb_context' to internal.h. Note as well that we cannot always set the context passed by wimaxll_recv(), as that'd mean -EBUSY from the user-set callbacks in wmx would leak to wimaxll_recv(), when their mission was to force nl_recvmsgs() to stop processing messages and return to wimaxll_recv()'s caller inmediately. So we need to consider -EBUSY as no error but just a code and in that case, consider that result is "zero". Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2008-12-10wimaxll_gnl_handle_message_to_user: return NL_SKIP on incorrect interface indexInaky Perez-Gonzalez1-2/+2
Skip the processing of this message if it is addressed to another interface and not the one this caller cares about. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2008-12-10libwimaxll: rename _cb_msg_to_user() -> _msg_read_cb()Inaky Perez-Gonzalez1-5/+5
This callback is used to implement wimaxll_msg_read() functionality, so the name match makes it easier to understand what it is for. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2008-12-10libwimaxll: fix policies for msg_to_user and re_state_changeInaky Perez-Gonzalez1-0/+6
Added missing policies to verify attr list in msg_to_user re_state_change Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2008-12-10libwimaxll: update documentation after pipe removalInaky Perez-Gonzalez1-58/+28
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2008-12-10libwimax: move to address interfaces by attribute (vs by family)Inaky Perez-Gonzalez1-153/+131
Commnunity review asked to move the whole genl schema to addess interfaces by ifindex contained in an attribute on each message. Doing so made it almost impossible to keep the models we had with a single family per interface, so huge rework ensued: - remove pipes and all their APIs: no longer makes sense to have one mcast group per pipe, so this is no longer needed. - create the pipe concept by adding a "pipe name" to the message. Default pipe has no name; as a side benefit, all the pipes are now bidirectional. - side benefit: greatly simplify the msg vs pipe vs mc_rx interface: there is only one interface now, wimax_msg_*() and it contains just a few functions. - Delete all the usage of multicast groups and multicast groups handles - Declare two handles, one for reading notifications, one for writing (eases the work) All in all, this cuts a lot of code; on the bad side, we loose the perfect isolation we had before, where only whoever was listening for something was ever woken up. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2008-12-05libwimax: remove deprecated interfaceInaky Perez-Gonzalez1-15/+0
2008-12-05libwimaxll: use genl controller instead of op-open and rp-ifinfoInaky Perez-Gonzalez1-2/+1
The generic netlink controller can provide all the information needed for listing the multicast groups, so use that instead of the WiMAX stack provided one, which has been removed.
2008-11-20Import v1.3.93Inaky Perez-Gonzalez1-0/+565