summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-09-16 16:27:33 -0700
committerInaky Perez-Gonzalez <inaky@linux.intel.com>2009-09-16 16:27:33 -0700
commit8220dfa66ebd6f798222b1603754b23c52d1e675 (patch)
treef69cdd9f77b0a02bb981056c14cc996e52d74a7a
parentddda7f28e1fcd027241a9a3ac4b4a2bf4015f4c0 (diff)
libwimaxll: wimaxll_recv() understands multiple devices
When multiple WiMAX devices are present, messages will be sent by any. wimaxll_recv() needs to understand that a callback returning -ENODEV means that a message was received for another device, not for the one in the handle. Thus, it is not necessary to quit processing. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
-rw-r--r--lib/op-open.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/op-open.c b/lib/op-open.c
index 34874b0..7b7f8c5 100644
--- a/lib/op-open.c
+++ b/lib/op-open.c
@@ -115,6 +115,8 @@ static
*
* - >= 0 to indicate message processing should continue
* - -EBUSY to indicate message processing should stop
+ * - -ENODEV a message was received, but it was for another device,
+ * not the one this handle is listening to.
* - any other < 0 error code to indicate an error and that the
* message should be skipped.
*
@@ -243,6 +245,9 @@ ssize_t wimaxll_recv(struct wimaxll_handle *wmx)
result = nl_recvmsgs(wmx->nlh_rx, cb);
d_printf(3, wmx, "I: ctx.result %zd result %zd\n",
ctx.result, result);
+ /* if this was a message for another device, we skip it */
+ if (ctx.result == -ENODEV)
+ ctx.result = -EINPROGRESS;
} while ((ctx.result == -EINPROGRESS)
&& result > 0);
if (result < 0)