summaryrefslogtreecommitdiffstats
path: root/loader/modules.h
blob: ab3e1b280cb22ed0af51864ddd7b3935ac4f084c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef H_MODULES
#define H_MODULES

#include "isys/isys.h"

typedef struct moduleList_s * moduleList;
typedef struct moduleDependency_s * moduleDeps;

struct loadedModuleInfo {
    char * name;
    char ** args;
    int weLoaded;
    int written;
    char * path;
    int firstDevNum, lastDevNum;	/* only used for ethernet currently */
    enum driverMajor major;
    enum driverMinor minor;
};

struct moduleList_s {
    struct loadedModuleInfo mods[50];
    int numModules;
};


int mlReadLoadedList(moduleList * list);
void mlFreeList(moduleList list);
int mlLoadDeps(moduleDeps * moduleDepList, const char * path);
moduleDeps mlNewDeps(void);

int mlLoadModuleSet(const char * origModNames, moduleList modLoaded, 
		    moduleDeps modDeps, moduleInfoSet modInfo, 
		    int flags);

int mlLoadModule(const char * origModNames, moduleList modLoaded, 
		    moduleDeps modDeps, char ** args, moduleInfoSet modInfo, 
		    int flags);

char ** mlGetDeps(moduleDeps modDeps, const char * modName);
int mlModuleInList(const char * modName, moduleList list);
int mlWriteConfModules(moduleList list, int fd);

int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded,
			     int flags);
int reloadUnloadedModule(char * modName, void * location, 
			 moduleList modLoaded, char ** args, int flags);

#endif