/*
* libkmod - interface to kernel module operations
*
- * Copyright (C) 2011-2012 ProFUSION embedded systems
+ * Copyright (C) 2011-2013 ProFUSION embedded systems
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#pragma once
#ifndef _LIBKMOD_H_
#define _LIBKMOD_H_
void *kmod_get_userdata(const struct kmod_ctx *ctx);
void kmod_set_userdata(struct kmod_ctx *ctx, const void *userdata);
+const char *kmod_get_dirname(const struct kmod_ctx *ctx);
/*
* Management of libkmod's resources
KMOD_INDEX_MODULES_DEP = 0,
KMOD_INDEX_MODULES_ALIAS,
KMOD_INDEX_MODULES_SYMBOL,
+ KMOD_INDEX_MODULES_BUILTIN_ALIAS,
KMOD_INDEX_MODULES_BUILTIN,
/* Padding to make sure enum is not mapped to char */
- _KMOD_INDEX_PAD = (1 << 31),
+ _KMOD_INDEX_PAD = 1U << 31,
};
int kmod_dump_index(struct kmod_ctx *ctx, enum kmod_index type, int fd);
/* Removal flags */
enum kmod_remove {
KMOD_REMOVE_FORCE = O_TRUNC,
- KMOD_REMOVE_NOWAIT = O_NONBLOCK,
+ KMOD_REMOVE_NOWAIT = O_NONBLOCK, /* always set */
};
/* Insertion flags */
/* codes below can be used in return value, too */
KMOD_PROBE_APPLY_BLACKLIST_ALL = 0x10000,
KMOD_PROBE_APPLY_BLACKLIST = 0x20000,
+ KMOD_PROBE_APPLY_BLACKLIST_ALIAS_ONLY = 0x40000,
+};
+
+/* Flags to kmod_module_apply_filter() */
+enum kmod_filter {
+ KMOD_FILTER_BLACKLIST = 0x00001,
+ KMOD_FILTER_BUILTIN = 0x00002,
};
int kmod_module_remove_module(struct kmod_module *mod, unsigned int flags);
int kmod_module_get_softdeps(const struct kmod_module *mod,
struct kmod_list **pre, struct kmod_list **post);
int kmod_module_get_filtered_blacklist(const struct kmod_ctx *ctx,
+ const struct kmod_list *input,
+ struct kmod_list **output) __attribute__ ((deprecated));
+int kmod_module_apply_filter(const struct kmod_ctx *ctx,
+ enum kmod_filter filter_type,
const struct kmod_list *input,
struct kmod_list **output);
KMOD_MODULE_COMING,
KMOD_MODULE_GOING,
/* Padding to make sure enum is not mapped to char */
- _KMOD_MODULE_PAD = (1 << 31),
+ _KMOD_MODULE_PAD = 1U << 31,
};
const char *kmod_module_initstate_str(enum kmod_module_initstate state);
int kmod_module_get_initstate(const struct kmod_module *mod);