]> git.ipfire.org Git - thirdparty/kmod.git/blobdiff - libkmod/libkmod.h
Lookup aliases in the modules.builtin.modinfo
[thirdparty/kmod.git] / libkmod / libkmod.h
index 424640af33b93642ebef95f4b8b881c978cfc884..3cab2e521656d70aefad4d4933bd2fa2464d4a6c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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_
 
@@ -51,6 +51,7 @@ void kmod_set_log_priority(struct kmod_ctx *ctx, int priority);
 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
@@ -69,9 +70,10 @@ enum kmod_index {
        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);
 
@@ -139,7 +141,7 @@ struct kmod_module *kmod_module_get_module(const struct kmod_list *entry);
 /* Removal flags */
 enum kmod_remove {
        KMOD_REMOVE_FORCE = O_TRUNC,
-       KMOD_REMOVE_NOWAIT = O_NONBLOCK,
+       KMOD_REMOVE_NOWAIT = O_NONBLOCK, /* always set */
 };
 
 /* Insertion flags */
@@ -160,6 +162,13 @@ enum kmod_probe {
        /* 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);
@@ -183,6 +192,10 @@ struct kmod_list *kmod_module_get_dependencies(const struct kmod_module *mod);
 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);
 
@@ -199,7 +212,7 @@ enum kmod_module_initstate {
        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);