diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-04-20 16:58:35 -0700 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-04-21 15:00:44 -0700 |
commit | 822eb164a15ae746c5a8c514f581fb47200fe463 (patch) | |
tree | afe98dd998d830294471dfe5c1d8ccc5d267bc2e | |
parent | f8ee8042f5a53acd3dd39251b42a8cee716c97fe (diff) |
libwimaxll: add wimaxll_ifidx() to report the interface index the handle refers to
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
-rw-r--r-- | include/wimaxll.h | 1 | ||||
-rw-r--r-- | lib/wimax.c | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/wimaxll.h b/include/wimaxll.h index 5396c16..c2469f2 100644 --- a/include/wimaxll.h +++ b/include/wimaxll.h @@ -308,6 +308,7 @@ void *wimaxll_priv_get(struct wimaxll_handle *); void wimaxll_priv_set(struct wimaxll_handle *, void *); void wimaxll_close(struct wimaxll_handle *); const char *wimaxll_ifname(const struct wimaxll_handle *); +unsigned wimaxll_ifidx(const struct wimaxll_handle *); /* Wait for data from the kernel, execute callbacks */ int wimaxll_recv_fd(struct wimaxll_handle *); diff --git a/lib/wimax.c b/lib/wimax.c index d579d8c..83bc16e 100644 --- a/lib/wimax.c +++ b/lib/wimax.c @@ -272,6 +272,26 @@ const char *wimaxll_ifname(const struct wimaxll_handle *wmx) /** + * Return the interface index of the system's WiMAX interface + * associated to an open handle + * + * \param wmx WiMAX device handle + * \return Interface index + * + * Note that if this is an \e any interface (open for all devices), + * this will vary. When not processing a callback, it will be + * zero. When processing a callback, this call will return the + * interface for which the callback was executed. + * + * \ingroup device_management + */ +unsigned wimaxll_ifidx(const struct wimaxll_handle *wmx) +{ + return wmx->ifidx; +} + + +/** * Set the private data associated to a WiMAX device handle * * @param wmx WiMAX device handle |