nl80211: use genl_ctrl_resolve()

Based on a patch for iw by Johannes Berg <johannes.berg@intel.com>

This simplifies the code quite a bit since we don't need
an nl_cache or nl_family anymore.

genl_ctrl_resolve() is available in libnl1.1, libnl2 and libnl3.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
This commit is contained in:
Thomas Graf
2011-11-10 17:34:59 +01:00
committed by Dan Williams
parent a2b1afb1e4
commit 9b05037c44
2 changed files with 4 additions and 25 deletions

View File

@@ -173,18 +173,6 @@ __nl_cache_include (struct nl_cache *cache, struct nl_object *obj, change_func_t
}
#define nl_cache_include __nl_cache_include
#include <netlink/genl/ctrl.h>
static inline int __genl_ctrl_alloc_cache(struct nl_sock *h, struct nl_cache **cache)
{
struct nl_cache *tmp = genl_ctrl_alloc_cache(h);
if (!tmp)
return -ENOMEM;
*cache = tmp;
return 0;
}
#define genl_ctrl_alloc_cache __genl_ctrl_alloc_cache
#define NLE_SUCCESS 0
#define NLE_FAILURE 1
#define NLE_INTR 2